/* Vokabelapp – Gestaltung: minimalistisch, Graphit, Systemschrift (SF Pro)
   Hell ist Standard. Dunkel per <html data-theme="dark">, gesetzt aus dem Benutzerkonto. */
:root {
  --paper: #F2F2F7;
  --card: #FFFFFF;
  --card-2: #F2F2F7;
  --ink: #1D1D1F;
  --ink-soft: #6E6E73;
  --line: #E5E5EA;
  --rule: #D1D1D6;
  --outline: #AEAEB2;
  --accent: #1D1D1F;
  --accent-press: #3A3A3C;
  --on-accent: #FFFFFF;
  --accent-soft: #E8E8ED;
  --seg-bg: #E3E3E8;
  --seg-on: #FFFFFF;
  --logo-bg: #1D1D1F;
  --ok: #248A3D;
  --ok-bg: #E4F6E8;
  --ok-fill: #34C759;
  --close: #B25000;
  --close-bg: #FFF1DF;
  --bad: #D70015;
  --bad-bg: #FFE8E9;
  --marker: #FFD60A;
  --marker-ink: #1D1D1F;
  /* Lernstatus: offen, nicht gekonnt, im Aufbau, gekonnt, sicher */
  --st-open: #D1D1D6;
  --st-bad: #FF3B30;
  --st-build: #FF9500;
  --st-known: #A3DDB0;
  --st-secure: #34C759;
  --backdrop: rgba(0, 0, 0, .32);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-lift: 0 1px 3px rgba(0, 0, 0, .05), 0 10px 30px rgba(0, 0, 0, .07);
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --track-tight: -0.022em;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #000000;
  --card: #1C1C1E;
  --card-2: #2C2C2E;
  --ink: #F5F5F7;
  --ink-soft: #98989D;
  --line: #38383A;
  --rule: #48484A;
  --outline: #636366;
  --accent: #F5F5F7;
  --accent-press: #D1D1D6;
  --on-accent: #1D1D1F;
  --accent-soft: #2C2C2E;
  --seg-bg: #1C1C1E;
  --seg-on: #48484A;
  --logo-bg: #2C2C2E;
  --ok: #30D158;
  --ok-bg: #0E2A17;
  --ok-fill: #30D158;
  --close: #FF9F0A;
  --close-bg: #33230A;
  --bad: #FF453A;
  --bad-bg: #3A1412;
  --marker: #FFD60A;
  --marker-ink: #1D1D1F;
  --st-open: #48484A;
  --st-bad: #FF453A;
  --st-build: #FF9F0A;
  --st-known: #2F7A45;
  --st-secure: #30D158;
  --backdrop: rgba(0, 0, 0, .6);
  --shadow: none;
  --shadow-lift: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; } /* kein eigener Hintergrund: sonst verdeckt er die Karten hinter .kcard.stack (z-index -1) */
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.45 var(--font-ui);
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-family: var(--font-display); letter-spacing: var(--track-tight); }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.logo { display: block; flex: none; }

/* ---------- layout ---------- */
.shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) calc(32px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  min-height: 52px;
  padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left));
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.8) blur(20px);
  backdrop-filter: saturate(1.8) blur(20px);
  box-shadow: 0 .5px 0 var(--line);
}
.bar-inner { max-width: 736px; width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 4px; min-height: 52px; }
.bar h1 { font-size: 17px; font-weight: 600; letter-spacing: -0.015em; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .brand { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; letter-spacing: var(--track-tight); text-align: left; padding-left: 8px; }
.brand-link { display: inline-flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.brand-link span { overflow: hidden; text-overflow: ellipsis; }
.brand-link:active { opacity: .6; }
.bar .spacer { width: 44px; flex: none; }
.shell > .sheet-list:first-child, .shell > .plan-card:first-child { margin-top: 16px; }
.icon-btn {
  width: 44px; height: 44px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink);
  cursor: pointer; text-decoration: none;
}
.icon-btn:active { background: var(--accent-soft); }

.section-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink-soft); margin: 30px 4px 10px; display: flex; align-items: center; gap: 8px; font-family: var(--font-ui); }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }
.center { text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 20px;
  border-radius: 14px; border: 0;
  background: var(--accent); color: var(--on-accent);
  font-weight: 600; font-size: 17px; letter-spacing: -0.015em; text-decoration: none;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform .1s ease, background .15s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); background: var(--accent-press); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.btn.secondary:active { background: var(--accent-soft); }
.btn.ghost { background: transparent; color: var(--ink); min-height: 44px; padding: 0 12px; }
.btn.ghost:active { background: var(--accent-soft); }
.btn.danger { background: transparent; color: var(--bad); box-shadow: inset 0 0 0 1px currentColor; }
.btn.danger:active { background: var(--bad-bg); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > .btn { flex: 1 1 auto; white-space: nowrap; }
.btn-stack { display: grid; gap: 10px; }
:focus-visible { outline: 3px solid var(--rule); outline: 3px solid color-mix(in srgb, var(--ink) 30%, transparent); outline-offset: 2px; }

/* ---------- forms ---------- */
label.field { display: block; margin: 14px 0; }
label.field > span { display: block; font-size: 14px; font-weight: 600; color: var(--ink-soft); margin: 0 4px 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 50px;
  padding: 12px 14px;
  font-size: 17px; /* >=16px: kein Zoom auf dem iPhone */
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink);
  -webkit-appearance: none; appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input::placeholder { color: var(--ink-soft); opacity: .7; }
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--ink-soft) 50%), linear-gradient(135deg, var(--ink-soft) 50%, transparent 50%); background-position: calc(100% - 20px) 22px, calc(100% - 14px) 22px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.error-box { background: var(--bad-bg); color: var(--bad); padding: 12px 14px; border-radius: 12px; margin: 12px 0; font-size: 15px; }
.note-box { background: var(--accent-soft); padding: 12px 14px; border-radius: 12px; margin: 12px 0; font-size: 15px; }

/* ---------- auth ---------- */
.auth { max-width: 400px; margin: 0 auto; padding-top: calc(56px + env(safe-area-inset-top)); }
.auth-logo { display: flex; justify-content: center; margin-bottom: 20px; }
.auth-logo .logo { filter: drop-shadow(0 6px 18px rgba(0, 0, 0, .14)); }
.auth h1 { font-size: 34px; font-weight: 700; text-align: center; letter-spacing: -0.03em; }
.auth p.lead { text-align: center; color: var(--ink-soft); margin: 8px 0 28px; }
.tabs { display: flex; background: var(--seg-bg); border-radius: 11px; padding: 3px; margin-bottom: 8px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px 10px; border-radius: 8px; font-weight: 600; font-size: 15px; color: var(--ink-soft); cursor: pointer; transition: background .15s ease, color .15s ease; }
.tabs button.on { background: var(--seg-on); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 0 0 .5px rgba(0, 0, 0, .04); }

/* ---------- home ---------- */
.hello { font-size: 32px; font-weight: 700; letter-spacing: -0.03em; margin: 18px 4px 18px; }
.home-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.home-actions .btn { min-height: 54px; justify-content: flex-start; padding: 0 18px; }
.marker { background: linear-gradient(transparent 12%, var(--marker) 12%, var(--marker) 88%, transparent 88%); color: var(--marker-ink); padding: 0 .2em; border-radius: 2px; }

.sheet-list { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 16px; min-height: 62px;
  color: inherit; text-decoration: none;
  border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
a.row:active { background: var(--accent-soft); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { font-size: 14px; color: var(--ink-soft); margin-top: 2px; }
.chev { color: var(--rule); }
.progress { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 8px; }
.progress > i { display: block; height: 100%; background: var(--ok-fill); border-radius: 3px; }
.pct { font-size: 14px; font-variant-numeric: tabular-nums; color: var(--ink-soft); min-width: 38px; text-align: right; }
.flag { font-size: 22px; line-height: 1; }
@media (min-width: 820px) {
  .lang-group .sheet-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
  .lang-group .row:nth-child(2) { border-top: 0; }
  .lang-group .row:nth-child(even) { border-left: 1px solid var(--line); }
}

.empty { text-align: center; padding: 40px 20px; }
.empty .cards-art { display: block; margin: 0 auto 18px; }
.empty h2 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.empty p { color: var(--ink-soft); margin: 0 auto 18px; max-width: 32ch; }

.install-hint { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 14px; padding: 14px; margin: 12px 0 0; box-shadow: var(--shadow); font-size: 15px; }
.install-hint .icon-btn { width: 32px; height: 32px; margin: -6px -6px 0 auto; color: var(--ink-soft); }

/* ---------- Lernkarte ---------- */
.kcard {
  position: relative;
  background: var(--card);
  border-radius: 22px;
  box-shadow: var(--shadow-lift);
  padding: 20px 22px 26px;
  margin: 8px 0 24px;
  transition: box-shadow .2s ease;
}
:root[data-theme="dark"] .kcard { box-shadow: inset 0 0 0 1px var(--line); }
.kcard.stack::before, .kcard.stack::after {
  content: ""; position: absolute; left: 12px; right: 12px; height: 100%; top: 0;
  border-radius: 22px; background: var(--card); box-shadow: var(--shadow-lift); z-index: -1;
  transform: translateY(8px); opacity: .7;
}
.kcard.stack::after { left: 26px; right: 26px; transform: translateY(15px); opacity: .4; }
:root[data-theme="dark"] .kcard.stack::before, :root[data-theme="dark"] .kcard.stack::after { background: #141415; box-shadow: inset 0 0 0 1px var(--line); opacity: 1; }
.kcard-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 28px; font-size: 14px; font-weight: 600; color: var(--ink-soft); }
/* kurzer Strich: erinnert an die Linie einer Karteikarte, färbt sich bei der Rückmeldung */
.kcard-word::before { content: ""; display: block; width: 28px; height: 4px; border-radius: 2px; background: var(--accent); margin-bottom: 18px; transition: background .2s ease; }
.kcard-word {
  font-family: var(--font-display); font-weight: 700; letter-spacing: -0.025em;
  font-size: clamp(30px, 8vw, 42px); line-height: 1.15;
  margin: 18px 0 6px; word-break: break-word; hyphens: auto;
}
.kcard-note { color: var(--ink-soft); font-size: 15px; min-height: 22px; }
.kcard.fb-correct { box-shadow: var(--shadow-lift), inset 0 0 0 2px var(--ok); }
.kcard.fb-close { box-shadow: var(--shadow-lift), inset 0 0 0 2px var(--close); }
.kcard.fb-wrong { box-shadow: var(--shadow-lift), inset 0 0 0 2px var(--bad); }
:root[data-theme="dark"] .kcard.fb-correct { box-shadow: inset 0 0 0 2px var(--ok); }
:root[data-theme="dark"] .kcard.fb-close { box-shadow: inset 0 0 0 2px var(--close); }
:root[data-theme="dark"] .kcard.fb-wrong { box-shadow: inset 0 0 0 2px var(--bad); }
.kcard.fb-correct .kcard-word::before { background: var(--ok); }
.kcard.fb-close .kcard-word::before { background: var(--close); }
.kcard.fb-wrong .kcard-word::before { background: var(--bad); }

/* ---------- quiz ---------- */
.quiz-top { display: flex; align-items: center; gap: 12px; margin: 8px 4px 12px; font-size: 15px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.quiz-top .progress { flex: 1; margin: 0; height: 6px; border-radius: 3px; }
.quiz-top .progress > i { background: var(--accent); }
.answer-input { font-size: 22px; min-height: 58px; font-weight: 500; }
.keys { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.keys button { min-width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); font-size: 19px; cursor: pointer; }
.keys button:active { background: var(--accent-soft); }
.quiz-actions { display: flex; gap: 10px; margin-top: 14px; }
.quiz-actions .btn.primary-check { flex: 1; }
.feedback { border-radius: 16px; padding: 14px 16px; margin-top: 14px; }
.feedback h3 { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.feedback .reasons { font-size: 15px; margin-top: 2px; }
.feedback .solution { margin-top: 10px; font-size: 18px; }
.feedback .solution b { font-weight: 700; }
.feedback .yours { margin-top: 4px; font-size: 15px; color: var(--ink-soft); }
.feedback .yours s { text-decoration-thickness: 2px; }
.fb-correct-box { background: var(--ok-bg); color: var(--ok); }
.fb-close-box { background: var(--close-bg); color: var(--close); }
.fb-wrong-box { background: var(--bad-bg); color: var(--bad); }
.feedback .solution, .feedback .solution b { color: var(--ink); }
/* Querformat auf Touch-Geräten (iPad, große iPhones): Die Bildschirmtastatur bedeckt fast die halbe Höhe.
   Deshalb steht die Antwort neben der Karte statt darunter, so bleiben Eingabe, Knöpfe und Rückmeldung
   über der Tastatur sichtbar. Am Computer (Maus) bleibt die Abfrage einspaltig. */
@media (orientation: landscape) and (min-width: 800px) and (pointer: coarse) {
  .shell.quiz-shell { max-width: 1040px; }
  .bar-wide .bar-inner { max-width: 1056px; }
  .quiz-shell .quiz-top { margin: 4px 4px 10px; }
  .quiz-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 28px; align-items: start; }
  .quiz-body .kcard { margin: 8px 0 0; }
  .quiz-answer { margin-top: 8px; }
  .quiz-answer .keys { margin-top: 8px; }
  .quiz-answer .quiz-actions, .quiz-answer .feedback { margin-top: 12px; }
}

.score { font-family: var(--font-display); font-size: 48px; font-weight: 700; letter-spacing: -0.035em; line-height: 1; margin-top: 18px; }
.score-sub { font-size: 18px; margin-top: 8px; }
.tally { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 22px; }
.tally div { border-radius: 12px; padding: 10px; text-align: center; font-size: 14px; font-weight: 600; }
.tally b { display: block; font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }

/* ---------- vocab lists ---------- */
.vlist .row { min-height: 56px; align-items: flex-start; }
.vpair { flex: 1; min-width: 0; display: grid; grid-template-columns: 1fr; gap: 2px; }
/* rechts Typ und Zahlen: schmal untereinander (Zahlen oben), breit als zwei Spalten (Typ, dann Zahlen) */
.vmeta { flex: none; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 6px; }
.vkind { display: flex; padding-top: 2px; }
.vkind .kind { margin-left: 0; }
@media (min-width: 560px) {
  .vpair { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .vmeta { flex-direction: row; align-items: flex-start; gap: 14px; }
  /* feste Breiten, damit die Spalten in allen Zeilen übereinander stehen */
  .vkind { width: 100px; }
  .vlist .counts { width: 124px; justify-content: flex-end; }
}
.vpair .f { font-weight: 600; }
.vpair .g { color: var(--ink-soft); }
/* Zusatztext (Grammatik, Synonyme, Beispielsatz) in eigener Zeile unter der Vokabel */
.vnote { display: block; margin-top: 2px; font-size: 14px; font-weight: 400; color: var(--ink-soft); }
.counts { display: flex; gap: 6px; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; flex: none; padding-top: 2px; }
.counts span { padding: 2px 7px; border-radius: 7px; }
.c-ok { background: var(--ok-bg); color: var(--ok); }
.c-close { background: var(--close-bg); color: var(--close); }
.c-bad { background: var(--bad-bg); color: var(--bad); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); flex: none; margin-top: 8px; }
.dot.l0 { background: var(--bad); } .dot.l1 { background: var(--close); } .dot.l2 { background: var(--ok-fill); }

/* ---------- set detail ---------- */
.set-head { margin: 14px 4px 16px; }
.set-head h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.028em; display: flex; gap: 10px; align-items: center; }
.set-head p { margin: 6px 0 0; color: var(--ink-soft); }
.danger-zone { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }

/* ---------- editor ---------- */
.erow { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 6px 8px 8px; margin-bottom: 8px; }
.erow.off { opacity: .5; }
.erow-top { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.erow-top .icon-btn { width: 38px; height: 38px; }
.erow .inc-in { width: 22px; height: 22px; accent-color: var(--accent); margin: 0 2px 0 4px; flex: none; }
.kind-in { border: 0; background: var(--card-2); color: var(--ink); border-radius: 8px; padding: 5px 8px; font-size: 14px; font-weight: 600; -webkit-appearance: none; appearance: none; }
.erow .dup { white-space: normal; }
.spacer-flex { flex: 1; }
.erow .pair { display: grid; grid-template-columns: 1fr; gap: 6px; }
/* Sprachflagge vorn im Feld (Fremdsprache bzw. Deutsch) */
.erow .flagged { position: relative; display: block; min-width: 0; }
.erow .fflag { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 20px; line-height: 1; pointer-events: none; }
.erow .flagged .input { padding-left: 44px; }
.erow .gap-wrap { display: none; }
.erow[data-kind="cloze"] .gap-wrap { display: block; }
@media (min-width: 560px) { .erow[data-kind="cloze"] .pair .f-wrap { grid-column: 1 / -1; } }
@media (min-width: 560px) { .erow .pair { grid-template-columns: 1fr 1fr; } .erow .pair .note-in { grid-column: 1 / -1; } }
.erow .input { min-height: 44px; padding: 9px 12px; background: var(--card-2); border-color: transparent; }
.erow .input:focus { background: var(--card); border-color: var(--ink); }
/* Zusatzfeld: immer sichtbar, wächst mit dem Text (Höhe setzt fitNote() in app.js) */
textarea.input.note-in { font-size: 16px; min-height: 40px; padding: 8px 12px; color: var(--ink-soft); resize: none; overflow: hidden; line-height: 1.35; }
/* beim Lückensatz ist „Deutsch“ schon der Hinweis, ein Zusatz würde beim Abfragen nie angezeigt */
.erow[data-kind="cloze"] .note-in { display: none; }
.erow .icon-btn { color: var(--bad); align-self: start; }
.save-bar { position: sticky; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--paper) 30%); }

/* ---------- scan ---------- */
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin: 14px 0; }
.thumb { position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: var(--card); box-shadow: var(--shadow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.thumb button svg.i { width: 16px; height: 16px; }
.pick { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 160px; border-radius: 18px; border: 1.5px dashed var(--rule); background: var(--card); color: var(--ink); font-weight: 600; cursor: pointer; text-align: center; padding: 20px; }
.pick:active { background: var(--accent-soft); }
.pick svg.i { width: 34px; height: 34px; stroke-width: 1.75; }
.pick input { display: none; }
.tips { margin: 6px 4px 0; padding-left: 20px; color: var(--ink-soft); font-size: 15px; }

/* ---------- chips & segmented ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 14px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 14px; font-weight: 600; font-size: 15px; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* eigene Anzahl als Feld in der Chip-Reihe (16px gegen den Zoom auf dem iPhone) */
.chip-input { width: 100px; min-height: 0; height: 40px; padding: 0 14px; border-radius: 999px; font-size: 16px; font-weight: 600; -moz-appearance: textfield; }
.chip-input::-webkit-outer-spin-button, .chip-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.chip-input:not(:placeholder-shown) { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.seg { display: grid; gap: 6px; }
.seg button { text-align: left; border: 1px solid var(--line); background: var(--card); border-radius: 12px; padding: 12px 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 10px; color: var(--ink); }
.seg button::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--rule); flex: none; }
.seg button.on { border-color: var(--accent); background: var(--accent-soft); }
.seg button.on::before { border: 6px solid var(--accent); }
.check { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; font-size: 16px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--accent); }

/* Umschalter im iOS-Stil (Darstellung hell/dunkel) */
.switch { display: flex; background: var(--seg-bg); border-radius: 11px; padding: 3px; }
.switch button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: transparent; padding: 9px 10px; border-radius: 8px; font-weight: 600; font-size: 15px; color: var(--ink-soft); cursor: pointer; transition: background .15s ease, color .15s ease; }
.switch button svg.i { width: 18px; height: 18px; }
.switch button.on { background: var(--seg-on); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 0 0 .5px rgba(0, 0, 0, .04); }

/* ---------- bottom sheet ---------- */
.backdrop { position: fixed; inset: 0; background: var(--backdrop); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.sheet { width: 100%; max-width: 560px; max-height: 92vh; overflow: auto; background: var(--paper); border-radius: 24px 24px 0 0; padding: 10px 18px calc(18px + env(safe-area-inset-bottom)); animation: up .28s cubic-bezier(.2,.8,.2,1); }
@media (min-width: 620px) { .backdrop { align-items: center; } .sheet { border-radius: 24px; } }
.sheet .grab { width: 36px; height: 5px; border-radius: 3px; background: var(--rule); margin: 0 auto 12px; }
.sheet h2 { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.sheet h4 { margin: 18px 0 8px; font-size: 14px; color: var(--ink-soft); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }

/* ---------- loading / toast ---------- */
.loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 48px 20px; color: var(--ink-soft); text-align: center; }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.overlay { position: fixed; inset: 0; z-index: 60; background: var(--paper); background: color-mix(in srgb, var(--paper) 92%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; }
.overlay .loading { max-width: 300px; }
.overlay .loading strong { color: var(--ink); font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 14px; z-index: 70; font-weight: 600; font-size: 15px; animation: up .2s ease; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.skeleton { height: 62px; border-radius: 16px; background: var(--card); opacity: .6; margin-bottom: 10px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Anmeldung: Eltern ---------- */
.auth-sub { font-size: 22px; font-weight: 700; margin: 22px 4px 0; }
.auth-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 16px; font-size: 15px; }
.linkish { background: none; border: 0; padding: 0; color: var(--ink); font: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; cursor: pointer; }

/* ---------- Elternbereich & Super-Admin ---------- */
.badge { display: inline-block; font-size: 13px; font-weight: 600; line-height: 1.4; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--ink); vertical-align: middle; white-space: nowrap; letter-spacing: 0; }
.badge.pro { background: var(--marker); color: var(--marker-ink); }
.badge.warn { background: var(--close-bg); color: var(--close); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.plan-card { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 16px; }
.plan-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-edit + .plan-edit { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin-top: 14px; }
.stats > div { background: var(--card-2); border-radius: 12px; padding: 10px 12px; }
.stats b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stats b small { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.stats span { display: block; font-size: 13px; line-height: 1.3; color: var(--ink-soft); }
.stats.cards { margin-top: 6px; }
.stats.cards > div { background: var(--card); box-shadow: var(--shadow); }
.row.tap { cursor: pointer; }
.row.tap:active { background: var(--accent-soft); }
.row .row-sub .badge { margin-right: 2px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
.grid3 label.field { margin: 10px 0 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: end; }
.grid2 label.field { margin: 10px 0 0; }
.field-label { font-size: 14px; font-weight: 600; color: var(--ink-soft); margin: 14px 4px 6px; }
.seg.seg-2 { grid-template-columns: 1fr 1fr; }
.break { word-break: break-word; overflow-wrap: anywhere; }
.section-title svg.i { width: 18px; height: 18px; }

/* ---------- Impressum & Datenschutz ---------- */
.legal { padding-top: 8px; line-height: 1.6; }
.legal h2 { font-size: 20px; font-weight: 700; margin: 30px 0 8px; }
.legal p { margin: 8px 0; }
.legal address { font-style: normal; margin: 8px 0; }
.legal h3 { font-size: 17px; font-weight: 700; margin: 20px 0 6px; }
.legal-box { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 6px 16px; }
mark.todo { background: var(--bad-bg); color: var(--bad); padding: 0 4px; border-radius: 4px; }
.legal-links { text-align: center; font-size: 14px; color: var(--ink-soft); margin: 28px 0 0; }
.legal-links a { color: var(--ink-soft); }

/* ---------- Super-Admin: Einstellungen ---------- */
.settings-form label.field:first-of-type { margin-top: 4px; }
.settings-form .note-box, .settings-form .error-box { margin-top: 0; }
em.src { font-style: normal; font-weight: 600; color: var(--ok); margin-left: 4px; }

/* ---------- Lernstatus ---------- */
.dot.s0 { background: var(--st-open); } .dot.s1 { background: var(--st-bad); } .dot.s2 { background: var(--st-build); }
.dot.s3 { background: var(--st-known); } .dot.s4 { background: var(--st-secure); }
.stbar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); margin-top: 8px; }
.stbar > i { display: block; height: 100%; min-width: 3px; }
.stbar > i.s0 { background: var(--st-open); } .stbar > i.s1 { background: var(--st-bad); } .stbar > i.s2 { background: var(--st-build); }
.stbar > i.s3 { background: var(--st-known); } .stbar > i.s4 { background: var(--st-secure); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .dot, .st-chip .dot { margin: 0; width: 9px; height: 9px; }
.st-legend { margin-top: 12px; }
.st-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px; font-size: 14px; }
.kind { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 600; color: var(--ink-soft); background: var(--card-2); border-radius: 6px; padding: 1px 6px; vertical-align: 1px; }
.gapw { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.gap { display: inline-block; min-width: 3.2em; height: .9em; border-bottom: 3px solid currentColor; vertical-align: baseline; margin: 0 .1em; }
.kcard-word.long { font-size: clamp(22px, 5.6vw, 30px); line-height: 1.3; letter-spacing: -0.015em; }

/* ---------- Startseite: Sprachen, Tagestraining, Sessions ---------- */
.kid-sub { margin: 14px 4px 4px; color: var(--ink-soft); font-size: 15px; }
.lang-tabs { overflow-x: auto; margin-top: 8px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.lang-tabs::-webkit-scrollbar { display: none; }
/* Sprach-Tabs: Flagge über dem Namen, so passen auch drei oder mehr Sprachen */
.lang-tabs button { flex: 1 0 auto; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 7px 10px 6px; white-space: nowrap; position: relative; }
.lt-flag { position: relative; display: inline-flex; }
.lang-tabs .flag { font-size: 20px; line-height: 1; }
.lt-name { font-size: 13px; line-height: 1.2; }
.shell > #home:first-child > .lang-tabs:first-child { margin-top: 16px; }
/* roter Punkt vor dem Sprachnamen = Tagestraining fällig, blinkt (bei „Bewegung reduzieren“ nicht) */
.tab-dot, .alert-dot { display: inline-block; flex: none; width: 7px; height: 7px; margin: 0 5px 0 0; border-radius: 50%; background: var(--bad); vertical-align: 1px; animation: blink 1.6s ease-in-out infinite; }
/* gleicher Punkt für offene Tests: vor dem Testnamen, hinter dem Sprachnamen und im Button „Tests“ */
.alert-dot.after { margin: 0 0 0 1px; }
.btn .alert-dot.after { margin-left: -4px; }
.row-title .alert-dot { margin-right: 7px; vertical-align: 2px; }
@keyframes blink { 50% { opacity: .2; } }
.lang-head { margin-top: 18px; }
.daily-card { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 12px 12px 14px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); }
.daily-card.done { background: var(--ok-bg); color: var(--ok); }
.daily-card.due { background: var(--bad-bg); color: var(--bad); }
.dc-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.dc-main b { display: block; font-size: 16px; }
.dc-main > span:last-child > span { display: block; font-size: 14px; opacity: .85; }
.dc-icon { width: 38px; height: 38px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, currentColor 14%, transparent); }
.daily-card.off .dc-icon { background: var(--accent-soft); }
button.daily-card { width: 100%; border: 0; font: inherit; color: var(--ink); text-align: left; cursor: pointer; }
button.daily-card:active { background: var(--accent-soft); }
/* Tagestraining-Kachel: antippen öffnet den Kalender (Pfeil rechts); Kind: Starten in einer Zeile darunter */
.dc-text { flex: 1; min-width: 0; }
.dc-text > span { display: block; font-size: 14px; opacity: .85; }
.daily-card .chev { flex: none; display: inline-flex; color: currentColor; opacity: .45; margin-right: -4px; }
a.dc-main:active { opacity: .7; }
.daily-card.has-start { flex-wrap: wrap; }
.daily-card.has-start .dc-main { flex-basis: 100%; }
.dc-start { margin: 4px 0 0 50px; }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 15px; border-radius: 12px; gap: 6px; flex: none; }
.btn.sm svg.i { width: 18px; height: 18px; }
.daily-card .btn.secondary.sm { box-shadow: none; }
/* Fotografieren über den Sprachen */
.scan-top { margin-top: 16px; }
.scan-top + .lang-tabs { margin-top: 18px; }
/* Lernstand ohne Kachel; „?“ öffnet die Legende der Farben */
.stats-block { margin-top: 6px; }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 4px 2px; }
.sb-head .section-title { margin: 0; }
.help-btn { width: 26px; height: 26px; border: 1.5px solid var(--rule); font-size: 14px; font-weight: 700; color: var(--ink-soft); line-height: 1; }
.st-line { display: flex; align-items: center; gap: 8px; margin-top: 7px; }
.st-badges { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }
.stb { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 6px; border-radius: 999px; font-size: 11.5px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--marker-ink); }
.stb.s0 { background: var(--st-open); color: var(--ink); } .stb.s1 { background: var(--st-bad); color: #fff; } .stb.s2 { background: var(--st-build); }
.stb.s3 { background: var(--st-known); } .stb.s4 { background: var(--st-secure); }
:root[data-theme="dark"] .stb.s3 { color: var(--ink); }
.st-pct { flex: none; margin-left: auto; font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.st-help { padding: 8px 0; }
.menu:has(.st-help) { width: auto; min-width: 190px; }
.sh-row { display: flex; align-items: center; gap: 10px; padding: 5px 16px; font-size: 15px; }
.sh-row .stb { min-width: 26px; height: 14px; padding: 0; }
.list-head { display: flex; align-items: center; gap: 12px; margin: 30px 4px 10px; }
.lh-title { flex: 1; min-width: 0; }
.lh-sub { display: block; margin-top: 1px; font-size: 13px; color: var(--ink-soft); }
/* Sessions: deutlicher Rahmen, Titel mit Pfeil, darunter Balken und Badges */
#set-list { border: 1px solid var(--rule); }
.row-head { display: flex; align-items: center; gap: 8px; }
.row-head .row-title { flex: 1; min-width: 0; }
.row-head .chev { flex: none; display: inline-flex; margin-right: -6px; }
.set-row { align-items: flex-start; }
.set-row .sel-box { margin-top: 1px; }
.list-head .section-title { margin: 0; flex: 1; }
.list-head .linkish { font-size: 15px; }
.mini-switch { display: flex; background: var(--seg-bg); border-radius: 9px; padding: 2px; }
.mini-switch button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-soft); cursor: pointer; }
.mini-switch button.on { background: var(--seg-on); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }
.set-row .stbar { height: 6px; }
.sel-box { display: none; width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--rule); align-items: center; justify-content: center; color: var(--on-accent); }
.sel-box svg.i { width: 14px; height: 14px; stroke-width: 3; visibility: hidden; }
.selecting .sel-box { display: inline-flex; }
.selecting .chev { display: none; }
.set-row.sel .sel-box { background: var(--accent); border-color: var(--accent); }
.set-row.sel .sel-box svg.i { visibility: visible; }
#merge-bar { position: sticky; bottom: 0; z-index: 5; }
.merge-bar { display: flex; align-items: center; gap: 12px; }
.merge-bar span { flex: 1; font-size: 15px; color: var(--ink-soft); }
.merge-list { margin: 12px 0 0; padding-left: 20px; }
.btn-stack.narrow { max-width: 340px; margin: 0 auto; }
.check.top { align-items: flex-start; }
.check.top input { margin-top: 2px; flex: none; }
.check-list { background: var(--card); border-radius: 14px; padding: 4px 14px; max-height: 260px; overflow: auto; }
.check-list .check { margin: 0; padding: 10px 0; border-top: 1px solid var(--line); }
.check-list .check:first-child { border-top: 0; }
.check .ck-label { flex: 1; min-width: 0; }
.check-list .ck-count { flex: none; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
/* Arten im Test: zwei Spalten */
.kinds-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; max-height: none; }
.kinds-list .check:nth-child(2) { border-top: 0; }

/* ---------- Kalender ---------- */
.cal-card { margin-top: 14px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow); padding: 10px 12px 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head h3 { font-size: 18px; font-weight: 700; }
.cal-head .icon-btn:disabled { opacity: .25; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.cal .wd { text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-soft); padding-bottom: 2px; }
.cal .d { aspect-ratio: 1; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--card-2); color: var(--ink-soft); }
.cal .d.out { visibility: hidden; }
.cal .d.done { background: var(--st-secure); color: #fff; }
.cal .d.started { background: var(--st-build); color: #fff; }
.cal .d.missed { background: var(--st-bad); color: #fff; }
.cal .d.is-today { box-shadow: inset 0 0 0 2px var(--ink); }
.cal .d.done.is-today, .cal .d.started.is-today, .cal .d.missed.is-today { box-shadow: inset 0 0 0 2px var(--ink), inset 0 0 0 4px var(--card); }
.cal-legend { margin-top: 14px; }
.dot.cd-done { background: var(--st-secure); } .dot.cd-started { background: var(--st-build); } .dot.cd-missed { background: var(--st-bad); }

/* ---------- Elternbereich: Kinder ---------- */
.kid-row { align-items: flex-start; }
/* jedes Kind in einer eigenen Karte */
.kid-cards, .test-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
#ov > .kid-cards:first-child { margin-top: 16px; }
.kid-cards > .kid-row, .test-cards > .row { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; box-shadow: var(--shadow); }
.test-cards > .row.tap:active { background: var(--accent-soft); }
/* Test-Karte: Titel, rechts oben wer ihn angelegt hat, darunter Ergebnis bzw. „noch nicht gemacht“ */
.test-row { align-items: flex-start; }
.row-head .badge { flex: none; }
.test-status { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.test-row .pill { font-size: 12px; padding: 1px 8px; }
.row-title .done-check { display: inline-flex; margin-right: 6px; color: var(--ok); vertical-align: -2px; }
.done-check svg.i { width: 16px; height: 16px; stroke-width: 3; }
/* Test-Details: Ergebnis und Einstellungen in einer Karte unter dem Titel */
.ta-card { margin-top: 12px; padding: 2px 14px; background: var(--card); border: 1px solid var(--rule); border-radius: 14px; }
.ta-item { padding: 11px 0; border-top: 1px solid var(--line); }
.ta-item:first-child { border-top: 0; }
.ta-item > span { display: block; margin-bottom: 3px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.ta-item > div { font-size: 15px; }
.ta-result { display: flex; align-items: center; gap: 12px; }
.ta-result b { font-family: var(--font-display); font-size: 30px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ta-result span { font-size: 14px; line-height: 1.35; color: var(--ink-soft); }
.ta-item .pill { font-size: 12px; padding: 1px 8px; }
.kid-cards > a.kid-row:active { background: var(--accent-soft); }
/* Pfeil oben auf Höhe des Namens, die Sprachen darunter nutzen die ganze Breite */
.kid-head { display: flex; align-items: center; gap: 8px; }
.kid-head .row-title { flex: 0 1 auto; min-width: 0; }
.kid-head .pill { flex: none; margin-left: auto; }
.kid-head .chev { flex: none; display: inline-flex; margin-right: -6px; }
/* jede Sprache in einem eigenen Rahmen */
.kid-lang { margin-top: 10px; padding: 10px 12px 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.kid-lang:active { background: var(--accent-soft); border-color: var(--rule); }
.kid-head + .kid-lang { margin-top: 12px; }
.kl-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; }
.kl-name { display: inline-flex; align-items: center; gap: 7px; }
.kl-name .flag { font-size: 18px; }
.kid-row .pill { font-size: 12px; padding: 1px 8px; gap: 3px; }
.kid-row .pill svg.i { width: 13px; height: 13px; }
.kl-top .pill { margin-left: auto; padding-left: 6px; }
.kl-pct { margin-top: 4px; text-align: right; font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.kid-lang .stbar { height: 6px; margin-top: 6px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill svg.i { width: 14px; height: 14px; stroke-width: 3; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--close-bg); color: var(--close); }
.pill.muted { background: var(--card-2); color: var(--ink-soft); }
.mail-preview { white-space: pre-wrap; word-break: break-word; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--card); border-radius: 12px; padding: 14px; margin: 0; }
.mail-frame { display: block; width: 100%; height: 70vh; border: 0; border-radius: 12px; background: transparent; }
code.break { font-size: 13px; word-break: break-all; }

/* ---------- Kopfzeile: Tarif hinter dem Schriftzug ---------- */
a.badge { text-decoration: none; }
#plan-badge { display: inline-flex; }
.bar .brand .badge { font-size: 12px; padding: 1px 8px; letter-spacing: 0; }
.shell > .section-title:first-child, #t-body > .section-title:first-child { margin-top: 18px; }

/* ---------- Button mit kleiner Zeile darunter (Kinderkonten, Foto-Scans) ---------- */
.act { display: grid; gap: 7px; align-content: start; }
.act > .btn { width: 100%; }
.home-actions { align-items: start; }
/* Tests (und beim Kind „Schwächste üben“) jeweils über die ganze Breite */
.home-actions { grid-template-columns: 1fr; }
.home-actions .btn { justify-content: center; }
/* Kind: „Tests“ und „Schwächste üben“ nebeneinander, etwas kompakter */
.home-actions.two { grid-template-columns: 1fr 1fr; }
.home-actions.two .btn { padding: 0 10px; gap: 7px; font-size: 16px; white-space: nowrap; }
.home-actions.two .btn svg.i { width: 20px; height: 20px; }
.btn-note { display: block; margin: 0; text-align: center; font-size: 13px; line-height: 1.35; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.btn-note a { color: var(--ink-soft); }

/* ---------- Benutzermenü (Aufklappmenü oben rechts) ---------- */
.menu-layer { position: fixed; inset: 0; z-index: 55; }
.menu {
  position: fixed; width: 284px; max-width: calc(100vw - 16px); max-height: calc(100vh - 72px); overflow: auto;
  background: var(--card); border-radius: 16px; padding: 4px 0;
  box-shadow: 0 0 0 .5px var(--rule), 0 14px 44px rgba(0, 0, 0, .18);
  transform-origin: top right; animation: pop .16s cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="dark"] .menu { background: var(--card-2); box-shadow: 0 0 0 .5px var(--rule), 0 14px 44px rgba(0, 0, 0, .7); }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }
.menu-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px 12px; }
.mh-text { min-width: 0; }
.mh-text b, .mh-text span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mh-text b { font-size: 15px; }
.mh-text span { font-size: 13px; color: var(--ink-soft); }
.menu-group { border-top: 1px solid var(--line); padding: 4px 0; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 0 16px;
  border: 0; background: none; color: var(--ink); font: inherit; font-size: 16px; text-align: left; text-decoration: none; cursor: pointer;
}
.menu-item > svg.i, .mi-icon svg.i { width: 20px; height: 20px; color: var(--ink-soft); flex: none; }
.mi-icon { display: inline-flex; flex: none; }
.mi-label { flex: 1; min-width: 0; }
.menu-item .badge { flex: none; }
.menu-caption { padding: 6px 16px 2px; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.menu-item > .flag { width: 20px; font-size: 18px; text-align: center; flex: none; }
.mi-state { flex: none; font-size: 13px; color: var(--ink-soft); }
.mi-label small { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-soft); }
.menu-item:has(.mi-label small) { padding-top: 6px; padding-bottom: 6px; }
a.menu-item:active, button.menu-item:active { background: var(--accent-soft); }
@media (hover: hover) { a.menu-item:hover, button.menu-item:hover { background: var(--accent-soft); } }
:root[data-theme="dark"] a.menu-item:active, :root[data-theme="dark"] button.menu-item:active { background: var(--seg-on); }
@media (hover: hover) { :root[data-theme="dark"] a.menu-item:hover, :root[data-theme="dark"] button.menu-item:hover { background: var(--seg-on); } }
.menu-item.static { cursor: default; }
/* Tastatur-Fokus im Menü als graue Zeile statt Rahmen (der Rahmen würde an den Seiten abgeschnitten) */
.menu-item:focus-visible { outline: none; background: var(--accent-soft); }
:root[data-theme="dark"] .menu-item:focus-visible { background: var(--seg-on); }
.switch.sm { flex: none; padding: 2px; border-radius: 9px; }
.switch.sm button { padding: 5px 11px; border-radius: 7px; }
.switch.sm button svg.i { width: 16px; height: 16px; }

/* ---------- Tarife ---------- */
.meter { margin-top: 14px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 15px; }
.meter-top b { font-variant-numeric: tabular-nums; }
.meter-top b small { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.meter .progress { height: 6px; }
.meter .progress > i { background: var(--accent); }
.meter .progress.full > i { background: var(--close); }
.plan-compare { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(var(--cols, 2), minmax(0, 1fr)); background: var(--card); border: 1px solid var(--outline); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.plc-row { display: contents; }
.plc-head > span { border-top: 0 !important; }
.plc-row > span { padding: 12px 8px; border-top: 1px solid var(--line); }
/* Beschriftung füllt die ganze Zeilenhöhe, damit ihre Trennlinie auf derselben Höhe liegt wie bei den Werten */
.plc-label { padding-left: 16px !important; font-size: 15px; display: flex; flex-direction: column; justify-content: center; gap: 2px; }
.plc-label small { font-size: 13px; color: var(--ink-soft); }
.plc-val { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center; font-size: 15px; font-variant-numeric: tabular-nums; }
.plc-val.cur { background: var(--card-2); }
.plc-val small { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.plc-check { display: inline-flex; color: var(--ok); }
.plc-check svg.i { width: 20px; height: 20px; stroke-width: 2.6; }

/* ---------- Pro bestellen ---------- */
.price-big { margin-top: 12px; font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.form-card { padding-top: 2px; padding-bottom: 14px; }
.grid-zip { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 10px; margin: 14px 0; }
.grid-zip label.field { margin: 0; }
#o-body > .plan-card:first-child { margin-top: 16px; }
.mandate { background: var(--card-2); border-radius: 12px; padding: 12px 14px; margin: 14px 0 12px; font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.mandate b { color: var(--ink); }
.mandate p { margin: 8px 0 0; }
.order-done { text-align: center; padding: 28px 8px 8px; }
.order-done h2 { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.order-done p { margin: 0 auto 14px; max-width: 40ch; }
.ok-circle { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); margin-bottom: 14px; }
.ok-circle svg.i { width: 34px; height: 34px; stroke-width: 2.6; }
.dev-mail { margin: 10px 0; }
.order-final { margin-top: 18px; background: var(--card); border: 1px solid var(--outline); border-radius: 14px; padding: 4px 14px; }
.order-final > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.order-final > div:first-child { border-top: 0; }
.order-final span { color: var(--ink-soft); }
.order-final b { text-align: right; }
.plc-val small.plc-year { font-weight: 500; }
.dev-mail summary { cursor: pointer; font-size: 14px; color: var(--ink-soft); margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; margin: 14px 0; font-size: 15px; line-height: 1.4; }
.kv dt { color: var(--ink-soft); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
