:root {
  --bg: #0b1016;
  --bg-2: #0f151d;
  --panel: #121922;
  --panel-2: #161f2a;
  --line: #1f2935;
  --line-2: #2b3746;
  --text: #e8edf2;
  --text-2: #c3ccd6;
  --muted: #8d9aab;
  --accent: #34d399;
  --accent-strong: #10b981;
  --accent-soft: rgba(52, 211, 153, .1);
  --accent-ink: #052a1c;
  --warn: #f5b942;
  --danger: #f87171;
  --info: #60a5fa;
  --radius: 14px;
  --radius-sm: 10px;
  --sans: 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --display: 'Segoe UI Variable Display', 'Segoe UI', system-ui, -apple-system, Roboto, 'Helvetica Neue', Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -16px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

/* Self-hosted so the CSP (font-src 'self') allows it. Used only for codes and references. SIL OFL. */
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-latin-700-normal.woff2') format('woff2'); font-weight: 600 800; font-display: swap; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: #6ee7b7; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; font-family: var(--display); color: #f4f7fa; }
h1 { font-weight: 700; letter-spacing: -.025em; }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.15rem); font-weight: 700; letter-spacing: -.02em; }
h3 { font-size: 1.08rem; font-weight: 650; letter-spacing: -.01em; }
::selection { background: var(--accent); color: var(--accent-ink); }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
[hidden] { display: none !important; }
img, svg, video { max-width: 100%; }

.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
section.wrap { padding-top: 88px; scroll-margin-top: 72px; }
.section-head { max-width: 640px; margin-bottom: 28px; }
.section-head .kicker { display: block; color: var(--accent); font-size: .8rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.stack > * + * { margin-top: 16px; }
.narrow { max-width: 560px; }
.grow { flex: 1; min-width: 160px; width: auto; }
.m0 { margin: 0; }
.m-top { margin-top: 10px; }
.pad { padding: 0 16px 12px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 16, 22, .82);
  backdrop-filter: saturate(150%) blur(12px);
  -webkit-backdrop-filter: saturate(150%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar > .row { min-height: 64px; flex-wrap: nowrap; }
.brand { color: var(--text); text-decoration: none; font-weight: 700; display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 1.02rem; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.logo {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: var(--accent); color: var(--accent-ink);
}
.logo svg { width: 19px; height: 19px; }
.nav-links { display: flex; gap: 2px; margin-left: 28px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: .94rem; font-weight: 500; padding: 8px 12px; border-radius: 8px; }
.nav-links a:hover { color: var(--text); background: var(--panel); }
.nav-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.nav-actions .who { color: var(--muted); font-size: .875rem; }
@media (max-width: 800px) { .nav-links, .hide-sm { display: none !important; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: var(--radius-sm); border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 650; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover { background: #5ee0ab; border-color: #5ee0ab; color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: progress; }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--panel-2); border-color: #3a4a5e; color: var(--text); }
.btn.danger { background: transparent; color: var(--danger); border-color: rgba(248, 113, 113, .4); }
.btn.danger:hover { background: rgba(248, 113, 113, .08); }
.btn.small { min-height: 36px; padding: 6px 13px; font-size: .875rem; border-radius: 8px; }
.btn.lg { min-height: 50px; padding: 12px 24px; font-size: 1.02rem; }
.btn.wide { width: 100%; }
@media (max-width: 480px) { form .btn, .summary .btn { white-space: normal; text-align: center; } }

/* ---------- Forms ---------- */
label { display: block; font-size: .9rem; color: var(--text-2); font-weight: 500; margin-bottom: 14px; }
label > input, label > select, label > textarea { margin-top: 6px; }
input, select, textarea {
  width: 100%; min-height: 46px; padding: 11px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line-2);
  background: var(--bg-2); color: var(--text); font: inherit; font-size: 1rem; font-weight: 400;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #627083; }
input:hover, select:hover, textarea:hover { border-color: #3a4a5e; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type=checkbox] { width: 20px; min-height: 20px; height: 20px; accent-color: var(--accent); }
textarea { min-height: 110px; resize: vertical; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 16px; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 76px; }
.pw-toggle {
  position: absolute; right: 6px; bottom: 6px; min-height: 34px; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font: inherit; font-size: .8rem; cursor: pointer;
}
.pw-toggle:hover { color: var(--text); }

/* ---------- Cards & panels ---------- */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .grid3 { grid-template-columns: 1fr; } }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card { display: flex; flex-direction: column; transition: border-color .2s; }
.card:hover { border-color: var(--line-2); }
.card > .btn:last-child { margin-top: auto; }
.card .price { font-size: 1.9rem; font-weight: 700; letter-spacing: -.02em; color: #f4f7fa; margin: 12px 0 0; line-height: 1.1; font-variant-numeric: tabular-nums; }
.card .price small { font-size: .85rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.card ul { padding-left: 0; list-style: none; margin: 18px 0 22px; color: var(--text-2); }
.card ul li { position: relative; padding-left: 26px; margin-bottom: 9px; }
.card ul li::before {
  content: ''; position: absolute; left: 2px; top: .45em; width: 13px; height: 8px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.icon-badge {
  width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 16px;
  background: var(--accent-soft); color: var(--accent);
}
.icon-badge.info { background: rgba(96, 165, 250, .1); color: var(--info); }
.icon-badge.warn { background: rgba(245, 185, 66, .1); color: var(--warn); }
.icon-badge svg { width: 21px; height: 21px; }
.tag {
  display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 600; line-height: 1.6;
  padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap;
}
.tag.ok { color: var(--accent); border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .07); }
.tag.warn { color: var(--warn); border-color: rgba(245, 185, 66, .35); background: rgba(245, 185, 66, .07); }
.tag.bad { color: var(--danger); border-color: rgba(248, 113, 113, .35); background: rgba(248, 113, 113, .07); }
.tag.info { color: var(--info); border-color: rgba(96, 165, 250, .35); background: rgba(96, 165, 250, .07); }

/* ---------- Home: hero ---------- */
.hero-band {
  position: relative; border-bottom: 1px solid var(--line); overflow: hidden;
  background:
    radial-gradient(800px 420px at 80% -20%, rgba(52, 211, 153, .12), transparent 65%),
    radial-gradient(600px 380px at 0% 0%, rgba(96, 165, 250, .07), transparent 60%);
}
/* A faint grid, faded out towards the bottom: a quiet nod to "network" without decoration that competes with text. */
.hero-band::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; opacity: .35;
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 85%);
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}
.hero { position: relative; padding-top: 80px; padding-bottom: 80px; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; }
@media (max-width: 920px) { .hero-grid { grid-template-columns: 1fr; gap: 40px; } .hero { padding-top: 56px; padding-bottom: 56px; } }
.hero h1 { font-size: clamp(2.5rem, 5.6vw, 3.9rem); max-width: 15ch; }
.hero h1 .hl { color: var(--accent); }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-size: .85rem; font-weight: 600;
  padding: 5px 12px 5px 8px; border: 1px solid var(--line-2); border-radius: 999px; background: rgba(18, 25, 34, .7); margin-bottom: 22px;
}
.eyebrow::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.lead { font-size: 1.15rem; color: var(--text-2); max-width: 52ch; }
.hero .cta { margin: 30px 0 26px; }
.trust { display: flex; flex-wrap: wrap; gap: 10px 22px; list-style: none; padding: 0; margin: 0; color: var(--muted); font-size: .92rem; }
.trust li { display: flex; align-items: center; gap: 8px; }
.trust svg { width: 17px; height: 17px; color: var(--accent); flex: none; }

/* Hero: live course list */
.hero-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.hero-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.hero-card-head strong { font-size: .95rem; }
.hero-list { list-style: none; margin: 0; padding: 6px 0; }
.hero-list li { display: flex; align-items: center; gap: 14px; padding: 13px 20px; }
.hero-list li + li { border-top: 1px solid var(--line); }
.hero-list .ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line); color: var(--accent); font-weight: 700; font-size: .85rem; }
.hero-list .t { flex: 1; min-width: 0; }
.hero-list .t strong { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-list .t span { color: var(--muted); font-size: .82rem; }
.hero-list .p { font-size: .85rem; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hero-card-foot { padding: 16px 20px 20px; }
.skeleton { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--line), var(--line-2), var(--line)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Home: how it works ---------- */
.steps-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: st; }
@media (max-width: 760px) { .steps-3 { grid-template-columns: 1fr; } }
.steps-3 .panel { position: relative; padding-top: 22px; }
.steps-3 .num-chip {
  counter-increment: st; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; margin-bottom: 16px;
  font-size: .85rem; font-weight: 700; color: var(--accent-ink); background: var(--accent);
}
.steps-3 .num-chip::before { content: counter(st); }
.steps-3 p { color: var(--muted); margin: 0; }

/* ---------- Home: courses ---------- */
.courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.course h3 { font-size: 1.15rem; margin-bottom: 6px; }
.course .desc { color: var(--muted); margin-bottom: 14px; }
.course .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.price-list { display: grid; gap: 0; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.price-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 14px; background: var(--bg-2); }
.price-list div + div { border-top: 1px solid var(--line); }
.price-list dt { color: var(--muted); font-size: .9rem; }
.price-list dd { margin: 0; font-weight: 650; font-variant-numeric: tabular-nums; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------- Home: enrol ---------- */
.enrol { display: grid; grid-template-columns: 1fr 350px; gap: 0; padding: 0; overflow: hidden; }
@media (max-width: 920px) { .enrol { grid-template-columns: 1fr; } }
.enrol-steps { padding: 28px; }
.step { border: 0; padding: 0; margin: 0 0 26px; min-width: 0; }
.step:last-child { margin-bottom: 0; }
.step legend { display: flex; align-items: center; gap: 10px; padding: 0; margin-bottom: 12px; font-weight: 650; font-size: 1rem; }
.step .num {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none;
  font-size: .8rem; font-weight: 700; background: var(--accent-soft); color: var(--accent);
}
.step .hint { color: var(--muted); font-size: .85rem; margin: 8px 0 0; }
.summary { padding: 28px; background: var(--bg-2); border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 920px) { .summary { border-left: 0; border-top: 1px solid var(--line); } }
.summary h3 { margin: 0; }
.summary dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: .95rem; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; border-top: 1px solid var(--line-2); }
.total strong { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; color: #f4f7fa; line-height: 1; font-variant-numeric: tabular-nums; }

/* Track picker (radio cards) */
.seg { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; margin: 0; }
.seg label {
  margin: 0; padding: 14px 14px 14px 44px; position: relative; border: 1px solid var(--line-2); border-radius: 12px; cursor: pointer;
  color: var(--text); background: var(--bg-2); transition: border-color .15s, background-color .15s;
}
.seg label::before {
  content: ''; position: absolute; left: 14px; top: 16px; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid var(--line-2); background: var(--bg);
}
.seg label:hover { border-color: #3a4a5e; }
.seg label strong { display: block; font-size: .97rem; }
.seg label span { color: var(--muted); font-size: .85rem; font-weight: 400; }
.seg input:checked + label { border-color: var(--accent); background: rgba(52, 211, 153, .05); }
.seg input:checked + label::before { border-color: var(--accent); background: var(--accent); box-shadow: inset 0 0 0 3px var(--bg); }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 640px) { .seg { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; background: var(--bg-2); }
tbody tr:hover td { background: rgba(255, 255, 255, .015); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td input, td select { min-height: 38px; padding: 7px 9px; min-width: 90px; }

/* Payment steps */
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 16px; }
.steps li { counter-increment: s; position: relative; padding: 11px 0 11px 44px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.steps li:last-child { border-bottom: 0; }
.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 10px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--bg-2); border: 1px solid var(--line-2);
  font-size: .8rem; font-weight: 700; color: var(--accent);
}
.pay-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .pay-grid { grid-template-columns: 1fr; } }
.big-ref { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .06em; color: var(--accent); }

/* Notices */
.notice { padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); margin: 12px 0; color: var(--text-2); }
.notice strong { color: var(--text); }
.notice.ok { border-color: rgba(52, 211, 153, .4); background: rgba(52, 211, 153, .06); }
.notice.err { border-color: rgba(248, 113, 113, .45); background: rgba(248, 113, 113, .06); color: #fecaca; }
.notice.warn { border-color: rgba(245, 185, 66, .4); background: rgba(245, 185, 66, .05); }
.notice.info { border-color: rgba(96, 165, 250, .4); background: rgba(96, 165, 250, .05); }

/* FAQ */
.faq { display: grid; gap: 10px; max-width: 820px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.faq summary { cursor: pointer; padding: 16px 48px 16px 18px; font-weight: 600; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; position: absolute; right: 20px; top: 22px; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(-135deg); top: 25px; }
.faq details p { padding: 0 18px 16px; margin: 0; color: var(--muted); }

/* CTA band + footer */
.cta-band {
  margin-top: 88px; text-align: center; padding: 48px 24px;
  background: radial-gradient(600px 240px at 50% 0%, rgba(52, 211, 153, .1), transparent 70%), var(--panel);
}
.cta-band h2 { margin-bottom: 10px; }
.cta-band p { color: var(--muted); }
footer { margin-top: 80px; padding: 32px 0 44px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }
footer .row { justify-content: space-between; align-items: flex-start; gap: 20px; }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--text); }

/* ---------- Tabs (dashboard + staff) ---------- */
.tabs {
  display: flex; gap: 4px; margin: 24px 0; padding: 4px; overflow-x: auto; scrollbar-width: none;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: none; min-height: 40px; padding: 8px 15px; border: 0; border-radius: 9px; background: none; color: var(--muted);
  font: inherit; font-size: .94rem; font-weight: 600; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected='true'] { color: var(--text); background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.tabs .count { font-size: .72rem; font-weight: 700; background: var(--warn); color: #241a00; padding: 0 7px; border-radius: 99px; line-height: 1.6; }
/* Student dashboard on phones: all four tabs visible at once instead of hiding one off-screen. */
@media (max-width: 480px) {
  .tabs.grid-sm { display: grid; grid-template-columns: 1fr 1fr; }
  .tabs.grid-sm button { justify-content: center; }
}
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
details.panel summary { cursor: pointer; font-weight: 600; }
details.panel[open] summary { margin-bottom: 14px; }
.code-out { font-family: var(--mono); font-size: 1.3rem; letter-spacing: .08em; color: var(--accent); }
pre.mail { white-space: pre-wrap; font-family: var(--mono); font-size: .85rem; background: var(--bg-2); padding: 12px; border-radius: 10px; margin: 8px 0 0; }

/* ---------- Auth ---------- */
.auth { display: grid; grid-template-columns: 1fr 440px; gap: 56px; align-items: center; padding: 64px 0; }
@media (max-width: 920px) { .auth { grid-template-columns: 1fr; padding: 28px 0; } .auth-side { display: none; } }
.auth-side h1 { font-size: clamp(2.2rem, 4.2vw, 3rem); max-width: 16ch; }
.auth-side ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 16px; }
.auth-side li { display: flex; gap: 14px; align-items: flex-start; color: var(--muted); }
.auth-side li strong { color: var(--text); display: block; }
.auth-side .icon-badge { margin: 0; flex: none; }
.auth-card { width: 100%; max-width: 440px; margin: 0 auto; padding: 28px; box-shadow: var(--shadow); }
.auth-card .tabs { margin-top: 0; }
.auth-card .tabs button { flex: 1; justify-content: center; }
.auth-card h2 { font-size: 1.6rem; }
.btn.google { width: 100%; background: #fff; color: #1f1f1f; border-color: #fff; margin-bottom: 4px; font-weight: 600; }
.btn.google:hover { background: #f1f3f4; border-color: #f1f3f4; color: #1f1f1f; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .85rem; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; border-top: 1px solid var(--line); }

/* ---------- Student dashboard ---------- */
.dash-hero { padding-top: 44px; padding-bottom: 0; }
.dash-hero h1 { font-size: clamp(2rem, 4.5vw, 2.6rem); margin-bottom: 18px; }
.dash-hero .eyebrow { margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .stats { gap: 8px; } }
.stat { padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-align: left; color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s; }
.stat:hover { border-color: var(--line-2); }
.stat b { display: block; font-size: 1.9rem; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; color: #f4f7fa; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.due b { color: var(--warn); }
.todo { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.todo p { margin: 0; flex: 1; min-width: 200px; }
.library { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
@media (max-width: 860px) { .library { grid-template-columns: 1fr; } .library .player { order: -1; } }
.lessons { padding: 6px 0; overflow: hidden; }
.lessons h3 { padding: 12px 16px 8px; margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.lessons button {
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; padding: 11px 16px; border: 0;
  background: transparent; color: var(--text); font: inherit; cursor: pointer;
}
.lessons button .n {
  flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; font-weight: 700;
  border: 1px solid var(--line-2); color: var(--muted);
}
.lessons button:hover { background: var(--bg-2); }
.lessons button[aria-current='true'] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.lessons button[aria-current='true'] .n { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.player video { display: block; width: 100%; border-radius: var(--radius); background: #000; aspect-ratio: 16 / 9; border: 1px solid var(--line); }
.player h2 { font-size: 1.4rem; margin-top: 14px; }
.player-nav { display: flex; gap: 8px; }
.when { display: flex; gap: 16px; align-items: flex-start; }
.date-chip { flex: none; width: 60px; text-align: center; border-radius: 12px; border: 1px solid var(--line-2); background: var(--bg-2); padding: 8px 0 6px; }
.date-chip b { display: block; font-size: 1.5rem; font-weight: 700; line-height: 1.1; color: #f4f7fa; }
.date-chip span { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.pay-head { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.pay-head .amt { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.2; color: #f4f7fa; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.copy { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); font: .85rem var(--mono); cursor: pointer; }
.copy:hover { border-color: var(--accent); }
.copy::after { content: 'copy'; font-family: var(--sans); font-size: .72rem; color: var(--muted); }
.copy.done::after { content: 'copied'; color: var(--accent); }
.stk { margin-top: 16px; padding: 16px; border: 1px solid rgba(52, 211, 153, .3); border-radius: 12px; background: rgba(52, 211, 153, .04); }
.stk form { display: flex; gap: 10px; flex-wrap: wrap; }
.stk input { flex: 1; min-width: 180px; width: auto; }
.waiting { display: flex; gap: 12px; align-items: center; }
.waiting .pulse { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(52, 211, 153, .6); animation: pulse 1.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(52, 211, 153, 0); } 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); } }
.pay-box { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.pay-box summary { cursor: pointer; color: var(--accent); font-weight: 600; margin-bottom: 10px; }

/* Phones: tables become stacked cards. Each cell is labelled with its column name (set by common.js). */
@media (max-width: 720px) {
  .table-wrap { border: 0; overflow: visible; background: none; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 0; margin-bottom: 12px; }
  .table-wrap td { border: 0; padding: 6px 16px; text-align: left; }
  .table-wrap td.num { text-align: left; }
  .table-wrap td[data-label]:not([data-label=''])::before {
    content: attr(data-label); display: block; margin-bottom: 2px;
    font-size: .72rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
  }
  .table-wrap td[colspan] { text-align: center; }
  .table-wrap td input:not([type=checkbox]), .table-wrap td select, .table-wrap td textarea { width: 100% !important; }
  .table-wrap .actions .btn { flex: 1; min-height: 42px; }
}

/* Gentle fade-in as sections scroll into view (fx.js). Only hides content once the script is running. */
.fx .reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.fx .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Legal pages (privacy, terms) ---------- */
.prose { max-width: 760px; padding: 48px 0 24px; color: var(--text-2); }
.prose h1 { font-size: clamp(2rem, 4vw, 2.6rem); }
.prose h2 { font-size: 1.3rem; margin-top: 2em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .45em; }
.prose strong { color: var(--text); }
.prose .updated { color: var(--muted); font-size: .9rem; }
