/* Pflege Deutsch: calm clinical palette, warm paper background. */
:root {
  --bg: #F7F5F0; --surface: #FFFFFF; --surface2: #EFECE5; --line: #E2DDD3;
  --ink: #1F2A2E; --text: #3B4548; --muted: #6F797C;
  --teal: #0F766E; --teal-soft: #E1F0EE; --teal-ink: #0B5952;
  --coral: #D9573A; --coral-soft: #FBEAE4;
  --green: #2F8F4E; --green-soft: #E5F4EA; --green-ink: #22703B;
  --red: #C2412D; --red-soft: #FBE9E5; --red-ink: #9F321F;
  --amber: #B7791F; --amber-soft: #FBF1DE;
  --der: #2563EB; --die: #D0336A; --das: #15803D; --pl: #7C3AED;
  --hl: #FFE58A; --hero: #0F766E;
  --shadow: 0 6px 20px rgba(31, 42, 46, .08);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12181A; --surface: #1B2326; --surface2: #243033; --line: #2E3B3F;
    --ink: #EEF2F1; --text: #CDD6D5; --muted: #8E9A9C;
    --teal: #2DB3A6; --teal-soft: #163330; --teal-ink: #93E1D7;
    --coral: #F07B5B; --coral-soft: #3A2620;
    --green: #4FBF73; --green-soft: #183323; --green-ink: #9BE0B1;
    --red: #EE7A62; --red-soft: #3A2220; --red-ink: #F6B2A4;
    --amber: #E3A847; --amber-soft: #3A2E1A;
    --der: #6A9BFF; --die: #FF6F9E; --das: #4ADE80; --pl: #B28DFF;
    --hl: #6B5A12; --hero: #0D5650;
    --shadow: 0 6px 20px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12181A; --surface: #1B2326; --surface2: #243033; --line: #2E3B3F;
  --ink: #EEF2F1; --text: #CDD6D5; --muted: #8E9A9C;
  --teal: #2DB3A6; --teal-soft: #163330; --teal-ink: #93E1D7;
  --coral: #F07B5B; --coral-soft: #3A2620;
  --green: #4FBF73; --green-soft: #183323; --green-ink: #9BE0B1;
  --red: #EE7A62; --red-soft: #3A2220; --red-ink: #F6B2A4;
  --amber: #E3A847; --amber-soft: #3A2E1A;
  --der: #6A9BFF; --die: #FF6F9E; --das: #4ADE80; --pl: #B28DFF;
  --hl: #6B5A12; --hero: #0D5650;
  --shadow: 0 6px 20px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Figtree', 'Segoe UI', system-ui, sans-serif; font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
#app { max-width: 640px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding-inline: 16px; padding-block: 0 40px; }
h1, h2, h3 { font-weight: 800; color: var(--ink); letter-spacing: -0.015em; text-wrap: balance; margin: 0; }
h1 { font-size: 1.55rem; line-height: 1.2; } h2 { font-size: 1.2rem; } h3 { font-size: 1.02rem; }
p { margin: 0; }
a { color: var(--teal); }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; padding: 0; touch-action: manipulation; }
button:focus-visible, a:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.eyebrow { font-size: .76rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.hidden { display: none !important; }

/* top bar */
.top { position: sticky; top: 0; z-index: 10; background: var(--bg); display: flex; align-items: center; gap: 10px; padding: calc(env(safe-area-inset-top, 0px) + 10px) 0 10px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.1rem; color: var(--teal); flex: 1; text-decoration: none; min-width: 0; }
.brand em { font-style: normal; color: var(--ink); }
.brand svg { width: 28px; height: 28px; flex: none; }
.iconbtn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink); background: var(--surface2); flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--surface2); color: var(--ink); font-weight: 700; font-size: .85rem; font-variant-numeric: tabular-nums; }
.pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); }
.timer { font-weight: 800; font-variant-numeric: tabular-nums; padding: 6px 10px; border-radius: 999px; background: var(--teal-soft); color: var(--teal-ink); font-size: .9rem; }
.timer.low { background: var(--coral-soft); color: var(--coral); }

main { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.screen { display: flex; flex-direction: column; gap: 14px; animation: rise .22s ease-out both; }
@keyframes rise { from { opacity: .4; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; transition-duration: .001s !important; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 1rem; transition: transform .08s ease, filter .15s ease; width: 100%; text-align: center; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--teal); color: #fff; box-shadow: 0 6px 16px rgba(15, 118, 110, .25); }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost { background: transparent; color: var(--teal); min-height: 44px; }
.btn.danger { background: transparent; color: var(--red); min-height: 44px; }
.btn[disabled] { opacity: .45; cursor: default; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.stickybar { position: sticky; bottom: 0; padding: 12px 0 calc(env(safe-area-inset-bottom, 0px) + 8px); background: linear-gradient(to top, var(--bg) 70%, transparent); z-index: 4; }

/* cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h3 + p { margin-top: 4px; }
.hero { background: var(--hero); color: #fff; border: 0; }
.hero h1, .hero h2 { color: #fff; }
.hero .muted { color: rgba(255, 255, 255, .8); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 6px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; min-height: 108px; box-shadow: var(--shadow); color: var(--text); text-decoration: none; }
.tile b { color: var(--ink); font-size: 1.02rem; }
.tile .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal-ink); font-weight: 800; }
.tile.wide { grid-column: span 2; min-height: 0; flex-direction: row; align-items: center; gap: 12px; }
.tile.wide .grow { flex: 1; }
.bar { height: 6px; border-radius: 99px; background: var(--surface2); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--teal); border-radius: inherit; }

/* lists */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; text-align: left; width: 100%; color: var(--text); text-decoration: none; }
.item .grow { flex: 1; min-width: 0; }
.item b { color: var(--ink); display: block; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 28px; padding: 0 8px; border-radius: 9px; font-weight: 800; font-size: .82rem; background: var(--surface2); color: var(--muted); font-variant-numeric: tabular-nums; }
.badge.good { background: var(--green-soft); color: var(--green-ink); }
.badge.mid { background: var(--amber-soft); color: var(--amber); }
.badge.bad { background: var(--red-soft); color: var(--red-ink); }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--teal-soft); color: var(--teal-ink); }

/* segmented tabs */
.seg { display: flex; background: var(--surface2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { flex: 1; padding: 9px 6px; border-radius: 9px; font-weight: 700; font-size: .9rem; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }

/* reading text */
.text { font-family: 'Source Serif 4', Georgia, serif; font-size: 1.06rem; line-height: 1.68; color: var(--ink); overflow-wrap: break-word; }
[lang="de"] { hyphens: auto; -webkit-hyphens: auto; }
.text p + p { margin-top: .7em; }
.text .head { font-family: 'Figtree', sans-serif; font-weight: 800; font-size: 1rem; margin-bottom: .4em; }
.g { cursor: pointer; border-bottom: 1.5px dotted var(--teal); }
.no-ul .g { border-bottom: 0; }
.g:active { background: var(--teal-soft); }
mark.beleg { background: var(--hl); color: inherit; border-radius: 3px; padding: 0 1px; }
.mail { border-left: 4px solid var(--teal); }
.mail .from { font-family: 'Figtree', sans-serif; font-size: .82rem; color: var(--muted); margin-top: .6em; white-space: pre-line; }

/* choices */
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-width: 44px; height: 44px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.chip.taken { opacity: .38; }
.chip.right { background: var(--green); border-color: var(--green); color: #fff; opacity: 1; }
.chip.wrong { background: var(--red); border-color: var(--red); color: #fff; opacity: 1; }
.opt { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); line-height: 1.4; }
.opt .k { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface2); font-weight: 800; font-size: .85rem; }
.opt[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); }
.opt[aria-pressed="true"] .k { background: var(--teal); color: #fff; }
.opt.right { border-color: var(--green); background: var(--green-soft); }
.opt.right .k { background: var(--green); color: #fff; }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt.wrong .k { background: var(--red); color: #fff; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.q { display: flex; flex-direction: column; gap: 10px; }
.q + .q { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.q .stem { font-weight: 700; color: var(--ink); }
.num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--ink); color: var(--bg); font-weight: 800; font-size: .8rem; margin-right: 6px; vertical-align: 1px; }
.why { background: var(--surface2); border-radius: 12px; padding: 10px 12px; font-size: .93rem; line-height: 1.5; }
.why.right { background: var(--green-soft); }
.why.wrong { background: var(--red-soft); }
.why b { color: var(--ink); }
.rf { display: flex; gap: 8px; }
.rf .chip { flex: 1; }

/* betreff list */
.betreff { display: grid; gap: 6px; }
.betreff div { display: flex; gap: 10px; align-items: baseline; }
.betreff .k { font-weight: 800; color: var(--teal); width: 16px; flex: none; }
.betreff .used { color: var(--muted); text-decoration: line-through; }

/* Pflegeplanung rows */
.plan { display: flex; flex-direction: column; gap: 10px; }
.prow { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 12px 14px; }
.prow .k { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--teal); color: #fff; font-weight: 800; margin-bottom: 6px; }
.prow dl { margin: 0; display: grid; grid-template-columns: 96px 1fr; gap: 4px 10px; font-size: .95rem; }
.prow dt { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding-top: 3px; }
.prow dd { margin: 0; color: var(--ink); font-family: 'Source Serif 4', Georgia, serif; }

/* gap texts */
.gap { display: inline-flex; align-items: center; gap: 5px; min-width: 72px; min-height: 36px; padding: 2px 10px; margin: 2px 2px; border-radius: 8px; border: 1.5px dashed var(--teal); background: var(--teal-soft); color: var(--teal-ink); font-family: 'Figtree', sans-serif; font-weight: 700; font-size: .95rem; line-height: 1.5; vertical-align: baseline; }
.gap .n { font-size: .72rem; opacity: .75; }
.gap.filled { border-style: solid; }
.gap.right { border-color: var(--green); background: var(--green-soft); color: var(--green-ink); }
.gap.wrong { border-color: var(--red); background: var(--red-soft); color: var(--red-ink); }
.gap.active { outline: 3px solid var(--coral); outline-offset: 1px; background: var(--coral-soft); }
.gaptext { line-height: 2.1; }
.wordbank { display: flex; flex-wrap: wrap; gap: 6px; }
.wordbank span { padding: 4px 10px; border-radius: 99px; background: var(--surface2); font-weight: 600; font-size: .9rem; color: var(--ink); }
.wordbank span.used { opacity: .35; text-decoration: line-through; }

/* bottom sheet */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 16, 18, .38); animation: fade .15s ease-out; }
.sheet > div { width: 100%; max-width: 640px; background: var(--surface); border-radius: 20px 20px 0 0; padding: 18px 16px calc(env(safe-area-inset-bottom, 0px) + 18px); max-height: 80vh; overflow: auto; animation: up .2s ease-out; display: flex; flex-direction: column; gap: 12px; }
.sheet .grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line); margin: -6px auto 2px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(30px); } }
.gloss-de { font-size: 1.3rem; font-weight: 800; color: var(--ink); }
.gloss-pt { font-size: 1.1rem; color: var(--text); }

/* articles */
.art-der { color: var(--der); } .art-die { color: var(--die); } .art-das { color: var(--das); } .art-pl { color: var(--pl); }

/* Schreiben */
.bogen { display: flex; flex-direction: column; gap: 10px; }
.bogen .area { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface); }
.bogen .area h4 { margin: 0; padding: 8px 12px; background: var(--surface2); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.bogen .entry { display: grid; grid-template-columns: 110px 1fr 22px; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--line); font-size: .95rem; align-items: start; }
.bogen .entry:first-of-type { border-top: 0; }
.bogen .entry span:first-child { color: var(--muted); font-weight: 600; font-size: .86rem; }
.bogen .entry span:nth-child(2) { color: var(--ink); }
.bogen .entry .st { font-weight: 800; text-align: center; }
.bogen .entry.ok .st { color: var(--green); }
.bogen .entry.miss { background: var(--red-soft); }
.bogen .entry.miss .st { color: var(--red); }
.bogen .entry.part { background: var(--amber-soft); }
.bogen .entry.part .st { color: var(--amber); }
.kopf { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: .95rem; }
.kopf span:nth-child(odd) { color: var(--muted); }
.kopf span:nth-child(even) { color: var(--ink); font-weight: 600; }
textarea.write { width: 100%; min-height: 300px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); padding: 14px; font: 1.02rem/1.6 'Source Serif 4', Georgia, serif; resize: vertical; }
.meter { display: flex; justify-content: space-between; font-size: .86rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.model { white-space: pre-line; }
.score { font-size: 2.4rem; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }

/* Satzbau tiles */
.answer-line { min-height: 64px; display: flex; flex-wrap: wrap; gap: 6px; align-content: flex-start; padding: 10px; border-radius: 14px; border: 1.5px dashed var(--line); background: var(--surface); }
.answer-line.right { border: 1.5px solid var(--green); background: var(--green-soft); }
.answer-line.wrong { border: 1.5px solid var(--red); background: var(--red-soft); }
.pool { display: flex; flex-wrap: wrap; gap: 6px; }
.wtile { padding: 9px 12px; border-radius: 10px; background: var(--surface); border: 1.5px solid var(--line); font-weight: 600; color: var(--ink); box-shadow: 0 2px 0 var(--line); }
.answer-line .wtile { background: var(--teal-soft); border-color: transparent; box-shadow: none; }
.wtile.ghost { visibility: hidden; }

/* flashcards */
.flash { min-height: 260px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: 12px; cursor: pointer; }
.flash .word { font-size: 1.9rem; font-weight: 800; color: var(--ink); line-height: 1.2; }
.flash .ex { font-family: 'Source Serif 4', Georgia, serif; color: var(--text); font-size: 1.02rem; }
.flash .pt { font-size: 1.25rem; color: var(--teal-ink); font-weight: 700; }
.rate { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rate .btn { min-height: 54px; flex-direction: column; gap: 0; font-size: .95rem; }
.rate .btn small { font-weight: 500; font-size: .72rem; opacity: .8; }
.rate .again { background: var(--red-soft); color: var(--red-ink); }
.rate .hard { background: var(--amber-soft); color: var(--amber); }
.rate .good { background: var(--green-soft); color: var(--green-ink); }
.artq { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.artq .btn { font-size: 1.15rem; }

/* misc */
.empty { text-align: center; padding: 30px 10px; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 22px); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-weight: 600; z-index: 60; animation: rise .2s ease-out; max-width: calc(100% - 32px); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch input { width: 46px; height: 26px; accent-color: var(--teal); }
.parts { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.parts button { flex: none; padding: 8px 12px; border-radius: 10px; background: var(--surface2); font-weight: 700; font-size: .85rem; color: var(--muted); }
.parts button[aria-current="true"] { background: var(--ink); color: var(--bg); }
.parts button.done::after { content: " ✓"; }
table.res { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.res td { padding: 8px 4px; border-top: 1px solid var(--line); }
table.res td:last-child { text-align: right; font-weight: 800; color: var(--ink); }
@media (max-width: 380px) {
  .prow dl { grid-template-columns: 1fr; }
  .bogen .entry { grid-template-columns: 1fr 22px; }
  .bogen .entry span:first-child { grid-column: 1 / -1; }
}
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .top:has(#timer:not([hidden])) .brand span { display: none; } }

/* ---------- phone layout: bottom tab bar ---------- */
body.has-tabbar #app { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(env(safe-area-inset-bottom, 0px) + 6px); }
.tabbar a { flex: 1; max-width: 160px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; color: var(--muted); text-decoration: none; font-size: .74rem; font-weight: 700; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a[aria-current="page"] { color: var(--teal); background: var(--teal-soft); }

/* ---------- exercises: compact header + bottom question dock ---------- */
.exhead { display: flex; align-items: center; gap: 10px; }
.exhead .grow { flex: 1; min-width: 0; }
.exhead h2 { font-size: 1.12rem; }
.result .score { font-size: 2rem; }
.mail.cur, article.card.cur { border-color: var(--teal); }
.mailhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pickbtn { min-height: 36px; }
.pick { display: inline-block; padding: 6px 10px; border-radius: 999px; background: var(--surface2); color: var(--muted); font-weight: 700; font-size: .82rem; }
.pick.set { background: var(--teal-soft); color: var(--teal-ink); }
.pick.ok { background: var(--green-soft); color: var(--green-ink); }
.pick.bad { background: var(--red-soft); color: var(--red-ink); }
.prow-h { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.prow-h .k { margin-bottom: 0; }
.prow.hit { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal) inset; }
mark.beleg.cur { background: var(--hl); outline: 2px solid var(--amber); }
mark.beleg:not(.cur) { background: color-mix(in srgb, var(--hl) 45%, transparent); }

.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; margin: 0 auto; max-width: 640px; background: var(--surface); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, .12); padding: 6px 10px calc(env(safe-area-inset-bottom, 0px) + 8px); display: flex; flex-direction: column; gap: 6px; }
.dock-head { display: flex; align-items: center; gap: 6px; }
.navbtn { flex: none; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface2); color: var(--ink); }
.dock-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.dock-label { font-weight: 800; font-size: .88rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; min-height: 22px; }
.dock-label .chev { margin-left: 6px; color: var(--muted); }
.dots { display: flex; justify-content: center; flex-wrap: nowrap; }
.dot { width: 14px; height: 16px; display: grid; place-items: center; }
.dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: block; }
.dot.ans i { background: var(--teal); }
.dot.ok i { background: var(--green); }
.dot.bad i { background: var(--red); }
.dot.cur i { width: 10px; height: 10px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--ink); }
.dockbtn { width: auto; min-height: 40px; padding: 8px 14px; font-size: .92rem; border-radius: 12px; box-shadow: none; flex: none; }
.scorepill { flex: none; min-height: 40px; padding: 0 12px; }
.dock-body { max-height: 36vh; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding-bottom: 2px; }
.dock.collapsed .dock-body { display: none; }
.dq { font-size: .98rem; line-height: 1.4; color: var(--ink); }
.dq.text { font-size: 1.04rem; }
.srows { display: flex; flex-direction: column; gap: 4px; }
.srow { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; min-height: 38px; padding: 5px 8px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-size: .9rem; line-height: 1.25; }
.srow .k { flex: none; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--surface2); font-weight: 800; font-size: .85rem; }
.srow .t { flex: 1; }
.srow small { color: var(--muted); font-size: .72rem; white-space: nowrap; }
.srow.sel { border-color: var(--teal); background: var(--teal-soft); }
.srow.sel .k { background: var(--teal); color: #fff; }
.srow.taken { opacity: .5; }
.srow.right { border-color: var(--green); background: var(--green-soft); }
.srow.right .k { background: var(--green); color: #fff; }
.srow.wrong { border-color: var(--red); background: var(--red-soft); }
.srow.wrong .k { background: var(--red); color: #fff; }
.chips9 { display: grid; grid-template-columns: repeat(9, 1fr); gap: 5px; }
.chips9 .chip { min-width: 0; padding: 0; height: 44px; }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; }
.wchip { min-height: 42px; padding: 6px 11px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font-weight: 600; font-size: .98rem; }
.wchip sup { font-size: .68rem; color: var(--muted); margin-left: 3px; }
.wchip.sel { background: var(--teal); border-color: var(--teal); color: #fff; }
.wchip.taken { opacity: .45; }
.btn.rf { min-height: 50px; background: var(--surface); border: 1.5px solid var(--line); color: var(--ink); }
.btn.rf[aria-pressed="true"] { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.rf.right { background: var(--green); border-color: var(--green); color: #fff; opacity: 1; }
.btn.rf.wrong { background: var(--red); border-color: var(--red); color: #fff; opacity: 1; }
.btn.rf[disabled]:not(.right):not(.wrong) { opacity: .45; }
.opt[disabled] { cursor: default; }
.parts { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 60px); z-index: 6; background: var(--bg); padding: 2px 0 8px; }

/* ---------- writing: bar above the keyboard ---------- */
.writebar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; max-width: 640px; margin: 0 auto; display: flex; gap: 8px; padding: 10px 12px calc(env(safe-area-inset-bottom, 0px) + 10px); background: var(--surface); border-top: 1px solid var(--line); }
.writebar .btn { min-height: 46px; }
.writebar .cov { flex: 1.3; }
.write-pad { height: 90px; }
.covchip { display: inline-block; padding: 2px 8px; border-radius: 99px; background: var(--teal-soft); color: var(--teal-ink); font-size: .82rem; font-weight: 800; margin-left: 4px; font-variant-numeric: tabular-nums; }
.drillnav { display: flex; flex-wrap: wrap; gap: 6px; }
.drillnav a { min-height: 36px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 99px; background: var(--surface2); color: var(--muted); font-weight: 700; font-size: .85rem; text-decoration: none; }
.drillnav a[aria-current="true"] { background: var(--teal); color: #fff; }

/* ---------- personal code ---------- */
.codebig { font-size: 2rem; font-weight: 800; letter-spacing: .08em; color: var(--ink); font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
.codein { flex: 1; min-width: 0; min-height: 48px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); padding: 0 12px; font: 700 1.1rem/1 'Figtree', sans-serif; letter-spacing: .08em; text-transform: uppercase; }
