/* Training: theme tokens. Bright is the default; Dark is opt-in (localStorage "ra_theme" = "dark", set in /theme-init.js).
   Contrast notes (WCAG AA): navy #0B1D36 on orange #FF7A00 = 6.5:1; orange text on white/tinted surfaces uses --orange-ink #A8340A = 5.5-6.6:1;
   white on blue #1D6BFF = 4.6:1; muted #4A5F7E on #F5F9FF = 6.2:1. */
:root {
  --bg: #F5F9FF; --bg2: #FFFFFF; --card: #FFFFFF; --card2: #EEF4FF; --line: #D5E1F5; --row-line: #E6EEFB;
  --input: #FFFFFF; --well: #EAF1FF;
  --text: #0B1D36; --muted: #4A5F7E; --label: #1F3556; --placeholder: #5F7391;
  --orange: #FF7A00; --orange-2: #FFA033; --orange-d: #E86A00; --orange-ink: #A8340A; --orange-chart: #F26B00;
  --on-orange: #0B1D36;
  --blue: #1D6BFF; --blue-ink: #1556D6; --blue-chart: #1D6BFF; --focus: #1D6BFF;
  --violet: #6D3AF0; --teal: #0891B2; --pink: #D6336C;
  --ok: #05603A; --ok-fill: #12B76A; --ok-chart: #0E9F5F; --on-ok: #0B1D36;
  --warn: #8A4B00; --warn-fill: #F59E0B; --err: #B42318; --err-ink: #B42318; --err-fill: #F04438;
  --orange-soft: rgba(255,122,0,.14); --orange-wash: rgba(255,122,0,.08);
  --ok-soft: rgba(18,183,106,.14); --ok-line: rgba(18,183,106,.55);
  --warn-soft: rgba(245,158,11,.16); --warn-line: rgba(217,119,6,.6);
  --err-soft: rgba(240,68,56,.1); --err-soft2: rgba(240,68,56,.18); --err-line: rgba(240,68,56,.45);
  --info-soft: rgba(29,107,255,.08); --info-line: rgba(29,107,255,.4);
  --tint: rgba(11,29,54,.03); --pill-bg: #E6EEFC; --track: #E3ECFA;
  --ph-ink: #A04100;
  --btn-grad: linear-gradient(135deg, #FF8A1F 0%, #FF6A00 100%); --btn-shadow: 0 4px 12px rgba(255,106,0,.28);
  --bar-grad: linear-gradient(90deg, #FF7A00, #FFB020);
  --body-bg: radial-gradient(1000px 520px at 88% -12%, #D9E8FF 0%, transparent 62%), radial-gradient(800px 420px at -5% -5%, #FFE9D2 0%, transparent 58%), #F5F9FF;
  --hero-grad: linear-gradient(135deg, #DCEAFF 0%, #FFFFFF 62%, #FFF0DE 100%);
  --auth-grad: linear-gradient(160deg, #1245B8 0%, #1D6BFF 100%); --auth-ink: #FFFFFF; --auth-ink2: #FFFFFF; --auth-accent: #FFC857;
  --topbar-bg: rgba(255,255,255,.94); --tabbar-bg: #FFFFFF;
  --toast-bg: #FFFFFF; --toast-shadow: 0 10px 28px rgba(11,29,54,.22);
  --modal-shadow: 0 30px 80px rgba(11,29,54,.35); --backdrop: rgba(11,29,54,.5);
  --r: 14px; --shadow: 0 1px 2px rgba(11,29,54,.06), 0 8px 24px rgba(29,107,255,.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1d36; --bg2: #09172b; --card: #132744; --card2: #183154; --line: #25406a; --row-line: rgba(37,64,106,.5);
  --input: #0d2142; --well: #0d2142;
  --text: #eaf0f8; --muted: #9db0c9; --label: #c6d3e6; --placeholder: #6f86a6;
  --orange: #ff8c00; --orange-2: #ffb347; --orange-d: #e07b00; --orange-ink: #ff8c00; --orange-chart: #ff8c00;
  --on-orange: #1a1000;
  --blue: #6cb3ff; --blue-ink: #6cb3ff; --blue-chart: #6cb3ff; --focus: #ff8c00;
  --violet: #a78bfa; --teal: #22d3ee; --pink: #f472b6;
  --ok: #3ddc97; --ok-fill: #3ddc97; --ok-chart: #3ddc97; --on-ok: #05281a;
  --warn: #fbbf24; --warn-fill: #fbbf24; --err: #ff6b6b; --err-ink: #ffb3b3; --err-fill: #ff6b6b;
  --orange-soft: rgba(255,140,0,.14); --orange-wash: rgba(255,140,0,.08);
  --ok-soft: rgba(61,220,151,.12); --ok-line: rgba(61,220,151,.5);
  --warn-soft: rgba(251,191,36,.12); --warn-line: rgba(251,191,36,.55);
  --err-soft: rgba(255,107,107,.1); --err-soft2: rgba(255,107,107,.22); --err-line: rgba(255,107,107,.4);
  --info-soft: rgba(108,179,255,.08); --info-line: rgba(108,179,255,.5);
  --tint: rgba(255,255,255,.03); --pill-bg: rgba(255,255,255,.07); --track: rgba(255,255,255,.1);
  --ph-ink: #ffc266;
  --btn-grad: #ff8c00; --btn-shadow: none; --bar-grad: linear-gradient(90deg, #ff8c00, #ffb347);
  --body-bg: radial-gradient(1200px 600px at 80% -10%, #14305a 0%, transparent 60%), #0b1d36;
  --hero-grad: linear-gradient(135deg, #17325a 0%, #132744 70%);
  --auth-grad: linear-gradient(160deg, #123058, #0b1d36 75%); --auth-ink: #eaf0f8; --auth-ink2: #9db0c9; --auth-accent: #ff8c00;
  --topbar-bg: rgba(11,29,54,.92); --tabbar-bg: #0a1a30;
  --toast-bg: #1d3a64; --toast-shadow: 0 8px 24px rgba(0,0,0,.4);
  --modal-shadow: 0 30px 80px rgba(0,0,0,.6); --backdrop: rgba(3,10,22,.7);
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--body-bg); color: var(--text); font: 16px/1.5 var(--font); min-height: 100vh; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 4vw, 2rem); } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; } a { color: var(--orange-ink); text-decoration: none; } a:hover { text-decoration: underline; }
.muted { color: var(--muted); } small { font-size: .82rem; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.boot { padding: 2rem; color: var(--muted); }
.icon { flex: none; }

/* shell */
.shell { display: grid; grid-template-columns: 1fr; min-height: 100vh; padding-bottom: 76px; }
.sidebar { display: none; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--topbar-bg); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar-r { display: flex; gap: 8px; align-items: center; }
.main { padding: 16px; max-width: 1100px; width: 100%; margin: 0 auto; outline: none; }
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: flex; background: var(--tabbar-bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 7px; color: var(--muted); font-size: .68rem; min-width: 0; }
.tab:hover { text-decoration: none; } .tab.active { color: var(--orange-ink); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); } .brand:hover { text-decoration: none; }
.brand strong { display: block; font-size: 1.05rem; line-height: 1.1; } .brand small { display: block; color: var(--muted); font-size: .72rem; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: var(--btn-grad); color: var(--on-orange); display: grid; place-items: center; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--card2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 700; color: var(--orange-ink); flex: none; }
@media (min-width: 900px) {
  .shell { grid-template-columns: 250px 1fr; padding-bottom: 0; }
  .topbar, .tabbar { display: none; }
  .sidebar { display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 22px 16px; background: var(--bg2); border-right: 1px solid var(--line); }
  .nav { display: flex; flex-direction: column; gap: 4px; }
  .nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
  .nav-link:hover { background: var(--card); color: var(--text); text-decoration: none; }
  .nav-link.active { background: var(--card); color: var(--orange-ink); box-shadow: inset 3px 0 0 var(--orange); }
  .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
  .who { display: flex; gap: 10px; align-items: center; } .who strong { display: block; } .who small { color: var(--muted); }
  .main { padding: 32px 36px 60px; }
}

/* layout bits */
.stack { display: flex; flex-direction: column; gap: 20px; } .stack.narrow { max-width: 780px; }
.grid2, .grid3, .grid4 { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid2 { grid-template-columns: repeat(2, 1fr); } .grid3 { grid-template-columns: repeat(2, 1fr); } .grid4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .grid3 { grid-template-columns: repeat(3, 1fr); } .grid4 { grid-template-columns: repeat(4, 1fr); } }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; } .page-head p { margin: 0; }
.page-actions { display: flex; gap: 8px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 10px; } .sec-head h2 { margin: 0; }
.link { font-size: .9rem; }
.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: .9rem; width: fit-content; } .back:hover { color: var(--text); text-decoration: none; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; color: var(--orange-ink); font-weight: 700; font-size: .72rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.hero { display: flex; justify-content: space-between; align-items: center; gap: 18px; background: var(--hero-grad); }
.hero-l { min-width: 0; } .hero h1 { margin-bottom: .3em; } .hero p { margin-bottom: 14px; }
.stat { display: flex; gap: 12px; align-items: center; padding: 14px; }
.stat-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--orange-soft); color: var(--orange-ink); display: grid; place-items: center; flex: none; }
.stat small { display: block; color: var(--muted); } .stat strong { display: block; font-size: 1.45rem; line-height: 1.15; } .stat span { font-size: .8rem; }
.quick { display: flex; gap: 14px; align-items: center; color: var(--text); } .quick:hover { text-decoration: none; border-color: var(--orange); }
.quick svg { color: var(--orange-ink); } .quick strong { display: block; } .quick span { font-size: .85rem; }
.ok-text { color: var(--ok); display: flex; align-items: center; gap: 6px; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 10px 16px; font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .05s; min-height: 42px; color: var(--text); background: transparent; }
.btn:hover { text-decoration: none; } .btn:active { transform: translateY(1px); } .btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--btn-grad); color: var(--on-orange); box-shadow: var(--btn-shadow); } .btn.primary:hover { background: var(--orange-d); }
.btn.ghost { border-color: var(--line); background: var(--tint); } .btn.ghost:hover { border-color: var(--orange); }
.btn.danger { background: var(--err-soft); border-color: var(--err-line); color: var(--err-ink); } .btn.danger:hover { background: var(--err-soft2); }
.btn.sm { padding: 6px 12px; min-height: 34px; font-size: .88rem; } .btn.block { width: 100%; }
.btn.copied { border-color: var(--ok); color: var(--ok); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; } .icon-btn:hover { background: var(--card2); color: var(--text); }
.input { width: 100%; background: var(--input); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 11px 12px; font: inherit; min-height: 44px; }
textarea.input { resize: vertical; line-height: 1.45; } .input::placeholder { color: var(--placeholder); } .input:focus { outline: 2px solid var(--focus); border-color: transparent; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; } .field-label { font-size: .85rem; font-weight: 600; color: var(--label); } .field-hint { font-size: .78rem; color: var(--muted); }
.form-error { color: var(--err-ink); background: var(--err-soft); border: 1px solid var(--err-line); padding: 10px 12px; border-radius: 10px; margin: 6px 0 12px; } .form-error[hidden] { display: none; }
.form-card { display: flex; flex-direction: column; } .form-card .btn { align-self: flex-start; }
.note { font-size: .88rem; color: var(--label); background: var(--orange-wash); border-left: 3px solid var(--orange); padding: 8px 12px; border-radius: 6px; }
.banner { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 10px; font-weight: 600; margin: 12px 0; }
.banner.ok { background: var(--ok-soft); color: var(--ok); } .banner.warn { background: var(--warn-soft); color: var(--warn); }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--pill-bg); color: var(--label); width: fit-content; }
.pill.ok { background: var(--ok-soft); color: var(--ok); } .pill.warn { background: var(--warn-soft); color: var(--warn); }

/* progress */
.ring { position: relative; flex: none; color: var(--text); } .ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.25rem; }
.bar { height: 8px; border-radius: 999px; background: var(--track); overflow: hidden; } .bar i { display: block; height: 100%; background: var(--bar-grad); border-radius: inherit; transition: width .5s ease; }

/* courses */
.course-card { display: flex; flex-direction: column; gap: 8px; } .course-card h3 { margin: 4px 0 0; } .course-card h3 a { color: var(--text); }
.cc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 28px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
.cc-meta { font-size: .84rem; } .cc-prog small { color: var(--muted); display: block; margin-top: 4px; } .cc-go { margin-top: auto; align-self: flex-start; }
.lesson-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; color: var(--text); } .lesson-row:hover { text-decoration: none; border-color: var(--orange); }
.lr-n { width: 34px; height: 34px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font-weight: 700; flex: none; color: var(--muted); }
.lesson-row.done .lr-n { background: var(--ok-fill); color: var(--on-ok); }
.lr-t { flex: 1; min-width: 0; display: flex; flex-direction: column; } .lr-t strong { font-weight: 600; }
.lesson-row > svg:last-child { color: var(--muted); }

/* lesson */
.lesson h1 { margin: 4px 0 14px; } .lesson-meta { font-size: .85rem; }
.prose { margin-top: 16px; } .prose h2 { font-size: 1.2rem; margin-top: 1.4em; } .prose h3 { font-size: 1.05rem; margin-top: 1.2em; } .prose h4 { margin-top: 1em; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; } .prose li { margin-bottom: .35em; }
.prose blockquote { margin: 1em 0; padding: 8px 14px; border-left: 3px solid var(--orange); background: var(--orange-wash); border-radius: 0 8px 8px 0; }
.prose code { background: var(--well); padding: 1px 6px; border-radius: 5px; font-size: .9em; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.quiz fieldset.q { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 8px; margin: 0 0 14px; min-width: 0; }
.quiz fieldset.right { border-color: var(--ok); } .quiz fieldset.wrong { border-color: var(--err); }
.quiz legend { font-weight: 600; padding: 0 6px; max-width: 100%; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 8px; border-radius: 8px; cursor: pointer; } .choice:hover { background: var(--tint); }
.choice input { margin-top: 4px; accent-color: var(--orange); width: 18px; height: 18px; flex: none; } .choice.picked { background: var(--orange-soft); } .choice.key { box-shadow: inset 3px 0 0 var(--ok); }
.explain { font-size: .88rem; color: var(--muted); margin: 4px 8px 8px; }

/* scripts / rebuttals */
.filters { display: flex; flex-direction: column; gap: 10px; }
.search-wrap { position: relative; } .search-wrap svg { position: absolute; left: 12px; top: 13px; color: var(--muted); } .search { padding-left: 40px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.chip { flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted); padding: 7px 14px; border-radius: 999px; font: inherit; font-size: .88rem; cursor: pointer; } .chip.on { background: var(--btn-grad); border-color: var(--orange); color: var(--on-orange); font-weight: 700; }
.cards { align-items: start; } .script h3, .rebuttal h3 { margin: 6px 0 8px; }
.row-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.script-body { white-space: pre-wrap; background: var(--well); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: .95rem; margin-bottom: 10px; }
.ph { color: var(--ph-ink); background: var(--orange-soft); border-radius: 4px; padding: 0 3px; }
.objection { margin: 8px 0 10px; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.response p { margin-bottom: .7em; }

/* tables */
.table-wrap { overflow-x: auto; } .table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--row-line); vertical-align: middle; } .table tr:last-child td { border-bottom: 0; }
.table .pct { min-width: 130px; } .table .pct small { color: var(--muted); } .streak { display: inline-flex; gap: 3px; align-items: center; color: var(--orange-ink); font-weight: 700; }
@media (max-width: 700px) {
  .stack-sm thead { display: none; } .stack-sm, .stack-sm tbody, .stack-sm tr, .stack-sm td { display: block; width: 100%; }
  .stack-sm tr { border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; background: var(--tint); }
  .stack-sm td { border: 0; padding: 5px 0; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
  .stack-sm td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
  .stack-sm td.pct { flex-wrap: wrap; } .stack-sm td.pct .bar { flex: 1; min-width: 80px; }
  .hero { flex-direction: column-reverse; align-items: flex-start; }
}
.course-bars { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; } .cb-top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.rep-list { list-style: none; margin: 10px 0 0; padding: 0; } .rep-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--row-line); flex-wrap: wrap; } .rep-list li:last-child { border: 0; }
.rl-name { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.pin-box { font: 700 2rem/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .15em; text-align: center; padding: 18px; background: var(--well); border: 1px dashed var(--orange); border-radius: 12px; user-select: all; }

/* empty */
.empty { text-align: center; padding: 28px 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; grid-column: 1 / -1; }
.empty-ic { width: 54px; height: 54px; border-radius: 16px; background: var(--orange-soft); color: var(--orange-ink); display: grid; place-items: center; margin-bottom: 6px; } .empty p { max-width: 380px; }

/* auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-hero { padding: 28px 22px; display: flex; flex-direction: column; gap: 14px; background: var(--auth-grad); } .auth-hero { color: var(--auth-ink); } .auth-hero .brand { color: var(--auth-ink); } .auth-hero h1 { font-size: clamp(2rem, 6vw, 3rem); margin-top: 12px; } .auth-hero p { color: var(--auth-ink2); max-width: 420px; }
.hero-points { list-style: none; padding: 0; margin: 0; display: none; flex-direction: column; gap: 10px; } .hero-points li { display: flex; gap: 10px; align-items: center; } .hero-points svg { color: var(--auth-accent); }
.auth-card { margin: -10px 16px 32px; padding: 24px; position: relative; } .auth-card h2 { font-size: 1.4rem; margin-bottom: 8px; }
@media (min-width: 900px) { .auth { grid-template-columns: 1.1fr 1fr; } .auth-hero { padding: 56px; justify-content: center; } .hero-points { display: flex; } .auth-card { margin: auto; width: min(440px, 90%); } }

/* modal & toast */
.modal { border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--text); padding: 0; width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 24px); box-shadow: var(--modal-shadow); }
.modal.wide { width: min(820px, calc(100vw - 24px)); } .modal::backdrop { background: var(--backdrop); backdrop-filter: blur(2px); }
.modal[open] { display: flex; flex-direction: column; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--line); } .modal-head h2 { margin: 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; } .modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); }
.toasts { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
@media (min-width: 900px) { .toasts { bottom: 28px; } }
.toast { display: flex; gap: 8px; align-items: center; background: var(--toast-bg); border: 1px solid var(--line); padding: 10px 16px; border-radius: 999px; box-shadow: var(--toast-shadow); transition: opacity .3s; } .toast.ok svg { color: var(--ok); } .toast.err svg { color: var(--err); } .toast.out { opacity: 0; }
dialog.modal::backdrop { z-index: 1; }

/* editors */
.grid2 .field { margin-bottom: 14px; }
.section-title { margin: 18px 0 10px; } .lesson-editors { display: flex; flex-direction: column; gap: 10px; }
.lesson-ed { border: 1px solid var(--line); border-radius: 12px; background: var(--tint); } .lesson-ed summary { cursor: pointer; padding: 12px 14px; display: flex; align-items: center; gap: 10px; list-style: none; } .lesson-ed summary::-webkit-details-marker { display: none; }
.lesson-ed .n { width: 26px; height: 26px; border-radius: 50%; background: var(--card2); display: grid; place-items: center; font-size: .8rem; font-weight: 700; } .lesson-ed .t { flex: 1; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson-ed-body { padding: 4px 14px 14px; } .quiz-ed h4 { margin: 14px 0 8px; }
.q-editor { border: 1px dashed var(--line); border-radius: 10px; padding: 12px; margin-bottom: 10px; } .q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.opt-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .opt-row input[type=radio] { accent-color: var(--orange); width: 18px; height: 18px; flex: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ===== v2: shared bits ===== */
.more-list { display: flex; flex-direction: column; gap: 4px; } .more-link { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px; color: var(--text); min-height: 44px; } .more-link:hover, .more-link.active { background: var(--card2); text-decoration: none; } .more-link.active { color: var(--orange-ink); }
button.tab { background: none; border: 0; font: inherit; font-size: .68rem; cursor: pointer; }
.tabs { display: flex; gap: 6px; overflow-x: auto; border-bottom: 1px solid var(--line); } .tab-btn { background: none; border: 0; color: var(--muted); font: inherit; font-weight: 600; padding: 10px 14px; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; min-height: 44px; } .tab-btn.on { color: var(--orange-ink); border-bottom-color: var(--orange); } .tab-btn:hover { color: var(--text); }
.banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--tint); font-size: .92rem; }
.banner.ok { border-color: var(--ok-line); background: var(--ok-soft); } .banner.warn { border-color: var(--warn-line); background: var(--warn-soft); } .banner.err { border-color: var(--err-line); background: var(--err-soft); } .banner.info { border-color: var(--info-line); background: var(--info-soft); }
.banner svg { flex: none; margin-top: 2px; }
.pill { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--card2); color: var(--label); border: 1px solid var(--line); } .pill.ok { color: var(--ok); border-color: var(--ok-line); } .pill.warn { color: var(--warn); border-color: var(--warn-line); } .pill.err { color: var(--err); border-color: var(--err-line); } .pill.sample { color: var(--on-orange); background: var(--orange); border-color: var(--orange); } .pill.nc { color: var(--warn); border-style: dashed; }
.chart { width: 100%; height: auto; max-height: 220px; } .legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.bar.ok > i { background: var(--ok-fill); } .bar.warn > i { background: var(--warn-fill); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: .92rem; } .kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; text-align: right; } .neg { color: var(--err); } .pos { color: var(--ok); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .row.between { justify-content: space-between; } .grow { flex: 1; min-width: 0; }
.dropzone { border: 2px dashed var(--line); border-radius: 14px; padding: 26px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; } .dropzone.over, .dropzone:hover { border-color: var(--orange); background: var(--orange-wash); color: var(--text); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; word-break: break-all; }
select.input { appearance: auto; }
.sm-input { min-height: 36px; padding: 6px 10px; }
.disclaimer { border: 1px solid var(--warn-line); background: var(--warn-soft); border-radius: 12px; padding: 12px 14px; font-weight: 600; font-size: .92rem; }
.legal-note { font-size: .8rem; color: var(--muted); }
.big-num { font-size: 2rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; } .big-num.sm { font-size: 1.4rem; }
.scroll-x { overflow-x: auto; }
.badge-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } .badge { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; text-align: center; font-size: .85rem; } .badge.got { border-color: var(--orange); background: var(--orange-wash); } .badge.locked { background: var(--well); border-style: dashed; } .badge.locked svg { color: var(--muted); opacity: .6; } .badge svg { color: var(--orange-ink); }
.kanban { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(220px, 1fr)); overflow-x: auto; padding-bottom: 8px; } .kcol { background: var(--tint); border: 1px solid var(--line); border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; } .kcol h3 { display: flex; justify-content: space-between; margin: 0 0 4px; font-size: .95rem; } .kcard { background: var(--card2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 6px; font-size: .9rem; } .kcard.overdue { border-color: var(--err); }
.level-map { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } .level { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--card2); display: flex; flex-direction: column; gap: 6px; text-align: left; color: var(--text); font: inherit; cursor: pointer; min-height: 44px; } .level[disabled] { opacity: .5; cursor: not-allowed; } .level.passed { border-color: var(--ok); } .level.cur { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange) inset; } .stars { color: var(--orange-ink); letter-spacing: 2px; }
.pitch-text { font-size: 1.25rem; line-height: 1.7; background: var(--well); border-radius: 12px; padding: 18px; white-space: pre-wrap; } .hidden-word { display: inline-block; min-width: 3ch; border-bottom: 2px solid var(--orange); color: transparent; user-select: none; } .peeked { color: var(--warn); border-bottom-color: var(--warn); }
.look-here { display: grid; place-items: center; min-height: 160px; border: 3px solid var(--orange); border-radius: 18px; background: var(--orange-wash); text-align: center; padding: 18px; font-size: 1.2rem; font-weight: 700; }
.meter { height: 10px; border-radius: 99px; background: var(--track); overflow: hidden; } .meter > i { display: block; height: 100%; background: var(--ok-fill); width: 0; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; padding: 4px; } .msg { max-width: 85%; padding: 10px 14px; border-radius: 14px; font-size: .97rem; white-space: pre-wrap; } .msg.you { align-self: flex-end; background: var(--btn-grad); color: var(--on-orange); border-bottom-right-radius: 4px; } .msg.them { align-self: flex-start; background: var(--card2); border: 1px solid var(--line); border-bottom-left-radius: 4px; } .msg small { display: block; opacity: .85; margin-bottom: 2px; }
.mood { display: flex; gap: 8px; align-items: center; font-size: .85rem; } .mood .bar { flex: 1; }
.waveform { width: 100%; height: 110px; background: var(--well); border-radius: 10px; display: block; cursor: pointer; }
.timeline { display: flex; height: 22px; border-radius: 8px; overflow: hidden; background: var(--well); margin: 8px 0; } .timeline span { display: block; height: 100%; } .tl-you { background: var(--orange); } .tl-cust { background: var(--blue-chart); } .tl-quiet { background: transparent; }
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; } .checks li { display: flex; gap: 10px; align-items: flex-start; } .checks input { accent-color: var(--orange); width: 20px; height: 20px; margin-top: 2px; flex: none; }
.module-h { margin: 18px 0 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.locked-note { opacity: .7; }
.score-card { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.breakdown { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 8px; font-size: .9rem; } .breakdown li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--row-line); padding-bottom: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 700px) { .kanban { grid-template-columns: repeat(4, 82vw); } .page-actions { flex-wrap: wrap; } }

/* v2: course editor, locked courses, training score */
.sticky-actions { position: sticky; bottom: 0; z-index: 5; padding: 12px; background: var(--bg2); border-top: 1px solid var(--line); flex-wrap: wrap; }
.lesson-edit > summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 4px 0; }
.lesson-edit[open] > summary { margin-bottom: 12px; }
.course-card.locked { background: var(--well); border-style: dashed; }
.score-top { display: grid; grid-template-columns: minmax(180px, 1fr) 2fr; gap: 20px; align-items: center; }
.score-chart .chart { width: 100%; height: auto; max-height: 170px; }
.big-num small { font-size: 18px; font-weight: 500; opacity: .7; }
.checks { border: 1px solid var(--line, #22345a); }
.checks legend { padding: 0 6px; font-weight: 700; }
@media (max-width: 720px) { .score-top { grid-template-columns: 1fr; } }

/* pitch practice */
.pitch-text { font-size: 1.15rem; line-height: 1.9; padding: 16px; background: var(--card2); border-radius: 12px; border: 1px solid var(--line); white-space: pre-wrap; }
.pitch-text.lookbox { text-align: center; border: 2px dashed var(--orange); min-height: 160px; display: flex; align-items: center; justify-content: center; }
.blank { font: inherit; color: var(--orange-ink); background: var(--orange-soft); border: 0; border-bottom: 2px solid var(--orange); border-radius: 4px; padding: 0 4px; cursor: pointer; min-height: 28px; } .blank.revealed { color: var(--text); background: transparent; border-bottom-style: dotted; }
.meter { height: 10px; border-radius: 999px; background: var(--well); overflow: hidden; } .meter i { display: block; height: 100%; background: var(--bar-grad); transition: width .1s linear; }
.cam { width: 100%; max-width: 320px; border-radius: 12px; background: #000; transform: scaleX(-1); } .cam[hidden] { display: none; }
.heard { min-height: 48px; padding: 10px 12px; border-radius: 10px; background: var(--card2); border: 1px solid var(--line); }
.parts .bar { flex: 0 0 90px; } .parts .num { font-variant-numeric: tabular-nums; min-width: 2.5em; text-align: right; }
.banner.err[hidden] { display: none; }
.checklist { padding-left: 1.2em; display: flex; flex-direction: column; gap: 10px; }
button.kcard { text-align: left; color: var(--text); font: inherit; cursor: pointer; width: 100%; min-height: 44px; } button.kcard:hover { border-color: var(--orange); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 40px; } .check-row input { width: 20px; height: 20px; flex: none; }
ul.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.table tr.me td { background: var(--orange-wash); }
.stat small { display: block; }
.shell > * { min-width: 0; } .tabs { max-width: 100%; }
[hidden] { display: none !important; }

/* bright theme: colour accents (level map, stat icons, headers, chips, tables) */
.level { border-top: 4px solid var(--lv, var(--blue)); }
.level:nth-child(10n+1) { --lv: #1D6BFF; } .level:nth-child(10n+2) { --lv: #0891B2; } .level:nth-child(10n+3) { --lv: #0E9F5F; } .level:nth-child(10n+4) { --lv: #65A30D; } .level:nth-child(10n+5) { --lv: #F59E0B; }
.level:nth-child(10n+6) { --lv: #FF7A00; } .level:nth-child(10n+7) { --lv: #F04438; } .level:nth-child(10n+8) { --lv: #D6336C; } .level:nth-child(10n+9) { --lv: #6D3AF0; } .level:nth-child(10n) { --lv: #0B1D36; }
.level.passed { background: var(--ok-soft); }
.level:not([disabled]):hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.grid4 > .stat:nth-child(4n+2) .stat-ic, .grid3 > .stat:nth-child(3n+2) .stat-ic { background: rgba(29,107,255,.14); color: var(--blue-ink); }
.grid4 > .stat:nth-child(4n+3) .stat-ic, .grid3 > .stat:nth-child(3n) .stat-ic { background: var(--ok-soft); color: var(--ok); }
.grid4 > .stat:nth-child(4n) .stat-ic { background: rgba(109,58,240,.14); color: var(--violet); }
:root[data-theme="dark"] .grid4 > .stat:nth-child(4n+2) .stat-ic, :root[data-theme="dark"] .grid3 > .stat:nth-child(3n+2) .stat-ic { background: rgba(108,179,255,.14); }
:root[data-theme="dark"] .grid4 > .stat:nth-child(4n) .stat-ic { background: rgba(167,139,250,.14); }
:root:not([data-theme="dark"]) .topbar { border-bottom: 0; box-shadow: 0 2px 0 0 #FF7A00, 0 6px 18px rgba(29,107,255,.08); }
:root:not([data-theme="dark"]) .hero { border-color: #C9DBFA; }
:root:not([data-theme="dark"]) .card.quick:hover, :root:not([data-theme="dark"]) .lesson-row:hover { box-shadow: 0 10px 28px rgba(29,107,255,.16); }
:root:not([data-theme="dark"]) .table tr:hover td { background: #F3F8FF; }
:root:not([data-theme="dark"]) .sidebar { box-shadow: 4px 0 24px rgba(29,107,255,.06); }
:root:not([data-theme="dark"]) .nav-link:hover { background: #EAF2FF; }
:root:not([data-theme="dark"]) .nav-link.active { background: linear-gradient(90deg, rgba(255,122,0,.16), rgba(255,122,0,.04)); }
:root:not([data-theme="dark"]) .tab.active { color: var(--orange-ink); font-weight: 700; }
:root:not([data-theme="dark"]) .chip { background: #fff; color: var(--label); }
:root:not([data-theme="dark"]) .chip:hover { border-color: var(--blue); }
:root:not([data-theme="dark"]) .btn.ghost { background: #fff; color: var(--blue-ink); border-color: #B9CEF3; }
:root:not([data-theme="dark"]) .btn.ghost:hover { background: #EAF2FF; border-color: var(--blue); }
:root:not([data-theme="dark"]) .btn.danger { background: #fff; }
:root:not([data-theme="dark"]) .btn.primary:hover { background: var(--orange-d); }
:root:not([data-theme="dark"]) .more-link:hover { background: #EAF2FF; }
.theme-btn { gap: 8px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; }
/* higher specificity than the bright ghost button */
:root .auth .auth-hero .btn.theme-btn { align-self: flex-start; color: var(--auth-ink); border-color: rgba(255,255,255,.7); background: rgba(8,28,70,.35); }
:root .auth .auth-hero .btn.theme-btn:hover { background: rgba(8,28,70,.5); }
.pin-box.invite-link { font-size: .85rem; letter-spacing: 0; word-break: break-all; }
.add-options { align-items: start; }
