/* ============================================================
   Fremdwort-Trainer — „Premium Apple"
   Apple-System-Typografie (SF Pro) mit engem Tracking, das Wort
   als Held, ruhige Schwarz/Weiß-Palette + Apple-Blau.
   Vanilla CSS, Custom-Properties als Design-Tokens.
   ============================================================ */

/* ---------- Tokens (Dark = Standard) — „Premium Apple" ---------- */
:root {
  --bg: #000000;            /* OLED-Schwarz */
  --bg-2: #1c1c1e;          /* erhöhte Flächen (Inputs, Chips) */
  --card: #1c1c1e;          /* Karten/Sheets */
  --line: #38383a;          /* Apple-Separator (dunkel) */
  --ink: #f5f5f7;           /* Apple-Off-White */
  --muted: #98989d;         /* Apple Secondary Label */
  --accent: #0a84ff;        /* Apple Systemblau (Dark) */
  --accent-2: #409cff;
  --accent-3: #64d2ff;      /* Apple Cyan — Etymologie/Labels */
  --good: #30d158;          /* Apple Grün */
  --again: #ff9f0a;         /* Apple Orange */
  --danger: #ff453a;        /* Apple Rot */
  --on-accent: #ffffff;     /* Text auf Akzentflächen */

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --tap: 48px;
  --gap-section: 24px;
  --tabbar-h: 60px;
  --action-h: 78px;
  --mini-h: 0px;
  /* Kanonische z-Index-Leiter (Stapelordnung ist geprüft korrekt) — Referenz für künftige Elemente,
     damit die Reihenfolge nicht versehentlich gebrochen wird:
     sheet-bar 3 < topbar 5 < tabbar 6 < miniplayer 7 < action-bar 8 < overlay 25 < toast 30 < nowplaying 40 */
  --z-sheet-bar: 3; --z-topbar: 5; --z-tabbar: 6; --z-miniplayer: 7; --z-action-bar: 8;
  --z-overlay: 25; --z-toast: 30; --z-nowplaying: 40;

  --shadow-sm: 0 1px 3px rgba(0,0,0,.40), 0 2px 8px rgba(10,12,20,.30);
  --shadow-md: 0 4px 14px rgba(8,10,18,.40);
  --shadow-lg: 0 10px 34px rgba(6,8,16,.55);

  --ease: cubic-bezier(.25,.46,.45,.94);
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --maxw: 680px;
}

/* ---------- Light = „Premium Apple" (Weiß/Grau, Apple-Blau) ---------- */
:root[data-theme="light"] {
  --bg: #ffffff;
  --bg-2: #f5f5f7;          /* Apple-Sektionsgrau (apple.com) */
  --card: #ffffff;
  --line: #d2d2d7;          /* Apple-Separator (hell) */
  --ink: #1d1d1f;           /* Apple-Signatur-Textfarbe */
  --muted: #6e6e73;         /* Apple Secondary Label */
  --accent: #0071e3;        /* apple.com-Blau */
  --accent-2: #0077ed;
  --accent-3: #0066cc;      /* dunkleres Blau für Label-Text auf Weiß */
  --good: #248a3d;          /* Apple Grün (kontraststark) */
  --again: #b25000;         /* Orange, lesbar auf Weiß */
  --danger: #d70015;        /* Apple Rot (hell) */
  --on-accent: #ffffff;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.05);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --shadow-lg: 0 12px 34px rgba(0,0,0,.16);
}

/* ---------- Schriftgröße ---------- */
:root[data-font="s"] { font-size: 15px; }
:root[data-font="m"] { font-size: 16px; }
:root[data-font="l"] { font-size: 18px; }

/* ---------- Reset / Basis ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  padding-bottom: env(safe-area-inset-bottom);
  overscroll-behavior-y: none;
  overflow-x: hidden; /* kein horizontales Seiten-Scrollen — Tabelle scrollt in ihrem eigenen Rahmen */
}
.app { overflow-x: clip; }
.hidden { display: none !important; }
body.has-mini { --mini-h: 86px; }
.muted { color: var(--muted); }
.error { color: var(--danger); min-height: 1.2em; }

/* ---------- Display-Typografie ---------- */
h1, h2, h3, .brand, .lemma, .now-word, .sg-span, .display {
  font-family: var(--display);
  letter-spacing: -.021em;   /* Apple-Headlines: enges Tracking */
}
h2 {
  font-size: 1.55rem; font-weight: 700; letter-spacing: -.022em;
  margin: 6px 0 var(--gap-section); color: var(--ink);
}
h3 { font-size: 1.2rem; font-weight: 600; margin: 0 0 14px; letter-spacing: -.018em; }

/* ---------- Icons ---------- */
.ic {
  width: 1.4em; height: 1.4em; flex: 0 0 auto;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  vertical-align: -0.18em;
}
.ic-fill { fill: currentColor; stroke: none; }

/* ---------- Login ---------- */
.login {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: radial-gradient(125% 80% at 50% -10%, #2a261c 0%, var(--bg) 65%);
  padding: 24px;
}
.login-card { text-align: center; max-width: 340px; }
.login-card h1 { font-family: var(--display); font-size: 2.1rem; font-weight: 700; margin: 0 0 6px; letter-spacing: -.03em; }
.login-card p { color: var(--muted); margin: 0 0 28px; }

/* ---------- App-Shell ---------- */
.app { max-width: var(--maxw); margin: 0 auto; min-height: 100vh; min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; padding-top: calc(12px + env(safe-area-inset-top));
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 1.18rem; font-weight: 600; letter-spacing: .01em; }
/* Top-Navigation: auf breiten Screens (Notebook) sichtbar, ersetzt dort die untere Tab-Leiste */
.topnav { display: none; }
.topnav-link { text-decoration: none; color: var(--muted); font-weight: 600; font-size: .95rem; padding: 7px 12px; border-radius: var(--radius-sm); transition: color .15s var(--ease), background-color .15s var(--ease); }
.topnav-link.active { color: var(--accent-2); background: color-mix(in oklab, var(--accent) 14%, transparent); }
@media (hover: hover) { .topnav-link:hover { color: var(--ink); } }
@media (min-width: 720px) {
  .topnav { display: flex; gap: 4px; }
  .tabbar { display: none; }
  #main { padding-bottom: calc(var(--mini-h) + env(safe-area-inset-bottom) + 28px); }
  /* Auf breiten Screens gibt es keine untere Tab-Leiste → tabbar-h nicht abziehen. */
  #screen-ueben.reviewing { min-height: calc(100dvh - 96px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
}
#main { padding: 18px 18px calc(var(--tabbar-h) + var(--mini-h) + env(safe-area-inset-bottom) + 22px); }
.screen { animation: screen-in .14s var(--ease) both; }
@keyframes screen-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Screens mit sticky Daumen-Aktionszone (Aktionsleiste sitzt selbst im Fluss) */
.screen--action { padding-bottom: 0; }

/* ---------- Formulare ---------- */
.lbl {
  display: block; font-size: .8rem; color: var(--muted);
  letter-spacing: .04em; text-transform: uppercase; margin: 0 0 8px;
}
.field { margin: 16px 0; }
textarea, input[type="text"], input[type="file"], select {
  width: 100%; padding: 13px 14px; font-size: 1rem;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: inherit; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea:focus, input[type="text"]:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 26%, transparent);
}
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
select {
  min-height: var(--tap); appearance: none; -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2398989d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.hint { color: var(--muted); font-size: .86rem; margin: 8px 0; line-height: 1.45; }
.row { margin: 14px 0; }
.check { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.status { min-height: 1.3em; color: var(--accent-2); margin: 12px 0; font-size: .92rem; }

/* ---------- Buttons (einheitliches System) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); width: 100%;
  padding: 12px 18px; font-size: 1rem; font-weight: 600;
  font-family: var(--body);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); color: var(--ink); cursor: pointer;
  transition: transform .08s var(--ease), background-color .15s var(--ease), border-color .15s var(--ease), opacity .15s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.975); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 40%, transparent); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  color: var(--on-accent); border: none; box-shadow: var(--shadow-sm);
}
.btn-secondary { background: transparent; border-color: var(--accent); color: var(--accent-2); }
.btn-good { background: var(--good); border: none; color: #f1f8f2; }
.btn-again { background: transparent; border-color: var(--again); color: var(--again); }
.btn-hard { background: transparent; border-color: #c79234; color: #cf9b3f; }
.btn-easy { background: transparent; border-color: var(--accent); color: var(--accent-2); }
.btn-destructive { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-ghost {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: .92rem; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px; border-radius: var(--radius-sm);
}
.btn-ghost:active { transform: scale(.96); }
.topbar-actions .btn-ghost { min-width: 44px; min-height: 44px; justify-content: center; } /* Daumen-Ziel: +/Zahnrad/Abmelden auf 44px */
/* Lade-Zustand */
.btn-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn-loading::after {
  content: ""; position: absolute; width: 18px; height: 18px;
  border: 2px solid color-mix(in oklab, currentColor 35%, transparent);
  border-top-color: var(--on-accent); border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn-secondary.btn-loading::after, .btn.btn-loading::after { border-top-color: var(--accent-2); }
@keyframes spin { to { transform: rotate(360deg); } }

/* Sichtbarer Fokus-Ring für ALLE interaktiven Elemente (Tastatur-Navigation, WCAG 2.4.7) */
:where(.iconbtn, .chip, .tagchip, .tab, .track, .mp-btn, .ctrl, .btn-ghost,
  .seg button, .lib-view button, .method-picker button, [role="button"]):focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 40%, transparent);
  border-radius: var(--radius-sm);
}

/* Kreis-Icon-Button (Listen, Detail) */
.iconbtn {
  width: 44px; height: 44px; flex: 0 0 auto;
  border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .08s var(--ease), background-color .15s;
}
.iconbtn:active { transform: scale(.92); }
.iconbtn.sm { width: 38px; height: 38px; }
.iconbtn .ic { width: 20px; height: 20px; }

/* ---------- Chips (chip + tagchip vereint) ---------- */
.chip, .tagchip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 8px 15px;
  font-size: .85rem; font-weight: 500;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; transition: transform .08s var(--ease), background-color .15s, border-color .15s, color .15s;
}
.tagchip { min-height: 32px; padding: 5px 13px; color: var(--muted); font-size: .8rem; }
.chip:active, .tagchip:active { transform: scale(.95); }
.chip.on, .tagchip.on {
  background: color-mix(in oklab, var(--accent) 22%, var(--bg-2));
  border-color: var(--accent); color: var(--accent-2); font-weight: 600;
}

/* ---------- Segmented Control ---------- */
.seg {
  display: inline-flex; width: 100%;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); padding: 3px; gap: 3px;
}
.seg button {
  flex: 1; background: transparent; color: var(--muted); border: none;
  padding: 9px 12px; min-height: 42px; cursor: pointer;
  font-family: var(--body); font-size: .9rem; font-weight: 600;
  border-radius: calc(var(--radius) - 4px);
  transition: background-color .18s var(--ease), color .18s var(--ease);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.seg button.on {
  background: var(--card); color: var(--accent-2);
  box-shadow: var(--shadow-sm);
}
.seg.seg-inline { width: auto; }

/* Methoden-Picker (wrappende Chips für viele Lernmodi) */
.method-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.method-picker button {
  background: var(--bg-2); color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 9px 15px; min-height: 42px; cursor: pointer;
  font-family: var(--body); font-size: .9rem; font-weight: 600;
  transition: transform .08s var(--ease), background-color .15s, border-color .15s, color .15s;
}
.method-picker button:active { transform: scale(.95); }
.method-picker button.on {
  background: color-mix(in oklab, var(--accent) 22%, var(--bg-2));
  border-color: var(--accent); color: var(--accent-2);
}

/* KI-Coaching-Block (Sterne + Tipp) */
.coach { margin-top: 12px; padding: 12px 14px; background: color-mix(in oklab, var(--accent) 12%, var(--card)); border: 1px solid var(--accent); border-radius: var(--radius); }
.coach-stars { color: var(--accent-2); font-size: 1.15rem; letter-spacing: 2px; }
.coach-tip { color: var(--ink); font-size: .9rem; margin-top: 4px; line-height: 1.45; }

/* ---------- Erfassen ---------- */
.capture-actions { display: flex; gap: 10px; margin: 12px 0; }
.capture-actions .btn { width: auto; flex: 1; }
.btn.rec { background: var(--again); color: #fff; border: none; }
.btn.rec .ic { animation: pulse-rec 1.2s ease-in-out infinite; }
@keyframes pulse-rec { 50% { opacity: .4; } }

/* KI-Vorschlag */
.suggest-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 14px 16px; margin: 14px 0;
  box-shadow: var(--shadow-sm);
  animation: banner-in .3s var(--ease) both;
}
@keyframes banner-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.suggest-banner .sg-main { flex: 1; min-width: 170px; }
.sg-cands { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.sg-span { font-weight: 600; color: var(--accent-2); }
.sg-why { font-size: .85rem; color: var(--muted); font-style: italic; }
.sg-type {
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--accent-3); color: var(--accent-3); margin-left: 6px;
}
.suggest-banner .btn { width: auto; min-height: 42px; padding: 9px 18px; flex: 0 0 auto; }

/* Antippbare Wörter */
.tokens { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 12px 0; font-size: 1.08rem; line-height: 1.95; }
.tok { padding: 2px 4px; border-radius: 7px; cursor: pointer; transition: background-color .12s, color .12s; }
.tok:hover { background: var(--bg-2); }
.tok.sel { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.sep { white-space: pre-wrap; }

/* Zuletzt erfasst */
.recent { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.recent .recent-label { color: var(--muted); font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; }

/* Erweitert (Excel + Sonnet) */
.advanced, .import {
  margin-top: var(--gap-section);
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg-2); padding: 0 16px;
}
.advanced > summary, .import summary {
  cursor: pointer; padding: 15px 0; font-weight: 600; list-style: none;
  display: flex; align-items: center; gap: 10px;
}
.advanced > summary::-webkit-details-marker, .import summary::-webkit-details-marker { display: none; }
.advanced[open], .import[open] { padding-bottom: 16px; }
.import input[type="file"] { margin: 10px 0; color: var(--muted); font-size: .9rem; }
#import-preview { font-size: .86rem; margin: 8px 0; }

/* ---------- Persistente Hintergrund-Statusleiste ---------- */
.bg-status {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--tabbar-h) + var(--mini-h) + env(safe-area-inset-bottom));
  max-width: var(--maxw); margin: 0 auto; z-index: 7;
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  background: color-mix(in oklab, var(--card) 94%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--accent);
  font-size: .88rem;
}
.bg-status .bs-label { flex: 1; min-width: 0; }
.bg-status .bs-bar { flex: 0 0 76px; height: 5px; background: var(--bg-2); border-radius: 999px; overflow: hidden; }
.bg-status .bs-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s var(--ease); }

/* ---------- Audio-Leiste (Bibliothek) ---------- */
.audio-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 12px 15px; margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.audio-bar .btn { width: auto; min-height: 42px; padding: 9px 15px; flex: 0 0 auto; }
.audio-bar span:first-child { flex: 1; min-width: 150px; display: inline-flex; align-items: center; gap: 8px; }

/* ---------- Bibliothek-Steuerung ---------- */
.lib-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.lib-controls .lib-search-wrap { flex: 1 1 140px; min-width: 0; position: relative; display: flex; align-items: center; }
.lib-controls #lib-status { width: auto; flex: 0 0 auto; max-width: 40%; }
.lib-controls .lib-search-wrap .ic { position: absolute; left: 12px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.lib-controls #lib-search { min-height: 44px; padding: 10px 12px 10px 38px; }
.lib-controls .btn-ghost {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 13px; color: var(--ink);
  min-height: 44px; white-space: nowrap;
}
.lib-controls .btn-ghost.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

.lib-actions { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.lib-actions .btn { width: auto; min-height: 40px; padding: 9px 14px; }
/* Filter-Chips als EINE horizontal scrollende Zeile statt Chip-Wand */
.lib-cats { display: flex; flex-wrap: nowrap; gap: 8px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.lib-cats::-webkit-scrollbar { display: none; }
.lib-cats .chip { flex: 0 0 auto; }
.lib-cats .chip .cover.xs { margin-right: -1px; }
.cat-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.cat-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cat-row:last-child { border-bottom: none; }
/* Generatives Cover (Farbe + Initialen aus dem Namen) */
.cover {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  width: 48px; height: 48px; border-radius: 12px; color: #fff; font-weight: 700;
  font-size: 1.1rem; letter-spacing: -.02em; box-shadow: var(--shadow-sm);
  font-family: var(--display); text-transform: uppercase; overflow: hidden; user-select: none;
}
.cover.xs { width: 26px; height: 26px; border-radius: 7px; font-size: .62rem; box-shadow: none; }

/* ---------- Start „Für dich heute" ---------- */
.home-hero {
  background: linear-gradient(140deg, color-mix(in oklab, var(--accent) 22%, var(--card)), var(--card));
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; margin-bottom: 24px; display: flex; flex-direction: column; gap: 14px;
}
.home-hero-sub { font-family: var(--display); font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.home-hero .btn { width: auto; align-self: flex-start; }
.home-hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.home-hero-actions .btn { flex: 1; min-width: 140px; align-self: stretch; }
/* Lernen-HOME „Das gesprochene Wort" — WEISS/SCHWARZ Letterpress: das erste Vokabel IST die Vorlese-Taste.
   Erzwungen HELL (unabhängig vom OS-Dark-Mode) und NUR auf dem Home (#start): `body.lp-home` tönt die GETEILTE
   Chrome (Topbar/Tabbar/Hintergrund) hell; Üben/Hören-Session-Screens bleiben dunkel-Apple. */
body.lp-home, body.lp-home #main, body.lp-home #app{ background:#fcfbf9; }
body.lp-home .topbar{ background:rgba(252,251,249,.86); border-bottom-color:#e6e4e0; }
body.lp-home .topbar .brand{ color:#141414; }
body.lp-home .topbar .btn-ghost{ color:#8a8a8a; }
body.lp-home .topbar .btn-ghost:active{ color:#141414; }
body.lp-home .tabbar{ background:rgba(252,251,249,.92); border-top-color:#e6e4e0; }
body.lp-home .tab{ color:#a8a8a6; }
body.lp-home .tab.active{ color:#141414; }
body.lp-home .tab.active::after{ background:#141414 !important; }

.lp-screen{
  --paper:#fcfbf9; --pl-ink:#141414; --pl-ink2:#1a1a1a; --pl-grey:#8a8a8a; --pl-grey2:#a8a8a6; --pl-hair:#e6e4e0; --pl-hair2:#ddd9d3;
  margin: -18px -18px 0;                        /* #main-Padding aufheben → Papier randlos */
  padding: 30px 24px 26px;
  background: var(--paper); color: var(--pl-ink);
}
.lp-screen #start-body{ display:flex; flex-direction:column; min-height: calc(100dvh - var(--tabbar-h) - 112px); }
.lp-greet{ font-family:var(--display); font-size:1.42rem; font-weight:600; letter-spacing:-.022em; color:var(--pl-ink); margin:0; }
.lp-meta{ margin:7px 0 0; font-size:.84rem; color:var(--pl-grey); letter-spacing:.01em; display:flex; align-items:center; gap:9px; }
.lp-meta .lp-dot{ width:3px; height:3px; border-radius:50%; background:var(--pl-grey2); flex:0 0 auto; }
.lp-meta b{ font-weight:600; color:var(--pl-ink2); }
.lp-src{ position:relative; display:inline-flex; align-items:baseline; cursor:pointer; }
.lp-mode{ background:none; border:0; padding:0; font:inherit; color:var(--pl-grey); cursor:pointer; -webkit-tap-highlight-color:transparent; }
.lp-overlay-select{ position:absolute; inset:0; width:100%; height:100%; opacity:0; border:0; cursor:pointer; -webkit-appearance:none; appearance:none; }
.lp-stage{ flex:1 1 auto; display:flex; flex-direction:column; justify-content:center; align-items:flex-start; padding:8px 0; }
.lp-overline{ font-size:.7rem; letter-spacing:.26em; text-transform:uppercase; color:var(--pl-grey2); font-weight:600; margin:0 0 18px 2px; }
.lp-word{ -webkit-appearance:none; appearance:none; background:transparent; border:0; margin:0; padding:0; text-align:left; width:100%; cursor:pointer; color:var(--pl-ink); display:block; position:relative; -webkit-tap-highlight-color:transparent; touch-action:manipulation; transition:transform .18s cubic-bezier(.25,.46,.45,.94); }
.lp-word:active{ transform:translateY(2px); }
.lp-lemma{ font-family:var(--display); font-size:clamp(2.3rem, 13vw, 4rem); line-height:.96; font-weight:700; letter-spacing:-.04em; color:var(--pl-ink); margin:0; position:relative; display:inline-block; padding-left:14px; overflow-wrap:anywhere; }
.lp-lemma::before{ content:""; position:absolute; left:0; top:6%; bottom:14%; width:2px; background:var(--pl-ink); animation:lp-caret 1.9s steps(1,end) infinite; }
@keyframes lp-caret{ 0%,55%{opacity:1;} 56%,100%{opacity:.12;} }
.lp-baseline{ position:relative; height:1px; margin:18px 0 0; overflow:visible; background:var(--pl-hair2); }
/* Der Shimmer animiert background-position (= Repaint, GPU-teuer). Im RUHE-Home pausiert (statische Haarlinie),
   nur während der Vorbereitung (.lp-busy) läuft er — spart Akku auf dem täglich offen liegenden Lernen-Screen. */
.lp-baseline::after{ content:""; position:absolute; inset:0; background:linear-gradient(90deg,transparent 0%,var(--pl-ink) 18%,var(--pl-ink) 30%,transparent 52%); background-size:240% 100%; background-repeat:no-repeat; opacity:.5; animation:lp-shimmer 3.4s linear infinite; animation-play-state:paused; }
.lp-busy .lp-baseline::after{ animation-play-state:running; }
@keyframes lp-shimmer{ 0%{background-position:120% 0;} 100%{background-position:-60% 0;} }
.lp-ipa{ margin:14px 0 0 14px; font-size:1.02rem; color:var(--pl-grey); letter-spacing:.01em; }
.lp-ipa .lp-pos{ font-style:italic; color:var(--pl-grey2); margin-left:10px; font-size:.92em; }
.lp-cue{ margin:22px 0 0 14px; display:inline-flex; align-items:center; gap:10px; font-size:.82rem; color:var(--pl-ink2); font-weight:500; }
.lp-cue .lp-bars{ width:15px; height:15px; color:var(--pl-ink); flex:0 0 auto; }
.lp-cue .lp-bars rect{ animation:lp-vb 1.5s ease-in-out infinite; transform-origin:bottom; }
.lp-cue .lp-bars rect:nth-child(2){ animation-delay:.18s; }
.lp-cue .lp-bars rect:nth-child(3){ animation-delay:.36s; }
@keyframes lp-vb{ 0%,100%{transform:scaleY(.42);} 50%{transform:scaleY(1);} }
.lp-cue .lp-arrow{ color:var(--pl-grey2); }
/* Vorbereitungs-Zustand auf dem weißen Schirm (Session wird gebaut): Wort gedimmt, Cue „Stimme wird vorbereitet …",
   die Stimm-Balken animieren weiter — KEIN Sprung auf den dunklen „Aufnahme wird vorbereitet"-Üben-Screen. */
.lp-busy .lp-word{ opacity:.45; pointer-events:none; }
.lp-busy .lp-lemma::before{ animation:none; opacity:.3; }
.lp-busy .lp-arrow{ display:none; }
.lp-busy .lp-cue{ color:var(--pl-grey); }
.lp-foot{ margin-top:18px; }
.lp-progress{ font-size:.84rem; color:var(--pl-grey); letter-spacing:.005em; display:flex; align-items:center; gap:8px; margin:0 0 14px; padding-top:16px; border-top:1px solid var(--pl-hair); }
.lp-progress .lp-dot{ width:3px; height:3px; border-radius:50%; background:var(--pl-grey2); flex:0 0 auto; }
.lp-progress b{ color:var(--pl-ink2); font-weight:600; }
.lp-pills{ display:flex; gap:10px; }
.lp-pill{ display:inline-flex; align-items:center; gap:7px; border:1px solid var(--pl-hair2); border-radius:999px; padding:7px 13px; font-size:.8rem; color:var(--pl-ink2); font-weight:500; background:transparent; cursor:pointer; -webkit-tap-highlight-color:transparent; }
.lp-pill .lp-n{ font-weight:700; letter-spacing:-.01em; }
.lp-pill .lp-lbl{ color:var(--pl-grey); }
.lp-pill--leech{ border-style:dashed; }
@media (prefers-reduced-motion:reduce){ .lp-baseline::after, .lp-cue .lp-bars rect{ animation:none; } .lp-lemma::before{ animation:none; opacity:1; } }
/* Tippbare Status-Chips (Fällig · Neu · Morgen) → öffnen die jeweiligen Karten */
.stat-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: var(--tap);
  padding: 6px 16px; border-radius: 999px; cursor: pointer;
  background: color-mix(in oklab, var(--card) 70%, transparent);
  border: 1px solid var(--line); color: var(--ink);
  transition: transform .08s var(--ease), border-color .15s var(--ease);
}
.stat-chip:active { transform: scale(.97); }
@media (hover: hover) { .stat-chip:hover { border-color: var(--accent); } }
.stat-chip .sc-num { font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: -.02em; }
.stat-chip .sc-lbl { font-size: .95rem; color: var(--muted); }
.shelf { margin-bottom: 24px; }
.shelf-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; margin: 0 0 12px; }
.shelf-row { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; -webkit-overflow-scrolling: touch; }
.shelf-row::-webkit-scrollbar { display: none; }
.shelf-item {
  flex: 0 0 auto; width: 96px; background: none; border: none; cursor: pointer; padding: 0;
  display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--ink);
}
.shelf-item .cover { width: 96px; height: 96px; border-radius: 16px; font-size: 2rem; }
.shelf-item:active { transform: scale(.96); }
.shelf-label { font-size: .8rem; line-height: 1.2; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover.sm { width: 40px; height: 40px; border-radius: 10px; font-size: .95rem; }
.cover.lg { width: 64px; height: 64px; border-radius: 16px; font-size: 1.5rem; }
/* Playlist-Name als Öffnen-/Bearbeiten-Button */
.pl-name {
  flex: 1; min-width: 0; text-align: left; background: none; border: none; cursor: pointer;
  color: var(--ink); font-family: var(--body); font-size: 1rem; font-weight: 600; padding: 6px 4px;
  border-radius: var(--radius-sm); display: flex; align-items: center; gap: 12px;
}
.pl-name-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .pl-name:hover { color: var(--accent-2); } }
.pl-detail-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
/* Karten-Navigation im Detail (Wischen/Pfeile) */
.card-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 6px 0 12px; }
/* Volle 44px-Tap-Ziele (war .sm = 38px) in der Karten-Navigation UND im Üben-Vollbild-Kopf (prev/next/beenden) */
.card-nav .iconbtn.sm, .ueben-head .iconbtn.sm { width: 44px; height: 44px; }
.card-nav-pos { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .02em; }

/* ---------- Vollbild „Now Playing" ---------- */
.nowplaying { position: fixed; inset: 0; z-index: 40; background: var(--bg); overflow: hidden; animation: np-rise .28s var(--ease); }
@keyframes np-rise { from { transform: translateY(100%); } to { transform: translateY(0); } }
.np-bg { position: absolute; inset: -10%; opacity: .5; filter: blur(70px) saturate(1.2); z-index: 0; }
/* Verlauf reicht früh auf den BG → Wort/Cover sitzen auf solider Fläche (Kontrast in Dark+Light) */
.nowplaying::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 6%, var(--bg) 52%); z-index: 0; pointer-events: none; }
.np-inner {
  position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%;
  max-width: var(--maxw); margin: 0 auto; width: 100%;
  padding: calc(env(safe-area-inset-top) + 12px) 22px calc(env(safe-area-inset-bottom) + 28px);
}
.np-top { display: flex; align-items: center; justify-content: space-between; }
.np-collapse { background: none; border: none; color: var(--ink); cursor: pointer; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.np-collapse .ic { width: 26px; height: 26px; }
.np-eyebrow { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.np-top-spacer { width: 44px; }
.np-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: clamp(14px, 4vw, 24px); text-align: center; min-height: 0; }
.np-art { width: min(58vw, 260px); height: min(58vw, 260px); border-radius: clamp(18px, 5vw, 26px); font-size: clamp(2.8rem, 11vw, 4rem); box-shadow: var(--shadow-lg); }
.np-word { font-family: var(--display); font-size: clamp(1.8rem, 6.5vw, 2.8rem); font-weight: 700; letter-spacing: -.03em; line-height: 1.12; max-width: 92%; }
.np-sub { color: var(--muted); font-size: clamp(.9rem, 3.5vw, 1.05rem); max-width: 90%; }
.np-foot { display: flex; flex-direction: column; gap: 4px; }
.np-foot .controls { justify-content: center; gap: 30px; margin-top: 12px; }
.detail .translation { font-size: 1.1rem; color: var(--accent-2); margin-top: 2px; font-weight: 600; }
.lib-tags { display: flex; flex-wrap: nowrap; gap: 8px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
.lib-tags::-webkit-scrollbar { display: none; }
.lib-tags .tagchip { flex: 0 0 auto; }
.lib-bulk {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--card); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.lib-bulk .btn { width: auto; min-height: 40px; padding: 8px 13px; flex: 0 0 auto; font-size: .9rem; }
.lib-bulk .sel-count { flex: 1; min-width: 96px; font-weight: 600; }
/* „+"-Sammeln: ausgewähltes Icon hervorheben */
.iconbtn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
/* Sticky kontextuelle Auswahl-Leiste (mehrere Karten → Playlist) */
.plpick-bar {
  position: fixed; left: 0; right: 0; z-index: 9;
  bottom: calc(var(--tabbar-h) + var(--mini-h) + env(safe-area-inset-bottom) + 10px);
  max-width: var(--maxw); margin: 0 auto; width: calc(100% - 24px);
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--accent); border-radius: 999px;
  padding: 8px 10px 8px 16px; box-shadow: var(--shadow-lg);
  animation: sheet-up .2s var(--ease) both;
}
.plpick-bar .pp-count { flex: 1; font-weight: 600; font-size: .9rem; }
.plpick-bar .btn { width: auto; min-height: 40px; flex: 0 0 auto; }

/* ---------- Karten-Liste ---------- */
.cards-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.lib-more-wrap { display: flex; justify-content: center; padding: 14px 0 4px; }
.lib-more-wrap .lib-more { width: auto; }
.card-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 13px 15px;
  box-shadow: var(--shadow-sm); transition: transform .1s var(--ease), border-color .15s;
}
.card-row:active { transform: scale(.99); }
@media (hover: hover) { .card-row:hover { border-color: var(--accent); background: var(--bg-2); } }
.card-row .meta:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 40%, transparent); border-radius: var(--radius-sm); }
.cards-table-rich tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.card-row .rowcheck { width: 22px; height: 22px; flex: 0 0 auto; accent-color: var(--accent); }
.card-row .meta { flex: 1; min-width: 0; cursor: pointer; }
.card-row .lemma { font-size: 1.12rem; font-weight: 600; }
.card-row .sub { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.card-row .row-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.card-row .row-tags .t { font-size: .68rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }

.badge { font-size: .7rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.badge.due { color: var(--accent-2); border-color: var(--accent); }
.badge.paused { color: var(--again); border-color: var(--again); }
.badge.leech { color: var(--danger); border-color: var(--danger); margin-left: 5px; }
/* Leech-Hinweis im Üben */
.leech-note {
  background: color-mix(in oklab, var(--danger) 12%, var(--bg-2)); border: 1px solid var(--danger);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink);
}
.leech-note .ic { width: 18px; height: 18px; color: var(--danger); flex: 0 0 auto; }
.leech-note .btn { width: auto; min-height: 38px; }

/* ---------- Tabelle ---------- */
.lib-view { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.lib-view button { background: var(--bg-2); color: var(--muted); border: none; padding: 9px 11px; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; }
.lib-view button.on { background: var(--accent); color: var(--on-accent); }
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; max-width: 100%; }
.cards-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cards-table th, .cards-table td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.cards-table tbody tr:last-child td { border-bottom: none; }
.cards-table th[data-sort] { cursor: pointer; color: var(--muted); font-weight: 600; user-select: none; }
.cards-table tbody tr { cursor: pointer; }
.cards-table tbody tr:active { background: var(--bg-2); }
.cards-table .tcell-lemma { font-weight: 600; }
.cards-table .tcell-tags { color: var(--muted); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }

/* Inhalts-Tabelle (Wort · Bedeutung · Beispiel · Anmerkungen) */
.cards-table-rich td { vertical-align: top; }
.cards-table-rich th { white-space: nowrap; }
.cards-table-rich .tc-word, .cards-table-rich .tcell-lemma { white-space: nowrap; }
.cards-table-rich .tc-clamp { white-space: normal; min-width: 150px; max-width: 240px; color: var(--muted); }
.cards-table-rich .tc-clamp > div {
  display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.cards-table-rich .tc-status { white-space: nowrap; }
.cards-table-rich .tc-act { width: 50px; text-align: center; }
.cards-table-rich .tc-lead { width: 34px; }
.cards-table-rich tbody tr:hover { background: var(--bg-2); }
.cards-table-rich .tc-act .iconbtn { width: 34px; height: 34px; }

/* ---------- Karten-Detail (als Sheet-Inhalt oder inline) ---------- */
.detail { }
.detail .lemma { font-size: 2rem; font-weight: 700; line-height: 1.15; letter-spacing: -.026em; }
.detail .ipa { color: var(--muted); margin-top: 4px; font-family: var(--mono); font-size: .92rem; }
.detail dt {
  font-family: var(--body); color: var(--accent-3); font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; margin-top: 18px;
}
.detail dd { margin: 5px 0 0; line-height: 1.55; }
.detail ul { margin: 5px 0 0; padding-left: 1.15em; }
.detail ul li { margin: 3px 0; }
.detail .orig em { font-style: normal; font-weight: 700; color: var(--accent-2); }
.detail dd.mnemonics li { font-style: italic; }
.detail-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.detail-actions .btn { width: auto; flex: 1; min-width: 120px; }
/* Schmale iPhones (z. B. SE/375px): die 7 Aktionen sauber 2-spaltig umbrechen statt abschneiden. */
@media (max-width: 380px) { .detail-actions .btn { flex: 1 1 calc(50% - 5px); min-width: 0; } }

/* Etymologie/Herkunft als Apparat-Kasten */
.detail dd.origin-box {
  background: color-mix(in oklab, var(--accent-3) 14%, var(--bg-2));
  border-left: 3px solid var(--accent-3);
  padding: 10px 13px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* ---------- Sticky Daumen-Aktionszone ---------- */
/* Z-Index-Leiter unten: tabbar(6) < miniplayer(7) < action-bar(8) < overlay(25) < toast(30) < nowplaying(40) */
.action-bar {
  position: sticky; z-index: 8;
  bottom: calc(var(--tabbar-h) + var(--mini-h) + env(safe-area-inset-bottom));
  display: flex; gap: 12px;
  margin: 18px -18px 0; padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: var(--bg); border-top: 1px solid var(--line);
  box-shadow: 0 -6px 18px color-mix(in oklab, var(--bg) 70%, transparent);
}
.action-bar .btn { box-shadow: var(--shadow-md); }
.action-bar .review-actions { display: flex; gap: 12px; flex: 1; }
.action-bar .review-actions .btn { flex: 1; }

/* ---------- Player / Now-Playing ---------- */
/* Inline-Vorlesen-Player abgeschaltet: Hören läuft jetzt über den Vollbild-Player (#nowplaying).
   Markup bleibt (dormant) damit bestehende Handler nicht ins Leere greifen. */
.player { display: none; }
.np-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 28px 22px 22px; text-align: center; box-shadow: var(--shadow-md);
}
.now-word { font-size: clamp(1.9rem, 7vw, 2.6rem); font-weight: 700; line-height: 1.12; min-height: 1.1em; letter-spacing: -.02em; overflow-wrap: anywhere; hyphens: auto; }
.now-pos { font-size: .9rem; margin-top: 6px; color: var(--muted); font-family: var(--mono); }
.seek { width: 100%; margin: 22px 0 4px; accent-color: var(--accent); height: 22px; }
.times { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
.controls { display: flex; align-items: center; justify-content: center; gap: 26px; margin-top: 18px; }
.ctrl {
  width: 52px; height: 52px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  transition: transform .08s var(--ease), background-color .15s;
}
.ctrl:active { transform: scale(.92); }
.ctrl .ic { width: 24px; height: 24px; }
.ctrl-main {
  width: 72px; height: 72px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--on-accent); border: none;
  box-shadow: var(--shadow-sm);
}
.ctrl-main .ic { width: 30px; height: 30px; }
.ctrl-secs { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.controls-2 { display: flex; justify-content: center; gap: 12px; margin-top: 18px; }
.controls-2 .chip { min-height: 40px; }

.tracklist {
  display: flex; flex-direction: column; gap: 6px; margin-top: 14px;
  max-height: 300px; overflow: auto; -webkit-overflow-scrolling: touch;
}
.track {
  display: flex; gap: 10px; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 13px; color: var(--ink); cursor: pointer; font-size: .94rem; text-align: left;
}
.track:active { transform: scale(.99); }
.track.on { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, var(--card)); color: var(--accent-2); font-weight: 600; }
.track .ti-n { color: var(--muted); font-size: .72rem; min-width: 1.6em; font-variant-numeric: tabular-nums; }

/* ---------- Üben ---------- */
.stats { display: flex; gap: 8px; margin: 4px 0 var(--gap-section); }
.stats .stat { flex: 1; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 6px; text-align: center; box-shadow: var(--shadow-sm); }
.stats .stat .n { font-family: var(--display); font-size: 1.5rem; font-weight: 700; line-height: 1; display: inline-flex; align-items: baseline; gap: 4px; justify-content: center; }
.stats .stat .n .ic { width: 18px; height: 18px; color: var(--again); vertical-align: -2px; }
.stats .stat .l { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 5px; }
.stats .stat-click { cursor: pointer; transition: transform .08s var(--ease), border-color .15s var(--ease); -webkit-tap-highlight-color: transparent; }
.stats .stat-click:active { transform: scale(.96); }
@media (hover: hover) { .stats .stat-click:hover { border-color: var(--accent); } }

/* Lern-Weissagung */
.forecast { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: var(--gap-section); box-shadow: var(--shadow-sm); }
/* Während des Ladens/Aktualisierens sind diese Container kurz leer — dann NICHT als leeres Band mit
   Rahmen/Hintergrund anzeigen (Founder: „die zwei Striche während des Übergangs stören"). */
.forecast:empty, .stats:empty, .heatmap:empty, .lib-cats:empty, .audio-bar:empty, #start-body:empty { display: none; }
/* Ton-Qualitäts-Anzeige (Karten-Detail + Einstellungen) */
.audio-quality { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: .9rem; color: var(--muted); margin: 14px 0 2px; }
.q-badge { display: inline-flex; align-items: center; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid currentColor; }
.q-premium { color: var(--accent-2); }
.q-standard { color: var(--good); } /* on-token + theme-aware statt hartkodiertem Grün (Kontrast) */
.q-none { color: var(--muted); }
.q-fehler { color: var(--again); } /* Ton-Fehler optisch von „Kein Ton" (muted) abheben — dauerhaft kaputt ≠ noch nicht dran */
.forecast .fc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.forecast .fc-rate { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.forecast .fc-rate input[type="range"] { width: 110px; accent-color: var(--accent); }
.forecast .fc-rate b { color: var(--accent-2); font-variant-numeric: tabular-nums; }
.forecast .fc-text { margin-top: 8px; font-size: .92rem; line-height: 1.45; }
.forecast .fc-bars { display: flex; align-items: flex-end; gap: 4px; height: 30px; margin-top: 12px; }
.forecast .fc-bar { flex: 1; background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-radius: 3px 3px 0 0; min-height: 3px; opacity: .9; }
.forecast .fc-axis { display: flex; justify-content: space-between; font-size: .66rem; color: var(--muted); margin-top: 5px; }
.forecast .fc-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 36px; background: none; border: none; padding: 0; color: var(--ink); font: inherit; cursor: pointer; }
.forecast .fc-chevron { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; transition: transform .2s var(--ease); }
.forecast.collapsed .fc-chevron { transform: rotate(-90deg); }
.forecast .fc-rate-row { margin-top: 12px; }

.ueben-bar { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin: 10px 0 16px; }
.ueben-bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0; transition: width .3s var(--ease); }

.review-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; margin: 14px 0; box-shadow: var(--shadow-md);
  animation: reveal-in .28s var(--ease) both;
}
/* Vollbild-Fokus während einer Übungs-Session: Setup-Chrome ausblenden, Karte trägt den Screen */
.ueben-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 2px 0 6px; }
.ueben-head .uh-nav { display: flex; align-items: center; gap: 12px; }
#screen-ueben.reviewing > h2,
#screen-ueben.reviewing #ueben-stats,
#screen-ueben.reviewing #ueben-forecast,
#screen-ueben.reviewing #ueben-heatmap,
#screen-ueben.reviewing .field,
#screen-ueben.reviewing #ueben-progress,
#screen-ueben.reviewing #ueben-bar { display: none; }
/* Üben-Vollbild: Karte füllt die verfügbare Höhe bis zur Tab-Leiste (kein toter Leerraum darunter). */
#screen-ueben.reviewing { display: flex; flex-direction: column; min-height: calc(100dvh - 96px - var(--tabbar-h) - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
#screen-ueben.reviewing #review-card { flex: 1 1 auto; min-height: 0; margin-top: 4px; }
/* Vorderseite (card-stage): keine Bewertungs-/Start-Leiste → Aktionsleiste ausblenden, damit die Karte
   den Platz bis zur Tab-Leiste füllt (sonst reserviert die leere Leiste ~70px = der tote Bereich). */
#screen-ueben.reviewing #review-card.card-stage ~ .action-bar { display: none; }
/* Vorbereitungs-/Ladezustand (Session-MP3 wird gebaut, noch keine Karte): der reviewing-Modus blendet sonst
   ALLES aus (auch die Lade-Meldung) und es bleibt nur die leere Aktionsleiste als zwei Geister-Striche stehen.
   → leere Aktionsleiste verbergen und eine zentrierte Lade-Meldung mit Spinner zeigen. */
#screen-ueben.reviewing.preparing .action-bar { display: none; }
#screen-ueben.reviewing.preparing #ueben-progress {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  margin: auto; padding: 24px; color: var(--muted); text-align: center; font-size: .95rem;
}
#screen-ueben.reviewing.preparing #ueben-progress::before {
  content: ""; width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite;
}
/* Minimal-Lernkarte (audio-first, Referenz-Look): Wort groß auf Verlauf + Play, Tippen deckt auf */
.review-card.card-stage {
  background: linear-gradient(180deg, var(--bg), color-mix(in oklab, var(--accent) 16%, var(--bg)));
  border: none; box-shadow: none; padding: 16px; display: flex; min-height: 0;
}
.card-front { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; cursor: pointer; }
.card-front .cf-badge { display: inline-flex; align-items: center; gap: 5px; font-size: .66rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent-3); }
.cf-word { font-family: var(--display); font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-size: clamp(2.2rem, 9vw, 3.4rem); }
/* Lange deutsche Komposita („Unzuständigkeitserklärung") immer umbrechen statt überlaufen/abschneiden —
   bei einem Fremdwort-Trainer der Normalfall (Muster wie bei .now-word). Gilt für alle großen Wort-Anzeigen. */
.detail .lemma, .cf-word, .r-lemma { overflow-wrap: break-word; word-break: break-word; hyphens: auto; }
.cf-sub { color: var(--muted); font-size: 1.05rem; margin-top: -8px; }
.cf-play { width: 76px; height: 76px; border-radius: 50%; border: none; cursor: pointer; margin-top: 12px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--on-accent);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); }
.cf-play .ic { width: 32px; height: 32px; }
.cf-play:active { transform: scale(.94); }
.cf-hint { color: var(--muted); font-size: .8rem; margin-top: 4px; }
/* Integrierter Karten-Player im Üben (Play/Pause + vor/zurück + Spulen) */
.cf-player { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 340px; margin-top: 8px; }
.cf-ctrls { display: flex; align-items: center; justify-content: center; gap: 28px; }
.cf-ctrls .cf-play { margin-top: 0; }
.cf-ic { width: 48px; height: 48px; border: none; background: transparent; color: var(--ink); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .08s var(--ease); }
.cf-ic .ic { width: 28px; height: 28px; }
.cf-ic:disabled { opacity: .3; pointer-events: none; }
.cf-ic:active { transform: scale(.9); }
.cf-seek { width: 100%; accent-color: var(--accent); height: 22px; }
.cf-time { display: flex; justify-content: space-between; width: 100%; font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.cf-auto { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; padding: 7px 16px; border-radius: 999px; background: transparent; border: 1px solid var(--line); color: var(--muted); cursor: pointer; transition: transform .08s var(--ease), background-color .15s, color .15s, border-color .15s; }
.cf-auto .ic { width: 16px; height: 16px; }
.cf-auto.on { color: var(--on-accent); background: var(--accent); border-color: var(--accent); }
.cf-auto:active { transform: scale(.96); }
/* „Stapel"-Liste (Playlists): Name + Anzahl, ruhige Zeilen */
.stapel-list { margin: 4px -18px 0; }
.stapel-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%;
  padding: 16px 18px; border: none; border-bottom: 1px solid var(--line); background: none; color: var(--ink);
  cursor: pointer; text-align: left; font-family: var(--body); }
.stapel-row .sr-name { font-size: 1.12rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stapel-row .sr-count { color: var(--muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
.stapel-row:active { background: var(--bg-2); }
@keyframes reveal-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.intro-head { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-3); margin-bottom: 8px; }
.intro-head .ic { width: 16px; height: 16px; }
.review-card .r-lemma { font-family: var(--display); font-size: 1.9rem; font-weight: 700; text-align: center; letter-spacing: -.025em; }
.review-card .r-ipa { color: var(--muted); text-align: center; font-family: var(--mono); margin-top: 4px; }
.review-actions { display: flex; gap: 12px; }
.review-actions .btn { flex: 1; }
/* 4-stufige Bewertung: engeres Layout, auf sehr schmalen Screens 2×2 */
.review-actions.four { gap: 8px; }
.review-actions.four .btn { font-size: .9rem; padding: 13px 4px; }
@media (max-width: 380px) { .review-actions.four { flex-wrap: wrap; } .review-actions.four .btn { flex: 1 1 42%; } }
.recap-sub { font-size: .9rem; color: var(--muted); margin: 10px 0; }
/* Verknüpfte Begriffe als anklickbare Chips + Reifegrad-Chip im Detail */
.rel-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rel-chip { font: inherit; font-size: .85rem; padding: 5px 11px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); color: var(--accent-2); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.rel-chip:active { transform: scale(.96); }
@media (hover: hover) { .rel-chip:hover { border-color: var(--accent); } }
.maturity-chip { display: inline-block; margin: 6px 0 2px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; }
/* Lernkarte umdrehen: kurze Flip-Animation (Inhalt wird an der Kante getauscht) */
@keyframes review-flip-out { from { transform: perspective(1000px) rotateY(0); } to { transform: perspective(1000px) rotateY(-90deg); opacity: .25; } }
@keyframes review-flip-in { from { transform: perspective(1000px) rotateY(90deg); opacity: .25; } to { transform: perspective(1000px) rotateY(0); opacity: 1; } }
.review-card.flip-out, .review-card.flip-in { will-change: transform, opacity; backface-visibility: hidden; transform-origin: center center; }
.review-card.flip-out { animation: review-flip-out .15s ease-in forwards; }
.review-card.flip-in { animation: review-flip-in .22s cubic-bezier(.2, .7, .3, 1) forwards; }
.flip-back-hint { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 14px; }
/* Aktivitäts-Heatmap (Logbuch, 6 Wochen) */
.heatmap { margin: 2px 0 var(--gap-section); }
.hm-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 6px; }
.hm-grid { display: grid; grid-template-rows: repeat(7, 11px); grid-auto-flow: column; grid-auto-columns: 11px; gap: 3px; }
.hm-cell { width: 11px; height: 11px; border-radius: 3px; background: var(--bg-2); }
.hm-cell.hm-l1 { background: color-mix(in oklab, var(--accent) 35%, var(--bg-2)); }
.hm-cell.hm-l2 { background: color-mix(in oklab, var(--accent) 65%, var(--bg-2)); }
.hm-cell.hm-l3 { background: var(--accent); }

.mc-options { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.mc-opt {
  text-align: left; background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px;
  cursor: pointer; min-height: 50px; transition: transform .08s var(--ease), background-color .2s, border-color .2s;
}
.mc-opt:active { transform: scale(.99); }
.mc-opt.right { background: color-mix(in oklab, var(--good) 28%, var(--bg-2)); border-color: var(--good); }
.mc-opt.wrong { background: color-mix(in oklab, var(--again) 28%, var(--bg-2)); border-color: var(--again); }
.cloze-sentence { font-size: 1.15rem; line-height: 1.7; margin-top: 8px; }
.cloze-gap { color: var(--accent-2); font-weight: 700; letter-spacing: 1px; }
.mc-result { font-weight: 700; margin-bottom: 12px; font-family: var(--display); }
.mc-result.ok { color: var(--good); }
.mc-result.no { color: var(--again); }

/* ---------- Edit-Formular ---------- */
.edit-form label { margin-top: 14px; }
.edit-form input, .edit-form textarea { margin-top: 5px; }

/* ---------- Leerzustände ---------- */
.empty-state { text-align: center; padding: 36px 18px; color: var(--muted); }
.empty-state .ic { width: 42px; height: 42px; color: var(--accent-3); margin-bottom: 12px; }
.empty-state p { margin: 0 0 16px; }
.empty-state .btn { width: auto; display: inline-flex; }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--card) 50%, var(--bg-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: var(--radius);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 6;
  display: flex; max-width: var(--maxw); margin: 0 auto;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 8px; font-size: .66rem; font-weight: 500;
  color: var(--muted); text-decoration: none;
  transition: color .18s var(--ease);
}
.tab .ic { width: 23px; height: 23px; }
.tab.active { color: var(--accent-2); }
.tab.active::after {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--accent-2);
}
/* Ambientes Fälligkeits-Badge am Üben-Tab */
.tab .tab-badge {
  position: absolute; top: 5px; left: calc(50% + 9px);
  min-width: 17px; height: 17px; padding: 0 4px; box-sizing: border-box;
  background: var(--danger); color: #fff; font-size: .62rem; font-weight: 700;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  line-height: 1;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%;
  bottom: calc(var(--tabbar-h) + var(--mini-h) + env(safe-area-inset-bottom) + 16px);
  transform: translateX(-50%) translateY(12px); z-index: 30;
  background: var(--card); color: var(--ink); border: 1px solid var(--accent);
  border-radius: 999px; padding: 11px 20px; font-size: .92rem; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .22s var(--ease), transform .22s var(--ease);
  max-width: 90vw; text-align: center; display: inline-flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-action {
  background: none; border: none; color: var(--accent-2); font-weight: 700;
  font-size: .9rem; cursor: pointer; padding: 2px 4px; margin-left: 4px;
  text-decoration: underline; flex: 0 0 auto;
}

/* ---------- Overlay / Sheet ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 25;
  background: rgba(0,0,0,.55); display: grid; place-items: end center;
  animation: overlay-in .2s var(--ease) both;
}
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: var(--maxw); background: var(--bg);
  border: 1px solid var(--line); border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 10px calc(18px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(18px + env(safe-area-inset-left));
  max-height: 90vh; overflow: auto; -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-lg);
  animation: sheet-up .32s var(--ease) both;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
/* Vollbild-Variante (Karten-Detail): füllt den ganzen Screen — mehr Platz für lange Satzteil-Karten.
   Andere Sheets (Bestätigung/Einstellungen/Playlists) bleiben kompakte Bottom-Sheets. */
.overlay.full { place-items: stretch; }
.overlay.full .sheet {
  max-width: 100%; max-height: none; height: 100dvh;
  border: none; border-radius: 0;
  padding-top: calc(10px + env(safe-area-inset-top));
}
/* Reine-Gesten-Detail: kein X oben (Schließen via Runterziehen + Schließ-Pfeil unten + Esc). Griff bleibt als Zieh-Hinweis. */
.overlay.full .sheet-close { display: none; }
/* Dezenter Fuß: Fortschritt (Position als Balken) + ein Schließ-Pfeil, bleibt unten sichtbar (sticky). */
.deck-foot { position: sticky; bottom: 0; margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 0 calc(6px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 72%, transparent); }
.deck-row { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 300px; }
.deck-n { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 2.5ch; text-align: center; }
.deck-track { flex: 1; height: 3px; border-radius: 999px; background: var(--line); overflow: hidden; }
.deck-fill { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s var(--ease); }
.deck-close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.deck-close:active { transform: scale(.92); }
.deck-close .ic { width: 24px; height: 24px; }
/* Platz reservieren, damit der sticky Schließ-Fuß die Aktions-Buttons nie überdeckt. */
.overlay.full .detail-actions { margin-bottom: 72px; }
/* Sticky Kopfleiste: zentrierter Griff + immer sichtbares Schließen-X */
.sheet-bar {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  margin: -10px -18px 10px; padding: 9px 12px; background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  min-height: 44px; /* enthält das 44px-Schließen-X vollständig → kein Überlauf in die darunterliegende .card-nav */
}
.sheet-handle { width: 38px; height: 4px; background: var(--line); border-radius: 999px; }
.sheet-close {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%; /* Apple-Mindest-Tap-Ziel (war 34px) */
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.sheet-close .ic { width: 18px; height: 18px; }
.sheet-close:active { transform: translateY(-50%) scale(.9); }
.sheet h3 { margin: 0 0 14px; }
.sheet .btn { margin-top: 10px; }
.sheet .detail { margin-bottom: 4px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 16px 0; }
.set-row > span { font-weight: 500; }
.set-row .seg { width: auto; }
.set-row select { width: auto; min-height: 42px; flex: 0 0 auto; max-width: 62%; }
.ob { margin: 10px 0 6px; padding-left: 1.15em; line-height: 1.75; }
.ob li { margin: 6px 0; }

/* ---------- Mini-Player (global, persistent) ---------- */
.miniplayer {
  position: fixed; left: 0; right: 0; z-index: 7;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  max-width: var(--maxw); margin: 0 auto;
  background: color-mix(in oklab, var(--card) 96%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -6px 22px rgba(0,0,0,.30);
  padding: 4px 12px 8px;
  animation: mini-in .26s var(--ease) both;
}
@keyframes mini-in { from { transform: translateY(100%); } to { transform: none; } }
.mp-seek { width: 100%; margin: 4px 0 2px; accent-color: var(--accent); height: 16px; }
.mp-row { display: flex; align-items: center; gap: 10px; }
.mp-meta { flex: 1; min-width: 0; cursor: pointer; }
.mp-word { font-family: var(--display); font-weight: 600; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.mp-time { font-size: .72rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.mp-ctrls { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.mp-btn {
  width: 44px; height: 44px; border: none; background: transparent; color: var(--ink);
  border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: transform .08s var(--ease);
}
.mp-btn:active { transform: scale(.9); }
.mp-btn .ic { width: 22px; height: 22px; }
.mp-secs { font-size: .74rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.mp-main { background: linear-gradient(180deg, var(--accent-2), var(--accent)); color: var(--on-accent); box-shadow: var(--shadow-sm); }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* Frisch erstellte Karte (inline in Erfassen) als Karten-Fläche */
#created-preview .detail {
  background: var(--card); border: 1px solid var(--accent);
  border-radius: var(--radius); padding: 18px; margin-top: 16px;
  box-shadow: var(--shadow-sm); animation: reveal-in .3s var(--ease) both;
}
#created-preview:empty { display: none; }

/* ---------- Schmale Geräte ---------- */
@media (max-width: 500px) {
  /* Tabelle/Liste-Umschalter wandert in die Einstellungen */
  #lib-controls #lib-view { display: none; }
}
@media (max-width: 360px) {
  .controls { gap: 16px; }
  .ctrl { width: 48px; height: 48px; }
  .ctrl-main { width: 64px; height: 64px; }
}

/* ---------- Üben-Sitzungs-Zähler (klickbar) + Übersicht ---------- */
.uh-pos-btn {
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; min-height: 32px; cursor: pointer; color: var(--muted);
  -webkit-tap-highlight-color: transparent;
}
.uh-pos-btn:active { transform: scale(.96); }
@media (hover: hover) { .uh-pos-btn:hover { border-color: var(--accent); color: var(--ink); } }
.card-row.is-current { border-color: var(--accent); background: color-mix(in oklab, var(--accent) 12%, transparent); }
.card-row.is-done .meta { opacity: .5; }
.ov-num { color: var(--muted); font-variant-numeric: tabular-nums; font-weight: 500; margin-right: 2px; }
.ov-now { color: var(--accent-2); font-weight: 700; flex: 0 0 auto; }
.ov-check { color: var(--good); flex: 0 0 auto; }

/* ---------- Aufräumen / Qualitäts-Check ---------- */
.qc-sec-title { font-weight: 700; font-size: .98rem; margin: 18px 0 8px; }
.qc-sec-title:first-child { margin-top: 4px; }
.qc-group {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  margin-bottom: 12px; background: var(--bg-2);
}
.qc-glemma { font-weight: 600; margin-bottom: 8px; }
.qc-card {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  border-top: 1px solid var(--line); cursor: pointer;
}
.qc-card input[type="radio"] { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--accent); }
.qc-cmeta { flex: 1; min-width: 0; }
.qc-cmeta .lemma { font-weight: 600; }
.qc-cmeta .sub { color: var(--muted); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn.sm { width: auto; min-height: 38px; padding: 8px 14px; font-size: .9rem; }

/* ---------- Vorlese-Bereiche-Editor (Üben: welche Felder, welche Reihenfolge) ---------- */
.vl-editor { display: flex; flex-direction: column; gap: 6px; }
.vl-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.vl-num { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.4em; }
.vl-name { flex: 1; font-weight: 600; }
.vl-btns { display: flex; gap: 4px; flex: 0 0 auto; }
.vl-add { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.vl-remember { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.vl-remember input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- KI-Vollprüfung (Qualitäts-Scan) ---------- */
.qc-scan { margin-bottom: 14px; }
.qc-scan .btn.sm { margin-top: 6px; }

/* ---------- KI-News ---------- */
.kinews-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 6px; }
.kinews-bar .btn { width: auto; flex: 1 1 auto; }
.news-auto { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; margin: 6px 0 2px; cursor: pointer; }
.news-auto input { width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.news-empty { color: var(--muted); font-size: .92rem; line-height: 1.5; margin-top: 18px; }
.news-date { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 2px; }
.news-cat { font-size: .82rem; color: var(--accent-3); text-transform: uppercase; letter-spacing: .05em; margin: 22px 0 8px; font-weight: 600; }
.news-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.news-titel { font-size: 1.02rem; font-weight: 600; line-height: 1.3; margin: 0 0 6px; color: var(--ink); }
.news-sum { font-size: .92rem; line-height: 1.5; color: var(--ink); margin: 0 0 8px; }
.news-src { font-size: .82rem; color: var(--accent-2); text-decoration: none; }
.news-src:hover { text-decoration: underline; }
