/* ==========================================================================
   ScanTo — Scanning-spezifisches CSS
   Nutzt AssistUK-Tokens (tokens.css) — gleiche Optik wie GazeTo/TouchTo.
   ========================================================================== */

:root {
  --scan-focus: #f59e0b;          /* Bernstein — hochkontrastiger Scan-Fokus */
  --scan-focus-row: #fcd34d;      /* helleres Gelb für Zeilen-Highlight */
  --scan-select: #10b981;         /* Grün — Bestätigung */
  --scan-dim-opacity: 0.32;
}

[data-theme="contrast"] {
  --scan-focus: #ffd400;
  --scan-focus-row: #ffe680;
  --scan-select: #00e08a;
  --scan-dim-opacity: 0.18;
}

/* CVI-Theme: maximaler Kontrast, reduzierte Komplexität (Gelb auf Schwarz),
   größere Schrift. Für Cerebral Visual Impairment (Forschung: ~100% der
   CVI-AAC-Nutzer profitieren). Am besten mit auditivem Scanning kombiniert. */
[data-theme="cvi"] {
  --color-bg: #000;
  --color-surface: #000;
  --color-text: #ffe600;
  --color-text-secondary: #ffe600;
  --color-text-muted: #cccc00;
  --color-border: #ffe600;
  --color-primary: #ffe600;
  --color-primary-dark: #ffe600;
  --color-primary-bg: #1a1a00;
  --scan-focus: #ffe600;
  --scan-focus-row: #fff04d;
  --scan-select: #00ff88;
  --scan-dim-opacity: 0.08;
}
[data-theme="cvi"] body { background: #000; color: #ffe600; }
[data-theme="cvi"] .scan-card { background: #000; border-color: #ffe600; color: #ffe600; }
[data-theme="cvi"] .scan-card__label, [data-theme="cvi"] .scan-prompt { color: #ffe600; }
[data-theme="cvi"] .scan-prompt { font-size: 2rem; }
[data-theme="cvi"] .scan-card__emoji { font-size: 4rem; }
[data-theme="cvi"] .statusbar, [data-theme="cvi"] .bottom-nav { background: #000; border-color: #ffe600; }
[data-theme="cvi"] .bottom-nav__item { color: #cccc00; }
[data-theme="cvi"] .bottom-nav__item.is-active { color: #ffe600; }
[data-theme="cvi"] .btn-primary-blue { background: #ffe600; color: #000; }
[data-theme="cvi"] .btn-ghost-pill, [data-theme="cvi"] .btn--outline { background: #000; color: #ffe600; border-color: #ffe600; }
[data-theme="cvi"] .scan-focus { box-shadow: 0 0 0 7px #ffe600, 0 0 30px rgba(255,230,0,0.8) !important; }

/* ── App-Grundlayout ──────────────────────────────────────────────────── */
body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg, #f5f5f7);
  color: var(--color-text, #1a1a1a);
  line-height: 1.5;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }
#app-content { flex: 1; padding: 20px 22px 96px; max-width: 1100px; margin: 0 auto; width: 100%; box-sizing: border-box; }

.page { width: 100%; }
.page-head { margin-bottom: 18px; }
.page-title { font-family: 'Merriweather', Georgia, serif; font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 6px; color: var(--color-primary-dark, #3a5a7c); }
.page-lead { font-size: 1.05rem; color: var(--color-text-secondary, #4a4a4a); margin: 0; }
.section__title { font-family: 'Merriweather', Georgia, serif; font-size: 1.4rem; margin: 0 0 14px; color: var(--color-primary-dark, #3a5a7c); }
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-primary, #4b698c); margin-bottom: 8px; }

/* ── Statusbar / Nav ──────────────────────────────────────────────────── */
.statusbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; background: rgba(255,255,255,0.95);
  border-bottom: 1px solid var(--color-border, #e4e7ee);
  position: sticky; top: 0; z-index: 20;
}
.statusbar__brand { display: flex; align-items: center; gap: 10px; border: none; background: none; cursor: pointer; font-weight: 800; font-size: 1.15rem; color: var(--color-brand-deep, #1a3a6a); }
.statusbar__brand-logo img { width: 30px; height: 30px; border-radius: 7px; display: block; }
.statusbar__spacer { flex: 1; }
/* Pill-Buttons in GazeTo-Optik: transparent, beim Hover/Aktiv gefüllt. */
.statusbar__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--color-text-secondary, #4a4a4a);
  font-family: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer;
  min-height: 48px; min-width: 48px;
  transition: background 0.15s, color 0.15s;
}
.statusbar__btn:hover { background: var(--color-primary-bg, #eef2f7); color: var(--color-text, #1a1a1a); }
.statusbar__btn.is-on { background: var(--color-primary, #4b698c); color: #fff; }
.statusbar__btn i, .statusbar__btn svg { width: 20px; height: 20px; }
.statusbar__btn--font { font-weight: 800; font-size: 1rem; }
.statusbar__avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 18px;
  border: 2px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  background: var(--color-primary, #4b698c);
  cursor: pointer; flex-shrink: 0;
}
@media (max-width: 900px) {
  .statusbar__btn-label { display: none; }
  .statusbar__btn--font .statusbar__btn-label { display: inline; } /* A−/A+ = Label selbst */
}

/* Vorlesen: Markierung des gerade gesprochenen Elements */
.tts-reading {
  background: rgba(75, 105, 140, 0.16) !important;
  outline: 2px solid var(--color-primary, #4b698c);
  outline-offset: 3px;
  border-radius: 6px;
  scroll-margin: 120px;
}
[data-theme="contrast"] .tts-reading, [data-theme="cvi"] .tts-reading {
  background: rgba(255, 214, 10, 0.28) !important;
  outline-color: #ffd60a;
}

/* Schriftgröße (Statusbar A−/A+) */
html[data-font-scale="s"]  { font-size: 15px; }
html[data-font-scale="m"]  { font-size: 16px; }
html[data-font-scale="l"]  { font-size: 17.5px; }
html[data-font-scale="xl"] { font-size: 19px; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: center;
  background: #fff; border-top: 1px solid var(--color-border, #e4e7ee);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.bottom-nav__item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: none; cursor: pointer; padding: 6px 14px;
  color: var(--color-text-muted, #525252); font-size: 0.8rem; font-weight: 600; min-height: 56px;
}
.bottom-nav__item i { width: 24px; height: 24px; }
.bottom-nav__item.is-active { color: var(--color-primary, #4b698c); }

/* Erhobener Mittel-Button „Mein Bereich" (GazeTo-Disc) */
.bottom-nav__item--primary { position: relative; justify-content: flex-end; }
.bottom-nav__primary-disc {
  display: flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 50%;
  margin-top: -30px; margin-bottom: 2px;
  background: linear-gradient(140deg, #4b698c, #2f4a6b);
  color: #fff;
  border: 4px solid #fff;
  box-shadow: 0 8px 22px rgba(75, 105, 140, 0.5), 0 2px 6px rgba(0, 0, 0, 0.22);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.bottom-nav__primary-disc i, .bottom-nav__primary-disc svg { width: 28px; height: 28px; color: #fff; }
.bottom-nav__item--primary .bottom-nav__label { color: var(--color-primary, #4b698c); font-weight: 700; }
.bottom-nav__item--primary:hover .bottom-nav__primary-disc { transform: translateY(-2px) scale(1.04); }
.bottom-nav__item--primary.is-active .bottom-nav__primary-disc {
  transform: scale(1.06);
  box-shadow: 0 10px 26px rgba(75, 105, 140, 0.6), 0 0 0 3px rgba(255, 214, 10, 0.5);
}
[data-theme="cvi"] .bottom-nav__primary-disc { background: #ffe600; border-color: #000; }
[data-theme="cvi"] .bottom-nav__primary-disc i, [data-theme="cvi"] .bottom-nav__primary-disc svg { color: #000; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-primary-blue {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-primary, #4b698c); color: #fff; border: none;
  padding: 14px 26px; border-radius: 999px; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; min-height: 56px;
}
.btn-primary-blue i { width: 20px; height: 20px; }
.btn-ghost-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--color-primary-dark, #3a5a7c);
  border: 1.5px solid var(--color-border, #e4e7ee);
  padding: 12px 22px; border-radius: 999px; font-size: 1rem; font-weight: 700;
  cursor: pointer; min-height: 52px;
}
.btn-ghost-pill i { width: 18px; height: 18px; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { padding: 12px 18px; border-radius: 12px; font-size: 0.95rem; font-weight: 700; cursor: pointer; min-height: 48px; }
.btn--outline { background: #fff; border: 1.5px solid var(--color-border, #e4e7ee); color: var(--color-text, #1a1a1a); }
.btn--active { background: var(--color-primary, #4b698c); color: #fff; border-color: var(--color-primary, #4b698c); }

/* ── Home ─────────────────────────────────────────────────────────────── */
.home-hero { padding: 24px 0 8px; }
.home-hero__title { font-family: 'Merriweather', Georgia, serif; font-size: clamp(1.9rem, 5vw, 2.8rem); margin: 0 0 12px; line-height: 1.1; color: var(--color-primary-dark, #3a5a7c); }
.home-hero__lead { font-size: 1.1rem; color: var(--color-text-secondary, #4a4a4a); max-width: 640px; margin: 0 0 20px; }
.home-hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.home-stufen { margin-top: 32px; }
.stufen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.stufe-card {
  position: relative; text-align: left; border: 2px solid var(--st-color, #4b698c);
  border-radius: 16px; background: #fff; padding: 16px 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; min-height: 130px;
}
.stufe-card__num { width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.stufe-card__icon i { width: 26px; height: 26px; color: var(--st-color, #4b698c); }
.stufe-card__name { font-weight: 800; font-size: 1.05rem; color: var(--color-text, #1a1a1a); }
.stufe-card__short { font-size: 0.85rem; color: var(--color-text-muted, #525252); }
.home-note { margin-top: 24px; font-size: 0.9rem; color: var(--color-text-muted, #525252); display: flex; align-items: flex-start; gap: 6px; }
.home-note i { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

/* ── Activities list (GazeTo-Kacheln mit Bild) ────────────────────────── */
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.act-tile {
  background: #fff; border: 1px solid var(--color-border, #e4e7ee);
  border-radius: 22px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; text-align: left;
  display: flex; flex-direction: column; padding: 0;
}
.act-tile:hover { transform: translateY(-5px); box-shadow: 0 10px 26px rgba(0,0,0,0.12); }
.act-tile__media { position: relative; width: 100%; aspect-ratio: 4/3; background: var(--color-primary-bg, #eef2f7); overflow: hidden; }
.act-tile__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.act-tile__placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--color-primary, #4b698c);
}
.act-tile__placeholder i, .act-tile__placeholder svg { width: 40px; height: 40px; }
.act-tile__chip {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 11px; font-weight: 700; color: #fff;
  padding: 4px 10px; border-radius: 999px; letter-spacing: 0.04em;
}
.act-tile__body { padding: 14px 16px 18px; }
.act-tile__title { font-family: 'Merriweather', Georgia, serif; font-weight: 700; font-size: 1.05rem; color: var(--color-text, #1a1a1a); margin: 0 0 3px; }
.act-tile__focus {
  font-size: 13px; color: var(--color-text-secondary, #4a4a4a); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Stern (→ "Mein Bereich") oben rechts auf der Medienfläche */
.act-tile__star {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0; color: #9ca3af;
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.act-tile__star:hover { transform: scale(1.1); }
.act-tile__star i, .act-tile__star svg { width: 24px; height: 24px; stroke: currentColor; fill: none; }
.act-tile__star.is-on { color: #f59e0b; background: rgba(255, 251, 235, 0.97); }
.act-tile__star.is-on svg { fill: currentColor; }
[data-theme="cvi"] .act-tile { background: #000; border-color: #ffe600; }
[data-theme="cvi"] .act-tile__title { color: #ffe600; }
[data-theme="cvi"] .act-tile__media { background: #1a1a00; }

/* Stufen-Abschnitte in der Übungs-Übersicht */
.act-stufe-section { margin-bottom: 28px; }
.act-stufe-head { margin: 8px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--st-color, #4b698c); }
.act-stufe-head__title { display: flex; align-items: center; gap: 12px; }
.act-stufe-head__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 1.1rem;
}
.act-stufe-head__label { font-weight: 800; font-size: 1.35rem; }
.act-stufe-head__sub { display: block; margin-top: 4px; font-size: 0.9rem; color: var(--color-text-secondary, #4a4a4a); }

/* ── Runner ───────────────────────────────────────────────────────────── */
.page-runner { display: flex; flex-direction: column; height: calc(100vh - 140px); }
.runner-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.runner-bar__title { display: flex; align-items: center; gap: 10px; }
.runner-bar__stufe { font-size: 0.72rem; font-weight: 700; background: var(--color-primary, #4b698c); color: #fff; padding: 3px 10px; border-radius: 999px; }
.runner-bar__name { font-weight: 800; font-size: 1.2rem; }
.runner-bar__ctrls { display: flex; gap: 8px; }
.runner-ctrl { padding: 10px 16px; min-height: 48px; }
.runner-hint { font-size: 0.95rem; color: var(--color-text-secondary, #4a4a4a); background: var(--color-primary-bg, #eef2f7); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.runner-stage { flex: 1; min-height: 360px; position: relative; }

/* ── Scan-Bühne (Aktivitäten) ─────────────────────────────────────────── */
.scan-stage { width: 100%; height: 100%; display: flex; flex-direction: column; }
.scan-prompt { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 16px; color: var(--color-primary-dark, #3a5a7c); }
.scan-progress { text-align: center; font-size: 0.95rem; color: var(--color-text-muted, #525252); margin-top: 12px; }

.scan-grid { display: grid; gap: 16px; flex: 1; align-content: center; }
.scan-grid--row { grid-template-columns: repeat(3, 1fr); }
.scan-grid--3x3 { grid-template-columns: repeat(3, 1fr); max-width: 560px; margin: 0 auto; width: 100%; }

.scan-card {
  border: 3px solid var(--color-border, #e4e7ee); border-radius: 20px; background: #fff;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 20px; min-height: 130px; transition: opacity 0.15s, transform 0.1s;
}
.scan-card--grid { min-height: 110px; }
.scan-card__emoji { font-size: 3.2rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.scan-card__img { width: 84px; height: 84px; object-fit: contain; display: block; }
.scan-card--grid .scan-card__img { width: 72px; height: 72px; }
.seq-output .scan-card__img, .seq-out-item .scan-card__img { width: 40px; height: 40px; }
.scan-card__label { font-size: 1.1rem; font-weight: 700; }
[data-theme="cvi"] .scan-card__img { filter: drop-shadow(0 0 2px #ffe600); }

.scan-bigtarget { transition: opacity 0.15s; }
.scan-bigtarget__hint { transition: opacity 0.4s; pointer-events: none; }

/* ── Scan-Fokus-Visualisierung (Kern!) ────────────────────────────────── */
.scan-focus {
  border-color: var(--scan-focus, #f59e0b) !important;
  box-shadow: 0 0 0 var(--scan-focus-width, 5px) var(--scan-focus, #f59e0b), 0 0 22px rgba(245,158,11,0.55) !important;
  transform: scale(1.04);
  outline: none;
}
.scan-focus-row {
  border-color: var(--scan-focus-row, #fcd34d) !important;
  box-shadow: 0 0 0 var(--scan-focus-width, 5px) var(--scan-focus-row, #fcd34d) !important;
}
.scan-dim { opacity: var(--scan-dim-opacity, 0.32); }
.scan-selected {
  border-color: var(--scan-select, #10b981) !important;
  box-shadow: 0 0 0 6px var(--scan-select, #10b981), 0 0 28px rgba(16,185,129,0.6) !important;
  transform: scale(1.07);
}

/* ── Result ───────────────────────────────────────────────────────────── */
.page-result { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.result-card { background: #fff; border-radius: 24px; padding: 36px 32px; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,0.08); max-width: 440px; }
.result-card__icon i { width: 56px; height: 56px; color: var(--scan-select, #10b981); }
.result-card__title { font-family: 'Merriweather', Georgia, serif; font-size: 1.8rem; margin: 12px 0 8px; }
.result-card__score { font-size: 1.3rem; font-weight: 800; color: var(--color-primary, #4b698c); margin-bottom: 4px; }
.result-card__sub { color: var(--color-text-muted, #525252); margin-bottom: 20px; }
.result-card__btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Settings ─────────────────────────────────────────────────────────── */
.settings-card { background: #fff; border-radius: 18px; padding: 20px 22px; margin-bottom: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.settings-card__title { font-size: 1.2rem; font-weight: 800; margin: 0 0 16px; color: var(--color-primary-dark, #3a5a7c); }
.settings-row { margin-bottom: 18px; }
.settings-row--col { display: flex; flex-direction: column; gap: 8px; }
.settings-row--toggle { display: flex; align-items: center; justify-content: space-between; }
.settings-label { font-weight: 700; font-size: 0.98rem; }
.settings-hint { font-size: 0.85rem; color: var(--color-text-muted, #525252); margin: 6px 0 14px; line-height: 1.45; }
/* Button-Gruppe direkt in einer Karte (z.B. Diagnostik) braucht Abstand zum Folgetext */
.settings-card .btn-group { margin-bottom: 6px; }

/* Taster-Zuordnung (Tasten-Chips) */
.keymap-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.keymap-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px;
  border-radius: 10px; background: var(--color-primary, #4b698c); color: #fff;
  font-weight: 700; font-size: 0.95rem; min-height: 40px;
}
.keymap-chip__x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.25); color: #fff; font-size: 1.1rem; line-height: 1;
}
.keymap-chip__x:hover { background: rgba(255,255,255,0.45); }
.keymap-add { min-height: 40px; }
[data-theme="cvi"] .keymap-chip { background: #ffe600; color: #000; }
[data-theme="cvi"] .keymap-chip__x { background: rgba(0,0,0,0.25); color: #000; }
.settings-slider-row { display: flex; align-items: center; gap: 14px; }
.settings-slider { flex: 1; height: 8px; }
.settings-slider__value { font-weight: 700; font-size: 0.95rem; min-width: 80px; text-align: right; color: var(--color-primary, #4b698c); }

.toggle { width: 56px; height: 32px; border-radius: 999px; background: #cbd0da; border: none; cursor: pointer; position: relative; transition: background 0.15s; }
.toggle--on { background: var(--color-success, #10b981); }
.toggle__knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.toggle--on .toggle__knob { left: 27px; }

/* ── Recovery-Delay-Overlay (sichtbare Erholungspause nach Auswahl) ─────── */
.scan-recovery {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  background: var(--scan-select, #10b981); color: #fff; font-weight: 700;
  padding: 8px 20px; border-radius: 999px; z-index: 50; display: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2); transition: opacity 0.2s; font-size: 0.95rem;
}

/* ── Diagnostik ────────────────────────────────────────────────────────── */
.diag-bigbtn { border: 3px solid var(--color-primary, #4b698c); background: var(--color-primary-bg, #eef2f7); }
.settings-select { font-family: inherit; }

/* ── Barrierefreiheit: sichtbarer Tastatur-/Switch-Fokus (WCAG 2.4.7) ───── */
*:focus-visible {
  outline: 3px solid var(--color-primary-dark, #3a5a7c);
  outline-offset: 2px;
  border-radius: 6px;
}
[data-theme="contrast"] *:focus-visible,
[data-theme="cvi"] *:focus-visible { outline-color: #ffe600; }

/* Größere Touch-Targets (WCAG 2.5.5): Toggle-Trefferfläche + Slider-Thumb */
.toggle { min-height: 44px; min-width: 56px; }
.settings-slider { height: 28px; }
.settings-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; border-radius: 50%; background: var(--color-primary, #4b698c); cursor: pointer; }
.settings-slider::-moz-range-thumb { width: 30px; height: 30px; border: none; border-radius: 50%; background: var(--color-primary, #4b698c); cursor: pointer; }
.statusbar__brand { min-height: 48px; }

/* ===== Statusbar: Themen + Schmal-Layout ================================ */
[data-theme="cvi"] .statusbar__btn { background: #000; color: #ffe600; border-color: #ffe600; }
[data-theme="cvi"] .statusbar__btn.is-on { background: #ffe600; color: #000; }
[data-theme="cvi"] .statusbar__avatar { background: #ffe600; color: #000; border-color: #ffe600; }
[data-theme="cvi"] .sb-lang-menu, [data-theme="cvi"] .sb-avatar-menu { background: #000 !important; border-color: #ffe600 !important; }
[data-theme="cvi"] .sb-lang-menu button, [data-theme="cvi"] .sb-avatar-menu button { color: #ffe600 !important; }
@media (max-width: 560px) {
  .statusbar { padding: 8px 10px; gap: 4px; }
  .statusbar__btn { min-width: 42px; min-height: 42px; padding: 8px 10px; }
  .statusbar__brand span:not(.statusbar__brand-logo) { display: none; } /* nur Logo auf Schmal */
}

/* ===== Mein Bereich (Nutzer-Hub) ======================================== */
.hub-top { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 20px; }
.hub-top__greet { font-family: 'Merriweather', Georgia, serif; font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700; color: var(--color-primary-dark, #3a5a7c); }
.hub-top__sub { font-size: 1.05rem; color: var(--color-text-secondary, #4a4a4a); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.hub-tile {
  position: relative; border: 3px solid var(--tile-color, #4b698c); border-radius: 24px;
  overflow: hidden; cursor: pointer; padding: 0; background: var(--color-primary-bg, #eef2f7);
  aspect-ratio: 16/10; box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  transition: transform 0.15s, box-shadow 0.15s;
}
.hub-tile:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.16); }
.hub-tile__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hub-tile__glow { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.62), transparent 55%); }
.hub-tile__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; }
.hub-tile__title { color: #fff; font-weight: 800; font-size: 1.25rem; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.hub-tile__star {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(255, 251, 235, 0.95); color: #f59e0b;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.hub-tile__star i, .hub-tile__star svg { width: 24px; height: 24px; fill: currentColor; stroke: currentColor; }
.hub-hint { margin-top: 18px; font-size: 0.95rem; color: var(--color-text-muted, #525252); text-align: center; }
.hub-empty { text-align: center; padding: 40px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hub-empty__icon {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: var(--color-primary-bg, #eef2f7); color: var(--color-primary, #4b698c);
}
.hub-empty__icon i, .hub-empty__icon svg { width: 32px; height: 32px; }
.hub-empty__text { max-width: 46ch; color: var(--color-text-secondary, #4a4a4a); line-height: 1.5; margin: 0; }
[data-theme="cvi"] .hub-tile { border-color: #ffe600; background: #1a1a00; }
[data-theme="cvi"] .hub-top__greet, [data-theme="cvi"] .hub-top__sub { color: #ffe600; }

/* ===== Gamification ===================================================== */
/* Statusbar-Sterne (Sammel-Motivator) */
.statusbar__stars {
  display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 4px 12px;
  border: none; border-radius: 999px; cursor: pointer; font-weight: 800; font-size: 0.95rem;
  background: linear-gradient(135deg, #ffe28a, #ffc83d); color: #6b4e00;
  box-shadow: 0 2px 6px rgba(245,158,11,0.35);
}
.statusbar__stars-icon { font-size: 1.05rem; line-height: 1; }

/* Ergebnis: schwebende Belohnungs-Ballons */
.result-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.result-balloon {
  position: absolute; bottom: -120px; width: 88px; height: auto;
  animation: balloon-rise 3.4s ease-out forwards;
}
@keyframes balloon-rise {
  0%   { transform: translateY(0) rotate(-4deg); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-90vh) rotate(4deg); opacity: 0; }
}
.page-result { position: relative; }
.result-card { position: relative; z-index: 1; }

/* Verdiente Sterne (1–3) */
.result-stars { display: flex; justify-content: center; gap: 10px; margin: 6px 0 4px; }
.result-star { font-size: 2.6rem; color: #d9dce3; line-height: 1; transition: color .2s; }
.result-star.is-on { color: #f5a623; animation: star-pop .5s ease-out both; }
@keyframes star-pop {
  0% { transform: scale(0.2) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* Verdienter Sticker */
.result-sticker {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 10px auto 4px; padding: 10px 16px; max-width: 380px;
  background: var(--color-primary-bg, #eef4fb); border-radius: 14px;
}
.result-sticker__emoji { font-size: 2.4rem; line-height: 1; animation: star-pop .5s .2s both; }
.result-sticker__text { font-weight: 700; font-size: 0.98rem; text-align: left; }
.result-card__total { margin-top: 6px; font-weight: 700; color: var(--color-text-secondary, #4a4a4a); }
.result-card__total-star { color: #f5a623; }

/* Auswertungs-Kennzahlen */
.result-metrics {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin: 14px auto 6px; max-width: 460px;
}
.result-metric {
  flex: 1 1 90px; min-width: 84px; padding: 10px 6px; border-radius: 12px;
  background: var(--color-primary-bg, #eef4fb);
}
.result-metric__val { font-size: 1.5rem; font-weight: 800; color: var(--color-primary-dark, #3a5a7c); }
.result-metric__lbl { font-size: 0.78rem; color: var(--color-text-secondary, #4a4a4a); }
[data-theme="cvi"] .result-metric { background: #1a1a1a; }
[data-theme="cvi"] .result-metric__val { color: #ffe600; }

/* Sammlung-Screen */
.coll-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 22px; }
.coll-stat {
  text-align: center; padding: 16px 8px; border-radius: 16px; background: #fff;
  border: 1px solid var(--color-border, #e4e7ee); border-top: 4px solid var(--c, #4b698c);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.coll-stat__icon { font-size: 1.8rem; }
.coll-stat__value { font-size: 1.8rem; font-weight: 800; color: var(--c, #4b698c); }
.coll-stat__label { font-size: 0.82rem; color: var(--color-text-secondary, #4a4a4a); }
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; }
.coll-sticker {
  text-align: center; padding: 14px 8px; border-radius: 16px; background: #fff;
  border: 1px solid var(--color-border, #e4e7ee); box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.coll-sticker__emoji { font-size: 2.6rem; line-height: 1.1; }
.coll-sticker__label { font-weight: 700; font-size: 0.9rem; margin-top: 4px; }
.coll-sticker__count { font-size: 0.85rem; color: #f59e0b; font-weight: 800; }
.coll-empty { text-align: center; padding: 30px 16px; }
.coll-empty__emoji { font-size: 3.4rem; }
.coll-empty p { color: var(--color-text-secondary, #4a4a4a); margin: 8px 0 16px; }

/* ===== Scanning-Bericht (druckfertig) ================================== */
.page-report-doc { max-width: 820px; margin: 0 auto; color: #1a1a1a; }
.report-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  padding-bottom: 16px; margin-bottom: 8px; border-bottom: 3px solid var(--color-primary, #4b698c);
}
.report-brand { display: flex; align-items: center; gap: 12px; }
.report-brand__logo { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--color-primary, #4b698c); color: #fff; font-weight: 800; }
.report-brand__logo img { width: 100%; height: 100%; object-fit: cover; }
.report-brand__name { font-size: 1.5rem; font-weight: 800; color: var(--color-brand-deep, #1a3a6a); line-height: 1; }
.report-brand__sub { font-size: 0.95rem; color: var(--color-text-secondary, #4a4a4a); }
.report-meta { text-align: right; font-size: 0.9rem; }
.report-meta__line { margin: 2px 0; }
.report-meta__label { color: var(--color-text-muted, #525252); }
.report-meta__val { font-weight: 700; }

.report-section { margin: 18px 0; }
.report-section__title { font-size: 1.15rem; font-weight: 800; color: var(--color-primary-dark, #3a5a7c); margin: 0 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--color-border, #e4e7ee); }

.report-deflist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; }
.report-def { display: flex; justify-content: space-between; gap: 12px; font-size: 0.95rem; border-bottom: 1px dotted #d8dde6; padding-bottom: 4px; }
.report-def__label { color: var(--color-text-secondary, #4a4a4a); }
.report-def__val { font-weight: 700; text-align: right; }

.report-kpis { display: flex; flex-wrap: wrap; gap: 12px; }
.report-kpi { flex: 1 1 120px; text-align: center; padding: 14px 8px; border-radius: 14px; background: var(--color-primary-bg, #eef4fb); border: 1px solid var(--color-border, #e4e7ee); }
.report-kpi__val { font-size: 1.8rem; font-weight: 800; color: var(--color-primary-dark, #3a5a7c); }
.report-kpi__lbl { font-size: 0.82rem; color: var(--color-text-secondary, #4a4a4a); }

.report-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.report-table th { text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--color-text-muted, #525252); padding: 6px 8px; border-bottom: 2px solid var(--color-border, #e4e7ee); }
.report-table td { padding: 8px; border-bottom: 1px solid #eef; }
.report-table__label { font-weight: 700; }
.report-table__value { font-weight: 800; color: var(--color-primary-dark, #3a5a7c); white-space: nowrap; }
.report-table__interp { color: var(--color-text-secondary, #4a4a4a); }
.report-row-muted td { color: #9aa3b2; }
.report-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--color-primary, #4b698c); color: #fff; font-weight: 700; font-size: .82rem; }

.report-tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.report-tip { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border-left: 4px solid #94a3b8; background: #f8fafc; font-size: 0.95rem; line-height: 1.45; }
.report-tip__icon i { width: 20px; height: 20px; }
.report-tip--good { border-left-color: #10b981; background: #ecfdf5; }
.report-tip--good .report-tip__icon { color: #10b981; }
.report-tip--warn { border-left-color: #f59e0b; background: #fffbeb; }
.report-tip--warn .report-tip__icon { color: #d97706; }
.report-tip--info { border-left-color: #4b698c; background: #eef4fb; }
.report-tip--info .report-tip__icon { color: #4b698c; }
.report-empty { padding: 20px; text-align: center; color: var(--color-text-secondary, #4a4a4a); background: var(--color-primary-bg, #eef4fb); border-radius: 12px; }
.report-text { font-size: 0.95rem; color: var(--color-text-secondary, #2f2f2f); margin: 0; }
.report-footer { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--color-border, #e4e7ee); font-size: 0.78rem; color: var(--color-text-muted, #6b7280); }
.report-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* Druck: nur den Bericht, kein App-Chrome */
@media print {
  .statusbar, .bottom-nav, .skip-link, #aria-status, .report-actions { display: none !important; }
  body, #app, #app-content { background: #fff !important; }
  #app-content { padding: 0 !important; }
  .page { padding: 0 !important; }
  .page-report-doc { max-width: 100%; }
  .report-section, .report-tip, .report-kpi, .report-table tr { page-break-inside: avoid; }
  .report-kpi, .report-tip, .report-def { box-shadow: none !important; }
  a[href]:after { content: ''; }
}

/* prefers-reduced-motion: Scan-Skalierung/Animationen neutralisieren */
@media (prefers-reduced-motion: reduce) {
  .scan-focus, .scan-selected, .stufe-card, .act-tile, .hub-tile { transform: none !important; }
  .scan-recovery { transition: none !important; }
  .result-balloon { animation: none !important; opacity: 0.9; bottom: auto; top: 10%; }
  .result-star.is-on, .result-sticker__emoji { animation: none !important; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 8px; top: 8px; background: #fff; padding: 8px 14px; z-index: 100; border-radius: 8px; }

@media (max-width: 600px) {
  .scan-grid--row { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .scan-card__emoji { font-size: 2.4rem; }
  .runner-bar__name { font-size: 1rem; }
}
