/* Doable English — "Editorial Learning Studio" design system.
   Mobile-first, light/dark, reduced-motion aware. Every colour comes from the official palette:
   ivory #F7F6F1 · white · ink #162A3A · grey #66717B · lines #DDE2DD · electric blue #3157F6 (action)
   · lime #D8F36A (milestones, marks) · coral #F47762 (editorial highlights) · ok/bad/warn states. */
:root {
  --bg: #f7f6f1; --surface: #ffffff; --surface-2: #f0efe8; --surface-3: #e6e8e3;
  --ink: #162a3a; --ink-2: #33475a; --muted: #66717b; --line: #dde2dd; --line-2: #c8cfc9;
  --brand: #3157f6; --brand-ink: #2747d1; --brand-soft: #e8edfe; --on-brand: #ffffff;
  --lime: #d8f36a; --lime-soft: #f1fbd0; --on-lime: #162a3a;
  --coral: #f47762; --coral-ink: #b4432f; --coral-soft: #fde8e3;
  --accent: var(--coral); --accent-ink: var(--coral-ink); --accent-soft: var(--coral-soft);
  --ok: #247a57; --ok-soft: #e2f1e9; --bad: #c74646; --bad-soft: #f9e4e2; --warn: #ac6b12; --warn-soft: #f8eedd;
  --deep: #162a3a; --on-deep: #f7f6f1; --on-deep-2: #b9c4cc;
  --shadow: 0 1px 2px rgb(22 42 58 / .05);
  --shadow-lg: 0 12px 32px rgb(22 42 58 / .12);
  --r: 16px; --r-sm: 10px; --r-lg: 20px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t: 180ms;
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px;
  --wrap: 1200px;
  --top: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1a24; --surface: #142533; --surface-2: #1a2f40; --surface-3: #22394c;
    --ink: #f2f1ea; --ink-2: #ccd4d9; --muted: #9aa6ae; --line: #253b4c; --line-2: #34506a;
    --brand: #6f8cff; --brand-ink: #a5b6ff; --brand-soft: #1d2c5c; --on-brand: #0b1530;
    --lime-soft: #2b3514; --coral-ink: #ff9d8c; --coral-soft: #3d221d;
    --ok: #5cc79a; --ok-soft: #133426; --bad: #ff8a80; --bad-soft: #3f1f1e; --warn: #e3a34a; --warn-soft: #36290f;
    --deep: #0a141c; --on-deep: #f2f1ea; --on-deep-2: #a9b5bd;
    --shadow: 0 1px 2px rgb(0 0 0 / .3); --shadow-lg: 0 12px 32px rgb(0 0 0 / .45);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1a24; --surface: #142533; --surface-2: #1a2f40; --surface-3: #22394c;
  --ink: #f2f1ea; --ink-2: #ccd4d9; --muted: #9aa6ae; --line: #253b4c; --line-2: #34506a;
  --brand: #6f8cff; --brand-ink: #a5b6ff; --brand-soft: #1d2c5c; --on-brand: #0b1530;
  --lime-soft: #2b3514; --coral-ink: #ff9d8c; --coral-soft: #3d221d;
  --ok: #5cc79a; --ok-soft: #133426; --bad: #ff8a80; --bad-soft: #3f1f1e; --warn: #e3a34a; --warn-soft: #36290f;
  --deep: #0a141c; --on-deep: #f2f1ea; --on-deep-2: #a9b5bd;
  --shadow: 0 1px 2px rgb(0 0 0 / .3); --shadow-lg: 0 12px 32px rgb(0 0 0 / .45);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 12px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--brand-ink); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 .5em; font-weight: 700; letter-spacing: -.015em; }
h1 { font: 700 clamp(1.85rem, 4.4vw, 2.6rem)/1.08 var(--display); letter-spacing: -.03em; }
h2 { font-size: 1.25rem; letter-spacing: -.02em; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .75em; }
kbd { font: 600 .72rem/1 var(--font); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 2px 5px; color: var(--muted); background: var(--surface); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 10px; }
.ico { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .center { text-align: center; }
.lead { font-size: 1.08rem; color: var(--ink-2); }
.eyebrow { font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 .4em; display: flex; gap: .4em; align-items: center; flex-wrap: wrap; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.row.actions { margin-bottom: 14px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ——— Buttons ——— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 46px; padding: 10px 20px; border-radius: var(--r-sm); border: 1.5px solid transparent; font: 600 1rem/1.1 var(--font); text-decoration: none; cursor: pointer; transition: transform var(--t) var(--ease), background var(--t), box-shadow var(--t), border-color var(--t), color var(--t); background: var(--surface-2); color: var(--ink); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, var(--ink)); }
.btn.deep { background: var(--ink); color: var(--bg); }
.btn.deep:hover { background: color-mix(in srgb, var(--ink) 85%, var(--brand)); }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { background: var(--surface); }
.btn.ghost:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn.danger { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.btn.lg { min-height: 54px; padding: 14px 26px; font-size: 1.05rem; }
.btn.sm { min-height: 34px; padding: 6px 12px; font-size: .88rem; border-radius: 10px; }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.link { display: inline-flex; align-items: center; gap: .3em; font-weight: 700; text-decoration: none; font-size: .92rem; }
.link:hover { text-decoration: underline; }

/* ——— Top bar & navigation ——— */
.topbar { position: sticky; top: 0; z-index: 30; height: calc(var(--top) + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
/* Wordmark: "doable" heavy in ink over a lime bar, "english" lighter in electric blue. */
.brand { display: inline-flex; align-items: baseline; gap: 1px; text-decoration: none; color: var(--ink); font: 800 1.3rem/1 var(--display); letter-spacing: -.045em; margin-right: auto; white-space: nowrap; }
.brand .wm-d { position: relative; z-index: 0; }
.brand .wm-d::after { content: ""; position: absolute; z-index: -1; left: -1px; right: -1px; bottom: .02em; height: .32em; background: var(--lime); border-radius: 2px; }
.brand .wm-e { font-weight: 600; color: var(--brand); letter-spacing: -.03em; }
@media (max-width: 400px) { .brand { font-size: 1.15rem; } .top-stats .stat-chip { padding: 6px 5px; } }
.search-btn { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: .92rem; cursor: pointer; }
.search-btn span, .search-btn kbd { display: none; }
.top-stats { display: flex; gap: 4px; }
.stat-chip { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .92rem; font-variant-numeric: tabular-nums; }
.stat-chip:hover { background: var(--surface-2); }
.stat-chip.on { background: var(--lime); color: var(--on-lime); }
.stat-chip.on:hover { background: var(--lime); }
.flame { color: var(--coral); }
.stat-chip.xp .ico, .bolt { color: var(--brand); }
#theme-btn .moon { display: none; }
:root[data-theme="dark"] #theme-btn .sun { display: none; } :root[data-theme="dark"] #theme-btn .moon { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) #theme-btn .sun { display: none; } :root:not([data-theme="light"]) #theme-btn .moon { display: block; } }

.layout { display: block; }
.side-nav { display: none; }
main { display: block; padding: 18px 16px calc(96px + env(safe-area-inset-bottom, 0px)); outline: none; min-width: 0; }
.view-inner { max-width: var(--wrap); margin: 0 auto; animation: fade .2s var(--ease); }
.bottom-nav { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); }
.bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; min-height: 52px; justify-content: center; border-radius: var(--r-sm); color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; }
.bottom-nav a .ico { width: 24px; height: 24px; }
.bottom-nav a[aria-current] { color: var(--brand-ink); background: var(--brand-soft); }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--lime); color: var(--on-lime); font-size: .72rem; font-weight: 700; display: inline-grid; place-items: center; }
.bottom-nav .badge { position: absolute; top: 3px; right: calc(50% - 22px); }

@media (min-width: 640px) {
  .search-btn { padding: 0 12px; min-width: 190px; } .search-btn span, .search-btn kbd { display: inline; } .search-btn kbd { margin-left: auto; }
  main { padding: 26px 24px calc(100px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 980px) {
  .layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); }
  .side-nav { display: flex; flex-direction: column; position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 16px 12px; border-right: 1px solid var(--line); }
  .side-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
  .side-nav a { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; padding: 8px 12px; border-radius: var(--r-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .95rem; transition: background var(--t), color var(--t); }
  .side-nav a:hover { background: var(--surface-2); color: var(--ink); }
  .side-nav a[aria-current] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
  .side-nav a[aria-current]::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
  .side-nav a[aria-current] .ico { color: var(--brand); }
  .side-nav .badge { margin-left: auto; }
  .side-profile { margin-top: auto; border-top: 1px solid var(--line); border-radius: 0 !important; padding-top: 14px !important; }
  .bottom-nav { display: none; }
  main { padding: 30px 36px 60px; }
}
/* Focus mode: sessions hide navigation to reduce distraction. */
body:has(.session, .flash) .side-nav, body:has(.session, .flash) .bottom-nav { display: none; }
body:has(.session, .flash) .layout { display: block; }
body:has(.session, .flash) main { padding-bottom: 40px; }

/* ——— Footer ——— */
.site-footer { max-width: var(--wrap); margin: 40px auto 0; padding-top: 18px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .88rem; }
.site-footer a { font-weight: 700; }
body:has(.session, .flash) .site-footer { display: none; }

/* ——— Audio (speechService UI) ——— */
.audio-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; vertical-align: middle; flex: none; cursor: pointer; color: var(--brand-ink); background: var(--surface); border: 1px solid var(--line-2); font: 700 .92rem/1 var(--font); transition: background .15s, border-color .15s, color .15s, transform .12s; }
.audio-btn.icon { width: 44px; height: 44px; border-radius: 50%; }
.audio-btn.label { min-height: 44px; padding: 8px 14px 8px 11px; border-radius: 999px; }
.audio-btn .ico { width: 20px; height: 20px; }
.audio-btn:hover { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 45%, var(--line-2)); }
.audio-btn:active { transform: scale(.96); }
.audio-btn.is-slow { color: var(--ink-2); }
.audio-btn.is-playing, .audio-btn.is-paused { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.audio-btn.is-playing .w1, .audio-btn.is-playing .w2 { animation: wave 1s ease-in-out infinite; }
.audio-btn.is-playing .w2 { animation-delay: .2s; }
.audio-btn.is-playing.is-slow .ico, .audio-btn.is-playing[data-mode=restart] .ico { animation: pulse 1.2s ease-in-out infinite; }
.audio-btn[disabled] { opacity: .45; cursor: not-allowed; }
.audio-ctl { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font: 700 .92rem/1 var(--font); cursor: pointer; }
.audio-ctl:hover { border-color: var(--bad); color: var(--bad); }
.audio-ctl .ico { width: 18px; height: 18px; }
.audio-note { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; margin: 6px 0; }
.word-audio, .fc-audio { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 4px 0 16px; }
.fc-audio { margin: 6px 0 0; }
.fc-back .audio-btn, .word-card .audio-btn.label, .wod .audio-btn.label { margin-top: 2px; }
.transcript-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.listen-panel { text-align: center; padding: 20px 16px; margin: 6px 0 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.lp-title { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; font-weight: 700; color: var(--brand-ink); }
.lp-sub { color: var(--muted); margin: 2px 0 12px; font-size: .95rem; }
.lp-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lp-controls .play-main { min-height: 52px; padding: 10px 22px 10px 16px; font-size: 1.05rem; background: var(--brand); color: var(--on-brand); border-color: var(--brand); }
.lp-controls .play-main:hover { background: color-mix(in srgb, var(--brand) 88%, #000); color: var(--on-brand); }
.lp-controls .play-main.is-playing, .lp-controls .play-main.is-paused { background: var(--brand); color: var(--on-brand); }
.lp-controls .play-main .ico { width: 22px; height: 22px; }
.lp-details { margin-top: 12px; }
.lp-details summary { cursor: pointer; color: var(--muted); font-weight: 700; font-size: .9rem; }
.lp-transcript { margin: 8px auto 0; max-width: 60ch; font-style: italic; color: var(--ink-2); }
.listen-panel.no-audio { text-align: left; }

.read-along { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.ra-title { display: flex; gap: 6px; align-items: center; font-family: var(--font); font-size: .9rem; font-weight: 700; color: var(--muted); margin-right: 4px; }
.ra-part { border-radius: 6px; transition: background .25s, box-shadow .25s; }
.ra-part.speaking { background: var(--lime); color: var(--on-lime); box-shadow: 0 0 0 3px var(--lime); }
.rt-head { border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.dialogue dd .audio-btn { margin-left: 4px; }

.speed-chip { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 700 .82rem/1 var(--font); cursor: pointer; }
.speed-chip .ico { width: 17px; height: 17px; }
.speed-chip.slow { background: var(--lime-soft); border-color: var(--lime); color: var(--ink); }
@media (max-width: 480px) { .speed-chip span { display: none; } .speed-chip { width: 36px; padding: 0; justify-content: center; } }

.method { margin: 6px 0 14px; padding-left: 1.3em; display: grid; gap: 4px; }
.shadow-status { min-height: 1.6em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 1rem; margin: 10px 0 0; }
.shadow-timer { display: block; width: 100%; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; position: relative; }
.shadow-timer::after { content: ""; position: absolute; inset: 0; background: var(--brand); transform-origin: left; animation: timer var(--d) linear forwards; }
.repeat li.active { outline: 3px solid var(--brand); background: var(--brand-soft); }
@keyframes wave { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes timer { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ——— Page structure ——— */
.page-head { margin-bottom: 22px; }
.page-head .lead { max-width: 60ch; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px; color: var(--muted); font-weight: 700; text-decoration: none; font-size: .92rem; }
.back:hover { color: var(--brand-ink); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3); margin-bottom: var(--s2); min-width: 0; }
@media (max-width: 520px) { .panel { padding: 18px; } }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.panel.note, .note { background: var(--surface-2); box-shadow: none; font-size: .94rem; }
.panel.notice { display: flex; gap: 14px; align-items: flex-start; border-color: var(--line); border-left: 3px solid var(--coral); }
.panel.notice > .ico { color: var(--coral-ink); width: 26px; height: 26px; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); margin-bottom: 18px; }
.link-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); color: var(--ink); text-decoration: none; transition: transform var(--t) var(--ease), border-color var(--t); min-width: 0; }
.link-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.link-card > .ico { width: 28px; height: 28px; color: var(--brand); }
.link-card b { font: 700 1.05rem/1.25 var(--display); letter-spacing: -.01em; }
.link-card > span, .link-card small { color: var(--muted); font-size: .9rem; }
.link-card.big { padding: 20px; }
.link-card.done { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); }
.link-card.done::after { content: "✓"; position: absolute; top: 12px; right: 14px; color: var(--ok); font-weight: 700; }
.link-card.dim { opacity: .72; }
.link-card.wide { margin-bottom: 18px; }
.link-card .huge { font: 650 2.6rem/1 var(--display); color: var(--brand-ink); }
.link-card.center { align-items: center; text-align: center; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: .8rem; font-weight: 600; }
.level-chip { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font); font-size: 1rem; }
.level-chip b { display: inline-grid; place-items: center; min-width: 40px; height: 30px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: .9rem; }
.level-chip.sm b { min-width: 30px; height: 22px; font-size: .75rem; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty > .ico { width: 44px; height: 44px; color: var(--brand); margin-bottom: 8px; }
.done-tag { display: inline-flex; gap: 6px; align-items: center; color: var(--ok); font-weight: 700; }
.ok-txt { color: var(--ok); } .warn-txt { color: var(--warn); font-weight: 700; }

/* progress bar */
.bar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); width: 0; transition: width .6s var(--ease); }
.skill-writing .bar i, .bar.skill-writing i { background: var(--brand); }

/* ——— Dashboard ——— */
.dash-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.dash-head h1 { margin-bottom: 4px; }
.dash-head .lead { margin: 0; }
.level-card { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-width: 220px; }
.lc-code { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--r-sm); background: var(--ink); color: var(--bg); font: 800 1.25rem/1 var(--display); letter-spacing: -.02em; box-shadow: inset 0 -5px 0 var(--lime); }
.lc-txt { display: grid; gap: 3px; flex: 1; } .lc-txt small { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.dash-grid { display: grid; gap: 16px; margin-bottom: 16px; }
.hero { position: relative; overflow: hidden; display: flex; gap: 24px; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: var(--s4); background: var(--deep); color: var(--on-deep); border-color: var(--deep); margin: 0; }
.hero .eyebrow, .hero .muted { color: var(--on-deep-2); }
.hero .btn.primary { background: var(--lime); color: var(--on-lime); }
.hero .btn.primary:hover { background: color-mix(in srgb, var(--lime) 85%, #fff); }
.hero .ring-bg { stroke: rgb(255 255 255 / .14); }
.hero .ring-fg { stroke: var(--lime); }
.hero .goal-ring span { color: var(--on-deep); }
@media (max-width: 520px) { .hero { padding: 22px; } }
.hero-main { flex: 1 1 280px; position: relative; }
.hero h2 { font: 700 clamp(1.45rem, 3.4vw, 1.95rem)/1.12 var(--display); letter-spacing: -.025em; margin-bottom: 8px; color: var(--on-deep); }
.hero .btn { margin-top: 8px; }
.goal { display: flex; align-items: center; gap: 12px; position: relative; }
.goal p { margin: 0; }
.goal-ring, .ring { position: relative; width: 88px; height: 88px; flex: none; }
.goal-ring svg, .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--brand); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.goal-ring span, .ring span { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; }
.streak-card { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.stat { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; }
.stat .ico { width: 26px; height: 26px; }
.stat b { font: 700 1.6rem/1.1 var(--display); letter-spacing: -.03em; }
.stat span { color: var(--muted); font-size: .82rem; }
.dash-cols { display: grid; gap: 16px; }
.col-main, .col-side { min-width: 0; }
.plan { list-style: none; margin: 0; padding: 0; display: grid; }
.plan-item { display: flex; align-items: center; gap: 14px; padding: 12px 8px; border-radius: 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s; }
.plan li:last-child .plan-item { border-bottom: 0; }
.plan-item:hover { background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
.pi-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-ink); flex: none; }
.pi-txt { display: grid; flex: 1; min-width: 0; } .pi-txt small { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pi-txt b { overflow: hidden; text-overflow: ellipsis; }
.pi-min { color: var(--muted); font-size: .88rem; font-weight: 700; white-space: nowrap; }
.plan-item.done b { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line-2); }
.plan-item.done .pi-ico { background: var(--surface); color: var(--ok); }
.plan-item.done .pi-min { color: var(--ok); }
.meters { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.meter { display: grid; grid-template-columns: minmax(118px, 150px) 1fr 44px; align-items: center; gap: 12px; padding: 7px 6px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.meter:hover { background: var(--surface-2); }
.m-name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .94rem; }
.m-name .ico { color: var(--brand); }
.m-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; font-size: .92rem; color: var(--ink-2); }
.weekly { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.weekly li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.weekly .bar { grid-column: 1 / -1; }
.weekly b { font-variant-numeric: tabular-nums; }
.review-card .big { font: 650 2rem/1 var(--display); color: var(--brand-ink); }
.challenge-card.done { background: var(--ok-soft); }
.mistakes-card ul { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.mistakes-card li { display: grid; gap: 2px; font-size: .94rem; }
.mistakes-card s { color: var(--bad); }
.mistakes-card li span { color: var(--ok); font-weight: 700; display: flex; gap: 4px; align-items: center; }
.hero { margin-bottom: var(--s4); }
.dash-sect { margin-bottom: var(--s4); }
.dash-sect + .dash-sect { border-top: 1px solid var(--line); padding-top: var(--s3); }
.weekly-inline { margin: 16px 0 0; font-size: .92rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.weekly-inline b { color: var(--ink); }
.wod, .tip { padding: 4px 2px 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tip { border-bottom: 0; }
.wc-ex { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wod-word { display: flex; align-items: center; gap: 10px; }
.wod-word h2 { font: 700 2rem/1.1 var(--display); letter-spacing: -.03em; margin: 0; box-shadow: inset 0 -.28em 0 var(--lime); padding: 0 2px; }
.ipa { color: var(--muted); font-size: .95rem; margin-bottom: .4em; }
.ipa.big { font-size: 1.15rem; margin: 0; }
.wc-ex { font-style: italic; color: var(--ink-2); }
.wc-ex.big { font-size: 1.12rem; }
.tip .eyebrow .ico { color: var(--coral); }
.modes h2 { margin-top: 10px; }
.modes .grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
@media (min-width: 760px) {
  .dash-grid { grid-template-columns: 1fr 280px; }
  .streak-card { grid-template-columns: 1fr; align-content: center; gap: 14px; }
  .streak-card .stat { display: grid; grid-template-columns: 32px auto 1fr; align-items: center; text-align: left; gap: 10px; }
}
@media (min-width: 1080px) { .dash-cols { grid-template-columns: minmax(0, 1fr) 340px; } }

/* ——— Learn path ——— */
.level-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; margin-bottom: 16px; scrollbar-width: thin; }
.lt { display: flex; flex-direction: column; align-items: center; min-width: 72px; padding: 8px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.lt b { font: 700 1.2rem/1.1 var(--display); letter-spacing: -.02em; } .lt small { color: var(--muted); font-size: .76rem; font-weight: 700; }
.lt.on { background: var(--ink); color: var(--bg); border-color: var(--ink); } .lt.on small { color: inherit; opacity: .8; }
.lt.soon { opacity: .5; }
.level-tabs.small .lt { min-width: 60px; padding: 6px 10px; }
.level-intro { display: grid; gap: 22px 40px; margin: 8px 0 var(--s4); padding-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.li-focus { font: 600 clamp(1.15rem, 2.2vw, 1.4rem)/1.4 var(--display); letter-spacing: -.015em; color: var(--ink); max-width: 46ch; margin: 6px 0 22px; }
.li-main .can { font-size: 1.02rem; }
.li-trap { margin: 0; padding: 18px 20px; border-radius: var(--r); background: var(--deep); color: var(--on-deep); align-self: start; }
.li-trap figcaption { font: 700 .74rem/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--lime); margin-bottom: 10px; }
.li-trap p { margin: 0 0 6px; font: 650 1.12rem/1.35 var(--display); letter-spacing: -.01em; }
.li-trap s { color: var(--on-deep-2); text-decoration-color: var(--coral); text-decoration-thickness: 2px; }
.li-trap b { box-shadow: inset 0 -.32em 0 color-mix(in srgb, var(--lime) 55%, transparent); }
.li-trap .small { font: 400 .9rem/1.5 var(--font); color: var(--on-deep-2); margin-top: 10px; }
.li-trap .small strong, .li-trap .small em { color: var(--on-deep); }
.li-side { display: grid; gap: 8px; align-content: start; }
@media (min-width: 860px) { .level-intro { grid-template-columns: minmax(0, 1fr) 300px; } .li-main { grid-row: span 2; } }
.can { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.can li { display: flex; gap: 8px; align-items: flex-start; }
.can .ico { color: var(--ok); margin-top: 2px; }
.path { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.path::before { content: ""; position: absolute; left: 21px; top: 20px; bottom: 20px; width: 3px; border-radius: 3px; background: var(--line); }
.unit-node { position: relative; display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: center; margin-bottom: 12px; }
.node-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--surface); border: 3px solid var(--line-2); color: var(--muted); }
.node-dot .ico { width: 18px; height: 18px; }
.unit-node.done .node-dot { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.unit-node.current .node-dot { background: var(--brand); border-color: var(--brand); color: var(--on-brand); box-shadow: 0 0 0 6px var(--brand-soft); }
.unit-node.open .node-dot { border-color: var(--brand); color: var(--brand); }
.unit-card { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--r); background: transparent; border: 1px solid transparent; text-decoration: none; color: var(--ink); transition: transform var(--t) var(--ease), border-color var(--t); min-width: 0; }
.unit-card:hover { background: var(--surface); border-color: var(--line); }
.unit-node.current .unit-card { background: var(--surface); border: 2px solid var(--brand); padding: 16px; }
.unit-node.locked .u-txt b { color: var(--ink-2); }
.unit-node.locked .u-num { color: var(--muted); }
.u-num { font: 800 1.15rem/1 var(--display); letter-spacing: -.03em; width: 48px; height: 48px; display: grid; place-items: center; border-radius: var(--r-sm); background: transparent; color: var(--ink); flex: none; font-variant-numeric: tabular-nums; }
.unit-node.done .u-num { background: var(--lime); color: var(--on-lime); }
.unit-node.current .u-num { background: var(--brand); color: var(--on-brand); }
.u-txt { display: grid; gap: 3px; flex: 1; min-width: 0; }
.u-txt small { color: var(--muted); font-size: .8rem; font-weight: 700; }
.u-txt .bar { max-width: 240px; margin-top: 4px; }
.unit-card > .ico { color: var(--muted); }
.unit-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .unit-grid { grid-template-columns: minmax(0, 1fr) 360px; } }
/* Open sections: a hairline and air instead of another white box. */
.sect { border-top: 1px solid var(--line); padding-top: var(--s3); margin: var(--s4) 0; }
.sect > h2:first-child { margin-top: 0; }
.kicker { font: 700 .78rem/1.2 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.unit-goals .can { font-size: 1.08rem; gap: 10px; }
.unit-main { min-width: 0; }
.unit-side { align-self: start; }
.unit-side h2 { font-size: 1.02rem; margin: 22px 0 10px; } .unit-side h2:first-child { margin-top: 0; }
.lessons { list-style: none; margin: 0; padding: 0; counter-reset: l; }
.lesson-row { display: flex; align-items: center; gap: 16px; padding: 14px 10px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); border-radius: 0; transition: background var(--t); }
.lessons li:last-child .lesson-row { border-bottom: 0; }
.lesson-row:hover { background: color-mix(in srgb, var(--brand-soft) 40%, transparent); }
.lesson-row.next { background: var(--surface); border: 1.5px solid var(--brand); border-radius: var(--r); margin: 6px 0; }
.lr-n { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-2); font: 700 .95rem/1 var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.lesson-row.next .lr-n { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.lesson-row.done .lr-n { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.lr-txt { display: grid; flex: 1; min-width: 0; gap: 2px; } .lr-txt b { font: 650 1.05rem/1.3 var(--display); letter-spacing: -.01em; } .lr-txt small { color: var(--muted); font-size: .82rem; }
.rows { list-style: none; margin: 0; padding: 0; }
.row-link { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.rows li:last-child .row-link { border-bottom: 0; }
.row-link > .ico { color: var(--brand); flex: none; }
.row-link:hover b { color: var(--brand); }
.rl-txt { display: grid; flex: 1; min-width: 0; } .rl-txt small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.rl-end { font-size: .8rem; color: var(--muted); white-space: nowrap; display: flex; gap: 4px; align-items: center; }
.row-link.done .rl-end { color: var(--ok); font-weight: 700; }
/* Reading column for explanations (grammar topics). */
.reading { font-size: 1.06rem; line-height: 1.65; min-width: 0; }
.reading p { margin: 0 0 1em; }
.reading .tw { margin-top: 1.4em; }
.lang-note { font-size: .9rem; line-height: 1.5; color: var(--ink-2); border-left: 3px solid var(--lime); padding: 2px 0 2px 12px; }
.contrast-sheet { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--coral); border-radius: var(--r); padding: var(--s3) var(--s4); margin: var(--s4) 0; }
@media (max-width: 520px) { .contrast-sheet { padding: var(--s3); } }
.links { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.links a { display: flex; gap: 8px; align-items: center; text-decoration: none; font-weight: 700; }
.links a:hover { text-decoration: underline; }
.word-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.word-chips a { padding: 4px 10px; border-radius: 999px; background: var(--surface-2); text-decoration: none; color: var(--ink); font-size: .9rem; }
.word-chips a:hover { background: var(--brand-soft); color: var(--brand-ink); }

/* ——— Session / exercises ——— */
.session, .flash { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; min-height: calc(100vh - var(--top) - 80px); }
.ses-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.ses-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.ses-bar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; transition: width .22s var(--ease); }
.ses-count { font-weight: 700; font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ses-phase { min-height: 1.5em; font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-ink); display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; }
.phase-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.ses-body { outline: none; }   /* the feedback follows the answer instead of sitting at the bottom of the screen */
.ses-body.enter { animation: slideIn .2s var(--ease); }
.ses-foot { position: sticky; bottom: 0; padding: 12px 0 calc(8px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(transparent, var(--bg) 22%); margin-top: 16px; }
.ses-actions { display: flex; justify-content: flex-end; }
.ses-actions .btn { min-width: 170px; min-height: 52px; }
@media (max-width: 520px) { .ses-actions .btn { width: 100%; } }
.ses-fb { display: none; border-radius: var(--r); padding: 16px 18px; margin-bottom: 12px; border: 1.5px solid; animation: rise .2s var(--ease); }
.ses-fb.show { display: block; }
.ses-fb.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.ses-fb.no { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.ses-fb.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.ses-fb p { margin: 6px 0 0; }
.fb-head { display: flex; align-items: center; gap: 8px; font-size: 1.1rem; }
.fb-head .ico { width: 26px; height: 26px; padding: 4px; border-radius: 50%; color: #fff; }
.ses-fb.ok .fb-head { color: var(--ok); } .ses-fb.ok .fb-head .ico { background: var(--ok); }
.ses-fb.no .fb-head { color: var(--bad); } .ses-fb.no .fb-head .ico { background: var(--bad); }
:root[data-theme="dark"] .fb-head .ico { color: #111; }
.xp-pop { margin-left: auto; font-weight: 600; color: var(--muted); font-size: .82rem; }
/* The explanation is the point of the feedback: it reads first and largest after the verdict. */
.ses-fb .fb-e { color: var(--ink); font-size: 1.02rem; line-height: 1.55; margin-top: 8px; max-width: 62ch; }
.fb-cmp { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent); display: grid; gap: 6px; }
.fb-cmp > div { display: grid; grid-template-columns: 7.5em 1fr; gap: 10px; align-items: baseline; }
.fb-cmp dt { font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.fb-cmp dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-given s { color: var(--bad); text-decoration-thickness: 1.5px; }
@media (max-width: 520px) { .fb-cmp > div { grid-template-columns: 1fr; gap: 2px; } }
.fb-tag { font-size: .9rem; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.fb-tag s { color: var(--bad); }
.ins { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-weight: 700; font-size: .92rem; margin-bottom: 10px; }
.q { font: 700 clamp(1.25rem, 3.2vw, 1.55rem)/1.35 var(--display); letter-spacing: -.015em; margin: 0 0 18px; outline: none; }
.q strong { color: var(--brand-ink); }
.gap { display: inline-block; min-width: 3.2em; border-bottom: 3px solid var(--brand); background: var(--brand-soft); border-radius: 4px 4px 0 0; color: transparent; line-height: 1; }
.wrong-sent { color: var(--ink); } .inline-x { color: var(--bad); }
.hint { display: flex; gap: 8px; align-items: flex-start; padding: 10px 14px; border-radius: var(--r-sm); background: var(--lime-soft); border-left: 3px solid var(--lime); color: var(--ink); font-size: .95rem; }
.hint .ico { color: var(--ink); margin-top: 2px; }
.opts { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.opts.long { grid-template-columns: 1fr; }
.opt { position: relative; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px 16px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: 500 1.05rem/1.3 var(--font); text-align: left; cursor: pointer; transition: transform .16s var(--ease), border-color .16s, background .16s, box-shadow .16s; }
.opt:hover:not([disabled]) { border-color: var(--brand); background: color-mix(in srgb, var(--brand-soft) 40%, var(--surface)); }
.opt:active:not([disabled]) { transform: translateY(1px); }
.opt[disabled] { cursor: default; }
.opt kbd { flex: none; }
.opt .mark { margin-left: auto; width: 24px; height: 24px; }
.opt.ok { border-color: var(--ok); background: var(--ok-soft); box-shadow: inset 0 0 0 1px var(--ok); font-weight: 600; } .opt.ok .mark { color: var(--ok); }
.opt.no { border-color: var(--bad); background: var(--bad-soft); box-shadow: inset 0 0 0 1px var(--bad); animation: shake .3s; } .opt.no .mark { color: var(--bad); }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.opt.idk { color: var(--muted); border-style: dashed; }
.field { display: grid; gap: 6px; margin-bottom: 12px; font-weight: 600; font-size: .95rem; }
input:not([type=radio]):not([type=checkbox]):not([type=range]):not([type=file]), textarea, select { width: 100%; font: 400 1.05rem/1.4 var(--font); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-2); border-radius: var(--r-sm); padding: 12px 14px; min-height: 50px; transition: border-color var(--t), box-shadow var(--t); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 22%, transparent); }
input[disabled] { opacity: .8; }
.answer { font-size: 1.15rem !important; }
textarea { resize: vertical; min-height: 160px; }
.passage { margin-bottom: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.passage summary { cursor: pointer; padding: 10px 14px; font-weight: 700; }
.passage p { padding: 0 14px 12px; margin: 0; max-height: 40vh; overflow: auto; line-height: 1.65; }
.passage-q { margin: 0 0 14px; padding: 14px 16px; border-left: 4px solid var(--brand); background: var(--surface); border-radius: 0 12px 12px 0; }
.slot { min-height: 64px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 4px; border-bottom: 2px dashed var(--line-2); margin-bottom: 16px; }
.slot-hint { color: var(--muted); font-size: .92rem; }
.pool { display: flex; flex-wrap: wrap; gap: 8px; }
.tile { font: 600 1.05rem/1.2 var(--font); min-height: 48px; padding: 8px 16px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); border-bottom-width: 3px; background: var(--surface); color: var(--ink); cursor: pointer; transition: transform .1s, opacity .15s; }
.tile:hover:not([disabled]) { border-color: var(--brand); }
.tile:active:not([disabled]) { transform: translateY(2px); border-bottom-width: 2px; }
.pool .tile[disabled] { opacity: .22; cursor: default; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match .col { display: grid; gap: 10px; align-content: start; }
.m-item { position: relative; min-height: 54px; padding: 10px 12px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); border-bottom-width: 3px; background: var(--surface); color: var(--ink); font: 600 1rem/1.25 var(--font); cursor: pointer; text-align: center; display: flex; align-items: center; justify-content: center; gap: 6px; }
.m-item.sel { border-color: var(--brand); background: var(--brand-soft); }
.m-item.matched { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); cursor: default; }
.m-item .mark { width: 18px; height: 18px; }
.shake { animation: shake .35s; border-color: var(--bad) !important; }
.card-item h2 { font: 700 clamp(1.4rem, 3vw, 1.75rem)/1.15 var(--display); letter-spacing: -.025em; }
.card-item .lead { margin-bottom: 14px; }
.card-item .can { margin: 10px 0 16px; }

/* teaching content */
.word-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.word-card { padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.wc-top { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
.wc-top h3 { font: 700 1.4rem/1.2 var(--display); letter-spacing: -.02em; margin: 0; }
.wc-es { font-weight: 700; margin-bottom: 4px; }
.examples { list-style: none; margin: 0; padding: 0; display: grid; }
/* Examples read like an annotated page: English large, the key form marked, Spanish below and labelled. */
.examples li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.examples li:last-child { border-bottom: 0; }
.examples li > span:first-child { font: 600 1.12rem/1.4 var(--display); letter-spacing: -.01em; }
.examples .tr { grid-column: 1 / -1; color: var(--muted); font-size: .94rem; display: flex; gap: 8px; align-items: baseline; }
.examples .tr::before { content: "ES"; font: 700 .64rem/1 var(--font); letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 3px 4px; }
.examples strong, .q strong { color: var(--ink); background: linear-gradient(transparent 62%, var(--lime) 62%); padding: 0 1px; }
.contrast { border-radius: 14px; }
.contrast h3 { display: flex; align-items: center; gap: 8px; color: var(--coral-ink); font-size: 1.1rem; margin-top: 0; }
.ct-row { padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 0; }
.ct-row:last-child { border-bottom: 0; }
.ct-row p { margin: 0 0 4px; }
.ct-es, .ct-no, .ct-ok { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flag-es { font-size: .66rem; font-weight: 700; letter-spacing: .06em; padding: 3px 5px; border-radius: 4px; border: 1px solid var(--line-2); color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.tag .ico { width: 14px; height: 14px; }
.tag.no { background: var(--bad-soft); color: var(--bad); } .tag.ok { background: var(--ok-soft); color: var(--ok); }
.ct-no s { color: var(--bad); text-decoration-thickness: 2px; }
.ct-ok strong { font-family: var(--display); font-size: 1.08rem; box-shadow: inset 0 -.3em 0 var(--lime); }
.dialogue { margin: 12px 0 0; display: grid; gap: 8px; }
.dialogue div { display: grid; grid-template-columns: 90px 1fr; gap: 10px; align-items: baseline; }
.dialogue dt { font-weight: 700; color: var(--brand-ink); font-size: .9rem; text-align: right; }
.dialogue dd { margin: 0; }
@media (max-width: 480px) { .dialogue div { grid-template-columns: 1fr; gap: 0; } .dialogue dt { text-align: left; } }
.mini-words { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.mini-words li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: .95rem; }
.mini-words span { color: var(--muted); text-align: right; }
.tw { overflow-x: auto; margin-bottom: 14px; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { border-bottom: 1px solid var(--line); padding: 9px 10px; text-align: left; vertical-align: top; }
thead th { color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; }
tbody th { font-weight: 700; }
@media (max-width: 520px) { th, td { padding: 8px 6px; } table { font-size: .88rem; } thead th { font-size: .68rem; letter-spacing: .02em; } }
.tbl.narrow { max-width: 360px; margin: 0 auto 18px; }
.prose p { max-width: 70ch; }
.prose h2 { margin-top: 1.2em; } .prose h2:first-child { margin-top: 0; }

/* results */
.result { max-width: 640px; margin: 0 auto; text-align: center; padding: 14px 0 40px; animation: rise .45s var(--ease); }
.res-burst { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--lime); color: var(--on-lime); margin-bottom: 12px; animation: rise .2s var(--ease); }
.res-burst .ico { width: 28px; height: 28px; }
.res-stats { display: flex; justify-content: center; align-items: center; gap: 24px; flex-wrap: wrap; margin: 18px 0; }
.ring { width: 110px; height: 110px; }
.ring span { font: 700 1.5rem/1 var(--display); letter-spacing: -.02em; }
.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.res-list li { display: flex; gap: 8px; align-items: center; }
.res-list .ico { color: var(--brand); }
.deltas { list-style: none; padding: 0; margin: 0 auto 16px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.deltas li { display: flex; gap: 6px; align-items: center; padding: 6px 12px; border-radius: 999px; background: var(--ok-soft); font-size: .92rem; }
.deltas b { color: var(--ok); }
.next-up { display: grid; gap: 2px; padding: 14px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); margin: 0 auto 16px; max-width: 420px; }
.next-up small { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; }
.res-missed { text-align: left; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.res-missed summary { cursor: pointer; padding: 12px 16px; font-weight: 700; }
.res-missed ul, .recent { list-style: none; margin: 0; padding: 0 16px 12px; display: grid; gap: 10px; }
.res-missed li, .recent li { display: grid; gap: 3px; padding-top: 10px; border-top: 1px solid var(--line); }
.ans { color: var(--ok); font-weight: 700; display: flex; gap: 6px; align-items: center; }
.given { color: var(--bad); display: flex; gap: 6px; align-items: center; text-decoration: line-through; }
.recent { padding: 0; } .recent .chip { justify-self: start; }
.res-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.left { text-align: left; }
.level-big { display: inline-grid; place-items: center; min-width: 76px; height: 64px; padding: 0 12px; border-radius: 16px; background: var(--ink); color: var(--bg); margin-right: 8px; vertical-align: middle; }
.rec-units { margin: 0; padding-left: 1.2em; } .rec-units li { margin: 4px 0; }
.exam-report { text-align: left; }

/* flashcards */
.fc { perspective: 1200px; margin: 18px 0; flex: 1; display: flex; }
.fc-face { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 300px; padding: 28px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); animation: flipIn .2s var(--ease); }
.fc.flipped .fc-face { border-color: var(--brand); }
.fc-word { font: 700 clamp(2.3rem, 8vw, 3.6rem)/1.05 var(--display); letter-spacing: -.035em; margin: 6px 0; }
.fc-q { color: var(--muted); margin-top: 16px; }
.fc-back { animation: rise .3s var(--ease); margin-top: 10px; }
.fc-es { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.fc-foot { padding-bottom: env(safe-area-inset-bottom, 0px); }
.fc-foot > .btn { width: 100%; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grade { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 76px; padding: 8px 4px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); border-bottom-width: 3px; background: var(--surface); color: var(--ink); cursor: pointer; font: 700 .95rem var(--font); }
.grade span { font-size: 1rem; line-height: 1; }
.grade small { color: var(--muted); font-weight: 400; font-size: .76rem; }
.grade kbd { display: none; }
@media (min-width: 700px) { .grade kbd { display: inline; } }
.grade.again:hover { border-color: var(--bad); } .grade.hard:hover { border-color: var(--warn); } .grade.good:hover, .grade.easy:hover { border-color: var(--ok); }
.grade-sum { list-style: none; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; padding: 0; }
.grade-sum li { padding: 8px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }

/* vocabulary */
.topics .link-card { gap: 4px; }
.t-emoji { display: none; }
.word-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.word-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.word-row a { flex: 1; display: grid; grid-template-columns: minmax(90px, 1fr) minmax(80px, 1fr) minmax(90px, 1.3fr); gap: 10px; align-items: baseline; text-decoration: none; color: var(--ink); min-width: 0; }
.word-row a > * { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 560px) { .word-row a { grid-template-columns: 1fr; gap: 0; } .word-row .muted { display: none; } }
.wstat { font-size: .74rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.wstat.learning { background: var(--lime-soft); color: var(--ink); }
.wstat.mastered { background: var(--ok-soft); color: var(--ok); }
.search-in { position: relative; } .search-in .ico { position: absolute; left: 14px; bottom: 15px; color: var(--muted); } .search-in input { padding-left: 42px !important; }
.word-detail .wd-top { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.word-detail .wc-ex + .row { margin-bottom: 18px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0 0 14px; }
.facts dt { color: var(--muted); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 0; font-weight: 700; }

/* grammar */
.g-level { margin-bottom: 18px; }
.gtopic .wstat { align-self: flex-start; }
.topic-layout { display: grid; gap: 16px; }
@media (min-width: 900px) { .topic-layout { grid-template-columns: minmax(0, 1fr) 300px; } .topic-side { position: sticky; top: calc(var(--top) + 16px); align-self: start; } }

/* skills */
.reading-text { font-size: 1.12rem; line-height: 1.75; }
.reading-text p { max-width: 68ch; }
.gloss { position: relative; font: inherit; color: inherit; background: none; border: 0; padding: 0; border-bottom: 2px dotted var(--brand); cursor: help; }
.gloss[aria-expanded=true] { background: var(--brand-soft); }
.gl-pop { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); white-space: nowrap; padding: 6px 10px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: .88rem; font-style: normal; z-index: 5; box-shadow: var(--shadow-lg); animation: rise .2s var(--ease); }
.glossary { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; margin: 0; }
.glossary div { padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.glossary dt { font-weight: 700; } .glossary dd { margin: 0; color: var(--muted); }
.transcript { text-align: left; }
.task h2 { font: 650 1.3rem/1.25 var(--display); }
.reqs { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; }
.reqs li { display: flex; gap: 8px; align-items: center; color: var(--muted); }
.reqs li .ico { color: var(--line-2); }
.reqs li.ok { color: var(--ok); } .reqs li.ok .ico { color: var(--ok); }
.reqs li.no { color: var(--bad); } .reqs li.no .ico { color: var(--bad); }
.issues { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.issues li { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.issues p { margin: 0 0 4px; }
.issues p:not(.small) { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.issues s { color: var(--bad); }
.model summary { cursor: pointer; font-weight: 700; }
.model p { margin-top: 10px; }
.repeat { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.repeat li { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.rp-target { font-weight: 700; font-size: 1.08rem; }
.mic.rec { background: var(--bad); color: #fff; border-color: var(--bad); animation: recPulse 1.2s infinite; }
.said { color: var(--ink-2); font-style: italic; margin-top: 8px; }
.diff .hit { color: var(--ok); font-weight: 700; }
.diff .miss { color: var(--bad); font-weight: 700; text-decoration: underline wavy; text-underline-offset: 4px; }
.speak-fb { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 10px; }
.speak-fb li { display: grid; grid-template-columns: 110px 1fr; gap: 4px 12px; align-items: center; }
.speak-fb li .small { grid-column: 2; color: var(--muted); }
.rec-play audio { width: 100%; margin: 6px 0; }
.transcript-live { color: var(--muted); font-style: italic; }
.task-p { font-size: 1.15rem; }

/* progress */
.kpis { grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr)); }
.exam-report h2 { margin-top: 18px; } .exam-report h2:first-child { margin-top: 0; }
.kpi { display: flex; flex-direction: column; gap: 2px; margin: 0; }
.kpi .ico { color: var(--brand); width: 24px; height: 24px; }
.kpi b { font: 700 1.8rem/1.15 var(--display); letter-spacing: -.03em; }
.kpi span { color: var(--muted); font-size: .86rem; }
.chart { margin: 0; }
.chart-scroll { overflow-x: auto; }
.chart svg { width: 100%; min-width: 420px; height: auto; display: block; }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .goal-line { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .goal-lbl { fill: var(--accent-ink); font-size: 11px; font-weight: 700; }
.chart .bar-r { fill: color-mix(in srgb, var(--brand) 55%, var(--surface)); }
.chart .bar-r.met { fill: var(--brand); }
.chart .hit { fill: transparent; }
.chart .bar-g:hover .hit { fill: color-mix(in srgb, var(--brand) 8%, transparent); }
.chart .val { fill: var(--ink-2); font-size: 11px; font-weight: 700; }
.chart .tick { fill: var(--muted); font-size: 11px; }
.chart .tick.today { fill: var(--ink); font-weight: 700; }
.tbl-toggle summary { cursor: pointer; color: var(--muted); font-size: .88rem; margin-top: 8px; }
.level-bars { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.level-bars a { display: grid; grid-template-columns: 44px minmax(90px, 160px) 1fr 44px; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.level-bars a:hover { background: var(--surface-2); }
.level-bars li.cur a { background: var(--brand-soft); }
.level-bars .small { text-align: right; }
@media (max-width: 520px) { .level-bars a { grid-template-columns: 44px 1fr 44px; } .level-bars a > span:nth-child(2) { display: none; } }
.achs { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.achs li { display: flex; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); }
.achs li:not(.got) b { color: var(--ink-2); font-weight: 400; }
.achs li.got { opacity: 1; background: var(--lime-soft); }
.achs li > .ico { width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: var(--surface); color: var(--muted); }
.achs li.got > .ico { background: var(--lime); color: var(--on-lime); }
.achs span { display: grid; } .achs small { color: var(--muted); font-size: .8rem; }

/* profile & settings */
.profile-top { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.avatar { display: grid; place-items: center; width: 64px; height: 64px; border-radius: var(--r); background: var(--ink); color: var(--bg); font: 700 1.8rem/1 var(--display); }
.grow { flex: 1; min-width: 220px; }
fieldset { border: 0; padding: 0; margin: 0 0 18px; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 14px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); font-weight: 600; font-size: .94rem; transition: background var(--t), border-color var(--t), color var(--t); }
.seg input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.seg input:focus-visible + span { outline: 3px solid var(--brand); outline-offset: 2px; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.file-btn { position: relative; overflow: hidden; margin-top: 8px; }
.export-box { margin-top: 10px; font-family: ui-monospace, monospace !important; font-size: .75rem !important; min-height: 100px; }
.col-side .btn { margin-top: 6px; }

/* mistakes */
.mk-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.mk-list li { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.mk-list p { margin: 0 0 4px; }
.mk-list p:not(.small) { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.mk-list s { color: var(--bad); }
.mk-list.cat { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.mk-list li:target { outline: 3px solid var(--brand); }
.q-small { font-weight: 700; }

/* class exercises */
.marks { list-style: none; padding: 0; display: grid; gap: 8px; }
.marks li { display: flex; gap: 10px; align-items: center; }
.marks i { width: 18px; height: 18px; border-radius: 5px; flex: none; }
.pista { background: var(--brand-soft); border-radius: 12px; padding: 10px 14px; margin: 8px 0 14px; }
.pista div { margin-top: 2px; }
.ln { margin: 8px 0; }
.ln small { display: flex; gap: 4px; align-items: center; min-height: 1.4em; font-size: .86rem; color: var(--muted); margin-top: 3px; }
.ln small.ok { color: var(--ok); } .ln small.no { color: var(--bad); }
.sum { font-weight: 700; margin: 12px 0 0; }
.verbs .cv { font: inherit; width: 100%; min-height: 32px; border: 0; border-radius: 8px; background: var(--surface-3); color: var(--muted); cursor: pointer; }

/* welcome */
.welcome { max-width: 640px; margin: 0 auto; text-align: center; padding-top: 10px; }
.brand-big { display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 22px; background: var(--brand); color: var(--on-brand); margin-bottom: 10px; }
.brand-big .ico { width: 40px; height: 40px; }
.welcome .eyebrow { justify-content: center; }
.onboard { text-align: left; margin-top: 18px; }
.ob-choices { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; border-radius: var(--r); border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, transform .15s; }
.choice:hover { border-color: var(--brand); transform: translateY(-2px); }
.choice .ico { width: 28px; height: 28px; color: var(--brand); }
.choice b { font-size: 1.08rem; } .choice span { color: var(--muted); font-size: .9rem; }
.choice.primary { border-color: var(--brand); background: var(--brand-soft); }
.seo-fallback { max-width: 720px; margin: 0 auto; }

/* search */
.search-dlg { width: min(640px, calc(100vw - 24px)); max-height: min(78vh, 720px); margin: 8vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.search-dlg::backdrop { background: rgb(22 42 58 / .5); }
.search-dlg[open] { display: flex; flex-direction: column; animation: rise .22s var(--ease); }
.search-form { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 16px; border-bottom: 1px solid var(--line); }
.search-form > .ico { color: var(--muted); }
.search-form input { border: 0 !important; box-shadow: none !important; padding: 8px 4px !important; }
.search-results { overflow-y: auto; padding: 10px 16px 16px; }
.search-results h3 { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 12px 0 6px; }
.search-results ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.search-results a { display: grid; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a:focus-visible { background: var(--brand-soft); }
.search-results a span { color: var(--muted); font-size: .86rem; }

/* toasts */
.toasts { position: fixed; z-index: 60; left: 50%; top: calc(var(--top) + env(safe-area-inset-top, 0px) + 12px); transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100vw - 32px)); pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-12px); transition: opacity .3s var(--ease), transform .3s var(--ease); }
.toast.in { opacity: 1; transform: none; }
.toast .ico { color: var(--lime); }

/* motion */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes pulse { 50% { transform: scale(1.12); } }
@keyframes flipIn { from { opacity: .3; transform: rotateX(12deg) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes recPulse { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--bad) 25%, transparent); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .bar i, .ses-bar i { background: Highlight; } .opt.ok, .opt.no { border-width: 4px; }
}

/* ——— Account (Sign in with Google + sync) ——— */
.google-btn { background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.google-btn:hover { background: var(--surface-2); }
.google-btn .g-logo { width: 20px; height: 20px; flex: none; }
.google-btn.sm { min-height: 40px; padding: 8px 14px; font-size: .95rem; }
.account h2 { margin-bottom: 10px; }
.account .google-btn { margin: 4px 0 8px; }
.acct { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.acct .grow { display: flex; flex-direction: column; min-width: 0; }
.acct .grow span { overflow: hidden; text-overflow: ellipsis; }
.acct-photo { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.avatar.sm { width: 44px; height: 44px; border-radius: 50%; font-size: 1.2rem; flex: none; }
.acct-status { display: flex; align-items: center; gap: 6px; }
.acct-status .ico { width: 16px; height: 16px; color: var(--ok); }
.acct-nudge { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; }
.acct-nudge > .ico { color: var(--brand); flex: none; }
.acct-nudge p { display: flex; flex-direction: column; margin: 0; min-width: 180px; }
.ob-account { margin-top: 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ob-account p { margin: 0; }

/* ═════════ Home page (Editorial Learning Studio) ═════════ */
body:has(.landing) .side-nav, body:has(.landing) .bottom-nav, body:has(.landing) .search-btn, body:has(.landing) .speed-chip { display: none; }
body:has(.landing) .layout { display: block; }
body:has(.landing) main { padding-bottom: 40px; }
.land-nav { display: none; gap: 2px; margin-right: 8px; }
.land-nav button { font: 500 .95rem/1 var(--font); color: var(--ink-2); background: none; border: 0; padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; transition: background var(--t), color var(--t); }
.land-nav button:hover { background: var(--surface); color: var(--ink); }
@media (min-width: 900px) { .land-nav { display: flex; } }
.top-stats .btn.sm { white-space: nowrap; }
.nb { white-space: nowrap; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
.mark-lime { background: linear-gradient(transparent 64%, var(--lime) 64%, var(--lime) 92%, transparent 92%); padding: 0 .06em; }
:root[data-theme="dark"] .mark-lime { background: linear-gradient(transparent 82%, var(--lime) 82%, var(--lime) 94%, transparent 94%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mark-lime { background: linear-gradient(transparent 82%, var(--lime) 82%, var(--lime) 94%, transparent 94%); } }
.linkish { font: inherit; font-weight: 600; color: var(--brand-ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.landing { padding-top: var(--s3); }
.land-hero { display: grid; gap: var(--s5); align-items: start; padding-bottom: var(--s6); }
.lh-text h1 { font: 800 clamp(2.5rem, 7.2vw, 4.6rem)/1.02 var(--display); letter-spacing: -.045em; margin: 0 0 var(--s3); max-width: 13ch; }
.lh-text h1 .serif { font-size: 1.06em; letter-spacing: -.02em; }
.lh-text .lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); line-height: 1.6; max-width: 46ch; color: var(--ink-2); margin-bottom: var(--s4); }
.lh-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.lh-ctas.center { justify-content: center; }
.lh-alt { margin: var(--s2) 0 0; color: var(--muted); }
@media (min-width: 980px) { .land-hero { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s6); padding: var(--s6) 0 var(--s7); } .lh-text { padding-top: var(--s5); } }
@media (max-width: 520px) { .lh-ctas .btn { width: 100%; } }

/* Demo: a real window onto a grammar card */
.demo { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); overflow: hidden; }
.demo-bar { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.demo-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.demo-where { margin-left: 8px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.demo-body { padding: var(--s3); }
.demo-sent { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin: 4px 0 var(--s2); }
.demo-q { margin: var(--s2) 0 10px; }
.demo-opts { display: grid; gap: 8px; }
.demo-opts .opt { min-height: 52px; font-size: 1.02rem; }
.demo-fb { margin-top: 12px; }
.fb-line { display: block; line-height: 1.55; padding: 12px 14px; border-radius: var(--r-sm); margin: 0 0 10px; font-size: .95rem; }
.fb-line .ico { width: 18px; height: 18px; vertical-align: -3px; margin-right: 4px; }
.fb-line.ok { background: var(--ok-soft); color: var(--ink); } .fb-line.ok .ico, .fb-line.ok b { color: var(--ok); }
.fb-line.no { background: var(--bad-soft); color: var(--ink); } .fb-line.no .ico, .fb-line.no b { color: var(--bad); }
.demo-transform { padding-top: 4px; border-top: 1px dashed var(--line-2); animation: rise .2s var(--ease); }
.tf-note { position: relative; padding-left: 32px; line-height: 1.5; font-size: .92rem; color: var(--ink-2); margin: 14px 0 6px; }
.tf-arrow { position: absolute; left: 0; top: 0; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--coral-soft); color: var(--coral-ink); flex: none; transform: rotate(90deg); }
.tf-arrow .ico { width: 14px; height: 14px; }

/* Linguistic annotations: words carry their grammatical role underneath */
.ann-line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px 10px; margin: 0; font: 700 clamp(1.5rem, 3.4vw, 2rem)/1.2 var(--display); letter-spacing: -.03em; padding-bottom: 22px; }
.ann-line .w { position: relative; display: inline-block; }
.ann-line .w[data-tag]::after { content: attr(data-tag); position: absolute; left: 0; top: calc(100% + 6px); white-space: nowrap; font: 600 .66rem/1 var(--font); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding-top: 5px; border-top: 2px solid var(--line-2); min-width: 100%; }
.ann-line .verb { color: var(--brand); }
.ann-line .verb[data-tag]::after { border-top-color: var(--brand); color: var(--brand-ink); }
.ann-line .s-mark { color: var(--coral-ink); background: var(--coral-soft); border-radius: 3px; padding: 0 1px; }
.solved .ann-line .s-mark { text-decoration: line-through; text-decoration-thickness: 3px; }
.ann-line .aux { background: var(--brand); color: var(--on-brand); border-radius: 6px; padding: 0 .18em; }
.ann-line .aux[data-tag]::after { border-top-color: var(--brand); color: var(--brand-ink); }
.ann-line .base-form { box-shadow: inset 0 -.22em 0 var(--lime); color: var(--ink); }
.ann-line .base-form[data-tag]::after { border-top-color: var(--lime); color: var(--ink-2); }

/* Sections */
.land-sec { padding: var(--s6) 0; border-top: 1px solid var(--line); }
.sec-head { max-width: 640px; margin-bottom: var(--s4); }
.sec-head h2 { font: 800 clamp(1.8rem, 4vw, 2.7rem)/1.06 var(--display); letter-spacing: -.04em; margin-bottom: 12px; }
.sec-head .muted { font-size: 1.05rem; margin: 0; }
@media (min-width: 980px) {
  .route-sec, .lesson-sec, .practice-sec { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--s5); align-items: start; }
  .route-sec .sec-head, .lesson-sec .sec-head, .practice-sec .sec-head { position: sticky; top: calc(var(--top) + 24px); }
}

/* Route A1 → C1: one line, five stops */
.route { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.route::before { content: ""; position: absolute; left: 27px; top: 28px; bottom: 28px; width: 2px; background: var(--ink); }
.stop { position: relative; display: grid; grid-template-columns: 56px 1fr; column-gap: 18px; align-items: center; align-content: start; padding: 10px 0; }
.stop-code { grid-row: span 2; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--bg); border: 2px solid var(--ink); font: 800 1.05rem/1 var(--display); letter-spacing: -.02em; position: relative; z-index: 1; }
.stop:first-child .stop-code { background: var(--lime); color: var(--on-lime); }
.stop-name { font: 700 1.25rem/1.2 var(--display); letter-spacing: -.02em; }
.stop-meta { color: var(--muted); font-size: .92rem; }
.stop-tag { grid-column: 2; justify-self: start; margin-top: 6px; font-size: .75rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--lime); color: var(--on-lime); }
.stop-tag.paid { background: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
@media (min-width: 760px) {
  .route { grid-template-columns: repeat(5, 1fr); gap: 12px; }
  .route::before { display: none; }
  .stop:not(:last-child)::before { content: ""; position: absolute; left: 56px; right: -12px; top: 27px; height: 2px; background: var(--ink); }
  .stop { grid-template-columns: 1fr; row-gap: 6px; align-items: start; padding: 0; }
  .stop-code { grid-row: auto; margin-bottom: 8px; }
  .stop-tag { grid-column: 1; }
}

/* Lesson steps */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 64px 1fr; column-gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.steps li:last-child { border-bottom: 0; }
.step-n { grid-row: span 2; font: 800 1.9rem/1 var(--display); letter-spacing: -.05em; color: var(--brand); font-variant-numeric: tabular-nums; }
.steps b { font: 700 1.15rem/1.3 var(--display); letter-spacing: -.015em; }
.steps li > span:last-child { color: var(--muted); }

/* Practice: editorial list, the English skill name carries the weight */
.skills-list { margin: 0; display: grid; gap: 0 var(--s4); }
.skills-list div { padding: 18px 0; border-bottom: 1px solid var(--line); }
.skills-list dt { display: flex; align-items: center; gap: 10px; font: 800 clamp(1.35rem, 2.6vw, 1.7rem)/1.1 var(--display); letter-spacing: -.035em; margin-bottom: 4px; }
.skills-list dt .ico { width: 22px; height: 22px; color: var(--brand); }
.skills-list dd { margin: 0; color: var(--muted); }
@media (min-width: 640px) { .skills-list { grid-template-columns: 1fr 1fr; } }

/* Method band: ink surface, full bleed */
.land-band { margin: 0 calc(50% - 50vw); padding: var(--s7) calc(50vw - 50%); background: var(--deep); color: var(--on-deep); }
.band-in { max-width: var(--wrap); margin: 0 auto; display: grid; gap: var(--s5); align-items: center; }
@media (min-width: 900px) { .band-in { grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: var(--s6); } }
@media (max-width: 520px) { .land-band { padding-top: var(--s6); padding-bottom: var(--s6); } }
.land-band .eyebrow { color: var(--lime); }
.land-band h2 { font: 800 clamp(1.8rem, 4vw, 2.7rem)/1.06 var(--display); letter-spacing: -.04em; color: var(--on-deep); }
.land-band p { color: var(--on-deep-2); font-size: 1.05rem; max-width: 52ch; }
.principles { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: 10px; }
.principles li { position: relative; padding-left: 28px; color: var(--on-deep-2); }
.principles li::before { content: ""; position: absolute; left: 0; top: .62em; width: 14px; height: 4px; border-radius: 2px; background: var(--lime); }
.principles b { color: var(--on-deep); }
.contrast-fig { margin: 0; padding: var(--s4); border-radius: var(--r-lg); background: rgb(255 255 255 / .05); border: 1px solid rgb(255 255 255 / .12); }
.contrast-fig p { margin: 0 0 14px; font: 700 clamp(1.3rem, 2.8vw, 1.75rem)/1.25 var(--display); letter-spacing: -.025em; color: var(--on-deep); display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; max-width: none; }
.contrast-fig .cf-es { font: 500 1rem/1.4 var(--font); color: var(--on-deep-2); letter-spacing: 0; }
.contrast-fig .flag-es { color: var(--on-deep-2); border-color: rgb(255 255 255 / .25); }
.cf-tag { font: 700 .7rem/1 var(--font); letter-spacing: .06em; text-transform: uppercase; padding: 5px 7px; border-radius: 4px; background: var(--coral); color: #162a3a; transform: translateY(-3px); }
.cf-tag.ok { background: var(--lime); }
.cf-no s { text-decoration-color: var(--coral); text-decoration-thickness: 3px; color: var(--on-deep-2); }
.hl-coral { color: var(--coral); }
.hl-lime { box-shadow: inset 0 -.3em 0 color-mix(in srgb, var(--lime) 70%, transparent); }
.contrast-fig figcaption { font-size: .95rem; color: var(--on-deep-2); padding-top: 14px; border-top: 1px solid rgb(255 255 255 / .12); }
.contrast-fig figcaption strong, .contrast-fig figcaption em { color: var(--on-deep); }

body:has(.landing) .topbar { padding-inline: max(16px, calc((100% - var(--wrap)) / 2)); }
.final-sec { text-align: center; border-top: 0; padding-bottom: var(--s4); }
.final-sec h2 { font: 800 clamp(1.9rem, 4.4vw, 3rem)/1.05 var(--display); letter-spacing: -.045em; margin-bottom: 10px; }
.final-sec .ob-account { margin-top: var(--s4); }

@media (prefers-reduced-motion: reduce) { .demo-transform { animation: none; } }

/* ═════════ Full course (premium) ═════════ */
.btn.block { width: 100%; justify-content: center; }
.prem { display: grid; gap: var(--s5); padding: var(--s3) 0 var(--s4); align-items: start; }
@media (min-width: 900px) { .prem { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s6); padding-top: var(--s5); } }
.prem h1 { font: 800 clamp(2rem, 5vw, 3.2rem)/1.04 var(--display); letter-spacing: -.045em; margin: 0 0 var(--s2); max-width: 16ch; }
.prem .lead { font-size: 1.1rem; line-height: 1.6; color: var(--ink-2); max-width: 46ch; }
.prem .fb-line { max-width: 52ch; }
.prem-levels { list-style: none; margin: var(--s4) 0 0; padding: 0; }
.prem-levels li { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.prem-levels li:last-child { border-bottom: 0; }
.prem-levels .stop-code { width: 48px; height: 48px; font-size: .95rem; flex: none; }
.prem-levels li > span:last-child { display: grid; gap: 2px; }
.prem-levels b { font: 700 1.15rem/1.2 var(--display); letter-spacing: -.02em; }
.prem-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s4); display: grid; gap: 12px; }
@media (min-width: 900px) { .prem-card { position: sticky; top: calc(var(--top) + 24px); } }
.prem-card p { margin: 0; }
.prem-card .can { margin: 6px 0 8px; }
.prem-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.prem-price b { font: 800 2.6rem/1 var(--display); letter-spacing: -.05em; }
.prem-price span { color: var(--muted); font-weight: 500; }
.prem-amount { border: 0; margin: 4px 0 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.prem-amount legend { font-weight: 700; font-size: .95rem; padding: 0; margin-bottom: 8px; }
.prem-amount .seg span { font-variant-numeric: tabular-nums; }
.prem-amount .seg.picks { display: grid; grid-template-columns: repeat(4, 1fr); }
.prem-amount .seg.picks span { width: 100%; justify-content: center; padding-inline: 4px; }
.prem-other { margin: 4px 0 0; }
.prem-restore { margin: 0; }
.admin-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 0 32px; margin: var(--s4) 0; }
.admin-sum div { border-top: 1px solid var(--line); padding: 14px 0; }
.admin-sum dt { font-size: .85rem; color: var(--muted); font-weight: 600; }
.admin-sum dd { margin: 4px 0 0; }
.admin-sum b { font: 800 1.8rem/1.1 var(--display); letter-spacing: -.03em; margin-right: 6px; }
.tbl { overflow-x: auto; }
.prem-other .small { font-weight: 500; color: var(--muted); }
.prem-card [data-buy][disabled] { opacity: .55; cursor: not-allowed; }
.prem-safe { display: flex; gap: 6px; align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--line); }
.prem-safe .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.prem-free { margin: 0 0 var(--s4); }
.prem-done { grid-template-columns: 1fr !important; padding: var(--s6) 0; }
.prem-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-color: var(--lime); background: color-mix(in srgb, var(--lime) 14%, var(--surface)); }
.prem-banner > .ico { color: var(--ink); flex: none; }
.prem-banner p { margin: 0; display: grid; gap: 2px; min-width: 200px; }

/* ——— Public level pages (/english-a1/ …) ——— */
.seo-page { max-width: 980px; }
.seo-head { padding: var(--s3) 0 var(--s4); }
.seo-head h1 { font: 800 clamp(2.6rem, 7vw, 4.4rem)/1 var(--display); letter-spacing: -.04em; margin: 4px 0 18px; }
.seo-focus { font: 600 clamp(1.15rem, 2.4vw, 1.45rem)/1.4 var(--display); letter-spacing: -.015em; max-width: 44ch; margin: 0 0 14px; }
.seo-facts { color: var(--ink-2); font-size: .95rem; margin: 0 0 22px; }
.seo-ctas { display: flex; gap: 10px; flex-wrap: wrap; margin: 0; }
.seo-split { display: grid; gap: 24px 48px; padding: var(--s4) 0; border-top: 1px solid var(--line); }
@media (min-width: 760px) { .seo-split { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }
.seo-units { list-style: none; margin: 0; padding: 0; }
.seo-units li { display: grid; grid-template-columns: 56px 1fr; gap: 6px 16px; padding: 18px 0; border-bottom: 1px solid var(--line); }
.seo-units li:last-child { border-bottom: 0; }
.su-n { font: 800 1.5rem/1.2 var(--display); color: var(--brand); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.seo-units h3 { margin: 0 0 6px; font: 700 1.2rem/1.3 var(--display); letter-spacing: -.015em; }
.seo-units h3 small { font: 500 .95rem var(--font); color: var(--muted); margin-left: 6px; }
.seo-units p { margin: 0 0 4px; max-width: 70ch; }
.seo-topics { margin: 0; display: grid; gap: 0 40px; }
@media (min-width: 760px) { .seo-topics { grid-template-columns: 1fr 1fr; } }
.seo-topics > div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.seo-topics dt { font: 700 1.05rem/1.3 var(--display); margin-bottom: 4px; }
.seo-topics dd { margin: 0; color: var(--ink-2); font-size: .95rem; }
.seo-ct { display: block; margin-top: 6px; font-size: .92rem; }
.seo-ct s { color: var(--bad); }
.seo-words { list-style: none; margin: 0; padding: 0; columns: 3 180px; column-gap: 32px; }
.seo-words li { break-inside: avoid; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: .95rem; display: flex; justify-content: space-between; gap: 10px; }
.seo-words li span { color: var(--muted); text-align: right; }
.seo-note { border-top: 1px solid var(--line); padding-top: 18px; margin-top: var(--s4); }
.nowrap { white-space: nowrap; }
