/* Svenska på 7 dagar — styles. Light/dark themes via tokens. No external fonts or CDNs. */
:root {
  --bg: #f5f3ee; --surface: #ffffff; --surface-2: #f0ede6; --ink: #1c2330; --muted: #5d6676; --line: #e2ddd3;
  --primary: #2457a6; --primary-ink: #ffffff; --primary-soft: #e3ecfa; --accent: #f2c230; --accent-soft: #fdf3d2;
  --good: #23784b; --good-soft: #e1f3e8; --warn: #a86b00; --warn-soft: #fbefd6; --bad: #b63a33; --bad-soft: #fbe3e1;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 4px 16px rgba(20, 30, 50, .06);
  --radius: 16px; --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs: 17px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141b; --surface: #171e28; --surface-2: #1e2733; --ink: #e8ecf2; --muted: #9aa5b5; --line: #2a3442;
    --primary: #6ea4ff; --primary-ink: #0b1220; --primary-soft: #1d2b42; --accent: #f2c230; --accent-soft: #3a3218;
    --good: #5cc98c; --good-soft: #163626; --warn: #f0b44c; --warn-soft: #3a2d12; --bad: #ff7d73; --bad-soft: #3b1d1b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141b; --surface: #171e28; --surface-2: #1e2733; --ink: #e8ecf2; --muted: #9aa5b5; --line: #2a3442;
  --primary: #6ea4ff; --primary-ink: #0b1220; --primary-soft: #1d2b42; --accent: #f2c230; --accent-soft: #3a3218;
  --good: #5cc98c; --good-soft: #163626; --warn: #f0b44c; --warn-soft: #3a2d12; --bad: #ff7d73; --bad-soft: #3b1d1b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25); color-scheme: dark;
}
:root.big-text { --fs: 20px; }

* { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.5; }
a { color: var(--primary); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.65rem; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .7em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { justify-content: center; text-align: center; }
.strike { text-decoration: line-through; text-decoration-color: var(--bad); opacity: .85; }
.good-txt { color: var(--good); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: var(--primary-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- layout ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; width: 232px; flex: 0 0 232px; background: var(--surface); border-right: 1px solid var(--line); padding: 16px 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; color: var(--ink); padding: 6px 10px 16px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), #3a78d6); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: 1rem; }
.brand strong { display: block; font-size: 1.05rem; }
.brand small { color: var(--muted); font-size: .78rem; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 11px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: .95rem; border: 0; background: none; font-family: inherit; cursor: pointer; text-align: left; }
.nav-item small { display: block; color: var(--muted); font-size: .72rem; font-weight: 400; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-ic { width: 1.4em; text-align: center; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 10px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top-day { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.top-theme { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.icon-btn.menu-btn { display: none; }
main { padding: 24px; max-width: 1080px; width: 100%; margin: 0 auto; outline: none; }
.bottombar, .scrim { display: none; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; }
.back-link { text-decoration: none; font-weight: 600; white-space: nowrap; }
.day-sep { margin: 1.4em 0 .6em; color: var(--muted); font-weight: 600; }

@media (max-width: 860px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 50; }
  .icon-btn.menu-btn { display: inline-grid; }
  main { padding: 16px 16px 96px; }
  .topbar { padding: 8px 12px; }
  .hide-sm { display: none; }
  .bottombar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: var(--surface); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottombar .nav-item { flex-direction: column; gap: 0; font-size: .7rem; padding: 6px 4px; flex: 1; align-items: center; text-align: center; }
  .bottombar .nav-item small { display: none; }
  .bottombar .nav-ic { font-size: 1.25rem; }
  h1 { font-size: 1.35rem; }
}

/* ---------- building blocks ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.row.wrap, .wrap { flex-wrap: wrap; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.two-col > .card { margin-bottom: 0; }
.two-col { margin-bottom: 16px; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; } }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; text-decoration: none; transition: transform .08s ease, background .15s; min-height: 40px; }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.ghost { background: transparent; }
.btn.small { padding: 5px 12px; min-height: 32px; font-size: .84rem; }
.btn.big { padding: 12px 22px; font-size: 1rem; min-height: 48px; }
.btn.link { border: 0; background: none; color: var(--primary); padding: 0; min-height: 0; text-decoration: underline; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.rec, .icon-btn.rec { background: var(--bad); color: #fff; border-color: var(--bad); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 25%, transparent); } }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 1rem; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.playing { background: var(--primary-soft); border-color: var(--primary); }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); font-size: .8rem; font-weight: 600; color: var(--ink); font-family: inherit; }
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--primary); }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.warm { background: var(--accent-soft); border-color: transparent; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.day-chip { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; flex: 1; min-width: 60px; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #4a8ae6); border-radius: 99px; transition: width .4s ease; }
.ring { position: relative; width: 120px; height: 120px; flex: 0 0 120px; margin: 0 auto; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-bg { stroke: var(--surface-2); }
.ring-fg { stroke: var(--primary); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label strong { font-size: 1.45rem; }
.ring-label small { color: var(--muted); font-size: .72rem; max-width: 90px; line-height: 1.2; }
.notice { background: var(--accent-soft); border-radius: var(--radius-sm); padding: 12px 14px; margin: 10px 0; font-size: .92rem; }
.notice p:last-child { margin: 0; }
.notice.bad { background: var(--bad-soft); }
.empty { padding: 10px 0; }
.tutor { display: flex; gap: 10px; align-items: flex-start; background: var(--primary-soft); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 14px; }
.tutor-face { font-size: 1.6rem; line-height: 1; }
.tutor-msg { font-size: .95rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; color: var(--muted); font-weight: 700; margin-bottom: .3em; }
input[type=text], input[type=search], select, textarea, .answer-input { font: inherit; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 44px; width: 100%; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
input[type=range] { width: 100%; accent-color: var(--primary); }

/* ---------- dashboard ---------- */
.hero { display: flex; gap: 24px; align-items: center; background: linear-gradient(135deg, var(--surface), var(--primary-soft)); }
.hero-text { flex: 1; }
.hero h2 { font-size: 1.25rem; }
@media (max-width: 640px) { .hero { flex-direction: column-reverse; align-items: stretch; } }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { display: flex; gap: 12px; align-items: flex-start; margin: 0; padding: 14px 16px; text-decoration: none; color: var(--ink); }
a.stat:hover { border-color: var(--primary); }
.stat-ic { font-size: 1.5rem; }
.stat > div { flex: 1; min-width: 0; }
.stat-val { font-size: 1.3rem; font-weight: 750; }
.stat-label { font-weight: 600; font-size: .88rem; }
.stat-sub { font-size: .78rem; margin-top: 2px; }
.stat-sub .progress { margin-top: 6px; }
.checklist { list-style: none; padding: 0; margin: 0 0 1em; }
.checklist li { padding: 4px 0 4px 28px; position: relative; }
.checklist li::before { content: '○'; position: absolute; left: 4px; color: var(--muted); }
.checklist li.ok::before { content: '✓'; color: var(--good); font-weight: 800; }
.checklist.live li.ok { color: var(--good); }
.sec-mini { display: flex; flex-wrap: wrap; gap: 6px; }
.sec-pill { font-size: .8rem; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); text-decoration: none; color: var(--ink); border: 1px solid var(--line); }
.sec-pill.done { background: var(--good-soft); color: var(--good); border-color: transparent; }
.weak-list { list-style: none; padding: 0; margin: 0 0 12px; }
.weak-list li { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.roadmap { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
@media (max-width: 1000px) { .roadmap { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.road-day a { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); background: var(--surface-2); border: 2px solid transparent; border-radius: 14px; padding: 12px; height: 100%; }
.road-day a:hover { border-color: var(--line); }
.road-day.current a { border-color: var(--primary); background: var(--primary-soft); }
.road-day.done .road-num { background: var(--good); }
.road-num { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--primary-ink); font-weight: 800; }
.road-body { display: flex; flex-direction: column; gap: 6px; }
.road-body strong { font-size: .9rem; }
.road-body small { font-size: .75rem; }

/* ---------- lessons ---------- */
.section-list { list-style: none; padding: 0; margin: 0; }
.section-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.section-row:last-child { border: 0; }
.section-row.done .sec-ic { background: var(--good-soft); }
.sec-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-size: 1.3rem; flex: 0 0 44px; }
.sec-main { flex: 1; min-width: 0; }
.sticky-actions { position: sticky; bottom: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 8px 8px 8px 16px; box-shadow: var(--shadow); justify-content: space-between; margin-top: 12px; z-index: 5; }
@media (max-width: 860px) { .sticky-actions { bottom: 76px; } }
.word-card .sv.xl, .sv.xl { font-size: 2rem; margin: 0; }
.word-en { font-size: 1.15rem; font-weight: 600; }
.pron-lesson .tips { margin-top: 0; }
.pron-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; flex-wrap: wrap; }
.pron-row:nth-child(odd) { background: var(--surface-2); }
.pron-row.practised .pron-word strong::after { content: ' ✓'; color: var(--good); }
.pron-word strong { font-size: 1.15rem; }
.pron-note { display: block; color: var(--muted); }
.grammar-card .gtable { border-collapse: collapse; width: 100%; margin: 8px 0 14px; font-size: .95rem; }
.gtable td { padding: 6px 10px; border-bottom: 1px solid var(--line); }
.gtable td:first-child { font-weight: 650; white-space: nowrap; }
.mistakes { background: var(--warn-soft); border-radius: var(--radius-sm); padding: 10px 14px; margin: 12px 0; }
.mistakes ul { margin: 0; padding-left: 1.2em; }
.simple { background: var(--good-soft); border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 10px; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 8px; }
.list-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); margin: 0; }
.list-card:hover { border-color: var(--primary); }
.page-tabs { margin-bottom: 16px; }

/* ---------- Swedish text with English support ---------- */
.svt { margin: 8px 0; }
.svt-line { font-size: 1.12rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.svt.lg .svt-line { font-size: 1.3rem; }
.svt.xl .svt-line { font-size: 1.7rem; font-weight: 600; }
.speaker { font-size: .9rem; }
.sv .w { cursor: pointer; border-bottom: 1px dotted color-mix(in srgb, var(--primary) 50%, transparent); border-radius: 2px; }
.sv .w:hover { background: var(--primary-soft); }
.svt-en { color: var(--muted); font-size: .95rem; margin-top: 2px; font-style: italic; }
.svt-tools { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; align-items: center; }
.svt-tools .icon-btn { width: 32px; height: 32px; flex-basis: 32px; font-size: .85rem; }
.tool { font: inherit; font-size: .78rem; font-weight: 700; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 4px 10px; cursor: pointer; min-height: 32px; }
.tool[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.tool:disabled { opacity: .4; cursor: not-allowed; }
.tool-label { font-weight: 500; }
@media (max-width: 480px) { .tool-label { display: none; } }
.popover { position: absolute; z-index: 90; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: 14px; padding: 12px 14px; font-size: .92rem; }
.pop-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 1.15rem; }
.pop-en { font-weight: 650; margin: 4px 0; }
.pop-note { font-size: .82rem; margin-bottom: 4px; }
.sv.big { font-size: 1.35rem; font-weight: 600; }

/* ---------- modal & drawer ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(10, 15, 25, .45); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 20px; width: min(560px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); }
.modal.wide { width: min(760px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 8px; gap: 12px; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 4px 20px 12px; overflow-y: auto; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 12px 20px 18px; flex-wrap: wrap; }
.explain h3 { margin-top: 1.1em; }
.ex-sentence { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ex-meaning { font-size: 1.05rem; }
.ex-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.ex-word { background: var(--surface-2); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; font-size: .9rem; }
.ex-word .sv { font-weight: 700; }
.ex-point { border-left: 3px solid var(--primary); padding: 4px 0 4px 12px; margin: 8px 0; }
.ex-point p { margin: 2px 0 0; }
.ex-alts li { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(440px, 100vw); background: var(--surface); z-index: 70; box-shadow: -10px 0 40px rgba(0, 0, 0, .2); display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 4px; }
.drawer-head h2 { margin: 0; }
.drawer-body { padding: 12px 18px 24px; overflow-y: auto; flex: 1; }
.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { font: inherit; font-size: .88rem; font-weight: 600; padding: 10px 12px; border: 0; background: none; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; text-decoration: none; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.phrase-card { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; margin: 10px 0; }
.phrase-card.best { border-color: var(--primary); background: var(--primary-soft); }
.practice { margin-top: 8px; }
.help-btn { min-height: 36px; padding: 6px 14px; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(480px, calc(100vw - 32px)); }
@media (max-width: 860px) { #toasts { bottom: 84px; } }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); transition: opacity .3s, transform .3s; font-size: .92rem; }
.toast.good { background: var(--good); color: #fff; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- answers & exercises ---------- */
.answer { margin: 12px 0; }
.answer-row { display: flex; gap: 8px; align-items: stretch; }
.answer-row .answer-input { flex: 1; font-size: 1.08rem; }
.answer-row .icon-btn { width: 44px; height: 44px; flex-basis: 44px; align-self: center; }
.answer-extras { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.aao { display: flex; gap: 4px; }
.key { font: inherit; font-weight: 700; width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.key:hover { border-color: var(--primary); }
.mic-status { font-size: .85rem; color: var(--muted); }
.runner { max-width: 760px; }
.runner-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.runner-count { font-weight: 700; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.runner-type { text-transform: uppercase; letter-spacing: .06em; font-size: .75rem; font-weight: 700; color: var(--primary); margin: 6px 0; }
.runner-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.skip { margin-left: auto; }
.prompt { font-size: 1.2rem; margin: 4px 0 12px; }
.en-prompt { display: flex; gap: 10px; align-items: baseline; font-size: 1.25rem; font-weight: 600; margin-bottom: 8px; }
.options { display: grid; gap: 8px; margin: 10px 0; }
.opt { display: flex; gap: 12px; align-items: center; text-align: left; font: inherit; font-size: 1.02rem; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; min-height: 48px; }
.opt:hover:not(:disabled) { border-color: var(--primary); background: var(--primary-soft); }
.opt-key { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-2); font-size: .8rem; font-weight: 700; flex: 0 0 26px; }
.opt.right { border-color: var(--good); background: var(--good-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt:disabled { cursor: default; }
.fill-line { font-size: 1.3rem; line-height: 2.2; }
.blank { display: inline-block; width: auto; min-height: 0; padding: 2px 8px; font-size: 1.15rem; border-width: 0 0 2px; border-radius: 6px 6px 0 0; background: var(--primary-soft); }
.cue { color: var(--muted); font-size: 1rem; }
.order-line { min-height: 56px; border: 2px dashed var(--line); border-radius: 14px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0; }
.order-bank { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chip.word { font-size: 1.05rem; padding: 8px 14px; font-weight: 600; background: var(--surface); }
.order-line .chip.word { background: var(--primary-soft); border-color: var(--primary); }
.tools-row { flex-wrap: wrap; margin-top: 4px; }
.hint { background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; margin: 10px 0; display: inline-block; }
.feedback { border-radius: 14px; padding: 12px 16px; margin: 14px 0 4px; border: 1.5px solid; animation: pop .25s ease; }
@keyframes pop { from { transform: scale(.98); opacity: .4; } }
.feedback.good { background: var(--good-soft); border-color: var(--good); }
.feedback.almost { background: var(--warn-soft); border-color: var(--warn); }
.feedback.bad { background: var(--bad-soft); border-color: var(--bad); }
.fb-title { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.fb-icon { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--good); font-size: .85rem; }
.almost .fb-icon { background: var(--warn); }
.bad .fb-icon { background: var(--bad); }
.fb-cheer { color: var(--muted); font-size: .9rem; }
.fb-note { margin: 4px 0; }
.fb-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.listen-box { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0; }
.play-big { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--primary); color: var(--primary-ink); font-size: 1.8rem; cursor: pointer; box-shadow: var(--shadow); }
.play-big.playing { animation: pulse 1.2s infinite; }
.transcript { background: var(--surface-2); border-radius: 12px; padding: 8px 14px; margin: 8px 0; }
.dline.now { background: var(--accent-soft); border-radius: 10px; }
.q-card .options { margin-bottom: 0; }
.steps { color: var(--muted); padding-left: 1.2em; }
.speak-out { margin-top: 12px; }
.diff .ok { color: var(--good); font-weight: 650; }
.diff .miss { color: var(--bad); text-decoration: underline wavy; }
.timer-wrap { display: flex; gap: 10px; align-items: center; margin: 4px 0; }
.timer { flex: 1; height: 6px; background: var(--surface-2); border-radius: 9px; overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: var(--accent); transition: width 1s linear; }
.timer-label { font-weight: 700; font-variant-numeric: tabular-nums; }
.big-timer { font-size: 2.6rem; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.center-col { display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.summary { text-align: center; }
.summary .row { justify-content: center; flex-wrap: wrap; }
.missed { text-align: left; margin: 12px 0; }
.missed-item { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px dashed var(--line); gap: 2px; }
.explain-card h3 { margin-top: .6em; }
.cat-bars { display: grid; gap: 10px; }
.cat-bar { display: grid; grid-template-columns: 200px 1fr 50px; gap: 10px; align-items: center; }
@media (max-width: 560px) { .cat-bar { grid-template-columns: 1fr 50px; } .cat-bar .progress { grid-column: 1 / -1; grid-row: 2; } }

/* ---------- conversations ---------- */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg-btn { font: inherit; font-size: .88rem; font-weight: 600; border: 0; padding: 7px 14px; border-radius: 999px; background: none; color: var(--ink); cursor: pointer; }
.seg-btn.on { background: var(--primary); color: var(--primary-ink); }
.scn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 8px; }
.scn { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); margin: 0; }
.scn:hover { border-color: var(--primary); transform: translateY(-1px); }
.scn-top { display: flex; align-items: center; gap: 8px; }
.scn-emoji { font-size: 1.8rem; }
.stars { margin-left: auto; color: var(--warn); letter-spacing: 1px; }
.scene { background: var(--primary-soft); border-color: transparent; }
.scene p { margin: 8px 0 0; }
.chat-log { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; min-height: 120px; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 92%; }
.msg.partner .bubble { background: var(--surface); border: 1px solid var(--line); border-radius: 18px 18px 18px 4px; }
.msg.user { align-self: flex-end; }
.msg.user .bubble { background: var(--primary); color: var(--primary-ink); border-radius: 18px 18px 4px 18px; font-size: 1.05rem; }
.msg.user.corrected .bubble { background: var(--good); color: #fff; }
.msg.sys { align-self: center; max-width: 100%; width: 100%; }
.msg.sys > * { width: 100%; }
.bubble { padding: 10px 14px; box-shadow: var(--shadow); min-width: 0; }
.bubble .svt { margin: 2px 0 0; }
.who { font-size: .75rem; font-weight: 700; color: var(--muted); }
.avatar { font-size: 1.8rem; line-height: 1; flex: 0 0 auto; }
.bubble.partner { display: flex; }
.mini-fb { font-size: .9rem; background: var(--good-soft); border-radius: 10px; padding: 6px 12px; }
.composer { position: sticky; bottom: 8px; z-index: 6; padding: 12px 14px; }
@media (max-width: 860px) { .composer { bottom: 72px; } }
.composer .answer { margin: 0 0 6px; }
.tools-toggle { display: none; }
@media (max-width: 860px) {
  .tools-toggle { display: inline-flex; }
  .composer-tools { display: none; max-height: 40vh; overflow-y: auto; }
  .composer.tools-open .composer-tools { display: block; }
  .composer .aao .key { width: 30px; height: 30px; }
}
.help-bar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.repair { align-items: center; }
.repair-chip, .sugg { font-weight: 500; }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0 10px; }
.help-out:not(:empty) { margin-bottom: 10px; }
.help-card { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: 10px 14px; }
.english-help { border-left-color: var(--primary); }
.convo-summary .summary-list { list-style: none; padding: 0; }
.convo-summary .missed-item { text-align: left; }
.talk-page .page-head h1 { font-size: 1.4rem; }

/* ---------- vocabulary, forms ---------- */
.boxes { display: flex; gap: 10px; align-items: flex-end; min-height: 140px; }
.box-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.box-bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--primary), #4a8ae6); border-radius: 8px 8px 2px 2px; }
.box-col small { font-size: .7rem; color: var(--muted); }
.filters input { flex: 2; min-width: 180px; }
.filters select { flex: 1; min-width: 120px; width: auto; }
.vocab-list { margin-top: 12px; }
.vocab-item { border-bottom: 1px solid var(--line); }
.vocab-item summary { display: grid; grid-template-columns: minmax(120px, 1fr) 1.4fr auto; gap: 10px; padding: 10px 4px; cursor: pointer; align-items: center; }
.vocab-detail { padding: 0 8px 12px; }
.flash { text-align: center; cursor: pointer; min-height: 260px; display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.flash .runner-head { text-align: left; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field-label { font-weight: 650; font-size: .9rem; }
.radio-list { display: grid; gap: 8px; margin: 8px 0 14px; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.radio span { display: flex; flex-direction: column; }
.radio input { margin-top: 4px; accent-color: var(--primary); }
.toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; margin: 10px 0; }
.switch { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--primary); }
.assisted { padding: 6px 0; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.prose p { margin-bottom: .9em; }
.rec-list li { margin: 6px 0; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
