/* =====================================================================
   Contivana Designsystem · „Tannengrün auf Leinen“ · v0.1 (2026-10-15)
   Reines CSS, keine externen Quellen. Schriften selbst hosten (woff2):
   - Bricolage Grotesque  (Überschriften) · SIL Open Font License 1.1
   - Atkinson Hyperlegible Next (Text)    · SIL Open Font License 1.1
   - JetBrains Mono (Zahlen, Daten)       · SIL Open Font License 1.1
   Theme: <html data-theme="light|dark">, ohne Attribut folgt es dem System.
   ===================================================================== */

/* ---------- 1. Tokens: hell (Standard) ---------- */
:root, [data-theme="light"], .t-light {
  color-scheme: light;
  /* Flächen */
  --bg: #F3F2EE;            /* Leinen: Seitengrund */
  --surface: #FFFFFF;       /* Karten, Felder */
  --surface-2: #F8F7F4;     /* abgesetzte Bereiche */
  --surface-3: #ECEBE6;     /* Hover, Chips, Schienen */
  --overlay: rgba(20, 24, 22, .48);
  /* Text */
  --text: #1A1F1C;
  --text-muted: #565D59;
  --text-on-accent: #FFFFFF;
  /* Linien */
  --line: #DCDAD3;          /* Trennlinien (dekorativ) */
  --line-strong: #85837A;   /* Feldränder, 3:1 auf Grund */
  /* Akzent: Tannengrün */
  --accent: #1D5C49;
  --accent-hover: #164A3B;
  --accent-soft: #E1EEE8;
  --accent-text: #1D5C49;
  --focus: #1D5C49;
  /* Zustände: fg = Text/Symbol, bg = Fläche */
  --success: #1E6B3A;  --success-bg: #E2F0E6;
  --warning: #8A4A00;  --warning-bg: #FBEBD2;
  --danger:  #B42318;  --danger-bg:  #FBE5E2;  --danger-solid: #B42318; --on-danger: #FFFFFF;
  --info:    #1F5A8A;  --info-bg:    #E1ECF6;
  /* KI-Kennzeichnung (EU AI Act): Pflaume + gestrichelte Kante */
  --ki: #7A2E5C;       --ki-bg: #F5E5EE;
  /* Inhaltsstatus */
  --st-draft: #4D5450;      --st-draft-bg: #E9E8E3;
  --st-writing: #7A2E5C;    --st-writing-bg: #F5E5EE;
  --st-review: #8A4A00;     --st-review-bg: #FBEBD2;
  --st-scheduled: #1F5A8A;  --st-scheduled-bg: #E1ECF6;
  --st-published: #1E6B3A;  --st-published-bg: #E2F0E6;
  --st-failed: #B42318;     --st-failed-bg: #FBE5E2;
  /* Profilfarben (Monogramm, weiße Schrift ≥ 4.5:1) */
  --pf-1: #A8436B; --pf-2: #1F5A8A; --pf-3: #56661C; --pf-4: #6B4E2E;
  /* Flächenstufen: Schatten nur hell, dunkel arbeitet mit Helligkeit */
  --shadow-1: 0 1px 2px rgba(26, 31, 28, .06), 0 0 0 1px rgba(26, 31, 28, .04);
  --shadow-2: 0 4px 14px rgba(26, 31, 28, .08), 0 1px 3px rgba(26, 31, 28, .06);
  --shadow-3: 0 18px 48px rgba(26, 31, 28, .16), 0 2px 8px rgba(26, 31, 28, .08);
}

/* ---------- 1b. Tokens: dunkel ---------- */
[data-theme="dark"], .t-dark {
  color-scheme: dark;
  --bg: #111513; --surface: #181D1A; --surface-2: #1E2420; --surface-3: #262D29;
  --overlay: rgba(0, 0, 0, .62);
  --text: #E9ECE8; --text-muted: #A2AAA5; --text-on-accent: #0E211A;
  --line: #2E3531; --line-strong: #6B746F;
  --accent: #74CBA8; --accent-hover: #8FD8BA; --accent-soft: #1C3A30; --accent-text: #8FD8BA; --focus: #8FD8BA;
  --success: #7DD69A; --success-bg: #173322;
  --warning: #F2B66A; --warning-bg: #3A2810;
  --danger:  #FF9C8F; --danger-bg:  #3D1B17; --danger-solid: #F07A6C; --on-danger: #2A0E0A;
  --info:    #8CC2F0; --info-bg:    #14293D;
  --ki: #EBA6CC; --ki-bg: #3A1C2E;
  --st-draft: #B5BCB7; --st-draft-bg: #262D29;
  --st-writing: #EBA6CC; --st-writing-bg: #3A1C2E;
  --st-review: #F2B66A; --st-review-bg: #3A2810;
  --st-scheduled: #8CC2F0; --st-scheduled-bg: #14293D;
  --st-published: #7DD69A; --st-published-bg: #173322;
  --st-failed: #FF9C8F; --st-failed-bg: #3D1B17;
  --shadow-1: 0 0 0 1px rgba(255, 255, 255, .05);
  --shadow-2: 0 0 0 1px rgba(255, 255, 255, .07), 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-3: 0 0 0 1px rgba(255, 255, 255, .08), 0 24px 60px rgba(0, 0, 0, .55);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #111513; --surface: #181D1A; --surface-2: #1E2420; --surface-3: #262D29;
    --overlay: rgba(0, 0, 0, .62);
    --text: #E9ECE8; --text-muted: #A2AAA5; --text-on-accent: #0E211A;
    --line: #2E3531; --line-strong: #6B746F;
    --accent: #74CBA8; --accent-hover: #8FD8BA; --accent-soft: #1C3A30; --accent-text: #8FD8BA; --focus: #8FD8BA;
    --success: #7DD69A; --success-bg: #173322; --warning: #F2B66A; --warning-bg: #3A2810;
    --danger: #FF9C8F; --danger-bg: #3D1B17; --danger-solid: #F07A6C; --on-danger: #2A0E0A;
    --info: #8CC2F0; --info-bg: #14293D; --ki: #EBA6CC; --ki-bg: #3A1C2E;
    --st-draft: #B5BCB7; --st-draft-bg: #262D29; --st-writing: #EBA6CC; --st-writing-bg: #3A1C2E;
    --st-review: #F2B66A; --st-review-bg: #3A2810; --st-scheduled: #8CC2F0; --st-scheduled-bg: #14293D;
    --st-published: #7DD69A; --st-published-bg: #173322; --st-failed: #FF9C8F; --st-failed-bg: #3D1B17;
    --shadow-1: 0 0 0 1px rgba(255,255,255,.05);
    --shadow-2: 0 0 0 1px rgba(255,255,255,.07), 0 6px 18px rgba(0,0,0,.35);
    --shadow-3: 0 0 0 1px rgba(255,255,255,.08), 0 24px 60px rgba(0,0,0,.55);
  }
}

/* ---------- 2. Tokens: themenunabhängig ---------- */
:root {
  /* Schrift */
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-text: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, sans-serif;
  --font-data: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  /* Größen-Skala 1.2 (Basis 16) */
  --fs-xs: .75rem;   /* 12 Meta */
  --fs-sm: .875rem;  /* 14 Hilfstext */
  --fs-md: 1rem;     /* 16 Text */
  --fs-lg: 1.125rem; /* 18 Lead */
  --fs-xl: 1.375rem; /* 22 H3 */
  --fs-2xl: 1.75rem; /* 28 H2 */
  --fs-3xl: 2.25rem; /* 36 H1 */
  --fs-4xl: 3rem;    /* 48 Display */
  --lh-tight: 1.15; --lh-snug: 1.3; --lh-text: 1.55;
  --fw-regular: 400; --fw-medium: 500; --fw-semibold: 600; --fw-bold: 700;
  /* Abstände: 4er-Raster */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;
  /* Rundungen: bewusst unterschiedlich je Ebene */
  --r-xs: 4px;    /* Kontrollkästchen, Tags im Text */
  --r-sm: 8px;    /* Felder, Knöpfe */
  --r-md: 12px;   /* Kacheln, Menüs */
  --r-lg: 20px;   /* Karten, Panels */
  --r-xl: 28px;   /* Dialoge, Sheets */
  --r-pill: 999px;/* Status-Pillen, Schalter */
  /* Raster & Umbrüche */
  --container: 1240px; --sidebar: 248px; --gutter-m: 16px; --gutter-d: 32px;
  --bp-sm: 360px; --bp-md: 600px; --bp-lg: 900px; --bp-xl: 1200px; --bp-2xl: 1600px;
  --tap: 44px;
  /* Bewegung */
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms; --dur-long: 1600ms;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
  --ease-in-out: cubic-bezier(.6, 0, .3, 1);
  --ease-spring: cubic-bezier(.3, 1.4, .5, 1);
  --z-nav: 20; --z-sticky: 30; --z-dialog: 50; --z-toast: 60;
}
@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; --dur-3: 0ms; --dur-long: 0ms; }
  *, *::before, *::after { animation-duration: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0ms !important; scroll-behavior: auto !important; }
}

/* ---------- 3. Basis ---------- */
.cv, .cv * { box-sizing: border-box; }
.cv { font-family: var(--font-text); font-size: var(--fs-md); line-height: var(--lh-text); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
.cv h1, .cv h2, .cv h3, .cv h4 { font-family: var(--font-display); line-height: var(--lh-tight); margin: 0; letter-spacing: -.01em; font-weight: 700; }
.cv p { margin: 0; }
.h-display { font-size: var(--fs-4xl); font-variation-settings: "opsz" 96; letter-spacing: -.025em; }
.h1 { font-size: var(--fs-3xl); } .h2 { font-size: var(--fs-2xl); } .h3 { font-size: var(--fs-xl); }
.eyebrow { font-family: var(--font-data); font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.muted { color: var(--text-muted); } .small { font-size: var(--fs-sm); } .xs { font-size: var(--fs-xs); }
.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.cv :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: inherit; }
.focus-demo { outline: 2px solid var(--focus) !important; outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 16px; height: 16px; } .ic-lg { width: 24px; height: 24px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.row { display: flex; align-items: center; gap: var(--sp-2); }
.stack { display: flex; flex-direction: column; gap: var(--sp-3); }
.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- 4. Knöpfe ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: var(--tap); padding: 0 var(--sp-5); border-radius: var(--r-sm); border: 1px solid transparent; font: 600 var(--fs-md)/1 var(--font-text); cursor: pointer; transition: background var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out); white-space: nowrap; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--text-on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--secondary { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn--secondary:hover { background: var(--surface-3); }
.btn--ghost { background: transparent; color: var(--accent-text); }
.btn--ghost:hover { background: var(--accent-soft); }
.btn--danger { background: var(--danger-solid); color: var(--on-danger); }
.btn--sm { min-height: 36px; padding: 0 var(--sp-3); font-size: var(--fs-sm); }
.btn--icon { width: var(--tap); padding: 0; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; }
.btn.is-loading { cursor: progress; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: cv-spin .8s linear infinite; flex: none; }
@keyframes cv-spin { to { transform: rotate(360deg); } }

/* ---------- 5. Formularfelder ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-weight: 600; font-size: var(--fs-sm); }
.hint { font-size: var(--fs-sm); color: var(--text-muted); }
.input, .textarea, .select { width: 100%; min-height: var(--tap); padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 400 var(--fs-md)/1.4 var(--font-text); }
.textarea { min-height: 112px; resize: vertical; }
.input-wrap { position: relative; display: flex; }
.input-wrap .input, .input-wrap .textarea { padding-right: 52px; }
.input-wrap .mic { position: absolute; right: 4px; top: 4px; }
.field.is-error .input, .field.is-error .textarea { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.field-error { display: flex; gap: 6px; align-items: center; color: var(--danger); font-size: var(--fs-sm); font-weight: 600; }
.counter { font-family: var(--font-data); font-size: var(--fs-xs); color: var(--text-muted); }
.counter.is-over { color: var(--danger); }
.switch { position: relative; width: 44px; height: 26px; border-radius: var(--r-pill); background: var(--line-strong); border: 0; flex: none; padding: 0; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); transition: transform var(--dur-2) var(--ease-spring); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.check { width: 22px; height: 22px; border-radius: var(--r-xs); border: 1.5px solid var(--line-strong); background: var(--surface); display: inline-grid; place-items: center; flex: none; color: var(--text-on-accent); }
.check.is-on { background: var(--accent); border-color: var(--accent); }
.choice { display: flex; gap: var(--sp-3); align-items: center; min-height: var(--tap); }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-3); border-radius: var(--r-sm); }
.seg button { min-height: 38px; padding: 0 var(--sp-4); border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); font: 600 var(--fs-sm)/1 var(--font-text); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }

/* ---------- 6. Sprach-Eingabe ---------- */
.mic { width: 40px; height: 40px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--text-muted); display: grid; place-items: center; cursor: pointer; }
.mic:hover { background: var(--surface-3); color: var(--text); }
.mic.is-rec { background: var(--danger-solid); color: var(--on-danger); }
.mic.is-busy { color: var(--ki); }
.mic.is-done { color: var(--success); }
.mic.is-err { color: var(--danger); }
.voice-bar { display: flex; align-items: center; gap: var(--sp-3); padding: 8px 8px 8px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-strong); background: var(--surface); min-height: var(--tap); }
.level { display: flex; align-items: center; gap: 3px; height: 24px; flex: 1; }
.level i { display: block; width: 3px; border-radius: 2px; background: var(--danger); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger-solid); animation: cv-pulse 1.2s var(--ease-in-out) infinite; }
@keyframes cv-pulse { 50% { opacity: .35; } }

/* ---------- 7. Kennzeichen ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px 0 8px; border-radius: var(--r-pill); font: 600 var(--fs-xs)/1 var(--font-text); white-space: nowrap; }
.pill .ic { width: 14px; height: 14px; stroke-width: 2; }
.pill--draft { color: var(--st-draft); background: var(--st-draft-bg); }
.pill--writing { color: var(--st-writing); background: var(--st-writing-bg); }
.pill--review { color: var(--st-review); background: var(--st-review-bg); }
.pill--scheduled { color: var(--st-scheduled); background: var(--st-scheduled-bg); }
.pill--published { color: var(--st-published); background: var(--st-published-bg); }
.pill--failed { color: var(--st-failed); background: var(--st-failed-bg); }
.pill .t { font-family: var(--font-data); font-weight: 500; opacity: .95; }
.ki-tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 8px; border-radius: var(--r-xs); border: 1.5px dashed var(--ki); color: var(--ki); background: var(--ki-bg); font: 700 11px/1 var(--font-data); letter-spacing: .04em; white-space: nowrap; }
.ki-tag .ic { width: 13px; height: 13px; stroke-width: 2; }
.ki-edge { outline: 1.5px dashed var(--ki); outline-offset: -1.5px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 600 var(--fs-sm)/1 var(--font-text); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- 8. Navigation & Profil ---------- */
.side { width: var(--sidebar); background: var(--surface-2); border-right: 1px solid var(--line); padding: var(--sp-4) var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-1); }
.logo { font: 800 22px/1 var(--font-display); letter-spacing: -.03em; display: flex; align-items: center; gap: 8px; padding: 6px 10px 14px; color: var(--text); }
.logo-mark { width: 26px; height: 26px; border-radius: 8px 8px 8px 2px; background: var(--accent); display: grid; place-items: center; color: var(--text-on-accent); }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 12px; border-radius: var(--r-sm); color: var(--text-muted); font-weight: 600; text-decoration: none; position: relative; }
.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.nav-item[aria-current="page"] .ic { color: var(--accent); }
.nav-count { margin-left: auto; font: 600 var(--fs-xs)/1 var(--font-data); background: var(--st-review-bg); color: var(--st-review); padding: 4px 7px; border-radius: var(--r-pill); }
.nav-sep { height: 1px; background: var(--line); margin: var(--sp-2) 4px; }
.nav-admin { font-size: var(--fs-xs); color: var(--text-muted); padding: 8px 12px 2px; font-family: var(--font-data); letter-spacing: .06em; text-transform: uppercase; }
.tabbar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px 10px; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center; color: var(--text-muted); font: 600 11px/1.1 var(--font-text); text-decoration: none; border-radius: var(--r-sm); }
.tab[aria-current="page"] { color: var(--accent-text); }
.tab[aria-current="page"] .tab-ic { background: var(--accent-soft); }
.tab-ic { width: 52px; height: 30px; border-radius: var(--r-pill); display: grid; place-items: center; }
.profile { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 6px 10px 6px 6px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.mono { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; font: 800 15px/1 var(--font-display); flex: none; }
.mono--sm { width: 28px; height: 28px; border-radius: 8px; font-size: 12px; }
.mono--1 { background: var(--pf-1); } .mono--2 { background: var(--pf-2); } .mono--3 { background: var(--pf-3); } .mono--4 { background: var(--pf-4); }
.p-name { font-weight: 700; line-height: 1.2; }
.p-sub { font-size: var(--fs-xs); color: var(--text-muted); }
.menu { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-3); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.menu-item { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 4px 10px 4px 6px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--text); font: inherit; text-align: left; width: 100%; }
.menu-item:hover, .menu-item.is-hl { background: var(--surface-3); }
.menu-item[aria-checked="true"] .ok { visibility: visible; }
.menu-item .ok { visibility: hidden; color: var(--accent); margin-left: auto; }
.topbar { display: flex; align-items: center; gap: var(--sp-3); min-height: 60px; padding: 0 var(--sp-4); background: var(--surface); border-bottom: 1px solid var(--line); }
.ctx { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 6px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface-2); font-weight: 700; font-size: var(--fs-sm); color: var(--text); }

/* ---------- 9. Karten, Kacheln, Tabellen ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: var(--sp-5); }
.card--flat { box-shadow: none; border: 1px solid var(--line); }
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.tile { border-radius: var(--r-md); overflow: hidden; background: var(--surface-3); position: relative; aspect-ratio: 1; }
.tile .ki-tag { position: absolute; left: 6px; bottom: 6px; }
.tile.is-sel { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile .sel { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.25); display: grid; place-items: center; color: #fff; }
.tile.is-sel .sel { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.ph { width: 100%; height: 100%; display: block; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font: 600 var(--fs-xs)/1 var(--font-data); text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); padding: 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--surface-2); }

/* ---------- 10. Meldungen ---------- */
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 16px; border-radius: var(--r-md); background: var(--text); color: var(--bg); box-shadow: var(--shadow-3); min-height: 52px; font-weight: 600; }
.toast .btn--ghost { color: var(--bg); }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid; min-height: 52px; }
.banner--warning { background: var(--warning-bg); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 25%, transparent); }
.banner--info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 25%, transparent); }
.banner--danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.banner b, .note b { color: var(--text); }
.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r-md); }
.note--info { background: var(--info-bg); } .note--info > .ic { color: var(--info); }
.note--success { background: var(--success-bg); } .note--success > .ic { color: var(--success); }
.note--warning { background: var(--warning-bg); } .note--warning > .ic { color: var(--warning); }
.note--danger { background: var(--danger-bg); } .note--danger > .ic { color: var(--danger); }
.note--ki { background: var(--ki-bg); outline: 1.5px dashed var(--ki); outline-offset: -1.5px; } .note--ki > .ic { color: var(--ki); }
.dialog { background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--shadow-3); padding: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-4); }
.sheet { background: var(--surface); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-3); }
.scrim { background: var(--overlay); }

/* ---------- 11. Fortschritt, Lange Arbeit, Verbrauch ---------- */
.bar { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.bar--ki > i { background: var(--ki); }
.bar--err > i { background: var(--danger-solid); }
.steps { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.steps li { display: flex; gap: 10px; align-items: center; font-size: var(--fs-sm); color: var(--text-muted); }
.steps li.is-done { color: var(--text); }
.steps li.is-now { color: var(--text); font-weight: 700; }
.dot { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.is-done .dot { background: var(--success); border-color: var(--success); color: var(--surface); }
.is-now .dot { border-color: var(--ki); border-right-color: transparent; animation: cv-spin 1s linear infinite; }
.shimmer { background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 50%, var(--surface-3) 100%); background-size: 200% 100%; animation: cv-shim var(--dur-long) linear infinite; border-radius: var(--r-xs); }
@keyframes cv-shim { to { background-position: -200% 0; } }
.meter { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px 6px 8px; border-radius: var(--r-pill); background: var(--surface-3); font-size: var(--fs-sm); }
.ring { width: 22px; height: 22px; }

/* ---------- 12. Kalender ---------- */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 104px; padding: 6px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.cal .is-out { background: var(--surface-2); color: var(--text-muted); }
.cal .is-today .dnum { background: var(--accent); color: var(--text-on-accent); }
.dnum { font: 500 var(--fs-xs)/1 var(--font-data); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; }
.ev { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: 6px; font-size: 12px; font-weight: 600; line-height: 1.2; cursor: grab; }
.ev .t { font-family: var(--font-data); font-weight: 500; }
.ev--scheduled { background: var(--st-scheduled-bg); color: var(--st-scheduled); }
.ev--review { background: var(--st-review-bg); color: var(--st-review); }
.ev--published { background: var(--st-published-bg); color: var(--st-published); }
.ev--failed { background: var(--st-failed-bg); color: var(--st-failed); }
.ev--drag { box-shadow: var(--shadow-3); transform: rotate(-2deg); background: var(--surface); outline: 2px solid var(--accent); color: var(--text); }
.drop { outline: 2px dashed var(--accent); outline-offset: -4px; background: var(--accent-soft) !important; }

/* ---------- 13. Upload ---------- */
.drop-zone { border: 2px dashed var(--line-strong); border-radius: var(--r-lg); background: var(--surface-2); padding: var(--sp-8); display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); text-align: center; }
.drop-zone.is-over { border-color: var(--accent); background: var(--accent-soft); }
.file { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.thumb { width: 40px; height: 40px; border-radius: var(--r-xs); overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--text-muted); }

/* ---------- 14. Fassungen & Freigabe ---------- */
.version { border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); text-align: left; font: inherit; color: inherit; }
.version.is-picked { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.diff { background: var(--accent-soft); color: var(--text); border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -2px 0 var(--accent); }
.approve-bar { display: flex; align-items: center; gap: var(--sp-3); padding: 12px var(--sp-4); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px rgba(0,0,0,.06); }

/* ---------- 15. Hilfen für Demo-Boards ---------- */
.board { padding: 64px; display: flex; flex-direction: column; gap: 56px; }
.sec { display: flex; flex-direction: column; gap: 20px; }
.sec-head { display: flex; align-items: baseline; gap: 16px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.sec-no { font: 500 var(--fs-sm)/1 var(--font-data); color: var(--accent-text); }
.spec { font: 500 11px/1.3 var(--font-data); color: var(--text-muted); }
.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.duo > div { padding: 28px; display: flex; flex-direction: column; gap: 16px; background: var(--bg); color: var(--text); }
.state-label { font: 500 11px/1 var(--font-data); color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; }

/* =====================================================================
   16. Seitenrahmen Modul 1 (Container Queries: reagiert auf die
   Breite der Seite, nicht des Fensters – funktioniert auch eingebettet)
   ===================================================================== */
.cq { container-type: inline-size; container-name: page; position: relative; min-height: 100vh; background: var(--bg); color: var(--text); display: flex; flex-direction: column; }
.cq--embed { min-height: 740px; }
.only-m { display: none !important; }
@container page (max-width: 760px) {
  .only-d { display: none !important; }
  .only-m { display: flex !important; }
}

/* Anmeldung */
.auth { display: flex; flex: 1; }
.auth-brand { flex: 0 0 40%; background: var(--accent); color: var(--text-on-accent); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; padding: 48px; }
.auth-brand .pill { background: rgba(255, 255, 255, .14); color: inherit; }
.auth-logo { display: flex; align-items: center; gap: 10px; font: 800 24px/1 var(--font-display); letter-spacing: -.03em; }
.auth-logo .logo-mark { background: var(--text-on-accent); color: var(--accent); }
.auth-claim { font: 700 48px/1.05 var(--font-display); letter-spacing: -.03em; max-width: 440px; }
.auth-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-col { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 20px; }
.auth-col--wide { max-width: 560px; }
.auth-foot { display: flex; gap: 16px; font-size: var(--fs-sm); border-top: 1px solid var(--line); padding-top: 16px; }
@container page (max-width: 760px) {
  .auth { flex-direction: column; }
  .auth-brand { flex: none; padding: 24px 16px; gap: 14px; }
  .auth-claim { font-size: 26px; }
  .auth-brand .hide-m { display: none; }
  .auth-main { justify-content: flex-start; padding: 24px 16px 32px; }
}

/* App-Rahmen mit Seitenleiste */
.shell { display: flex; flex: 1; }
.shell > .side { flex: 0 0 248px; }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { width: 100%; max-width: 1120px; margin: 0 auto; padding: 40px 32px 64px; display: flex; flex-direction: column; gap: 24px; flex: 1; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.page-head h1 { font-size: var(--fs-3xl); }
.mnav { position: sticky; bottom: 0; z-index: var(--z-nav); }
@container page (max-width: 760px) {
  .shell > .side { display: none; }
  .content { padding: 20px 16px 28px; gap: 18px; }
  .page-head h1 { font-size: 26px; }
  .page-head .btn--primary { width: 100%; }
}

/* Betreiber- und Kunden-Kennzeichen */
.op-badge { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); background: var(--text); color: var(--bg); font-weight: 700; }
.op-badge .xs { color: inherit; opacity: .8; font-weight: 400; }
.op-chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: var(--r-pill); background: var(--text); color: var(--bg); font: 700 13px/1 var(--font-text); }
.ctxbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 8px 8px 20px; min-height: 52px; background: var(--text); color: var(--bg); font-size: var(--fs-sm); }
.ctxbar .btn--secondary { background: transparent; color: var(--bg); border-color: currentColor; }
.ctxbar .btn--secondary:hover { background: rgba(127, 127, 127, .2); }
@container page (max-width: 760px) { .ctxbar { padding: 6px 6px 6px 14px; gap: 8px; } .ctxbar .why { display: none; } }

/* Reiter */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a, .tabs button { min-height: var(--tap); padding: 0 14px; border: 0; background: none; font: 600 15px/1 var(--font-text); color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap; cursor: pointer; }
.tabs [aria-selected="true"], .tabs [aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }

/* Code-Felder */
.code-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.code-in { width: 100%; height: 60px; padding: 0; text-align: center; font: 500 26px/1 var(--font-data); border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.code-row.is-error .code-in { border-color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger); }
.code-row[aria-disabled="true"] .code-in { opacity: .5; }
.secret { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }
.secret .num { flex: 1; overflow-wrap: anywhere; letter-spacing: .04em; }
.mask { font-family: var(--font-data); font-size: .88em; background: var(--surface-3); border-radius: 4px; padding: 1px 6px; white-space: nowrap; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 8px; border-radius: var(--r-xs); border: 1px solid var(--line-strong); font: 500 12px/1 var(--font-data); color: var(--text); background: var(--surface); white-space: nowrap; }

/* Schritte, QR, Stärke */
.wz { display: grid; grid-template-columns: repeat(var(--n, 3), minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
.wz li { display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); color: var(--text-muted); }
.wz li i { display: block; height: 4px; border-radius: 4px; background: var(--surface-3); }
.wz li.is-done i { background: var(--success); }
.wz li.is-now { color: var(--text); font-weight: 700; }
.wz li.is-now i { background: var(--accent); }
.qr { display: grid; grid-template-columns: repeat(21, 1fr); width: 184px; height: 184px; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--line); box-sizing: content-box; flex: none; }
.qr span { display: block; }
.strength { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.strength i { display: block; height: 4px; border-radius: 4px; background: var(--surface-3); }
.strength.s1 i:nth-child(-n+1) { background: var(--danger-solid); }
.strength.s2 i:nth-child(-n+2) { background: var(--warning); }
.strength.s3 i:nth-child(-n+3) { background: var(--success); }
.strength.s4 i { background: var(--success); }

/* Dialog über der Seite (Handy: Sheet von unten) */
.ovl { position: absolute; inset: 0; z-index: var(--z-dialog); display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--overlay); }
.ovl > .dialog { width: 100%; max-width: 480px; }
@container page (max-width: 760px) {
  .ovl { align-items: flex-end; padding: 0; }
  .ovl > .dialog { max-width: none; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 20px 16px 24px; }
  .ovl > .dialog .dlg-actions { flex-direction: column-reverse; align-items: stretch; }
}
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* Listen: Tabelle am Rechner, Karten am Handy */
.tbl-wrap { overflow-x: auto; }
.mlist { flex-direction: column; }
.mitem { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.mitem:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 16px; font-size: var(--fs-sm); }
.kv dt { color: var(--text-muted); } .kv dd { margin: 0; }
.row-open td { background: var(--surface-2); }
.expander { width: 32px; height: 32px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--text-muted); display: grid; place-items: center; cursor: pointer; }
.expander[aria-expanded="true"] .ic { transform: rotate(90deg); }

/* Leer, Seitenfehler, Wartung */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 48px 24px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); }
.empty-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); display: grid; place-items: center; }
.check-btn { display: flex; align-items: center; gap: 12px; min-height: var(--tap); border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }

/* Galerie für Handy-Vorschauen (nur Canvas) */
.gallery { display: flex; gap: 48px; align-items: flex-start; padding: 32px; }
.phone { width: 360px; border-radius: 28px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-2); flex: none; background: var(--bg); }

/* =====================================================================
   17. API-Doku (Schnittstelle v1)
   ===================================================================== */
.api { display: grid; grid-template-columns: 264px minmax(0, 1fr) 460px; flex: 1; align-items: start; }
.api-nav { align-self: stretch; border-right: 1px solid var(--line); background: var(--surface-2); padding: 20px 12px 32px; display: flex; flex-direction: column; gap: 2px; }
.api-main { min-width: 0; padding: 40px 40px 64px; display: flex; flex-direction: column; gap: 32px; }
.api-side { min-width: 0; padding: 40px 28px 48px 0; display: flex; flex-direction: column; gap: 20px; }
@container page (max-width: 1240px) {
  .api { grid-template-columns: 240px minmax(0, 1fr); }
  .api-side { grid-column: 2; padding: 0 40px 56px; }
}
@container page (max-width: 760px) {
  .api { grid-template-columns: minmax(0, 1fr); }
  .api-nav { display: none; }
  .api-main { padding: 20px 16px 24px; gap: 24px; }
  .api-side { grid-column: 1; padding: 0 16px 32px; }
}
.nav-label { font: 500 11px/1 var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 16px 10px 6px; }
.svc { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: var(--r-sm); border: 0; background: none; width: 100%; font: 600 14px/1.2 var(--font-text); color: var(--text); cursor: pointer; text-align: left; }
.svc:hover { background: var(--surface-3); }
.svc .cnt { margin-left: auto; font: 500 12px/1 var(--font-data); color: var(--text-muted); background: var(--surface-3); padding: 4px 7px; border-radius: var(--r-pill); }
.svc[aria-expanded="true"] .ic { transform: rotate(90deg); }
.ep { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 10px 0 30px; border-radius: var(--r-sm); border: 0; background: none; width: 100%; font: 500 13px/1 var(--font-data); color: var(--text-muted); cursor: pointer; text-align: left; }
.ep:hover { color: var(--text); background: var(--surface-3); }
.ep[aria-current="page"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-1); }
.method { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: var(--r-xs); background: var(--accent-soft); color: var(--accent-text); font: 700 10px/1 var(--font-data); letter-spacing: .05em; flex: none; }
.method--lg { height: 30px; padding: 0 10px; font-size: 13px; }
.path { font: 500 22px/1.3 var(--font-data); letter-spacing: -.01em; overflow-wrap: anywhere; }
.path .dim { color: var(--text-muted); }
.fields { border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.fld { display: grid; grid-template-columns: 180px minmax(0, 1fr) 96px; gap: 16px; align-items: start; padding: 14px 18px; border-top: 1px solid var(--line); }
.fld:first-child { border-top: 0; }
.fld-name { font: 600 14px/1.5 var(--font-data); overflow-wrap: anywhere; }
.fld-type { font-size: var(--fs-sm); line-height: 1.5; }
.fld-req { justify-self: end; }
.req { display: inline-flex; font: 700 11px/1 var(--font-text); color: var(--accent-text); background: var(--accent-soft); padding: 5px 9px; border-radius: var(--r-pill); }
.opt { font: 500 12px/1.5 var(--font-text); color: var(--text-muted); }
@container page (max-width: 760px) {
  .fld { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 14px; }
  .fld-type { grid-column: 1 / -1; grid-row: 2; }
}
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; }
.fact { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.fact code, .inl { font: 500 .9em/1.4 var(--font-data); background: var(--surface-3); border-radius: 4px; padding: 1px 5px; overflow-wrap: anywhere; }
/* Code-Blöcke: immer dunkel, in beiden Themen gleich */
.code { background: #121614; color: #E3E7E3; border-radius: var(--r-lg); overflow: hidden; border: 1px solid #262E29; }
.code-head { display: flex; align-items: center; gap: 2px; padding: 6px 6px 6px 8px; border-bottom: 1px solid #262E29; }
.code-tab { min-height: 34px; padding: 0 10px; border: 0; background: none; color: #A3ADA7; font: 600 13px/1 var(--font-text); border-radius: 6px; cursor: pointer; }
.code-tab[aria-selected="true"] { background: #262E29; color: #FFFFFF; }
.code-copy { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 10px; border: 0; background: none; color: #C9D0CB; font: 600 13px/1 var(--font-text); border-radius: 6px; cursor: pointer; }
.code-copy:hover { background: #262E29; }
.code-copy:focus-visible, .code-tab:focus-visible { outline: 2px solid #8FD8BA; outline-offset: 1px; }
.code pre { margin: 0; padding: 16px 18px; font: 400 13px/1.7 var(--font-data); overflow-x: auto; white-space: pre; tab-size: 2; }
.code-label { font: 500 11px/1 var(--font-data); letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
.c-key { color: #8FD8BA; } .c-str { color: #F2C98A; } .c-lit { color: #8CC2F0; } .c-mut { color: #8A958F; } .c-cmd { color: #EBA6CC; }
