:root {
  --bg: #f6f4ef; --surface: #ffffff; --text: #1b2330; --muted: #5d6775; --line: #dedad1;
  --accent: #1f4e79; --accent-text: #ffffff; --ok: #1f6f4a; --warn: #8a5a00; --err: #a3282d;
  --radius: 14px; --tap: 48px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #14181d; --surface: #1d232b; --text: #eceff3; --muted: #9aa5b3; --line: #2e3742;
  --accent: #7fb2e5; --accent-text: #0e1620; --ok: #6fcf9a; --warn: #e6b65c; --err: #f08b8f; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #14181d; --surface: #1d232b; --text: #eceff3; --muted: #9aa5b3; --line: #2e3742;
  --accent: #7fb2e5; --accent-text: #0e1620; --ok: #6fcf9a; --warn: #e6b65c; --err: #f08b8f; color-scheme: dark; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
#app { max-width: 560px; margin: 0 auto; padding: calc(16px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); min-height: 100dvh; }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 8px 0 6px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 4px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .pad { padding: 24px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
.step { display: flex; gap: 12px; align-items: flex-start; }
.step .num { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 600; font-size: .9rem; }
.step.done .num { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.step > div { flex: 1; min-width: 0; }
button, .btn { font: inherit; min-height: var(--tap); padding: 0 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.block, .btn.block { display: flex; width: 100%; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible + .btn { outline: 3px solid var(--accent); outline-offset: 2px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.status { margin-top: 8px; font-size: .92rem; } .status.ok { color: var(--ok); } .status.err { color: var(--err); } .status.warn { color: var(--warn); }
dl.facts { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 8px 0 0; font-size: .95rem; }
dl.facts dt { color: var(--muted); } dl.facts dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
label.check { display: flex; gap: 10px; align-items: center; min-height: var(--tap); }
label.check input { width: 22px; height: 22px; }
nav.top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
nav.top a { color: var(--accent); min-height: var(--tap); display: inline-flex; align-items: center; }
@media (prefers-reduced-motion: no-preference) { button { transition: transform .08s; } button:active { transform: scale(.98); } }

/* ---- etapa 2: Azi, unitate, carduri ---- */
body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
:root { --again: #a3282d; --hard: #8a5a00; --good: #1f6f4a; --easy: #1f4e79; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --again: #f08b8f; --hard: #e6b65c; --good: #6fcf9a; --easy: #7fb2e5; } }
:root[data-theme="dark"] { --again: #f08b8f; --hard: #e6b65c; --good: #6fcf9a; --easy: #7fb2e5; }
.kicker { color: var(--muted); font-size: .9rem; margin: 6px 0 10px; }
.kicker::first-letter { text-transform: uppercase; }
.center { text-align: center; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
nav.tabs a { flex: 1; min-height: 56px; display: grid; place-items: center; color: var(--muted); text-decoration: none; font-size: .95rem; }
nav.tabs a[aria-current="page"] { color: var(--accent); font-weight: 600; box-shadow: inset 0 2px 0 var(--accent); }
.hero { display: flex; flex-direction: column; gap: 6px; background: var(--accent); color: var(--accent-text); border-radius: 22px; padding: 26px 22px 24px; text-decoration: none; min-height: 190px; justify-content: flex-end; }
.hero.done { background: var(--surface); color: var(--text); border: 1px solid var(--line); }
.hero-label { font-size: .95rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .85; }
.hero-title { font-size: 1.9rem; line-height: 1.12; font-weight: 700; letter-spacing: -0.015em; }
.hero-sub { font-size: .92rem; opacity: .85; }
.second { display: flex; align-items: center; gap: 16px; margin-top: 14px; padding: 16px 20px; min-height: 76px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); line-height: 1.25; }
.second .big { font-size: 2.1rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); min-width: 1.6ch; }
.second.quiet .big { color: var(--muted); }
.stats { display: flex; gap: 28px; margin: 18px 4px 0; color: var(--muted); }
.stats strong { color: var(--text); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.words { list-style: none; margin: 8px 0 0; padding: 0; }
.word { display: flex; align-items: center; border-top: 1px solid var(--line); }
.word label { flex: 1; display: grid; grid-template-columns: 30px 1fr; align-items: center; min-height: 54px; padding: 6px 0; cursor: pointer; }
.word input, label.check input { width: 22px; height: 22px; accent-color: var(--accent); }
.word .w-no { font-weight: 600; } .word .w-ro { grid-column: 2; font-size: .92rem; }
.word.known { opacity: .55; }
label.check { cursor: pointer; } label.check span { flex: 1; }
button.icon { border: 0; background: none; color: var(--accent); min-width: var(--tap); padding: 0 10px; }
button.link { border: 0; background: none; color: var(--muted); text-decoration: underline; min-height: 32px; padding: 0 4px; font-size: .88rem; }
.sticky { position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); margin-top: 18px; }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; margin: 2px 0 14px; } .bar span { display: block; height: 100%; background: var(--accent); }
.flash { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px 20px; min-height: 46dvh; display: flex; flex-direction: column; justify-content: center; gap: 4px; text-align: center; touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: pointer; }
.flash.back { cursor: grab; padding-top: 44px; }
.flash[data-swipe="good"] { border-color: var(--good); box-shadow: inset 0 0 0 2px var(--good); }
.flash[data-swipe="again"] { border-color: var(--again); box-shadow: inset 0 0 0 2px var(--again); }
.badge { position: absolute; top: 14px; left: 18px; margin: 0; font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.f-no { font-size: clamp(1.7rem, 8vw, 2.4rem); line-height: 1.15; font-weight: 700; margin: 0 0 6px; overflow-wrap: anywhere; }
.f-ro { font-size: 1.3rem; margin: 6px 0; }
.tag { font-size: .7rem; border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; margin-left: 8px; color: var(--muted); vertical-align: middle; }
.example { text-align: left; font-size: .98rem; border-left: 3px solid var(--line); padding-left: 12px; margin: 12px 0 0; }
.hint { margin-top: 18px; }
.card-tools { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 10px; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grade { flex-direction: column; gap: 0; min-height: 60px; padding: 0 4px; font-weight: 600; }
.grade .small { font-weight: 400; color: var(--muted); font-size: .78rem; }
.grade.again { border-color: var(--again); color: var(--again); } .grade.hard { border-color: var(--hard); color: var(--hard); }
.grade.good { border-color: var(--good); color: var(--good); } .grade.easy { border-color: var(--easy); color: var(--easy); }
.field { display: grid; gap: 4px; margin: 10px 0; }
.field input { font: inherit; min-height: var(--tap); padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); width: 100%; }
@media (prefers-reduced-motion: no-preference) { .flash { transition: transform .12s; } .flash[data-swipe] { transition: none; } }

/* ---- etapa 3: pagina din carte, ascultare, player ---- */
details.card > summary { cursor: pointer; list-style: none; display: flex; align-items: baseline; gap: 6px; min-height: 32px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: '+'; margin-left: auto; color: var(--muted); font-size: 1.2rem; }
details.card[open] > summary::after { content: '−'; }
details.card > summary h2 { margin: 0; }
details > summary.small { cursor: pointer; min-height: var(--tap); display: flex; align-items: center; color: var(--accent); }
.page { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 1rem; line-height: 1.55; max-height: 60dvh; overflow: auto; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; -webkit-overflow-scrolling: touch; }
.row.between { justify-content: space-between; align-items: center; } .row.tight { gap: 8px; margin-top: 8px; align-items: center; }
.pager { margin-top: 8px; }
button.chip { min-height: 40px; min-width: 44px; padding: 0 12px; border-radius: 20px; font-size: .92rem; }
button.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
button.on { border-color: var(--again); color: var(--again); font-weight: 600; }
.player { margin-top: 8px; } .player input[type=range] { width: 100%; margin: 12px 0 0; accent-color: var(--accent); height: 28px; }
