/* CadreUp AI student app. Mobile first; sidebar layout from 900px.
   Design tokens first; every colour, radius and shadow below comes from them. */

:root {
  --bg: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --surface-3: #e6e9f1;
  --line: #e3e6ee;
  --line-strong: #cfd4e0;
  --text: #141827;
  --text-2: #424a5e;
  --muted: #6b7389;

  --brand: #2f3a8f;
  --brand-hover: #252e73;
  --brand-soft: #eceef9;
  --brand-soft-2: #d6daf2;
  --brand-ink: #ffffff;
  --brand-grad: linear-gradient(135deg, #27307a 0%, #2f3a8f 55%, #4553b8 100%);

  --accent: #9a5b00;
  --accent-soft: #fdf1dc;
  --good: #137a47; --good-soft: #e3f4ea;
  --bad: #c0392b; --bad-soft: #fcebe9;
  --warn: #9a5b00; --warn-soft: #fdf1dc;

  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 26, 23, .05);
  --shadow: 0 1px 2px rgba(15, 26, 23, .04), 0 2px 8px rgba(15, 26, 23, .05);
  --shadow-lg: 0 12px 32px rgba(15, 26, 23, .12), 0 2px 6px rgba(15, 26, 23, .06);
  --ring: 0 0 0 3px rgba(47, 58, 143, .22);

  --header-h: 56px; --nav-h: 66px; --side-w: 248px;
  --font: "Inter", "Anek Bangla", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

/* Signed-out pages (landing, sign-in) always use the light palette. */
:root.force-light {
  --bg: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #f0f2f7;
  --surface-3: #e6e9f1;
  --line: #e3e6ee;
  --line-strong: #cfd4e0;
  --text: #141827;
  --text-2: #424a5e;
  --muted: #6b7389;
  --brand: #2f3a8f;
  --brand-hover: #252e73;
  --brand-soft: #eceef9;
  --brand-soft-2: #d6daf2;
  --brand-ink: #ffffff;
  --brand-grad: linear-gradient(135deg, #27307a 0%, #2f3a8f 55%, #4553b8 100%);
  --accent: #9a5b00;
  --accent-soft: #fdf1dc;
  --good: #137a47; --good-soft: #e3f4ea;
  --bad: #c0392b; --bad-soft: #fcebe9;
  --warn: #9a5b00; --warn-soft: #fdf1dc;
  --radius-sm: 8px; --radius: 12px; --radius-lg: 16px; --radius-xl: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 26, 23, .05);
  --shadow: 0 1px 2px rgba(15, 26, 23, .04), 0 2px 8px rgba(15, 26, 23, .05);
  --shadow-lg: 0 12px 32px rgba(15, 26, 23, .12), 0 2px 6px rgba(15, 26, 23, .06);
  --ring: 0 0 0 3px rgba(47, 58, 143, .22);
  --header-h: 56px; --nav-h: 66px; --side-w: 248px;
  --font: "Inter", "Anek Bangla", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1018; --surface: #151824; --surface-2: #1c2030; --surface-3: #252a3c;
    --line: #262b3b; --line-strong: #333a4f;
    --text: #e9ebf2; --text-2: #bcc1d1; --muted: #8d93a8;
    --brand: #8b97f0; --brand-hover: #a3adf4; --brand-soft: #1d2244; --brand-soft-2: #272d58; --brand-ink: #0b0e2a;
    --brand-grad: linear-gradient(135deg, #1c2150 0%, #232a66 55%, #2c357c 100%);
    --accent: #f0b85a; --accent-soft: #33280f;
    --good: #5fd39a; --good-soft: #15301f; --bad: #ff8a7d; --bad-soft: #3a1a17; --warn: #f0b85a; --warn-soft: #33280f;
    --shadow-sm: none; --shadow: none; --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);
    --ring: 0 0 0 3px rgba(139, 151, 240, .3);
    color-scheme: dark;
  }
}

/* ---- base ---------------------------------------------------------------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15.5px/1.6 var(--font); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { line-height: 1.3; margin: 0; letter-spacing: -0.01em; color: var(--text); }
h1 { font-size: 23px; font-weight: 600; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15.5px; font-weight: 650; }
p { margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.nowrap { flex-wrap: nowrap; }
.stack { display: grid; gap: 12px; }
.stack.lg { gap: 24px; }
.grow { flex: 1; min-width: 0; }
.num { font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { body { font-size: 15.5px; } h1 { font-size: 26px; } }

/* ---- buttons & inputs ------------------------------------------------------- */
button, .btn {
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.3; color: var(--text); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 16px; min-height: 42px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  text-decoration: none; transition: background .12s, border-color .12s, color .12s; box-shadow: none;
}
button:hover:not(:disabled), .btn:hover { background: var(--surface-2); border-color: var(--muted); }
button:active:not(:disabled), .btn:active { background: var(--surface-3); }
button:focus-visible, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover:not(:disabled), a.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-primary:active:not(:disabled) { background: var(--brand-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-block { width: 100%; }
.btn-sm { min-height: 34px; padding: 5px 12px; font-size: 14px; border-radius: 8px; }
.btn-lg { min-height: 48px; padding: 11px 22px; font-size: 16px; }
.icon-btn { min-height: 38px; width: 38px; padding: 0; border-color: transparent; background: transparent; color: var(--text-2); }
.btn-on-dark { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); color: #fff; box-shadow: none; }
.btn-on-dark:hover:not(:disabled) { background: rgba(255, 255, 255, .22); }
.btn-light { background: #fff; border-color: #fff; color: #27307a; }
.btn-light:hover:not(:disabled), a.btn-light:hover { background: #eef0fb; }
input, select, textarea {
  font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; width: 100%; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .8; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
button:focus-visible, a:focus-visible { outline: none; box-shadow: var(--ring); }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--text-2); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 5px 14px; min-height: 36px;
  background: var(--surface); font-size: 14.5px; font-weight: 500; box-shadow: none;
}
.chip.on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 650; }
.segmented { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.segmented button { min-height: 32px; padding: 4px 14px; border: 0; background: transparent; box-shadow: none; font-size: 14px; color: var(--text-2); border-radius: 8px; }
.segmented button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.warn { background: var(--accent-soft); color: var(--accent); }

/* ---- surfaces ------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; box-shadow: var(--shadow); }
.card.tight { padding: 14px; }
.card-link { display: block; color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.card-link.row { display: flex; }
.card-link:hover { border-color: var(--brand-soft-2); box-shadow: var(--shadow-lg); }
.notice { border-radius: var(--radius); padding: 11px 14px; font-size: 14.5px; background: var(--surface-2); border: 1px solid var(--line); }
.notice.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.notice.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.grid-2 { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-auto { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.stat { display: grid; gap: 2px; }
.stat b { font-size: 24px; line-height: 1.2; }
.stat span { font-size: 13.5px; color: var(--muted); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: grid; justify-items: center; gap: 8px; }
.empty .empty-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.empty b { color: var(--text); font-size: 15.5px; }
.bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--brand); border-radius: inherit; transition: width .4s; }
.bar.bad > i { background: var(--bad); }
.bar.warn > i { background: #d48a12; }
.list { display: grid; }
.list > * { padding: 12px 0; border-top: 1px solid var(--line); }
.list > *:first-child { border-top: 0; padding-top: 4px; }
.list > *:last-child { padding-bottom: 4px; }
.list-row { display: flex; align-items: center; gap: 12px; color: inherit; }
a.list-row:hover .list-title { color: var(--brand); }
.list-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* page header & sections */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--muted); max-width: 62ch; }
.eyebrow { font-size: 12.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.section-head a { font-size: 14px; font-weight: 600; }

/* icon chips, KPI tiles */
.ichip { flex: none; width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.ichip.amber { background: var(--accent-soft); color: var(--accent); }
.ichip.red { background: var(--bad-soft); color: var(--bad); }
.ichip.blue { background: #e6eefc; color: #2457c5; }
.ichip.violet { background: #efe9fc; color: #6a3fc4; }
@media (prefers-color-scheme: dark) {
  .ichip.blue { background: #16233d; color: #8fb2ff; }
  .ichip.violet { background: #251a3d; color: #b99cff; }
}
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { display: flex; align-items: center; gap: 12px; padding: 14px; color: inherit; }
.kpi .v { font-size: 21px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi .l { font-size: 13px; color: var(--muted); line-height: 1.3; }

/* action tiles */
.actions { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 900px) { .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.action { display: grid; gap: 10px; align-content: start; padding: 16px; color: inherit; min-height: 128px; }
.action b { font-size: 15.5px; }
.action .small { line-height: 1.45; }

/* hero */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius-xl); padding: 22px; color: #fff;
  background: var(--brand-grad); box-shadow: var(--shadow-lg); display: grid; gap: 18px;
}
.hero::after {
  content: ""; position: absolute; right: -80px; top: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 70%); pointer-events: none;
}
.hero h1, .hero h2 { color: #fff; }
.hero .sub { color: rgba(255, 255, 255, .82); margin: 4px 0 0; }
.hero-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; background: rgba(255, 255, 255, .16); font-size: 13.5px; font-weight: 600; }
.hero-goal { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 76px; height: 76px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .ring-label { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; font-size: 17px; }
.hero .row { position: relative; z-index: 1; }
@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr auto; align-items: center; padding: 28px 30px; }
}

/* layout helpers */
.two-col { display: grid; gap: 16px; }
@media (min-width: 1000px) { .two-col { grid-template-columns: 1fr 1fr; align-items: start; } }

/* skeleton loading */
.skeleton { display: grid; gap: 12px; }
.sk { border-radius: var(--radius); background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } * { transition: none !important; } }

/* ---- shell -------------------------------------------------------------------- */
.shell { min-height: 100dvh; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--header-h); display: flex; align-items: center; gap: 10px;
  padding: 0 12px 0 16px; background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16.5px; color: var(--text); letter-spacing: -0.01em; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.ai-badge { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .04em; padding: 1px 6px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); vertical-align: 2px; margin-left: 2px; }
.auth-brand .ai-badge { background: rgba(255, 255, 255, .18); color: #fff; }
.auth-brand .brand img { box-shadow: 0 0 0 2px rgba(255, 255, 255, .45); }
.brand small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: -2px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; font-size: 15px;
}
main.page { padding: 20px 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom)); max-width: 1080px; margin: 0 auto; animation: enter .25s ease-out; }
@keyframes enter { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.bottomnav {
  position: fixed; inset: auto 0 0 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding: 6px 4px env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.navlink { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12px; font-weight: 550; }
.navlink .nav-ico { display: grid; place-items: center; width: 52px; height: 30px; border-radius: 999px; transition: background .15s; }
.navlink.on { color: var(--brand); font-weight: 700; }
.bottomnav .navlink.on .nav-ico { background: var(--brand-soft); }
.sidebar { display: none; }
.focus-mode .bottomnav { display: none; }
.focus-mode main.page { padding-bottom: 32px; }

@media (min-width: 900px) {
  :root { --header-h: 0px; }
  .shell { display: grid; grid-template-columns: var(--side-w) 1fr; }
  .topbar { display: none; }
  .sidebar {
    display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100dvh; padding: 18px 14px; overflow-y: auto;
    border-right: 1px solid var(--line); background: var(--surface);
  }
  .sidebar .brand { padding: 4px 8px 14px; }
  .sidebar .navlink { padding: 7px 12px !important; }
  .sidebar .nav-label { font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 12px 12px 6px; }
  .sidebar .navlink { flex-direction: row; justify-content: flex-start; gap: 12px; padding: 9px 12px; border-radius: 10px; font-size: 15px; color: var(--text-2); }
  .sidebar .navlink .nav-ico { width: auto; height: auto; }
  .sidebar .navlink:hover { background: var(--surface-2); color: var(--text); }
  .sidebar .navlink.on { background: var(--brand-soft); color: var(--brand); }
  .sidebar .spacer { flex: 1; }
  .sidebar .me { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 1px solid var(--line); color: inherit; }
  .sidebar .me:hover, .sidebar .me.on { background: var(--surface-2); }
  .sidebar .me span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 600; }
  .bottomnav { display: none; }
  main.page { padding: 32px 36px 56px; }
  .focus-mode { grid-template-columns: 1fr; }
  .focus-mode .sidebar { display: none; }
}

/* ---- sign in & onboarding ----------------------------------------------------- */
.auth-wrap { min-height: 100dvh; display: grid; }
.auth-brand {
  background: var(--brand-grad); color: #fff; padding: 28px 22px 64px; position: relative; overflow: hidden;
}
.auth-brand::after { content: ""; position: absolute; right: -120px; bottom: -140px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.14), rgba(255,255,255,0) 70%); }
.auth-brand .brand { color: #fff; }
.auth-brand .brand small { color: rgba(255, 255, 255, .75); }
.auth-brand h1 { color: #fff; font-size: 27px; margin: 28px 0 8px; max-width: 18ch; }
.auth-brand p { color: rgba(255, 255, 255, .85); max-width: 44ch; }
.features { display: grid; gap: 14px; margin-top: 24px; position: relative; z-index: 1; }
.feature { display: flex; gap: 12px; align-items: flex-start; }
.feature .ichip { background: rgba(255, 255, 255, .15); color: #fff; width: 36px; height: 36px; }
.feature b { display: block; color: #fff; font-size: 15px; }
.feature span { color: rgba(255, 255, 255, .78); font-size: 13.5px; }
@media (max-width: 899px) {
  .auth-wrap { align-content: start; }
  .auth-brand { padding: 22px 20px 60px; }
  .auth-brand h1 { font-size: 22px; margin: 20px 0 6px; }
  .auth-brand p { font-size: 14.5px; margin: 0; }
  .auth-brand .features { display: none; }
}
.auth-panel { display: grid; place-items: start center; padding: 0 16px 32px; margin-top: -40px; position: relative; z-index: 2; }
.auth-card { width: 100%; max-width: 420px; padding: 24px; border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); }
.auth-card h2 { font-size: 20px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 4px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.legal { font-size: 12.5px; color: var(--muted); text-align: center; }
@media (min-width: 900px) {
  .auth-wrap { grid-template-columns: 1.05fr 1fr; }
  .auth-brand { padding: 48px 56px; display: flex; flex-direction: column; }
  .auth-brand h1 { font-size: 36px; margin-top: auto; }
  .auth-brand .features { margin-bottom: auto; margin-top: 32px; }
  .auth-panel { place-items: center; margin: 0; padding: 32px; }
  .auth-card { box-shadow: var(--shadow); }
}
.onboard-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.onboard-wrap .auth-card { max-width: 520px; }
.steps { display: flex; gap: 6px; }
.steps i { height: 4px; flex: 1; border-radius: 999px; background: var(--surface-3); }
.steps i.on { background: var(--brand); }
.splash { min-height: 100dvh; display: grid; place-items: center; gap: 16px; align-content: center; }
.splash img { width: 56px; height: 56px; border-radius: 14px; }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- practice: subject grid ------------------------------------------------------ */
.subjects { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.subject {
  display: grid; gap: 8px; text-align: left; justify-items: stretch; justify-content: stretch; align-items: stretch;
  align-content: start; width: 100%; padding: 14px; min-height: 0;
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-weight: 500;
}
.subject:hover:not(:disabled) { background: var(--surface); border-color: var(--brand-soft-2); }
.subject.on { border-color: var(--brand); box-shadow: var(--ring); }
.subject .name { font-weight: 650; font-size: 15px; color: var(--text); line-height: 1.35; }
.subject .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.start-bar {
  position: sticky; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom)); z-index: 10;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
}
@media (min-width: 900px) { .start-bar { bottom: 20px; } }
@media (max-width: 599px) {
  .start-bar .small { display: none; }
  .start-bar > .btn-primary { width: 100%; }
}

/* ---- question cards ----------------------------------------------------------- */
.q-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.q-text { font-size: 17px; font-weight: 600; margin-bottom: 14px; white-space: pre-line; line-height: 1.55; }
.options { display: grid; gap: 8px; }
.option {
  /* Self-contained, so read-only options (divs) look the same as clickable ones (buttons). */
  display: flex; align-items: center; justify-content: flex-start; text-align: left; width: 100%; padding: 10px 12px;
  gap: 12px; min-height: 50px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 500;
  box-shadow: none; border-radius: var(--radius);
}
.option .key {
  flex: none; width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 650; font-size: 14px;
}
.option:not(:disabled):hover { border-color: var(--brand); background: var(--surface); }
.option.picked { border-color: var(--brand); background: var(--brand-soft); }
.option.picked .key { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.option.correct { border-color: var(--good); background: var(--good-soft); }
.option.correct .key { background: var(--good); border-color: var(--good); color: #fff; }
.option.wrong { border-color: var(--bad); background: var(--bad-soft); }
.option.wrong .key { background: var(--bad); border-color: var(--bad); color: #fff; }
.option:disabled { opacity: 1; cursor: default; }
.explain { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; font-size: 15px; }
.explain details summary { cursor: pointer; color: var(--brand); font-size: 14.5px; font-weight: 600; }
.verdict { font-weight: 700; margin-bottom: 6px; }
.verdict.good { color: var(--good); }
.verdict.bad { color: var(--bad); }
.progress-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.progress-dots i { width: 22px; height: 5px; border-radius: 999px; background: var(--surface-3); }
.progress-dots i.good { background: var(--good); }
.progress-dots i.bad { background: var(--bad); }
.progress-dots i.now { background: var(--brand); opacity: .45; }

/* ---- mock test runner ---------------------------------------------------------- */
.test-bar {
  position: sticky; top: calc(var(--header-h) + 8px); z-index: 15; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 10px 14px; margin-bottom: 18px; box-shadow: var(--shadow-lg);
}
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 20px; letter-spacing: .02em; }
.timer.low { color: var(--bad); }
.section-title { margin: 24px 0 10px; font-size: 13px; color: var(--muted); font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; }
.palette button { min-height: 38px; padding: 0; font-size: 13px; box-shadow: none; }
.palette button.done { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.palette button.good { background: var(--good-soft); border-color: var(--good); color: var(--good); }
.palette button.bad { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.score-big { font-size: 44px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; text-transform: uppercase; letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }
.table-wrap { overflow-x: auto; }
.option-card { display: grid; gap: 14px; align-content: start; }
.option-card .facts { display: flex; flex-wrap: wrap; gap: 6px; }
.option-card .grow-space { flex: 1; }
.option-card > button, .option-card > .btn { margin-top: auto; }

/* ---- photo solve ---------------------------------------------------------- */
.photo-drop { flex-direction: column; gap: 6px; width: 140px; min-height: 128px; border: 2px dashed var(--line-strong); border-radius: 12px;
  background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 13.5px; box-shadow: none; }
.photo-drop:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---- viva ---------------------------------------------------------------- */
.viva-thread { display: grid; gap: 14px; padding: 4px 0 8px; }
.viva-board { display: flex; gap: 10px; align-items: flex-start; max-width: 92%; }
.viva-board .msg { margin-top: 2px; }

/* ---- study plan ---------------------------------------------------------------- */
.tasks { display: grid; gap: 8px; }
.task { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.task.done { background: var(--surface-2); }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-title { font-weight: 600; line-height: 1.4; }
.check { flex: none; width: 26px; height: 26px; min-height: 26px; padding: 0; border-radius: 8px; border: 2px solid var(--line-strong); box-shadow: none; }
.task.done .check { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
details.day summary { cursor: pointer; list-style: none; }
details.day summary::-webkit-details-marker { display: none; }

/* ---- current affairs --------------------------------------------------------- */
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.facts-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.facts-list li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.55; }
.facts-list li svg { flex: none; margin-top: 4px; color: var(--brand); }
.digest h2 { margin: 22px 0 10px; font-size: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.digest h2:first-child { margin-top: 0; }
.digest ul { padding-left: 20px; margin: 0; display: grid; gap: 8px; }
.digest li { line-height: 1.65; }

/* ---- chat ------------------------------------------------------------------- */
.chat-layout { display: grid; grid-template-columns: 1fr; height: calc(100dvh - var(--header-h) - var(--nav-h) - env(safe-area-inset-bottom)); }
main.page.chat-page { padding: 0; max-width: none; animation: none; }
.chat-list { display: none; border-right: 1px solid var(--line); overflow-y: auto; padding: 14px 12px; background: var(--surface); }
.chat-list.open { display: block; position: fixed; inset: var(--header-h) 0 calc(var(--nav-h) + env(safe-area-inset-bottom)) 0; z-index: 25; }
.chat-list-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.chat-list a { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-radius: 10px; color: var(--text-2); font-size: 14.5px; }
.chat-list a.on, .chat-list a:hover { background: var(--surface-2); color: var(--text); }
.chat-list a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list a .icon-btn { opacity: .55; }
.chat-list a:hover .icon-btn { opacity: 1; }
.chat-main { display: flex; flex-direction: column; min-height: 0; background: var(--bg); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 20px 16px; }
.chat-inner { max-width: 760px; margin: 0 auto; display: grid; gap: 16px; }
.msg { max-width: 88%; padding: 11px 15px; border-radius: 18px; overflow-wrap: anywhere; line-height: 1.6; }
.msg.user { justify-self: end; background: var(--brand); color: var(--brand-ink); border-bottom-right-radius: 6px; white-space: pre-wrap; }
.msg.assistant { justify-self: start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 6px; box-shadow: var(--shadow-sm); }
.msg.error { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.msg.assistant > :first-child { margin-top: 0; }
.msg.assistant > :last-child { margin-bottom: 0; }
.msg.assistant p, .msg.assistant ul, .msg.assistant ol { margin: 0 0 8px; }
.msg.assistant ul, .msg.assistant ol { padding-left: 22px; }
.msg.assistant table { margin: 8px 0; }
.msg.assistant code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.status-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; }
.status-line .spinner { width: 16px; height: 16px; border-width: 2px; }
.typing::after { content: "▍"; animation: blink 1s steps(2) infinite; color: var(--brand); }
@keyframes blink { 50% { opacity: 0; } }
.composer { border-top: 1px solid var(--line); background: var(--surface); padding: 12px; }
.composer-inner { max-width: 760px; margin: 0 auto; }
.composer form { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { resize: none; max-height: 160px; min-height: 46px; line-height: 1.45; border-radius: 14px; padding: 11px 14px; }
.composer .send { min-width: 46px; min-height: 46px; border-radius: 14px; padding: 0; }
.suggest { display: grid; gap: 8px; margin-top: 12px; }
@media (min-width: 700px) { .suggest { grid-template-columns: 1fr 1fr; } }
.suggest button { justify-content: flex-start; text-align: left; font-weight: 500; padding: 12px 14px; border-radius: var(--radius); }
.chat-empty { text-align: center; display: grid; justify-items: center; gap: 6px; margin-top: 16px; }
.chat-empty .ichip { width: 52px; height: 52px; border-radius: 16px; }
@media (min-width: 900px) {
  .chat-layout { grid-template-columns: 280px 1fr; height: 100dvh; }
  .chat-list, .chat-list.open { display: block; position: static; }
  .chat-toggle, .chat-list-head { display: none; }
}

/* ---- dialogs & toasts --------------------------------------------------------- */
.backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(8, 14, 12, .5); backdrop-filter: blur(2px); display: grid; place-items: end center; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.dialog {
  width: 100%; max-width: 500px; background: var(--surface); border-radius: 20px 20px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 90dvh; overflow-y: auto; box-shadow: var(--shadow-lg);
}
@media (min-width: 600px) { .backdrop { place-items: center; padding: 16px; } .dialog { border-radius: 20px; } }
.toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast { background: #15201c; color: #f2f3f8; padding: 11px 16px; border-radius: 12px; font-size: 14.5px; max-width: 480px; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@media (min-width: 900px) { .toasts { bottom: 24px; } }

/* Privacy, terms, refund and contact links (sidebar foot, profile page) */
.legal-links { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; padding: 4px 2px; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { color: var(--text); text-decoration: underline; }
.legal a { color: inherit; }

/* Beta notice above each page (dismissible, remembered per browser) */
.beta-banner { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 9px 10px 9px 12px;
  border-radius: var(--radius); background: var(--accent-soft); color: var(--text); font-size: 14px; line-height: 1.5; }
.beta-banner a { color: var(--accent); font-weight: 600; }
.beta-tag { flex: none; background: var(--accent); color: #fff; font-weight: 700; font-size: 12px; padding: 2px 9px; border-radius: 999px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .beta-tag { color: #2a1b00; } }

/* ---- Landing page (signed-out visitors) ---------------------------------------------------- */
.auth-back { display: inline-flex; align-items: center; gap: 6px; color: rgba(255,255,255,.85); font-size: 14px; margin-bottom: 18px; position: relative; z-index: 1; text-decoration: none; }
.auth-back:hover { color: #fff; }
.lp { --lp-max: 1120px; background: var(--bg); overflow-x: clip; }
.lp > section, .lp-nav, .lp-foot { max-width: var(--lp-max); margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.lp h1, .lp h2, .lp h3 { letter-spacing: -.01em; }
.lp-nav { display: flex; align-items: center; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.lp-nav .brand { text-decoration: none; color: var(--text); }
.lp-links { display: none; gap: 26px; margin-left: auto; }
.lp-links a { color: var(--text-2); text-decoration: none; font-weight: 500; }
.lp-links a:hover { color: var(--brand); }
.lp-signin { margin-left: auto; }

/* Hero: promise on the left, a real question on the right */
.lp-hero { display: grid; gap: 28px; align-items: center; padding-top: 18px; padding-bottom: 24px; position: relative; }
.lp-hero::before { content: ""; position: absolute; z-index: 0; inset: -60px -20% auto auto; width: 620px; height: 520px; pointer-events: none;
  background: radial-gradient(closest-side, rgba(69,83,184,.18), transparent 70%); }
.lp-hero > * { position: relative; z-index: 1; }
.lp-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: 13.5px; padding: 6px 12px; border-radius: 999px; }
.lp-hero h1 { font-size: clamp(33px, 7vw, 56px); line-height: 1.22; font-weight: 600; margin: 16px 0 12px; }
.lp-grad { background: linear-gradient(120deg, #2f3a8f, #4553b8 55%, #6b78d6); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="dark"] .lp-grad { background-image: linear-gradient(120deg, #8b97f0, #c3c9fa); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]):not(.force-light) .lp-grad { background-image: linear-gradient(120deg, #8b97f0, #c3c9fa); } }
.lp-hero-text > p { font-size: 17.5px; line-height: 1.75; color: var(--text-2); max-width: 46ch; margin: 0; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.lp-cta { gap: 8px; }
.lp-ghost { gap: 8px; background: var(--surface); }
.lp-proof { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 20px; color: var(--muted); font-size: 14.5px; }
.lp-proof b { color: var(--text); font-weight: 700; }
.lp-proof i { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }

/* "Try a question" card */
.lp-try { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 20px; box-shadow: 0 24px 60px rgba(20, 24, 60, .14), 0 2px 6px rgba(20,24,60,.06); }
.lp-try-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; flex-wrap: wrap; }
.lp-try-note { margin-left: auto; font-weight: 500; font-size: 12.5px; color: var(--muted); background: var(--surface-2); padding: 3px 10px; border-radius: 999px; }
.lp-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.2); }
.lp-try-tags { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.lp-try-tags span { background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.lp-try-q { font-size: 19px; font-weight: 600; line-height: 1.5; margin: 10px 0 14px; }
.lp-try-opts { display: grid; gap: 8px; }
.lp-try-opts button { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; padding: 11px 12px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 16px; cursor: pointer; transition: border-color .15s, background .15s; }
.lp-try-opts button:not(:disabled):hover { border-color: var(--brand); background: var(--brand-soft); }
.lp-try-opts button b { flex: none; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); font-size: 15px; }
.lp-try-opts button.right { border-color: var(--good); background: var(--good-soft); }
.lp-try-opts button.right b { background: var(--good); color: #fff; }
.lp-try-opts button.wrong { border-color: var(--bad); background: var(--bad-soft); }
.lp-try-opts button.dim { opacity: .55; }
.lp-try-opts button:disabled { cursor: default; opacity: 1; }
.lp-try-opts button.dim:disabled { opacity: .55; }
.lp .lp-try-opts button { justify-content: flex-start; min-height: 52px; box-shadow: none; }
.lp-try-opts button span { flex: 1; }
.lp-try-exp { margin-top: 12px; border-radius: 14px; padding: 12px 14px; animation: lp-in .25s ease-out; }
.lp-try-exp.good { background: var(--good-soft); } .lp-try-exp.bad { background: var(--bad-soft); }
.lp-try-exp.good b { color: var(--good); } .lp-try-exp.bad b { color: var(--bad); }
.lp-try-exp p { margin: 4px 0 0; color: var(--text); line-height: 1.65; font-size: 15px; }
.lp-try-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.lp-try-actions .btn-primary { gap: 6px; }
.lp-try-skel { height: 22px; border-radius: 8px; margin-top: 16px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: lp-shimmer 1.2s infinite; }
.lp-try-skel.short { width: 60%; height: 140px; }
@keyframes lp-shimmer { to { background-position: -200% 0; } }
@keyframes lp-in { from { opacity: 0; transform: translateY(4px); } }

/* Colourful icon chips */
.lp-icon { flex: none; display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; color: #fff; box-shadow: 0 8px 18px -6px var(--sh, rgba(0,0,0,.25)); }
.lp-icon.sm { width: 40px; height: 40px; border-radius: 12px; }
.tone-0 { background: linear-gradient(135deg, #6b78d6, #2f3a8f); --sh: rgba(47,58,143,.45); }
.tone-1 { background: linear-gradient(135deg, #60a5fa, #2563eb); --sh: rgba(37,99,235,.45); }
.tone-2 { background: linear-gradient(135deg, #a78bfa, #7c3aed); --sh: rgba(124,58,237,.45); }
.tone-3 { background: linear-gradient(135deg, #fbbf24, #d97706); --sh: rgba(217,119,6,.45); }
.tone-4 { background: linear-gradient(135deg, #fb7185, #e11d48); --sh: rgba(225,29,72,.4); }

/* Sections */
.lp-section { padding-top: 72px; scroll-margin-top: 12px; }
.lp-head { text-align: center; max-width: 700px; margin: 0 auto 30px; }
.lp-eyebrow { color: var(--brand); font-weight: 700; font-size: 14px; letter-spacing: .02em; }
.lp-head h2 { font-size: clamp(25px, 4.4vw, 38px); line-height: 1.3; margin: 8px 0 10px; }
.lp-head p { color: var(--text-2); font-size: 16.5px; margin: 0; }

/* Stage cards: prelim → written → viva */
.lp-stages { display: grid; gap: 14px; position: relative; }
.lp-stage { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 22px; }
.lp-stage-top { display: flex; align-items: center; gap: 14px; }
.lp-step { font-size: 12.5px; font-weight: 700; color: var(--muted); letter-spacing: .03em; }
.lp-stage h3 { font-size: 21px; margin: 0; line-height: 1.35; }
.lp-stage small { color: var(--muted); font-size: 13.5px; }
.lp-stage ul { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 9px; }
.lp-stage li { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.lp-stage li svg { flex: none; margin-top: 3px; color: var(--good); }

/* Feature tabs */
.lp-tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 10px; margin: 0 -20px 6px; padding-left: 20px; padding-right: 20px; scroll-snap-type: x proximity; }
.lp-tabs::-webkit-scrollbar { display: none; }
.lp-tabs button { flex: none; display: inline-flex; align-items: center; gap: 7px; font: inherit; font-weight: 600; font-size: 15px; padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text-2); cursor: pointer; scroll-snap-align: start; transition: background .15s, color .15s, border-color .15s; }
.lp-tabs button:hover { border-color: var(--brand-soft-2); color: var(--text); }
.lp-tabs button.on { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.lp-tab-body { display: grid; gap: 24px; align-items: center; background: linear-gradient(160deg, var(--brand-soft), transparent 70%), var(--surface);
  border: 1px solid var(--line); border-radius: 28px; padding: 26px 22px; overflow: hidden; }
.lp-tab-text h3 { font-size: clamp(23px, 3.6vw, 30px); line-height: 1.3; margin: 0 0 10px; }
.lp-tab-text p { color: var(--text-2); font-size: 16.5px; line-height: 1.8; margin: 0 0 20px; max-width: 46ch; }
.lp-tab-art { display: grid; place-items: center; }
.lp-phone { border-radius: 30px; overflow: hidden; background: var(--surface); border: 7px solid #0e1018; box-shadow: 0 30px 60px rgba(20, 24, 60, .28); }
.lp-tab-art .lp-phone { width: min(270px, 74%); display: grid; }
.lp-tab-art .lp-phone img { grid-area: 1 / 1; width: 100%; height: auto; display: block; opacity: 0; transition: opacity .3s; }
.lp-tab-art .lp-phone img.on { opacity: 1; }
.lp-more { display: grid; gap: 12px; margin-top: 16px; }
.lp-more-item { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; }
.lp-more-item b { display: block; font-size: 15.5px; }
.lp-more-item span:not(.lp-icon) { color: var(--muted); font-size: 14px; line-height: 1.55; }

/* Steps, FAQ, final CTA, footer */
.lp-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.lp-steps li { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.lp-num { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 18px; }
.lp-steps h3 { font-size: 18px; margin: 14px 0 4px; }
.lp-steps p { margin: 0; color: var(--text-2); }
.lp-faq { max-width: 780px; margin: 0 auto; display: grid; gap: 10px; }
.lp-faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 4px 18px; }
.lp-faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: "+"; color: var(--brand); font-size: 22px; line-height: 1; }
.lp-faq details[open] summary::after { content: "−"; }
.lp-faq details p { margin: 0 0 16px; color: var(--text-2); line-height: 1.75; }
.lp-final { margin-top: 80px !important; text-align: center; padding: 48px 24px !important; border-radius: 28px; color: #fff;
  background: radial-gradient(600px 300px at 10% 0%, rgba(255,255,255,.14), transparent 60%), var(--brand-grad); }
.lp-final h2 { font-size: clamp(26px, 4.5vw, 38px); margin: 0 0 10px; color: #fff; }
.lp-final p { margin: 0 auto; max-width: 52ch; color: rgba(255,255,255,.88); font-size: 16.5px; }
.lp-final .lp-actions { justify-content: center; }
.lp-final .lp-cta { background: #fff; color: #27307a; border-color: #fff; }
.lp-final .lp-cta:hover { background: #eef0fb; border-color: #eef0fb; }
.lp-final .lp-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.lp-foot { padding-top: 48px; padding-bottom: 40px; color: var(--muted); font-size: 13.5px; display: grid; gap: 12px; }
.lp-foot .brand { color: var(--text); }
.lp-foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.lp-foot a { color: var(--text-2); text-decoration: none; }
.lp-foot a:hover { color: var(--brand); }
.lp-foot p { margin: 0; line-height: 1.7; }

@media (min-width: 720px) {
  .lp-stages { grid-template-columns: repeat(3, 1fr); }
  .lp-more { grid-template-columns: repeat(2, 1fr); }
  .lp-steps { grid-template-columns: repeat(3, 1fr); }
  .lp-tabs { justify-content: center; margin: 0 0 6px; padding-left: 2px; padding-right: 2px; flex-wrap: wrap; }
}
@media (min-width: 960px) {
  .lp-links { display: flex; }
  .lp-signin { margin-left: 8px; }
  .lp-hero { grid-template-columns: 1.05fr 1fr; gap: 56px; padding-top: 52px; padding-bottom: 48px; }
  .lp-try { padding: 26px; }
  .lp-tab-body { grid-template-columns: 1.1fr 1fr; padding: 40px 48px; gap: 40px; }
  .lp-more { grid-template-columns: repeat(4, 1fr); }
  .lp-more-item { flex-direction: column; }
}
@media (max-width: 719px) {
  .lp-hero-text > p { font-size: 16px; }
  .lp-section { padding-top: 56px; }
}
@media (max-width: 420px) {
  .lp-actions .btn { flex: 1 1 100%; }
}

/* ---- previous years' papers ---------------------------------------------------- */
.stack.sm { gap: 6px; }
.past-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.past-card { gap: 14px; }
.past-card button { white-space: nowrap; }
.past-title { margin: 0; font-size: 18px; font-weight: 600; }
