/* SPDX-License-Identifier: Apache-2.0 · © 2026 St.-Antonius-Gymnasium Lüdinghausen */

/* ── DESIGN TOKENS ──────────────────────────────── */
:root {
  --bg:      #17151A;
  --surface: #221F26;
  --surf2:   #2A262F;
  --border:  #3A3540;
  --text:    #F1EEE9;
  --muted:   #A59E96;
  --accent:  #7DA2F5;
  --on-hue:  #171419;          /* Schriftfarbe auf Modulfarben-Flächen */
  --c-img:   #7DA2F5; --t-img:   #232C42;
  --c-audio: #E58BD4; --t-audio: #392335;
  --c-pose:  #4CC496; --t-pose:  #1D3229;
  --c-draw:  #F2AC45; --t-draw:  #382B17;
  --c-face:  #F08080; --t-face:  #3A2322;
  --c-data:  #A493F2; --t-data:  #2A2440;
  --green:   #4CC496;
  --red:     #F08080;
  --radius:  16px;
  --font-ui:   system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', 'Fira Mono', 'Courier New', monospace;
}

/* ── LIGHT THEME ─────────────────────────────────── */
html[data-theme="light"] {
  --bg:      #F4F1EA;
  --surface: #FFFFFF;
  --surf2:   #F5F1E9;
  --border:  #E5E0D6;
  --text:    #232020;
  --muted:   #6E6862;
  --accent:  #2050C4;
  --on-hue:  #FFFFFF;
  --c-img:   #2050C4; --t-img:   #E4EDFF;
  --c-audio: #A63795; --t-audio: #FBE7F7;
  --c-pose:  #096847; --t-pose:  #DFF5EB;
  --c-draw:  #8F5500; --t-draw:  #FFF1DA;
  --c-face:  #B23030; --t-face:  #FFE7E4;
  --c-data:  #5341BE; --t-data:  #ECE8FF;
  --green:   #096847;
  --red:     #B23030;
}
html[data-theme="light"] #home {
  background:
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(59,92,232,.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 80% 20%, rgba(214,51,84,.06) 0%, transparent 60%),
    var(--bg);
}
html[data-theme="light"] .code-block {
  background: #1e2030; color: #a0aec0;
}
html[data-theme="light"] .draw-wrap { background: #fff; }
html[data-theme="light"] .audio-viz { background: var(--surf2); }

/* ── THEME TOGGLE SWITCH ─────────────────────────── */
#theme-toggle {
  position: fixed;
  bottom: 14px; right: 14px;  /* unten: verdeckt so nicht mehr den Hilfe-Button */
  z-index: 9000;
  display: flex; align-items: center; gap: 7px;
  background: var(--surf2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 10px 5px 8px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  transition: background .2s, border-color .2s;
  user-select: none;
}
#theme-toggle:hover { background: var(--border); }

.theme-toggle-icon { font-size: 0.9rem; line-height: 1; }

/* The pill track */
.theme-toggle-track {
  width: 30px; height: 17px;
  background: var(--border);
  border-radius: 9px;
  position: relative;
  transition: background .25s;
  flex-shrink: 0;
}
html[data-theme="light"] .theme-toggle-track {
  background: var(--accent);
}

/* The knob */
.theme-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: white;
  transition: transform .22s cubic-bezier(.4,0,.2,1);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
html[data-theme="light"] .theme-toggle-track::after {
  transform: translateX(13px);
}


/* ── RESET ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
}

/* ── LAYOUT: SCREENS ────────────────────────────── */
.screen           { display: none; min-height: 100dvh; flex-direction: column; }
.screen.is-active { display: flex; }

/* ── TOP BAR ────────────────────────────────────── */
.top-bar {
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.top-bar h2      { font-size: 1rem; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Schmale Bildschirme: Statustext weglassen (Punkt bleibt), damit
   die Leiste nicht über den Rand läuft */
@media (max-width: 480px) {
  .top-bar { padding: 12px 12px; gap: 8px; }
  .status-pill span { display: none; }
}
.btn-back {
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: 8px; padding: 6px 12px;
  color: var(--text); cursor: pointer;
  font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600;
}
.btn-back:hover  { background: var(--border); }

/* ── STATUS DOT ─────────────────────────────────── */
.status-pill {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 0.65rem; color: var(--muted);
}
.dot              { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.dot.is-on        { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.is-loading   { background: #f59e0b; animation: blink .8s infinite; }
@keyframes blink  { 0%,100%{opacity:1} 50%{opacity:.2} }

/* ── HOME: HERO ─────────────────────────────────── */
#home {
  background:
    radial-gradient(ellipse 60% 40% at 20% 80%, rgba(79,110,247,.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 35% at 80% 20%, rgba(244,63,94,.10) 0%, transparent 60%),
    var(--bg);
}
.hero {
  text-align: center;
  padding: 56px 24px 32px;
}
.hero-logo {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--c-img), var(--c-audio));
  border-radius: 22px; font-size: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  box-shadow: 0 0 40px rgba(79,110,247,.3);
}
.hero h1 {
  font-size: 2.4rem; font-weight: 800;
  letter-spacing: -0.04em; line-height: 1.1; margin-bottom: 12px;
}
.hero h1 em { font-style: normal; color: var(--c-img); }
.hero p     { font-size: 0.9rem; color: var(--muted); max-width: 420px; margin: 0 auto 8px; line-height: 1.6; }
.privacy-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(34,197,94,.1); border: 1px solid rgba(34,197,94,.25);
  border-radius: 20px; padding: 4px 12px;
  font-size: 0.72rem; color: var(--green); margin-top: 16px;
}
.hero-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ── HOME: MODULE GRID ───────────────────────────── */
.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 16px 18px 28px;
  width: 100%;
}

/* ── HOME: GROSSE BILDSCHIRME ────────────────────────
   Inhalt zentrieren und begrenzen, damit die Seite auf
   Desktop-Monitoren nicht leer wirkt: größerer Hero,
   3-spaltiges Raster mit kräftigeren Karten. */
@media (min-width: 900px) {
  #home { align-items: center; justify-content: center; }
  .hero, .module-grid { max-width: 1080px; margin-inline: auto; }
  .hero        { padding: 40px 24px 28px; }
  .hero-logo   { width: 92px; height: 92px; font-size: 46px; border-radius: 26px; }
  .hero h1     { font-size: 3.1rem; }
  .hero p      { font-size: 1rem; max-width: 540px; }
  .module-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    padding: 24px 24px 48px;
  }
  .module-card      { padding: 26px 22px; }
  .module-icon      { font-size: 2.3rem; margin-bottom: 12px; }
  .module-card h3   { font-size: 1.05rem; }
  .module-card p    { font-size: 0.84rem; }
}
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  cursor: pointer;
  transition: transform .2s, border-color .2s;
}
.module-card:hover  { transform: translateY(-2px); border-color: var(--accent); }
.module-card:active { transform: scale(.97); }
.module-card.is-idea { opacity: .45; cursor: default; }
.module-card.is-idea:hover { transform: none; }
.module-icon { font-size: 1.8rem; margin-bottom: 10px; display: block; }
.module-card h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 6px; }
.module-card p  { font-size: 0.78rem; color: var(--muted); line-height: 1.5; }
.module-tag {
  display: inline-block; font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em; align-self: flex-start;
  border-radius: 4px; padding: 2px 6px; margin-bottom: 8px;
  border: 1px solid var(--border); color: var(--muted);
}

/* ── CARD CONTAINER ──────────────────────────────── */
.mod-content {
  flex: 1; overflow-y: auto;
  padding: 18px;
  display: flex; flex-direction: column; gap: 14px;
}

/* ── MODUL-SPALTEN ────────────────────────────────────
   Mobil: alles untereinander. Auf breiten Bildschirmen:
   Kamera/Zeichenfläche links (bleibt beim Scrollen sichtbar),
   Klassen + Training rechts – so sieht man beim Aufnehmen
   immer, was die Kamera sieht. */
.mod-cols, .mod-col {
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
@media (min-width: 1000px) {
  .mod-content { max-width: 1240px; margin-inline: auto; width: 100%; }
  #mod-data .mod-content, #mod-info .mod-content { max-width: 900px; }
  .mod-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
  }
  /* Medienspalte bleibt beim Scrollen im Blick (Top-Bar ist ~52px hoch) */
  .mod-col-media { position: sticky; top: 66px; }
}

/* ── MODUL-INTRO ──────────────────────────────────────
   Einzeilige, unaufdringliche Erklärung am Kopf jedes Moduls.
   Details stehen weiterhin im ausklappbaren ❓-Hilfe-Panel. */
.mod-intro {
  font-size: 0.78rem; color: var(--muted); line-height: 1.55;
  padding: 8px 12px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.mod-intro strong { color: var(--text); }

/* Hinweiszeile unter den Mimik-Tabs */
.face-tab-hint {
  font-size: 0.75rem; color: var(--muted); line-height: 1.5;
  padding: 8px 14px 10px;
}

/* Zeichen-Canvas an die Spaltenbreite anpassen (sonst läuft es
   beim Verkleinern des Fensters über den Rand hinaus) */
.draw-wrap canvas { width: 100%; height: 100%; display: block; touch-action: none; }

/* ── EXTRAS: k-Regler, Modelltest, Nachbarn, Reset ──── */
.extras { display: flex; flex-direction: column; gap: 10px; margin-top: 12px;
  padding-top: 12px; border-top: 1px dashed var(--border); }
.k-row  { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 0.78rem; }
.k-row label  { font-weight: 600; white-space: nowrap; }
.k-row input[type=range] { flex: 1; min-width: 120px; accent-color: var(--accent); }
.k-hint { font-size: 0.7rem; color: var(--muted); width: 100%; }
.nn-info { font-size: 0.74rem; color: var(--muted); line-height: 1.9; }
.nn-label { font-weight: 600; }
.nn-chip {
  display: inline-block; padding: 1px 8px; border: 1px solid; border-radius: 999px;
  font-weight: 700; font-size: 0.7rem; margin-right: 2px;
}
.btn-eval, .btn-reset-mod {
  border: 1px solid var(--border); background: var(--surf2); color: var(--text);
  border-radius: 8px; padding: 8px 12px; cursor: pointer;
  font-family: var(--font-ui); font-size: 0.78rem; font-weight: 600;
}
.btn-eval:hover, .btn-reset-mod:hover { background: var(--border); }
.btn-reset-mod { color: var(--red, #f43f5e); align-self: flex-start; }
.eval-acc { font-size: 0.82rem; }
.eval-tip, .eval-err { font-size: 0.74rem; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.conf-matrix {
  border-collapse: collapse; margin-top: 8px; font-size: 0.7rem;
  font-family: var(--font-mono);
}
.conf-matrix caption { caption-side: top; text-align: left; color: var(--muted);
  font-family: var(--font-ui); font-size: 0.68rem; padding-bottom: 4px; }
.conf-matrix th, .conf-matrix td {
  border: 1px solid var(--border); padding: 4px 8px; text-align: center;
}
.conf-matrix th { background: var(--surf2); font-weight: 700; }
.conf-matrix td.is-diag { background: rgba(34,197,94,.18); font-weight: 700; }
.conf-matrix td.is-err  { background: rgba(244,63,94,.18); font-weight: 700; }

/* ── BARRIEREFREIHEIT ─────────────────────────────── */
/* Sichtbarer Fokusring bei Tastaturnavigation */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Nur für Screenreader sichtbar */
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Reduzierte Bewegung respektieren (Blink-/Pulse-Animationen aus) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.card    {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.card-hd {
  padding: 10px 14px;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
  background: var(--surf2); border-bottom: 1px solid var(--border);
}
.card-bd { padding: 14px; }

/* ── CLASS CARDS ─────────────────────────────────── */
.class-list { display: flex; flex-direction: column; gap: 10px; }
.cls-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.cls-hd {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  background: var(--surf2); border-bottom: 1px solid var(--border);
}
.cls-stripe { width: 4px; height: 18px; border-radius: 2px; flex-shrink: 0; }
.cls-name {
  flex: 1; background: transparent; border: none;
  font-size: 0.85rem; font-weight: 600; color: var(--text);
  font-family: var(--font-ui); padding: 0;
}
.cls-name:focus { outline: none; text-decoration: underline; }
.cls-count {
  font-size: 0.68rem; color: var(--muted);
  font-family: var(--font-mono); white-space: nowrap;
}
.cls-del    { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.9rem; padding: 0 2px; line-height: 1; }
.cls-del:hover { color: var(--red); }
.cls-act    { display: flex; gap: 6px; padding: 6px 10px 6px; flex-wrap: wrap; }
.cls-thumbs { display: flex; gap: 4px; padding: 0 10px 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; }

.btn-hold {
  flex: 1; border: none; border-radius: 8px; padding: 8px 6px;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.78rem;
  cursor: pointer; transition: transform .1s;
  display: flex; align-items: center; justify-content: center; gap: 5px;
  /* Tablets: Gedrückthalten darf weder scrollen noch Text markieren */
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn-hold:active   { transform: scale(.95); }
.btn-clear-cls     { background: transparent; border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; color: var(--muted); cursor: pointer; font-size: 0.75rem; }
.btn-clear-cls:hover { color: var(--red); border-color: var(--red); }
.cls-thumb-wrap { position: relative; flex-shrink: 0; }
.cls-thumb { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); display: block; }
.cls-thumb-del {
  display: none;
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--red); color: white; border: none;
  font-size: 0.55rem; line-height: 1; cursor: pointer;
  align-items: center; justify-content: center;
}
.cls-thumb-wrap:hover .cls-thumb-del { display: flex; }
.btn-upload-cls {
  background: transparent; border: 1px dashed var(--border);
  border-radius: 8px; padding: 7px 10px; color: var(--muted);
  cursor: pointer; font-size: 0.72rem; font-family: var(--font-ui);
  transition: border-color .15s, color .15s; white-space: nowrap;
}
.btn-upload-cls:hover { border-color: var(--accent); color: var(--accent); }
#mod-audio .btn-upload-cls, #mod-pose .btn-upload-cls { display: none; }
/* ── DIFFICULTY BADGES ───────────────────────────── */
.difficulty-badge {
  display: inline-block; font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  border-radius: 4px; padding: 2px 7px; margin-left: 4px; vertical-align: middle;
}
.difficulty-badge.einsteiger {
  color: var(--green); background: rgba(34,197,94,.1);
  border: 1px solid rgba(34,197,94,.25);
}
.difficulty-badge.fortgeschritten {
  color: #f59e0b; background: rgba(245,158,11,.08);
  border: 1px solid rgba(245,158,11,.25);
}

/* ── FACE MODULE ─────────────────────────────────── */
.face-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--surf2); overflow-x: auto;
}
.face-tab {
  flex: 1; padding: 10px 8px; border: none; background: transparent;
  font-family: var(--font-ui); font-size: 0.72rem; font-weight: 700;
  letter-spacing: .04em; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s; white-space: nowrap;
}
.face-tab.is-active { color: var(--text); border-bottom-color: var(--c-face); }
.face-pane { display: none; flex-direction: column; gap: 14px; }
.face-pane.is-active { display: flex; }
.face-cam-area {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
@media (max-width: 520px) { .face-cam-area { grid-template-columns: 1fr; } }
.face-avatar-canvas {
  width: 100%; aspect-ratio: 1; background: var(--surf2);
  border-radius: var(--radius); display: block;
}
.face-warning {
  background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--radius); padding: 12px 14px;
  font-size: 0.8rem; line-height: 1.7; color: var(--muted);
}
.face-warning strong { color: #f59e0b; }
.face-science-note {
  background: rgba(167,139,250,.06); border: 1px solid rgba(167,139,250,.2);
  border-radius: var(--radius); padding: 12px 14px;
  font-size: 0.78rem; line-height: 1.7; color: var(--muted);
}
.face-science-note strong { color: var(--accent); }
.face-experiment-box {
  background: rgba(34,197,94,.06); border: 1px solid rgba(34,197,94,.2);
  border-radius: var(--radius); padding: 12px 14px;
  font-size: 0.8rem; line-height: 1.7; color: var(--muted);
}
.face-experiment-box strong { color: var(--green); }

/* ── DATA MODULE ─────────────────────────────────── */
.data-feature-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.data-feature-name {
  flex: 1; background: var(--surf2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 10px; color: var(--text);
  font-family: var(--font-ui); font-size: 0.8rem;
}
.data-feature-name:focus { outline: none; border-color: var(--accent); }
.data-feature-del {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 0.9rem; padding: 4px;
}
.data-feature-del:hover { color: var(--red); }
.data-input-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px;
}
.data-input-field { display: flex; flex-direction: column; gap: 3px; }
.data-input-field label {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted);
}
.data-input-field input {
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; color: var(--text);
  font-family: var(--font-mono); font-size: 0.85rem; width: 100%;
}
.data-input-field input:focus { outline: none; border-color: var(--accent); }
.data-dataset-note {
  background: rgba(34,197,94,.06); border: 1px solid rgba(34,197,94,.2);
  border-radius: var(--radius); padding: 10px 14px;
  font-size: 0.75rem; line-height: 1.7; color: var(--muted);
}
.data-dataset-note strong { color: var(--green); }

.btn-add-class {
  width: 100%; background: transparent; border: 1px dashed var(--border);
  border-radius: 10px; padding: 8px; color: var(--muted);
  font-family: var(--font-ui); font-size: 0.82rem; cursor: pointer;
  transition: border-color .15s, color .15s; margin-top: 8px;
}
.btn-add-class:hover { border-color: var(--accent); color: var(--accent); }

/* ── TRAINING PANEL ──────────────────────────────── */
.training-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.info-box {
  padding: 10px 14px;
  font-size: 0.75rem; color: var(--muted);
  border-bottom: 1px solid var(--border); line-height: 1.6;
}
.progress-bar { height: 4px; background: var(--surf2); }
.progress-fill { height: 100%; background: var(--accent); transition: width .3s; width: 0; }
.btn-train {
  width: 100%; border: none; border-radius: 0;
  padding: 14px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.85rem;
  background: linear-gradient(135deg, var(--c-img), var(--accent));
  color: white; transition: filter .2s, transform .2s;
}
.btn-train:hover:not(:disabled) { filter: brightness(1.1); transform: translateY(-1px); }
.btn-train:disabled              { opacity: .35; cursor: not-allowed; transform: none; }
.btn-live {
  width: 100%; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.85rem;
  background: transparent; color: var(--text); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-live:hover:not(:disabled) { background: var(--surf2); }
.btn-live:disabled { opacity: .35; cursor: not-allowed; }
.btn-live.is-active {
  background: rgba(34,197,94,.12); border-color: var(--green); color: var(--green);
}
.train-info { font-size: 0.72rem; color: var(--muted); line-height: 1.5; }

/* ── PREDICTIONS ─────────────────────────────────── */
.pred-list { display: flex; flex-direction: column; gap: 8px; }
.pred-row       { display: flex; align-items: center; gap: 10px; }
.pred-label     { font-size: 0.78rem; font-weight: 600; min-width: 80px; }
.pred-track     { flex: 1; height: 6px; background: var(--surf2); border-radius: 3px; }
.pred-fill      { height: 100%; border-radius: 3px; transition: width .15s; }
.pred-pct       { font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); min-width: 32px; text-align: right; }

/* ── DOWNLOAD ROW ────────────────────────────────── */
.dl-row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-download {
  flex: 1; min-width: 120px; border-radius: var(--radius); padding: 10px;
  font-family: var(--font-ui); font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: filter .15s;
  background: var(--surf2); color: var(--text); border: 1px solid var(--border);
}
.btn-download:hover:not(:disabled) { filter: brightness(1.15); }
.btn-download:disabled { opacity: .35; cursor: not-allowed; }

/* ── INFO TOGGLE ─────────────────────────────────── */
.btn-info-toggle {
  width: 100%; text-align: left; padding: 10px 14px;
  background: var(--surf2); border: none; border-radius: var(--radius);
  font-size: 0.78rem; font-weight: 600; color: var(--muted); cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-info-toggle:hover { background: var(--border); color: var(--text); }
.usage-panel { margin-top: 2px; }
.usage-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--surf2); gap: 2px; overflow-x: auto;
}
.usage-tab {
  padding: 8px 12px; border: none; background: transparent;
  font-size: 0.72rem; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s; font-family: var(--font-ui); white-space: nowrap;
}
.usage-tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.usage-body { padding: 12px 14px; }
.usage-pane { display: none; flex-direction: column; gap: 10px; }
.usage-pane.is-active { display: flex; }
.code-block {
  position: relative;
  background: #0d0f17; border: 1px solid var(--border);
  border-radius: 8px; padding: 14px; padding-top: 32px;
  font-family: var(--font-mono); font-size: 0.72rem;
  color: #a0aec0; line-height: 1.7; overflow-x: auto; white-space: pre;
}
.btn-copy-code {
  position: absolute; top: 8px; right: 8px;
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: 6px; padding: 3px 8px;
  color: var(--muted); font-family: var(--font-ui);
  font-size: 0.62rem; cursor: pointer;
}
.btn-copy-code:hover { background: var(--border); color: var(--text); }
.step-list { display: flex; flex-direction: column; gap: 8px; }
.t-green  { color: var(--green); font-weight: 600; }
.t-yellow { color: #f59e0b; font-weight: 600; }
.t-blue   { color: var(--c-img); font-weight: 600; }

/* ── CAMERA AREA ─────────────────────────────────── */
.video-wrap {
  position: relative; background: #000;
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3;
}
.video-wrap video {
  width: 100%; height: 100%;
  display: block; object-fit: cover;
}
.cam-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
}
.cam-overlay p { font-size: 0.8rem; color: var(--muted); text-align: center; padding: 0 16px; }
.btn-start-cam {
  border: none; border-radius: var(--radius); padding: 10px 20px;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.82rem;
  cursor: pointer; color: white;
}
.cam-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.cam-btns button {
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 12px;
  color: var(--muted); font-family: var(--font-ui); font-size: 0.75rem;
  cursor: pointer; transition: background .15s, color .15s;
}
.cam-btns button:hover { background: var(--border); color: var(--text); }

/* ── POSE MODULE ─────────────────────────────────── */
.pose-status { font-size: 0.75rem; color: var(--muted); text-align: center; padding: 8px 0; }

/* ── AUDIO MODULE ────────────────────────────────── */
.audio-viz     { width: 100%; height: 80px; display: block; background: var(--surf2); border-radius: 8px; }
.rec-indicator { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--muted); }
.btn-mic {
  width: 100%; border: none; border-radius: var(--radius); padding: 12px;
  font-family: var(--font-ui); font-weight: 700; font-size: 0.85rem;
  background: var(--c-audio); color: white; cursor: pointer; transition: filter .15s;
}
.btn-mic:hover { filter: brightness(1.1); }

/* ── DRAW MODULE ─────────────────────────────────── */
.draw-wrap {
  position: relative; background: #fff;
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 1;
}
.draw-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stroke-btns   { display: flex; gap: 4px; }
.btn-stroke {
  width: 32px; height: 32px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surf2);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .1s;
}
.btn-stroke.is-active { background: var(--accent); border-color: var(--accent); }
.hint { font-size: 0.72rem; color: var(--muted); }

/* ── TOAST ───────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surf2); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 10px 18px; font-size: 0.82rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.5); transition: transform .25s;
  max-width: calc(100vw - 32px); width: max-content;
  text-align: center; z-index: 9999;
}
#toast.is-visible { transform: translateX(-50%) translateY(0); }
.spinner {
  display: none; width: 18px; height: 18px;
  border: 2px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ── INFO / HINTERGRUNDWISSEN ────────────────────── */
.info-screen-content {
  flex: 1; overflow-y: auto;
  padding: 0;
}
.info-tabs {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--surf2); gap: 2px; overflow-x: auto;
}
.info-tab {
  padding: 12px 16px; border: none; background: transparent;
  font-size: 0.78rem; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s; font-family: var(--font-ui); white-space: nowrap;
}
.info-tab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.info-pane { display: none; flex-direction: column; gap: 14px; padding: 18px; }
.info-pane.is-active { display: flex; }

.lib-card {
  border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  background: var(--surface);
}
.lib-card-hd {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surf2); border-bottom: 1px solid var(--border);
}
.lib-icon {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; flex-shrink: 0;
}
.lib-card-hd h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 2px; }
.lib-card-hd p  { font-size: 0.72rem; color: var(--muted); }
.lib-card-bd    { padding: 14px 16px; font-size: 0.8rem; line-height: 1.7; color: var(--muted); }
.lib-card-bd strong { color: var(--text); }
.lib-tag {
  display: inline-block; font-size: 0.62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  border: 1px solid var(--border); border-radius: 4px;
  padding: 2px 6px; color: var(--muted); margin-left: 6px;
}

.method-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; padding: 14px; background: var(--surface); }
.method-badge { display: inline-block; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; border: 1px solid var(--border); border-radius: 4px; padding: 2px 7px; color: var(--muted); margin-bottom: 6px; }
.badge-used    { color: var(--accent); border-color: var(--accent); }
.badge-simple  { color: var(--muted); }
.badge-medium  { color: var(--c-draw); border-color: var(--c-draw); }
.badge-complex { color: var(--c-audio); border-color: var(--c-audio); }

.knn-visual { display: flex; flex-direction: column; gap: 10px; }
.knn-step   { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.knn-step:last-child { border-bottom: none; }
.knn-num   {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: white;
  font-size: 0.75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.knn-step-txt { font-size: 0.82rem; line-height: 1.6; color: var(--muted); padding-top: 4px; }
.knn-step-txt strong { color: var(--text); }
.method-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ── HELP PANEL ──────────────────────────────────── */
.help-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 8px;
  background: rgba(255,255,255,.07); border: 1px solid var(--border);
  color: var(--muted); font-size: 0.73rem; font-weight: 600;
  cursor: pointer; transition: background .15s, color .15s;
  font-family: var(--font-ui); white-space: nowrap; flex-shrink: 0;
}
.help-btn:hover { background: rgba(255,255,255,.12); color: var(--text); }
.help-btn[aria-expanded="true"] {
  background: rgba(167,139,250,.12); color: #a78bfa;
  border-color: rgba(167,139,250,.3);
}
.help-panel {
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  display: none; flex-direction: column; gap: 0;
  animation: slideDown .2s ease;
}
.help-panel.is-open { display: flex; }
.help-panel h4 {
  font-size: 0.78rem; font-weight: 700; padding: 10px 14px;
  border-bottom: 1px solid var(--border); color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em;
}
.help-steps { display: flex; flex-direction: column; }
.help-step  { display: flex; gap: 12px; align-items: flex-start; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.help-step:last-child { border-bottom: none; }
.help-step-num {
  width: 22px; height: 22px; flex-shrink: 0;
  background: var(--accent); border-radius: 50%;
  font-size: 0.68rem; font-weight: 700; color: white;
  display: flex; align-items: center; justify-content: center;
}
.help-step-txt { font-size: 0.8rem; line-height: 1.6; color: var(--muted); padding-top: 2px; }
.help-step-txt strong { color: var(--text); }
.help-tip { padding: 10px 14px; font-size: 0.78rem; background: rgba(34,197,94,.06); border-top: 1px solid var(--border); color: var(--green); }

/* ── ADV SUB-TABS ────────────────────────────────── */
.adv-subtabs {
  display: flex; border-bottom: 1px solid var(--border);
  background: var(--surf2); overflow-x: auto;
}
.adv-subtab {
  padding: 9px 14px; border: none; background: transparent;
  font-size: 0.72rem; font-weight: 600; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .15s; font-family: var(--font-ui); white-space: nowrap;
}
.adv-subtab.is-active { color: var(--text); border-bottom-color: var(--accent); }
.adv-pane { display: none; flex-direction: column; gap: 14px; }
.adv-pane.is-active { display: flex; }

.license-badge {
  display: inline-block; font-size: 0.6rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
  background: rgba(34,197,94,.1); color: var(--green);
  border: 1px solid rgba(34,197,94,.3); border-radius: 4px; padding: 2px 6px;
}
.license-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.license-link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem; color: var(--muted); text-decoration: none;
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 9px;
  transition: border-color .15s, color .15s;
}
.license-link:hover { border-color: var(--accent); color: var(--accent); }

.ki-intro-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.ki-intro-card h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 10px; }
.ki-intro-card p  { font-size: 0.83rem; line-height: 1.75; color: var(--muted); margin-bottom: 10px; }
.ki-intro-card p:last-child { margin-bottom: 0; }
.ki-intro-card code {
  font-family: var(--font-mono); font-size: 0.82em;
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px;
}
.lernmethode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 10px 0; }
.lernmethode-item {
  background: var(--surf2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px; text-align: center;
}
.lernmethode-item .lm-icon { font-size: 1.4rem; margin-bottom: 6px; display: block; }
.lernmethode-item h4 { font-size: 0.75rem; font-weight: 700; margin-bottom: 4px; }
.lernmethode-item p  { font-size: 0.72rem; color: var(--muted); line-height: 1.5; }
.lernmethode-item.is-highlight {
  border-color: var(--accent); background: rgba(167,139,250,.08);
}
.lernmethode-item.is-highlight h4 { color: var(--accent); }

.hero-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.oss-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.72rem; color: var(--green); text-decoration: none;
  background: rgba(34,197,94,.08); border: 1px solid rgba(34,197,94,.25);
  border-radius: 20px; padding: 4px 12px; margin-top: 16px;
  transition: background .15s;
}
.oss-badge:hover { background: rgba(34,197,94,.14); }

/* ── KI-ENTSTEHUNGSHINWEIS ───────────────────────── */
.ki-origin-note {
  background: rgba(167,139,250,.06);
  border: 1px solid rgba(167,139,250,.2);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 0.8rem; line-height: 1.7; color: var(--muted);
}
.ki-origin-note strong { color: var(--accent); }
.ki-origin-note a { color: var(--accent); text-decoration: none; border-bottom: 1px solid rgba(167,139,250,.3); }
.ki-origin-note a:hover { border-bottom-color: var(--accent); }

/* ── FOOTER ───────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 20px 16px 28px;
  font-size: 0.72rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 8px;
  line-height: 1.8;
}
.site-footer a {
  color: var(--muted); text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.15);
  transition: color .15s, border-color .15s;
}
.site-footer a:hover { color: var(--text); border-color: rgba(255,255,255,.4); }
.footer-sep { margin: 0 6px; opacity: .4; }

/* ═════════════════════════════════════════════════════
   DESIGN C · „WERKSTATT" — Override-Block (v1.3)
   Farbcodierte Werkbänke, kräftige Rundungen, Buttons mit
   Tiefe. Überschreibt gezielt die Basis-Styles oben; die
   Layout- und Funktions-CSS bleibt unangetastet.
   ═════════════════════════════════════════════════════ */

/* Modul-Farbräume: jede Modulseite kennt ihre Farbe + Tönung */
#mod-img   { --mc: var(--c-img);   --mt: var(--t-img); }
#mod-audio { --mc: var(--c-audio); --mt: var(--t-audio); }
#mod-pose  { --mc: var(--c-pose);  --mt: var(--t-pose); }
#mod-draw  { --mc: var(--c-draw);  --mt: var(--t-draw); }
#mod-face  { --mc: var(--c-face);  --mt: var(--t-face); }
#mod-data  { --mc: var(--c-data);  --mt: var(--t-data); }
#mod-info  { --mc: var(--accent);  --mt: var(--surf2); }

/* ── Größenempfinden auf Desktop: Wirkung wie ~130 % Zoom ── */
@media (min-width: 1440px) { html { font-size: 18px; } }
@media (min-width: 1760px) { html { font-size: 20px; } }
@media (min-width: 1000px) {
  .mod-content { max-width: 78rem; }
  .hero, .module-grid { max-width: 72rem; }
  #mod-data .mod-content, #mod-info .mod-content { max-width: 58rem; }
}

/* ── Startseite: Werkbänke ── */
.hero h1 { font-weight: 900; letter-spacing: -0.03em; }
.hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--c-img), var(--c-pose) 40%, var(--c-draw) 75%, var(--c-face));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-logo { border-radius: 22px; }
.privacy-badge { border-radius: 999px; font-weight: 700; }
.module-card {
  border-radius: 18px;
  background: var(--tint, var(--surface));
  border: 2px solid transparent;
}
.module-card:hover { border-color: var(--accent); box-shadow: none; }
.module-card[data-open="img"]   { --tint: var(--t-img); }
.module-card[data-open="audio"] { --tint: var(--t-audio); }
.module-card[data-open="pose"]  { --tint: var(--t-pose); }
.module-card[data-open="draw"]  { --tint: var(--t-draw); }
.module-card[data-open="face"]  { --tint: var(--t-face); }
.module-card[data-open="data"]  { --tint: var(--t-data); }
.module-icon {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--accent); color: var(--on-hue);
  display: grid; place-items: center; font-size: 1.45rem;
  margin-bottom: 12px;
}
.module-card h3 { font-weight: 850; }
.module-card p  { color: var(--text); opacity: .75; }
.module-tag { display: none; }  /* "Verfügbar" trägt keine Information */
.difficulty-badge {
  background: var(--surface); border: none;
  font-weight: 800; letter-spacing: .08em;
}
.module-card:not(.is-idea)::after {
  content: "Loslegen →"; display: block; margin-top: 10px;
  font-size: 0.8rem; font-weight: 800; color: var(--accent);
}
.module-card.is-idea { opacity: 1; background: transparent; border: 2px dashed var(--border); }

/* ── Modulseiten: getönte Kopfleiste, Karten, Buttons ── */
.top-bar { background: var(--mt, var(--surface)); border-bottom: 3px solid var(--mc, var(--border)); }
.top-bar h2 { font-weight: 900; color: var(--mc); }
.btn-back {
  border-radius: 10px; border-width: 2px; font-weight: 800;
  background: var(--surface);
}
.help-btn { border-radius: 10px; border-width: 2px; font-weight: 800; background: var(--surface); }
.card { border-radius: var(--radius); border-width: 2px; }
.card-hd { font-weight: 850; }
.mod-intro { border-radius: 0 12px 12px 0; border-left-color: var(--mc, var(--accent)); }

.btn-train {
  background: var(--mc, var(--accent));
  color: var(--on-hue);
  border-radius: 12px; font-weight: 900;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.28);
}
.btn-train:disabled { box-shadow: none; }
.progress-fill { background: var(--mc, var(--accent)); }
.btn-hold {
  background: var(--mc, var(--accent)) !important;
  color: var(--on-hue) !important;
  border-radius: 11px;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.28);
}
.btn-hold:active { transform: translateY(1px); box-shadow: inset 0 -2px 0 rgba(0,0,0,.28); }
.btn-live {
  border-radius: 11px; border-width: 2px; font-weight: 800;
}
.btn-start-cam {
  background: var(--mc, var(--accent)) !important;
  color: var(--on-hue) !important;
  border-radius: 11px; font-weight: 850;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.28);
}
.btn-start-cam:disabled { opacity: .75; box-shadow: none; }
.btn-eval, .btn-reset-mod, .btn-download { border-radius: 10px; border-width: 2px; font-weight: 800; }
.face-tab.is-active { border-bottom-color: var(--mc); color: var(--mc); font-weight: 850; }

/* ── Erklärungs-Details (Was ist k? / Wie funktioniert der Test?) ── */
.extras-help summary {
  cursor: pointer; font-size: 0.74rem; font-weight: 800;
  color: var(--mc, var(--accent)); list-style: none;
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: -4px;
}
.extras-help summary::before { content: "ⓘ"; font-weight: 400; }
.extras-help[open] summary::before { content: "▾"; }
.extras-help summary::-webkit-details-marker { display: none; }
.extras-help p {
  font-size: 0.76rem; line-height: 1.65; color: var(--muted);
  background: var(--surf2); border-radius: 10px;
  padding: 10px 12px; margin-top: 6px;
}

/* ── Mimik: Kamera & Avatar deutlich größer ── */
@media (min-width: 1000px) {
  #mod-face .mod-cols { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
}
.face-avatar-canvas { min-height: 220px; border-radius: 14px; }
@media (min-width: 640px) and (max-width: 999px) {
  /* iPad hochkant: Video + Avatar nebeneinander volle Breite nutzen */
  .face-cam-area { gap: 14px; }
}

/* ── Kamerabild in der Höhe deckeln, damit Kamera UND Live-Erkennung
     gemeinsam ohne Scrollen sichtbar bleiben (Desktop wie iPad) ── */
:is(#mod-img, #mod-pose) .mod-col-media .video-wrap {
  width: min(100%, calc((100dvh - 21rem) * 4 / 3));
  margin-inline: auto;
}
