/* Layout: an on-screen exam console — a section rail on top, one question per screen, review after submit. */
/* One light look modelled on the real test platform: white page, red (#be1d2c / #cc0000),
   navy (#1c3866 / #333366), Poppins. Deliberately single-theme so practice looks like the real test. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #222222;
  --muted: #6b6b70;
  --line: #e3e3e6;
  --accent: #1c3866;
  --accent-ink: #ffffff;
  --accent-soft: #eef1f7;
  --red: #be1d2c;
  --red2: #cc0000;
  --navy2: #333366;
  --wattle: #e6a23c;
  --wattle-soft: #fdf6ec;
  --good: #2f8a3e;
  --good-soft: #f0f9eb;
  --bad: #cc0000;
  --bad-soft: #fdecec;
  --font-display: "Poppins", "Segoe UI", system-ui, sans-serif;
  --font-body: "Poppins", "Segoe UI", system-ui, sans-serif;
  --radius: 6px;
  color-scheme: light;
}
* { box-sizing: border-box; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.55;
}
.wrap {
  max-width: 980px; margin: 0 auto;
  padding-block: 20px 64px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 20px;
}
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; margin: 0; line-height: 1.2; }
h1 { font-size: 1.75rem; font-weight: 700; }
h2 { font-size: 1.3rem; font-weight: 600; }
h3 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.eyebrow { font-family: var(--font-display); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }

header.top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; }
header.top .meta { display: flex; flex-direction: column; gap: 4px; }

nav.rail { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
nav.rail a {
  flex: 0 0 auto; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 7px 14px; font-family: var(--font-display); font-size: 0.9rem;
  display: flex; gap: 8px; align-items: center;
}
nav.rail a[aria-current="page"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
nav.rail .chip { font-size: 0.75rem; opacity: 0.85; font-variant-numeric: tabular-nums; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

table.plan { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.plan th, table.plan td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.plan th { font-family: var(--font-display); font-weight: 600; font-size: 0.8rem; color: var(--muted); letter-spacing: 0.04em; }
table.plan td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

.btn {
  font: inherit; font-family: var(--font-display); font-size: 0.95rem; font-weight: 600;
  border-radius: 8px; padding: 10px 18px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink);
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.quiet { background: transparent; color: var(--muted); border-color: var(--line); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn:focus-visible, .opt:focus-visible, .navq:focus-visible, nav.rail a:focus-visible, textarea:focus-visible, .tab:focus-visible { outline: 3px solid var(--wattle); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }

.exambar { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.timer { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-size: 1.15rem; font-weight: 600; padding: 4px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.timer.low { background: var(--wattle-soft); color: var(--ink); }
.timer.over { background: var(--bad-soft); color: var(--bad); }

.qlayout { display: grid; grid-template-columns: 1fr; gap: 20px; }
.qlayout.with-passage { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
@media (max-width: 760px) { .qlayout.with-passage { grid-template-columns: 1fr; } }
.passage { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px; max-height: 460px; overflow-y: auto; min-width: 0; }
.passage h3 { margin-bottom: 8px; }
.passage p + p { margin-top: 10px; }
.qtext { font-size: 1.12rem; }
.figure { display: flex; justify-content: center; padding: 8px 0; overflow-x: auto; color: var(--ink); }
.figure svg { max-width: 100%; height: auto; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  font: inherit; text-align: left; display: flex; gap: 12px; align-items: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: 11px 14px; cursor: pointer;
}
.opt .letter { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.opt[aria-pressed="true"] .letter { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.navgrid { display: flex; flex-wrap: wrap; gap: 6px; }
.navq { font: inherit; font-size: 0.8rem; font-variant-numeric: tabular-nums; width: 34px; height: 34px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.navq.answered { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.navq.current { border-color: var(--accent); border-width: 2px; color: var(--ink); }
.navq.flag { box-shadow: inset 0 -3px 0 var(--wattle); }

.confirm { background: var(--wattle-soft); border: 1px solid var(--wattle); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }

.score { display: flex; flex-wrap: wrap; gap: 24px; align-items: baseline; }
.score .big { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.review { display: flex; flex-direction: column; gap: 12px; }
.ritem { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; border-left-width: 5px; }
.ritem.ok { border-left-color: var(--good); }
.ritem.no { border-left-color: var(--bad); }
.ritem .tag { font-size: 0.8rem; font-family: var(--font-display); font-weight: 600; }
.ritem.ok .tag { color: var(--good); }
.ritem.no .tag { color: var(--bad); }
.ex { background: var(--bg); border-radius: 6px; padding: 8px 12px; font-size: 0.95rem; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; }
.topic { font-size: 0.85rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.topic.weak { background: var(--bad-soft); border-color: transparent; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { font: inherit; font-family: var(--font-display); font-size: 0.9rem; padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.tab[aria-selected="true"] { border-color: var(--accent); background: var(--accent-soft); }
.picture { border-radius: 8px; overflow: hidden; border: 1px solid var(--line); max-width: 560px; width: 100%; }
.picture svg { display: block; width: 100%; height: auto; }
textarea {
  width: 100%; min-height: 260px; resize: vertical;
  font: inherit; font-size: 1.05rem; line-height: 1.6;
  border: 1px solid var(--line); border-radius: 8px; padding: 14px; background: var(--surface); color: var(--ink);
}
.checklist { display: flex; flex-direction: column; gap: 8px; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; }
.checklist input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--accent); }

.story { background: var(--wattle-soft); border-radius: 8px; padding: 16px 18px; }
ol.iv { margin: 0; padding-left: 1.4em; display: flex; flex-direction: column; gap: 10px; }
ol.iv li .hint { display: block; font-size: 0.9rem; color: var(--muted); }
.note { border-left: 4px solid var(--wattle); padding: 8px 14px; background: var(--wattle-soft); border-radius: 0 8px 8px 0; font-size: 0.95rem; }
table.mini { border-collapse: collapse; margin: 10px 0; font-size: 1rem; font-variant-numeric: tabular-nums; }
table.mini th, table.mini td { border: 1px solid var(--line); padding: 6px 12px; text-align: center; }
table.mini th { background: var(--accent-soft); font-family: var(--font-display); font-weight: 600; }
details.gu { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
details.gu summary { cursor: pointer; font-size: 0.9rem; color: var(--accent); font-family: var(--font-display); }
details.gu[open] summary { margin-bottom: 8px; }
ul.tight { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 4px; }
.scale { display: flex; flex-wrap: wrap; gap: 6px; }
.scale span { font-size: 0.85rem; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; }
@media (prefers-reduced-motion: no-preference) { .opt, .btn, .navq { transition: background-color .12s, border-color .12s; } }
