/* ==========================================================================
   The Exam Hub — 16+ admissions practice
   Design: midnight navy chrome, gold accents, ivory "exam paper" for questions.
   ========================================================================== */
:root {
  --bg: #080F1F;
  --bg2: #0C162B;
  --panel: #111C34;
  --panel2: #16233F;
  --panel3: #1C2B4B;
  --line: rgba(201, 163, 39, .16);
  --line2: rgba(255, 255, 255, .07);
  --gold: #C9A327;
  --gold2: #E3C566;
  --gold3: #F4E2A6;
  --goldGrad: linear-gradient(135deg, #F0D78A 0%, #C9A327 45%, #A8841A 100%);
  --ivory: #F7F2E6;
  --text: #ECE7DA;
  --muted: #A3ABBD;
  --muted2: #7C8499;
  --ok: #43B581;
  --okBg: rgba(67, 181, 129, .14);
  --bad: #E26D5F;
  --badBg: rgba(226, 109, 95, .14);
  --amber: #E7A93B;
  --paper: #FBF8F0;
  --paperLine: #E4DCC8;
  --ink: #16213A;
  --ink2: #4A5570;
  --radius: 16px;
  --radiusS: 10px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .35);
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', 'Segoe UI', system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --navW: 240px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(1200px 600px at 85% -10%, rgba(201, 163, 39, .10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(64, 96, 170, .10), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans); font-size: 15px; line-height: 1.55;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--gold2); }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: .2px; }
h1 { font-size: 30px; line-height: 1.15; margin: 0 0 6px; }
h2 { font-size: 22px; line-height: 1.2; margin: 0 0 12px; }
h3 { font-size: 17px; margin: 0 0 8px; }
.hide { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.gold { color: var(--gold2); }
.caps { text-transform: uppercase; letter-spacing: 1.6px; font-size: 11px; font-weight: 700; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.center { text-align: center; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mt24 { margin-top: 24px; } .mt32 { margin-top: 32px; }
.mb8 { margin-bottom: 8px; } .mb16 { margin-bottom: 16px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.side {
  width: var(--navW); flex: none; position: fixed; top: 0; bottom: 0; left: 0;
  background: linear-gradient(180deg, #0B1428, #070D1B);
  border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 6px; z-index: 30;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 4px 8px 20px; text-decoration: none; color: inherit; }
.brand img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgba(201,163,39,.5), 0 6px 18px rgba(0,0,0,.4); background: #fff; }
.brand .bt { font-family: var(--serif); font-size: 19px; line-height: 1.05; color: var(--ivory); }
.brand .bt b { display: block; font-weight: 700; background: var(--goldGrad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .bs { font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: transparent; border: 0; border-radius: 12px; padding: 11px 12px;
  color: var(--muted); font-weight: 600; font-size: 14.5px; text-align: left;
}
.nav-btn svg { width: 20px; height: 20px; flex: none; }
.nav-btn:hover { background: rgba(255,255,255,.04); color: var(--text); }
.nav-btn.on { background: linear-gradient(90deg, rgba(201,163,39,.20), rgba(201,163,39,.04)); color: var(--gold3); box-shadow: inset 2px 0 0 var(--gold); }
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line2); font-size: 12px; color: var(--muted2); }

.main { flex: 1; margin-left: var(--navW); min-width: 0; }
.page-wrap { max-width: 1120px; margin: 0 auto; padding: 32px 36px 80px; }
.topbar { display: none; }

.bottom-nav { display: none; }

@media (max-width: 900px) {
  .side { display: none; }
  .main { margin-left: 0; }
  .page-wrap { padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
  .topbar {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 25;
    padding: 12px 16px; background: rgba(8,15,31,.88); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .topbar img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #fff; }
  .topbar .bt { font-family: var(--serif); font-size: 17px; }
  .topbar .bt b { background: var(--goldGrad); -webkit-background-clip: text; background-clip: text; color: transparent; }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: rgba(9,16,32,.96); backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .bottom-nav .nav-btn { flex-direction: column; gap: 3px; font-size: 10.5px; padding: 7px 2px; text-align: center; justify-content: center; }
  .bottom-nav .nav-btn.on { box-shadow: inset 0 2px 0 var(--gold); }
  h1 { font-size: 25px; }
}

/* ---------- surfaces ---------- */
.card {
  background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line2); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card.gold { border-color: rgba(201,163,39,.35); background: linear-gradient(160deg, rgba(201,163,39,.12), rgba(17,28,52,.9) 45%); }
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } }
.g4.keep2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1100px) { .g4.keep2 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.eyebrow { color: var(--gold2); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; font-weight: 700; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.06); color: var(--muted);
  border: 1px solid var(--line2); white-space: nowrap;
}
.pill.gold { background: rgba(201,163,39,.14); color: var(--gold3); border-color: rgba(201,163,39,.35); }
.pill.ok { background: var(--okBg); color: #7FE0B0; border-color: rgba(67,181,129,.35); }
.pill.bad { background: var(--badBg); color: #F3A79D; border-color: rgba(226,109,95,.35); }
.pill.amber { background: rgba(231,169,59,.14); color: #F4C98A; border-color: rgba(231,169,59,.35); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; padding: 12px 20px;
  font-weight: 700; font-size: 14.5px; letter-spacing: .2px; text-decoration: none;
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--goldGrad); color: #1B1405; box-shadow: 0 8px 22px rgba(201,163,39,.28); }
.btn.primary:hover { box-shadow: 0 10px 28px rgba(201,163,39,.42); }
.btn.ghost { background: rgba(255,255,255,.04); border-color: rgba(201,163,39,.35); color: var(--gold3); }
.btn.ghost:hover { background: rgba(201,163,39,.10); }
.btn.quiet { background: transparent; color: var(--muted); padding: 10px 12px; }
.btn.quiet:hover { color: var(--text); }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- home ---------- */
.hero { position: relative; overflow: hidden; padding: 28px; }
.hero::after {
  content: ''; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,163,39,.22), transparent 65%); pointer-events: none;
}
.stat-big { font-family: var(--serif); font-size: 46px; line-height: 1; color: var(--gold2); }
.stat-lbl { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 6px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
@media (max-width: 760px) { .stats { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.stat { background: rgba(255,255,255,.035); border: 1px solid var(--line2); border-radius: 14px; padding: 14px 16px; }
.stat b { display: block; font-family: var(--serif); font-size: 26px; color: var(--ivory); font-weight: 600; line-height: 1.1; }
.stat span { font-size: 11px; color: var(--muted); letter-spacing: 1.2px; text-transform: uppercase; font-weight: 700; }

.zone-card {
  position: relative; overflow: hidden; cursor: pointer; text-align: left; width: 100%;
  border: 1px solid var(--line2); border-radius: var(--radius); padding: 20px 18px 18px;
  background: linear-gradient(165deg, var(--panel3), var(--panel) 70%);
  transition: transform .15s ease, border-color .2s ease, box-shadow .2s ease;
  min-height: 176px; display: flex; flex-direction: column;
}
.zone-card:hover { transform: translateY(-2px); border-color: rgba(201,163,39,.45); box-shadow: 0 14px 36px rgba(0,0,0,.4); }
.zone-card .zi { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; background: rgba(201,163,39,.13); color: var(--gold2); border: 1px solid rgba(201,163,39,.3); }
.zone-card .zi svg { width: 24px; height: 24px; }
.zone-card h3 { margin: 14px 0 4px; font-size: 19px; color: var(--ivory); }
.zone-card p { margin: 0; color: var(--muted); font-size: 13px; }
.zone-card .zfoot { margin-top: auto; padding-top: 14px; display: flex; align-items: center; gap: 10px; }
.bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; flex: 1; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--goldGrad); }
.bar.ok > i { background: linear-gradient(90deg, #3BA374, #6BD6A4); }
.bar.bad > i { background: linear-gradient(90deg, #C9574B, #EE8C80); }
.bar.amber > i { background: linear-gradient(90deg, #D39227, #F2C064); }

.test-card { display: flex; flex-direction: column; gap: 10px; cursor: pointer; text-align: left; width: 100%; color: inherit; }
.test-card .tt { font-family: var(--serif); font-size: 20px; color: var(--ivory); }
.test-card:hover { border-color: rgba(201,163,39,.5); }
.test-meta { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- lists ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.li {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 14px;
  background: rgba(255,255,255,.03); border: 1px solid var(--line2);
}
.li.click { cursor: pointer; }
.li.click:hover { border-color: rgba(201,163,39,.4); background: rgba(201,163,39,.05); }
.li .lt { font-weight: 700; color: var(--ivory); }
.li .ls { font-size: 12.5px; color: var(--muted); }
.score-chip { min-width: 58px; text-align: center; font-family: var(--serif); font-size: 20px; color: var(--gold2); }

/* ---------- activity page ---------- */
.act { display: flex; flex-direction: column; gap: 12px; }
.act .ah { display: flex; gap: 14px; align-items: flex-start; }
.levels { display: flex; gap: 8px; flex-wrap: wrap; }
.lvl {
  flex: 1; min-width: 96px; border-radius: 12px; padding: 10px 12px; text-align: left;
  background: rgba(255,255,255,.035); border: 1px solid var(--line2); color: var(--text);
}
.lvl:hover { border-color: rgba(201,163,39,.5); background: rgba(201,163,39,.06); }
.lvl b { display: block; font-size: 13.5px; }
.lvl span { font-size: 11.5px; color: var(--muted); }
.lvl.l3 b { color: var(--gold2); }

/* ---------- question area (exam paper) ---------- */
.qwrap { max-width: 980px; margin: 0 auto; }
.qhead {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: 14px; background: rgba(255,255,255,.035); border: 1px solid var(--line2); margin-bottom: 14px;
}
.qhead .qt { font-weight: 700; color: var(--ivory); }
.timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 18px; color: var(--gold2); padding: 4px 12px; border-radius: 10px; background: rgba(201,163,39,.10); border: 1px solid rgba(201,163,39,.3); }
.timer.warn { color: #FFB4A9; background: rgba(226,109,95,.14); border-color: rgba(226,109,95,.45); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .65; } }
.progress-strip { display: flex; gap: 3px; flex: 1; min-width: 120px; }
.progress-strip i { flex: 1; height: 5px; border-radius: 3px; background: rgba(255,255,255,.1); }
.progress-strip i.done { background: rgba(201,163,39,.7); }
.progress-strip i.cur { background: var(--gold3); }
.progress-strip i.ok { background: var(--ok); }
.progress-strip i.bad { background: var(--bad); }

.paper {
  background: var(--paper); color: var(--ink); border-radius: 18px; padding: 28px 30px;
  box-shadow: 0 18px 48px rgba(0,0,0,.45), inset 0 0 0 1px rgba(201,163,39,.25);
  position: relative;
}
.paper::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 18px 18px 0 0; background: var(--goldGrad); }
@media (max-width: 760px) { .paper { padding: 22px 16px; border-radius: 14px; } }
.paper .inst { font-size: 13px; color: var(--ink2); font-weight: 600; margin-bottom: 14px; }
.paper .qnum { font-family: var(--serif); color: #8A6F13; font-size: 14px; font-weight: 700; letter-spacing: .5px; margin-bottom: 6px; }
.paper .stem { font-size: 18px; line-height: 1.55; color: var(--ink); }
.paper .stem p { margin: 0 0 10px; }
.paper .stem .big { font-family: var(--serif); font-size: 26px; }
.paper .chips { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 4px; }
.paper .chip { padding: 10px 18px; border-radius: 10px; background: #fff; border: 1.5px solid var(--paperLine); font-weight: 700; font-size: 18px; color: var(--ink); }
.paper .chip.q { border-style: dashed; color: #8A6F13; border-color: #C9A327; min-width: 64px; text-align: center; }
.paper .arrow { color: #8A6F13; font-weight: 800; font-size: 20px; }
.analogy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.analogy .pair { display: flex; align-items: center; gap: 10px; }
.seq { display: flex; flex-wrap: wrap; gap: 8px; }
.seq .n { min-width: 58px; padding: 12px 10px; text-align: center; border-radius: 10px; background: #fff; border: 1.5px solid var(--paperLine); font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.seq .n.q { border: 2px dashed #C9A327; color: #8A6F13; }
.na { display: flex; flex-wrap: wrap; gap: 12px; }
.na .nb { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: #fff; border: 1.5px solid var(--paperLine); font-weight: 800; font-size: 19px; font-variant-numeric: tabular-nums; }
.na .nb .q { color: #8A6F13; }

.opts { display: grid; gap: 10px; margin-top: 20px; }
.opts.cols5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.opts.cols2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 760px) { .opts.cols5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .opts.cols2 { grid-template-columns: 1fr; } }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 16px; border-radius: 12px; background: #fff; color: var(--ink);
  border: 1.5px solid var(--paperLine); font-size: 16px; line-height: 1.4;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.opt:hover { border-color: #C9A327; box-shadow: 0 4px 14px rgba(201,163,39,.18); }
.opt .ol { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: #F2EBD8; color: #6E5810; }
.opt.sel { border-color: #C9A327; background: #FFF9E6; box-shadow: 0 0 0 2px rgba(201,163,39,.35); }
.opt.sel .ol { background: #C9A327; color: #fff; }
.opt.right { border-color: #2E9B69; background: #EAF8F0; }
.opt.right .ol { background: #2E9B69; color: #fff; }
.opt.wrong { border-color: #D2594B; background: #FDEEEC; }
.opt.wrong .ol { background: #D2594B; color: #fff; }
.opt.fig { flex-direction: column; gap: 6px; padding: 10px 8px; }
.opt.fig svg { width: 100%; height: auto; max-width: 150px; }
.opt[disabled] { cursor: default; }

.feedback { margin-top: 18px; border-radius: 14px; padding: 16px 18px; font-size: 15px; line-height: 1.55; }
.feedback.ok { background: #EAF8F0; border: 1px solid #A6DEC2; color: #164E35; }
.feedback.bad { background: #FDF1EF; border: 1px solid #F0B9B1; color: #6B2118; }
.feedback .fbt { display: block; font-size: 13px; font-weight: 800; letter-spacing: 1.4px; text-transform: uppercase; margin-bottom: 4px; }

.qfoot { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.passage-split { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 980px) { .passage-split { grid-template-columns: 1fr; } }
.passage {
  background: var(--paper); color: var(--ink); border-radius: 18px; padding: 24px 26px;
  max-height: calc(100vh - 170px); overflow: auto; position: sticky; top: 20px;
  box-shadow: inset 0 0 0 1px rgba(201,163,39,.25);
  font-family: Georgia, 'Times New Roman', serif; font-size: 16.5px; line-height: 1.7;
}
@media (max-width: 980px) { .passage { position: static; max-height: 46vh; } }
.passage h3 { font-family: var(--serif); color: #8A6F13; margin-bottom: 2px; }
.passage .src { font-family: var(--sans); font-size: 12px; color: var(--ink2); margin-bottom: 14px; }
.passage p { margin: 0 0 12px; text-indent: 1.2em; }
.passage p:first-of-type { text-indent: 0; }
.argument { background: #fff; border: 1.5px solid var(--paperLine); border-left: 4px solid #C9A327; border-radius: 12px; padding: 16px 18px; font-size: 16.5px; line-height: 1.65; margin-bottom: 14px; }
.paper .exhibit { background: #fff; border: 1.5px solid var(--paperLine); border-left: 4px solid #C9A327; border-radius: 12px; padding: 14px 18px; margin: 12px 0 4px; font-family: var(--serif); font-size: 19px; line-height: 1.55; color: var(--ink); }

/* navigator (tests) */
.navgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 6px; }
.navgrid button { height: 36px; border-radius: 9px; border: 1px solid var(--line2); background: rgba(255,255,255,.04); color: var(--muted); font-weight: 700; font-size: 12.5px; }
.navgrid button.ans { background: rgba(201,163,39,.18); color: var(--gold3); border-color: rgba(201,163,39,.4); }
.navgrid button.cur { outline: 2px solid var(--gold2); color: #fff; }
.navgrid button.flag { box-shadow: inset 0 -3px 0 var(--amber); }

/* ---------- results ---------- */
.sas-ring { position: relative; width: 168px; height: 168px; flex: none; }
.sas-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sas-ring .v { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.sas-ring .v b { font-family: var(--serif); font-size: 44px; color: var(--gold2); line-height: 1; }
.sas-ring .v span { font-size: 11px; letter-spacing: 1.6px; color: var(--muted); text-transform: uppercase; font-weight: 700; margin-top: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; letter-spacing: 1.3px; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 10px 10px; border-bottom: 1px solid var(--line); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.tscroll { overflow-x: auto; }
.chart { width: 100%; height: auto; display: block; }
.review-item { border-radius: 14px; border: 1px solid var(--line2); background: rgba(255,255,255,.03); padding: 14px 16px; }
.review-item.ok { border-left: 3px solid var(--ok); }
.review-item.bad { border-left: 3px solid var(--bad); }
.review-item.skip { border-left: 3px solid var(--muted2); }
.review-item details summary { cursor: pointer; list-style: none; display: flex; gap: 10px; align-items: center; }
.review-item details summary::-webkit-details-marker { display: none; }
.review-body { margin-top: 12px; }
.band { display: flex; height: 12px; border-radius: 99px; overflow: hidden; }
.band i { flex: 1; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line2); background: rgba(255,255,255,.03); color: var(--muted); font-weight: 700; font-size: 13px; }
.tab.on { background: rgba(201,163,39,.16); color: var(--gold3); border-color: rgba(201,163,39,.45); }

/* ---------- forms / login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login { width: 100%; max-width: 440px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }
.input {
  width: 100%; padding: 13px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04); color: var(--text); font-size: 15px; outline: none;
}
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,163,39,.2); }
.err { color: #F3A79D; font-size: 13px; min-height: 18px; }
select.input option { background: #0C162B; }

.modal-back { position: fixed; inset: 0; background: rgba(3,6,14,.72); backdrop-filter: blur(4px); z-index: 80; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 520px; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 90; background: #1B2A4A; border: 1px solid rgba(201,163,39,.45); color: var(--ivory); padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow); font-weight: 600; font-size: 14px; }
@media (max-width: 900px) { .toast { bottom: calc(90px + env(safe-area-inset-bottom)); } }

.method { border-left: 3px solid var(--gold); padding: 4px 0 4px 14px; }
.method li { margin-bottom: 6px; }
.kbd { display: inline-block; padding: 1px 7px; border-radius: 6px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); font-size: 12px; font-weight: 700; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media print { .side, .bottom-nav, .topbar { display: none !important; } .main { margin: 0; } body { background: #fff; color: #000; } }

/* word links, gaps, small extras */
.chips.wl { margin: 8px 0 12px; }
.chip.wlc { cursor: pointer; font: inherit; font-weight: 700; font-size: 17px; transition: border-color .15s ease, background .15s ease; }
.chip.wlc:hover { border-color: #C9A327; }
.chip.wlc.sel { border-color: #C9A327; background: #FFF9E6; box-shadow: 0 0 0 2px rgba(201,163,39,.35); }
.chip.wlc.right { border-color: #2E9B69; background: #EAF8F0; }
.chip.wlc.wrong { border-color: #D2594B; background: #FDEEEC; }
.gapline { letter-spacing: 1px; color: #8A6F13; font-weight: 700; }
.review-body .paper { box-shadow: none; }
.levels .lvl[disabled] { cursor: not-allowed; }
a.btn { cursor: pointer; }
details > summary { cursor: pointer; }

/* Playfair's default old-style figures make 0 look like o — use lining figures everywhere */
body, h1, h2, h3, .serif, .stat-big, .stat b, .score-chip, .sas-ring .v b, .paper .qnum, .timer { font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: center; position: relative; z-index: 1; }
.hero-grid .rec { background: rgba(8, 15, 31, .45); border: 1px solid rgba(201,163,39,.28); border-radius: 14px; padding: 18px 20px; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: minmax(0, 1fr); } }

sup { font-size: .72em; line-height: 0; }

/* ===== adaptive practice, access arrangements, phone pass ===== */

/* ---------- how shall we practise? ---------- */
.chooser { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.choice {
  text-align: left; padding: 12px 14px; border-radius: 12px; min-height: 62px;
  border: 1px solid var(--line2); background: rgba(255,255,255,.035); color: var(--text);
}
.choice b { display: block; font-size: 14px; }
.choice span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.choice.on { border-color: rgba(201,163,39,.55); background: rgba(201,163,39,.14); }
.choice.on b { color: var(--gold3); }
.choice:disabled { opacity: .38; cursor: not-allowed; }
.choice.rev.on { border-color: rgba(226,109,95,.55); background: rgba(226,109,95,.13); }
.choice.rev.on b { color: #FFC4BB; }
.worklvl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.revtag {
  font-size: 12.5px; color: var(--gold3); background: rgba(201,163,39,.12);
  border: 1px solid rgba(201,163,39,.30); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px;
}

/* ---------- session summary ---------- */
.res-top { display: flex; gap: 28px; flex-wrap: wrap; align-items: center; }
.res-bar { flex: 1; min-width: 220px; }
.stat-big.sm { font-size: 34px; }
.notes { display: grid; gap: 10px; }
.note { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line2); }
.note.amber { border-color: rgba(231,169,59,.45); background: rgba(231,169,59,.10); }
.note b { color: var(--ivory); }
.skill-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(90px,1.3fr) 54px; gap: 10px; align-items: center; margin-top: 8px; }
.skill-row .num { text-align: right; }

/* ---------- access arrangements ---------- */
:root { --fs: 1; }
body.ts1 { --fs: 1.10; }
body.ts2 { --fs: 1.22; }
.paper .inst { font-size: calc(13px * var(--fs)); }
.paper .stem { font-size: calc(18px * var(--fs)); }
.paper .chip { font-size: calc(18px * var(--fs)); }
.paper .argument { font-size: calc(15.5px * var(--fs)); }
.opt { font-size: calc(16px * var(--fs)); }
.feedback { font-size: calc(15px * var(--fs)); }
.passage { font-size: calc(16.5px * var(--fs)); }
.passage p { line-height: calc(1.7 * var(--fs)); }
body.dys .paper, body.dys .passage, body.dys .opt, body.dys .feedback, body.dys .argument, body.dys .review-body {
  font-family: Verdana, 'Trebuchet MS', 'Segoe UI', sans-serif;
  letter-spacing: .02em; word-spacing: .09em; line-height: 1.78;
}

/* ---------- one-tap practice list ---------- */
.act-list { display: grid; gap: 8px; }
.act-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 14px; border-radius: 13px; border: 1px solid var(--line2);
  background: rgba(255,255,255,.035); color: var(--text); min-height: 62px;
}
.act-row:hover { border-color: rgba(201,163,39,.45); background: rgba(201,163,39,.07); }
.act-row .an { font-weight: 700; color: var(--ivory); font-size: 14.5px; }
.act-row .ad { font-size: 11.5px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.act-row .arr { color: var(--gold2); font-weight: 800; flex: none; }
.act-row .meta { flex: none; text-align: right; display: grid; gap: 3px; justify-items: end; }
.act-row.soon { opacity: .55; }
.zone-head { display: flex; align-items: center; gap: 10px; margin: 26px 0 10px; }
.zone-head .zi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(201,163,39,.13); border: 1px solid rgba(201,163,39,.3); color: var(--gold2); }
.zone-head .zi svg { width: 18px; height: 18px; }
.zone-head h2 { margin: 0; font-size: 19px; }
.badge-due { background: rgba(226,109,95,.16); border: 1px solid rgba(226,109,95,.45); color: #FFC4BB; border-radius: 999px; padding: 2px 9px; font-size: 11px; font-weight: 700; }

/* ---------- phones and tablets ---------- */
@media (max-width: 900px) {
  .page-wrap { padding: 14px 14px calc(96px + env(safe-area-inset-bottom)); }
  .card { padding: 16px; border-radius: 14px; }
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  .grid { gap: 12px; }
}
@media (max-width: 760px) {
  /* the question header stays put, so the timer and Exit are always reachable */
  .qhead { position: sticky; top: 56px; z-index: 22; background: rgba(12,22,43,.96); backdrop-filter: blur(8px); padding: 10px 12px; gap: 8px; }
  .qhead .qt { font-size: 13px; width: 100%; }
  .progress-strip { order: 3; width: 100%; flex-basis: 100%; }
  .timer { font-size: 16px; padding: 3px 10px; }
  /* thumb-sized answers */
  .opt { padding: 14px 14px; min-height: 54px; border-radius: 13px; }
  .opts { gap: 9px; }
  .opts.cols5 { grid-template-columns: repeat(auto-fit, minmax(86px, 1fr)); }
  .paper { padding: 20px 15px; }
  .paper .chip { padding: 9px 14px; }
  .seq .n { min-width: 52px; padding: 10px 8px; font-size: 18px; }
  /* one clear action at the bottom, big enough to hit */
  .qfoot { gap: 8px; margin-top: 14px; }
  .qfoot .btn { min-height: 50px; }
  .qfoot .btn.primary { flex: 1; font-size: 16px; }
  .tab { min-height: 44px; padding: 10px 13px; }
  .btn.sm { min-height: 40px; }
  .chooser { gap: 7px; }
  .choice { min-height: 58px; padding: 11px 12px; }
  .res-top { gap: 18px; }
  .skill-row { grid-template-columns: minmax(0,1fr) 54px; }
  .skill-row .bar { grid-column: 1 / -1; }
  .passage { max-height: 44vh; padding: 18px 16px; }
}
@media (max-width: 420px) {
  .chooser { grid-template-columns: 1fr; }
  .choice { min-height: 52px; }
  .stats { gap: 8px; }
}
/* iPad and other tablets: two columns is right, but the reading column must stay wide */
@media (min-width: 761px) and (max-width: 1100px) {
  .page-wrap { padding: 22px 22px 80px; }
  .passage-split { grid-template-columns: minmax(0, 1fr); }
  .passage { position: static; max-height: 52vh; }
}

/* ===== phone fixes, first render ===== */
/* a grid item will not shrink below its content unless told to — this is what pushed the
   option grid off the right of the screen at 390px */
.opt { min-width: 0; }
.opt > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.chip, .seq .n, .na .nb { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .opts.cols5.words { grid-template-columns: 1fr; }
  .opts.cols5.nums { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .opts.cols5.nums .opt { padding: 12px 10px; }
  /* the action stays above the bottom nav, so it is always one thumb away */
  .qwrap .qfoot, .passage-split .qfoot {
    position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 18;
    padding: 10px 0 8px; margin-top: 12px;
    background: linear-gradient(180deg, rgba(8,15,31,0), rgba(8,15,31,.94) 30%);
  }
  /* title and Exit share a row; the progress strip takes the row below */
  .qhead .qt { flex: 1; width: auto; min-width: 0; }
}

/* the sticky action reads as a bar, not a gradient over the card */
@media (max-width: 760px) {
  .qwrap .qfoot, .passage-split .qfoot {
    margin-left: -14px; margin-right: -14px; padding: 10px 14px 8px;
    background: rgba(8,15,31,.96); border-top: 1px solid var(--line2);
  }
}

/* ===== the week plan and the readiness ring on home ===== */
.home-top { display: flex; align-items: center; gap: 22px; }
@media (max-width: 620px) {
  .home-top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .home-top .sas-ring { width: 128px; height: 128px; align-self: center; }
  .home-top .sas-ring .v b { font-size: 34px; }
}
.plan-list { display: grid; gap: 8px; }
.task {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 13px 14px; border-radius: 13px; min-height: 66px; color: var(--text);
  border: 1px solid var(--line2); background: rgba(255,255,255,.035);
}
.task:hover { border-color: rgba(201,163,39,.45); background: rgba(201,163,39,.07); }
.task .tick {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 800; font-size: 13px; background: rgba(255,255,255,.06); border: 1px solid var(--line2); color: var(--muted);
}
.task .tb { flex: 1; min-width: 0; display: grid; gap: 2px; }
.task .tb b { color: var(--ivory); font-size: 14.5px; }
.task .ts { font-size: 12px; color: var(--gold2); }
.task .tw { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.task .arr { color: var(--gold2); font-weight: 800; flex: none; }
.task.done { opacity: .62; }
.task.done .tick { background: rgba(67,181,129,.18); border-color: rgba(67,181,129,.5); color: #8CE3BA; }
.task.done .tb b { text-decoration: line-through; text-decoration-color: rgba(255,255,255,.3); }

/* ===== worked examples and the method sheet ===== */
.paper.worked { box-shadow: 0 12px 34px rgba(0,0,0,.4), inset 0 0 0 1px rgba(201,163,39,.3); }
.paper.worked .opt { cursor: default; }
.wsteps { margin-top: 20px; border-top: 1px dashed var(--paperLine); padding-top: 14px; }
.wsteps .eyebrow { color: #8A6F13; }
.wsteps ol { margin: 10px 0 0; padding-left: 20px; }
.wsteps li { margin-bottom: 9px; line-height: 1.55; color: var(--ink); font-size: calc(15px * var(--fs)); }
.wtrap { margin-top: 12px; font-size: calc(14px * var(--fs)); color: #6B4E12; background: #FBF0D3; border: 1px solid #E8D79B; border-radius: 12px; padding: 12px 14px; }
.sheet {
  position: fixed; inset: 0; z-index: 60; background: rgba(4,8,18,.78); backdrop-filter: blur(4px);
  overflow: auto; padding: 24px 16px calc(40px + env(safe-area-inset-bottom));
}
.sheet-in {
  max-width: 760px; margin: 0 auto; background: linear-gradient(180deg, var(--panel2), var(--panel));
  border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow);
}
@media (max-width: 760px) { .sheet { padding: 12px 10px 40px; } .sheet-in { padding: 14px; } }
.sheet-in .method { padding-left: 30px; }   /* the numbers were sitting on the gold rule */
