:root {
  --bg: #faf7f2; --card: #fff; --ink: #1f1b16; --muted: #7a7166; --line: #e7e0d6;
  --accent: #0072ce; --ok: #2e7d32; --ok-bg: #e8f5e9; --bad: #c62828; --bad-bg: #fdecea; --warn-bg: #fff4e0;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
[hidden] { display: none !important; }

.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  padding-top: max(8px, env(safe-area-inset-top)); background: var(--bg); border-bottom: 1px solid var(--line); }
.icon { border: 0; background: none; font-size: 22px; min-width: 44px; min-height: 44px; }
.progress { flex: 1; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
#progFill { height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.aids { display: flex; align-items: center; gap: 6px; }
.pill { min-width: 40px; min-height: 36px; padding: 0 10px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--card);
  font-weight: 600; font-size: 14px; color: var(--muted); }
.pill[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: #e8f2fc; }
.listen-toggle { font-size: 15px; }
.listen-toggle.speaking { border-color: var(--ok); color: var(--ok); background: var(--ok-bg); }
.menu { position: absolute; z-index: 6; top: 60px; left: 8px; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12); display: flex; flex-direction: column; min-width: 220px; }
.menu a, .menu button { display: block; padding: 14px 16px; text-decoration: none; color: var(--ink); border: 0;
  background: none; text-align: left; width: 100%; border-bottom: 1px solid var(--line); }
.menu form { margin: 0; }

main { max-width: 560px; margin: 0 auto; padding: 14px 14px 120px; }
.loading, .empty { text-align: center; color: var(--muted); padding: 60px 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px; }
.meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 10px; flex-wrap: wrap; }
.chip { display: inline-block; padding: 2px 9px; border-radius: 10px; background: #f3eee6; font-size: 12px; color: var(--muted); }
.chip.hint { background: var(--warn-bg); color: #9a5b00; }
.chip.ok { background: var(--ok-bg); color: var(--ok); }
.ask { color: var(--muted); margin: 0 0 10px; }
.ru-prompt { font-size: 20px; font-weight: 600; margin: 6px 0 14px; }

.big { font-size: 38px; text-align: center; margin: 16px 0 18px; line-height: 1.3; overflow-wrap: anywhere; }
.sent { font-size: 22px; line-height: 1.6; margin: 8px 0 14px; overflow-wrap: break-word; }
.w { border-radius: 6px; }
.w.tap { cursor: pointer; border-bottom: 1px dotted var(--muted); }
.w.hl { background: #fff1c2; box-shadow: 0 0 0 2px #fff1c2; }
.blank { color: var(--accent); letter-spacing: 2px; }
.et { font-weight: 600; }
.forms { font-size: 14px; margin: 4px 0; }

.opts { display: grid; gap: 10px; margin-top: 8px; }
.opt { min-height: 54px; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  text-align: left; font-size: 17px; }
.opt.et-opt { text-align: center; font-size: 24px; padding: 8px 10px; }
.opt:active { transform: scale(.99); }
.opt.right { border-color: var(--ok); background: var(--ok-bg); }
.opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.opt:disabled { cursor: default; color: var(--ink); }
.unknown { margin-top: 4px; border: 0; background: none; color: var(--muted); padding: 12px; min-height: 44px; text-decoration: underline; }

.listen-row { display: flex; gap: 10px; justify-content: center; margin: 12px 0 16px; flex-wrap: wrap; }
.play { min-height: 56px; padding: 0 22px; border-radius: 28px; border: 0; background: var(--accent); color: #fff; font-size: 18px; font-weight: 600; white-space: nowrap; }
.play.secondary { background: #f3eee6; color: var(--ink); font-weight: 500; }

input.et-in, textarea.et-in, textarea.ru-in { width: 100%; font-size: 22px; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff; font-family: inherit; }
textarea.ru-in { font-size: 18px; }
textarea { resize: vertical; min-height: 84px; }
input.et-in:focus, textarea:focus { outline: none; border-color: var(--accent); }
.et-keys { display: flex; gap: 6px; margin-top: 8px; }
.et-keys button { flex: 1; min-height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); font-size: 20px; }
.et-keys button:active { background: #e8f2fc; }
.et-keys button:disabled { opacity: .4; }
.primary { display: block; width: 100%; min-height: 54px; margin-top: 12px; border: 0; border-radius: 14px;
  background: var(--accent); color: #fff; font-size: 18px; font-weight: 600; }
.primary:disabled { opacity: .5; }
.ghost { display: block; width: 100%; min-height: 48px; margin-top: 10px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); }
.link-btn { text-align: center; line-height: 44px; text-decoration: none; color: inherit; }

.feedback { margin-top: 14px; border-radius: 14px; padding: 14px; border: 1.5px solid var(--line); background: var(--card); }
.feedback.ok { border-color: var(--ok); background: var(--ok-bg); }
.feedback.bad { border-color: var(--bad); background: var(--bad-bg); }
.feedback.mid { border-color: #e0a800; background: var(--warn-bg); }
.feedback h3 { margin: 0 0 6px; font-size: 18px; }
.wcard { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0; }
.wcard .et { font-size: 26px; }
.wcard .forms { flex-basis: 100%; margin: 0; }
.feedback .line { margin: 4px 0; }
.feedback .ex { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(0,0,0,.15); }
.feedback .ex .sent { font-size: 19px; margin: 0; }
.feedback .next { font-size: 13px; color: var(--muted); margin-top: 6px; }
.diff .del { background: #f8c9c4; text-decoration: line-through; }
.diff .ins { background: #c8e6c9; }
.selfgrade { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.selfgrade button { min-height: 50px; padding: 0 4px; font-size: 16px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); }
.next-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 14px max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(250,247,242,0)); }
.next-bar .primary { max-width: 532px; margin: 0 auto; }

.stage-card { text-align: center; padding: 40px 16px; }
.stage-card h2 { margin: 6px 0 8px; }
.results h2 { margin-top: 0; }
.score { font-size: 48px; font-weight: 700; text-align: center; color: var(--accent); }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bar-mini { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.bar-mini div { height: 100%; background: var(--ok); }
.row > .muted:last-child { min-width: 72px; text-align: right; white-space: nowrap; }
.section { margin-top: 18px; }
.section h3 { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 6px; }
.mist { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mist-word { font-size: 20px; font-weight: 600; }
.mist .muted { color: var(--muted); font-size: 13px; }
.muted { color: var(--muted); }

.login-body { display: flex; align-items: center; justify-content: center; padding: 20px; }
.login { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.login h1 { margin: 0 0 14px; text-align: center; color: var(--accent); }
.login label { display: block; margin: 10px 0; color: var(--muted); font-size: 14px; }
.login input { display: block; width: 100%; margin-top: 4px; font-size: 18px; padding: 12px; border-radius: 10px; border: 1.5px solid var(--line); }
.err { color: var(--bad); text-align: center; }
.voice-warn { font-size: 13px; color: #9a5b00; background: var(--warn-bg); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; }

.recorder { margin-top: 14px; text-align: center; }
.rec-row { display: flex; align-items: center; justify-content: center; gap: 18px; }
.rec { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; font-size: 34px; line-height: 1;
  box-shadow: 0 4px 14px rgba(0,114,206,.35); }
.rec.on { background: var(--ink); animation: pulse 1.2s infinite; }
.rec:disabled { opacity: .5; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(0,114,206,.15); } }
.level { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 14px auto 6px; max-width: 240px; }
.level span { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; }
.rec-status { min-height: 22px; font-size: 14px; }
.recorder .unknown { display: block; margin: 4px auto 0; }

.gloss { position: fixed; left: 8px; right: 8px; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 7; max-width: 544px; margin: 0 auto;
  background: var(--card); border: 1.5px solid var(--accent); border-radius: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18);
  padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; }
.gl-main { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gl-word { font-size: 24px; font-weight: 600; }
.gl-ru { grid-column: 1; font-size: 16px; }
.gl-btns { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; }
.gl-btns .play { min-height: 44px; min-width: 44px; padding: 0 12px; font-size: 16px; }

.units { display: grid; gap: 10px; margin-top: 10px; }
.unit { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1.5px solid var(--line); border-radius: 14px; text-decoration: none; color: inherit; background: var(--card); }
.u-body { flex: 1; min-width: 0; }
.u-title { font-weight: 600; font-size: 17px; }
.u-sub { font-size: 13px; margin-top: 2px; }
button.unit.pk { width: 100%; text-align: left; min-height: 64px; }
button.unit.pk:disabled { opacity: .5; cursor: default; }

.mk { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.mk.fixed { opacity: .65; }
.mk-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.mk-q { font-size: 20px; overflow-wrap: anywhere; }
.mk-ans { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 4px 8px; border-radius: 8px; }
.mk-ans.ok { background: var(--ok-bg); }
.mk-ans.bad { background: var(--bad-bg); }
.mk-lbl { font-size: 13px; color: var(--muted); min-width: 86px; }
.mk-ans .wcard .et { font-size: 20px; }
.mix-text { overflow-wrap: anywhere; }
.mk .line { font-size: 14px; }
a.lrow { color: inherit; text-decoration: none; }
a.lrow.open .muted:last-child { color: var(--accent); font-weight: 600; }
a.lrow > .muted:last-child { white-space: normal; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.mcol { display: grid; gap: 8px; align-content: start; }
.mcell { min-height: 56px; padding: 6px 8px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; transition: background .15s, border-color .15s; }
.mcell.et-cell { font-size: 20px; }
.mcell .msay { font-weight: 600; color: var(--accent); }
.mcell.sel { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; }
.mcell.done { border-color: var(--ok); background: var(--ok-bg); opacity: .6; cursor: default; }
.mcell.miss { border-color: var(--bad); background: var(--bad-bg); }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; min-height: 60px; padding: 8px; border-radius: 12px; margin: 8px 0; }
.tiles.ans { border: 1.5px dashed var(--line); background: #fcfaf6; }
.tiles.ans.right { border-color: var(--ok); background: var(--ok-bg); }
.tiles.ans.wrong { border-color: #e0a800; background: var(--warn-bg); }
.tile { min-height: 48px; min-width: 48px; padding: 6px 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card);
  font-size: 20px; line-height: 1.4; }
.tile:disabled { cursor: default; color: var(--ink); }

.case-head { margin: 4px 0 12px; }
.case-q { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; }
.chip.case-chip { background: #e8f2fc; color: var(--accent); font-size: 14px; font-weight: 600; }
.case-lemma { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; margin-top: 10px; }
.case-lemma .et { font-size: 30px; font-weight: 600; overflow-wrap: anywhere; }
.case-title { display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 10px; margin: 10px 0 4px; }
.case-title .et { font-size: 32px; font-weight: 600; }
.case-end { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 8px; background: #e8f2fc; color: var(--accent); font-weight: 600; font-size: 15px; }
.case-title .case-end { font-size: 20px; }
.case-rule { margin: 12px 0; line-height: 1.45; }
.case-ex { display: grid; gap: 8px; margin-bottom: 16px; }
.case-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.case-pair { flex: 1; min-width: 0; font-size: 19px; overflow-wrap: anywhere; }
.case-pair .muted { font-size: 13px; }
.case-row .play { min-width: 48px; padding: 0 12px; }
.ladder { display: grid; gap: 6px; }
.rung { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.rung-main { flex: 1; min-width: 0; }
.rung-et { font-weight: 600; font-size: 17px; }
.rung-sub { font-size: 13px; overflow-wrap: anywhere; }
.rung.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.rung.locked { opacity: .55; }
.rung .bar-mini { margin-top: 6px; }

@media (max-width: 380px) {
  .play { padding: 0 16px; font-size: 17px; }
  .big { font-size: 32px; }
  .sent { font-size: 20px; }
}

/* ---------- stories ---------- */
:root {
  --st-navy: #0b2545; --st-blue: #0072ce; --st-sky: #e8f2fc; --st-gold: #e0a800;
  --st-thumb: #cdbfae;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--st-thumb); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.st-head { position: relative; overflow: hidden; border-radius: 18px; padding: 22px 18px; margin-bottom: 16px;
  color: #fff; background: linear-gradient(135deg, var(--st-navy) 0%, #123f6d 45%, var(--st-blue) 100%);
  box-shadow: 0 10px 30px rgba(11,37,69,.25); }
.st-head::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: radial-gradient(120% 80% at 85% -10%, rgba(255,255,255,.28), transparent 55%),
              repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 2px, transparent 2px 9px); }
.st-head > * { position: relative; z-index: 1; }
.st-head h1 { margin: 0; font-size: 27px; letter-spacing: -.01em; }
.st-head p { margin: 6px 0 0; font-size: 14px; color: rgba(255,255,255,.82); max-width: 40ch; }
.st-head .st-count { display: inline-block; margin-top: 12px; font-size: 12px; font-weight: 600;
  padding: 4px 11px; border-radius: 20px; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25); }

.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.st-card { position: relative; display: flex; flex-direction: column; overflow: hidden; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 2px 8px rgba(31,27,22,.06); transition: transform .18s, box-shadow .18s; }
.st-card:hover { transform: translateY(-3px); box-shadow: 0 12px 26px rgba(11,37,69,.16); }
.st-card:active { transform: translateY(-1px); }
.st-cover { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: linear-gradient(135deg, #123f6d, var(--st-blue)); }
.st-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.st-card:hover .st-cover img { transform: scale(1.05); }
.st-cover::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(11,37,69,.45), transparent 55%); }
.st-kind { position: absolute; left: 8px; top: 8px; z-index: 1; font-size: 11px; font-weight: 600; color: #fff;
  padding: 3px 9px; border-radius: 20px; background: rgba(11,37,69,.6); backdrop-filter: blur(4px); }
.st-done-badge { position: absolute; right: 8px; top: 8px; z-index: 1; display: flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: #fff; padding: 3px 8px; border-radius: 20px; background: var(--ok); }
.st-card-body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.st-card-et { font-size: 16px; font-weight: 700; line-height: 1.25; }
.st-card-ru { font-size: 13px; color: var(--muted); }
.st-card-foot { display: flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 9px; flex-wrap: wrap; }
.st-tag { font-size: 11px; color: var(--st-navy); background: var(--st-sky); padding: 2px 8px; border-radius: 8px; font-weight: 600; }
.st-lvl { display: inline-flex; gap: 3px; margin-left: auto; }
.st-lvl i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.st-lvl i.on { background: var(--st-gold); }

.st-hero { position: relative; margin: -14px -14px 0; height: 230px; overflow: hidden; background: var(--st-navy); }
.st-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.st-hero::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 2%, rgba(250,247,242,.55) 22%, rgba(11,37,69,.25) 60%, rgba(11,37,69,.55) 100%); }
.st-hero-inner { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; padding: 16px 16px 14px; max-width: 560px; margin: 0 auto; }
.st-hero-kind { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
  color: #fff; background: rgba(11,37,69,.55); padding: 3px 10px; border-radius: 20px; backdrop-filter: blur(4px); }
.st-hero h1 { margin: 8px 0 2px; font-size: 28px; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.st-hero .st-hero-ru { font-size: 15px; color: rgba(255,255,255,.9); text-shadow: 0 1px 8px rgba(0,0,0,.4); }
.st-back { position: absolute; z-index: 2; left: 12px; top: max(12px, env(safe-area-inset-top)); display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 14px; border-radius: 22px; border: 0; text-decoration: none; font-weight: 600; font-size: 14px;
  color: #fff; background: rgba(11,37,69,.5); backdrop-filter: blur(6px); }
.st-credit { font-size: 11px; color: var(--muted); padding: 8px 2px 0; }
.st-credit a { color: var(--muted); }
.st-intro { font-size: 15px; color: var(--muted); margin: 10px 0 0; }
.st-read-badge { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 13px; font-weight: 600;
  color: var(--ok); background: var(--ok-bg); padding: 5px 12px; border-radius: 20px; }

.st-controls { position: sticky; top: 61px; z-index: 4; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  margin: 14px -4px; padding: 10px 4px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line); }
.st-ctl { min-height: 42px; padding: 0 16px; border-radius: 22px; border: 1.5px solid var(--line); background: var(--card);
  font-weight: 600; font-size: 14px; color: var(--ink); display: inline-flex; align-items: center; gap: 7px; }
.st-ctl.play-all { background: var(--accent); border-color: var(--accent); color: #fff; }
.st-ctl.play-all.playing { background: var(--ink); border-color: var(--ink); }
.st-ctl[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--st-sky); }
.st-ctl .ico { font-size: 15px; }

.st-lines { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.st-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 14px;
  border-left: 3px solid transparent; transition: background .2s, border-color .2s; }
.st-line.active { background: var(--st-sky); border-left-color: var(--accent); }
.st-line-play { flex: none; width: 38px; height: 38px; margin-top: 2px; border-radius: 50%; border: 1.5px solid var(--line);
  background: var(--card); color: var(--accent); font-size: 14px; display: grid; place-items: center; }
.st-line-play:active { background: var(--st-sky); }
.st-line.active .st-line-play { border-color: var(--accent); background: var(--accent); color: #fff; }
.st-line-body { flex: 1; min-width: 0; }
.st-et { font-size: 20px; line-height: 1.6; overflow-wrap: break-word; }
.st-ru { font-size: 14px; color: var(--muted); margin-top: 3px; line-height: 1.45; }
.st-lines.hide-ru .st-ru { display: none; }

.st-line.dlg { gap: 9px; }
.st-line.dlg.right { flex-direction: row-reverse; }
.st-av { flex: none; width: 34px; height: 34px; margin-top: 2px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.st-bubble { position: relative; max-width: 84%; padding: 9px 13px; border-radius: 16px; background: var(--card);
  border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.st-line.dlg.right .st-bubble { background: var(--st-sky); border-color: #cfe3f7; border-bottom-left-radius: 16px; border-bottom-right-radius: 4px; }
.st-sp { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 2px; }
.st-bubble .st-et { font-size: 18px; }
.st-bubble-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.st-bubble-head .st-sp { margin-bottom: 0; }
.st-bubble .st-line-play { width: 34px; height: 34px; margin: -2px -4px 0 0; font-size: 12px; }

.st-quiz { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.st-quiz h2 { font-size: 18px; margin: 0 0 4px; }
.st-quiz .st-quiz-sub { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.st-q { padding: 14px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; background: var(--card); }
.st-q-text { font-size: 16px; font-weight: 600; margin-bottom: 10px; }
.st-opts { display: grid; gap: 8px; }
.st-opt { min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  text-align: left; font-size: 15px; transition: background .15s, border-color .15s; }
.st-opt:active { transform: scale(.99); }
.st-opt.right { border-color: var(--ok); background: var(--ok-bg); font-weight: 600; }
.st-opt.wrong { border-color: var(--bad); background: var(--bad-bg); }
.st-opt:disabled { cursor: default; color: var(--ink); }
.st-explain { font-size: 13px; color: var(--muted); margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.st-explain.ok { color: var(--ok); }
.st-explain.bad { color: var(--bad); }
.st-quiz-foot { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.st-score { font-size: 14px; color: var(--muted); font-weight: 600; }
.st-done { margin-top: 14px; padding: 16px; border-radius: 14px; background: var(--ok-bg); border: 1.5px solid var(--ok);
  text-align: center; }
.st-done h3 { margin: 0 0 4px; color: var(--ok); font-size: 18px; }
.st-done .st-done-score { font-size: 30px; font-weight: 700; color: var(--ok); }

@media (max-width: 380px) {
  .st-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
  .st-hero { height: 200px; }
  .st-hero h1 { font-size: 24px; }
  .st-et { font-size: 18px; }
  .st-bubble { max-width: 86%; }
  .st-controls { gap: 6px; }
  .st-ctl { padding: 0 12px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .st-card, .st-cover img, .st-line, .st-opt { transition: none; }
}