:root {
  /* Farben: css/themes.css (Theme × hell/dunkel); hier nur abgeleitete Werte */
  --sep: color-mix(in srgb, var(--text) 16%, transparent);
  --chev: color-mix(in srgb, var(--text) 28%, var(--bg));
  --press: color-mix(in srgb, var(--text) 8%, transparent);
  --info-bg: color-mix(in srgb, var(--blue) 14%, var(--surface));
  --radius: 14px;
  --shadow: 0 1px 2px rgb(60 40 20 / .05), 0 2px 10px rgb(60 40 20 / .04);
  --tabbar-h: 50px;
}
:root { color-scheme: light; }
:root[data-mode="dark"] { --shadow: none; color-scheme: dark; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ——— Kopfzeile ——— */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  padding: calc(env(safe-area-inset-top) + 6px) 12px 6px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.topbar h1 { grid-column: 2; margin: 0; text-align: center; font-size: 17px; font-weight: 600; }
#backBtn { grid-column: 1; grid-row: 1; }
#settingsBtn { grid-column: 3; grid-row: 1; }
.icon-btn {
  width: 44px; height: 44px; border: 0; background: none; border-radius: 12px;
  display: grid; place-items: center; font-size: 30px; line-height: 1; color: var(--accent);
}

main {
  max-width: 640px; margin: 0 auto;
  padding: 8px 16px calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px);
}

/* ——— Karten & Buttons ——— */
.card {
  background: var(--surface); border-radius: var(--radius);
  padding: 20px; box-shadow: 0 1px 2px rgb(0 0 0 / .04), 0 4px 16px rgb(0 0 0 / .04);
}
.btn {
  border: 0; border-radius: 12px; padding: 14px 18px; font-weight: 600; font-size: 17px;
  background: var(--surface-2);
}
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.small { padding: 8px 14px; font-size: 15px; }
.btn.block { width: 100%; margin: 12px 0 4px; }
.btn:active { transform: scale(.98); }

/* ——— Üben ——— */
.scorebar { display: flex; justify-content: center; gap: 18px; font-weight: 600; font-size: 15px; margin: 4px 0 12px; font-variant-numeric: tabular-nums; }
.scorebar .ok { color: var(--ok); }
.scorebar .bad { color: var(--bad); }
.focus-banner {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface-2); border-radius: 12px; padding: 8px 8px 8px 14px; margin-bottom: 8px; font-size: 15px;
}
.focus-banner button { border: 0; background: none; font-size: 16px; width: 36px; height: 36px; color: var(--muted); }

.quiz-tense { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.quiz-tense small { display: block; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--muted); font-size: 13px; margin-top: 2px; }
.quiz-verb { margin: 14px 0 4px; font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.quiz-de { font-size: 16px; font-weight: 400; color: var(--muted); display: block; margin-top: 2px; }
.quiz-person { font-size: 20px; margin: 16px 0 10px; }
.quiz-person b { font-weight: 600; }
.refl-note { font-size: 13px; color: var(--muted); margin: -6px 0 10px; }

.answer {
  width: 100%; font-size: 20px; padding: 14px 16px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--bg); color: var(--text);
  outline: none; -webkit-appearance: none; appearance: none;
}
.answer:focus { border-color: var(--accent); }
.answer.ok { border-color: var(--ok); background: var(--ok-bg); }
.answer.bad { border-color: var(--bad); background: var(--bad-bg); }
.answer.warn { border-color: var(--warn); background: var(--warn-bg); }

.table-quiz { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; margin-top: 16px; }
.table-quiz label { font-size: 15px; color: var(--muted); text-align: right; }
.table-quiz .answer { font-size: 18px; padding: 10px 12px; }
.table-quiz .solution { grid-column: 2; font-size: 14px; margin-top: -4px; }

.feedback { min-height: 24px; margin: 10px 0 4px; font-size: 16px; }
.feedback .ok { color: var(--ok); font-weight: 600; }
.feedback .bad { color: var(--bad); font-weight: 600; }
.feedback .warn { color: var(--warn); font-weight: 600; }
.feedback .sol { font-weight: 600; }
.solution.bad { color: var(--bad); }
.solution.warn { color: var(--warn); }

.accentbar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 8px 0 14px; }
.accentbar button {
  border: 0; border-radius: 10px; background: var(--surface-2); height: 44px; font-size: 20px;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.accentbar button:active { background: var(--line); }
.quiz-actions { display: flex; gap: 10px; }
.quiz-actions .ghost { flex: 1; }
.quiz-actions .primary { flex: 2; }

/* ——— Verben ——— */
.search {
  width: 100%; font-size: 17px; padding: 12px 14px; border-radius: 12px; border: 0;
  background: var(--surface-2); color: var(--text); outline: none; -webkit-appearance: none;
}
.chips { display: flex; gap: 8px; margin: 12px 0; }
.chips.scroll { overflow-x: auto; scrollbar-width: none; margin-left: -16px; margin-right: -16px; padding: 0 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; }
.chip {
  flex: none; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 8px 14px; font-size: 15px; white-space: nowrap;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }

.verb-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.verb-list li {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.verb-list li:last-child { border-bottom: 0; }
.verb-list li:active { background: var(--surface-2); }
.verb-list .main { flex: 1; min-width: 0; }
.verb-list .inf { font-size: 17px; font-weight: 600; }
.verb-list .de { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { font-size: 11px; font-weight: 600; padding: 3px 7px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.badge.irr { background: var(--bad-bg); color: var(--bad); }
.verb-list .fav { color: var(--accent); }
.empty { text-align: center; color: var(--muted); padding: 24px; }

/* ——— Detail ——— */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; margin-top: 4px; }
.detail-inf { font-size: 32px; font-weight: 700; }
.detail-de { color: var(--muted); font-size: 17px; }
.star { border: 0; background: none; font-size: 30px; color: var(--accent); width: 48px; height: 48px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; font-size: 15px; }
.detail-meta span { background: var(--surface); padding: 6px 10px; border-radius: 8px; }
.detail-meta b { font-weight: 600; }
.legend { font-size: 13px; color: var(--muted); margin: 8px 0 12px; }
.irr { color: var(--bad); font-weight: 600; }
.unknown-note { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-top: 12px; }
.mood { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 4px 8px; }
.tables { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 560px) { .tables { grid-template-columns: 1fr 1fr; } }
.tense-card { background: var(--surface); border-radius: 14px; padding: 12px 14px; }
.tense-card h4 { margin: 0; font-size: 15px; }
.tense-card .sub { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.tense-card table { width: 100%; border-collapse: collapse; font-size: 16px; }
.tense-card td { padding: 4px 0; vertical-align: top; }
.tense-card td.p { color: var(--muted); font-size: 13px; width: 38%; padding-right: 8px; padding-top: 6px; }

/* ——— Statistik ——— */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--surface); border-radius: 14px; padding: 14px 10px; text-align: center; }
.stat .v { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); margin-top: 2px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 4px 8px; }
.bars { background: var(--surface); border-radius: 14px; padding: 6px 14px; }
.bar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.bar-row:last-child { border-bottom: 0; }
.bar-row .n { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.mistakes { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: 14px; }
.mistakes li { padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 15px; display: flex; justify-content: space-between; gap: 10px; }
.mistakes li:last-child { border-bottom: 0; }
.mistakes .meta { color: var(--muted); font-size: 13px; }
.mistakes .cnt { color: var(--bad); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.danger { color: var(--bad); background: none; border: 0; width: 100%; padding: 16px; font-size: 16px; margin-top: 16px; }

/* ——— Tab-Leiste ——— */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  height: var(--tabbar-h); border: 0; background: none; color: var(--muted); min-width: 0; padding: 0 2px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 500;
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar button.active { color: var(--accent); }

/* ——— Einstellungs-Sheet ——— */
.sheet-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / .35); z-index: 20; animation: ux-fade-in .3s ease-out; touch-action: none; }
@keyframes ux-fade-in { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  max-height: 88vh; max-height: 88dvh; display: flex; flex-direction: column;
  background: var(--bg); border-radius: 20px 20px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  max-width: 640px; margin: 0 auto;
  animation: ux-sheet-in .45s cubic-bezier(.32, .72, 0, 1);
}
@keyframes ux-sheet-in { from { transform: translateY(100%); } }
.sheet-grip { width: 38px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 16px; }
.sheet-head h2 { font-size: 18px; margin: 0; }
.sheet-body { overflow-y: auto; padding: 0 16px 24px; -webkit-overflow-scrolling: touch; }
.sheet-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 0 8px; display: flex; justify-content: space-between; align-items: center; }
.quick button { border: 0; background: none; color: var(--accent); font-size: 13px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 4px 6px; }
.tense-group { font-size: 12px; color: var(--muted); margin: 10px 0 6px; }
.segmented { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { flex: 1; border: 0; background: none; padding: 8px 6px; border-radius: 8px; font-size: 14px; white-space: nowrap; }
.segmented button.on { background: var(--surface); font-weight: 600; box-shadow: 0 1px 3px rgb(0 0 0 / .12); }
.hint { font-size: 13px; color: var(--muted); }

/* ——— Grammatik ——— */
#grammarSeg { margin-bottom: 14px; }
.gcat { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 22px 4px 8px; }
.gcard { background: var(--surface); border-radius: 14px; margin-bottom: 8px; scroll-margin-top: 70px; }
.gcard summary {
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 16px; cursor: pointer;
}
.gcard summary::-webkit-details-marker { display: none; }
.gcard summary b { font-size: 17px; font-weight: 600; }
.gcard summary .sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.gcard summary::after { content: '›'; font-size: 24px; color: var(--muted); transition: transform .15s; }
.gcard[open] summary::after { transform: rotate(90deg); }
.gbody { padding: 0 16px 16px; font-size: 15px; line-height: 1.5; }
.gbody p { margin: 0 0 10px; }
.gbody .label { font-weight: 600; }
.gbody ul.ex { margin: 0 0 10px; padding-left: 18px; }
.gbody ul.ex b { color: var(--accent); }
.gbody .note { background: var(--surface-2); border-radius: 10px; padding: 8px 12px; margin: 0 0 10px; font-size: 14px; }
.sub-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
.end { color: var(--accent); font-weight: 600; }
.endings { width: 100%; border-collapse: collapse; font-size: 14px; margin: 4px 0 12px; }
.endings th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 4px 4px 6px; border-bottom: 1px solid var(--line); }
.endings td { padding: 5px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.endings tr:last-child td { border-bottom: 0; }
.endings td.p { color: var(--muted); font-size: 12px; white-space: nowrap; padding-top: 7px; }
.ex-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 4px; }
.ex-grid.one { grid-template-columns: 1fr; }
.ex-card { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; }
.ex-card h5 { margin: 0 0 4px; font-size: 13px; }
.ex-card h5 span { font-weight: 400; color: var(--muted); }
.ex-card table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ex-card td { padding: 2px 0; }
.ex-card td.p { color: var(--muted); font-size: 12px; width: 1%; white-space: nowrap; padding-right: 10px; }
.nw { white-space: nowrap; }
.chip.small { padding: 5px 10px; font-size: 14px; }
.chip.small span { color: var(--muted); }
.group-tag {
  border: 0; background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 6px 10px; font-size: 14px;
}
.group-tag::before { content: '◆ '; color: var(--accent); font-size: 10px; vertical-align: 1px; }

/* ——— Sync ——— */
.lang-card { padding: 12px; }
.sync-card { padding: 16px; font-size: 15px; line-height: 1.45; }
.sync-card p { margin: 0 0 8px; }
.sync-card a { color: var(--accent); font-weight: 600; }
.sync-card code { font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.steps { padding-left: 20px; margin: 8px 0 12px; }
.steps li { margin-bottom: 6px; }
.sync-ok { color: var(--ok); font-weight: 600; }
.sync-err { color: var(--bad); font-size: 14px; min-height: 0; }
.devices { list-style: none; padding: 0; margin: 0 0 12px; }
.devices li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--line); }
.devices li:last-child { border-bottom: 0; }
.devices span { color: var(--muted); font-size: 13px; }
.sync-actions { display: flex; gap: 8px; }
.sync-actions .btn { flex: 1; font-size: 15px; padding: 12px; }
.btn:disabled { opacity: .5; }

/* ——— Wiederholen ——— */
#practiceSeg { margin: 2px 0 6px; }
.srs-info { text-align: center; font-size: 13px; color: var(--muted); min-height: 18px; }
.scorebar .goal { color: var(--muted); }
.scorebar .goal.reached { color: var(--ok); }
.quiz-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.qbadge { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.qbadge.new { background: var(--ok-bg); color: var(--ok); }
.qbadge.again { background: var(--bad-bg); color: var(--bad); }
.next-review { color: var(--muted); font-size: 14px; }
.quiz.done .accentbar, .quiz.done .quiz-actions, .quiz.done .feedback { display: none; }
.done-actions { display: grid; gap: 10px; margin-top: 18px; }
.colchart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; align-items: end; height: 110px; padding: 10px 12px 6px; background: var(--surface); border-radius: 14px; }
.colchart .col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 3px; min-width: 0; }
.colchart .col i { display: block; width: 100%; max-width: 26px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.colchart .col i.zero { background: var(--line); }
.colchart .col i.goal { background: var(--ok); }
.colchart .col b { font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.colchart .col span { font-size: 10px; color: var(--muted); }
.colchart .col span em { font-style: normal; color: var(--accent); font-weight: 600; }
.colchart .col span { white-space: nowrap; }

/* ——— Vokabeln ——— */
#vocabSeg { margin: 2px 0 6px; }
.vscore { margin: 6px 0 8px; gap: 14px; }
.vscore .goal { color: var(--muted); }
.vscore .goal.reached { color: var(--ok); }
.vfilter {
  width: 100%; border: 0; background: var(--surface-2); border-radius: 10px; padding: 9px 12px; margin-bottom: 10px;
  font-size: 13px; color: var(--muted); text-align: left; display: flex; justify-content: space-between; gap: 8px; align-items: center;
}
.vfilter span { color: var(--accent); font-weight: 600; white-space: nowrap; }
.vinfo { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); margin: 0 4px 8px; }
.vundo { border: 0; background: var(--surface-2); border-radius: 10px; width: 40px; height: 34px; font-size: 18px; }
.vundo:disabled { opacity: .35; }

.vstage { position: relative; height: min(430px, calc(100dvh - 360px)); min-height: 330px; margin-bottom: 14px; }
.vcard {
  position: absolute; inset: 0; background: var(--surface); border-radius: 22px; padding: 18px 20px;
  box-shadow: 0 2px 6px rgb(0 0 0 / .06), 0 10px 30px rgb(0 0 0 / .08);
  display: flex; flex-direction: column; overflow: hidden;
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; will-change: transform;
}
.vcard.under { transform: scale(.95) translateY(12px); opacity: .7; pointer-events: none; box-shadow: none; }
.vcard.under .vc-main, .vcard.under .vc-foot { visibility: hidden; }
.vc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vc-tags { font-size: 12px; color: var(--muted); }
.vc-main { flex: 1; display: flex; flex-direction: column; justify-content: center; text-align: center; overflow-y: auto; padding: 8px 0; }
.vc-dir { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.vc-prompt { font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; overflow-wrap: anywhere; }
.vc-answer { display: none; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.vcard.flipped .vc-answer { display: block; animation: fadein .2s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }
.vc-translation { font-size: 24px; font-weight: 600; color: var(--accent); overflow-wrap: anywhere; }
.vc-ex { margin-top: 14px; font-size: 15px; font-style: italic; background: var(--surface-2); border-radius: 12px; padding: 10px 12px; text-align: left; }
.vc-ex .de { color: var(--muted); margin-top: 3px; }
.vc-note { margin-top: 10px; font-size: 14px; color: var(--muted); text-align: left; }
.vc-link { margin-top: 10px; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 15px; }
.vc-foot { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.vc-speak { border: 0; background: var(--surface-2); border-radius: 50%; width: 44px; height: 44px; font-size: 19px; flex: none; }
.vc-hint { font-size: 13px; color: var(--muted); }
.art.m { color: var(--art-m); }
.art.f { color: var(--art-f); }
.art.mf { color: var(--art-mf); }

.ov {
  position: absolute; z-index: 2; pointer-events: none; opacity: 0; font-weight: 800; font-size: 22px; letter-spacing: .06em;
  padding: 6px 12px; border: 3px solid currentColor; border-radius: 10px; background: color-mix(in srgb, var(--surface) 85%, transparent);
}
.ov-right { top: 22px; left: 18px; color: var(--ok); transform: rotate(-12deg); }
.ov-left { top: 22px; right: 18px; color: var(--bad); transform: rotate(12deg); }
.ov-up { bottom: 70px; left: 50%; transform: translateX(-50%); color: var(--art-m); }
.ov-down { top: 60px; left: 50%; transform: translateX(-50%); color: var(--muted); }

.vactions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.va {
  border: 0; border-radius: 14px; padding: 8px 4px; font-size: 12px; font-weight: 600; line-height: 1.2;
  display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--surface);
}
.va b { font-size: 20px; }
.va-left { color: var(--bad); } .va-right { color: var(--ok); } .va-up { color: var(--art-m); } .va-down { color: var(--muted); }
.va:active { transform: scale(.96); }
.vdone { text-align: left; }

.vtoast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px); z-index: 30;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: all .2s;
  background: #222; color: #fff; border-radius: 12px; padding: 10px 14px; display: flex; gap: 14px; align-items: center; font-size: 15px;
  max-width: calc(100% - 32px);
}
.vtoast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.vtoast button { border: 0; background: none; color: #ffb199; font-weight: 700; font-size: 15px; }

.vlist-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 10px; }
.vlist .inf { font-size: 16px; }
.chip .cnt { opacity: .6; font-size: 12px; }
.vstatus { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.vstatus.s-learning { background: var(--bad-bg); color: var(--bad); }
.vstatus.s-known { background: var(--ok-bg); color: var(--ok); }
.vstatus.s-mastered { background: var(--info-bg); color: var(--blue); }

.vword { padding-bottom: 8px; }
.vword-es { font-size: 28px; font-weight: 700; margin: 6px 0 2px; display: flex; align-items: center; gap: 10px; }
.vword-de { font-size: 19px; color: var(--accent); font-weight: 600; }
.vword-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.vword-actions .btn { font-size: 15px; padding: 12px 8px; }
.danger-text { color: var(--bad) !important; }
.vfield { display: block; margin: 10px 0; }
.vfield span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
select.search { appearance: none; -webkit-appearance: none; }

/* ——— Vokabeln: Icons & Kategorien ——— */
.vc-icon { font-size: 54px; line-height: 1; margin-bottom: 10px; }
.vicon { width: 28px; flex: none; font-size: 22px; text-align: center; }
.vword-icon { font-size: 34px; margin-right: 4px; }
.vcats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vcat {
  border: 0; background: var(--surface); border-radius: 14px; padding: 12px; text-align: left;
  display: flex; flex-direction: column; gap: 4px; min-height: 112px;
}
.vcat:active { transform: scale(.98); }
.vcat-icon { font-size: 26px; line-height: 1.1; }
.vcat-name { font-size: 15px; font-weight: 600; line-height: 1.25; }
.vcat-meta { font-size: 12px; color: var(--muted); margin-top: auto; }
.vcat-meta b { color: var(--accent); font-weight: 600; }
.vcat .bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; display: block; }
.vcat .bar i { display: block; height: 100%; background: var(--ok); }
#view-vocab .focus-banner { margin-bottom: 10px; }
.vcard.dir-native:not(.flipped) .vc-speak { visibility: hidden; } /* würde sonst die Lösung vorsprechen */

/* ——— Vokabeln: Lernansicht ohne Scrollen ——— */
body.vfit { overflow: hidden; }
body.vfit main {
  position: fixed; left: 0; right: 0; margin: 0 auto;
  top: calc(env(safe-area-inset-top) + 56px);
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 1px);
  padding: 6px 16px 10px; display: flex; flex-direction: column; overflow: hidden;
}
body.vfit #view-vocab, body.vfit #vocabBody { flex: 1; display: flex; flex-direction: column; min-height: 0; }
body.vfit #vocabScore { display: none; }
body.vfit #vocabSeg { margin-bottom: 8px; flex: none; }
body.vfit .vfilter { flex: none; padding: 7px 12px; margin-bottom: 6px; }
body.vfit .vfilter, body.vfit .vfilter * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.vfit .vfilter > span { flex: none; }
body.vfit #view-vocab .focus-banner { flex: none; margin-bottom: 6px; padding-top: 4px; padding-bottom: 4px; }
body.vfit .vinfo { flex: none; margin: 0 2px 6px; gap: 8px; }
body.vfit .vstage { flex: 1; height: auto; min-height: 0; margin-bottom: 10px; }
body.vfit .vactions { flex: none; }
body.vfit .vdone { overflow-y: auto; }
.vgoal { display: flex; gap: 8px; margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.vgoal .goal { color: var(--muted); }
.vgoal .goal.reached { color: var(--ok); }
/* kleine Bildschirme: Karteninhalt etwas kompakter */
@media (max-height: 700px) {
  .vc-prompt { font-size: 26px; }
  .vc-translation { font-size: 20px; }
  .vc-icon { font-size: 40px; margin-bottom: 6px; }
  .vc-ex { margin-top: 8px; padding: 8px 10px; font-size: 14px; }
  .va { padding: 6px 4px; }
}

/* Filterbalken einzeilig mit sichtbarem „Ändern“ */
.vf-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vf-change { flex: none; color: var(--accent); font-weight: 600; }
body.vfit .vfilter, body.vfit .vfilter * { overflow: visible; }
body.vfit .vfilter .vf-text { overflow: hidden; }
/* Karte verdichten, wenn der Inhalt nicht passt */
.vcard.c1 .vc-icon { font-size: 36px; margin-bottom: 4px; }
.vcard.c1 .vc-prompt { font-size: 24px; }
.vcard.c1 .vc-answer { margin-top: 10px; padding-top: 10px; }
.vcard.c1 .vc-translation { font-size: 20px; }
.vcard.c1 .vc-ex { margin-top: 8px; padding: 7px 10px; font-size: 14px; }
.vcard.c1 .vc-note { margin-top: 6px; font-size: 13px; }
.vcard.c1 .vc-dir { margin-bottom: 2px; }
.vcard.c1 .vc-main { padding: 4px 0; }
.vcard.c2 .vc-icon, .vcard.c2 .vc-dir { display: none; }
.vcard.c2 .vc-note { font-size: 12px; }
.vcard.c2 .vc-foot { min-height: 38px; }
.vcard.c2 .vc-speak { width: 38px; height: 38px; font-size: 16px; }
.vcard.c3 .vc-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard.c3 .vc-ex { font-size: 13px; padding: 6px 9px; }
.vcard.c3 .vc-link { margin-top: 4px; font-size: 14px; }
.vcard.c3 .vc-prompt { font-size: 21px; }
.vcard.c3 .vc-translation { font-size: 18px; }
.vcard.c3 .vc-answer { margin-top: 6px; padding-top: 6px; }
.vcard.c4 .vc-main { touch-action: pan-y; }

/* ——— Kurswahl ——— */
.course-seg { display: grid; grid-template-columns: 1fr 1fr; }
.course-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 6px; }
.course-seg .flag { font-size: 18px; line-height: 1; }
.lang-card .hint { margin: 10px 2px 0; }

/* ——— Fehleranalyse ——— */
.analysis { padding: 12px; }
.analysis .hint { margin: 0 0 8px; }
.weak { list-style: none; margin: 0; padding: 0; }
.weak li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--surface-2); }
.weak-main { flex: 1; min-width: 0; }
.weak-main b { font-size: 14px; }
.weak-type { display: inline-block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-right: 6px; }
.weak .bar { margin: 5px 0 3px; }
.weak .bar.bad i { background: var(--bad, #c8432b); }
.weak small { font-size: 12px; color: var(--muted); }

/* ——— Zusatzpakete ——— */
.vpacks { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.vpack { display: flex; align-items: center; gap: 12px; background: var(--surface); border-radius: 14px; padding: 10px 12px; }
.vpack.on { box-shadow: inset 0 0 0 2px var(--accent); }
.vpack-name { flex: 1; display: flex; flex-direction: column; line-height: 1.25; }
.vpack-name small { color: var(--muted); font-size: 12px; }

/* ——— Feinschliff: Abstände, Treffer­flächen, Fokus, kleine Displays ——— */
:root { --gap: 12px; --pad: 16px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
.answer:focus-visible, .search:focus-visible { outline: none; }
h1, h2, h3, .vcat-name, .les-tt b, .quiz-verb { overflow-wrap: anywhere; }
.topbar h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.section-title, .gcat { margin: 24px 4px 8px; }
.btn.small { min-height: 44px; }
.btn.primary:active { filter: brightness(.92); }
.segmented button { min-height: 40px; }
.chip { min-height: 40px; }
.quick button { min-height: 44px; padding: 4px 10px; }
.focus-banner button { width: 44px; height: 44px; }
.vundo { width: 44px; height: 44px; }
.rd-pop-x { width: 44px; height: 44px; }
.duel-btn { width: 44px; height: 44px; }
.duel-cell { width: 48px; }
.star { width: 48px; height: 48px; }
.sheet-body { padding-bottom: 32px; }
.sheet { padding-bottom: max(env(safe-area-inset-bottom), 8px); }
.quiz-actions .ghost { white-space: nowrap; font-size: 16px; padding-left: 8px; padding-right: 8px; }
.ranking .who b { overflow-wrap: anywhere; }
.ranking th, .ranking td { padding-left: 4px; padding-right: 4px; }
/* Lernen: im Detail (Zurück-Pfeil sichtbar) die Reiter ausblenden */
body:has(#backBtn:not(.hidden)) #view-lessons .learn-seg { display: none; }
.learn-seg button { min-height: 44px; }

/* Üben: kompakter, damit Eingabe und „Check“ auf kleinen iPhones ohne Scrollen sichtbar sind */
.scorebar { margin: 2px 0 8px; }
.srs-info { min-height: 16px; line-height: 16px; }
.feedback { min-height: 20px; margin: 8px 0 2px; }
.accentbar { margin: 6px 0 12px; }
@media (max-height: 700px) {
  .card.quiz { padding: 14px 16px; }
  .quiz-verb { margin: 8px 0 2px; font-size: 28px; }
  .quiz-de { font-size: 15px; }
  .quiz-person { margin: 8px 0 8px; font-size: 19px; }
  .answer { padding: 11px 14px; }
  .accentbar { margin: 4px 0 8px; gap: 5px; }
  .accentbar button { height: 40px; }
  .feedback { min-height: 0; margin: 4px 0 0; }
  .feedback:empty { display: none; }
  .btn { padding: 12px 16px; }
  #practiceSeg { margin-bottom: 2px; }
  .topbar { padding-top: calc(env(safe-area-inset-top) + 2px); padding-bottom: 2px; }
}
@media (max-width: 360px) { .stat .v { font-size: 22px; } .segmented button { font-size: 13px; padding: 8px 3px; } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
