/* ==========================================================================
   DEUTSCH MASTER — design system
   Paper, ink, one German red for the route, Reclam yellow for achievement.
   der / die / das = blue / red / green, as in German classrooms.
   ========================================================================== */
:root {
  --paper: #F6F6F3; --surface: #FFFFFF; --surface-2: #F0F0EC; --surface-3: #E7E7E1;
  --ink: #1C1E23; --ink-2: #525763; --ink-3: #7C818C; --line: rgba(28,30,35,.12); --line-strong: rgba(28,30,35,.22);
  --red: #C8102E; --red-ink: #A10C24; --red-soft: #FBE8EB;
  --yellow: #F2C200; --yellow-ink: #7A5E00; --yellow-soft: #FFF5D1;
  --green: #1E8A5A; --green-soft: #E3F3EA;
  --blue: #1F5FAD; --blue-soft: #E7EFF9;
  --violet: #6B4BC6; --violet-soft: #EFEAFB;
  --amber: #C98A00;
  --der: #1F5FAD; --die: #C8102E; --das: #1E8A5A;
  --r-lg: 22px; --r-md: 16px; --r-sm: 11px;
  --shadow-1: 0 1px 2px rgba(28,30,35,.06); --shadow-2: 0 1px 2px rgba(28,30,35,.05), 0 14px 32px -18px rgba(28,30,35,.28);
  --f-display: "Literata", "Noto Sans Arabic", "Iowan Old Style", Georgia, serif;
  --f-ui: "Barlow", "Noto Sans Arabic", "Segoe UI", system-ui, -apple-system, sans-serif;
  --topbar-h: 60px;
  /* aliases used by markup generated in the original app */
  --navy: var(--blue); --terracotta: var(--red); --teal: var(--green); --gold: #D9A400; --limoncello: var(--yellow);
  --pink-accent: var(--violet); --ok-green: var(--green); --err-red: var(--red); --cream-deep: var(--surface-2);
  --bg: var(--paper); --fg: var(--ink); --border: var(--line); --radius-card: var(--r-lg);
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #121418; --surface: #1B1E24; --surface-2: #23272F; --surface-3: #2D323B;
    --ink: #ECEDEF; --ink-2: #AEB3BD; --ink-3: #868C97; --line: rgba(255,255,255,.11); --line-strong: rgba(255,255,255,.22);
    --red: #F0435A; --red-ink: #FF7A8B; --red-soft: #3A1A21; --yellow: #F5CB2A; --yellow-ink: #F5CB2A; --yellow-soft: #3A3113;
    --green: #3DB57F; --green-soft: #173327; --blue: #5B97E5; --blue-soft: #1A2A40; --violet: #9C84F0; --violet-soft: #2A2342;
    --der: #5B97E5; --die: #F0435A; --das: #3DB57F; color-scheme: dark;
    --shadow-2: 0 1px 2px rgba(0,0,0,.3), 0 18px 36px -20px rgba(0,0,0,.7);
  }
}
:root[data-theme="dark"] {
  --paper: #121418; --surface: #1B1E24; --surface-2: #23272F; --surface-3: #2D323B;
  --ink: #ECEDEF; --ink-2: #AEB3BD; --ink-3: #868C97; --line: rgba(255,255,255,.11); --line-strong: rgba(255,255,255,.22);
  --red: #F0435A; --red-ink: #FF7A8B; --red-soft: #3A1A21; --yellow: #F5CB2A; --yellow-ink: #F5CB2A; --yellow-soft: #3A3113;
  --green: #3DB57F; --green-soft: #173327; --blue: #5B97E5; --blue-soft: #1A2A40; --violet: #9C84F0; --violet-soft: #2A2342;
  --der: #5B97E5; --die: #F0435A; --das: #3DB57F; color-scheme: dark;
  --shadow-2: 0 1px 2px rgba(0,0,0,.3), 0 18px 36px -20px rgba(0,0,0,.7);
}
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--topbar-h) + 12px); -webkit-text-size-adjust: 100%; }
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink); font-family: var(--f-ui); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body[dir="rtl"] { font-family: var(--f-ui); }
body.has-overlay { overflow: hidden; }
img, svg { max-width: 100%; }
a { color: var(--blue); }
h1, h2, h3 { margin: 0; }
p { margin: 0 0 .7em; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.skip-link:focus { top: 12px; }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }
.de-word, .de-text { font-family: var(--f-display); font-feature-settings: "kern"; }
.de-word { font-weight: 500; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- type scale ---------- */
.display { font-family: var(--f-display); font-weight: 600; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.1; letter-spacing: -0.015em; }
.page-title { font-family: var(--f-display); font-weight: 600; font-size: clamp(28px, 3.6vw, 38px); line-height: 1.12; letter-spacing: -0.01em; }
.lead { font-size: 18px; color: var(--ink-2); margin-top: 8px; max-width: 62ch; }
.page-sub { color: var(--ink-2); margin-top: 6px; max-width: 62ch; }
.section-h { font-family: var(--f-display); font-weight: 600; font-size: 22px; margin: 34px 0 12px; display: flex; align-items: center; gap: 10px; }
.panel-title { font-family: var(--f-ui); font-weight: 700; font-size: 17px; margin-bottom: 14px; }
.prose { max-width: 68ch; font-size: 17px; line-height: 1.65; }
.prose b { font-weight: 700; } .prose i { font-family: var(--f-display); font-style: italic; }
.text-link { display: inline-block; margin-top: 10px; font-weight: 600; color: var(--blue); text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.note { background: var(--blue-soft); color: var(--ink); border-radius: var(--r-sm); padding: 10px 14px; font-size: 14px; margin: 12px 0 20px; }
.count-tag { font-family: var(--f-ui); font-size: 14px; font-weight: 600; color: var(--ink-3); }

/* ---------- buttons ---------- */
.btn { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); font-family: var(--f-ui); font-weight: 600; font-size: 15px; line-height: 1.2; padding: 11px 18px; min-height: 44px; border-radius: 999px; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, transform .12s; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn.primary:hover { background: #000; }
:root[data-theme="dark"] .btn.primary:hover { background: #fff; }
.btn.accent, .btn.terra { background: var(--red); color: #fff; border-color: var(--red); }
.btn.accent:hover, .btn.terra:hover { background: var(--red-ink); border-color: var(--red-ink); }
.btn.teal { background: var(--green); color: #fff; border-color: var(--green); }
.btn.ghost { background: transparent; }
.btn.ghost.light { color: #fff; border-color: rgba(255,255,255,.5); }
.btn.big { font-size: 16px; padding: 14px 24px; min-height: 52px; }
.btn.small, .btn.ghost.small { font-size: 13.5px; padding: 7px 14px; min-height: 36px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.icon-btn:hover { border-color: var(--ink); }
.row-gap { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.row-gap.center { justify-content: center; }
.row-gap.between { justify-content: space-between; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 60; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 20px; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand-mark { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 6px solid var(--red); display: inline-block; flex-shrink: 0; box-shadow: inset 0 0 0 2px var(--surface); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--f-display); font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.brand-tag { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.topbar-spacer { flex: 1; }
.pub-links { display: flex; gap: 4px; }
.pub-links a { text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.pub-links a:hover, .pub-links a.active { color: var(--ink); background: var(--surface-2); }
.top-controls { display: flex; align-items: center; gap: 8px; }
.search-trigger { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px 0 14px; min-width: 220px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-3); border-radius: 999px; cursor: pointer; font: 500 14.5px var(--f-ui); }
.search-trigger:hover { border-color: var(--line-strong); color: var(--ink-2); }
.search-trigger kbd { margin-inline-start: auto; font: 600 11px var(--f-ui); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; color: var(--ink-3); }
.mode-public .app-only, .mode-app .public-only { display: none !important; }
.auth-btn.logged-in { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 700; font-size: 13px; }
.theme-toggle { width: 40px; height: 40px; }

/* dropdowns (existing components) */
.dd { position: relative; }
.dd-trigger { height: 40px; padding: 0 12px; display: flex; align-items: center; gap: 6px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; cursor: pointer; font: 600 14px var(--f-ui); max-width: 210px; }
.dd-trigger:hover { border-color: var(--line-strong); }
.dd-trigger span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-caret { font-size: 10px; color: var(--ink-3); transition: transform .15s; }
.dd.open .dd-caret { transform: rotate(180deg); }
.dd-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 210px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 6px; display: none; z-index: 80; }
.dd.open .dd-menu { display: block; animation: ddPop .14s ease; }
@keyframes ddPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dd-option { padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 14.5px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.dd-option:hover { background: var(--surface-2); }
.dd-option.selected { background: var(--ink); color: var(--paper); }
.dd-option-count { color: inherit; opacity: .6; font-weight: 500; }
.deck-slot { display: none; }
body[data-view="flash"] .deck-slot, body[data-view="quiz"] .deck-slot, body[data-view="words"] .deck-slot { display: block; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.mode-public .shell { display: block; }
.sidenav { position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); overflow-y: auto; padding: 22px 14px; border-inline-end: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.mode-public .sidenav { display: none; }
.nav-group-label { font-size: 13px; font-weight: 600; color: var(--ink-3); padding: 16px 12px 6px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; position: relative; }
.nav-link .ni { width: 22px; text-align: center; font-size: 16px; }
.nav-link:hover { background: var(--surface-2); color: var(--ink); }
.nav-link.active { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-1); }
.nav-link.active::before { content: ""; position: absolute; inset-inline-start: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--red); }
.nav-sub { padding-inline-start: 46px; font-weight: 500; font-size: 14.5px; }
.nav-sub.active { box-shadow: none; background: transparent; color: var(--red-ink); font-weight: 700; }
.nav-sub.active::before { display: none; }
.sidenav-foot { margin-top: auto; padding: 18px 12px 0; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.sidenav-foot a { color: var(--ink-3); text-decoration: none; }
.sidenav-foot a:hover { color: var(--ink); }
main { outline: none; min-width: 0; }
.main-inner { max-width: 1080px; margin: 0 auto; padding: 30px 28px 110px; }
.mode-public .main-inner { max-width: 1180px; padding-top: 10px; }
.view { display: none; }
.view.active { display: block; animation: viewIn .22s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.subnav { display: none; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; margin-bottom: 8px; scrollbar-width: none; }
.subnav a { flex-shrink: 0; text-decoration: none; color: var(--ink-2); border: 1.5px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.subnav a.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.bottomnav { display: none; }

/* public footer */
.site-footer { border-top: 1px solid var(--line); padding: 34px 24px 110px; display: none; }
.mode-public .site-footer { display: block; }
.footer-inner { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 0; padding: 0; }
.footer-links a { color: var(--ink-2); text-decoration: none; font-weight: 600; }
.footer-links a:hover { color: var(--ink); }
.footer-note { color: var(--ink-3); font-size: 14px; max-width: 46ch; }

@media (max-width: 1100px) { .search-trigger { min-width: 0; } .search-trigger .st-label, .search-trigger kbd { display: none; } }
@media (max-width: 900px) {
  .shell { display: block; }
  .sidenav { display: none; }
  .brand-tag { display: none; }
  .pub-links { display: none; }
  .main-inner { padding: 20px 16px 120px; }
  .mode-app .bottomnav { display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; min-height: 52px; justify-content: center; text-decoration: none; color: var(--ink-3); font-size: 12.5px; font-weight: 600; border-radius: 12px; }
  .bottomnav a .ni { font-size: 20px; line-height: 1; }
  .bottomnav a.active { color: var(--ink); background: var(--surface-2); }
  body[data-section="learn"] .subnav-learn, body[data-section="practice"] .subnav-practice { display: flex; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom, 0px)) !important; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .brand-name { font-size: 16px; }
  .dd-trigger { padding: 0 10px; font-size: 13px; max-width: 120px; }
  .deck-slot .dd-trigger { max-width: 108px; }
  .mode-public .top-controls .pub-cta { display: none; }
}

/* ---------- shared components ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-1); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.meter { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--ink); border-radius: 999px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.meter-red span { background: var(--red); }
.prog-row { margin-bottom: 16px; }
.prog-label { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.prog-meta { color: var(--ink-3); font-weight: 500; font-size: 14px; }
.line-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 24px; padding: 0 7px; border-radius: 7px; background: var(--red); color: #fff; font: 700 13px var(--f-ui); letter-spacing: .02em; }
.lm-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.lm-badge.done { background: var(--green-soft); color: var(--green); }
.lm-badge.current { background: var(--red-soft); color: var(--red-ink); }
.lm-badge.locked { background: transparent; color: var(--ink-3); padding-inline: 0; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.word-chip { display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font-size: 15px; cursor: pointer; color: var(--ink); }
.word-chip:hover { border-color: var(--ink); }
.art-dot { width: 8px; height: 8px; border-radius: 50%; }
.art-dot.art-der { background: var(--der); } .art-dot.art-die { background: var(--die); } .art-dot.art-das { background: var(--das); }
.art-chip { display: inline-flex; align-items: center; justify-content: center; font: 700 13px var(--f-ui); padding: 3px 9px; border-radius: 7px; color: #fff; vertical-align: middle; }
.art-der { background: var(--der); } .art-die { background: var(--die); } .art-das { background: var(--das); }
.type-chip { display: inline-flex; align-items: center; font: 600 12.5px var(--f-ui); padding: 3px 9px; border-radius: 7px; background: var(--surface-2); color: var(--ink-2); vertical-align: middle; }
.mastery-pill { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.m-seen { background: var(--blue-soft); color: var(--blue); }
.m-learning { background: var(--violet-soft); color: var(--violet); }
.m-strong { background: var(--green-soft); color: var(--green); }
.m-mastered { background: var(--yellow-soft); color: var(--yellow-ink); }
.empty-state-card, .error-state, .locked-state { text-align: center; padding: 44px 24px; background: var(--surface); border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); max-width: 560px; margin: 10px auto; }
.empty-state-card h3, .error-state h2 { font-family: var(--f-display); font-weight: 600; font-size: 21px; margin-bottom: 6px; }
.empty-state-card p, .error-state p, .locked-state p { color: var(--ink-2); max-width: 44ch; margin: 0 auto 16px; }
.es-icon { font-size: 34px; margin-bottom: 8px; }
.locked-state { border-style: solid; }
.locked-state .row-gap { justify-content: center; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-3); margin-bottom: 18px; font-weight: 600; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.table-wrap { overflow-x: auto; margin: 10px 0 14px; }
table.pattern { border-collapse: separate; border-spacing: 0; min-width: 320px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.pattern th, .pattern td { padding: 10px 16px; text-align: start; border-bottom: 1px solid var(--line); font-size: 15.5px; }
.pattern thead th { background: var(--surface-2); font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.pattern tbody th { font-weight: 600; color: var(--ink-2); }
.pattern tbody tr:last-child > * { border-bottom: 0; }
.pattern td.de-word { font-size: 17px; }

/* ---------- landing ---------- */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; padding: 48px 0 64px; }
.hero-brand { display: flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 600; font-size: 20px; margin-bottom: 18px; }
.hero-title { font-family: var(--f-display); font-weight: 700; font-size: clamp(40px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -.025em; }
.hero-kicker { font-family: var(--f-display); font-size: clamp(20px, 2.2vw, 25px); line-height: 1.3; margin: 18px 0 12px; max-width: 30ch; }
.hero-lead { color: var(--ink-2); font-size: 18px; max-width: 52ch; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-visual { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 26px 26px 30px; box-shadow: var(--shadow-2); overflow: hidden; }
.line-sign { display: flex; align-items: center; gap: 12px; font-weight: 600; color: var(--ink-2); padding-bottom: 18px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.hero-line { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.hero-line::before { content: ""; position: absolute; inset-inline-start: 15px; top: 26px; bottom: 26px; width: 8px; border-radius: 8px; background: var(--red); }
.hl-stop { position: relative; display: flex; align-items: center; gap: 18px; padding: 16px 0; }
.hl-dot { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 6px solid var(--red); flex-shrink: 0; position: relative; z-index: 1; }
.hl-stop b { display: block; font-family: var(--f-display); font-size: 22px; font-weight: 600; }
.hl-stop span { color: var(--ink-2); font-size: 15px; }
.hl-emoji { margin-inline-start: auto; font-size: 22px; opacity: .9; }
.hl-train { position: absolute; inset-inline-start: 34px; top: 88px; width: 14px; height: 14px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--yellow); animation: ride 3.2s cubic-bezier(.45,.05,.3,1) .5s 1 forwards; opacity: 0; }
@keyframes ride { 0% { opacity: 0; transform: translateY(0); } 8% { opacity: 1; } 100% { opacity: 1; transform: translateY(var(--ride, 186px)); } }
.band { padding: 56px 0; border-top: 1px solid var(--line); }
.band-title { font-family: var(--f-display); font-weight: 600; font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.01em; }
.band-sub { color: var(--ink-2); font-size: 18px; margin: 8px 0 28px; max-width: 60ch; }
.caps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.cap { background: var(--surface); padding: 26px 24px; }
.cap-icon { font-size: 24px; display: block; margin-bottom: 12px; }
.cap h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.cap p { color: var(--ink-2); margin: 0; font-size: 15.5px; }
.band-split { display: grid; grid-template-columns: .8fr 1.2fr; gap: 40px; align-items: start; }
.route-list { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
.route-list li { break-inside: avoid; display: flex; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rl-num { font-weight: 700; color: var(--red); min-width: 26px; }
.rl-title { font-family: var(--f-display); font-size: 17px; }
.levels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; position: relative; }
.levels::before { content: ""; position: absolute; left: 24px; right: 24px; top: 24px; height: 6px; background: repeating-linear-gradient(90deg, var(--line-strong) 0 12px, transparent 12px 20px); border-radius: 6px; }
.lv { position: relative; display: flex; flex-direction: column; gap: 10px; padding-inline-end: 10px; }
.lv-badge { position: relative; z-index: 1; width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; background: var(--surface); border: 3px dashed var(--line-strong); color: var(--ink-3); }
.lv.avail .lv-badge { background: var(--red); border: 0; color: #fff; box-shadow: 0 0 0 6px var(--red-soft); }
.lv.avail::after { content: ""; position: absolute; left: 30px; right: 0; top: 24px; height: 6px; background: var(--red); border-radius: 6px; }
.lv b { display: block; font-size: 15.5px; }
.lv-status { display: block; font-size: 14px; color: var(--ink-3); font-weight: 600; }
.lv.avail .lv-status { color: var(--green); }
.band-cta { text-align: center; }
.band-cta .band-sub { margin-left: auto; margin-right: auto; }
.band-cta .hero-ctas { justify-content: center; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 24px; gap: 32px; }
  .caps { grid-template-columns: 1fr 1fr; }
  .band-split { grid-template-columns: 1fr; }
  .levels { grid-template-columns: 1fr; gap: 18px; }
  .levels::before { left: 24px; right: auto; top: 24px; bottom: 24px; width: 6px; height: auto; background: repeating-linear-gradient(180deg, var(--line-strong) 0 12px, transparent 12px 20px); }
  .lv { flex-direction: row; align-items: center; gap: 16px; }
  .lv.avail::after { display: none; }
}
@media (max-width: 560px) { .caps { grid-template-columns: 1fr; } .route-list { columns: 1; } }

/* public text pages */
.doc { max-width: 760px; }
.doc h1 { margin-bottom: 14px; }
.doc h2 { font-family: var(--f-display); font-weight: 600; font-size: 24px; margin: 36px 0 10px; }
.doc p, .doc li { font-size: 17px; line-height: 1.7; color: var(--ink); }
.doc ul { padding-inline-start: 22px; }
.doc .placeholder { background: var(--yellow-soft); padding: 1px 6px; border-radius: 5px; font-weight: 600; }
.doc .lead { margin-bottom: 20px; }
.faq details { border-bottom: 1px solid var(--line); padding: 4px 0; }
.faq summary { cursor: pointer; font-weight: 700; font-size: 18px; padding: 16px 0; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--ink-3); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 18px; color: var(--ink-2); }
.method-line { list-style: none; padding: 0; margin: 30px 0; position: relative; }
.method-line::before { content: ""; position: absolute; inset-inline-start: 19px; top: 20px; bottom: 20px; width: 8px; background: var(--red); border-radius: 8px; }
.method-line li { position: relative; padding-block: 0 30px; padding-inline: 66px 0; }
.method-line li::before { content: attr(data-n); position: absolute; inset-inline-start: 4px; top: 0; width: 38px; height: 38px; border-radius: 50%; background: var(--surface); border: 6px solid var(--red); font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.method-line h2 { margin: 2px 0 6px; }

/* ---------- dashboard ---------- */
.dash-hello { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 20px; margin-bottom: 26px; }
.habit { display: flex; gap: 12px; flex-wrap: wrap; }
.habit-item { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 16px 10px 10px; }
.habit-item b { display: block; font-size: 16px; }
.habit-item span { font-size: 13.5px; color: var(--ink-3); }
.ring { width: 44px; height: 44px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 7; }
.ring-fg { fill: none; stroke: var(--green); stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.streak-flame { font-size: 26px; width: 44px; text-align: center; filter: grayscale(1); opacity: .45; }
.streak-flame.lit { filter: none; opacity: 1; }
.journey { margin-bottom: 18px; }
.journey-head { display: flex; justify-content: space-between; align-items: baseline; }
.big-pct { font-family: var(--f-display); font-weight: 600; font-size: 34px; line-height: 1; }
.big-pct small { font-family: var(--f-ui); font-size: 14px; color: var(--ink-3); font-weight: 600; margin-inline-start: 6px; }
.journey-meta { color: var(--ink-3); font-size: 14.5px; margin: 14px 0 0; }
.mini-line { display: flex; align-items: flex-start; margin-top: 20px; position: relative; overflow-x: auto; padding: 4px 2px 2px; }
.mini-line::before { content: ""; position: absolute; left: 18px; right: 18px; top: 17px; height: 5px; background: var(--surface-3); border-radius: 5px; }
.ml-stop { flex: 1 0 40px; display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; position: relative; z-index: 1; }
.ml-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 4px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #fff; }
.ml-num { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.ml-stop.s-done .ml-dot { background: var(--red); border-color: var(--red); }
.ml-stop.s-current .ml-dot { border-color: var(--red); box-shadow: 0 0 0 5px var(--red-soft); width: 30px; height: 30px; margin-top: -2px; }
.ml-stop.s-current .ml-num { color: var(--red-ink); }
.ml-stop.s-open .ml-dot { border-color: var(--ink-3); }
.ml-final .ml-dot { border: 0; background: var(--surface-2); font-size: 15px; }
.ml-final.s-done .ml-dot { background: var(--yellow-soft); }
.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-bottom: 18px; }
.dash-grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.continue-card { position: relative; overflow: hidden; background: var(--ink); color: var(--paper); border-radius: var(--r-lg); padding: 28px; display: flex; flex-direction: column; align-items: flex-start; min-height: 250px; }
.continue-card::after { content: ""; position: absolute; inset-inline-end: -40px; bottom: -40px; width: 200px; height: 200px; border-radius: 50%; border: 14px solid var(--red); opacity: .9; }
.cc-eyebrow { font-weight: 600; font-size: 14.5px; opacity: .7; margin-bottom: 10px; }
.cc-title { font-family: var(--f-display); font-weight: 600; font-size: clamp(24px, 3vw, 32px); line-height: 1.15; max-width: 20ch; }
.cc-num { display: block; font-family: var(--f-ui); font-size: 15px; font-weight: 700; color: var(--yellow); margin-bottom: 4px; }
.cc-sub { opacity: .8; margin: 10px 0 22px; max-width: 42ch; }
.continue-card .btn { margin-top: auto; position: relative; z-index: 1; }
.cc-icon { position: absolute; inset-inline-end: 36px; bottom: 34px; font-size: 54px; z-index: 1; }
.today-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 6px; }
.today-row { display: flex; align-items: center; gap: 14px; width: 100%; background: var(--surface-2); border: 0; border-radius: 12px; padding: 10px 14px; text-align: start; font: 500 15px var(--f-ui); color: var(--ink); cursor: pointer; text-decoration: none; }
button.today-row:hover, a.today-row:hover { background: var(--surface-3); }
.today-row.muted { cursor: default; color: var(--ink-3); }
.tl-n { font-family: var(--f-display); font-weight: 600; font-size: 22px; min-width: 30px; }
.tl-n.zero { color: var(--ink-3); }
.insight { display: flex; align-items: center; gap: 18px; background: var(--yellow-soft); border-radius: var(--r-lg); padding: 18px 22px; margin-bottom: 18px; flex-wrap: wrap; }
.ins-icon { font-size: 28px; }
.ins-body { flex: 1; min-width: 220px; }
.ins-body p { margin: 0; font-size: 17px; font-weight: 600; }
.ins-list { margin: 6px 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 14.5px; }
.ins-list li::before { content: "↗ "; color: var(--green); font-weight: 700; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.timeline li:last-child { border-bottom: 0; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 15px; }
.tl-text { font-weight: 600; font-size: 15px; }
.tl-score { color: var(--green); font-weight: 700; margin-inline-start: 4px; }
.tl-time { color: var(--ink-3); font-size: 13.5px; }
.panel .empty-state-card { border: 0; padding: 12px 0; background: none; }
@media (max-width: 1000px) { .dash-grid3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) { .dash-grid, .dash-grid3 { grid-template-columns: 1fr; } .habit { width: 100%; } .habit-item { flex: 1; } }

/* ---------- course map ---------- */
.course-hero { display: flex; justify-content: space-between; gap: 28px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 28px; }
.eyebrow-line { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; }
.course-stat { min-width: 240px; display: grid; gap: 8px; }
.line-map { list-style: none; margin: 0; padding: 0; position: relative; }
.line-map::before { content: ""; position: absolute; inset-inline-start: 21px; top: 30px; bottom: 40px; width: 8px; border-radius: 8px; background: var(--red); }
.lm-unit { padding-block: 16px 10px; padding-inline: 66px 0; font-weight: 700; color: var(--ink-3); font-size: 14px; }
.lm-stop { position: relative; padding-block: 0 14px; padding-inline: 66px 0; }
.lm-dot { position: absolute; inset-inline-start: 8px; top: 24px; width: 34px; height: 34px; border-radius: 50%; background: var(--surface); border: 7px solid var(--red); z-index: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 800; color: #fff; }
.lm-stop.s-done .lm-dot { background: var(--red); }
.lm-stop.s-current .lm-dot { box-shadow: 0 0 0 7px var(--red-soft); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 11px color-mix(in srgb, var(--red-soft) 60%, transparent); } }
.lm-stop.s-locked .lm-dot { border-color: var(--line-strong); }
.lm-test .lm-dot { border: 0; background: var(--surface-2); font-size: 17px; width: 40px; height: 40px; inset-inline-start: 5px; }
.lm-test.s-done .lm-dot { background: var(--green-soft); color: var(--green); }
.lm-card { display: flex; gap: 16px; align-items: center; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--shadow-1); transition: border-color .15s, transform .15s; }
.lm-card:hover { border-color: var(--line-strong); transform: translateX(3px); }
.lm-stop.s-current .lm-card { border: 2px solid var(--red); }
.lm-stop.s-locked .lm-card { background: transparent; box-shadow: none; border-style: dashed; }
.lm-stop.s-locked .lm-card h3, .lm-stop.s-locked .lm-card p { color: var(--ink-3); }
.lm-icon { font-size: 30px; width: 46px; text-align: center; flex-shrink: 0; }
.lm-body { flex: 1; min-width: 0; }
.lm-num { font-weight: 700; font-size: 13.5px; color: var(--red-ink); }
.lm-card h3 { font-family: var(--f-display); font-weight: 600; font-size: 21px; margin: 2px 0 4px; }
.lm-card p { color: var(--ink-2); margin: 0; font-size: 15px; }
.lm-card p.lm-meta { color: var(--ink-3); font-size: 13.5px; margin-top: 6px; }
.lm-final .lm-card { background: var(--yellow-soft); border-color: transparent; }
.band-inline { margin-top: 44px; }
@media (max-width: 640px) { .lm-card { flex-wrap: wrap; } .lm-icon { display: none; } .lm-badge { margin-inline-start: 0; } }

/* ---------- lesson ---------- */
.lesson-hero { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 22px; }
.lh-icon { font-size: 44px; width: 76px; height: 76px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.lh-num { font-weight: 700; color: var(--red-ink); margin-bottom: 4px; }
.stepper { list-style: none; padding: 0; margin: 0 0 26px; display: flex; align-items: center; }
.stepper li { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--ink-3); font-weight: 600; font-size: 14.5px; position: relative; }
.stepper li:not(:last-child)::after { content: ""; flex: 1; height: 4px; background: var(--surface-3); border-radius: 4px; margin: 0 10px; }
.stepper li.done:not(:last-child)::after { background: var(--red); }
.st-dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; background: var(--surface); }
.stepper li.done .st-dot { background: var(--red); border-color: var(--red); color: #fff; }
.stepper li.active { color: var(--ink); }
.stepper li.active .st-dot { border-color: var(--red); color: var(--red-ink); box-shadow: 0 0 0 4px var(--red-soft); }
@media (max-width: 560px) { .stepper .st-label { display: none; } .stepper li.active .st-label { display: inline; } }
.lesson-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
@media (max-width: 760px) { .lesson-grid { grid-template-columns: 1fr; } }
.learn-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.learn-list li { display: flex; gap: 10px; align-items: baseline; font-size: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.learn-list li:last-child { border-bottom: 0; }
.learn-list b { font-family: var(--f-display); font-size: 20px; min-width: 28px; }
.why p { font-size: 16.5px; }
.why .btn { margin-top: 10px; }
.done-note { color: var(--green); font-weight: 700; }
.learn-head { display: flex; justify-content: space-between; align-items: baseline; }
.learn-head .section-h { margin-top: 0; }
.dots { display: flex; gap: 4px; margin: -4px 0 18px; flex-wrap: wrap; }
.dots span { width: 18px; height: 5px; border-radius: 5px; background: var(--surface-3); }
.dots span.past { background: var(--ink-3); } .dots span.now { background: var(--red); width: 30px; }
.word-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 34px 30px 26px; text-align: center; box-shadow: var(--shadow-2); max-width: 640px; margin: 0 auto; animation: cardIn .25s ease; }
@keyframes cardIn { from { opacity: 0; transform: translateX(10px); } to { opacity: 1; transform: none; } }
.wc-star { position: absolute; top: 18px; inset-inline-end: 18px; }
.wc-emoji { font-size: 42px; margin-bottom: 8px; }
.wc-word { font-size: clamp(34px, 6vw, 50px); font-weight: 600; line-height: 1.1; margin: 10px 0 6px; display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.wc-plural { color: var(--ink-3); font-weight: 600; margin: 0; }
.wc-meaning { font-size: 21px; font-weight: 600; margin: 16px 0 4px; }
.wc-other { display: flex; justify-content: center; gap: 8px 22px; flex-wrap: wrap; margin: 8px 0 0; }
.wc-other div { display: flex; gap: 6px; align-items: baseline; }
.wc-other dt { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.wc-other dd { margin: 0; color: var(--ink-2); }
.wc-example { margin: 22px auto 0; max-width: 460px; background: var(--surface-2); border-radius: var(--r-md); padding: 14px 18px; }
.wc-ex-label { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.wc-example p { margin: 4px 0 0; } .wc-example .de-word { font-size: 19px; }
.wc-conj { margin: 14px auto 0; max-width: 460px; text-align: start; }
.wc-conj summary { cursor: pointer; font-weight: 700; color: var(--blue); text-align: center; }
.wc-foot { margin-top: 18px; }
.deck-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.kbd-hint { text-align: center; color: var(--ink-3); font-size: 13.5px; margin-top: 12px; }
.all-words { margin-top: 26px; }
.all-words summary { cursor: pointer; font-weight: 600; color: var(--ink-2); margin-bottom: 12px; }
.sentence-list { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 10px; }
.sentence-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 18px; }
.sl-de { font-size: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sl-tr { color: var(--ink-2); margin-top: 6px; }
.reveal { background: none; border: 0; padding: 4px 0 0; font: 600 14px var(--f-ui); color: var(--blue); cursor: pointer; }
.grammar-spot { background: var(--violet-soft); border-radius: var(--r-lg); padding: 22px; margin: 18px 0; }
.gs-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; font-size: 26px; }
.gs-label { font-size: 13.5px; font-weight: 700; color: var(--violet); }
.gs-head h3 { font-family: var(--f-display); font-weight: 600; font-size: 21px; }
.grammar-spot p { max-width: 64ch; }
.grammar-spot b { font-weight: 700; }
.complete-card { text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 28px; padding: 40px 26px; box-shadow: var(--shadow-2); }
.complete-card.passed { background: linear-gradient(180deg, var(--yellow-soft), var(--surface) 60%); }
.cc-big { font-size: 54px; margin-bottom: 8px; animation: popIn .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes popIn { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.complete-card .lead { margin-left: auto; margin-right: auto; }
.result-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin: 26px 0 8px; }
.result-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 18px; min-width: 124px; }
.result-stats dt { font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.result-stats dd { margin: 2px 0 0; font-family: var(--f-display); font-weight: 600; font-size: 30px; }
.score-big { font-family: var(--f-display); font-weight: 700; font-size: 64px; line-height: 1; margin: 16px 0 20px; }
.score-big small { display: block; font-family: var(--f-ui); font-size: 15px; color: var(--ink-3); margin-top: 6px; }
.sec-bars { max-width: 460px; margin: 0 auto 14px; text-align: start; }
.plain-links { list-style: none; padding: 0; margin: 0; } .plain-links li { padding: 6px 0; } .plain-links a { font-weight: 600; text-decoration: none; }

/* ---------- exercise engine ---------- */
.session { max-width: 720px; margin: 0 auto; position: relative; }
.ss-top { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.ss-bar { flex: 1; height: 10px; background: var(--surface-3); border-radius: 10px; overflow: hidden; }
.ss-bar span { display: block; height: 100%; background: var(--red); border-radius: 10px; transition: width .4s ease; width: 0; }
.ss-count { font-weight: 700; color: var(--ink-3); font-size: 14px; min-width: 52px; text-align: end; }
.ss-title { font-weight: 700; margin-bottom: 10px; color: var(--ink-2); }
.ss-stage { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 30px 26px; box-shadow: var(--shadow-2); animation: cardIn .22s ease; }
.ex-eyebrow { font-weight: 700; font-size: 14.5px; color: var(--ink-3); margin-bottom: 10px; }
.ex-prompt { font-family: var(--f-display); font-size: clamp(24px, 4.4vw, 34px); font-weight: 500; line-height: 1.25; margin-bottom: 24px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ex-prompt-sm { font-family: var(--f-ui); font-size: 19px; font-weight: 600; }
.ex-dim, .ex-hint { color: var(--ink-3); font-size: .7em; font-family: var(--f-ui); font-weight: 500; }
.cloze-blank { display: inline-block; min-width: 70px; border-bottom: 3px solid var(--red); margin: 0 4px; height: 1em; vertical-align: -0.1em; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .quiz-options { grid-template-columns: 1fr; } }
.opt-btn { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); padding: 14px 16px; min-height: 56px; border-radius: 16px; font: 600 16px var(--f-ui); cursor: pointer; text-align: start; transition: border-color .12s, background .12s, transform .12s; }
.opt-btn:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-1px); }
.opt-btn.de-opt span:last-child { font-family: var(--f-display); font-weight: 500; font-size: 17.5px; }
.opt-key { width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); color: var(--ink-3); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.opt-btn.correct { border-color: var(--green); background: var(--green-soft); animation: pop .35s ease; }
.opt-btn.wrong { border-color: var(--red); background: var(--red-soft); animation: shake .35s ease; }
.opt-btn:disabled { cursor: default; }
.art-options { grid-template-columns: repeat(3, 1fr); }
.art-options .opt-btn { justify-content: center; font-size: 19px; }
.art-options .opt-key { display: none; }
.art-opt-der { color: var(--der); } .art-opt-die { color: var(--die); } .art-opt-das { color: var(--das); }
@keyframes pop { 40% { transform: scale(1.04); } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.write-answer { display: flex; flex-direction: column; gap: 10px; }
.write-input-row { display: flex; gap: 10px; }
.write-input { flex: 1; min-width: 0; font: 500 19px var(--f-display); padding: 13px 16px; border-radius: 14px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.write-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--surface-3); }
.write-input.correct { border-color: var(--green); background: var(--green-soft); }
.write-input.wrong { border-color: var(--red); background: var(--red-soft); }
.umlaut-row { display: flex; gap: 6px; flex-wrap: wrap; }
.umlaut-btn { width: 40px; height: 40px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 10px; font: 600 16px var(--f-ui); cursor: pointer; }
.umlaut-btn:hover { border-color: var(--ink); }
.order-line { min-height: 64px; border: 2px dashed var(--line-strong); border-radius: 16px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.order-line.correct { border-style: solid; border-color: var(--green); background: var(--green-soft); }
.order-line.wrong { border-style: solid; border-color: var(--red); background: var(--red-soft); }
.order-placeholder { color: var(--ink-3); font-size: 14.5px; padding: 0 6px; }
.order-end { font-family: var(--f-display); font-size: 20px; }
.order-bank { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.tile { font: 500 18px var(--f-display); padding: 9px 14px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: 0 2px 0 var(--line); }
.tile:hover:not(:disabled) { border-color: var(--ink); }
.tile.used { opacity: .25; }
.tile.placed { background: var(--surface-2); }
.order-actions { display: flex; justify-content: space-between; gap: 10px; }
.match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match-col { display: grid; gap: 8px; }
.match-btn { min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--surface); color: var(--ink); font: 600 15.5px var(--f-ui); cursor: pointer; text-align: start; }
.match-btn.de-opt { font-family: var(--f-display); font-weight: 500; font-size: 17px; }
.match-btn.sel { border-color: var(--ink); box-shadow: 0 0 0 3px var(--surface-3); }
.match-btn.matched { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.match-btn.wrong, .match-btn.nudge { border-color: var(--red); animation: shake .35s; }
.reading-card { background: var(--surface-2); border-radius: var(--r-md); padding: 18px 20px; margin-bottom: 20px; }
.reading-card h3 { font-size: 19px; margin-bottom: 8px; }
.reading-card .de-text { font-size: 18px; line-height: 1.7; }
.ss-feedback { margin-top: 14px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-radius: 20px; padding: 16px 18px; animation: slideUp .2s ease; }
@keyframes slideUp { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.ss-feedback.ok { background: var(--green-soft); }
.ss-feedback.no { background: var(--red-soft); }
.ss-fb-msg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; flex: 1; font-size: 16.5px; }
.fb-icon { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; }
.ok .fb-icon { background: var(--green); } .no .fb-icon { background: var(--red); }
.fb-answer { display: inline-flex; align-items: center; gap: 6px; font-size: 19px; }
.fb-note, .fb-why { flex-basis: 100%; color: var(--ink-2); font-size: 14.5px; }
.ss-streak { position: absolute; top: -8px; left: 50%; transform: translate(-50%, 0); background: var(--ink); color: var(--paper); font-weight: 700; padding: 6px 14px; border-radius: 999px; opacity: 0; pointer-events: none; }
.ss-streak.show { animation: streakPop 1.6s ease; }
@keyframes streakPop { 0% { opacity: 0; transform: translate(-50%, 8px); } 15%, 75% { opacity: 1; transform: translate(-50%, -6px); } 100% { opacity: 0; transform: translate(-50%, -14px); } }
.result-inline { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.result-inline b { font-family: var(--f-display); font-size: 34px; display: block; }
.result-inline.good { background: var(--green-soft); border-color: transparent; }

/* ---------- grammar ---------- */
.topic-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.topic-card { position: relative; display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1); transition: border-color .15s; }
.topic-card:hover { border-color: var(--line-strong); }
.tc-num { position: absolute; top: 18px; inset-inline-end: 20px; font-weight: 700; color: var(--ink-3); font-size: 14px; }
.tc-icon { font-size: 26px; margin-bottom: 10px; }
.topic-card h3 { font-family: var(--f-display); font-weight: 600; font-size: 19px; margin-bottom: 6px; }
.topic-card p { color: var(--ink-2); font-size: 15px; flex: 1; }
.tc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.topic-steps { list-style: none; margin: 0; padding: 0; }
.ts-n { width: 32px; height: 32px; border-radius: 50%; border: 5px solid var(--violet); display: inline-flex; align-items: center; justify-content: center; font: 700 13px var(--f-ui); flex-shrink: 0; }

/* ---------- review & difficult ---------- */
.rv-hero { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px; background: var(--ink); color: var(--paper); border-radius: var(--r-lg); padding: 26px 28px; margin-bottom: 18px; }
.rv-hero h2 { font-family: var(--f-display); font-weight: 600; font-size: 26px; }
.rv-hero p { margin: 6px 0 0; opacity: .8; max-width: 52ch; }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.rv-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-1); }
.rv-card.is-empty { background: transparent; box-shadow: none; border-style: dashed; }
.rv-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.rv-icon { font-size: 24px; }
.rv-count { font-family: var(--f-display); font-weight: 600; font-size: 28px; }
.rv-card h3 { font-size: 17px; margin-bottom: 4px; }
.rv-card p { color: var(--ink-2); font-size: 14.5px; flex: 1; }
.dw-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.dw-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.dw-row:last-child { border-bottom: 0; }
.dw-main { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; background: none; border: 0; padding: 4px 0; cursor: pointer; text-align: start; color: var(--ink); font: inherit; }
.dw-emoji { font-size: 20px; width: 26px; text-align: center; }
.dw-word { font-size: 18px; }
.dw-mean { color: var(--ink-2); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-meter { width: 110px; display: flex; align-items: center; gap: 8px; }
.dw-meter .meter { flex: 1; height: 6px; }
@media (max-width: 600px) { .dw-meter { display: none; } .dw-mean { display: none; } }

/* ---------- progress & profile ---------- */
.stat-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-tiles.compact { grid-template-columns: repeat(4, 1fr); }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.stat-tile b { display: block; font-family: var(--f-display); font-weight: 600; font-size: 30px; line-height: 1.1; }
.stat-tile span { display: block; font-weight: 600; font-size: 14px; margin-top: 4px; }
.stat-tile small { color: var(--ink-3); font-size: 13px; }
@media (max-width: 900px) { .stat-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .stat-tiles, .stat-tiles.compact { grid-template-columns: 1fr 1fr; } }
.days-chart { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 10px; }
.dc-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; }
.dc-bar { width: 100%; max-width: 26px; background: var(--surface-3); border-radius: 6px 6px 3px 3px; }
.dc-bar.goal { background: var(--green); }
.dc-day { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.assess-list { list-style: none; margin: 0; padding: 0; }
.assess-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.assess-list li:last-child { border-bottom: 0; }
.assess-list a { display: flex; justify-content: space-between; gap: 10px; color: var(--ink); font-weight: 600; text-decoration: none; }
.assess-parts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-3); margin-top: 4px; }
.profile-head { display: flex; gap: 20px; align-items: center; margin-bottom: 22px; }
.avatar-lg { width: 76px; height: 76px; border-radius: 50%; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font: 700 26px var(--f-ui); flex-shrink: 0; border: 5px solid var(--red); }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-btn { flex: 1; min-width: 72px; min-height: 44px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: 12px; font: 600 15px var(--f-ui); cursor: pointer; padding: 8px 12px; }
.seg.wrap .seg-btn { flex: 0 1 auto; }
.seg-btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.toggle-row { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; cursor: pointer; }
.toggle-row input { width: 20px; height: 20px; margin-top: 3px; accent-color: var(--red); }
.ach-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.ach { border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 2px; }
.ach b { font-size: 15px; } .ach span { font-size: 13.5px; color: var(--ink-2); } .ach small { font-size: 12.5px; margin-top: 4px; }
.ach-icon { font-size: 24px; filter: grayscale(1); opacity: .4; margin-bottom: 4px; }
.ach.got { border-style: solid; border-color: transparent; background: var(--yellow-soft); }
.ach.got .ach-icon { filter: none; opacity: 1; }
.settings-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 16px; }
.settings-card-title { font-weight: 700; font-size: 16px; margin-bottom: 14px; }
.settings-title { display: none; }
.settings-account-row { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.settings-account-name { font-weight: 700; font-size: 17px; }
.settings-account-email { font-size: 14px; color: var(--ink-2); }
.settings-account-role { font-size: 13px; font-weight: 600; color: var(--red-ink); }
.settings-name-edit { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.settings-empty { color: var(--ink-2); margin-bottom: 14px; }
.settings-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 600; }
.settings-row:last-child { border-bottom: 0; }
.settings-about-text { color: var(--ink-2); }
.academy-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--ink); color: var(--paper); display: flex; align-items: center; justify-content: center; font-weight: 700; flex-shrink: 0; }
.legacy-hidden { display: none !important; }

/* onboarding */
.onboard { max-width: 620px; margin: 30px auto; }
.ob-dots { display: flex; gap: 6px; margin: 24px 0 18px; }
.ob-dots span { flex: 1; height: 5px; border-radius: 5px; background: var(--surface-3); }
.ob-dots span.on { background: var(--red); }
.ob-q { font-family: var(--f-display); font-weight: 600; font-size: 24px; margin-bottom: 14px; }
.ob-opts { display: grid; gap: 10px; }
.ob-opt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: start; padding: 15px 18px; min-height: 56px; border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 16px; cursor: pointer; font: 600 16.5px var(--f-ui); color: var(--ink); }
.ob-opt span { font-weight: 500; font-size: 14px; color: var(--ink-3); }
.ob-opt:hover { border-color: var(--ink); }
.ob-opt.on { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

/* ---------- overlays: search, word detail, auth ---------- */
.overlay { position: fixed; inset: 0; z-index: 200; background: rgba(12,14,18,.5); display: flex; justify-content: center; align-items: flex-start; padding: 8vh 16px 16px; }
.overlay-panel { width: 100%; max-width: 640px; max-height: 84vh; overflow: auto; background: var(--surface); border-radius: var(--r-lg); box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); animation: ddPop .16s ease; }
.search-head { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); }
.search-head input { flex: 1; border: 0; background: none; font: 500 18px var(--f-ui); color: var(--ink); outline: none; padding: 8px 4px; }
#searchResults { padding: 8px 10px 16px; }
.search-hint { color: var(--ink-3); padding: 14px 10px; margin: 0; }
.sr-group h3 { font-size: 13.5px; color: var(--ink-3); font-weight: 700; padding: 12px 10px 6px; }
.sr-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border: 0; background: none; border-radius: 12px; text-align: start; color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; }
.sr-item:hover, .sr-item:focus { background: var(--surface-2); outline: none; }
.sr-emoji { width: 26px; text-align: center; font-size: 18px; }
.sr-de { font-family: var(--f-display); font-size: 17px; font-weight: 500; }
.sr-mean { color: var(--ink-3); font-size: 14.5px; margin-inline-start: auto; text-align: end; }
.word-modal { max-width: 560px; padding: 26px; position: relative; }
.modal-close { position: absolute; top: 16px; inset-inline-end: 16px; }
.wd-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; padding-inline-end: 44px; }
.wd-emoji { font-size: 40px; }
.wd-word { font-size: 30px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wd-plural { color: var(--ink-3); font-weight: 600; }
.wd-trans { display: grid; gap: 6px; margin: 0 0 14px; }
.wd-trans div { display: flex; gap: 12px; align-items: baseline; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.wd-trans div.primary { background: var(--blue-soft); }
.wd-trans dt { font-size: 13px; font-weight: 700; color: var(--ink-3); min-width: 72px; }
.wd-trans dd { margin: 0; font-weight: 600; font-size: 16.5px; }
.wd-block { margin-top: 16px; }
.wd-block h4 { font-size: 13.5px; color: var(--ink-3); margin: 0 0 6px; }
.wd-ex { font-size: 19px; margin: 0; display: flex; align-items: center; gap: 8px; }
.wd-ex-tr { color: var(--ink-2); margin: 2px 0 0; }
.wd-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.wd-meta .meter { margin-top: 10px; }
.wd-small { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; }
.wd-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.wd-links a { text-decoration: none; font-weight: 600; }
.wd-actions { margin-top: 20px; display: flex; justify-content: flex-end; }
@media (max-width: 520px) { .wd-meta { grid-template-columns: 1fr; } .overlay { padding-top: 4vh; } }
.conj-table { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; margin-top: 6px; }
.conj-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.conj-pron { color: var(--ink-3); font-weight: 600; font-size: 14.5px; }
.conj-form { font-family: var(--f-display); font-size: 17px; display: inline-flex; align-items: center; gap: 4px; }
.conj-compact { display: block; font-size: 13px; color: var(--ink-3); margin-top: 3px; font-style: italic; }
.auth-overlay { position: fixed; inset: 0; background: rgba(12,14,18,.5); z-index: 210; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-modal { position: relative; background: var(--surface); border-radius: var(--r-lg); padding: 30px 26px 26px; width: 100%; max-width: 400px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.5); }
.auth-close { position: absolute; top: 14px; inset-inline-end: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--ink); cursor: pointer; }
.auth-title { font-family: var(--f-display); font-weight: 600; font-size: 26px; margin-bottom: 16px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 18px; background: var(--surface-2); border-radius: 999px; padding: 4px; }
.auth-tab { flex: 1; border: 0; background: transparent; padding: 10px 0; border-radius: 999px; font: 600 15px var(--f-ui); cursor: pointer; color: var(--ink-2); }
.auth-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.auth-error { color: var(--red); font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.auth-note { font-size: 13.5px; color: var(--ink-3); text-align: center; margin-top: 14px; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-name { font-weight: 700; font-size: 19px; } .auth-email { color: var(--ink-2); margin-bottom: 6px; word-break: break-all; } .auth-role { font-size: 13.5px; color: var(--ink-3); margin-bottom: 16px; }
.auth-gate { text-align: center; padding: 28px 18px; background: var(--surface); border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg); margin-bottom: 22px; }
.auth-gate .btn { margin-top: 12px; }

/* ---------- forms (existing) ---------- */
.form-row { display: flex; gap: 10px; margin-bottom: 12px; }
.form-row.stack { flex-direction: column; }
input[type=text], input[type=email], input[type=password], select { width: 100%; font: 500 16px var(--f-ui); padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); min-height: 46px; }
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px var(--surface-3); }
label.field-label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; text-transform: none; }
.art-select, .deck-choice { display: flex; gap: 6px; }
.art-opt { flex: 1; text-align: center; padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--line-strong); cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--ink-2); }
.art-opt:hover { border-color: var(--ink); }
.art-opt.selected { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.art-opt.sel-der.selected { background: var(--der); border-color: var(--der); color: #fff; }
.art-opt.sel-die.selected { background: var(--die); border-color: var(--die); color: #fff; }
.art-opt.sel-das.selected { background: var(--das); border-color: var(--das); color: #fff; }
.add-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 8px; }
.add-form h2 { display: none; }
.add-details { margin-bottom: 22px; }
.add-details > summary { cursor: pointer; font-weight: 700; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); list-style: none; }
.add-details[open] > summary { margin-bottom: 10px; }
.add-details > summary::-webkit-details-marker { display: none; }
.add-details > summary::before { content: "+ "; color: var(--red); font-weight: 800; }

/* ---------- existing: word list ---------- */
.list-filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; align-items: center; }
.pill { border: 1.5px solid var(--line); background: var(--surface); padding: 7px 14px; min-height: 36px; border-radius: 999px; font: 600 14px var(--f-ui); cursor: pointer; color: var(--ink-2); }
.pill:hover { border-color: var(--ink); }
.pill.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.list-search { margin-bottom: 14px; }
.word-list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.word-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.word-row:last-child { border-bottom: 0; }
.word-row .w-emoji { font-size: 20px; width: 24px; text-align: center; }
.word-row .w-word { font-family: var(--f-display); font-size: 18px; font-weight: 500; min-width: 110px; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 4px; }
.word-row .w-word:hover { text-decoration-color: var(--line-strong); }
.word-row .w-mean { flex: 1; color: var(--ink-2); font-size: 15px; min-width: 140px; }
.word-row .w-del { background: none; border: 0; color: var(--ink-3); cursor: pointer; font-size: 15px; padding: 6px; border-radius: 8px; }
.word-row .w-del:hover { color: var(--red); background: var(--red-soft); }
.plural-tag, .example-tag { display: block; font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.example-tag { font-style: italic; }
.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-3); }
.section-gap { margin-top: 10px; }
.speaker-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 14px; flex-shrink: 0; vertical-align: middle; transition: border-color .12s, transform .12s; }
.speaker-btn:hover { border-color: var(--blue); transform: scale(1.06); }
.speaker-btn.small { width: 30px; height: 30px; font-size: 12.5px; }
.speaker-btn.on-dark { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.35); color: #fff; }
.star-btn { border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-3); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 15px; flex-shrink: 0; }
.star-btn:hover { border-color: var(--gold); color: var(--gold); }
.star-btn.on { border-color: var(--gold); color: var(--gold); background: var(--yellow-soft); }
.star-btn.small { width: 32px; height: 32px; font-size: 13px; }

/* ---------- existing: flashcards ---------- */
.deck-status { display: flex; justify-content: space-between; color: var(--ink-3); font-weight: 600; font-size: 14px; margin-bottom: 12px; max-width: 640px; margin-left: auto; margin-right: auto; }
.card-stage { perspective: 1400px; margin: 0 auto 18px; max-width: 640px; }
.flashcard { position: relative; width: 100%; height: 340px; cursor: pointer; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.4,.2,.2,1); }
.flashcard.flipped { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; border-radius: 28px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; text-align: center; border: 1px solid var(--line); }
.face.front { background: var(--surface); box-shadow: var(--shadow-2); }
.face.back { background: var(--ink); color: var(--paper); transform: rotateY(180deg); }
.face.back .type-chip { background: rgba(255,255,255,.14); color: #fff; }
.face-eyebrow { font-weight: 600; font-size: 14px; color: var(--ink-3); margin-bottom: 12px; text-transform: none; }
.face.back .face-eyebrow { color: rgba(255,255,255,.6); }
.face-emoji { font-size: 38px; margin-bottom: 6px; }
.face-word { font-family: var(--f-display); font-weight: 500; font-size: clamp(26px, 6vw, 40px); line-height: 1.15; }
.face .art-chip { margin-bottom: 8px; }
.face-hint { margin-top: 16px; font-size: 13.5px; color: var(--ink-3); }
.face-star { position: absolute; top: 16px; inset-inline-end: 16px; background: transparent; border: 0; font-size: 20px; cursor: pointer; opacity: .45; }
.face-star.on { opacity: 1; }
.fc-ex { font-family: var(--f-display); font-style: italic; opacity: .8; margin-top: 12px; font-size: 16px; }
.fc-mastery { margin-top: 10px; font-size: 13px; font-weight: 700; color: var(--yellow); }
.flash-rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 640px; margin: 0 auto 14px; }
.flash-rate .btn { border-radius: 14px; flex-direction: column; gap: 0; }
.flash-rate .btn small { font-weight: 500; color: var(--ink-3); font-size: 12px; }
.rate-again { border-color: var(--red) !important; } .rate-hard { border-color: var(--gold) !important; } .rate-good { border-color: var(--green) !important; } .rate-master { border-color: var(--violet) !important; }
.flash-hint { text-align: center; color: var(--ink-3); font-size: 13px; }
.flash-nav { max-width: 640px; margin: 0 auto; }

/* ---------- existing: quiz ---------- */
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
@media (max-width: 640px) { .mode-grid { grid-template-columns: 1fr 1fr; } }
.mode-card { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 12px 14px; cursor: pointer; transition: border-color .12s; }
.mode-card:hover { border-color: var(--line-strong); }
.mode-card.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.mode-card-icon { width: 38px; height: 38px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; background: var(--surface-2) !important; color: var(--ink) !important; }
.mode-card-body { flex: 1; min-width: 0; }
.mode-card-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.mode-card-desc { font-size: 13px; color: var(--ink-3); margin-top: 2px; }
.mode-card-stat { font-family: var(--f-display); font-weight: 600; font-size: 16px; }
.score-row { display: flex; justify-content: space-between; margin-bottom: 12px; color: var(--ink-3); font-weight: 600; font-size: 14px; max-width: 720px; margin-left: auto; margin-right: auto; }
.score-row b { color: var(--green); }
#quizArea, #quizResults { max-width: 720px; margin: 0 auto; }
.quiz-card { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 30px 22px; text-align: center; margin-bottom: 14px; box-shadow: var(--shadow-2); }
.quiz-eyebrow { font-weight: 700; font-size: 14px; color: var(--ink-3); margin-bottom: 10px; text-transform: none; }
.quiz-emoji { font-size: 32px; margin-bottom: 6px; }
.quiz-prompt { font-family: var(--f-display); font-weight: 500; font-size: clamp(24px, 5vw, 34px); }
.cloze-sentence { font-size: clamp(20px, 4.4vw, 27px); line-height: 1.6; }
#quizArea .cloze-blank { background: var(--yellow-soft); border-bottom: 3px solid var(--yellow); height: auto; padding: 0 16px; border-radius: 4px; }
.feedback-line { text-align: center; min-height: 24px; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.feedback-line.ok { color: var(--green); } .feedback-line.no { color: var(--red); }
.retype-wrap { background: var(--red-soft); border-radius: var(--r-md); padding: 14px 16px; margin: 12px 0; }
.retype-label { font-weight: 700; font-size: 14px; color: var(--red-ink); margin-bottom: 8px; }
.quiz-actions-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.explain-box { background: var(--surface-2); border-radius: var(--r-md); padding: 16px 18px; margin-top: 12px; line-height: 1.6; }
.explain-box .ex-lang { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--blue); margin-bottom: 4px; text-transform: none; }
.explain-box .ex-block + .ex-block { margin-top: 12px; }
.explain-box .ex-sentence { font-family: var(--f-display); font-style: italic; }
.results-card { background: var(--ink); color: var(--paper); border-radius: 26px; padding: 34px 26px; text-align: center; }
.results-card .big { font-family: var(--f-display); font-size: 52px; font-weight: 700; }
.results-card p { opacity: .85; margin: 8px 0 20px; }
.results-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.island-active-bar { display: none; align-items: center; justify-content: space-between; margin: 0 auto 14px; max-width: 720px; gap: 10px; }
.island-level-label { font-weight: 700; font-size: 14px; background: var(--surface-2); padding: 7px 14px; border-radius: 999px; }
.quiz-toolbar-note { color: var(--ink-3); font-size: 14px; margin: -8px 0 14px; }

/* ---------- existing: islands (kept, calmer palette) ---------- */
.island-intro { margin: -6px 0 16px; } .island-eyebrow, .island-title { display: none; } .island-sub { color: var(--ink-2); }
.island-map { position: relative; border-radius: 28px; overflow: hidden; background: linear-gradient(180deg, #CFE6F5 0%, #9CCBEA 35%, #5E9FD0 70%, #3E86B8 100%); max-width: 720px; margin: 0 auto; }
:root[data-theme="dark"] .island-map { background: linear-gradient(180deg, #22364A 0%, #1C3550 40%, #173049 100%); }
.island-sky { position: absolute; inset: 0; pointer-events: none; }
.sky-deco { position: absolute; opacity: .85; }
.sky-deco.sun { top: 18px; right: 9%; font-size: 30px; }
.sky-deco.cloud { font-size: 24px; animation: driftCloud 40s linear infinite; }
.sky-deco.c1 { top: 36px; left: -10%; } .sky-deco.c2 { top: 90px; left: -20%; font-size: 18px; animation-delay: -12s; } .sky-deco.c3 { top: 150px; left: -30%; font-size: 20px; animation-delay: -24s; }
.sky-deco.bird, .sky-deco.bird2, .sky-deco.boat { display: none; }
@keyframes driftCloud { to { transform: translateX(560px); } }
.water-critter { position: absolute; z-index: 1; font-size: 13px; opacity: .45; }
.island-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.island-nodes { position: relative; z-index: 2; }
.island-node { position: absolute; width: 66px; height: 66px; margin-left: -33px; margin-top: -33px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .15s; }
.island-node:hover:not(.locked) { transform: scale(1.06); }
.isle-shadow { position: absolute; bottom: 2px; left: 50%; width: 44px; height: 10px; background: rgba(10,30,50,.2); border-radius: 50%; transform: translateX(-50%); }
.island-node .isle-base { position: absolute; inset: 0; }
.island-node .isle-base::before { content: "🏝️"; position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; font-size: 50px; }
.island-node.locked .isle-base::before { filter: grayscale(1) opacity(.5); }
.isle-palm { display: none; }
.island-node .isle-num { position: relative; z-index: 1; margin-top: -14px; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: #fff; background: var(--ink); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.island-node.done .isle-num { background: var(--green); }
.island-node.current .isle-num { background: var(--red); box-shadow: 0 0 0 5px rgba(255,255,255,.5); }
.island-node.locked .isle-num { background: #7C818C; }
.island-node .isle-check { display: none; }
.island-walker { position: absolute; z-index: 3; font-size: 28px; transform: translate(-50%, -115%); transition: left .6s, top .6s; }
.walker-bubble { position: absolute; top: -28px; left: 50%; transform: translateX(-50%); background: #fff; color: #1C1E23; font-weight: 700; font-size: 11px; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.island-waves { display: none; }
.island-sub-line { color: var(--ink-2); margin: -10px 0 16px; }

/* toast & confetti (existing) */
.toast { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--paper); padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 300; max-width: calc(100vw - 32px); text-align: center; box-shadow: var(--shadow-2); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.confetti-piece { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 999; animation-fill-mode: forwards; animation-timing-function: cubic-bezier(.2,.6,.4,1); }
@keyframes confetti-fall { to { transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .confetti-piece { display: none; } .hl-train { display: none; } }

/* ---------- original progress widgets ---------- */
.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.stat-card .num { font-family: var(--f-display); font-weight: 600; font-size: 28px; }
.stat-card .lbl { font-size: 13.5px; color: var(--ink-3); font-weight: 600; text-transform: none; }
.section-title { font-weight: 700; font-size: 17px; margin: 26px 0 12px; }
.bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.bar-row .art-chip { width: 44px; }
.bar-track { flex: 1; height: 10px; border-radius: 10px; background: var(--surface-3); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 10px; transition: width .5s ease; }
.bar-pct { font-weight: 700; font-size: 14px; width: 44px; text-align: end; color: var(--ink-2); }
.weak-row { display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.weak-row:last-child { border-bottom: 0; }
.wr-emoji { font-size: 18px; width: 24px; text-align: center; }
.wr-word { font-family: var(--f-display); font-weight: 500; flex: 1; font-size: 17px; }
.wr-pct { font-weight: 700; font-size: 14px; color: var(--red); }
.empty-note { text-align: center; padding: 24px 16px; color: var(--ink-2); background: var(--surface); border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); }
.deckbreak-row { display: flex; justify-content: space-between; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 8px; font-weight: 600; }
@media (max-width: 520px) { .home-grid { grid-template-columns: 1fr 1fr; } }

.panel + .panel { margin-top: 14px; }
main:focus, main:focus-visible { outline: none; }

/* ==========================================================================
   JOY LAYER — bright, warm, colourful. Every lesson has its own colour (--c).
   ========================================================================== */
:root {
  --paper: #FBF9FF; --surface: #FFFFFF; --surface-2: #F3F1FC; --surface-3: #E9E5F8;
  --ink: #1F1B3A; --ink-2: #57527A; --ink-3: #8A85A8; --line: rgba(60,45,140,.12); --line-strong: rgba(60,45,140,.24);
  --red: #FF4D5A; --red-ink: #E0303E; --red-soft: #FFE7EA;
  --yellow: #FFC53D; --yellow-ink: #9A6400; --yellow-soft: #FFF4D4;
  --green: #1DB980; --green-soft: #DDF7EC;
  --blue: #3D7BFF; --blue-soft: #E4EDFF;
  --violet: #6C5CE7; --violet-soft: #ECE9FF;
  --pink: #FF5FA2; --pink-soft: #FFE6F1; --orange: #FF8A3D; --orange-soft: #FFEBDD; --teal-j: #14B8C4;
  --der: #3D7BFF; --die: #FF4D5A; --das: #1DB980;
  --shadow-1: 0 1px 2px rgba(60,45,140,.06), 0 4px 14px -8px rgba(60,45,140,.18);
  --shadow-2: 0 2px 4px rgba(60,45,140,.06), 0 18px 40px -20px rgba(60,45,140,.35);
  --c: var(--red);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #16142A; --surface: #211E3A; --surface-2: #2A2647; --surface-3: #353057; --ink: #F3F1FF; --ink-2: #BFB9E3; --ink-3: #908AB8;
  --line: rgba(200,190,255,.13); --line-strong: rgba(200,190,255,.26);
  --red-soft: #45202E; --yellow-soft: #3E3317; --green-soft: #173B30; --blue-soft: #1F2C56; --violet-soft: #2D2758; --pink-soft: #45213A; --orange-soft: #45291B;
} }
:root[data-theme="dark"] {
  --paper: #16142A; --surface: #211E3A; --surface-2: #2A2647; --surface-3: #353057; --ink: #F3F1FF; --ink-2: #BFB9E3; --ink-3: #908AB8;
  --line: rgba(200,190,255,.13); --line-strong: rgba(200,190,255,.26);
  --red-soft: #45202E; --yellow-soft: #3E3317; --green-soft: #173B30; --blue-soft: #1F2C56; --violet-soft: #2D2758; --pink-soft: #45213A; --orange-soft: #45291B;
}
body {
  background-color: var(--paper);
  background-image:
    radial-gradient(900px 500px at 105% -10%, rgba(255,95,162,.14), transparent 60%),
    radial-gradient(800px 520px at -10% 10%, rgba(61,123,255,.13), transparent 60%),
    radial-gradient(700px 500px at 60% 110%, rgba(255,197,61,.16), transparent 60%);
  background-attachment: fixed;
}
.topbar { background: color-mix(in srgb, var(--paper) 78%, transparent); }

/* buttons: colourful, a little bouncy */
.btn { border-width: 2px; transition: transform .12s, box-shadow .12s, background .15s, border-color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(135deg, #5B6CFF, #8B5CF6); border-color: transparent; color: #fff; box-shadow: 0 4px 0 #4B3FC4, 0 10px 20px -10px rgba(91,108,255,.7); }
.btn.primary:hover { background: linear-gradient(135deg, #4F60FF, #7C4DF0); }
:root[data-theme="dark"] .btn.primary:hover { background: linear-gradient(135deg, #4F60FF, #7C4DF0); }
.btn.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 #4B3FC4; }
.btn.accent, .btn.terra { background: linear-gradient(135deg, #FF5A5F, #FF8A3D); border-color: transparent; color: #fff; box-shadow: 0 4px 0 #D23A3F, 0 10px 20px -10px rgba(255,90,95,.7); }
.btn.accent:hover, .btn.terra:hover { background: linear-gradient(135deg, #FF4B51, #FF7A2A); border-color: transparent; }
.btn.accent:active, .btn.terra:active { transform: translateY(3px); box-shadow: 0 1px 0 #D23A3F; }
.btn.ghost { background: var(--surface); }
.btn.ghost:hover { border-color: var(--violet); color: var(--violet); }
.pill.active, .seg-btn.on, .subnav a.active, .dd-option.selected, .art-opt.selected, .mode-card.active .mode-card-stat { background: var(--violet); border-color: var(--violet); color: #fff; }
.mode-card.active { border-color: var(--violet); box-shadow: inset 0 0 0 1px var(--violet); background: var(--violet-soft); }
.auth-btn.logged-in { background: linear-gradient(135deg, #FF5FA2, #6C5CE7); border-color: transparent; color: #fff; }
.brand-mark { border-color: var(--red); background: conic-gradient(from 0deg, #FF5A5F, #FFB020, #1DB980, #3D7BFF, #6C5CE7, #FF5FA2, #FF5A5F); box-shadow: inset 0 0 0 5px var(--surface); border: 0; }

/* nav */
.nav-link.active { background: var(--violet-soft); color: var(--violet); box-shadow: none; }
.nav-link.active::before { background: linear-gradient(#FF5A5F, #6C5CE7); }
.nav-sub.active { color: var(--violet); }
.bottomnav a.active { color: var(--violet); background: var(--violet-soft); }

/* meters & rings */
.meter { background: var(--surface-3); height: 10px; }
.meter span { background: linear-gradient(90deg, #3D7BFF, #6C5CE7); }
.meter-red span { background: linear-gradient(90deg, #FF5A5F, #FFB020, #1DB980, #3D7BFF, #6C5CE7); background-size: 100% 100%; }
.ring-fg { stroke: #1DB980; }
.streak-flame.lit { animation: flicker 2.4s ease-in-out infinite; display: inline-block; }
@keyframes flicker { 50% { transform: scale(1.12) rotate(-4deg); } }

/* landing */
.hero-title { background: linear-gradient(100deg, #6C5CE7 0%, #FF5FA2 45%, #FF8A3D 80%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.hero-visual { background: linear-gradient(160deg, var(--surface) 60%, var(--violet-soft)); border: 0; }
.hero-line::before { background: linear-gradient(#FF5A5F, #FFB020, #1DB980, #6C5CE7); }
.hl-dot { border-color: var(--c); }
.hl-stop b { color: var(--c); }
.hl-emoji { width: 42px; height: 42px; border-radius: 14px; background: color-mix(in srgb, var(--c) 16%, transparent); display: flex; align-items: center; justify-content: center; }
.hl-train { background: #FFC53D; box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px #FFC53D, 0 0 18px 6px rgba(255,197,61,.6); }
.caps { background: none; border: 0; gap: 14px; }
.cap { border-radius: var(--r-lg); background: color-mix(in srgb, var(--c) 9%, var(--surface)); border: 2px solid color-mix(in srgb, var(--c) 22%, transparent); transition: transform .15s; }
.cap:hover { transform: translateY(-3px) rotate(-.4deg); }
.cap-icon { width: 50px; height: 50px; border-radius: 16px; background: var(--c); display: flex; align-items: center; justify-content: center; font-size: 24px; box-shadow: 0 6px 14px -6px var(--c); }
.cap h3 { color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.rl-num { color: var(--c); }
.route-list li { border-bottom-color: var(--line); }
.lv-badge { border-color: color-mix(in srgb, var(--c) 45%, transparent); color: var(--c); }
.lv.avail .lv-badge { background: var(--c); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 22%, transparent); }
.lv.avail::after { background: var(--c); }
.band-cta { background: linear-gradient(135deg, #6C5CE7, #FF5FA2 60%, #FF8A3D); color: #fff; border-radius: 32px; border: 0; margin-top: 30px; padding: 56px 24px; }
.band-cta .band-sub { color: rgba(255,255,255,.9); }
.band-cta .btn.primary { background: #fff; color: #6C5CE7; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.band-cta .btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }

/* dashboard */
.dash-hello .display::after { content: ""; }
.habit-item { border: 0; box-shadow: var(--shadow-1); }
.habit-item:first-child { background: var(--green-soft); }
.habit-item:last-child { background: var(--orange-soft); }
.journey { background: linear-gradient(160deg, var(--surface) 55%, var(--pink-soft)); border: 0; }
.big-pct { color: var(--violet); }
.mini-line::before { background: linear-gradient(90deg, #FF5A5F, #FFB020, #1DB980, #14B8C4, #3D7BFF, #6C5CE7, #FF5FA2); opacity: .35; height: 6px; }
.ml-dot { border-color: var(--c); background: var(--surface); }
.ml-stop.s-done .ml-dot { background: var(--c); border-color: var(--c); }
.ml-stop.s-current .ml-dot { border-color: var(--c); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 25%, transparent); }
.ml-stop.s-current .ml-num { color: var(--c); }
.ml-stop.s-locked .ml-dot { border-color: color-mix(in srgb, var(--c) 35%, transparent); }
.ml-num { color: color-mix(in srgb, var(--c) 60%, var(--ink-3)); }
.continue-card { background: linear-gradient(135deg, var(--c), var(--c2, #6C5CE7)); color: #fff; box-shadow: 0 20px 40px -22px var(--c); }
.continue-card::after { border-color: rgba(255,255,255,.28); }
.continue-card::before { content: ""; position: absolute; inset-inline-end: 120px; top: -60px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.14); }
.cc-eyebrow { opacity: .9; }
.cc-num { color: #fff; background: rgba(255,255,255,.22); display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 14px; }
.cc-sub { opacity: .95; }
.continue-card .btn.accent { background: #fff; color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.2); }
.continue-card .btn.accent:hover { background: #fff; transform: translateY(-2px); }
.cc-icon { font-size: 64px; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(6deg); } }
.today { background: linear-gradient(160deg, var(--surface) 60%, var(--blue-soft)); border: 0; }
.today-list li:nth-child(1) .today-row { background: var(--blue-soft); }
.today-list li:nth-child(2) .today-row { background: var(--yellow-soft); }
.today-list li:nth-child(3) .today-row { background: var(--violet-soft); }
.today-list li:nth-child(1) .tl-n { color: var(--blue); } .today-list li:nth-child(2) .tl-n { color: var(--yellow-ink); } .today-list li:nth-child(3) .tl-n { color: var(--violet); }
.tl-n.zero { opacity: .45; }
.insight { background: linear-gradient(120deg, #FFF1C9, #FFE3EE); }
:root[data-theme="dark"] .insight { background: linear-gradient(120deg, #3E3317, #45213A); }
.ins-icon { width: 54px; height: 54px; border-radius: 18px; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-1); }
.panel { border: 0; box-shadow: var(--shadow-1); }
.dash-grid3 .panel:nth-child(1) { border-top: 5px solid #3D7BFF; }
.dash-grid3 .panel:nth-child(2) { border-top: 5px solid #1DB980; }
.dash-grid3 .panel:nth-child(3) { border-top: 5px solid #FFB020; }
.prog-row:nth-of-type(1) .meter span { background: linear-gradient(90deg, #3D7BFF, #14B8C4); }
.prog-row:nth-of-type(2) .meter span { background: linear-gradient(90deg, #6C5CE7, #FF5FA2); }
.prog-row:nth-of-type(3) .meter span { background: linear-gradient(90deg, #FF5A5F, #FFB020); }
.tl-dot { background: var(--violet-soft); }
.word-chip { border-width: 2px; }
.word-chip:hover { border-color: var(--violet); background: var(--violet-soft); }

/* course map — the rainbow line */
.line-map::before { background: linear-gradient(#FF5A5F, #FF8A3D, #FFB020, #1DB980, #14B8C4, #3D7BFF, #6C5CE7, #B45CF6, #FF5FA2, #FFB020); }
.lm-dot { border-color: var(--c); }
.lm-stop.s-done .lm-dot { background: var(--c); }
.lm-stop.s-current .lm-dot { box-shadow: 0 0 0 7px color-mix(in srgb, var(--c) 25%, transparent); animation: none; }
.lm-stop.s-locked .lm-dot { border-color: color-mix(in srgb, var(--c) 40%, var(--surface)); }
.lm-card { border: 2px solid transparent; }
.lm-card:hover { border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.lm-icon { width: 58px; height: 58px; border-radius: 18px; background: color-mix(in srgb, var(--c) 16%, transparent); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.lm-num { color: var(--c); }
.lm-stop.s-current .lm-card { border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 7%, var(--surface)); }
.lm-stop.s-done .lm-card { background: color-mix(in srgb, var(--c) 5%, var(--surface)); }
.lm-stop.s-locked .lm-card { background: color-mix(in srgb, var(--surface) 55%, transparent); border: 2px dashed color-mix(in srgb, var(--c) 30%, transparent); }
.lm-stop.s-locked .lm-icon { filter: saturate(.5); opacity: .7; }
.lm-badge.current { background: var(--c, var(--red)); color: #fff; }
.lm-test .lm-dot { background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
.lm-final .lm-card { background: linear-gradient(120deg, #FFF1C9, #FFE3EE); border-color: transparent; }
:root[data-theme="dark"] .lm-final .lm-card { background: linear-gradient(120deg, #3E3317, #45213A); }
.line-badge { background: linear-gradient(135deg, #FF5A5F, #FF8A3D); }
.course-hero .big-pct { color: var(--red); }

/* lessons */
#view-lesson .lh-icon, #view-topic .lh-icon { background: color-mix(in srgb, var(--c) 18%, var(--surface)); border: 0; box-shadow: 0 10px 24px -14px var(--c); }
#view-lesson .lh-num { color: var(--c); }
#view-lesson .stepper li.done .st-dot { background: var(--c); border-color: var(--c); }
#view-lesson .stepper li.done:not(:last-child)::after { background: var(--c); }
#view-lesson .stepper li.active .st-dot { border-color: var(--c); color: var(--c); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
#view-lesson .dots span.now { background: var(--c); }
#view-lesson .learn-list b { color: var(--c); }
#view-lesson .why { background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.word-card { border: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--c, #6C5CE7) 12%, var(--surface)) 0, var(--surface) 45%); }
.wc-emoji { font-size: 54px; animation: popIn .4s cubic-bezier(.3,1.6,.5,1); }
.wc-meaning { color: var(--c, var(--violet)); }
.wc-example { background: var(--yellow-soft); }
.sentence-list li { border: 0; box-shadow: var(--shadow-1); border-inline-start: 5px solid var(--c, var(--violet)); }
.grammar-spot { background: linear-gradient(135deg, var(--violet-soft), var(--pink-soft)); }
.complete-card { border: 0; }
.complete-card.passed { background: linear-gradient(180deg, #FFF1C9, #FFE3EE 45%, var(--surface) 85%); }
:root[data-theme="dark"] .complete-card.passed { background: linear-gradient(180deg, #3E3317, #45213A 45%, var(--surface) 85%); }
.result-stats div { border: 0; box-shadow: var(--shadow-1); }
.result-stats div:nth-child(1) dd { color: #3D7BFF; } .result-stats div:nth-child(2) dd { color: #6C5CE7; } .result-stats div:nth-child(3) dd { color: #FF8A3D; } .result-stats div:nth-child(4) dd { color: #1DB980; } .result-stats div:nth-child(5) dd { color: #FF5FA2; }
.score-big { background: linear-gradient(100deg, #6C5CE7, #FF5FA2); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* exercises */
.ss-bar span { background: linear-gradient(90deg, #FF5A5F, #FFB020, #1DB980, #3D7BFF, #6C5CE7); background-size: 720px 100%; }
.ss-stage { border: 0; }
.opt-btn { border-width: 2px; }
.opt-btn:hover:not(:disabled) { border-color: var(--violet); background: var(--violet-soft); }
.quiz-options .opt-btn:nth-child(1) .opt-key { background: var(--blue-soft); color: var(--blue); }
.quiz-options .opt-btn:nth-child(2) .opt-key { background: var(--pink-soft); color: var(--pink); }
.quiz-options .opt-btn:nth-child(3) .opt-key { background: var(--yellow-soft); color: var(--yellow-ink); }
.quiz-options .opt-btn:nth-child(4) .opt-key { background: var(--green-soft); color: var(--green); }
.art-options .opt-btn { color: #fff !important; border: 0; box-shadow: 0 4px 0 rgba(0,0,0,.15); }
.art-options .art-opt-der { background: var(--der); } .art-options .art-opt-die { background: var(--die); } .art-options .art-opt-das { background: var(--das); }
.art-options .opt-btn:hover:not(:disabled) { filter: brightness(1.08); background-color: inherit; }
.art-options .art-opt-der:hover:not(:disabled) { background: var(--der); } .art-options .art-opt-die:hover:not(:disabled) { background: var(--die); } .art-options .art-opt-das:hover:not(:disabled) { background: var(--das); }
.art-options .opt-btn.correct { box-shadow: 0 0 0 4px var(--green-soft), 0 0 0 7px var(--green); }
.art-options .opt-btn.wrong { opacity: .55; }
.tile { border-width: 2px; background: var(--surface); box-shadow: 0 3px 0 var(--line-strong); }
.tile:hover:not(:disabled) { border-color: var(--violet); }
.tile.placed { background: var(--violet-soft); border-color: var(--violet); }
.umlaut-btn { border-width: 2px; } .umlaut-btn:hover { border-color: var(--violet); color: var(--violet); }
.write-input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-soft); }
.match-btn.sel { border-color: var(--violet); background: var(--violet-soft); }
.ss-feedback.ok { background: linear-gradient(120deg, #DDF7EC, #E4F8FF); }
.ss-feedback.no { background: linear-gradient(120deg, #FFE7EA, #FFF1E4); }
:root[data-theme="dark"] .ss-feedback.ok { background: var(--green-soft); } :root[data-theme="dark"] .ss-feedback.no { background: var(--red-soft); }
.ss-streak { background: linear-gradient(135deg, #FF8A3D, #FF5A5F); color: #fff; }
.reading-card { background: var(--blue-soft); }

/* grammar, review, difficult */
.topic-card { border: 2px solid transparent; }
.topic-card:hover { border-color: color-mix(in srgb, var(--c) 50%, transparent); transform: translateY(-2px); }
.tc-icon { width: 50px; height: 50px; border-radius: 16px; background: color-mix(in srgb, var(--c) 18%, transparent); display: flex; align-items: center; justify-content: center; }
.tc-num { color: var(--c); }
.ts-n { border-color: var(--c, var(--violet)); color: var(--c, var(--violet)); }
.rv-hero { background: linear-gradient(135deg, #3D7BFF, #6C5CE7 55%, #FF5FA2); }
.rv-hero .btn.accent { background: #fff; color: #6C5CE7; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.rv-card { border: 0; border-top: 5px solid var(--c); }
.rv-card.is-empty { border: 2px dashed var(--line-strong); border-top: 5px solid color-mix(in srgb, var(--c) 35%, transparent); }
.rv-icon { width: 46px; height: 46px; border-radius: 14px; background: color-mix(in srgb, var(--c) 16%, transparent); display: flex; align-items: center; justify-content: center; }
.rv-count { color: var(--c); }
.dw-list { border: 0; box-shadow: var(--shadow-1); }
.dw-row:hover { background: var(--surface-2); }

/* progress & profile */
.stat-tile { border: 0; box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.stat-tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; }
.stat-tile:nth-child(6n+1)::before { background: #FF5A5F; } .stat-tile:nth-child(6n+1) b { color: #FF5A5F; }
.stat-tile:nth-child(6n+2)::before { background: #3D7BFF; } .stat-tile:nth-child(6n+2) b { color: #3D7BFF; }
.stat-tile:nth-child(6n+3)::before { background: #FFB020; } .stat-tile:nth-child(6n+3) b { color: #D98E00; }
.stat-tile:nth-child(6n+4)::before { background: #6C5CE7; } .stat-tile:nth-child(6n+4) b { color: #6C5CE7; }
.stat-tile:nth-child(6n+5)::before { background: #1DB980; } .stat-tile:nth-child(6n+5) b { color: #1DB980; }
.stat-tile:nth-child(6n+6)::before { background: #FF8A3D; } .stat-tile:nth-child(6n+6) b { color: #FF8A3D; }
.dc-bar { background: var(--violet-soft); } .dc-bar.goal { background: linear-gradient(#1DB980, #14B8C4); }
.avatar-lg { background: linear-gradient(135deg, #FF5FA2, #6C5CE7); border: 5px solid var(--surface); box-shadow: 0 0 0 4px #FFC53D; }
.academy-avatar { background: linear-gradient(135deg, #FF5FA2, #6C5CE7); }
.ach.got { background: linear-gradient(135deg, #FFF1C9, #FFE3EE); }
:root[data-theme="dark"] .ach.got { background: linear-gradient(135deg, #3E3317, #45213A); }
.settings-card { border: 0; box-shadow: var(--shadow-1); }
.ob-dots span.on { background: linear-gradient(90deg, #FF5A5F, #6C5CE7); }
.ob-opt { border-width: 2px; }
.ob-opt:nth-child(5n+1).on { border-color: #FF5A5F; box-shadow: 0 0 0 4px var(--red-soft); }
.ob-opt:nth-child(5n+2).on { border-color: #3D7BFF; box-shadow: 0 0 0 4px var(--blue-soft); }
.ob-opt:nth-child(5n+3).on { border-color: #1DB980; box-shadow: 0 0 0 4px var(--green-soft); }
.ob-opt:nth-child(5n+4).on { border-color: #6C5CE7; box-shadow: 0 0 0 4px var(--violet-soft); }
.ob-opt:nth-child(5n+5).on { border-color: #FF8A3D; box-shadow: 0 0 0 4px var(--orange-soft); }
#view-welcome .display { background: linear-gradient(100deg, #6C5CE7, #FF5FA2, #FF8A3D); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* existing views */
.face.back { background: linear-gradient(135deg, #5B6CFF, #8B5CF6 55%, #FF5FA2); border: 0; }
.face.front { border: 0; }
.flash-rate .btn { border-width: 2px; }
.rate-again { background: var(--red-soft) !important; } .rate-hard { background: var(--yellow-soft) !important; } .rate-good { background: var(--green-soft) !important; } .rate-master { background: var(--violet-soft) !important; }
.results-card { background: linear-gradient(135deg, #5B6CFF, #8B5CF6 55%, #FF5FA2); }
.results-card .btn.terra { background: #fff; color: #6C5CE7; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.quiz-card { border: 0; }
.mode-card-icon { background: var(--surface-2) !important; }
.mode-card:nth-child(1) .mode-card-icon { background: var(--blue-soft) !important; }
.mode-card:nth-child(2) .mode-card-icon { background: var(--pink-soft) !important; }
.mode-card:nth-child(3) .mode-card-icon { background: var(--yellow-soft) !important; }
.mode-card:nth-child(4) .mode-card-icon { background: var(--green-soft) !important; }
.mode-card:nth-child(5) .mode-card-icon { background: var(--orange-soft) !important; }
.mode-card:nth-child(6) .mode-card-icon { background: var(--violet-soft) !important; }
.word-list { border: 0; box-shadow: var(--shadow-1); }
.add-details > summary { border: 0; box-shadow: var(--shadow-1); }
.island-map { background: linear-gradient(180deg, #BDE7FF 0%, #7FCBFF 35%, #3FA7F0 70%, #2D8BE0 100%); }
.stat-card { border: 0; box-shadow: var(--shadow-1); }
.toast { background: linear-gradient(135deg, #6C5CE7, #FF5FA2); color: #fff; }
.note { background: var(--blue-soft); }
.search-trigger:hover { border-color: var(--violet); }
.sr-item:hover, .sr-item:focus { background: var(--violet-soft); }
.wd-trans div.primary { background: var(--violet-soft); }
.faq summary::after { color: var(--violet); }
.method-line::before { background: linear-gradient(#FF5A5F, #FFB020, #1DB980, #6C5CE7); }
.method-line li:nth-child(1)::before { border-color: #FF5A5F; } .method-line li:nth-child(2)::before { border-color: #FFB020; } .method-line li:nth-child(3)::before { border-color: #1DB980; } .method-line li:nth-child(4)::before { border-color: #6C5CE7; }
.doc .placeholder { background: var(--yellow-soft); }
.cc-num { display: table; margin-bottom: 10px; }
.face.back .face-eyebrow { color: #fff !important; background: rgba(255,255,255,.18); padding: 3px 12px; border-radius: 999px; opacity: 1; } .fc-mastery { color: #FFE27A; }

/* ==========================================================================
   RIGHT-TO-LEFT (Arabic) and mixed-direction text
   German text is always isolated so punctuation and word order stay correct.
   ========================================================================== */
.de-word, .de-text, .sl-de, .tile, .de-opt span, .match-btn, .conj-form, .conj-pron, .sr-de, .w-word, .wr-word,
.face-word, .quiz-prompt, .cloze-sentence, .word-chip, .wc-word, .wd-word, .fb-answer, .ex-meta, .ex-hint, .opt-btn span,
.pattern th, .pattern td, .tl-text, .lm-card h3, .rl-title, .wd-ex, .ex-sentence, .sr-mean, .dw-word, .dw-mean, .wd-meaning { unicode-bidi: plaintext; }
.write-input, .order-line, .order-bank { direction: ltr; }
[dir="rtl"] .write-input { text-align: left; }
[dir="rtl"] .reading-card .de-text, [dir="rtl"] .reading-card h3 { direction: ltr; text-align: left; }
[dir="rtl"] .order-line, [dir="rtl"] .order-bank { justify-content: flex-start; }
[dir="rtl"] .pattern td.de-word, [dir="rtl"] .pattern th.de-cell { direction: ltr; text-align: right; }
[dir="rtl"] .display, [dir="rtl"] .page-title, [dir="rtl"] .hero-title, [dir="rtl"] .band-title, [dir="rtl"] .section-h, [dir="rtl"] .cc-title, [dir="rtl"] .ex-prompt { letter-spacing: 0; }
[dir="rtl"] .hero-title { line-height: 1.25; }
[dir="rtl"] .display { line-height: 1.3; }
[dir="rtl"] .lead, [dir="rtl"] .prose, [dir="rtl"] .doc p, [dir="rtl"] .doc li { line-height: 1.85; }
[dir="rtl"] .nav-link.active::before { border-radius: 4px 0 0 4px; }
[dir="rtl"] .lm-card:hover { transform: translateX(-3px); }
[dir="rtl"] .crumbs span[aria-hidden], [dir="rtl"] .arr { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .lv.avail::after { left: 0; right: 30px; }
[dir="rtl"] .opt-btn, [dir="rtl"] .match-btn, [dir="rtl"] .ob-opt, [dir="rtl"] .today-row { text-align: right; }
[dir="rtl"] .ob-opt { align-items: flex-start; }
[dir="rtl"] .ins-list li::before { content: "↖ "; }
[dir="rtl"] .search-trigger kbd { margin-inline-start: auto; }
[dir="rtl"] .cc-icon { inset-inline-end: 36px; }
[dir="rtl"] .streak-flame.lit { animation-name: flickerRtl; }
@keyframes flickerRtl { 50% { transform: scale(1.12) rotate(4deg); } }
@media (max-width: 900px) { [dir="rtl"] .levels::before { left: auto; right: 24px; } }
.wd-trans { margin: 0 0 14px; }
.wd-meaning { font-size: 21px; font-weight: 700; color: var(--violet); margin: 0; padding: 10px 14px; background: var(--violet-soft); border-radius: 12px; }
.ex-meta { font-family: var(--f-ui); font-weight: 600; font-size: .8em; line-height: 1.35; }
.pattern td.tr-cell { color: var(--ink-2); }

/* ==========================================================================
   TOP BAR — a station header: monogram sign, live status, rainbow route stripe
   ========================================================================== */
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.topbar { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0; height: var(--topbar-h); gap: 14px; padding: 0 22px 0 18px; box-shadow: 0 1px 0 var(--line); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: linear-gradient(90deg, #FF5A5F 0 20%, #FFB020 20% 40%, #1DB980 40% 60%, #3D7BFF 60% 80%, #6C5CE7 80% 100%); }
.brand { gap: 11px; }
.brand-sign { position: relative; width: 36px; height: 36px; border-radius: 9px; background: #1F1B3A; color: #fff; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; transform: rotate(-4deg); transition: transform .2s; }
.brand:hover .brand-sign { transform: rotate(0); }
.bs-letter { font-family: "Literata", Georgia, serif; font-weight: 700; font-size: 22px; line-height: 1; margin-top: -4px; }
.bs-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: linear-gradient(90deg, #FF5A5F 0 20%, #FFB020 20% 40%, #1DB980 40% 60%, #3D7BFF 60% 80%, #6C5CE7 80% 100%); }
:root[data-theme="dark"] .brand-sign { background: #fff; color: #1F1B3A; }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -.015em; }
.brand-tag { font-size: 12.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .01em; }
.search-trigger { height: 40px; min-width: 300px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--ink-3); padding: 0 10px 0 12px; gap: 10px; font-weight: 500; }
.search-trigger:hover { background: var(--surface-3); color: var(--ink-2); }
.search-trigger .ico { width: 18px; height: 18px; }
.search-trigger kbd { border: 0; background: var(--surface); color: var(--ink-3); border-radius: 6px; padding: 2px 7px; box-shadow: 0 1px 0 var(--line-strong); }
.tb-status { display: flex; gap: 6px; }
.tb-chip { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 11px; border-radius: 10px; text-decoration: none; color: var(--ink); font-size: 14.5px; }
.tb-chip:hover { background: var(--surface-2); }
.tb-chip b { font-weight: 700; font-variant-numeric: tabular-nums; }
.tb-unit { color: var(--ink-3); font-weight: 600; font-size: 13px; }
.flame { width: 19px; height: 19px; stroke: none; fill: var(--surface-3); }
.flame.lit { fill: url(#none); fill: #FF7A33; filter: drop-shadow(0 2px 4px rgba(255,122,51,.45)); }
.mini-ring { width: 20px; height: 20px; transform: rotate(-90deg); flex-shrink: 0; }
.mr-bg { fill: none; stroke: var(--surface-3); stroke-width: 3.2; }
.mr-fg { fill: none; stroke: #1DB980; stroke-width: 3.2; stroke-linecap: round; transition: stroke-dashoffset .6s; }
.top-controls { gap: 4px; }
.tb-icon { width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.tb-icon:hover { background: var(--surface-2); color: var(--ink); }
.auth-btn.logged-in { width: 36px; height: 36px; margin-inline-start: 6px; border-radius: 50%; background: #1F1B3A; color: #fff; font: 700 13px var(--f-ui); box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px #FFB020; }
:root[data-theme="dark"] .auth-btn.logged-in { background: #fff; color: #1F1B3A; }
.dd-trigger { height: 36px; border: 0; border-radius: 10px; background: transparent; font-weight: 700; color: var(--ink-2); padding: 0 10px; }
.dd-trigger:hover, .dd.open .dd-trigger { background: var(--surface-2); color: var(--ink); }
.deck-slot .dd-trigger { background: var(--surface-2); }
.dd-menu { border-radius: 14px; }
.dd-option.selected { background: var(--ink); color: var(--paper); }
.pub-links a { border-radius: 10px; }
.search-head .ico { color: var(--ink-3); }
@media (max-width: 1180px) { .search-trigger { min-width: 0; } .search-trigger .st-label, .search-trigger kbd { display: none; } .search-trigger { background: transparent; width: 40px; justify-content: center; padding: 0; } }
@media (max-width: 700px) { .tb-status .tb-chip:last-child { display: none; } .brand-sign { width: 32px; height: 32px; } .bs-letter { font-size: 19px; } }
@media (max-width: 420px) { .tb-status { display: none; } }

/* ==========================================================================
   SIDEBAR — the route map. Groups are coloured lines, pages are stations.
   ========================================================================== */
.sidenav { padding: 26px 18px 18px 22px; gap: 0; background: var(--surface); border-inline-end: 0; box-shadow: 1px 0 0 var(--line); }
.route-group { position: relative; padding: 2px 0 14px; }
.route-group::before { content: ""; position: absolute; inset-inline-start: 8px; top: 12px; bottom: 26px; width: 4px; border-radius: 4px; background: linear-gradient(var(--c), var(--c2, var(--c))); opacity: .28; transition: opacity .2s; }
.route-group.active::before { opacity: 1; }
.rg-solo::before { background: repeating-linear-gradient(var(--c) 0 5px, transparent 5px 10px); opacity: .35; }
.route-group:not(:has(.stop + .stop))::before { display: none; }
.line-head { position: relative; z-index: 1; margin: 2px 0 6px; }
.line-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 7px; background: linear-gradient(90deg, var(--c), var(--c2, var(--c))); color: #fff; font: 800 12.5px var(--f-ui); letter-spacing: .02em; box-shadow: 0 3px 8px -4px var(--c); }
.stop { position: relative; display: flex; align-items: center; gap: 14px; padding: 7px 10px 7px 0; margin: 1px 0; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: 15px; border-radius: 10px; }
.stop-dot { position: relative; z-index: 1; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 4px solid color-mix(in srgb, var(--c) 55%, var(--surface)); flex-shrink: 0; transition: transform .15s, border-color .15s, box-shadow .15s; }
.stop-label { transition: transform .15s; }
.stop:hover { color: var(--ink); }
.stop:hover .stop-dot { border-color: var(--c); transform: scale(1.12); }
.stop:hover .stop-label { transform: translateX(2px); }
[dir="rtl"] .stop:hover .stop-label { transform: translateX(-2px); }
.stop.active { color: var(--ink); font-weight: 800; }
.stop.active .stop-dot { background: var(--c); border-color: var(--c); box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 20%, transparent); }
.stop.active::after { content: ""; position: absolute; inset-inline-end: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.route-group[data-nav] .stop.active .stop-dot { background: var(--surface); border-width: 5px; }
.route-group[data-nav] .stop.active .stop-dot::after { content: ""; position: absolute; inset: 2px; border-radius: 50%; background: var(--c); }
.nav-group-label, .nav-link { display: none; }
.side-today { margin: 10px 0 0; padding: 14px; border-radius: 16px; background: var(--surface-2); display: grid; gap: 8px; }
.st-head { font-weight: 800; font-size: 13px; color: var(--ink-3); }
.st-row { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.st-row b { color: var(--ink); }
.st-next { display: flex; align-items: center; gap: 10px; margin-top: 4px; padding: 8px 10px; border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px; line-height: 1.25; border-inline-start: 4px solid var(--c); }
.st-next:hover { box-shadow: var(--shadow-1); }
.st-next-num { font: 800 12px var(--f-ui); color: var(--c); }
.sidenav-foot { padding: 16px 2px 0; }

/* bottom nav with drawn icons */
.bottomnav a .ni { display: flex; } .bottomnav a .ico { width: 22px; height: 22px; }
.bottomnav a.active .ico { stroke-width: 2.3; }
.stop { padding-block: 7px; padding-inline: 0 10px; }
.stop.active::after { display: none; }
.search-trigger, .tb-icon, .brand-sign { flex-shrink: 0; } @media (max-width: 1180px) { .search-trigger { width: 40px; height: 40px; } }

/* ---------- phone top bar: never wider than the screen ---------- */
html, body { overflow-x: clip; max-width: 100%; }
.topbar { min-width: 0; }
.brand { min-width: 0; }
.brand-text { min-width: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-slot-mobile { display: none; }
@media (max-width: 700px) {
  .topbar .deck-slot { display: none !important; }
  body[data-view="flash"] .deck-slot-mobile, body[data-view="quiz"] .deck-slot-mobile, body[data-view="words"] .deck-slot-mobile { display: flex; justify-content: flex-end; margin: -4px 0 10px; }
  .deck-slot-mobile .dd-trigger { background: var(--surface); box-shadow: var(--shadow-1); max-width: none; height: 38px; }
  .topbar { gap: 6px; padding: 0 10px; }
  .top-controls { gap: 2px; }
  .theme-toggle { display: none; }
  .search-trigger, .tb-icon { width: 38px; height: 38px; }
}
@media (max-width: 360px) { .brand-name { font-size: 15px; } }
.flash-rate { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.flash-rate .btn { min-width: 0; padding: 10px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.mode-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mode-card { min-width: 0; }
.mode-card-title, .mode-card-desc { overflow-wrap: anywhere; }
@media (max-width: 640px) { .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .mode-card { padding: 10px; gap: 8px; } .mode-card-icon { width: 32px; height: 32px; font-size: 16px; } }
@media (max-width: 380px) { .flash-rate .btn { font-size: 12.5px; } }
.quiz-options, .art-options, .match-grid, .home-grid, .stat-tiles, .result-stats { min-width: 0; }
.quiz-options > *, .match-grid > *, .caps > *, .rv-grid > *, .topic-grid > *, .dash-grid > *, .dash-grid3 > *, .lesson-grid > * { min-width: 0; }
/* pronunciation */
.speaker-btn.speaking { border-color: var(--violet); color: #fff; background: var(--violet); animation: speakPulse 1s ease-in-out infinite; }
@keyframes speakPulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--violet) 22%, transparent); } }
.pron-card select { margin-bottom: 12px; }
.pron-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pron-row .seg { flex: 1; min-width: 200px; }
.pron-tip { margin: 12px 0 0; }
.rec-credit { font-size: 13px; color: var(--ink-3); margin: 14px 0 0; }

/* ==========================================================================
   CALM PASS — colour carries meaning: progress, "you are here", the main action.
   Everything else sits on quiet white cards. Brand moments stay (route stripe,
   course line, Continue card, lesson colours, gradient buttons).
   ========================================================================== */
body { background-image:
    radial-gradient(900px 500px at 105% -10%, rgba(255,95,162,.07), transparent 60%),
    radial-gradient(800px 520px at -10% 10%, rgba(61,123,255,.07), transparent 60%); }

/* one place for streak + goal: the top bar (the dashboard shows them only on phones) */
.side-today { display: none; }
@media (min-width: 701px) { .dash-hello .habit { display: none; } }

/* quiet cards: no tinted backgrounds, no coloured top edges */
.panel, .journey, .today, #view-lesson .why, .lm-stop.s-done .lm-card, .word-card, .complete-card.passed { background: var(--surface); }
.dash-grid3 .panel, .rv-card, .stat-tile { border-top: 0 !important; }
.stat-tile::before { display: none; }
.rv-card.is-empty { border: 1.5px dashed var(--line-strong); }
.insight { background: var(--yellow-soft); }
:root[data-theme="dark"] .insight { background: var(--yellow-soft); }
.lm-final .lm-card { background: var(--yellow-soft); }
:root[data-theme="dark"] .lm-final .lm-card { background: var(--yellow-soft); }
.complete-card.passed { box-shadow: var(--shadow-2), inset 0 6px 0 var(--yellow); }

/* numbers in ink; colour only where it signals something */
.stat-tile b, .stat-tile:nth-child(n) b, .rv-count, .result-stats div:nth-child(n) dd, .today-list li:nth-child(n) .tl-n, .big-pct, .course-hero .big-pct { color: var(--ink) !important; }
.tc-num { color: var(--ink-3); }
.today-list li:nth-child(n) .today-row { background: var(--surface-2); }
.tl-n.zero { opacity: .35; }

/* progress bars: the A1 journey keeps the rainbow, everything else is one solid colour */
.meter span, .prog-row:nth-of-type(n) .meter span { background: var(--violet); }
.meter-red span { background: linear-gradient(90deg, #FF5A5F, #FFB020, #1DB980, #3D7BFF, #6C5CE7); }
.dw-meter .meter span { background: var(--green); }

/* the lesson line: colour for done and "you are here", neutral for what's ahead */
.mini-line::before { background: var(--surface-3); opacity: 1; }
.ml-stop.s-open .ml-dot, .ml-stop.s-locked .ml-dot { border-color: var(--line-strong); background: var(--surface); }
.ml-stop.s-open .ml-num, .ml-stop.s-locked .ml-num { color: var(--ink-3); }
.ml-stop.s-done .ml-num { color: var(--ink-2); }
.ml-final .ml-dot { background: var(--surface-2) !important; }

/* course map: completed cards stay white; colour lives in the dot and icon tile */
.lm-stop.s-current .lm-card { background: var(--surface); }
.lm-stop.s-locked .lm-card { border-color: var(--line-strong); }
.lm-stop.s-locked .lm-icon { background: var(--surface-2); }

/* activity chart that is actually readable */
.dc-bar { background: color-mix(in srgb, var(--violet) 55%, var(--surface)); }
.dc-bar.goal { background: var(--green); }

/* calmer extras */
.ins-icon { box-shadow: none; }
.cap { background: var(--surface); border: 1px solid var(--line); }
.cap h3 { color: var(--ink); }
.cap:hover { transform: translateY(-2px); }
.sentence-list li { border-inline-start-width: 4px; }
.dash-grid > *, .dash-grid3 > *, .lesson-grid > *, .rv-grid > * { margin-top: 0 !important; }

/* ---------- tidy pass for bigger lessons and small screens ---------- */
.learn-progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: -4px 0 18px; }
.learn-progress span { display: block; height: 100%; border-radius: 6px; background: var(--c, var(--violet)); transition: width .25s ease; }
.wc-word.wc-long { font-size: clamp(26px, 4.4vw, 36px); }
.toast { top: calc(env(safe-area-inset-top, 0px) + var(--topbar-h) + 12px) !important; bottom: auto !important; transform: translateX(-50%) translateY(-12px); max-width: min(420px, calc(100vw - 32px)); padding: 10px 18px; font-size: 14.5px; }
.toast.show { transform: translateX(-50%) translateY(0); }
.mini-line { scroll-behavior: smooth; scrollbar-width: none; }
.mini-line::-webkit-scrollbar { display: none; }
@media (max-width: 700px) {
  .habit { gap: 8px; }
  .habit-item { padding: 8px 12px 8px 8px; gap: 8px; min-width: 0; }
  .habit-item b { font-size: 14.5px; white-space: nowrap; }
  .habit-item span { font-size: 12.5px; white-space: nowrap; }
  .habit-item .ring { width: 34px; height: 34px; }
  .habit-item .streak-flame { width: 30px; font-size: 20px; }
  .journey-head { flex-wrap: wrap; gap: 4px 12px; }
  .wc-word { font-size: clamp(30px, 9vw, 40px); }
  .wc-word.wc-long { font-size: 26px; }
}
.toast { width: max-content; }
@media (hover: none), (max-width: 700px) { .kbd-hint, .flash-hint { display: none; } }
/* sort the nouns */
.sort-hint { color: var(--ink-3); font-size: 14.5px; margin: -8px 0 14px; }
.sort-pool { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; min-height: 44px; }
.sort-chip { font-size: 18px; padding: 9px 14px; border-radius: 12px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--line-strong); }
.sort-chip.sel { border-color: var(--violet); background: var(--violet-soft); transform: translateY(-2px); }
.sort-chip.placed { display: none; }
.sort-buckets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.sort-bucket { min-height: 150px; border-radius: 16px; padding: 10px; cursor: pointer; border: 2px dashed currentColor; background: color-mix(in srgb, currentColor 7%, var(--surface)); transition: transform .12s; }
.sort-bucket.art-der { color: var(--der); } .sort-bucket.art-die { color: var(--die); } .sort-bucket.art-das { color: var(--das); }
.sort-bucket:hover { transform: translateY(-2px); }
.sort-bucket.wrong, .sort-bucket.nudge { animation: shake .35s; }
.sb-label { display: block; font: 800 18px var(--f-ui); text-align: center; margin-bottom: 8px; }
.sb-items { display: flex; flex-direction: column; gap: 6px; }
.sb-item { font-size: 15.5px; color: var(--ink); background: var(--surface); border-radius: 10px; padding: 6px 8px; text-align: center; animation: popIn .3s; }

/* ==========================================================================
   DASHBOARD — quieter: one accent (violet), the lesson colour only as a detail
   ========================================================================== */
#view-dashboard .continue-card { background: #1F1B3A; color: #fff; box-shadow: var(--shadow-2); border-inline-start: 6px solid var(--c); }
:root[data-theme="dark"] #view-dashboard .continue-card { background: #2A2647; }
#view-dashboard .continue-card::before { display: none; }
#view-dashboard .continue-card::after { border-color: color-mix(in srgb, var(--c) 35%, transparent); opacity: .6; }
#view-dashboard .cc-num { background: var(--c); color: #fff; }
#view-dashboard .cc-eyebrow { color: rgba(255,255,255,.65); }
#view-dashboard .cc-icon { animation: none; opacity: .9; }
#view-dashboard .continue-card .btn.accent { background: #fff; color: #1F1B3A; box-shadow: none; }
#view-dashboard .meter-red span { background: var(--violet); }
#view-dashboard .mini-line::before { background: var(--surface-3); }
#view-dashboard .ml-stop.s-done .ml-dot { background: var(--violet); border-color: var(--violet); }
#view-dashboard .ml-stop.s-current .ml-dot { border-color: var(--violet); box-shadow: 0 0 0 5px var(--violet-soft); }
#view-dashboard .ml-stop.s-current .ml-num { color: var(--violet); }
#view-dashboard .ml-stop .ml-num { color: var(--ink-3); }
#view-dashboard .insight { background: var(--surface); box-shadow: var(--shadow-1); }
#view-dashboard .ins-icon { background: var(--yellow-soft); }
#view-dashboard .habit-item { background: var(--surface) !important; box-shadow: var(--shadow-1); }
#view-dashboard .btn.primary { background: var(--violet); box-shadow: 0 3px 0 color-mix(in srgb, var(--violet) 65%, #000); }
#view-dashboard .btn.primary:hover { background: color-mix(in srgb, var(--violet) 88%, #000); }
#view-dashboard .today-row .tl-n { color: var(--ink); }
#view-dashboard .tl-dot { background: var(--surface-2); }
#view-dashboard .tl-score { color: var(--ink-2); }
#view-dashboard .word-chip .art-dot { opacity: .8; }
.toast { background: #1F1B3A !important; color: #fff; } :root[data-theme="dark"] .toast { background: #fff !important; color: #1F1B3A; }

/* the article sits right in front of its noun, in its colour */
.art-in { font-weight: 800; }
.art-in.art-der { color: var(--der); } .art-in.art-die { color: var(--die); } .art-in.art-das { color: var(--das); }
.face-word .art-in { filter: brightness(1.35); }
.noart-note { display: inline-block; margin-inline-start: 8px; font: 700 12px var(--f-ui); color: var(--ink-3); background: var(--surface-2); border-radius: 999px; padding: 3px 9px; vertical-align: middle; }
.ex-prompt .noart-note { font-size: 12.5px; }
.art-in, .art-in.art-der, .art-in.art-die, .art-in.art-das { background: none !important; box-shadow: none !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; display: inline !important; width: auto !important; height: auto !important; font-size: inherit !important; line-height: inherit !important; }
.art-in.art-der { color: var(--der) !important; } .art-in.art-die { color: var(--die) !important; } .art-in.art-das { color: var(--das) !important; }
.face-word .art-in.art-der { color: #9FC1FF !important; } .face-word .art-in.art-die { color: #FFB3B8 !important; } .face-word .art-in.art-das { color: #8CE8C3 !important; }

/* placement test results */
.pl-results { list-style: none; margin: 18px auto 22px; padding: 0; max-width: 520px; text-align: start; display: grid; gap: 6px; }
.pl-results li { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 12px; background: var(--surface-2); font-size: 15px; }
.pl-results li.ok span { color: var(--green); font-weight: 800; } .pl-results li.no { background: var(--violet-soft); } .pl-results li.no span { color: var(--violet); font-weight: 800; }
.pl-results em { margin-inline-start: auto; font-style: normal; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.link-btn { background: none; border: 0; color: var(--violet); font: 700 13.5px var(--f-ui); cursor: pointer; padding: 4px 6px; margin-inline-start: 10px; text-decoration: underline; }

body[data-view="flash"] .deck-slot, body[data-view="quiz"] .deck-slot,
body[data-view="flash"] .deck-slot-mobile, body[data-view="quiz"] .deck-slot-mobile { display: none !important; }

.listen-hint { font: 600 15px var(--f-ui); color: var(--ink-3); }
.advice-card { grid-column: 1 / -1; display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-1); border-inline-start: 5px solid var(--violet); }
.advice-card h2 { font: 800 18px var(--f-ui); margin: 0 0 6px; } .advice-card p { margin: 0 0 12px; color: var(--ink-2); }
.adv-icon { font-size: 30px; line-height: 1; }

.write-input.almost { border-color: var(--yellow) !important; box-shadow: 0 0 0 4px var(--yellow-soft); }
.case-warn { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--yellow-soft); color: var(--ink); font-size: 14.5px; }
.case-warn .de-word { font-weight: 800; }
.write-input.shake { animation: shake .35s; }
/* buttons on the coloured results card: see-through with white text (was white-on-white) */
.btn.ghost.light, #islandResultsBack { background: rgba(255,255,255,.16) !important; color: #fff !important; border: 2px solid rgba(255,255,255,.75) !important; box-shadow: none !important; white-space: nowrap; }
.btn.ghost.light:hover, #islandResultsBack:hover { background: rgba(255,255,255,.28) !important; }
.btn.ghost.light .arr, #islandResultsBack .arr { color: #fff; }
.results-card #resultsScore, .results-card #resultsLine, .results-card .big { color: #fff !important; }

/* answer targets stay still when pressed (a moving target can swallow a light tap) */
.opt-btn:active, .match-btn:active, .tile:active, .sort-chip:active, .sort-bucket:active, .ob-opt:active { transform: none !important; }
.opt-btn, .match-btn, .tile, .sort-chip, .sort-bucket, .ob-opt { touch-action: manipulation; -webkit-user-select: none; user-select: none; }

.deck-slot, .deck-slot-mobile, #deckDropdown { display: none !important; }
.add-form .form-row:has(.deck-choice) { display: none !important; }
.case-warn { display: block; width: 100%; box-sizing: border-box; margin: 0 0 10px !important; flex-basis: 100%; }
.again-tag { display: inline-block; font: 800 11.5px var(--f-ui); color: var(--violet); background: var(--violet-soft); border-radius: 999px; padding: 2px 8px; margin-inline-end: 6px; text-transform: none; letter-spacing: 0; }

/* capital-letter pop-up */
.cw-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(20, 16, 40, .45); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fadeIn .15s; }
.cw-pop { width: min(380px, 100%); background: var(--surface); border-radius: 22px; padding: 26px 24px 22px; text-align: center; box-shadow: 0 24px 60px -12px rgba(0,0,0,.35); border-top: 6px solid var(--yellow); animation: popIn .2s; }
.cw-icon { font-size: 34px; line-height: 1; margin-bottom: 6px; }
.cw-pop h2 { font: 800 22px var(--f-ui); margin: 0 0 6px; color: var(--ink); }
.cw-pop p { margin: 0 0 10px; color: var(--ink-2); font-size: 15px; }
.cw-answer { font-size: 26px !important; color: var(--ink) !important; margin: 6px 0 18px !important; }
.cap-hl { color: var(--violet); font-weight: 800; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 4px; }
.cw-pop .btn { width: 100%; }
.dlg-pop { width: min(420px, 100%); border-top-color: var(--violet); } .dlg-actions { display: grid; gap: 8px; margin-top: 6px; } .dlg-pop p { line-height: 1.55; }

/* ============================ CHALLENGES ============================ */
.ch-summary { display: grid; grid-template-columns: auto 1fr auto; gap: 20px; align-items: center; padding: 20px 22px; margin: 0 0 26px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1); }
.ch-sum-num { text-align: center; min-width: 86px; padding-inline-end: 18px; border-inline-end: 1px solid var(--line); }
.ch-sum-num b { display: block; font: 800 40px var(--f-display); color: var(--violet); line-height: 1; }
.ch-sum-num span { font: 700 12.5px var(--f-ui); color: var(--ink-3); }
.ch-eyebrow { font: 800 12px var(--f-ui); color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
.ch-sum-next h2 { font: 800 20px var(--f-ui); margin: 4px 0; color: var(--ink); }
.ch-sum-next p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.ch-hard { display: inline-block; font: 800 11px var(--f-ui); color: #fff; background: var(--red); border-radius: 999px; padding: 2px 8px; vertical-align: middle; }
.ch-line { list-style: none; margin: 0; padding: 0; position: relative; }
.ch-line::before { content: ""; position: absolute; inset-inline-start: 19px; top: 20px; bottom: 20px; width: 4px; border-radius: 4px; background: var(--surface-3); }
.ch-stop { position: relative; padding-inline-start: 60px; padding-block-end: 12px; }
.ch-dot { position: absolute; inset-inline-start: 7px; top: 18px; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 800 13px var(--f-ui); background: var(--surface); border: 4px solid var(--line-strong); color: var(--ink-3); z-index: 1; }
.s-done .ch-dot { background: var(--c); border-color: var(--c); color: #fff; }
.s-current .ch-dot { border-color: var(--c); color: var(--c); box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 18%, transparent); }
.ch-card { display: flex; align-items: center; gap: 16px; padding: 14px 18px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-1); }
.s-current .ch-card { box-shadow: 0 0 0 2px var(--c), var(--shadow-2); }
.s-locked .ch-card { background: transparent; box-shadow: none; border: 1.5px dashed var(--line-strong); }
.ch-main { flex: 1; min-width: 0; }
.ch-num { font: 800 12px var(--f-ui); color: var(--c); }
.s-locked .ch-num { color: var(--ink-3); }
.ch-card h3 { font: 800 17px var(--f-ui); margin: 2px 0 2px; color: var(--ink); }
.s-locked .ch-card h3, .s-locked .ch-card p { color: var(--ink-3); }
.ch-card p { margin: 0; font-size: 14px; color: var(--ink-2); }
.ch-meta { margin-top: 4px !important; font-size: 13px !important; color: var(--ink-3) !important; font-weight: 600; }
.ch-lock { font: 700 13px var(--f-ui); color: var(--ink-3); white-space: nowrap; }
@media (max-width: 640px) {
  .ch-summary { grid-template-columns: auto 1fr; }
  .ch-summary .btn { grid-column: 1 / -1; width: 100%; }
  .ch-card { flex-wrap: wrap; } .ch-card .btn { width: 100%; } .ch-lock { width: 100%; }
}

/* ============================ GAMES ============================ */
.ch-card { align-items: center; }
.ch-game { font-size: 30px; width: 52px; height: 52px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border-radius: 14px; background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.s-locked .ch-game { filter: grayscale(1); opacity: .5; }
.ch-stars { margin: 4px 0 0 !important; color: #F5B800 !important; font-size: 17px !important; letter-spacing: 2px; }
.ch-stars span { color: var(--line-strong); }
.gm { max-width: 760px; margin: 0 auto; }
.gm-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.gm-title { font: 800 17px var(--f-ui); color: var(--ink); flex: 1; min-width: 0; }
.gm-hud { display: flex; gap: 8px; align-items: center; }
.hud-item, .hud-combo, .hud-hearts { font: 700 14px var(--f-ui); background: var(--surface); border-radius: 999px; padding: 6px 12px; box-shadow: var(--shadow-1); color: var(--ink-2); white-space: nowrap; }
.hud-item b { color: var(--ink); }
.hud-combo { background: #FFF1D6; color: #B25E00; animation: popIn .25s; }
.hud-hearts .lost { opacity: .45; }
.gm-stage { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-2); padding: 26px 22px; min-height: 380px; border-top: 6px solid var(--c); }
.gm-intro { text-align: center; padding: 20px 6px; }
.gm-big-icon { font-size: 64px; line-height: 1; margin-bottom: 10px; }
.gm-intro h2 { font: 800 26px var(--f-ui); margin: 0 0 8px; }
.gm-rules { font-size: 16.5px; color: var(--ink-2); max-width: 520px; margin: 0 auto 10px; line-height: 1.55; }
.gm-stars-rule { color: #B58800; font-weight: 700; font-size: 14px; margin: 0 0 20px; }
/* rush */
.rush-bar, .surv-timer { height: 10px; border-radius: 10px; background: var(--surface-3); overflow: hidden; margin-bottom: 26px; }
.rush-bar span, .surv-timer span { display: block; height: 100%; width: 100%; background: var(--c); border-radius: 10px; transition: width .1s linear; }
.rush-word { text-align: center; font-size: clamp(38px, 8vw, 58px); min-height: 80px; margin-bottom: 26px; }
.rush-word.pop { animation: popIn .22s; }
.rush-btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gm-art { position: relative; border: 0; border-radius: 18px; padding: 22px 8px; cursor: pointer; font: 800 26px var(--f-ui); color: #fff; box-shadow: 0 5px 0 rgba(0,0,0,.18); }
.gm-art.art-der { background: var(--der); } .gm-art.art-die { background: var(--die); } .gm-art.art-das { background: var(--das); }
.gm-art kbd { position: absolute; top: 8px; inset-inline-end: 10px; font: 700 12px var(--f-ui); opacity: .7; background: none; border: 0; color: #fff; }
.gm-art.ok { outline: 5px solid #19C37D; outline-offset: 3px; } .gm-art.no { animation: shake .35s; opacity: .55; }
/* bee */
.bee { text-align: center; }
.bee-mean { font: 700 22px var(--f-ui); margin: 0 0 16px; color: var(--ink); }
.bee-arts { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.bee-art { border: 2px solid currentColor; background: var(--surface); border-radius: 12px; padding: 8px 18px; font: 800 18px var(--f-ui); cursor: pointer; }
.bee-art.art-der { color: var(--der); } .bee-art.art-die { color: var(--die); } .bee-art.art-das { color: var(--das); }
.bee-art.sel { color: #fff; } .bee-art.art-der.sel { background: var(--der); } .bee-art.art-die.sel { background: var(--die); } .bee-art.art-das.sel { background: var(--das); }
.bee-slots { font-size: clamp(30px, 6vw, 42px); min-height: 56px; margin-bottom: 18px; letter-spacing: 1px; }
.bee-gap { color: var(--line-strong); }
.bee-tiles { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 16px; }
.gm-tile { min-width: 46px; height: 50px; border-radius: 12px; border: 2px solid var(--line-strong); background: var(--surface); font: 700 22px var(--f-display); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 var(--line-strong); padding: 0 10px; }
.gm-tile:disabled { opacity: .25; cursor: default; }
.bee-fb, .surv-fb { min-height: 28px; margin: 14px 0 0; font: 700 20px var(--f-ui); }
.bee-fb.ok, .surv-fb.ok { color: #0F9D63; } .bee-fb.no, .surv-fb.no { color: var(--red); }
.bee-fb .btn { margin-top: 10px; }
/* dictation */
.dict-play { text-align: center; margin-bottom: 18px; }
.dict-big { width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--c); color: #fff; font-size: 40px; cursor: pointer; box-shadow: 0 8px 20px -6px var(--c); margin-bottom: 10px; }
.dict-big.speaking { animation: speakPulse 1s infinite; }
.dict-fb { margin-top: 16px; text-align: center; }
.dict-diff { font-size: 24px; line-height: 1.6; margin: 0 0 6px; }
.dw { padding: 1px 4px; border-radius: 6px; } .dw.ok { background: #DDF7EA; color: #0B7A4B; } .dw.no { background: #FFE1E3; color: #C02332; text-decoration: underline wavy; } .dw.case { background: var(--yellow-soft); color: #8A6100; }
.dict-score { font-weight: 800; color: var(--ink-2); margin: 0 0 4px; } .dict-tr { color: var(--ink-3); margin: 0 0 14px; }
/* conversation */
.talk-scene { font: 800 15px var(--f-ui); color: var(--ink-3); text-align: center; margin-bottom: 14px; }
.talk-log { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.bub { max-width: 82%; padding: 10px 14px; border-radius: 18px; animation: popIn .25s; }
.bub.npc { align-self: flex-start; background: var(--surface-2); border-end-start-radius: 4px; }
.bub.me { align-self: flex-end; background: var(--c); color: #fff; border-end-end-radius: 4px; }
.bub-who { display: block; font: 800 11.5px var(--f-ui); opacity: .7; margin-bottom: 2px; }
.bub-de { font-size: 19px; }
.bub-tr-btn { display: block; background: none; border: 0; color: var(--violet); font: 700 12.5px var(--f-ui); cursor: pointer; padding: 4px 0 0; }
.bub-tr { display: block; color: var(--ink-3); font-size: 14px; }
.talk-q { font: 800 13px var(--f-ui); color: var(--ink-3); margin: 0 0 8px; }
.talk-opts { display: grid; gap: 8px; }
.talk-opt { text-align: start; border: 2px solid var(--line-strong); background: var(--surface); border-radius: 14px; padding: 12px 16px; font-size: 18px; cursor: pointer; color: var(--ink); }
.talk-opt:hover { border-color: var(--c); } .talk-opt.no { border-color: var(--red); background: #FFE9EB; opacity: .6; animation: shake .35s; }
/* survival */
.surv .ex-prompt { font-size: 28px; margin: 6px 0 18px; }
.surv-opts { display: grid; gap: 8px; }
.surv-opt { text-align: start; border: 2px solid var(--line-strong); background: var(--surface); border-radius: 14px; padding: 12px 16px; font-size: 17px; cursor: pointer; color: var(--ink); }
.surv-opt.ok { border-color: #19C37D; background: #E3F9EF; } .surv-opt.no { border-color: var(--red); background: #FFE9EB; }
/* result */
.gm-result { text-align: center; padding: 10px 0; }
.gm-res-stars { font-size: 64px; letter-spacing: 8px; margin-bottom: 6px; }
.gm-res-stars span { color: var(--line-strong); display: inline-block; }
.gm-res-stars span.on { color: #F5B800; animation: popIn .45s both; text-shadow: 0 4px 14px rgba(245,184,0,.45); }
.gm-result h2 { font: 800 26px var(--f-ui); margin: 0 0 6px; }
.gm-res-line { color: var(--ink-2); font-size: 16px; margin: 0 0 16px; }
@media (max-width: 640px) {
  .gm-stage { padding: 20px 14px; } .gm-art { padding: 18px 4px; font-size: 22px; } .bub { max-width: 92%; }
}

/* ---------- course map on phones: text gets the full card width ---------- */
@media (max-width: 640px) {
  .lm-card { display: grid !important; grid-template-columns: 46px minmax(0, 1fr); column-gap: 12px; row-gap: 8px; align-items: start; padding: 14px 14px 14px !important; }
  .lm-icon { grid-column: 1; grid-row: 1; width: 46px !important; height: 46px !important; font-size: 24px !important; border-radius: 12px !important; margin: 0 !important; }
  .lm-body { grid-column: 2; grid-row: 1; min-width: 0; }
  .lm-card > .lm-body:first-child { grid-column: 1 / -1; }
  .lm-card h3 { font-size: 19px !important; line-height: 1.25 !important; margin: 2px 0 4px !important; }
  .lm-card .lm-body p { font-size: 14.5px; line-height: 1.45; }
  .lm-badge { grid-column: 1 / -1; justify-self: start; margin: 2px 0 0 !important; }
}
@media (max-width: 640px) {
  .ch-summary { grid-template-columns: 1fr !important; gap: 10px !important; text-align: start; }
  .ch-sum-num { display: flex; align-items: baseline; gap: 8px; text-align: start; border: 0 !important; padding: 0 !important; min-width: 0; }
  .ch-sum-num b { font-size: 30px; }
  .ch-card { display: grid !important; grid-template-columns: 40px minmax(0, 1fr); column-gap: 12px; row-gap: 10px; align-items: start; padding: 14px !important; }
  .ch-game { width: 40px !important; height: 40px !important; font-size: 22px !important; border-radius: 11px !important; grid-column: 1; grid-row: 1; }
  .ch-main { grid-column: 2; grid-row: 1; }
  .ch-card .btn, .ch-lock { grid-column: 1 / -1; width: 100%; }
  .ch-stop { padding-inline-start: 46px !important; }
}
.retype-hint { margin: 6px 0 0; font: 700 13.5px var(--f-ui); color: #8A6100; }

/* ======================= ROUTE ======================= */
.route { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1); padding: 18px 20px; margin: 0 0 22px; }
.route-head { margin-bottom: 10px; } .route-head .panel-title { margin: 0 0 2px; }
.rt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rt-step { display: grid; grid-template-columns: 30px 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.rt-step.rt-next { background: var(--violet-soft); box-shadow: inset 0 0 0 2px var(--violet); }
.rt-step.rt-done { opacity: .65; }
.rs-num { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font: 800 14px var(--f-ui); background: var(--surface); color: var(--ink-2); border: 2px solid var(--line-strong); }
.rt-next .rs-num { background: var(--violet); border-color: var(--violet); color: #fff; }
.rt-done .rs-num { background: var(--green); border-color: var(--green); color: #fff; }
.rs-icon { font-size: 26px; text-align: center; }
.rs-body { min-width: 0; } .rs-body b { display: block; font: 800 15.5px var(--f-ui); color: var(--ink); }
.rs-body span { display: block; font-size: 13.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-body em { font-style: normal; font: 700 12px var(--f-ui); color: var(--green); }
@media (max-width: 640px) {
  .route { padding: 14px; }
  .rt-step { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .rs-icon { display: none; } .rs-num { width: 26px; height: 26px; font-size: 12.5px; }
  .rs-body span { white-space: normal; }
}
/* the "Next step" bar */
.next-bar { position: fixed; z-index: 60; inset-inline-end: 24px; bottom: 24px; display: flex; align-items: center; gap: 10px; max-width: min(560px, calc(100vw - 48px)); padding: 10px 10px 10px 16px; background: var(--surface); border-radius: 999px; box-shadow: 0 12px 30px -10px rgba(30, 20, 80, .35), 0 0 0 1px var(--line); animation: popIn .25s; }
.next-bar[hidden] { display: none; }
.nb-label { font: 800 11.5px var(--f-ui); color: var(--violet); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.nb-icon { font-size: 20px; }
.nb-title { font: 700 14px var(--f-ui); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 700px) {
  .next-bar { inset-inline: 10px; bottom: calc(env(safe-area-inset-bottom, 0px) + 74px); max-width: none; border-radius: 16px; padding: 8px 8px 8px 12px; }
  .nb-label { display: none; }
}
.gm-next:empty { display: none; } .gm-next { margin-top: 10px; }

.route .rt-step { display: grid !important; border: 0 !important; margin: 0 !important; }
.route .rt-step::before, .route .rt-step::after { display: none !important; content: none !important; }
.route .rt-step > .btn { justify-self: end; }

.route .rt-step { padding: 12px 14px !important; }
@media (max-width: 640px) { .route .rt-step { padding: 10px 10px 10px 10px !important; gap: 10px; } }

.unit-cards { display: grid; gap: 12px; }
.unit-card { background: var(--surface); border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow-1); border-inline-start: 5px solid var(--c); }
.uc-head { font: 800 15px var(--f-ui); color: var(--ink); }
.uc-icons { font-size: 20px; letter-spacing: 4px; margin: 6px 0 4px; }
.uc-topics { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.uc-final { border-inline-start-color: #F5B800; }

.gm-goal { text-align: center; padding: 18px 6px; animation: popIn .3s; }
.gm-goal h2 { font: 800 24px var(--f-ui); margin: 0 0 6px; }
.gm-goal p { color: var(--ink-2); max-width: 440px; margin: 0 auto 16px; }
.gm-goal-stars { font-size: 40px; letter-spacing: 6px; margin: 4px 0 8px !important; }
.gm-goal-stars span { color: var(--line-strong); } .gm-goal-stars .on { color: #F5B800; text-shadow: 0 4px 14px rgba(245,184,0,.45); }
.hud-bonus { background: #FFF6D9; color: #8A6100; }
.cloze-hint { display: block; margin-top: 10px; font: 600 16px var(--f-ui); color: var(--ink-3); }

/* keyboard-shortcut badges: only with a keyboard, and quiet so they never look like part of an answer */
.opt-key, .quiz-options .opt-btn .opt-key { background: transparent !important; color: var(--ink-3) !important; border: 1.5px solid var(--line-strong); font-size: 11.5px; width: 22px; height: 22px; opacity: .75; }
@media (hover: none), (pointer: coarse) { .opt-key { display: none !important; } }

.conj-star { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font: 700 13px var(--f-ui); cursor: pointer; }
.conj-star.on { border-color: #F5B800; background: #FFF6D9; color: #8A6100; }
.ss-fb-msg .conj-star { margin: 8px 0 0; display: flex; width: max-content; }
.wc-extra { display: inline-block; margin: 0 auto 6px; font: 700 11.5px var(--f-ui); color: var(--ink-3); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 999px; padding: 3px 10px; }
.bonus-pack { margin-top: 18px; border: 1.5px dashed var(--line-strong); box-shadow: none !important; } .bonus-pack .btn { margin-top: 10px; }

/* ======================= GRAMMAR LAB ======================= */
.lab-bar { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.lab-dot { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); opacity: .45; font-size: 17px; }
.lab-dot.done { opacity: .8; background: #E3F9EF; } .lab-dot.now { opacity: 1; background: var(--violet-soft); box-shadow: 0 0 0 2px var(--violet); }
.lab-card { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1); padding: 20px; animation: popIn .25s; }
.lab-kicker { display: block; font: 800 13px var(--f-ui); color: var(--violet); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.lab-kicker-out { margin: 0 0 10px; text-transform: none; letter-spacing: 0; font-size: 14px; }
.lab-lead { color: var(--ink-2); margin: 0 0 12px; }
.lab-examples { margin: 0 0 16px; padding-inline-start: 22px; display: grid; gap: 10px; }
.lab-examples li { font-size: 19px; }
.lab-tr { display: block; font: 500 14px var(--f-ui); color: var(--ink-3); }
mark.hl, .lab-forms .hl { background: #FFE7A3; color: #6B4A00; border-radius: 5px; padding: 0 3px; font-weight: 700; }
.lab-q { font: 800 16px var(--f-ui); margin: 6px 0 8px; }
.lab-opts { display: grid; gap: 8px; } .lab-opt { text-align: start; }
.lab-fb { margin-top: 12px; } .lab-fb .btn { margin-inline-start: 6px; }
.lab-rule-main { font-size: 17px; }
.pattern-table td.hl-cell { background: #FFF4D1; font-weight: 700; }
.lab-more { margin: 10px 0; } .lab-more summary { cursor: pointer; font: 700 14px var(--f-ui); color: var(--violet); }
.lab-forms { margin: 0 0 10px; line-height: 2; }
textarea.lab-own { width: 100%; min-height: 64px; resize: vertical; font-size: 18px; margin-bottom: 10px; }
.lab-good { color: #0F9D63; font-weight: 700; } .lab-try { color: #8A6100; font-weight: 700; }
.lab-src { font-size: 20px; margin: 6px 0 2px; }
.sent-struct { margin-top: 8px; font-size: 19px; line-height: 1.8; }
.ss-v2 { background: #E9E3FF; color: #4B2FB8; border-radius: 6px; padding: 1px 5px; font-weight: 700; }
.ss-end { background: #FFE0EE; color: #A3195B; border-radius: 6px; padding: 1px 5px; font-weight: 700; }
.ss-legend { display: block; font: 600 12px var(--f-ui); color: var(--ink-3); margin-top: 2px; }
.ss-legend i { font-style: normal; padding: 0 3px; }
.spot-line { display: flex; flex-wrap: wrap; gap: 6px; font-size: 21px; margin: 6px 0 4px; }
.spot-tok { border: 2px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 6px 10px; font: inherit; cursor: pointer; color: var(--ink); }
.spot-tok:hover { border-color: var(--violet); }
.spot-tok.spot-bad { border-color: var(--red); background: #FFE9EB; text-decoration: line-through; }
.spot-tok.spot-miss { border-color: #F5B800; }
table.pattern td.hl-cell { background: #FFF4D1; font-weight: 700; color: #6B4A00; }

.lab-why { background: #EEF6FF; border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; color: var(--ink); font-size: 15px; }
.lab-why b { color: #1D5FB8; }
.lab-sub { font: 800 14px var(--f-ui); margin: 6px 0 6px; color: var(--ink-2); }
.lab-pairs { display: grid; gap: 8px; margin-bottom: 14px; }
.lab-pair { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.lp-ok { color: #0B7A4B; font-size: 18px; } .lp-bad { color: #C02332; font-size: 16px; text-decoration: line-through; text-decoration-color: rgba(192,35,50,.5); }
.lab-h { font: 800 13px var(--f-ui); color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; margin: 12px 0 6px; }
.lab-trap, .lab-tip { display: grid; gap: 2px; border-radius: 12px; padding: 10px 12px; margin: 12px 0 0; font-size: 15px; }
.lab-trap { background: #FFF1F1; border-inline-start: 4px solid var(--red); } .lab-trap b { color: #C02332; }
.lab-tip { background: #FFF8E1; border-inline-start: 4px solid #F5B800; } .lab-tip b { color: #8A6100; }
.lab-score { display: flex; align-items: baseline; gap: 12px; padding: 12px 14px; border-radius: 14px; background: #FFF1F1; margin: 4px 0 14px; }
.lab-score.good { background: #E3F9EF; } .lab-score b { font: 800 30px var(--f-ui); }
.lab-can { border-top: 1px solid var(--line); padding: 12px 0 4px; } .lab-can h4 { margin: 0 0 4px; font: 800 16px var(--f-ui); }
.lab-can-line { font-weight: 700; color: #0B7A4B; margin: 0 0 6px; }
.lab-model { font-size: 18px; margin: 6px 0; }
.recovery-card { background: #EAF8F0; border: 2px solid #19C37D; border-radius: 18px; padding: 16px 18px; margin: 0 0 18px; } .recovery-card h2 { margin: 0 0 6px; font: 800 18px var(--f-ui); } .recovery-card p { margin: 0 0 10px; color: var(--ink-2); }


/* Lesson 0: alphabet */
.alph { max-width: 920px; }
.alph-hero { margin: 14px 0 8px; }
.alph-badge { display: inline-block; font: 800 12.5px var(--f-ui); color: #5B3FD8; background: #EEE9FF; border-radius: 999px; padding: 4px 12px; margin-bottom: 8px; }
.alph-why { background: #EEF6FF; border-radius: 14px; padding: 12px 14px; color: var(--ink); max-width: 720px; }
.alph-sec { margin: 30px 0; }
.alph-sec h2 { font: 800 21px var(--f-ui); margin: 0 0 4px; color: var(--ink); }
.alph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; margin-top: 14px; }
.alph-tile { display: grid; gap: 2px; justify-items: center; padding: 12px 6px 10px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; transition: transform .12s, border-color .12s; color: var(--ink); }
.alph-tile b { font: 700 30px var(--f-display); line-height: 1; } .alph-tile b small { font-size: 18px; margin-inline-start: 3px; color: var(--ink-3); }
.alph-name { font: 800 13px var(--f-ui); color: #5B3FD8; } .alph-ex { font-size: 12.5px; color: var(--ink-3); }
.alph-tile:hover { border-color: #7C5CFA; transform: translateY(-2px); }
.alph-tile.on { border-color: #7C5CFA; background: #F3EFFF; box-shadow: 0 0 0 3px rgba(124,92,250,.18); }
.alph-tile.special { border-style: dashed; border-color: #F5A524; }
.alph-sounds { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.alph-card { background: var(--surface); border-radius: 18px; padding: 16px; box-shadow: var(--shadow-1); border-top: 4px solid #7C5CFA; }
.alph-card:nth-child(3n+2) { border-top-color: #19B979; } .alph-card:nth-child(3n) { border-top-color: #F5A524; }
.alph-card h3 { font: 800 22px var(--f-display); margin: 0 0 6px; color: var(--ink); }
.alph-card p { margin: 0 0 10px; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.alph-words { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.alph-word { border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: 5px 12px; font-size: 16px; cursor: pointer; color: var(--ink); }
.alph-word:hover { border-color: #7C5CFA; background: #F3EFFF; }
.alph-tip { background: #FFF8E1; border-radius: 10px; padding: 8px 10px; font-size: 13.5px !important; margin: 0 !important; }
.alph-dialog { background: var(--surface-2); border-radius: 14px; padding: 12px 16px; font-size: 19px; margin: 10px 0 14px; max-width: 480px; }
.alph-dialog p { margin: 4px 0; }
.alph-spelled { font-size: 20px; min-height: 28px; color: #5B3FD8; font-weight: 700; }
.alph-q { font: 700 18px var(--f-ui); } .alph-big { font-size: 22px; }
.alph-result { text-align: center; padding: 18px; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1); }
.alph-score { font: 800 46px var(--f-ui); color: #5B3FD8; }
.lm-optional .lm-card { border: 2px dashed #B9A8FF; }
@media (max-width: 640px) { .alph-grid { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); } .alph-tile b { font-size: 26px; } }
[dir="rtl"] .alph-dialog, [dir="rtl"] .alph-spelled { text-align: left; margin-inline-start: 0; }
[dir="rtl"] .alph-words { justify-content: flex-end; }
