/*
 * Werkbank-Tokens für wunderdoc.de.
 * Quelle: WunderdocCore/Sources/AppFeatures/WerkbankPalette.swift (App-Repo, Stand main 07baa42, 03.12.2026),
 * kopiert, nicht verlinkt. Web-Ergänzungen (nur Website) sind als solche markiert.
 * Die Blöcke mit „@theme …“ liest tests/contrast.mjs; Namen und Werte nur paarweise ändern.
 */

/* @theme light */
:root {
  color-scheme: light;
  --surface: #FCFCFD;
  --surface-sunken: #F4F4F5;
  --surface-raised: #FFFFFF;
  --surface-card: #FFFFFF;
  --panel: #F4F4F5;
  --canvas: #EEEEF0;
  --row-selected: #EDEDF0;
  --field-fill: #FFFFFF;
  --ink: #18181B;
  --ink-nav: #27272A;
  --ink-secondary: #3F3F46;
  --ink-tertiary: #52525B;
  --line: #E4E4E7;
  --line-strong: #D4D4D8;
  --field-border: #8E8E96;
  --control-border: #84848C;
  --ok: #0B7A53;
  --ok-soft: #D5F0E2;
  --review: #7A4100;
  --review-soft: #FFF5E0;
  --review-border: #E0B45C;
  --review-strong: #A86400;
  --review-choice: #FFFBF2;
  --review-choice-border: #B58A3A;
  --review-text: #5C3600;
  --danger: #B42318;
  --danger-soft: #FEF3F2;
  --primary-fill: #18181B;
  --on-primary: #FFFFFF;
  /* Web-Ergänzung: Hover des Primärknopfs (inkNav) und Fokusring (ink) */
  --primary-hover: #27272A;
  --focus: #18181B;
  --shadow-float: 0 1px 2px rgb(0 0 0 / 0.12), 0 12px 32px -16px rgb(0 0 0 / 0.18);
}
/* @end */

/* @theme dark */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --surface: #111113;
    --surface-sunken: #0C0C0E;
    --surface-raised: #1F1F23;
    --surface-card: #151518;
    --panel: #18181B;
    --canvas: #09090A;
    --row-selected: #1F1F23;
    --field-fill: #0C0C0E;
    --ink: #EDEDEF;
    --ink-nav: #D4D4D8;
    --ink-secondary: #C4C4CC;
    --ink-tertiary: #A1A1AA;
    --line: #27272A;
    --line-strong: #3F3F46;
    --field-border: #62626B;
    --control-border: #75757E;
    --ok: #3DD68C;
    --ok-soft: #12301F;
    --review: #F2C063;
    --review-soft: #2E230C;
    --review-border: #6E5216;
    --review-strong: #E0A534;
    --review-choice: #231A08;
    --review-choice-border: #8A6A24;
    --review-text: #F6D38A;
    --danger: #F97066;
    --danger-soft: #2D1210;
    --primary-fill: #EDEDEF;
    --on-primary: #111113;
    --primary-hover: #C4C4CC;
    --focus: #EDEDEF;
    --shadow-float: 0 0 0 1px #3F3F46;
  }
}
/* @end */

/* Gleiche Werte bei aktiver Wahl „Dunkel“ (data-theme setzt theme-init.js bzw. theme-switch.js). */
/* @theme dark */
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface: #111113;
  --surface-sunken: #0C0C0E;
  --surface-raised: #1F1F23;
  --surface-card: #151518;
  --panel: #18181B;
  --canvas: #09090A;
  --row-selected: #1F1F23;
  --field-fill: #0C0C0E;
  --ink: #EDEDEF;
  --ink-nav: #D4D4D8;
  --ink-secondary: #C4C4CC;
  --ink-tertiary: #A1A1AA;
  --line: #27272A;
  --line-strong: #3F3F46;
  --field-border: #62626B;
  --control-border: #75757E;
  --ok: #3DD68C;
  --ok-soft: #12301F;
  --review: #F2C063;
  --review-soft: #2E230C;
  --review-border: #6E5216;
  --review-strong: #E0A534;
  --review-choice: #231A08;
  --review-choice-border: #8A6A24;
  --review-text: #F6D38A;
  --danger: #F97066;
  --danger-soft: #2D1210;
  --primary-fill: #EDEDEF;
  --on-primary: #111113;
  --primary-hover: #C4C4CC;
  --focus: #EDEDEF;
  --shadow-float: 0 0 0 1px #3F3F46;
}
/* @end */

/* „Kontrast erhöhen“: highContrastLight/Dark aus WerkbankPalette.swift. */
/* @theme light-hc */
@media (prefers-contrast: more) {
  :root {
    --line: #A1A1AA;
    --line-strong: #71717A;
    --field-border: #52525B;
    --control-border: #52525B;
    --ink-tertiary: #3F3F46;
    --ink-secondary: #27272A;
    --review-border: #A86400;
    --review-choice-border: #7A4100;
  }
}
/* @end */

/* @theme dark-hc */
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --line: #52525B;
    --line-strong: #71717A;
    --field-border: #A1A1AA;
    --control-border: #A1A1AA;
    --ink-tertiary: #C4C4CC;
    --ink-secondary: #E4E4E7;
    --review-border: #E0A534;
    --review-choice-border: #E0A534;
  }
}
/* @end */

/* @theme dark-hc */
@media (prefers-contrast: more) {
  :root[data-theme="dark"] {
    --line: #52525B;
    --line-strong: #71717A;
    --field-border: #A1A1AA;
    --control-border: #A1A1AA;
    --ink-tertiary: #C4C4CC;
    --ink-secondary: #E4E4E7;
    --review-border: #E0A534;
    --review-choice-border: #E0A534;
  }
}
/* @end */

:root {
  /* Web-Ergänzung: Briefpapier der Demo bleibt in beiden Modi hell (wie eine Seite in der App-Vorschau). */
  --paper: #FFFFFF;
  --paper-ink: #18181B;
  --paper-ink-2: #3F3F46;
  --paper-line: #D4D4D8;
  --paper-mark: #EDEDF0;
  --paper-mark-line: #52525B;
  /* Radien 4/6/8 wie die App; Pillenform nur für Status-Chips. */
  --r-4: 4px;
  --r-6: 6px;
  --r-8: 8px;
  --font-sans: "Geist", "Geist Fallback", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --header-h: 60px;
  --container: 1160px;
  --gutter: 16px;
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }
}

/* wunderdoc.de – Seitenstil „Werkbank“. Farben nur über Tokens (tokens.css), keine Inline-Stile. */

/* ---------- Schriften (selbst gehostet, SIL OFL 1.1, siehe /fonts/OFL.txt) ---------- */
@font-face { font-family: "Geist"; src: url("/fonts/Geist-Regular.otf?v=674ccb412b") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist"; src: url("/fonts/Geist-SemiBold.otf?v=e7516c6998") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Regular.otf?v=f0d0ab7618") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/GeistMono-Medium.otf?v=bcb73d3fca") format("opentype"); font-weight: 500; font-style: normal; font-display: swap; }
/* Ersatzschriften mit angepasster Breite, damit beim Nachladen nichts springt. */
@font-face { font-family: "Geist Fallback"; src: local("Arial"), local("Helvetica"); size-adjust: 104%; ascent-override: 92%; descent-override: 22%; }
@font-face { font-family: "Geist Mono Fallback"; src: local("Menlo"), local("Courier New"); size-adjust: 100%; }

/* ---------- Grundlagen ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "ss01" 0;
  overflow-wrap: break-word;
}
img, video { max-width: 100%; height: auto; display: block; }
::selection { background: var(--row-selected); color: var(--ink); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; color: var(--ink); }
h1 { font-size: clamp(38px, 5.5vw, 60px); line-height: 1.05; letter-spacing: -0.03em; }
h2 { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.12; letter-spacing: -0.02em; }
h3 { font-size: 19px; line-height: 1.3; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code, .mono, kbd, samp, pre { font-family: var(--font-mono); }
code { font-size: 0.9em; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-4); padding: 0.05em 0.35em; }
strong { font-weight: 600; }
ul, ol { padding-left: 1.25em; margin: 0 0 1em; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-4); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100; padding: 10px 14px;
  background: var(--primary-fill); color: var(--on-primary); border-radius: var(--r-6); font-weight: 600;
}
.skip-link:focus { top: 10px; outline-color: var(--on-primary); outline-offset: -4px; }

/* Nur mit bzw. ohne JavaScript (Klasse „js“ setzt theme-init.js). */
html:not(.js) [data-js-only] { display: none !important; }
html.js [data-nojs-only] { display: none !important; }

/* ---------- Bausteine ---------- */
.eyebrow { display: block; font-family: var(--font-mono); font-size: 13px; font-weight: 500; line-height: 1.4; letter-spacing: 0.01em; color: var(--ink-tertiary); margin-bottom: 14px; }
.lead { font-size: clamp(17px, 1.5vw, 19px); line-height: 1.55; color: var(--ink-secondary); max-width: 62ch; }
.small, small { font-size: 14px; line-height: 1.5; }
.muted { color: var(--ink-secondary); }
.meta { font-family: var(--font-mono); font-size: 13px; font-weight: 500; line-height: 1.4; letter-spacing: 0.01em; color: var(--ink-tertiary); }

.status-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface-raised); color: var(--ink-secondary);
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; line-height: 1.4;
}
.status-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-tertiary); flex: none; }

/* Hauptaufruf vor der Veröffentlichung: Statusetikett, kein (deaktivierter) Knopf. */
.cta-status {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 14px;
  border: 1px dashed var(--control-border); border-radius: var(--r-6); background: var(--surface-raised);
  color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.2;
}
.cta-status .dot { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--ink-secondary); flex: none; }
.cta-status-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border-radius: var(--r-6); border: 1px solid var(--control-border); background: var(--surface-raised); color: var(--ink);
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--row-selected); text-decoration: none; }
.btn-primary { background: var(--primary-fill); color: var(--on-primary); border-color: var(--primary-fill); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-primary:focus-visible { outline-color: var(--focus); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.link-arrow { font-weight: 600; }

/* Tastenkappen: Fläche surfaceRaised, Rahmen controlBorder, 1 px Unterkante. */
kbd, .keycap {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.9em; padding: 0.12em 0.45em;
  border: 1px solid var(--control-border); border-bottom-width: 2px; border-radius: var(--r-4);
  background: var(--surface-raised); color: var(--ink); font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  line-height: 1.35; white-space: nowrap; vertical-align: 0.08em;
}
kbd.is-pressed, .is-hot kbd { background: var(--primary-fill); color: var(--on-primary); border-color: var(--primary-fill); }
.btn-primary kbd { background: transparent; color: var(--on-primary); border-color: var(--on-primary); }

/* Herkunft und Sicherheit: nie nur Farbe – Text plus Symbol. */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: var(--r-4);
  font-family: var(--font-mono); font-size: 13px; font-weight: 500; line-height: 1.4; letter-spacing: 0.01em;
  border: 1px solid transparent; white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ink); }
.badge-ok .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.badge-review { background: var(--review-soft); color: var(--review); border-color: var(--review-border); }
.badge-review .sym { font-weight: 600; }
.badge-origin { background: var(--panel); color: var(--ink-secondary); border-color: var(--line); }

/* ---------- Kopfleiste ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; color: var(--ink); }
.wordmark img { width: 28px; height: 28px; }
.site-nav { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.nav-anchors { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-anchors a { display: inline-block; padding: 8px 10px; color: var(--ink-nav); font-size: 15px; text-decoration: none; border-radius: var(--r-4); }
.nav-anchors a:hover { background: var(--row-selected); }
.nav-anchors a[aria-current="true"], .nav-anchors a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.header-tools { display: flex; align-items: center; gap: 12px; }
.lang-link { font-family: var(--font-mono); font-size: 13px; font-weight: 500; padding: 8px 6px; }
.nav-toggle { display: none; }

/* Erscheinungsbild: System / Hell / Dunkel als Radiogruppe */
.theme-switch { display: inline-flex; border: 1px solid var(--control-border); border-radius: var(--r-6); padding: 2px; margin: 0; min-width: 0; background: var(--surface-sunken); }
.theme-switch legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.theme-switch label { position: relative; display: inline-flex; align-items: center; min-height: 32px; padding: 4px 10px; border-radius: var(--r-4); font-size: 13px; color: var(--ink-secondary); cursor: pointer; }
.theme-switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.theme-switch input:checked + span { color: var(--ink); font-weight: 600; }
.theme-switch label:has(input:checked) { background: var(--surface-raised); box-shadow: 0 0 0 1px var(--control-border); }
.theme-switch label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }

@media (max-width: 1099px) {
  .nav-toggle {
    display: inline-flex; margin-left: auto; align-items: center; gap: 8px; min-height: 40px; padding: 8px 12px;
    border: 1px solid var(--control-border); border-radius: var(--r-6); background: var(--surface-raised); color: var(--ink);
    font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  }
  .nav-toggle .bars { width: 16px; height: 10px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; position: relative; }
  .nav-toggle .bars::after { content: ""; position: absolute; left: 0; right: 0; top: 2px; border-top: 2px solid currentColor; }
  html.js .site-nav { display: none; }
  html.js .site-nav.is-open { display: flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 16px;
    padding: 16px var(--gutter) 24px; background: var(--surface); border-bottom: 1px solid var(--line); margin: 0;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  html:not(.js) .site-nav { position: static; padding: 8px 0 16px; border: 0; }
  html:not(.js) .header-inner { flex-wrap: wrap; }
  .nav-anchors { flex-direction: column; }
  .nav-anchors a { display: block; padding: 10px 8px; }
  .header-tools { flex-wrap: wrap; }
}

/* ---------- Abschnitte ---------- */
.section { padding: 48px 0 52px; border-top: 1px solid var(--line); }
.section-alt { background: var(--surface-sunken); }
.section-head { margin-bottom: 28px; max-width: 900px; }
.section-head .lead { max-width: 74ch; }
.section-head h2 { margin-bottom: 12px; }
@media (max-width: 767px) {
  .section { padding: 48px 0; }
  .section-head { margin-bottom: 28px; }
}

/* Hero */
.hero { padding: 56px 0 72px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; align-items: start; }
.hero-copy { padding-top: 24px; }
.hero h1 { margin: 20px 0 20px; }
.hero .lead { margin-bottom: 28px; }
.req-line { margin-top: 24px; }
@media (max-width: 1023px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .hero-copy { padding-top: 0; }
}
@media (max-width: 767px) { .hero { padding: 40px 0 64px; } }

/* So geht's */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.step { border-top: 1px solid var(--line-strong); padding-top: 20px; }
.step-num { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--ink-tertiary); display: block; margin-bottom: 10px; }
.step h3 { margin-bottom: 8px; }
.step-illus { margin-top: 14px; }
@media (max-width: 767px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* Feldzeilen (Herkunft je Feld, Demo) */
.field-rows { margin: 0; display: grid; gap: 0; }
.field-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.field-row:first-child { border-top: 1px solid var(--line); }
.field-row dt { color: var(--ink-tertiary); font-size: 14px; }
.field-row dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.fv { font-family: var(--font-mono); font-size: 14px; color: var(--ink); }

.origin-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 20px 28px; }
.origin-list li { display: grid; gap: 8px; justify-items: start; align-content: start; }
.origin-note { margin-top: 28px; padding: 16px 18px; border: 1px solid var(--line-strong); border-radius: var(--r-8); background: var(--panel); }

/* Karten */
.cards-2, .cards-3 { display: grid; gap: 20px; }
.cards-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1023px) { .cards-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) { .cards-2, .cards-3 { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--surface-card); border: 1px solid var(--line-strong); border-radius: var(--r-8); padding: 20px 22px; }
.card h3 { margin-bottom: 8px; }
.card .meta { margin-bottom: 10px; display: block; }
.card ul { margin: 12px 0 0; padding-left: 1.1em; }
.card-choice { position: relative; }
.card-choice .choice-mark { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1px solid var(--control-border); border-radius: 50%; margin-bottom: 12px; }
.card-choice .choice-mark::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.leaves { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--ink-secondary); }
.prep-line { margin-top: 24px; color: var(--ink-secondary); }
.prep-line .status-chip { margin-right: 8px; }

/* Reiter „Die App“ */
.tablist { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tab {
  appearance: none; border: 0; background: transparent; color: var(--ink-secondary); font: inherit; font-size: 15px;
  padding: 10px 14px; min-height: 40px; border-radius: var(--r-6) var(--r-6) 0 0; cursor: pointer; position: relative;
}
.tab:hover { background: var(--row-selected); color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--ink); }
.media-figure { margin: 0; display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.media-figure .stage { padding: clamp(8px, 1.6vw, 20px); }
.media-figure[hidden] { display: none; }
.media-figure + .media-figure { margin-top: 40px; }
html.js .tabs .media-figure + .media-figure { margin-top: 0; }
.media-figure figcaption { display: grid; gap: 8px; align-content: start; }
.media-figure figcaption h3 { margin: 0; }
@media (max-width: 1023px) { .media-figure { grid-template-columns: minmax(0, 1fr); gap: 16px; } }
.stage { background: var(--canvas); border: 1px solid var(--line); border-radius: var(--r-8); padding: clamp(12px, 3vw, 32px); }
.stage img, .stage video { border-radius: var(--r-6); box-shadow: var(--shadow-float); width: 100%; }
.sample-note { font-size: 14px; color: var(--ink-secondary); margin-top: 16px; }

/* Bild- und Videovarianten hell/dunkel folgen dem wirksamen Erscheinungsbild. */
.v-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .v-light { display: none; }
  :root:not([data-theme="light"]) .v-dark { display: block; }
}
:root[data-theme="dark"] .v-light { display: none; }
:root[data-theme="dark"] .v-dark { display: block; }

/* Videos */
.steps-details { margin-top: 4px; border-top: 1px solid var(--line); padding-top: 10px; }
.steps-details summary { cursor: pointer; font-weight: 600; font-size: 15px; min-height: 24px; }
.tour .steps-alt { margin: 10px 0 0; padding-left: 1.3em; font-size: 15px; color: var(--ink-secondary); }
.tour .steps-alt li { margin-bottom: 4px; }


/* Recht & Anwälte */
.legal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; align-items: start; }
.panel { background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-8); padding: 24px; }
.path { display: block; font-family: var(--font-mono); font-size: 14px; color: var(--ink); background: var(--surface-raised); border: 1px solid var(--line); border-radius: var(--r-4); padding: 10px 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-review { display: flex; gap: 10px; align-items: flex-start; margin-top: 16px; padding: 12px 14px; border: 1px solid var(--review-border); background: var(--review-soft); color: var(--review-text); border-radius: var(--r-6); font-size: 15px; }
.note-review .sym { color: var(--review); font-weight: 600; font-family: var(--font-mono); }
.plain-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.plain-list li { padding-left: 18px; position: relative; }
.plain-list li::before { content: ""; position: absolute; left: 0; top: 0.75em; width: 8px; height: 1px; background: var(--ink-tertiary); }
@media (max-width: 1023px) { .legal-grid { grid-template-columns: minmax(0, 1fr); } }

/* Privatsphäre */
.privacy-panel { background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-8); padding: clamp(20px, 3vw, 32px); }
.flow { list-style: none; margin: 0 0 24px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; counter-reset: flow; }
.flow li { flex: 1 1 150px; background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--r-6); padding: 12px 14px; position: relative; counter-increment: flow; }
.flow li::before { content: counter(flow, decimal-leading-zero); display: block; font-family: var(--font-mono); font-size: 13px; color: var(--ink-tertiary); margin-bottom: 4px; }
.flow strong { display: block; }
.flow span { font-size: 14px; color: var(--ink-secondary); }
.connections { max-width: 760px; }
.connections h3 { margin-bottom: 12px; }
.connections p { margin-bottom: 12px; }
.site-statement { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line-strong); }

/* Code mit Kopierknopf */
.codeblock { position: relative; background: var(--surface-raised); border: 1px solid var(--line-strong); border-radius: var(--r-8); margin: 16px 0; }
.codeblock pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 14px; line-height: 1.7; color: var(--ink); }
.codeblock pre .prompt { color: var(--ink-tertiary); user-select: none; }
.codeblock .code-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); }
.codeblock .code-bar .meta { margin: 0; }
.copy-btn { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.copy-status { font-family: var(--font-mono); font-size: 13px; color: var(--ink-secondary); min-height: 1.4em; }
.oss-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.oss-grid .codeblock { margin-top: 0; }
.oss-guide { margin-top: 16px; }
.oss-line { margin-top: 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.oss-byline { margin-top: 8px; }
@media (max-width: 1023px) { .oss-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

/* FAQ */
.faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; align-items: start; }
.faq details:nth-child(-n+2) { border-top: 1px solid var(--line); }
@media (max-width: 1023px) { .faq { grid-template-columns: minmax(0, 1fr); } .faq details:nth-child(2) { border-top: 0; } }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; position: relative; font-weight: 600; font-size: 17px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 8px; top: 16px; font-family: var(--font-mono); font-size: 20px; color: var(--ink-secondary); }
.faq details[open] summary::after { content: "–"; }
.faq .answer { padding: 0 0 20px; color: var(--ink-secondary); max-width: 70ch; }
.faq .answer strong { color: var(--ink); }

/* Abschluss: Fläche primaryFill, invertierte Knöpfe, Fokus in onPrimary */
.final { background: var(--primary-fill); color: var(--on-primary); padding: 56px 0; }
.final h2, .final a { color: var(--on-primary); }
.final .lead { color: var(--on-primary); }
.final code { background: transparent; color: var(--on-primary); border-color: var(--on-primary); }
.final .meta { color: var(--on-primary); }
.final :focus-visible { outline-color: var(--on-primary); }
.final .cta-status { background: var(--on-primary); color: var(--primary-fill); border-color: var(--primary-fill); border-style: solid; }
.final .cta-status .dot { border-color: var(--primary-fill); }
.final .btn { background: var(--primary-fill); color: var(--on-primary); border-color: var(--on-primary); }
.final .btn:hover { background: var(--primary-hover); }
.final .btn-row { margin: 28px 0 20px; }

/* Fußzeile */
.site-footer { background: var(--surface-sunken); border-top: 1px solid var(--line); padding: 56px 0 40px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.footer-grid h2 { font-size: 15px; letter-spacing: 0; margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.footer-grid li a { display: inline-flex; align-items: center; min-height: 28px; }
.footer-claim { font-weight: 600; font-size: 17px; margin-bottom: 12px; }
.footer-meta { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
@media (max-width: 767px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Unterseiten ---------- */
.page-head { padding: 64px 0 40px; border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(34px, 4.5vw, 48px); margin: 12px 0 16px; }
.prose { max-width: 760px; padding: 48px 0 96px; }
.prose h2 { font-size: clamp(22px, 2.4vw, 26px); margin: 48px 0 14px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 28px 0 10px; }
.prose p, .prose li { color: var(--ink-secondary); }
.prose strong { color: var(--ink); }
.prose address { font-style: normal; font-family: var(--font-mono); font-size: 15px; line-height: 1.7; color: var(--ink); padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-6); background: var(--panel); display: inline-block; }
.notice { padding: 14px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-6); background: var(--panel); color: var(--ink-secondary); margin-bottom: 32px; }
.install-steps { counter-reset: st; list-style: none; padding: 0; margin: 0; }
.install-steps > li { counter-increment: st; position: relative; padding: 0 0 32px 48px; border-left: 1px solid var(--line-strong); margin-left: 14px; }
.install-steps > li:last-child { border-left-color: transparent; }
.install-steps > li::before { content: counter(st, decimal-leading-zero); position: absolute; left: -15px; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-raised); border: 1px solid var(--control-border); font-family: var(--font-mono); font-size: 12px; }
.install-steps h2 { margin: 0 0 10px; font-size: 21px; }
.shortcut-table { width: 100%; border-collapse: collapse; margin: 16px 0 8px; }
.shortcut-table caption { text-align: left; font-weight: 600; font-size: 19px; padding: 0 0 12px; color: var(--ink); }
.shortcut-table th, .shortcut-table td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.shortcut-table thead th { font-size: 14px; color: var(--ink-tertiary); font-weight: 600; border-bottom-color: var(--line-strong); }
.shortcut-table td:first-child { white-space: nowrap; width: 9em; }
.shortcut-table .app-label { display: block; font-family: var(--font-mono); font-size: 13px; color: var(--ink-tertiary); }
.not-found { padding: 96px 0; }
.not-found .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
@media (max-width: 767px) { .not-found .cols { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Interaktive Demo „Eingang“ ---------- */
.demo { position: relative; }
.demo-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.demo-head h2 { font-size: 17px; letter-spacing: 0; }
.demo-window { background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-8); box-shadow: var(--shadow-float); overflow: hidden; }
.demo-window:focus-visible { outline-offset: 3px; }
.demo-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface); min-height: 44px; }
.demo-bar .title { font-weight: 600; font-size: 14px; }
.demo-inbox { display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--surface-sunken); border-bottom: 1px solid var(--line); min-height: 40px; font-size: 14px; }
.demo-inbox .label { color: var(--ink-tertiary); font-size: 13px; }
.demo-item { font-family: var(--font-mono); font-size: 13px; padding: 2px 8px; border-radius: var(--r-4); background: var(--row-selected); color: var(--ink); }
.demo-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); min-height: 380px; }
.demo-preview { background: var(--canvas); padding: 16px; border-right: 1px solid var(--line); display: flex; align-items: flex-start; justify-content: center; }
.demo-empty { color: var(--ink-tertiary); font-size: 14px; align-self: center; text-align: center; }
.letter {
  background: var(--paper); color: var(--paper-ink); width: 100%; max-width: 340px; min-height: 100%; padding: 18px 18px 16px;
  border-radius: 2px; box-shadow: 0 1px 2px rgb(0 0 0 / 0.14), 0 8px 20px -10px rgb(0 0 0 / 0.25);
  font-size: 13px; line-height: 1.45; overflow-wrap: anywhere;
}
/* Papier bleibt in beiden Modi weiß wie eine echte Seite (Tokens --paper*). */
.letter p { margin: 0 0 6px; }
.letter .l-sender { font-weight: 600; font-size: 14px; border-bottom: 1px solid var(--paper-line); padding-bottom: 6px; margin-bottom: 10px; }
.letter .l-to { margin-bottom: 10px; }
.letter .l-date { text-align: right; }
.letter .l-subject { font-weight: 600; font-size: 14px; margin: 8px 0; }
.letter .l-ref { font-family: var(--font-mono); }
.letter mark { background: transparent; color: inherit; border-radius: 2px; transition: background-color 0.3s, box-shadow 0.3s; }
.demo mark.find.is-found, .demo:not([data-state]) mark.find { background: var(--paper-mark); box-shadow: inset 0 -2px 0 var(--paper-mark-line); }
.demo-inspector { padding: 6px 14px 14px; display: flex; flex-direction: column; background: var(--surface); min-width: 0; }
.demo .field-row { grid-template-columns: 76px minmax(0, 1fr); padding: 8px 0; gap: 2px 10px; }
.demo .field-row:first-child { border-top: 0; }
.demo .field-row dt { font-size: 13px; }
.demo .fv { font-size: 13px; }
.demo .badge { font-size: 13px; padding: 1px 6px; white-space: normal; }
.demo .fv-empty { color: var(--ink-tertiary); font-family: var(--font-mono); font-size: 13px; }
.demo .field-row:not(.is-filled) .fv, .demo .field-row:not(.is-filled) .badge { display: none; }
.field-row.is-filled .fv-empty { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .demo .field-row.is-filled .fv, .demo .field-row.is-filled .badge { animation: wd-in 0.25s ease-out; }
}
@keyframes wd-in { from { opacity: 0; transform: translateY(2px); } to { opacity: 1; transform: none; } }
.area-group { margin: 8px 0 4px; padding: 10px 12px; border: 1px solid var(--review-border); background: var(--review-soft); border-radius: var(--r-6); }
.area-group .ag-title { display: flex; align-items: center; gap: 6px; color: var(--review); font-size: 13px; font-weight: 600; margin-bottom: 8px; font-family: var(--font-mono); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 4px 10px 4px 6px; border-radius: var(--r-6);
  border: 1px solid var(--review-choice-border); background: var(--review-choice); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer;
}
.choice[aria-pressed="true"] { border-color: var(--review-strong); box-shadow: inset 0 0 0 1px var(--review-strong); font-weight: 600; }
.choice kbd { min-width: 1.6em; }
.demo-actions { margin-top: auto; padding-top: 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; }
.demo-actions .btn { min-height: 38px; }
.demo-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 14px; border-top: 1px solid var(--line); background: var(--surface-sunken); min-height: 44px; font-size: 14px; }
.demo-status .st-text { flex: 1 1 200px; color: var(--ink-secondary); }
.demo-status .st-text strong { color: var(--ink); }
.demo-status .btn { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.demo-archive { padding: 16px 14px 20px; min-height: 380px; }
.demo-archive label { display: block; font-size: 13px; color: var(--ink-tertiary); margin-bottom: 6px; }
.search-field { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--field-border); border-radius: var(--r-6); background: var(--field-fill); color: var(--ink); font-family: var(--font-mono); font-size: 15px; }
.search-field:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.results { list-style: none; margin: 14px 0 0; padding: 0; }
.result { padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--r-6); background: var(--surface-raised); display: grid; gap: 4px; }
.result .r-title { font-weight: 600; }
.result mark { background: var(--row-selected); color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink-tertiary); border-radius: 2px; }
.result .path { font-size: 13px; padding: 6px 8px; white-space: normal; overflow-wrap: anywhere; }
.no-result { margin-top: 14px; color: var(--ink-secondary); font-size: 14px; }
.demo-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.demo-note { margin-top: 12px; font-size: 14px; color: var(--ink-secondary); }
.demo-hint { font-size: 14px; color: var(--ink-secondary); margin-top: 6px; }

/* Sichtbarkeit je Zustand (data-state setzt demo.js; ohne JS bleibt der statische Zustand 5 sichtbar). */
.demo .demo-archive { display: none; }
.demo .t-archive { display: none; }
.demo[data-state="7"] .t-archive { display: inline; }
.demo[data-state="7"] .t-review { display: none; }
.demo[data-state="7"] .demo-archive { display: block; }
.demo[data-state="7"] .demo-body { display: none; }
.demo[data-state="0"] .letter, .demo[data-state="0"] .demo-item { display: none; }
.demo:not([data-state="0"]) .demo-empty, .demo:not([data-state]) .demo-empty { display: none; }
.demo .area-group { display: none; }
.demo[data-state="4"] .area-group, .demo[data-state="5"] .area-group { display: block; }
.demo[data-state="4"] .field-row[data-field="area"], .demo[data-state="5"] .field-row[data-field="area"] { display: none; }
.demo .st-filed, .demo .st-ready, .demo .st-idle, .demo .st-review { display: none; }
.demo[data-state="0"] .st-idle, .demo[data-state="1"] .st-idle, .demo[data-state="2"] .st-idle, .demo[data-state="3"] .st-idle { display: inline; }
.demo[data-state="4"] .st-review { display: inline; }
.demo[data-state="5"] .st-ready, .demo:not([data-state]) .st-ready { display: inline; }
.demo[data-state="6"] .st-filed, .demo[data-state="7"] .st-filed { display: inline; }
.demo .st-actions { display: none; }
.demo[data-state="6"] .st-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.demo .demo-count { display: none; }
.demo[data-state="3"] .demo-count, .demo[data-state="4"] .demo-count { display: inline-flex; }
.demo .c-ready { display: none; }
.demo[data-state="5"] .c-ready, .demo:not([data-state]) .c-ready { display: inline-flex; }
.demo[data-state="5"] .submit-key kbd, .demo:not([data-state]) .submit-key kbd { background: var(--on-primary); color: var(--primary-fill); }
.demo [data-ctl] { display: none; }
.demo[data-state="0"] [data-ctl="start"], .demo[data-state="7"] [data-ctl="again"] { display: inline-flex; }
.demo[data-state] [data-ctl="all"] { display: inline-flex; }
.demo[data-state="5"] [data-ctl="all"], .demo[data-state="6"] [data-ctl="all"], .demo[data-state="7"] [data-ctl="all"] { display: none; }
.demo .submit-row { display: flex; }
.demo[data-state="0"] .submit-row, .demo[data-state="1"] .submit-row, .demo[data-state="2"] .submit-row, .demo[data-state="3"] .submit-row, .demo[data-state="6"] .submit-row { display: none; }
.k-other { display: none; }
html.non-mac .demo .k-mac { display: none; }
html.non-mac .demo .k-other { display: inline; }
@media (max-width: 767px) {
  .badge { white-space: normal; }
  .demo-body { grid-template-columns: minmax(0, 1fr); }
  .demo-preview { border-right: 0; border-bottom: 1px solid var(--line); }
  .kbd-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Hochkontrast / erzwungene Farben ---------- */
@media (forced-colors: active) {
  .badge, .status-chip, .cta-status, .choice, kbd, .card, .panel, .demo-window, .letter, .result { border: 1px solid CanvasText; forced-color-adjust: auto; }
  .badge-ok .dot, .cta-status .dot, .status-chip .dot { background: CanvasText; border-color: CanvasText; }
  .tab[aria-selected="true"]::after { background: Highlight; }
  .letter mark.find, .result mark { outline: 1px solid Highlight; }
}

/* ---------- Druck (Tastatur-Seite) ---------- */
@media print {
  .site-header, .site-footer, .skip-link, .final { display: none !important; }
  body { background: var(--paper); color: var(--paper-ink); }
  .page-head { padding: 0 0 16px; }
  .prose { padding: 16px 0; max-width: none; }
  kbd { border-color: var(--paper-ink); }
}

/* Feinschliff */
.codeblock code { background: none; border: 0; padding: 0; font-size: inherit; }
.final h2 { margin-bottom: 16px; }
.final code { white-space: nowrap; }
.plain-list { margin-bottom: 16px; }
.legal-grid .meta { margin-top: 16px; }
/* Tastensymbole (⌘ ⏎ ⌥ …) fehlen in Geist Mono: direkt auf die Systemschrift ausweichen, nicht auf Menlo. */
kbd, .keycap { font-family: "Geist Mono", system-ui, -apple-system, "Segoe UI Symbol", sans-serif; }
