:root {
  --inset-top: env(safe-area-inset-top);
  --inset-bottom: env(safe-area-inset-bottom);
  color-scheme: light;
  --bg: #f6f5f2;
  --surface: #ffffff;
  --soft: #efede7;
  --text: #1d1c1a;
  --muted: #57544d;
  --line: #dcd9d1;
  --accent: #1f5f4a;
  --accent-text: #ffffff;
  --danger: #a1261b;
  --good-bg: #e2f1e7; --good-fg: #1a5a37;
  --ok-bg: #fbf0d3; --ok-fg: #6f4b00;
  --bad-bg: #fbe2de; --bad-fg: #99201a;
  --radius: 14px;
  --radius-sm: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-phrase: "Iowan Old Style", "Palatino Linotype", Charter, Georgia, serif;
  --nav-h: 64px;
}

.tg {
  --inset-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --inset-bottom: var(--tg-safe-area-inset-bottom, env(safe-area-inset-bottom));
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #161615;
    --surface: #1f1f1d;
    --soft: #2a2a27;
    --text: #efede8;
    --muted: #b3afa6;
    --line: #3a3935;
    --accent: #86cfae;
    --accent-text: #10241b;
    --danger: #ff9d90;
    --good-bg: #1b3526; --good-fg: #a4e0bb;
    --ok-bg: #3a2f12; --ok-fg: #f2d07e;
    --bad-bg: #3f1d1a; --bad-fg: #ffb2a6;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overscroll-behavior: none; scroll-padding-top: calc(var(--shell-h, 0px) + 8px); }
body { overscroll-behavior: none; margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); }
h1 { font-size: 24px; line-height: 1.25; margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h2 { font-size: 17px; line-height: 1.3; margin: 0; font-weight: 600; }
p { margin: 0; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.view {
  max-width: 560px; margin: 0 auto;
  padding: 16px 16px calc(var(--nav-h) + 28px + var(--inset-bottom));
  display: grid; gap: 16px;
}
.view-head { display: grid; gap: 2px; margin-bottom: 4px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.label { font-size: 14px; color: var(--muted); }

.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: grid; gap: 12px;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.phrase-text {
  font-family: var(--font-phrase); font-size: 28px; line-height: 1.25; font-weight: 500;
  overflow-wrap: anywhere;
}
.translation { color: var(--muted); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  font: 600 16px/1.2 var(--font); min-height: 48px; padding: 12px 18px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--soft); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.recording { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn.plain { background: transparent; border-color: transparent; color: var(--accent); padding-inline: 4px; }
.btn.wide { width: 100%; }
.btn.small { font-size: 14px; min-height: 40px; padding: 8px 10px; }
.actions.quiet { margin-top: -4px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn svg { width: 20px; height: 20px; flex: none; }

.status { color: var(--muted); }
.status:empty { display: none; }
.status.error { color: var(--danger); font-weight: 600; }

.result { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 12px; }
.result-body { display: grid; gap: 12px; }
.score { display: flex; align-items: baseline; gap: 8px; }
.score-num { font-size: 34px; font-weight: 700; line-height: 1; }
.score-of { color: var(--muted); }
.score-label { font-weight: 600; }
.words { display: flex; flex-wrap: wrap; gap: 6px; }
.word { padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.word.good { background: var(--good-bg); color: var(--good-fg); }
.word.ok { background: var(--ok-bg); color: var(--ok-fg); }
.word.bad { background: var(--bad-bg); color: var(--bad-fg); text-decoration: underline wavy; text-underline-offset: 3px; }
.word.paused::before {
  content: ""; display: inline-block; width: 7px; height: .8em; margin-right: 6px; vertical-align: -1px;
  border-inline: 2px solid currentColor; opacity: .7;
}
.hints { margin: 0; padding-left: 20px; }
.hints li { margin: 2px 0; }
.meta { color: var(--muted); margin: 0; }

.options { display: grid; gap: 12px; }
.option {
  font: 500 17px/1.35 var(--font); text-align: left; min-height: 52px; padding: 12px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--text);
  cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.option:disabled { cursor: default; }
.option.correct { background: var(--good-bg); color: var(--good-fg); border-color: transparent; font-weight: 600; }
.option.wrong { background: var(--bad-bg); color: var(--bad-fg); border-color: transparent; }
.option { position: relative; }
.option .mark {
  position: absolute; top: -9px; right: 12px; padding: 0 8px; border-radius: 999px; font-size: 12px; line-height: 18px;
  font-weight: 650; white-space: nowrap; background: var(--good-fg); color: var(--surface);
}
.option.wrong .mark { background: var(--bad-fg); }
.reveal { font-size: 20px; font-weight: 600; }

.rows { margin: 0; display: grid; }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; padding-top: 0; }
.row dt { color: var(--muted); }
.row dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 4px 10px; border-radius: 999px; background: var(--soft); font-size: 15px; }
.chip b { font-weight: 600; color: var(--muted); margin-left: 4px; }
.filters { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; }
.filter {
  font: 500 15px/1 var(--font); min-height: 40px; padding: 8px 14px; border-radius: 999px; flex: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
}
.filter b { font-weight: 600; color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }
.filter[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.filter[aria-pressed="true"] b { color: inherit; opacity: .8; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--radius-sm); background: var(--soft); }
.seg-btn {
  font: 600 15px/1.2 var(--font); min-height: 44px; padding: 8px 10px; border-radius: 8px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer;
}
.seg-btn b { font-weight: 600; margin-left: 6px; opacity: .7; font-variant-numeric: tabular-nums; }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.card.lex-list { gap: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.lex-item { display: grid; gap: 6px; padding: 14px 0; border-top: 1px solid var(--line); }
.lex-item:first-child { border-top: 0; }
.lex-list .lex-item:first-child { border-top: 1px solid var(--line); }
.lex-term { font-family: var(--font-phrase); font-size: 21px; line-height: 1.3; font-weight: 500; overflow-wrap: anywhere; }
.lex-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.badge { font-size: 13px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.badge.learning { background: var(--good-bg); color: var(--good-fg); }
.badge.deferred { background: var(--ok-bg); color: var(--ok-fg); }
.badge.new { background: var(--soft); color: var(--text); }
.lex-item .actions { gap: 6px; }
.lex-list .lex-item { gap: 8px; padding: 10px 0; }
.lex-row { display: flex; align-items: center; gap: 10px; }
.lex-open { display: grid; flex: 1; min-width: 0; color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.lex-pct { flex: none; font: 600 14px/1 var(--font); font-variant-numeric: tabular-nums; }
.lex-pct.zero { color: var(--muted); font-weight: 500; }
.deck-title { font-weight: 600; }
.deck-beta { margin-left: 8px; vertical-align: middle; }
.decks { display: grid; gap: 10px; }
.decks .lex-list { margin-top: 4px; }
.decks .rfold:not([open]) { gap: 0; }
.lex-row .speak { width: 40px; height: 40px; margin: 0; }
.lex-list .lex-term { font-size: 19px; }
.lex-list .translation { font-size: 15px; line-height: 1.4; }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; padding-top: 0; }
.list .word { flex: none; align-self: start; font-variant-numeric: tabular-nums; }

.passed { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--good-bg); color: var(--good-fg); font-weight: 600; overflow-wrap: anywhere; }
.feed { display: grid; gap: 12px; }
.turn.hl { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); scroll-margin: 96px; }
.origin { justify-self: start; }
.scope { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; padding: 12px 14px;
  border-radius: var(--radius-sm); background: var(--soft); }
.turn { display: grid; gap: 8px; padding: 14px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.turn.them { margin-right: 20px; }
.turn.me { margin-left: 20px; background: var(--soft); border-color: var(--soft); }
.turn-who { font-size: 13px; font-weight: 600; color: var(--muted); }
.turn-text { font-size: 18px; line-height: 1.55; overflow-wrap: anywhere; }
.turn .actions.quiet { margin-top: -4px; }
.turn .btn.plain { margin-left: -4px; }
.gap {
  display: inline-flex; align-items: center; gap: 3px; padding: 0 5px; border-radius: 999px; white-space: nowrap;
  background: var(--ok-bg); color: var(--ok-fg); font: 600 11px/1.5 var(--font); font-variant-numeric: tabular-nums;
  vertical-align: 2px;
}
.gap::before { content: ""; width: 3px; height: .75em; border-inline: 1.5px solid currentColor; }
.turn-wrap { display: grid; gap: 8px; }
.review { padding-inline: 4px; }
.review-body { display: grid; gap: 6px; padding-top: 2px; }
.fix { display: grid; gap: 1px; }
.fix > .chunk { min-height: 0; }
.fix s { color: var(--muted); }
.fix b { font-weight: 600; }
.fix-why, .said-was { font-size: 13px; line-height: 1.4; color: var(--muted); }
.said-was { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.more > summary, .rfold > summary, .review > summary {
  display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.more > summary::-webkit-details-marker, .rfold > summary::-webkit-details-marker, .review > summary::-webkit-details-marker { display: none; }
.more > summary { min-height: 36px; font-size: 14px; font-weight: 600; color: var(--accent); }
.review > summary { width: fit-content; min-height: 32px; font-size: 13px; font-weight: 600; color: var(--muted); }
.more > summary::after, .rfold > summary::after, .review > summary::after {
  content: ""; flex: none; width: 7px; height: 7px; margin-bottom: 3px; border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor; transform: rotate(45deg);
}
.more[open] > summary::after, .rfold[open] > summary::after, .review[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
.more-body { display: grid; gap: 8px; }
.upgrade { display: grid; gap: 2px; }
.upgrade-text { font-family: var(--font-phrase); font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.upgrade .actions { margin-top: -2px; }
.chunks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 15px; }
.chunk { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; }
.chunk > :first-child { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.chunk .badge { margin-left: 6px; }
.saver { display: inline-flex; align-items: center; gap: 2px; flex: none; }
.actions .saver { flex: 0 1 auto; min-width: 0; }
.actions .saver .btn { white-space: normal; text-align: left; line-height: 1.25; }
.dict { flex: none; display: inline-grid; place-items: center; width: 34px; min-width: 34px; height: 34px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: var(--muted); }
.dict svg { width: 21px; height: 21px; }
.dict.on { color: var(--good-fg); background: var(--good-bg); }
.dict:disabled { opacity: 1; cursor: default; }
.dict { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.review .chip { font-size: 13px; padding: 2px 8px; }
.chip.used { background: var(--good-bg); color: var(--good-fg); font-weight: 600; }
.turn-note { display: grid; gap: 8px; padding: 12px 16px; border-radius: var(--radius); margin-left: 20px; }
.turn-note.unheard { background: var(--ok-bg); color: var(--ok-fg); }
.turn-note.failed { background: var(--bad-bg); color: var(--bad-fg); }
.turn-note p:first-child { font-weight: 600; }
.thinking { justify-self: start; padding: 16px 20px; }
.dots { display: inline-flex; gap: 6px; }
.dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); animation: breathe 1.4s ease-in-out infinite; }
.dots span:nth-child(2) { animation-delay: .2s; }
.dots span:nth-child(3) { animation-delay: .4s; }
@keyframes breathe { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dots span, .talk-live.on::before { animation: none; } }
.talk-bar, .qdock {
  position: sticky; bottom: calc(var(--nav-h) + var(--inset-bottom) + 12px); z-index: 5;
  display: grid; gap: 6px; padding: 12px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 28px rgb(0 0 0 / .10);
}
.talk-live { display: flex; align-items: center; gap: 8px; min-height: 22px; font-weight: 600; font-variant-numeric: tabular-nums; }
.talk-live::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.talk-live.on::before { background: var(--danger); animation: breathe 1.4s ease-in-out infinite; }
.talk-live.paused::before { background: var(--muted); }
.talk-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.talk-mic, .talk-send { min-height: 56px; font-size: 17px; white-space: nowrap; padding-inline: 12px; }
.talk-mic svg { width: 22px; height: 22px; }
.talk-mic[aria-pressed="true"] { background: var(--good-bg); border-color: var(--good-fg); color: var(--good-fg); }
.turn-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; }
.result { display: grid; gap: 16px; }
.rsec { gap: 10px; }
.rgroup { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.rsec .card-head + .rgroup { padding-top: 0; border-top: 0; }
.rfold > summary { justify-content: space-between; }
.rfold > summary h2 { flex: 1; }
.rfold[open] > summary { margin-bottom: 4px; }
.rfold .turn.them { background: var(--bg); }
.result-go .btn { flex: 1; }
.talk-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.talk-foot .status { font-size: 14px; }
.talk-foot .btn { margin-left: auto; min-height: 40px; }

.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 15px; overflow-wrap: anywhere; }
.address { background: var(--soft); border-radius: var(--radius-sm); padding: 10px 12px; }
.code-big { font: 600 34px/1.1 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .18em; }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 4px; }

.shell-top {
  position: sticky; top: 0; z-index: 12; padding-top: var(--inset-top);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.notices { max-width: 560px; margin: 0 auto; padding: 8px 12px 0; display: grid; gap: 8px; }
.notices:empty { display: none; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: var(--inset-bottom);
}
.tabs-inner { max-width: 560px; margin: 0 auto; display: flex; }
.tab {
  flex: 1 1 0; min-width: 0; height: var(--nav-h); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 500;
  -webkit-tap-highlight-color: transparent;
}
.tab svg { width: 24px; height: 24px; }
.tab[aria-current="page"] { color: var(--accent); font-weight: 650; }

.form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; }
.field span { font-size: 14px; color: var(--muted); }
input[type=text], input[type=number], input[type=date], select, textarea {
  font: 16px/1.3 var(--font); padding: 11px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); width: 100%;
}
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; border: 0; margin: 0; padding: 0; }
.checks legend { font-size: 14px; color: var(--muted); padding: 0; margin-bottom: 4px; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
.qr { background: #ffffff; padding: 12px; border-radius: var(--radius-sm); justify-self: start; line-height: 0; }
.qr img, .qr canvas { display: block; }

.notice { min-height: 100dvh; display: grid; place-items: center; padding: 16px; }
.notice-box {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: grid; gap: 12px;
}
.notice-box p { color: var(--muted); }

a.lex-term { justify-self: start; color: var(--text); text-decoration: underline; text-decoration-color: var(--line);
  text-decoration-thickness: 1px; text-underline-offset: 5px; }
.skill-mark {
  display: grid; justify-items: center; align-content: center; gap: 5px; min-height: 48px; padding: 6px 0;
  border-radius: var(--radius-sm); border: 1.5px dashed var(--muted); background: transparent; color: var(--muted);
  font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.skill-mark[data-tier="1"] { border-style: solid; color: var(--text); }
.skill-mark[data-tier="2"] { border-style: solid; border-color: var(--good-fg); background: var(--good-bg); color: var(--good-fg); }
.skill-icon { line-height: 0; }
.skill-icon svg { width: 20px; height: 20px; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 10px; height: 5px; border-radius: 2px; border: 1.5px solid currentColor; }
.pips i.on { background: currentColor; }
.skill-list .skill-row { justify-content: flex-start; align-items: center; }
.skill-row .skill-mark { width: 52px; flex: none; cursor: default; }
.skill-name { display: grid; flex: 1; min-width: 0; }
.skill-tier { flex: none; font-size: 14px; font-weight: 600; }
.skill-row[data-tier="2"] .skill-tier { color: var(--good-fg); }
.skill-row[data-tier="0"] .skill-tier { color: var(--muted); font-weight: 500; }
.history-what { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.hit { color: var(--good-fg); font-weight: 600; }
.miss { color: var(--bad-fg); font-weight: 600; }
.nowrap { white-space: nowrap; }
.word-title { font-family: var(--font-phrase); font-size: 30px; font-weight: 500; overflow-wrap: anywhere; }
.examples li { align-items: center; }
.example-body { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.example-text { font-family: var(--font-phrase); font-size: 18px; line-height: 1.35; }
.examples .speak { flex: none; margin: 0; }
.table-wrap { overflow-x: auto; margin-inline: -4px; }
.skill-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.skill-table th, .skill-table td { padding: 9px 4px; border-top: 1px solid var(--line); text-align: right; }
.skill-table thead th { border-top: 0; padding-top: 0; font-size: 13px; line-height: 1.25; font-weight: 600; color: var(--muted); vertical-align: top; }
.skill-table thead th .pips { display: flex; justify-content: flex-end; margin-bottom: 5px; }
.skill-table thead th:first-child { text-align: left; }
.skill-table tbody th { text-align: left; font-weight: 600; }
.skill-th { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.skill-th .skill-icon { color: var(--muted); }
.skill-table td { font-weight: 600; width: 18%; }

textarea { resize: vertical; min-height: 96px; }

.topbar {
  max-width: 560px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.top-lang {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none;
  font-weight: 600; font-size: 15px; min-width: 0; white-space: nowrap;
}
.top-lang b { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.seg { display: inline-flex; flex: none; padding: 3px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.seg button {
  font: 600 14px/1 var(--font); min-height: 36px; padding: 0 11px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.seg button[aria-checked="true"] { background: var(--accent); color: var(--accent-text); }

.choices { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.choice {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.card .choice { background: var(--bg); }
.choice input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.choice-body { display: grid; gap: 2px; }
.choice-body b { font-weight: 650; }
.choice-body span { color: var(--muted); font-size: 15px; line-height: 1.4; }
.picks { gap: 8px; }
.pick {
  position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 500;
}
.card .pick { background: var(--bg); }
.pick input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.pick:has(input:checked) { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.pick:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.goals { display: grid; }
.goal { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.goal:first-child { border-top: 0; padding-top: 0; }
.stepper { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.stepper button {
  width: 44px; height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--soft);
  color: var(--text); font: 600 20px/1 var(--font); cursor: pointer;
}
.stepper output { min-width: 44px; text-align: center; font-weight: 650; font-size: 18px; font-variant-numeric: tabular-nums; }
.steps-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; }
.steps-bar i { height: 4px; border-radius: 2px; background: var(--line); }
.steps-bar i.on { background: var(--accent); }
.onboard-actions { justify-content: space-between; }
.onboard-actions .btn.primary { flex: 1; }
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }

.qfeed { display: grid; gap: 10px; }
.qday { font-size: 14px; font-weight: 600; color: var(--muted); text-align: center; margin-top: 6px; }
.qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.qlist > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.qrow {
  width: 100%; min-height: 60px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 0;
  border-radius: var(--radius); background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.qrow::after {
  content: ""; flex: none; width: 8px; height: 8px; margin: 0 2px 4px; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(45deg);
}
.qrow[aria-expanded="true"]::after { transform: rotate(-135deg); margin-bottom: -4px; }
.qrow-main { display: grid; flex: 1; min-width: 0; }
.qrow-type { font-weight: 600; }
.qrow-score { flex: none; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.qd-list { list-style: none; margin: 0; padding: 0 14px 6px; display: grid; }
.qd { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--line); }
.qd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.qd-q { font-family: var(--font-phrase); font-size: 19px; line-height: 1.35; overflow-wrap: anywhere; }
.qd-verdict { flex: none; font-size: 14px; }
.qd .result-body { gap: 8px; margin-top: 4px; }
.qd .score-num { font-size: 24px; }
.qstart { margin-top: 6px; }
.today-time { display: grid; gap: 2px; }
.today-min { font-size: 34px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; }
.goals-list { display: grid; gap: 12px; }
.dgoal { display: grid; gap: 6px; }
.dgoal-head { display: flex; justify-content: space-between; gap: 12px; }
.dgoal-count { font-variant-numeric: tabular-nums; color: var(--muted); }
.dgoal-count.done { color: var(--accent); font-weight: 600; }
.dgoal progress { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--soft); overflow: hidden; }
.dgoal progress::-webkit-progress-bar { background: var(--soft); border-radius: 999px; }
.dgoal progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.dgoal progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }
.today-go { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.btn.big { min-height: 64px; font-size: 18px; }
.qrow-main .badge { justify-self: start; margin-top: 4px; }
.tbody { display: grid; gap: 12px; padding: 2px 14px 14px; }
.tbody .card, .tbody .turn.them { background: var(--bg); }
.qactive-wrap { display: grid; gap: 4px; margin-top: 6px; scroll-margin-top: 16px; }
.qactive { border-color: var(--accent); }
.qcard { display: grid; gap: 12px; }
.qactive .qcard.spoken { display: flex; flex-direction: column; min-height: calc(100dvh - var(--shell-h, 0px) - var(--nav-h) - var(--inset-bottom) - 72px); }
.qdock { display: flex; flex-wrap: nowrap; gap: 8px; padding: 10px; margin-top: auto; }
.qdock:empty { display: none; }
.qdock .btn { min-height: 56px; font-size: 17px; }
.qdock .btn.primary, .qdock .btn.recording { flex: 1; min-width: 0; }
.btn.counting { position: relative; isolation: isolate; overflow: hidden; font-variant-numeric: tabular-nums; }
.btn.counting::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: currentColor; opacity: .22;
  transform-origin: left; transform: scaleX(0); animation: advance-fill var(--advance, 3s) linear forwards;
}
@keyframes advance-fill { to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .btn.counting::before { animation: none; } }
.btn.advance-pause { flex: none; width: 48px; padding: 0; color: var(--muted); }
.qdock .btn.advance-pause { width: 56px; }
.btn.advance-pause svg { width: 20px; height: 20px; }
.qreview .qd-list { margin: 0; padding: 0; list-style: none; }
.start-row { display: flex; gap: 8px; }
.start-go { flex: 1; min-width: 0; min-height: 64px; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; }
.start-sub { font-size: 14px; font-weight: 500; opacity: .88; overflow-wrap: anywhere; }
.icon-btn { flex: none; width: 64px; padding: 0; }
.btn.icon-btn svg { width: 24px; height: 24px; }
.icon-btn[aria-expanded="true"] { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.start-settings { display: grid; gap: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.summary-main { font-size: 20px; font-weight: 650; }
.qlist .choice, .qlist .pick { background: var(--bg); }
.speak {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; margin-inline-start: .3em;
  vertical-align: middle; border: 1px solid var(--line); border-radius: 50%; background: var(--surface);
  color: var(--accent); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.speak svg { width: 14px; height: 14px; }
.speak[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.speak.autoplay svg { width: 18px; height: 18px; }
.actions .speak.autoplay { align-self: center; }
.speak.autoplay[aria-pressed="false"] { color: var(--muted); }
.say-line { display: flex; align-items: center; gap: 4px; }
.option-wrap { position: relative; display: grid; }
.option-wrap.spoken .option { padding-right: 56px; }
.option-wrap .speak { position: absolute; right: 12px; top: 50%; margin: -16px 0 0; }
.qcard { position: relative; }
.btn.tip-btn { min-width: 52px; padding-inline: 12px; font: 600 19px/1 var(--font-phrase); }
.tip-btn[aria-expanded="true"] { background: var(--surface); border-color: var(--accent); color: var(--accent); }
.tip {
  position: absolute; inset-inline: 12px; z-index: 5; display: grid; gap: 12px; padding: 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: 0 10px 28px rgb(0 0 0 / .2);
}
.tip-text { font-family: var(--font-phrase); font-size: 24px; line-height: 1.3; overflow-wrap: anywhere; }
.tip .btn { justify-self: end; }
.know-pop { gap: 8px; z-index: 6; }
.know-list { display: grid; }
.know-row { display: flex; align-items: flex-start; gap: 12px; padding: 7px 2px; cursor: pointer; }
.know-row input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.know-row > span { display: flex; flex-wrap: wrap; column-gap: 8px; align-items: baseline; min-width: 0; }
.know-row:has(input:disabled) { cursor: default; opacity: .7; }
.tip .know-actions { justify-content: flex-end; }
.lex-item, .know-host { position: relative; }

.links-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.install { display: contents; }
.install-hint { flex-basis: 100%; }
.install-head { display: flex; align-items: center; gap: 12px; }
.install-head img { border-radius: 11px; flex: none; }
.share-icon { width: 18px; height: 18px; vertical-align: -3px; color: var(--accent); }

.hold { visibility: hidden; }
.qcard .status { min-height: 1.5em; }
.qcard.spoken .status { min-height: 3em; }
.qcard .status:empty { display: block; }
.busy { color: transparent !important; }
.busy::after {
  content: ""; width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%;
  border: 2px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite;
}
.btn.busy { position: relative; }
.btn.busy::after { position: absolute; inset: 0; margin: auto; }
.speak > svg, .speak::after { grid-area: 1 / 1; }
.btn.primary.busy::after, .speak[aria-pressed="true"].busy::after { border-color: var(--accent-text); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy::after { animation: none; border-right-color: currentColor; opacity: .6; } }

.lesson-host { --lp-stage-h: clamp(200px, calc(100dvh - 530px), 440px); }
.lesson-body { display: grid; gap: 10px; padding: 0 14px 12px; }
.lesson-go .btn { flex: 1; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: var(--surface); }
.btn.danger-text { color: var(--danger); justify-self: start; }
.lesson-del .actions { align-items: center; }
.confirm-q { flex-basis: 100%; }
.update-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; border: 1px solid var(--line);
  border-radius: 14px; background: var(--surface); box-shadow: 0 4px 16px rgb(0 0 0 / .12); font-size: 14px;
}
.update-bar span { flex: 1; min-width: 0; }
.lex-bar { display: flex; align-items: center; gap: 8px; }
.lex-bar .seg { flex: 1; min-width: 0; }
.sort {
  position: relative; flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 999px;
  background: var(--soft); border: 1px solid var(--line); color: var(--muted); cursor: pointer;
}
.sort.on { color: var(--accent); border-color: var(--accent); }
.sort svg { width: 22px; height: 22px; }
.sort:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.sort-select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; font-size: 16px; cursor: pointer; }
.wod { display: grid; gap: 8px; }
.to-latest {
  position: absolute; right: 8px; top: -58px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent);
  box-shadow: 0 4px 16px rgb(0 0 0 / .16); cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.to-latest svg { width: 22px; height: 22px; }
.badge.bad { background: var(--bad-bg); color: var(--bad-fg); }
.exam-kinds { display: grid; gap: 8px; }
.exam-kinds .start-go { width: 100%; }
.exam-hist .qrow::after { transform: rotate(-45deg); margin-bottom: 0; }
.exam-hist .qrow { text-decoration: none; }
.exam-prompt { display: grid; gap: 4px; }
.exam-lt { font-family: var(--font-phrase); font-size: 22px; line-height: 1.35; overflow-wrap: anywhere; }
.exam-q { font-family: var(--font-phrase); font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.exam-panel { justify-items: stretch; text-align: center; }
.exam-clock { font-size: 56px; line-height: 1.05; font-weight: 700; font-variant-numeric: tabular-nums; }
.exam-clock.on { color: var(--danger); }
.exam-go .btn { flex: 1; min-height: 56px; font-size: 17px; }
.exam-heard { display: grid; gap: 4px; text-align: left; }
.exam-said { font-size: 18px; line-height: 1.5; overflow-wrap: anywhere; }
.exam-unheard { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--ok-bg); color: var(--ok-fg); font-weight: 600; }
.exam-problem { display: grid; gap: 6px; }
.exam-problem:empty { display: none; }
.exam-wait { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.exam-task .speak:disabled { opacity: .4; cursor: default; }
