/* HayNexa — mobile-first stylesheet
   Palette from the logo: ink navy, royal, aqua. Ember is reserved for the streak. */
:root {
  --ink: #0A1650;
  --ink-2: #13226E;
  --royal: #1747D1;
  --royal-2: #2F63F0;
  --aqua: #14C8C4;
  --aqua-soft: #DDF7F6;
  --paper: #F3F6FD;
  --surface: #FFFFFF;
  --line: #DCE3F4;
  --line-strong: #C3CEEA;
  --text: #121A3D;
  --muted: #4A5578;
  --faint: #7D88AA;
  --ember: #FF6B1A;
  --ember-soft: #FFF0E6;
  --good: #0E9F6E;
  --good-soft: #E3F7EF;
  --bad: #DC2F3E;
  --bad-soft: #FDECEE;
  --warn: #B7791F;
  --warn-soft: #FFF6E0;

  --font-display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;

  --r-lg: 22px;   /* major surfaces */
  --r-md: 14px;   /* cards inside surfaces */
  --r-sm: 10px;   /* controls */
  --shadow: 0 1px 0 rgba(10, 22, 80, .04), 0 12px 32px -18px rgba(10, 22, 80, .35);
  --shadow-lift: 0 18px 40px -20px rgba(23, 71, 209, .55);
  --gutter: 16px;
  --max: 1160px;
  --tabbar-h: 66px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--text);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--royal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }
h1, h2, h3, h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.12; margin: 0 0 .5em; letter-spacing: -.015em; }
h1 { font-size: clamp(2rem, 6.5vw, 3.6rem); font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: clamp(1.5rem, 4vw, 2.2rem); font-weight: 750; }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
:focus-visible { outline: 3px solid var(--aqua); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
@media (max-width: 959px) { .hide-sm { display: none !important; } }
@media (min-width: 960px) { .hide-lg { display: none !important; } }
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }
.icon.lg { width: 26px; height: 26px; }

/* ------------------------------------------------------------ top bar --- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 38px; height: 38px; }
.brand span { font: 800 1.3rem/1 var(--font-display); letter-spacing: -.03em; }
@media (max-width: 400px) { .topbar .brand span { font-size: 1.12rem; } .topbar .btn.sm { padding: 0 12px; } }
.brand span b { color: var(--royal); font-weight: 800; }
.nav-links { display: none; gap: 4px; margin-left: 18px; }
.nav-links a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 600; font-size: .95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--ink); background: var(--paper); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
}
.icon-btn .dot { position: absolute; top: 6px; right: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--ember); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center; }
.avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--ink); color: #fff; display: inline-grid; place-items: center; font: 700 .85rem var(--font-display); flex: none; }
.avatar.lg { width: 84px; height: 84px; font-size: 1.6rem; }

/* mobile drawer (guests) */
.drawer { position: fixed; inset: 0; z-index: 80; pointer-events: none; }
.drawer .scrim { position: absolute; inset: 0; background: rgba(10, 22, 80, .45); opacity: 0; transition: opacity .25s; }
.drawer .panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(84vw, 340px); background: var(--surface); padding: 22px; transform: translateX(100%); transition: transform .32s var(--ease); display: flex; flex-direction: column; gap: 6px; }
.drawer.open { pointer-events: auto; }
.drawer.open .scrim { opacity: 1; }
.drawer.open .panel { transform: none; }
.drawer .panel a.link { padding: 14px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 600; display: flex; gap: 12px; align-items: center; }
.drawer .panel a.link:hover { background: var(--paper); }

/* bottom tab bar (signed-in, phones) — the "app" feel */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--faint); text-decoration: none; font-size: .72rem; font-weight: 700; position: relative; }
.tabbar a.active { color: var(--royal); }
.tabbar a.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--royal); }
.tabbar a.cta .bubble { width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, var(--royal), var(--aqua)); margin-top: -26px; box-shadow: var(--shadow-lift); }
body.has-tabbar { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); }

/* ------------------------------------------------------------- buttons --- */
.btn {
  --bg: var(--royal); --fg: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-sm); border: 1px solid transparent;
  background: var(--bg); color: var(--fg); font: 700 1rem var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s; -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.btn:hover { color: var(--fg); box-shadow: var(--shadow-lift); }
.btn:active { transform: scale(.97); }
.btn.ghost { --bg: var(--surface); --fg: var(--ink); border-color: var(--line-strong); }
.btn.ghost:hover { box-shadow: none; border-color: var(--royal); }
.btn.ink { --bg: var(--ink); }
.btn.aqua { --bg: var(--aqua); --fg: var(--ink); }
.btn.ember { --bg: var(--ember); }
.btn.danger { --bg: var(--bad-soft); --fg: var(--bad); }
.btn.danger:hover { box-shadow: none; --bg: #fbd5da; }
.btn.sm { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn[disabled], .btn.disabled { opacity: .5; pointer-events: none; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--royal); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------- forms --- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 700; font-size: .92rem; color: var(--ink); }
.field .hint { font-size: .82rem; color: var(--faint); }
.field .err, .err { font-size: .84rem; color: var(--bad); font-weight: 600; }
.req { color: var(--bad); }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: var(--r-sm);
  border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--text);
  font: 1rem var(--font-body); transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--royal); box-shadow: 0 0 0 4px rgba(23, 71, 209, .14); }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color: var(--bad); }
.grid-2, .grid-3 { display: grid; gap: 16px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.check {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 999px;
  border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; font-weight: 600; user-select: none;
}
.check input { position: absolute; opacity: 0; pointer-events: none; }
.check:has(input:checked) { border-color: var(--royal); background: #EAF0FF; color: var(--royal); }
.check:has(input:focus-visible) { outline: 3px solid var(--aqua); outline-offset: 2px; }
.check .tick { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.check:has(input:checked) .tick { background: var(--royal); border-color: var(--royal); }
.check:has(input:checked) .tick::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.switch input { width: 20px; height: 20px; accent-color: var(--royal); }

.photo-drop { display: flex; align-items: center; gap: 16px; padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: var(--r-md); background: var(--paper); cursor: pointer; }
.photo-drop .preview { width: 72px; height: 72px; border-radius: 50%; background: var(--surface) center/cover; border: 2px solid var(--line); display: grid; place-items: center; color: var(--faint); flex: none; }
.photo-drop input { position: absolute; opacity: 0; width: 1px; }

/* ------------------------------------------------------------- flashes --- */
.flashes { position: fixed; top: 72px; left: 0; right: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 var(--gutter); pointer-events: none; }
.flash { pointer-events: auto; width: min(560px, 100%); display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 600; animation: flashIn .45s var(--ease) both; }
.flash.success { border-left: 4px solid var(--good); }
.flash.error { border-left: 4px solid var(--bad); }
.flash.warning { border-left: 4px solid var(--warn); }
.flash.info { border-left: 4px solid var(--royal); }
.flash button { margin-left: auto; background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 1.2rem; line-height: 1; }
.flash.out { animation: flashOut .3s ease forwards; }
@keyframes flashIn { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
@keyframes flashOut { to { opacity: 0; transform: translateY(-10px); } }

/* --------------------------------------------------------------- hero ---- */
.hero { position: relative; background: var(--ink); color: #fff; overflow: hidden; isolation: isolate; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -2; background: radial-gradient(80% 60% at 85% 10%, rgba(20, 200, 196, .28), transparent 60%), radial-gradient(70% 70% at 0% 100%, rgba(47, 99, 240, .45), transparent 65%); }
.hero .wrap { display: grid; gap: 34px; padding-top: 44px; padding-bottom: 56px; }
.hero h1 { color: #fff; max-width: 15ch; }
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: inline-block; animation: rise .9s var(--ease) both; }
.hero h1 .line:nth-child(2) > span { animation-delay: .12s; }
.hero h1 .line:nth-child(3) > span { animation-delay: .24s; }
.hero .lede { color: #C9D4FA; font-size: 1.12rem; max-width: 46ch; animation: fadeUp .9s .35s var(--ease) both; }
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap; animation: fadeUp .9s .45s var(--ease) both; }
.hero .btn.ghost { --bg: transparent; --fg: #fff; border-color: rgba(255, 255, 255, .35); }
.hero .btn.ghost:hover { border-color: #fff; }
.hero .audience { margin-top: 18px; display: flex; gap: 8px; flex-wrap: wrap; animation: fadeUp .9s .55s var(--ease) both; }
.hero .audience span { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); color: #E3E9FF; font-size: .85rem; font-weight: 600; }
.trajectory { position: absolute; inset: auto 0 0 0; height: 62%; z-index: -1; pointer-events: none; }
.trajectory path.trail { fill: none; stroke: url(#trailGrad); stroke-width: 10; stroke-linecap: round; stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: draw 2.2s .3s var(--ease) forwards; opacity: .9; }
.trajectory path.trail-soft { fill: none; stroke: rgba(20, 200, 196, .16); stroke-width: 44; stroke-linecap: round; stroke-dasharray: 1600; stroke-dashoffset: 1600; animation: draw 2.2s .3s var(--ease) forwards; }
.trajectory .marker { opacity: 0; animation: pop .5s 2.2s var(--ease) forwards; transform-box: fill-box; transform-origin: center; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes rise { from { transform: translateY(105%); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
@keyframes pop { 0% { opacity: 0; transform: scale(.4); } 70% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: scale(1); } }

/* sample question shown in hero */
.qcard { background: var(--surface); color: var(--text); border-radius: var(--r-lg); padding: 18px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); animation: fadeUp 1s .6s var(--ease) both; max-width: 440px; }
.qcard .meta { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; color: var(--muted); font-weight: 700; margin-bottom: 10px; }
.qcard .q { font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.qcard .opt { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; margin-top: 8px; font-size: .95rem; }
.qcard .opt b { width: 26px; height: 26px; border-radius: 8px; background: var(--paper); display: grid; place-items: center; font-size: .8rem; color: var(--muted); flex: none; }
.qcard .opt.pick { border-color: var(--good); background: var(--good-soft); animation: pickIn .5s 1.6s both; }
.qcard .opt.pick b { background: var(--good); color: #fff; }
@keyframes pickIn { from { border-color: var(--line); background: #fff; } }
.qcard .foot { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .9rem; color: var(--muted); }

/* ------------------------------------------------------------ sections --- */
.section { padding: 56px 0; }
.section.tight { padding: 36px 0; }
.section.white { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 640px; margin-bottom: 26px; }
.section-head p { color: var(--muted); font-size: 1.06rem; }

.counts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.counts > div { background: var(--surface); padding: 18px; }
.counts strong { display: block; font: 800 1.8rem/1 var(--font-display); color: var(--ink); letter-spacing: -.02em; }
.counts span { color: var(--muted); font-size: .9rem; }

/* test formats as rows of an exam sheet */
.formats { border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.format { display: grid; gap: 14px; padding: 22px; border-top: 1px solid var(--line); }
.format:first-child { border-top: 0; }
.format .size { white-space: nowrap; font: 800 2.6rem/1 var(--font-display); color: var(--royal); letter-spacing: -.04em; }
.format .size small { font-size: .9rem; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-left: 4px; }
.format p { color: var(--muted); margin: 0; }
.dist { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.dist i { display: block; height: 100%; }
.dist-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; color: var(--muted); margin-top: 8px; }
.dist-legend span::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--c); margin-right: 6px; }
.s-phy { --c: #1747D1; background: #1747D1; }
.s-che { --c: #14C8C4; background: #14C8C4; }
.s-zoo { --c: #6C4DF0; background: #6C4DF0; }
.s-bot { --c: #22A06B; background: #22A06B; }

.features { display: grid; gap: 14px; }
.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature .ico { width: 44px; height: 44px; border-radius: 12px; background: #EAF0FF; color: var(--royal); display: grid; place-items: center; flex: none; }
.feature h3 { font-size: 1.05rem; margin-bottom: 4px; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }

/* leaderboard */
.board { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.board li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.board li:first-child { border-top: 0; }
.board li.me { background: #EEF3FF; }
.board .rank { width: 28px; font: 800 1.05rem var(--font-display); color: var(--faint); text-align: center; }
.board li:nth-child(1) .rank { color: #D4A017; }
.board li:nth-child(2) .rank { color: #8A94A8; }
.board li:nth-child(3) .rank { color: #B5651D; }
.board .who { flex: 1; min-width: 0; }
.board .who strong { display: block; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board .who span { font-size: .82rem; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.flame-count { display: inline-flex; align-items: center; gap: 4px; font: 800 1.05rem var(--font-display); color: var(--ember); }
.flame-count svg { width: 18px; height: 18px; }

/* about */
.leaders { display: grid; gap: 18px; }
.leader { display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.leader .portrait { width: 96px; height: 116px; border-radius: 16px; object-fit: cover; background: linear-gradient(160deg, var(--ink), var(--royal)); color: #fff; display: grid; place-items: center; font: 800 1.8rem var(--font-display); }
.leader .role { color: var(--royal); font-weight: 700; font-size: .9rem; }
.leader blockquote { margin: 8px 0 0; color: var(--muted); font-size: .95rem; }
.team-list { list-style: none; margin: 0; padding: 0; columns: 1; column-gap: 32px; }
.team-list li { break-inside: avoid; display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.team-list li strong { color: var(--ink); }
.team-list li span { color: var(--muted); }
.prose { max-width: 68ch; }
.prose p { color: var(--muted); font-size: 1.05rem; }

/* ------------------------------------------------------------- surfaces -- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; }
.card.pad-lg { padding: 26px; }
.card h2 { font-size: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2, .card-head h3 { margin: 0; }
.page-head { padding: 26px 0 16px; }
.page-head h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); margin-bottom: 4px; }
.page-head p { color: var(--muted); margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--paper); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.royal { background: #EAF0FF; color: var(--royal); border-color: transparent; }
.chip.ember { background: var(--ember-soft); color: var(--ember); border-color: transparent; }
.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty .icon { width: 40px; height: 40px; color: var(--line-strong); margin: 0 auto 10px; }

.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px; }
.kpi strong { display: block; font: 800 1.6rem/1.1 var(--font-display); color: var(--ink); letter-spacing: -.02em; }
.kpi span { font-size: .85rem; color: var(--muted); }

/* tables become stacked cards on phones */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .8rem; color: var(--faint); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { font-variant-numeric: tabular-nums; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
@media (max-width: 759px) {
  .table.stack thead { display: none; }
  .table.stack tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .table.stack tr:last-child { border-bottom: 0; }
  .table.stack td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .table.stack td::before { content: attr(data-label); color: var(--faint); font-size: .82rem; font-weight: 700; text-align: left; }
  .table.stack td.lead { display: block; text-align: left; font-weight: 700; color: var(--ink); padding-bottom: 6px; }
  .table.stack td.lead::before { display: none; }
}
.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 18px; }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar > * { flex: 1 1 160px; }
.toolbar .btn { flex: 0 0 auto; }

/* --------------------------------------------------------- dashboard ----- */
.dash-grid { display: grid; gap: 16px; }
.streak-card { position: relative; overflow: hidden; background: var(--ink); color: #fff; border-radius: var(--r-lg); padding: 20px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.streak-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 107, 26, .35), transparent 70%); }
.streak-card h2 { color: #fff; margin: 0; font-size: 1.1rem; }
.streak-card p { margin: 4px 0 0; color: #C9D4FA; font-size: .92rem; }
.ring { position: relative; width: 112px; height: 112px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255, 255, 255, .12); }
.ring .fill { stroke: var(--ember); stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease); }
.ring .center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .center strong { display: block; font: 800 2rem/1 var(--font-display); }
.ring .center span { font-size: .72rem; color: #C9D4FA; }
.flame { width: 26px; height: 26px; color: var(--ember); transform-origin: 50% 90%; animation: flicker 1.8s ease-in-out infinite; }
.flame.dead { color: rgba(255, 255, 255, .3); animation: none; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.08, 1.12) rotate(2deg); } }
.reward-banner { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--r-md); background: linear-gradient(120deg, var(--ember), #FFB020); color: #fff; animation: pop .6s var(--ease) both; }
.reward-banner strong { display: block; }
.reward-banner .btn { margin-left: auto; --bg: #fff; --fg: var(--ember); }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.calendar .d { aspect-ratio: 1; border-radius: 7px; background: var(--paper); border: 1px solid var(--line); }
.calendar .d.l1 { background: #FFD9C2; border-color: transparent; }
.calendar .d.l2 { background: #FFA36B; border-color: transparent; }
.calendar .d.l3 { background: var(--ember); border-color: transparent; }
.calendar .d.today { outline: 2px solid var(--royal); outline-offset: 1px; }

.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-dasharray: 3 4; }
.chart .grid text { fill: var(--faint); font-size: 11px; }
.chart .area { fill: url(#areaGrad); }
.chart .line { fill: none; stroke: var(--royal); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: draw 1.6s var(--ease) forwards; }
.chart circle { fill: #fff; stroke: var(--royal); stroke-width: 2.5; }
.chart .xl { fill: var(--faint); font-size: 10.5px; }

.quick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick a { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-weight: 700; transition: border-color .2s, transform .2s var(--ease); }
.quick a:hover { border-color: var(--royal); transform: translateY(-2px); }
.quick a .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: #EAF0FF; color: var(--royal); }
.quick a.daily { background: linear-gradient(140deg, var(--royal), var(--ink)); color: #fff; border: 0; }
.quick a.daily .ico { background: rgba(255, 255, 255, .15); color: #fff; }
.quick a small { font-weight: 600; color: var(--muted); }
.quick a.daily small { color: #C9D4FA; }

.resume { display: flex; gap: 12px; align-items: center; padding: 14px 16px; border-radius: var(--r-md); background: var(--warn-soft); border: 1px solid #F3D9A4; }

/* ------------------------------------------------------------ test hub --- */
.hub { display: grid; gap: 16px; }
.hub-block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.hub-block .top { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.hub-block .big { font: 800 2.4rem/1 var(--font-display); color: var(--royal); letter-spacing: -.04em; min-width: 64px; }
.subject-acc { border: 1px solid var(--line); border-radius: var(--r-md); margin-top: 10px; overflow: hidden; }
.subject-acc summary { list-style: none; cursor: pointer; padding: 14px 16px; display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink); }
.subject-acc summary::-webkit-details-marker { display: none; }
.subject-acc summary .chev { margin-left: auto; transition: transform .25s; }
.subject-acc[open] summary .chev { transform: rotate(180deg); }
.subject-acc .topics { border-top: 1px solid var(--line); }
.topic-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.topic-row:first-child { border-top: 0; }
.topic-row .name { flex: 1 1 180px; }
.topic-row form { display: flex; gap: 6px; }
.set-list { display: grid; gap: 10px; }
.set-item { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-md); flex-wrap: wrap; }
.set-item .yr { font: 800 1.3rem var(--font-display); color: var(--ink); min-width: 56px; }

/* --------------------------------------------------------------- exam ---- */
body.exam-mode { background: #EEF2FC; }
.exam-bar { position: sticky; top: 0; z-index: 55; background: var(--ink); color: #fff; }
.exam-bar .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.exam-bar .title { min-width: 0; flex: 1; }
.exam-bar .title strong { display: block; font: 700 .98rem var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exam-bar .title span { font-size: .78rem; color: #AFC0F5; }
.timer { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .1); font: 800 1.05rem var(--font-display); font-variant-numeric: tabular-nums; }
.timer.low { background: var(--bad); animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(220, 47, 62, .25); } }
.exam-progress { height: 4px; background: rgba(255, 255, 255, .12); }
.exam-progress i { display: block; height: 100%; width: 0; background: var(--aqua); transition: width .3s var(--ease); }
.exam-layout { display: grid; gap: 16px; padding-top: 18px; padding-bottom: 120px; }
.question { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; }
.js .question { display: none; }
.js .question.current { display: block; animation: qIn .35s var(--ease); }
@keyframes qIn { from { opacity: 0; transform: translateX(14px); } }
.question .qhead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: .85rem; font-weight: 700; }
.question .qtext { font-size: 1.12rem; font-weight: 700; color: var(--ink); line-height: 1.5; margin-bottom: 16px; white-space: pre-line; }
.option { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 14px; margin-top: 10px; border-radius: var(--r-md); border: 1.5px solid var(--line-strong); background: var(--surface); font: 1rem/1.45 var(--font-body); color: var(--text); cursor: pointer; transition: border-color .15s, background .15s, transform .12s; -webkit-tap-highlight-color: transparent; min-height: 56px; }
.option:hover { border-color: var(--royal); }
.option:active { transform: scale(.99); }
.option .letter { width: 32px; height: 32px; border-radius: 10px; background: var(--paper); display: grid; place-items: center; font: 800 .9rem var(--font-display); color: var(--muted); flex: none; transition: background .15s, color .15s; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option.selected, .option:has(input:checked) { border-color: var(--royal); background: #EEF3FF; }
.option.selected .letter, .option:has(input:checked) .letter { background: var(--royal); color: #fff; }
.qnav { display: flex; gap: 10px; margin-top: 18px; }
.qnav .btn { flex: 1; }
.palette { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.palette .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; max-height: 260px; overflow-y: auto; }
.palette button { aspect-ratio: 1; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--surface); font: 700 .85rem var(--font-display); color: var(--muted); cursor: pointer; }
.palette button.answered { background: var(--royal); border-color: var(--royal); color: #fff; }
.palette button.current { outline: 3px solid var(--aqua); outline-offset: 1px; }
.palette .legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); margin: 10px 0 0; }
.save-state { font-size: .8rem; color: var(--faint); }
.save-state.err { color: var(--bad); }
.exam-submit { position: fixed; left: 0; right: 0; bottom: 0; z-index: 56; background: var(--surface); border-top: 1px solid var(--line); padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom)); }
.exam-submit .wrap { display: flex; gap: 10px; align-items: center; padding: 0; }

.modal { position: fixed; inset: 0; z-index: 100; display: none; place-items: center; padding: var(--gutter); background: rgba(10, 22, 80, .55); }
.modal.open { display: grid; }
.modal .box { width: min(440px, 100%); background: var(--surface); border-radius: var(--r-lg); padding: 22px; animation: pop .35s var(--ease); }

/* protection layer */
.protected { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.watermark { position: fixed; inset: 0; z-index: 54; pointer-events: none; overflow: hidden; opacity: .07; }
.watermark div { position: absolute; inset: -50%; display: flex; flex-wrap: wrap; gap: 70px 90px; transform: rotate(-24deg); font: 700 15px var(--font-body); color: var(--ink); align-content: flex-start; }
.shield { position: fixed; inset: 0; z-index: 200; display: none; place-items: center; text-align: center; background: var(--ink); color: #fff; padding: 24px; }
.shield.on { display: grid; }
.shield h2 { color: #fff; }
.shield p { color: #C9D4FA; }
@media print { body * { display: none !important; } body::after { content: "Printing is disabled on HayNexa."; display: block !important; } }

/* -------------------------------------------------------------- report --- */
.score-hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: grid; gap: 18px; }
.score-big { font: 800 3.4rem/1 var(--font-display); color: var(--ink); letter-spacing: -.04em; }
.score-big small { font-size: 1.2rem; color: var(--faint); letter-spacing: 0; }
.score-bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: var(--paper); }
.score-bar .c { background: var(--good); }
.score-bar .w { background: var(--bad); }
.score-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; color: var(--muted); }
.score-legend b { color: var(--ink); }
.review { display: grid; gap: 12px; }
.review-item { background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--line-strong); border-radius: var(--r-md); padding: 16px; }
.review-item.right { border-left-color: var(--good); }
.review-item.wrong { border-left-color: var(--bad); }
.review-item .qtext { font-weight: 700; color: var(--ink); margin-bottom: 10px; white-space: pre-line; }
.review-item ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.review-item li { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--paper); font-size: .95rem; }
.review-item li b { width: 24px; flex: none; color: var(--muted); }
.review-item li.correct { background: var(--good-soft); color: #075E42; font-weight: 700; }
.review-item li.picked-wrong { background: var(--bad-soft); color: #8E1622; font-weight: 700; text-decoration: line-through; text-decoration-thickness: 1px; }
.review-item .expl { margin-top: 10px; font-size: .9rem; color: var(--muted); padding: 10px 12px; border-radius: 10px; background: #F7F9FF; border: 1px dashed var(--line-strong); }
.once-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-md); background: var(--warn-soft); color: #7A4F0E; font-size: .92rem; }

/* --------------------------------------------------------------- notes --- */
.note-grid { display: grid; gap: 12px; }
.note-card { display: block; padding: 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--text); transition: border-color .2s; }
.note-card:hover { border-color: var(--royal); color: var(--text); }
.note-card h3 { font-size: 1.05rem; margin: 8px 0 4px; }
.note-card p { color: var(--muted); font-size: .92rem; margin: 0; }
.note-card.important { border-left: 4px solid var(--ember); }
.note-body { font-size: 1.06rem; line-height: 1.75; max-width: 70ch; }
.note-body h2 { font-size: 1.5rem; margin-top: 1.2em; }
.note-body h3 { font-size: 1.2rem; margin-top: 1.1em; }
.note-body h4 { margin-top: 1em; }
.note-body ul, .note-body ol { padding-left: 1.3em; }
.note-body li { margin: .25em 0; }
.note-body mark { background: #FFF1A8; padding: 0 3px; border-radius: 3px; }
.note-body code { background: var(--paper); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.callout { display: flex; flex-direction: column; gap: 2px; margin: 1em 0; padding: 12px 16px; border-radius: var(--r-md); background: var(--ember-soft); border-left: 4px solid var(--ember); }
.callout strong { color: var(--ember); font-size: .85rem; }
.pills { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pills a { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--muted); font-weight: 700; font-size: .9rem; }
.pills a.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ----------------------------------------------------------------- auth -- */
.auth { min-height: calc(100vh - 62px); display: grid; }
.auth-side { display: none; }
.auth-main { padding: 28px var(--gutter) 48px; display: flex; justify-content: center; }
.auth-box { width: 100%; max-width: 520px; }
.auth-box.wide { max-width: 720px; }
.steps { display: flex; gap: 6px; margin-bottom: 22px; }
.steps span { flex: 1; height: 5px; border-radius: 3px; background: var(--line); transition: background .3s; }
.steps span.on { background: linear-gradient(90deg, var(--royal), var(--aqua)); }
.js .step { display: none; }
.js .step.current { display: block; animation: qIn .35s var(--ease); }
.step-title { font: 700 1.05rem var(--font-display); color: var(--ink); margin-bottom: 14px; }
.step-nav { display: flex; gap: 10px; margin-top: 22px; }
.step-nav .btn { flex: 1; }
.no-js-only { display: none; }

/* ---------------------------------------------------------------- panel -- */
.panel-shell { display: grid; gap: 0; }
.panel-nav { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 62px; z-index: 40; }
.panel-nav .scroller { display: flex; gap: 4px; overflow-x: auto; padding: 8px var(--gutter); scrollbar-width: none; }
.panel-nav .scroller::-webkit-scrollbar { display: none; }
.panel-nav a { flex: none; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: .9rem; white-space: nowrap; }
.panel-nav a:hover { background: var(--paper); color: var(--ink); }
.panel-nav a.active { background: var(--ink); color: #fff; }
.panel-nav .sep { display: none; }
.panel-main { padding: 18px var(--gutter) 56px; min-width: 0; }
.qtext-cell { max-width: 520px; color: var(--ink); }
.actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.inline { display: inline; }
.result-box { margin-top: 16px; }
.result-box ul { margin: 6px 0 0; padding-left: 1.2em; font-size: .9rem; color: var(--muted); }
.dup-warn { display: none; margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); color: var(--bad); font-weight: 700; font-size: .9rem; }
.dup-warn.on { display: block; animation: pop .3s var(--ease); }
.answer-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.answer-picker label { display: grid; place-items: center; height: 48px; border-radius: var(--r-sm); border: 1.5px solid var(--line-strong); font: 800 1.05rem var(--font-display); cursor: pointer; position: relative; }
.answer-picker input { position: absolute; opacity: 0; }
.answer-picker label:has(input:checked) { background: var(--good); border-color: var(--good); color: #fff; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; background: var(--paper); padding: 2px 6px; border-radius: 6px; }
details.inline-edit summary { cursor: pointer; color: var(--royal); font-weight: 700; list-style: none; }
details.inline-edit summary::-webkit-details-marker { display: none; }
details.inline-edit[open] { padding: 12px; border-radius: var(--r-md); background: var(--paper); margin: 8px 0; }

/* -------------------------------------------------------------- footer --- */
.footer { background: var(--ink); color: #AFC0F5; padding: 40px 0 28px; margin-top: 40px; }
.footer .wrap { display: grid; gap: 22px; }
.footer a { color: #fff; text-decoration: none; }
.footer .brand span { color: #fff; }
.footer .brand span b { color: var(--aqua); }
.footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer .fine { font-size: .82rem; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 18px; }

.error-page { text-align: center; padding: 70px var(--gutter); }
.error-page .code-num { font: 800 5rem/1 var(--font-display); background: linear-gradient(120deg, var(--royal), var(--aqua)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* reveal on scroll (one subtle entrance per page section) */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------- breakpoints ----- */
@media (min-width: 560px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .counts { grid-template-columns: repeat(4, 1fr); }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .quick { grid-template-columns: repeat(4, 1fr); }
  .note-grid { grid-template-columns: 1fr 1fr; }
  .team-list { columns: 2; }
}
@media (min-width: 760px) {
  :root { --gutter: 28px; }
  .format { grid-template-columns: 210px 1fr 1.1fr; align-items: center; }
  .features { grid-template-columns: 1fr 1fr; gap: 26px 34px; }
  .leaders { grid-template-columns: 1fr 1fr; }
  .leader { grid-template-columns: 130px 1fr; }
  .leader .portrait { width: 130px; height: 156px; }
  .score-hero { grid-template-columns: auto 1fr; align-items: center; }
  .footer .wrap { grid-template-columns: 1.4fr 1fr; }
}
@media (min-width: 960px) {
  .nav-links { display: flex; }
  .hero .wrap { grid-template-columns: 1.15fr .85fr; align-items: center; padding-top: 72px; padding-bottom: 96px; }
  .hero .qcard { justify-self: end; }
  .tabbar { display: none; }
  body.has-tabbar { padding-bottom: 0; }
  .dash-grid { grid-template-columns: 1.4fr 1fr; align-items: start; }
  .dash-grid .span-2 { grid-column: 1 / -1; }
  .exam-layout { grid-template-columns: 1fr 300px; align-items: start; }
  .exam-layout .palette { position: sticky; top: 84px; }
  .auth { grid-template-columns: 1fr 1.1fr; }
  .auth-side { display: flex; flex-direction: column; justify-content: flex-end; position: relative; overflow: hidden; background: var(--ink); color: #fff; padding: 48px; }
  .auth-side h2 { color: #fff; font-size: 2.2rem; max-width: 14ch; }
  .auth-side p { color: #C9D4FA; max-width: 40ch; }
  .auth-side .trajectory { height: 70%; }
  .auth-main { align-items: center; }
  .panel-shell { grid-template-columns: 236px 1fr; }
  .panel-nav { position: sticky; top: 62px; height: calc(100vh - 62px); border-bottom: 0; border-right: 1px solid var(--line); }
  .panel-nav .scroller { flex-direction: column; overflow: visible; padding: 18px 14px; }
  .panel-nav .sep { display: block; font-size: .78rem; color: var(--faint); font-weight: 700; padding: 14px 12px 4px; }
  .panel-main { padding: 26px 34px 60px; }
  .note-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
  .trajectory path.trail, .trajectory path.trail-soft, .chart .line { stroke-dashoffset: 0; }
  .js .reveal { opacity: 1; transform: none; }
}

/* ===================================================== v2 additions ===== */
[hidden] { display: none !important; }
.s-mat { --c: #E0A21B; background: #E0A21B; }

/* hero leaderboard (replaces the sample question card) */
.hero-board { background: var(--surface); color: var(--text); border-radius: var(--r-lg); padding: 18px; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .6); animation: fadeUp 1s .6s var(--ease) both; width: 100%; max-width: 440px; }
.hero-board h2 { font-size: 1.15rem; margin: 0; }
.hero-board .row a { font-size: .85rem; font-weight: 700; }
.hero-board .board { border: 0; margin-top: 8px; }
.hero-board .board li { padding: 10px 2px; }
.hero-board .empty { padding: 22px 8px; }
.hero-board .foot { display: flex; gap: 6px; align-items: center; margin: 8px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); font-size: .86rem; color: var(--muted); }
.hero-board .foot .icon { color: var(--ember); }
@media (min-width: 960px) { .hero .hero-board { justify-self: end; } }

/* programs */
.program-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.program-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: var(--text); transition: border-color .2s, transform .25s var(--ease); }
.program-card:hover { border-color: var(--royal); transform: translateY(-3px); color: var(--text); }
.program-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.program-mark { display: grid; place-items: center; aspect-ratio: 16 / 9; background: linear-gradient(140deg, var(--ink), var(--royal) 70%, var(--aqua)); color: #fff; font: 800 2.2rem/1 var(--font-display); letter-spacing: -.03em; }
.program-card > div { padding: 14px 16px 18px; }
.program-card h3 { margin: 0 0 4px; }
.program-card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* blog */
.post-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.post-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: var(--text); transition: border-color .2s; }
.post-card:hover { border-color: var(--royal); color: var(--text); }
.post-card img, .post-cover-blank { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-cover-blank { display: block; background: radial-gradient(80% 90% at 90% 0%, rgba(20, 200, 196, .35), transparent 60%), var(--ink); }
.post-body { padding: 14px 16px 18px; }
.post-body h3 { margin: 6px 0; font-size: 1.1rem; }
.post-body p { margin: 0; color: var(--muted); font-size: .92rem; }
.article { font-size: 1.06rem; }
.article .lead { font-size: 1.15rem; color: var(--muted); }
.article-cover { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--r-lg); margin-bottom: 16px; }
.md-img { margin: 1.2em 0; }
.md-img img { border-radius: var(--r-md); border: 1px solid var(--line); max-height: 520px; width: auto; }
.cover-preview { max-width: 320px; border-radius: var(--r-md); border: 1px solid var(--line); }

/* question pictures */
.q-img { max-width: 100%; max-height: 360px; width: auto; border-radius: var(--r-md); border: 1px solid var(--line); margin: 0 0 12px; background: #fff; }

/* editor */
.editor { border: 1.5px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.editor:focus-within { border-color: var(--royal); box-shadow: 0 0 0 4px rgba(23, 71, 209, .14); }
.editor-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: var(--paper); border-bottom: 1px solid var(--line); align-items: center; }
.editor-bar button, .editor-bar .upload-btn { min-height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font: 600 .85rem var(--font-body); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.editor-bar button:hover, .editor-bar .upload-btn:hover { border-color: var(--royal); }
.editor-status { font-size: .8rem; color: var(--muted); margin-left: 4px; }
.editor textarea { border: 0; border-radius: 0; box-shadow: none !important; min-height: 260px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92rem; }

/* tabs */
.tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 14px; scrollbar-width: none; }
.tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font: 700 .9rem var(--font-body); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* past papers picker */
.picker { margin-bottom: 8px; }
.picker-title { font-size: 1rem; color: var(--muted); margin: 14px 0 8px; }
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.year-grid a { display: grid; place-items: center; min-height: 52px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); text-decoration: none; font: 800 1.1rem var(--font-display); color: var(--ink); }
.year-grid a:first-child { font-size: .9rem; font-family: var(--font-body); }
.year-grid a.on { background: var(--royal); color: #fff; border-color: var(--royal); }
.answer-only { display: none; }
[data-answer-box].open .answer-only { display: block; }
[data-answer-box].open li.answer-key { background: var(--good-soft); color: #075E42; font-weight: 700; }

/* recommendations, subject bars, time per day */
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tips li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r-md); background: var(--paper); font-size: .94rem; }
.tips li .icon { margin-top: 3px; }
.tips li.focus { background: var(--ember-soft); }
.tips li.focus .icon { color: var(--ember); }
.tips li.good .icon { color: var(--good); }
.subj-bars { display: grid; gap: 14px; }
.subj-row .score-bar { height: 10px; margin-top: 6px; }
.daybars { display: grid; gap: 6px; max-height: 340px; overflow-y: auto; }
.daybar { display: grid; grid-template-columns: 48px 1fr 70px; gap: 8px; align-items: center; font-size: .85rem; }
.daybar .d { color: var(--faint); font-variant-numeric: tabular-nums; }
.daybar .bar { height: 10px; border-radius: 6px; background: var(--paper); overflow: hidden; }
.daybar .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--royal), var(--aqua)); }
.daybar .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
.report-range { align-items: flex-end; }
.report-range .field { flex: 1 1 150px; }
.report-tools .share { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }

/* full test plan */
.plan-total { font-size: 1.05rem; }
.plan-subject summary { cursor: pointer; list-style: none; }
.plan-subject summary::-webkit-details-marker { display: none; }
.plan-num { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; }
.plan-num input { width: 90px; min-height: 40px; }
.plan-topics { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.plan-topic { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--paper); }
.plan-topic input { width: 80px; min-height: 38px; }

.danger-zone summary { cursor: pointer; color: var(--bad); }
.quick { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 560px) { .quick { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .quick { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); } }
.dash-grid .span-2 { grid-column: 1 / -1; }
.table .num { white-space: nowrap; }
@media (min-width: 960px) { .panel-nav { overflow-y: auto; align-self: start; } }
@media (max-width: 759px) {
  .table.stack td { display: block; text-align: right; }
  .table.stack td::before { float: left; margin-right: 12px; }
  .table.stack td .actions { justify-content: flex-end; }
}
.program-mark { font-size: clamp(1.5rem, 3vw, 2rem); padding: 0 12px; text-align: center; }
