/* m-niggemann.de – Stylesheet */
:root {
  --bg: #f5f3ee;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --ink: #1d2733;
  --ink-soft: #4d5a69;
  --line: #d9dde3;
  --navy: #12406f;
  --navy-deep: #0b2a4a;
  --accent: #b8692a;
  --accent-ink: #ffffff;
  --ok: #2d7a46;
  --err: #b3261e;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 56, .06), 0 6px 20px rgba(16, 32, 56, .07);
  --maxw: 1180px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161d; --surface: #19212b; --surface-2: #1f2935; --ink: #e6ebf1; --ink-soft: #a9b4c1;
    --line: #2c3846; --navy: #6fa8e6; --navy-deep: #0a1a2c; --accent: #e08a45; --accent-ink: #1b1208;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--font); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { line-height: 1.25; margin: 1.6em 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); margin-top: 0; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.skip, .sr-only { position: absolute; left: -9999px; }
mark { background: #fde68a; color: #1d2733; padding: 0 3px; border-radius: 3px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--navy-deep); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.site-header .wrap { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.brand:hover { color: #fff; }
.brand svg.logo { height: 44px; overflow: visible; width: auto; aspect-ratio: 26.93 / 17.64; flex: none; color: #fff; }
.brand > span { white-space: nowrap; }
.brand small { display: block; font-weight: 400; font-size: .72rem; opacity: .75; letter-spacing: .04em; text-transform: uppercase; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a, .nav button.dd { color: #dfe8f3; text-decoration: none; padding: 8px 12px; border-radius: 8px; font: inherit; font-size: .95rem; background: none; border: 0; cursor: pointer; }
.nav a:hover, .nav button.dd:hover, .nav .open > button.dd { background: rgba(255,255,255,.1); color: #fff; }
.nav a[aria-current="page"], .nav .active > button.dd { color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
.nav .cta { background: var(--accent); color: var(--accent-ink); font-weight: 600; margin-left: 6px; }
.nav .cta:hover { background: #cf7a35; color: #fff; }
.nav .cta .count { display: inline-block; min-width: 1.4em; padding: 0 .35em; margin-left: .35em; border-radius: 99px; background: rgba(255,255,255,.9); color: var(--navy-deep); font-size: .8em; text-align: center; }
.nav .cta .count:empty { display: none; }
.lang-switch { display: flex; gap: 2px; margin-left: 10px; flex: none; }
.lang-switch a { color: #dfe8f3; text-decoration: none; font-size: .8rem; font-weight: 600; padding: 5px 7px; border-radius: 6px; }
.lang-switch a:hover { background: rgba(255,255,255,.1); color: #fff; }
.lang-switch a[aria-current] { color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }
@media (max-width: 480px) {
  .site-header .wrap { gap: 8px; padding: 0 16px; }
  .brand { gap: 8px; font-size: .95rem; }
  .brand small { display: none; }
  .brand svg.logo { height: 30px; }
  .menu-btn { padding: 6px 10px; font-size: .9rem; }
  .lang-switch { margin-left: 0; }
  .lang-switch a { padding: 5px; }
}
.has-sub { position: relative; }
.has-sub .sub { display: none; position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; }
.has-sub.open .sub { display: block; }
.has-sub .sub a { display: block; color: var(--ink); padding: 8px 12px; }
.has-sub .sub a:hover { background: var(--surface-2); color: var(--navy); }
.menu-btn { display: none; margin-left: auto; background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; border-radius: 8px; padding: 8px 12px; font: inherit; cursor: pointer; }
@media (max-width: 960px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 64px; flex-direction: column; align-items: stretch; background: var(--navy-deep); padding: 8px 16px 16px; gap: 2px; max-height: calc(100vh - 64px); overflow: auto; }
  .nav.open { display: flex; }
  .nav a, .nav button.dd { text-align: left; width: 100%; }
  .has-sub .sub { position: static; display: block; background: transparent; border: 0; box-shadow: none; padding: 0 0 0 14px; }
  .has-sub .sub a { color: #c9d6e4; }
  .has-sub .sub a:hover { background: rgba(255,255,255,.08); color: #fff; }
  .nav button.dd { pointer-events: none; opacity: .7; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; }
  .nav .cta { margin: 8px 0 0; text-align: center; }
}

/* Hero */
.hero { background: radial-gradient(1200px 500px at 85% 20%, rgba(184,105,42,.25), transparent 60%), linear-gradient(160deg, var(--navy-deep), #12406f 70%); color: #fff; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; padding-top: 56px; padding-bottom: 56px; }
.hero h1 { color: #fff; }
.hero p.lead { font-size: 1.15rem; color: #d8e3ef; max-width: 36em; }
.hero .eyebrow { color: #f0b27a; }
.hero-img { border-radius: var(--radius); overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.35); }
.hero-img img { width: 100%; }
.blueprint { background-color: var(--navy-deep); background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 28px 28px; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; padding-top: 36px; padding-bottom: 36px; } }

.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: var(--accent); margin: 0 0 .6em; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .08s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #cf7a35; color: #fff; }
.btn-ghost { border-color: currentColor; color: inherit; background: transparent; }
.btn-ghost:hover { background: rgba(127,127,127,.12); color: inherit; }
.btn-small { padding: 8px 14px; font-size: .92rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Sections */
main { display: block; }
.section { padding: 56px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 28px; }
.section-head h2 { margin-top: 0; }
.page-head { padding-top: 36px; padding-bottom: 8px; }
.page-head .lead { font-size: 1.12rem; color: var(--ink-soft); max-width: 46em; }
.crumbs { font-size: .88rem; color: var(--ink-soft); margin-bottom: 14px; }
.crumbs a { color: var(--ink-soft); }
.crumbs span[aria-hidden] { margin: 0 6px; opacity: .6; }

/* Cards */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; text-decoration: none; color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
a.card:hover { transform: translateY(-3px); color: inherit; box-shadow: 0 2px 4px rgba(16,32,56,.08), 0 14px 30px rgba(16,32,56,.12); }
.card .thumb { aspect-ratio: 3 / 2; background: #fff; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); position: relative; }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.card .thumb.photo img { object-fit: cover; padding: 0; }
.card .thumb img.foto { position: absolute; right: 8px; bottom: 8px; width: 34%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; padding: 0; border: 2px solid #fff; border-radius: 6px; box-shadow: 0 1px 5px rgba(16, 32, 56, .35); transition: width .25s ease, height .25s ease, right .25s ease, bottom .25s ease, border-radius .25s ease; }
@media (hover: hover) { a.card:hover .thumb img.foto, a.card:focus-visible .thumb img.foto { right: 0; bottom: 0; width: 100%; height: 100%; aspect-ratio: auto; border-width: 0; border-radius: 0; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .card .thumb img.foto { transition: none; } }
.card .thumb .tag { z-index: 1; }
.card .thumb.foto-gross img:not(.foto) { height: auto; aspect-ratio: 3 / 2; }
.card .thumb img.foto.zeichnung { object-fit: contain; background: #fff; padding: 3px; }
@media (hover: hover) { a.card:hover .thumb img.foto.zeichnung, a.card:focus-visible .thumb img.foto.zeichnung { padding: 10px; } }
.card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { margin: 0; font-size: 1.08rem; }
.card .sub { color: var(--ink-soft); font-size: .93rem; }
.card .meta { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; font-size: .92rem; }
.price { font-weight: 700; color: var(--navy); white-space: nowrap; }
.tag { position: absolute; top: 10px; left: 10px; background: var(--navy); color: #fff; font: 600 .72rem/1 var(--mono); padding: 5px 7px; border-radius: 6px; }
.tag.new { left: auto; right: 10px; background: var(--accent); color: var(--accent-ink); font-family: var(--font); letter-spacing: .05em; }

.feature-list { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); counter-reset: step; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.feature h3 { margin: 0 0 6px; font-size: 1.08rem; }
.feature p { margin: 0; color: var(--ink-soft); }
.feature .num { counter-increment: step; display: inline-flex; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); color: #fff; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 10px; }
.feature .num::before { content: counter(step); }

.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 26px; }
.cat-nav a { padding: 7px 14px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: .93rem; }
.cat-nav a:hover { border-color: var(--navy); color: var(--navy); }

/* Prose / Artikel */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; padding-bottom: 64px; }
.layout.single { grid-template-columns: minmax(0, 1fr); }
.wrap.narrow { max-width: 920px; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }
.prose { min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose h3 { color: var(--navy); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .25em 0; }
.prose .figure, .prose .gallery { margin: 22px 0; }
.prose .figure a, .gallery a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.prose .figure a { width: fit-content; max-width: 100%; margin: 0 auto; }
.gallery { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.gallery a { aspect-ratio: 4 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.gallery.contain img { object-fit: contain; padding: 6px; }
.gallery.tall a { aspect-ratio: 414 / 586; }
.gallery.tall img.whole { object-fit: contain; }
.gallery a:hover img { transform: scale(1.03); }
.table-wrap { overflow-x: auto; margin: 18px 0; }
table.data { border-collapse: collapse; width: 100%; font-size: .94rem; background: var(--surface); }
table.data td, table.data th { border: 1px solid var(--line); padding: 7px 10px; text-align: left; vertical-align: top; }
table.data tr:first-child td { background: var(--surface-2); font-weight: 600; }
.note { border-left: 4px solid var(--accent); background: var(--surface); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 20px 0; }
.note.warn { border-color: var(--err); }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 22px 0; }
.toc h3 { margin: 0 0 8px; font-size: 1rem; color: var(--ink); }
.toc ol, .toc ul { margin: 0; }
.factbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 22px 0; }
.factbox h3 { margin: 0 0 8px; font-size: 1rem; color: var(--ink); }
.factbox dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 18px; margin: 0; font-size: .95rem; }
.factbox dt { color: var(--ink-soft); }
.factbox dd { margin: 0; }

/* Modell-Seite */
.model-hero { display: grid; grid-template-columns: 1.2fr 1fr; gap: 32px; align-items: center; padding: 8px 0 32px; }
.model-hero .img { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.model-hero .img img { width: 100%; max-height: 460px; object-fit: contain; }
@media (max-width: 860px) { .model-hero { grid-template-columns: 1fr; } }
.planbox { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.planbox h2 { margin: 0 0 4px; font-size: 1.2rem; }
.planbox .hint { font-size: .86rem; color: var(--ink-soft); margin: 0 0 14px; }
.offer { border-top: 1px solid var(--line); padding: 14px 0; }
.offer:last-of-type { padding-bottom: 4px; }
.offer-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.offer-head strong { font-size: .98rem; }
.offer p { font-size: .88rem; color: var(--ink-soft); margin: 4px 0 8px; }
.offer details { font-size: .88rem; margin: 6px 0 10px; }
.offer summary { cursor: pointer; color: var(--navy); }
.offer details ul { margin: 6px 0 0; padding-left: 1.1em; font-family: var(--mono); font-size: .8rem; line-height: 1.55; }
.add-btn[aria-pressed="true"] { background: var(--ok); color: #fff; }
.add-btn[aria-pressed="true"]::before { content: "✓ "; }
.planbox .go { display: block; margin-top: 14px; text-align: center; }
.checks { list-style: none; padding: 0; margin: 0 0 14px; font-size: .9rem; }
.checks li { padding-left: 1.5em; position: relative; margin: 4px 0; }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--ok); font-weight: 700; }
.plan-list { columns: 2 260px; font-family: var(--mono); font-size: .86rem; padding-left: 1.1em; }

/* Bestellen */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 36px; align-items: start; padding-bottom: 64px; }
@media (max-width: 1000px) { .order-layout { grid-template-columns: 1fr; } }
.order-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 20px; }
.order-filter input[type=search] { flex: 1 1 240px; }
.order-group { margin-bottom: 34px; }
.order-group h2 { font-size: 1.25rem; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.order-model { display: grid; grid-template-columns: 110px 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.order-model .pic { background: #fff; border-radius: 8px; border: 1px solid var(--line); aspect-ratio: 3/2; display: flex; }
.order-model .pic img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.order-model h3 { margin: 0; font-size: 1.02rem; }
.order-model h3 a { color: inherit; text-decoration: none; }
.order-model h3 a:hover { color: var(--navy); text-decoration: underline; }
.order-model .sub { font-size: .9rem; color: var(--ink-soft); }
.order-items { list-style: none; margin: 8px 0 0; padding: 0; }
.order-item { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px dashed var(--line); }
.order-item:first-child { border-top: 0; }
.order-item label { cursor: pointer; font-size: .95rem; }
.order-item .badge { font-size: .72rem; background: var(--surface-2); color: var(--ink-soft); border-radius: 6px; padding: 2px 6px; margin-left: 6px; vertical-align: middle; white-space: nowrap; }
.order-item input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); }
@media (max-width: 560px) { .order-model { grid-template-columns: 1fr; } .order-model .pic { max-width: 220px; } }
.summary { position: sticky; top: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.summary h2 { margin: 0 0 10px; font-size: 1.2rem; }
.summary .empty { color: var(--ink-soft); font-size: .93rem; }
.sel-list { list-style: none; margin: 0 0 10px; padding: 0; font-size: .92rem; }
.sel-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.sel-list button { background: none; border: 0; color: var(--ink-soft); cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 2px 4px; }
.sel-list button:hover { color: var(--err); }
.total { display: flex; justify-content: space-between; font-weight: 700; margin: 8px 0 4px; }
.small { font-size: .84rem; color: var(--ink-soft); }

/* Formulare */
form .row { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { form .row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: .92rem; }
.field .opt { font-weight: 400; color: var(--ink-soft); }
input[type=text], input[type=email], input[type=search], input[type=tel], textarea, select {
  font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; width: 100%;
}
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(184,105,42,.45); outline-offset: 1px; border-color: var(--accent); }
textarea { min-height: 130px; resize: vertical; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; margin: 6px 0 16px; }
.consent input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }
.form-status { margin-top: 14px; padding: 12px 14px; border-radius: 9px; display: none; }
.form-status.show { display: block; }
.form-status.ok { background: rgba(45,122,70,.12); color: var(--ok); border: 1px solid rgba(45,122,70,.35); }
.form-status.err { background: rgba(179,38,30,.08); color: var(--err); border: 1px solid rgba(179,38,30,.3); }
.form-status a { color: inherit; font-weight: 600; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) 1fr; gap: 36px; padding-bottom: 64px; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }

/* Footer */
.site-footer { background: var(--navy-deep); color: #c9d5e2; padding: 44px 0 26px; margin-top: 0; font-size: .94rem; }
.site-footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; }
@media (max-width: 820px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } }
.site-footer h3 { color: #fff; font-size: .95rem; margin: 0 0 10px; letter-spacing: .02em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 5px 0; }
.site-footer a { color: #c9d5e2; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .legal { border-top: 1px solid rgba(255,255,255,.12); margin-top: 30px; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: space-between; font-size: .86rem; }

/* Lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(8,14,22,.92); z-index: 200; display: none; align-items: center; justify-content: center; padding: 50px 60px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 50%; width: 46px; height: 46px; font-size: 1.5rem; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.25); }
.lightbox .lb-close { top: 14px; right: 14px; }
.lightbox .lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-count { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #c9d5e2; font-size: .88rem; }
@media (max-width: 600px) { .lightbox { padding: 60px 8px; } }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(120%); background: var(--navy-deep); color: #fff; padding: 12px 18px; border-radius: 10px; box-shadow: var(--shadow); z-index: 150; transition: transform .25s ease; font-size: .95rem; }
.toast.show { transform: translateX(-50%) translateY(0); }
.toast a { color: #f0b27a; font-weight: 600; margin-left: 8px; }

@media print {
  .site-header, .site-footer, .planbox .add-btn, .lightbox, .toast { display: none !important; }
  body { background: #fff; }
}

/* Formeln (MathML) */
math { font-family: "Cambria Math", "STIX Two Math", "Latin Modern Math", serif; font-size: 1.08em; }
.math { overflow-x: auto; overflow-y: hidden; margin: 14px 0 18px; padding: 4px 0; display: flex; align-items: center; justify-content: safe center; gap: 12px; }
.math math[display="block"] { margin: 0; }
.math.wrap { flex-wrap: wrap; row-gap: 8px; }
.math.wrap math { math-style: normal; }
.math.pair { column-gap: 56px; align-items: flex-start; }
.thumb-math { padding: 10px; color: var(--ink); }
.thumb-math .math { margin: 0; padding: 0; width: 100%; font-size: .84em; }
.thumb-math mtd { padding: .2em .1em; }
.math mtd { math-style: normal; padding: .25em .1em; }
.math mtd:first-child { text-align: right; }
.math mtd:last-child { text-align: left; }
.math .lbl { font-weight: 600; }
.factbox .math { margin: 8px 0 12px; }
table.data th { border: 1px solid var(--line); padding: 7px 10px; text-align: left; background: var(--surface-2); }
.task { border-left: 4px solid var(--navy); background: var(--surface); padding: 12px 18px; border-radius: 0 10px 10px 0; margin: 14px 0; }
.task > p:first-child { margin-bottom: 6px; }
.task details summary { cursor: pointer; color: var(--navy); font-weight: 600; font-size: .95rem; }
.task details[open] summary { margin-bottom: 6px; }
.task details > :last-child { margin-bottom: 0; }
.prose .mono { font-family: var(--mono); font-size: .92rem; }
.pascal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 10px; margin: 18px 0 22px; overflow-x: auto; font-variant-numeric: tabular-nums; }
.pascal > div { display: flex; justify-content: center; gap: 4px; position: relative; padding-left: 52px; padding-right: 52px; }
.pascal span { min-width: 2.4em; text-align: center; }
.pascal .n { position: absolute; left: 6px; min-width: 0; color: var(--ink-soft); font-size: .8rem; line-height: 1.65rem; font-style: italic; }
@media (max-width: 600px) { .math math { font-size: .92em; } }
.toc-numbered ul { list-style: none; padding: 0; margin: 0; }
.toc-numbered li { margin: .2em 0; }
.toc-numbered li.d1 { padding-left: 1.2em; }
.toc-numbered li.d2 { padding-left: 2.4em; }
.toc-numbered a, .toc-numbered li.off { display: grid; grid-template-columns: 3em 1fr; text-decoration: none; }
.toc-numbered a:hover { text-decoration: underline; }
.toc-numbered .nr { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.toc-numbered li.off { color: var(--ink-soft); }
.toc-numbered small { font-size: .8em; }
.prose h2[id], .prose h3[id], .prose h4[id] { scroll-margin-top: 90px; }

/* Programmlisting mit Erläuterungen daneben */
.code-explain { margin: 22px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.ce-row { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); }
.ce-row + .ce-row { border-top: 1px solid var(--line); }
.ce-row .explain { padding: 12px 16px; }
.ce-row .explain p { margin: 0; }
.ce-row .explain p + p { margin-top: .8em; }
pre.code { margin: 0; padding: 12px 16px; background: var(--surface-2); font-family: var(--mono); font-size: .8rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
pre.code code { font: inherit; }
@media (max-width: 760px) { .ce-row { grid-template-columns: minmax(0, 1fr); } }
