/* Tesla-Rabatt-Check.de — "Faktencheck" design system (see _chain/07-design.md).
   Newsprint grey + ink, red "Mythos" / green "Fakt" stamps, Zilla Slab headings, margin labels. */

@font-face {
  font-family: "Zilla Slab";
  font-style: normal;
  font-weight: 700;
  font-display: optional; /* no late swap → no reflow */
  src: url(/assets/fonts/zilla-slab-700-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --fc-paper: #eceae3;
  --fc-sheet: #f6f5f0;
  --fc-ink: #17171b;
  --fc-ink-2: #45454d;
  --fc-rule: #17171b;
  --fc-hair: #c9c6bb;
  --fc-myth: #b0231a;
  --fc-fact: #17663a;
  --fc-open: #8a5a00;
  --fc-focus: #1849c6;
  --fc-link: #17171b;
  --fc-slab: "Zilla Slab", "Rockwell", "Roboto Slab", Georgia, serif;
  --fc-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fc-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fc-s1: 4px; --fc-s2: 8px; --fc-s3: 12px; --fc-s4: 16px; --fc-s5: 24px; --fc-s6: 32px; --fc-s7: 48px; --fc-s8: 72px;
  --fc-measure: 42rem;
  --fc-marg: 8.5rem;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fc-paper: #15161a; --fc-sheet: #1d1f24; --fc-ink: #ecebe6; --fc-ink-2: #b9b8b2; --fc-rule: #ecebe6;
    --fc-hair: #3a3c43; --fc-myth: #ff8a7f; --fc-fact: #6fd39a; --fc-open: #f0c060; --fc-focus: #8fb0ff; --fc-link: #ecebe6;
  }
}
:root[data-theme="dark"] {
  --fc-paper: #15161a; --fc-sheet: #1d1f24; --fc-ink: #ecebe6; --fc-ink-2: #b9b8b2; --fc-rule: #ecebe6;
  --fc-hair: #3a3c43; --fc-myth: #ff8a7f; --fc-fact: #6fd39a; --fc-open: #f0c060; --fc-focus: #8fb0ff; --fc-link: #ecebe6;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fc-paper);
  color: var(--fc-ink);
  font: 400 1.0625rem/1.62 var(--fc-sans);
  overflow-wrap: break-word;
  hyphens: auto;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--fc-link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--fc-focus); outline-offset: 2px; }
h1, h2, h3, .slab { font-family: var(--fc-slab); font-weight: 700; line-height: 1.15; letter-spacing: -0.005em; hyphens: manual; }
h1 { font-size: clamp(2.1rem, 7vw, 3.5rem); margin: 0 0 var(--fc-s4); }
h2 { font-size: clamp(1.45rem, 3.6vw, 1.9rem); margin: 0 0 var(--fc-s3); }
h3 { font-size: 1.22rem; margin: var(--fc-s5) 0 var(--fc-s2); }
p, ul, ol, dl, table { margin: 0 0 var(--fc-s4); }
ul, ol { padding-left: 1.3rem; }
li { margin-bottom: var(--fc-s1); }
small, .srcline { font-size: 0.86rem; color: var(--fc-ink-2); }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--fc-ink); color: var(--fc-paper); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 16px; }

/* ---------- chrome: masthead + in-chrome strip (persistent surface) */
.chrome { position: sticky; top: 0; z-index: 20; background: var(--fc-paper); }
.mast { border-bottom: 2px solid var(--fc-rule); }
/* slim independence line above the masthead (trademark guardrail) — static text, wraps at 360px */
.mast__ind { margin: 0; border-bottom: 1px solid var(--fc-hair); font-family: var(--fc-sans); font-size: 0.74rem; line-height: 1.3; letter-spacing: 0.04em; color: var(--fc-ink-2); }
.mast__ind .wrap { display: block; padding-top: 3px; padding-bottom: 3px; overflow-wrap: anywhere; }
.mast__in { position: relative; display: flex; align-items: center; gap: var(--fc-s3); min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-family: var(--fc-slab); font-weight: 700; font-size: 1.12rem; white-space: nowrap; }
.brand__mark { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 2px solid var(--fc-ink); font-size: 0.8rem; letter-spacing: -1px; transform: rotate(-4deg); }
.brand__name span { color: var(--fc-myth); }
.mainnav { margin-left: auto; min-width: 0; }
.mainnav ul { list-style: none; margin: 0; padding: 0; }
.mainnav a { text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.mainnav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; }
.mainnav__d { display: none; }
.mainnav__m summary { cursor: pointer; font-weight: 700; padding: 8px 10px; border: 2px solid var(--fc-ink); list-style: none; }
.mainnav__m summary::-webkit-details-marker { display: none; }
.mainnav__m[open] ul { position: absolute; left: 0; right: 0; top: 100%; background: var(--fc-sheet); border-bottom: 2px solid var(--fc-rule); padding: 8px 16px 12px; z-index: 30; }
.mainnav__m li { margin: 0; }
.mainnav__m a { display: block; padding: 10px 0; border-bottom: 1px solid var(--fc-hair); }
.navact { flex: none; font-weight: 700; font-size: 0.92rem; text-decoration: none; padding: 7px 10px; background: var(--fc-ink); color: var(--fc-paper); white-space: nowrap; }
.navact:hover { background: var(--fc-fact); }
@media (min-width: 900px) {
  .mainnav__m { display: none; }
  .mainnav__d { display: flex; gap: 18px; }
}

.strip { border-bottom: 1px solid var(--fc-hair); background: var(--fc-sheet); font-size: 0.88rem; }
.strip__in { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.strip__txt { margin: 0; flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.strip__disc { color: var(--fc-ink-2); }
.strip .rbtn { padding: 5px 9px; font-size: 0.85rem; min-height: 32px; }
@media (max-width: 520px) { .strip { font-size: 0.8rem; } .strip .rbtn--open { display: none; } }
/* phones: the outbound button folds away (copy stays); the disclosure always stays visible */

/* ---------- buttons */
.rbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 9px 14px; border: 2px solid var(--fc-ink); background: var(--fc-ink); color: var(--fc-paper);
  font: 700 0.95rem/1.1 var(--fc-sans); text-decoration: none; cursor: pointer; border-radius: 0;
}
.rbtn:hover { background: var(--fc-fact); border-color: var(--fc-fact); color: #fff; }
.rbtn--open, .rbtn--ghost { background: transparent; color: var(--fc-ink); }
.rbtn--open:hover, .rbtn--ghost:hover { background: var(--fc-ink); color: var(--fc-paper); border-color: var(--fc-ink); }
.rbtn--copy [data-rfc-state] { display: inline-block; min-width: 9.5ch; text-align: center; }
.rbtn[data-state="done"] { background: var(--fc-fact); border-color: var(--fc-fact); color: #fff; }
.rbtn[data-state="fail"] { background: var(--fc-myth); border-color: var(--fc-myth); color: #fff; }

/* ---------- the rotating code: fixed box → zero CLS */
.rcode {
  display: inline-block; width: 19ch; height: 2.1em; line-height: 2.1em; padding: 0 8px; vertical-align: middle;
  font: 700 0.98rem var(--fc-mono); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 2px solid var(--fc-ink); background: var(--fc-paper); text-align: center;
}

/* ---------- referral units */
.refunit { border: 2px solid var(--fc-ink); background: var(--fc-sheet); padding: var(--fc-s5); margin: var(--fc-s6) 0; position: relative; }
.refunit__kicker { margin: 0 0 4px; font: 700 0.78rem var(--fc-sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fc-fact); }
.refunit__h { font-size: 1.45rem; margin-bottom: var(--fc-s2); }
.refunit__h3 { font-family: var(--fc-slab); font-weight: 700; font-size: 1.15rem; margin: 0 0 var(--fc-s2); }
.refunit__lead, .refunit__benefit { max-width: var(--fc-measure); }
.refunit__stand { font-size: 0.85rem; color: var(--fc-ink-2); white-space: nowrap; }
.refunit__row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: var(--fc-s3) 0; }
.refunit__row > * { min-width: 0; }
.refunit__codewrap { display: inline-flex; flex-direction: column; gap: 2px; }
.refunit__codekey { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fc-ink-2); }
.refunit__url { font-size: 0.86rem; color: var(--fc-ink-2); min-height: 2.8em; margin-bottom: var(--fc-s2); }
.rlabel { font-family: var(--fc-mono); overflow-wrap: anywhere; word-break: break-all; hyphens: none; color: var(--fc-ink); }
.disc { font-size: 0.84rem; color: var(--fc-ink-2); margin: 0; }
.refunit--foot { margin: var(--fc-s6) 0 var(--fc-s5); padding: var(--fc-s4); }

/* ---------- page head: question + verdict + jump list */
.page { padding-top: var(--fc-s6); padding-bottom: var(--fc-s7); }
.qhead { border-bottom: 2px solid var(--fc-rule); padding-bottom: var(--fc-s5); margin-bottom: var(--fc-s5); }
.qhead__kicker { font: 700 0.8rem var(--fc-sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--fc-ink-2); margin-bottom: var(--fc-s2); }
.verdict { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 0 0 var(--fc-s4); }
.verdict__stamp {
  display: inline-block; font: 700 clamp(1.6rem, 6vw, 2.4rem)/1 var(--fc-slab); text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--fc-myth); border: 4px solid var(--fc-myth); padding: 6px 14px 4px; transform: rotate(-3deg);
}
.verdict__line { font-family: var(--fc-slab); font-weight: 700; font-size: clamp(1.2rem, 3.4vw, 1.5rem); margin: 0; max-width: 32rem; }
.lede { font-size: 1.14rem; max-width: var(--fc-measure); }
.meta { font-size: 0.86rem; color: var(--fc-ink-2); }
.jump { counter-reset: q; list-style: none; padding: 0; margin: var(--fc-s5) 0 0; display: grid; gap: 0; border-top: 1px solid var(--fc-hair); }
.jump li { margin: 0; border-bottom: 1px solid var(--fc-hair); }
.jump a { display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 8px; padding: 10px 0; text-decoration: none; font-weight: 600; }
.jump a:hover span:last-child { text-decoration: underline; }
.jump .n { font-family: var(--fc-slab); color: var(--fc-ink-2); }
@media (min-width: 760px) { .jump { grid-template-columns: 1fr 1fr; column-gap: 32px; } }

/* ---------- Q&A section: margin label + body */
.qa { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; padding: var(--fc-s6) 0; border-top: 2px solid var(--fc-rule); }
.marg { display: flex; align-items: center; gap: 10px; }
.qnum { font: 700 1.6rem/1 var(--fc-slab); color: var(--fc-ink-2); }
.qbody { min-width: 0; max-width: var(--fc-measure); }
@media (min-width: 900px) {
  .qa { grid-template-columns: var(--fc-marg) minmax(0, 1fr); gap: var(--fc-s6); }
  .marg { flex-direction: column; align-items: flex-start; gap: 12px; padding-top: 4px; }
  .qnum { font-size: 2.4rem; }
}
.short { border-left: 4px solid var(--fc-ink); padding-left: 12px; font-size: 1.08rem; }

/* stamps */
.stamp {
  display: inline-block; font: 700 0.78rem/1 var(--fc-slab); text-transform: uppercase; letter-spacing: 0.1em;
  padding: 5px 7px 4px; border: 2px solid currentColor; border-radius: 2px; transform: rotate(-2deg); white-space: nowrap;
}
.stamp--myth { color: var(--fc-myth); }
.stamp--fact { color: var(--fc-fact); }
.stamp--open { color: var(--fc-open); }

/* myth → fact pairs */
.claims { margin: var(--fc-s4) 0; }
.claim { border-top: 1px solid var(--fc-hair); padding: var(--fc-s3) 0; }
.claim dt, .claim dd { margin: 0; display: grid; grid-template-columns: 6.2rem minmax(0, 1fr); gap: 10px; align-items: start; }
.claim dt { margin-bottom: 6px; color: var(--fc-ink-2); }
.claim dt span:last-child { text-decoration: line-through; text-decoration-color: var(--fc-myth); text-decoration-thickness: 1.5px; }

/* callouts */
.note { border-left: 4px solid var(--fc-open); padding: 4px 0 4px 12px; margin: var(--fc-s4) 0; }
.warn { border: 2px solid var(--fc-myth); padding: var(--fc-s4); margin: var(--fc-s4) 0; }
.warn > :last-child, .note > :last-child { margin-bottom: 0; }
.steps { counter-reset: st; list-style: none; padding: 0; }
.steps > li { counter-increment: st; position: relative; padding-left: 2.6rem; margin-bottom: var(--fc-s3); }
.steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 1.9rem; height: 1.9rem; display: grid; place-items: center; border: 2px solid var(--fc-ink); font: 700 0.95rem var(--fc-slab); }
.check { list-style: none; padding: 0; }
.check li { padding-left: 1.8rem; position: relative; }
.check li::before { content: "☐"; position: absolute; left: 0; font-size: 1.1rem; line-height: 1.4; }

/* ---------- ledger (stacking table) */
.ledger-wrap { overflow-x: auto; margin: var(--fc-s4) 0; border-top: 2px solid var(--fc-rule); }
.ledger { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.ledger th, .ledger td { text-align: left; vertical-align: top; padding: 10px 8px; border-bottom: 1px solid var(--fc-hair); }
.ledger thead th { font-family: var(--fc-slab); font-size: 0.95rem; border-bottom: 2px solid var(--fc-rule); }
.ledger tbody th { font-family: var(--fc-slab); font-size: 1.02rem; }
@media (max-width: 760px) {
  .ledger, .ledger tbody, .ledger tr, .ledger th, .ledger td { display: block; width: 100%; }
  .ledger thead { position: absolute; left: -9999px; }
  .ledger tr { border-bottom: 2px solid var(--fc-rule); padding: var(--fc-s3) 0; }
  .ledger td, .ledger tbody th { border: 0; padding: 4px 0; }
  .ledger td::before { content: attr(data-l) ": "; font-weight: 700; }
}

/* ---------- diagrams */
.fig { margin: var(--fc-s5) 0; }
.fig svg { display: block; width: 100%; height: auto; }
.fig figcaption { font-size: 0.9rem; color: var(--fc-ink-2); margin-top: var(--fc-s2); }
.fig .t { font: 600 15px var(--fc-sans); fill: var(--fc-ink); }
.fig .ts { font: 400 13px var(--fc-sans); fill: var(--fc-ink-2); }
.fig .tb { font: 700 16px var(--fc-slab); fill: var(--fc-ink); }
.fig .bx { fill: var(--fc-sheet); stroke: var(--fc-ink); stroke-width: 2; }
.fig .ln { stroke: var(--fc-ink); stroke-width: 2; fill: none; }
.fig .ok { fill: none; stroke: var(--fc-fact); stroke-width: 3; }
.fig .no { fill: none; stroke: var(--fc-myth); stroke-width: 3; }
.fig .okt { fill: var(--fc-fact); font: 700 13px var(--fc-slab); }
.fig .not { fill: var(--fc-myth); font: 700 13px var(--fc-slab); }

/* ---------- breadcrumbs, sources, lists of posts */
.crumbs ol { list-style: none; padding: 0; margin: 0 0 var(--fc-s4); display: flex; flex-wrap: wrap; gap: 6px; font-size: 0.88rem; }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--fc-ink-2); }
.sources { font-size: 0.93rem; }
.sources li { margin-bottom: var(--fc-s2); }
.postlist { list-style: none; padding: 0; border-top: 2px solid var(--fc-rule); }
.postlist li { padding: var(--fc-s4) 0; border-bottom: 1px solid var(--fc-hair); }
.postlist h2, .postlist h3 { font-size: 1.3rem; margin: 0 0 6px; }
.next { border-top: 2px solid var(--fc-rule); margin-top: var(--fc-s6); padding-top: var(--fc-s4); }
.placeholder { border: 3px solid var(--fc-open); padding: var(--fc-s4); background: var(--fc-sheet); }

/* ---------- footer */
.foot { border-top: 4px double var(--fc-rule); padding-bottom: var(--fc-s6); font-size: 0.93rem; }
.foot__cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--fc-s5); }
.foot__brand { font-family: var(--fc-slab); font-weight: 700; font-size: 1.15rem; margin-bottom: 6px; }
.foot__legal { color: var(--fc-ink-2); font-size: 0.85rem; }
.foot ul { list-style: none; padding: 0; }
@media (min-width: 760px) { .foot__cols { grid-template-columns: 2fr 1fr; } }

/* ---------- consent (only rendered when GA4 is configured) */
.consent { position: fixed; left: 12px; bottom: 12px; max-width: 26rem; z-index: 40; background: var(--fc-sheet); border: 2px solid var(--fc-ink); padding: 12px; font-size: 0.9rem; }
.consent p { margin-bottom: 8px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
@media print { .chrome, .refunit, .foot .refunit, .consent { display: none; } }

/* very small phones: stack the brand, drop the mark, keep all three header controls on one row */
@media (max-width: 400px) {
  .brand__mark { display: none; }
  .brand { font-size: 1rem; line-height: 1.05; white-space: normal; }
  .brand__name span { display: block; }
  .mast__in { gap: 8px; }
  .navact { padding: 7px 8px; font-size: 0.86rem; }
  .mainnav__m summary { padding: 7px 8px; }
}
.qhead + .qa, .qhead + section.qa { border-top: 0; }
.ledger tbody th { hyphens: manual; min-width: 8.5rem; overflow-wrap: normal; }
@media (max-width: 760px) { .ledger tbody th { min-width: 0; } }
