@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,500;0,9..144,600;0,9..144,700;1,9..144,600&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap");

:root {
  color-scheme: light;
  --bg: #f7f0e5;
  --bg-soft: #efe3d1;
  --panel: #ffffff;
  --panel-strong: #ffffff;
  --text: #1b1611;
  --muted: #6f6256;
  --line: #e7dac6;
  --accent: #c2410c;
  --accent-dark: #9a3412;
  --accent-soft: #f8e6d8;
  --header: rgba(247, 240, 229, 0.85);
  --shadow: 0 24px 60px rgba(60, 40, 20, 0.14);
  --danger: #b42318;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #17120d;
  --bg-soft: #1f1811;
  --panel: #211a13;
  --panel-strong: #2a2118;
  --text: #f6ede0;
  --muted: #b0a08c;
  --line: #3a2e20;
  --accent: #e2703a;
  --accent-dark: #f0895a;
  --accent-soft: #2e2015;
  --header: rgba(23, 18, 13, 0.88);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.5);
  --danger: #f0796b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-height: 100%; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 12% 8%, var(--bg-soft) 0, transparent 32%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", sans-serif;
  transition: background-color .25s ease, color .25s ease;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: .25;
  pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 52%);
}

button, select, textarea { font: inherit; }
button { cursor: pointer; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 12px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--header);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand strong { display: block; font-size: 19px; line-height: 1.1; letter-spacing: -.4px; }
.brand small { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 8px; letter-spacing: 1.7px; }

.brand-mark {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  width: 35px;
  height: 35px;
  transform: rotate(45deg);
}

.brand-mark span { border-radius: 3px 8px 3px 8px; background: var(--text); }
.brand-mark span:first-child, .brand-mark span:last-child { background: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 20px; }
.header-note { color: var(--muted); font-size: 12px; }

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--panel);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.theme-toggle:hover { border-color: var(--accent); }
.theme-icon { color: var(--accent); font-size: 17px; line-height: 1; }

.app { width: min(1180px, calc(100vw - 48px)); margin: 0 auto; }

.home {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  align-items: center;
  gap: clamp(50px, 9vw, 130px);
  min-height: 610px;
  padding: 70px 0 58px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.eyebrow span { width: 27px; height: 1px; background: var(--accent); }

.hero-copy h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(44px, 5.25vw, 72px);
  line-height: 1.04;
  letter-spacing: -3.4px;
}

.hero-copy h1 em {
  color: var(--accent);
  font-family: "Fraunces", serif;
  font-weight: 700;
}

.hero-description {
  max-width: 575px;
  margin: 26px 0 38px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.trust-row { display: flex; gap: 0; }
.trust-row div { min-width: 120px; padding-right: 28px; margin-right: 28px; border-right: 1px solid var(--line); }
.trust-row div:last-child { border: 0; }
.trust-row strong { display: block; font-size: 22px; letter-spacing: -.6px; }
.trust-row span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .7px; }

.setup-card {
  position: relative;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.setup-card::before {
  position: absolute;
  top: -1px;
  left: 34px;
  width: 70px;
  height: 3px;
  content: "";
  background: var(--accent);
}

.card-heading { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.step-number { color: var(--accent); font-family: "JetBrains Mono", monospace; font-size: 12px; }
.card-heading h2 { margin: 0 0 3px; font-size: 20px; letter-spacing: -.5px; }
.card-heading p { margin: 0; color: var(--muted); font-size: 12px; }

.mode-selector { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 22px; }
.mode-option { display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 2px; background: var(--panel-strong); color: var(--text); text-align: left; }
.mode-option > span { display: grid; place-items: center; width: 28px; height: 28px; flex: 0 0 auto; background: var(--bg); color: var(--muted); }
.mode-option strong, .mode-option small { display: block; }
.mode-option strong { font-size: 10px; }
.mode-option small { margin-top: 2px; color: var(--muted); font-size: 7px; }
.mode-option.active { border-color: var(--accent); background: var(--accent-soft); }
.mode-option.active > span { background: var(--accent); color: #fff; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
label { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.select-wrap { position: relative; }
.select-wrap::after { position: absolute; top: 50%; right: 15px; content: "⌄"; color: var(--accent); transform: translateY(-60%); pointer-events: none; }

select {
  width: 100%;
  height: 49px;
  appearance: none;
  padding: 0 42px 0 14px;
  border: 1px solid var(--line);
  border-radius: 2px;
  outline: none;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 13px;
}

select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.passage-preview {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  margin: 3px 0 20px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.passage-preview-icon { display: grid; place-items: center; width: 32px; height: 32px; background: var(--accent-soft); color: var(--accent); font-family: serif; font-size: 17px; font-weight: 700; }
.passage-preview strong, .passage-preview > div > span { display: block; }
.passage-preview strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.passage-preview > div > span { margin-top: 2px; color: var(--muted); font-size: 8px; }
.passage-badges { display: flex; align-items: flex-end; gap: 4px; }
.passage-badges span { padding: 3px 5px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 7px; text-transform: capitalize; }

.mode-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 25px 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.summary-icon { display: grid; place-items: center; width: 35px; height: 35px; background: var(--accent-soft); color: var(--accent); }
.mode-summary div { flex: 1; }
.mode-summary strong, .mode-summary small { display: block; }
.mode-summary strong { font-size: 12px; }
.mode-summary small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.status-dot { color: var(--accent); font-family: "JetBrains Mono", monospace; font-size: 9px; text-transform: uppercase; }
.status-dot::before { content: "●"; margin-right: 5px; font-size: 7px; }

.primary-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.primary-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.primary-button > span:first-child { font-size: inherit; font-weight: inherit; }
.primary-button > span:last-child { font-size: 21px; font-weight: 400; }
.keyboard-hint { margin: 13px 0 0; color: var(--muted); text-align: center; font-size: 9px; }
kbd { padding: 2px 5px; border: 1px solid var(--line); border-radius: 2px; background: var(--bg); font-family: "JetBrains Mono", monospace; }

.exam-strip {
  display: flex;
  align-items: center;
  gap: clamp(25px, 4vw, 56px);
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.exam-strip > p { margin: 0; color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 9px; letter-spacing: 1px; }
.exam-strip div { display: flex; align-items: baseline; gap: 8px; }
.exam-strip div span { font-size: 20px; font-weight: 800; letter-spacing: -1px; }
.exam-strip div small { color: var(--muted); font-size: 10px; }
.exam-strip .coming-soon { margin-left: auto; }

.terminal, .results {
  margin: 48px 0;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.terminal {
  --exam-blue: #174f7d;
  --exam-blue-dark: #103957;
  --exam-blue-soft: #eaf2f8;
  overflow: hidden;
  border-radius: 2px;
}

:root[data-theme="dark"] .terminal {
  --exam-blue: #397fae;
  --exam-blue-dark: #e2703a;
  --exam-blue-soft: #2e2015;
}

.exam-masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 9px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.exam-identity, .candidate-card, .exam-meta, .pane-heading > div, .exam-actions, .exam-actions > div {
  display: flex;
  align-items: center;
}

.exam-identity { gap: 11px; }
.exam-logo { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 3px; background: var(--exam-blue); color: #fff; font-family: "JetBrains Mono", monospace; font-size: 11px; font-weight: 500; }
.exam-identity strong, .exam-identity span { display: block; }
.exam-identity strong { font-size: 14px; }
.exam-identity div span { margin-top: 2px; color: var(--muted); font-size: 9px; letter-spacing: .8px; text-transform: uppercase; }

.candidate-card { gap: 9px; padding-left: 20px; border-left: 1px solid var(--line); }
.candidate-avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--bg-soft); color: var(--exam-blue); font-size: 12px; font-weight: 800; }
.candidate-card small, .candidate-card strong { display: block; }
.candidate-card small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.candidate-card strong { font-size: 11px; }
.candidate-card .online-status { margin-left: 10px; color: #388454; font-family: "JetBrains Mono", monospace; font-size: 8px; text-transform: uppercase; }

.exam-statusbar { display: grid; grid-template-columns: 190px 1fr auto; min-height: 66px; background: var(--exam-blue); color: #fff; }
.section-tab { display: flex; flex-direction: column; justify-content: center; padding: 0 22px; background: var(--exam-blue-dark); border-right: 1px solid rgba(255,255,255,.15); }
.section-tab small { opacity: .65; font-size: 8px; letter-spacing: .8px; text-transform: uppercase; }
.section-tab strong { margin-top: 3px; font-size: 13px; }
.exam-meta { gap: 32px; padding: 8px 22px; }
.exam-meta > span { display: grid; gap: 2px; }
.exam-meta small { opacity: .65; font-size: 8px; text-transform: uppercase; }
.exam-meta strong { font-size: 10px; font-weight: 600; }
.fullscreen-button { margin-left: auto; padding: 7px 10px; border: 1px solid rgba(255,255,255,.35); border-radius: 2px; background: transparent; color: #fff; font-size: 9px; }
.fullscreen-button:hover { background: rgba(255,255,255,.1); }
.timer-box { display: grid; align-content: center; min-width: 135px; padding: 7px 22px; background: rgba(0,0,0,.14); text-align: right; }
.timer-box > span { opacity: .7; font-size: 8px; letter-spacing: .8px; text-transform: uppercase; }
.timer { color: #fff; font-family: "JetBrains Mono", monospace; font-size: 22px; font-weight: 500; letter-spacing: 1px; }
.timer-warning { background: #a33c32; }
.time-track { height: 3px; background: var(--line); }
.time-track span { display: block; width: 100%; height: 100%; background: var(--accent); transition: width .25s linear; }

.exam-notice { display: flex; align-items: center; gap: 9px; min-height: 37px; padding: 6px 20px; border-bottom: 1px solid var(--line); background: var(--exam-blue-soft); color: var(--muted); font-size: 9px; }
.exam-notice span { display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid var(--exam-blue); border-radius: 50%; color: var(--exam-blue); font-family: serif; font-weight: 700; }
.exam-notice > span:last-child { display: inline; width: auto; height: auto; border: 0; border-radius: 0; color: var(--muted); font-family: inherit; font-weight: 400; }
.phase-overlay { min-height: 520px; padding: 110px 25px; border-bottom: 1px solid var(--line); background: var(--panel); text-align: center; }
.phase-overlay-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 50%; background: var(--exam-blue-soft); color: var(--exam-blue); font-family: "JetBrains Mono", monospace; font-size: 20px; }
.phase-overlay small { color: var(--exam-blue); font-family: "JetBrains Mono", monospace; font-size: 9px; letter-spacing: 1px; text-transform: uppercase; }
.phase-overlay h2 { margin: 9px 0; font-size: 24px; }
.phase-overlay p { max-width: 470px; margin: 0 auto; color: var(--muted); font-size: 11px; line-height: 1.6; }
.exam-workspace { margin: 16px; border: 1px solid var(--line); }

.pane-heading { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: var(--bg); }
.pane-heading > div { gap: 10px; }
.question-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 2px; background: var(--exam-blue); color: #fff; font-family: "JetBrains Mono", monospace; font-size: 11px; }
.pane-heading small, .pane-heading strong { display: block; }
.pane-heading small { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 7px; letter-spacing: .8px; }
.pane-heading strong { margin-top: 2px; font-size: 10px; }
.passage-meta span { padding-left: 14px; border-left: 1px solid var(--line); color: var(--muted); font-size: 9px; }
.passage-meta span:first-child { border: 0; }
.passage-meta span strong { display: inline; color: var(--text); font-size: 9px; }

.reference-panel { height: 220px; overflow-y: auto; padding: 20px 24px; border-bottom: 1px solid var(--line); background: var(--panel-strong); }
.reference-document { max-width: 900px; color: var(--text); font-family: Arial, sans-serif; font-size: 18px; line-height: 1.8; white-space: pre-line; }
.typing-heading { border-top: 3px solid var(--exam-blue); }
.typing-indicator { width: 8px; height: 28px; background: var(--exam-blue); }
.typing-meta { gap: 18px !important; }
.typing-meta > span { padding: 5px 8px; border-radius: 2px; background: var(--accent-soft); color: var(--accent); font-size: 8px; font-weight: 700; text-transform: uppercase; }
.typing-meta > strong { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 8px; font-weight: 500; }
.typing-meta > strong span { display: inline; color: var(--text); font-size: 8px; }

textarea { display: block; width: 100%; min-height: 205px; resize: none; padding: 20px 24px; border: 0; outline: none; background: var(--panel-strong); color: var(--text); font-family: Arial, sans-serif; font-size: 18px; line-height: 1.8; }

/* Practice-mode training aids (never shown in evaluated exam mode) */
.practice-tools {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  padding: 10px 24px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.practice-tools-label { color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; margin-right: 4px; }
.ptoggle { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none;
  padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-strong); }
.ptoggle input { accent-color: var(--accent); margin: 0; cursor: pointer; }
.ptoggle span { color: var(--text); font-size: 11px; font-weight: 600; }
.ptoggle:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel-strong)); }
.practice-live { display: flex; gap: 14px; margin-left: auto; font-family: "JetBrains Mono", monospace; }
.practice-live span { color: var(--muted); font-size: 10px; }
.practice-live strong { color: var(--text); font-size: 15px; }

/* Reference character states while typing (practice aids) */
.reference-document .r-ok  { color: #1a7f4b; }
.reference-document .r-bad { color: #c0392b; background: color-mix(in srgb, #c0392b 16%, transparent); border-radius: 2px; }
.reference-document .r-cur { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
  text-decoration-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border-radius: 2px; }
:root[data-theme="dark"] .reference-document .r-ok  { color: #62b98a; }
:root[data-theme="dark"] .reference-document .r-bad { color: #ef786d; }
textarea::placeholder { color: var(--muted); opacity: .55; }
textarea:focus { box-shadow: inset 0 0 0 2px var(--exam-blue); }

.exam-actions { justify-content: space-between; min-height: 66px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--bg); }
.exam-actions > div { gap: 10px; }
.test-legend { color: var(--muted); font-size: 9px; }
.test-legend span + span { padding-left: 12px; border-left: 1px solid var(--line); }
.test-legend i { display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: #388454; }
.exam-actions button { height: 40px; padding: 0 16px; font-size: 10px; font-weight: 700; }
.secondary-button { border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.submit-button { border: 1px solid var(--exam-blue); background: var(--exam-blue); color: #fff; }
.submit-button span { margin-left: 15px; }
.submit-button:hover { background: var(--exam-blue-dark); }
.exam-actions button:disabled { cursor: not-allowed; opacity: .45; }

/* Exam-terminal skin. This is an exam-simulation skin, not an official
   claim of affiliation or a pixel-perfect copy of any live exam vendor UI. */
.exam-skin-exam-terminal {
  background: #f3efe8;
}

.exam-skin-exam-terminal .app {
  width: min(1260px, calc(100vw - 28px));
}

.exam-skin-exam-terminal .terminal {
  --exam-blue: #c2410c;
  --exam-blue-dark: #9a3412;
  --exam-blue-soft: #f4f0e9;
  margin-top: 6px;
  border-color: #d6c8b7;
  background: #f7f3ed;
  box-shadow: 0 18px 42px rgba(58, 42, 26, .14);
}

.exam-skin-exam-terminal .exam-masthead,
.exam-skin-exam-terminal .exam-statusbar,
.exam-skin-exam-terminal .time-track,
.exam-skin-exam-terminal .exam-notice {
  display: none;
}

.exam-skin-exam-terminal .exam-workspace {
  margin: 0;
  border-color: #d6c8b7;
  background: #fff;
}

.exam-skin-exam-terminal .pane-heading {
  min-height: 52px;
  padding: 8px 12px;
  border-bottom-color: #d6c8b7;
  background: #f7f3ed;
}

.exam-skin-exam-terminal .question-number {
  width: 30px;
  height: 30px;
  border-radius: 1px;
  background: #c2410c;
  color: #fff;
  font-size: 12px;
}

.exam-skin-exam-terminal .pane-heading small {
  color: #81766d;
  font-size: 8px;
  letter-spacing: 1.1px;
}

.exam-skin-exam-terminal .pane-heading strong {
  color: #1d1a17;
  font-size: 11px;
}

.exam-skin-exam-terminal .passage-meta span {
  border-left-color: #d6c8b7;
  color: #6f675f;
}

.exam-skin-exam-terminal .reference-panel {
  height: 220px;
  padding: 24px 42px 28px;
  border-bottom: 3px solid #c2410c;
  background: #fff;
  color: #000;
}

.exam-skin-exam-terminal .reference-document {
  max-width: 760px;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.48;
  white-space: pre-line;
}

.exam-skin-exam-terminal .typing-heading {
  min-height: 50px;
  border-top: 0;
  border-bottom: 1px solid #d6c8b7;
  background: #f7f3ed;
}

.exam-skin-exam-terminal .typing-indicator {
  width: 8px;
  height: 28px;
  background: #c2410c;
}

.exam-skin-exam-terminal .typing-meta > span {
  background: #f3dfcb;
  color: #9b4f1b;
  font-size: 8px;
}

.exam-skin-exam-terminal .typing-meta > strong {
  color: #6f675f;
}

.exam-skin-exam-terminal textarea {
  min-height: 205px;
  padding: 22px;
  border-top: 0;
  background: #fff;
  color: #111;
  font-size: 18px;
  line-height: 1.7;
}

.exam-skin-exam-terminal textarea:focus {
  box-shadow: inset 0 0 0 2px #c2410c;
}

.exam-skin-exam-terminal .exam-actions {
  border-top-color: #d6c8b7;
  background: #f7f3ed;
}

.exam-skin-exam-terminal .secondary-button {
  border-color: #d6c8b7;
  background: #fff;
  color: #1d1a17;
}

.exam-skin-exam-terminal .submit-button {
  border-color: #9fb5c8;
  background: #9fb5c8;
  color: #fff;
}

.terminal:fullscreen { overflow-y: auto; margin: 0; border: 0; border-radius: 0; background: var(--panel); }
.test-active .topbar { display: none; }

/* Exam workspace: keep the reading/answer flow intact while reserving a
   stable right rail for session context. The rail disappears only at phone
   widths, so desktop users never lose the timer or instructions. */
.exam-workspace-shell { display: grid; grid-template-columns: minmax(0, 3fr) minmax(230px, 1fr); gap: 16px; min-width: 0; }
.workspace-sidebar { display: none; align-content: start; gap: 12px; padding: 16px 16px 16px 0; min-width: 0; }
.exam-skin-exam-terminal .exam-workspace-shell { flex: 1 1 auto; min-height: 0; }
.exam-skin-exam-terminal .workspace-sidebar { display: grid; overflow-y: auto; }
.workspace-sidebar-card { display: grid; gap: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-strong); }
.workspace-sidebar-label { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.workspace-sidebar-card strong { color: var(--text); font-size: 13px; line-height: 1.3; overflow-wrap: anywhere; }
.workspace-sidebar-card small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.workspace-sidebar-timer { border-color: var(--exam-blue); background: var(--exam-blue-soft); }
.workspace-sidebar-timer strong { color: var(--exam-blue); font-family: "JetBrains Mono", monospace; font-size: 28px; letter-spacing: .04em; }
.workspace-sidebar-instructions ul { display: grid; gap: 8px; margin: 5px 0 0; padding-left: 16px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.workspace-sidebar-instructions li::marker { color: var(--exam-blue); }
.exam-skin-exam-terminal textarea[data-blind-mode="true"] { color: #111; caret-color: #111; }

.session-terminated-card { max-width: 470px; }
.session-terminated-icon { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 12px; border-radius: 14px; background: #fff3cd; font-size: 23px; }
.session-terminated-help { color: var(--muted); font-size: .85rem; }
.session-terminated-card .paywall-actions { align-items: stretch; }
.session-terminated-card .paywall-actions .secondary-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

@media (max-width: 900px) and (min-width: 701px) {
  .exam-workspace-shell { grid-template-columns: minmax(0, 4fr) minmax(190px, 1.2fr); gap: 10px; }
  .workspace-sidebar { padding-right: 10px; }
  .workspace-sidebar-card { padding: 12px; }
}

@media (max-width: 700px) {
  .exam-workspace-shell { grid-template-columns: 1fr; gap: 0; }
  .exam-skin-exam-terminal .workspace-sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px; overflow: visible; }
  .exam-skin-exam-terminal .workspace-sidebar-instructions { grid-column: 1 / -1; }
  .workspace-sidebar-card { padding: 11px; }
  .workspace-sidebar-timer strong { font-size: 22px; }
}
.test-active .app { width: min(1280px, calc(100vw - 32px)); }
.test-active .terminal { margin: 16px auto; }
.test-active footer { display: none; }

.results {
  --success: #287a4d;
  --success-soft: #e6f2eb;
  --failure: #b5493e;
  --failure-soft: #faeae7;
  padding: 0;
  overflow: hidden;
}

:root[data-theme="dark"] .results {
  --success: #62b98a;
  --success-soft: #173126;
  --failure: #ef786d;
  --failure-soft: #381c19;
}

.report-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-strong);
}

.report-kicker { color: var(--accent); font-family: "JetBrains Mono", monospace; font-size: 8px; letter-spacing: 1.2px; text-transform: uppercase; }
.report-header h2 { margin: 4px 0; font-size: 22px; letter-spacing: -.5px; }
.report-header p { margin: 0; color: var(--muted); font-size: 12px; }
.report-actions { display: flex; gap: 9px; }
.report-actions button { height: 40px; padding: 0 15px; font-size: 10px; font-weight: 700; }
.print-button { border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.practice-button { border: 1px solid var(--accent); background: var(--accent); color: #fff; }

.result-verdict {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  margin: 24px 28px 14px;
  padding: 24px 28px;
  border: 1px solid color-mix(in srgb, var(--success) 35%, var(--line));
  background: linear-gradient(105deg, var(--success-soft), var(--panel));
}

.verdict-copy { display: flex; align-items: center; gap: 18px; }
.verdict-icon { display: grid; place-items: center; width: 50px; height: 50px; flex: 0 0 auto; border-radius: 50%; background: var(--success); color: #fff; font-size: 24px; font-weight: 700; }
.verdict-copy > div > span { color: var(--success); font-family: "JetBrains Mono", monospace; font-size: 10px; letter-spacing: .8px; text-transform: uppercase; }
.verdict-copy h3 { margin: 4px 0; font-size: 29px; letter-spacing: -1px; }
.verdict-copy p { margin: 0; color: var(--muted); font-size: 13px; }
.result-verdict.not-qualified { border-color: color-mix(in srgb, var(--failure) 35%, var(--line)); background: linear-gradient(105deg, var(--failure-soft), var(--panel)); }
.result-verdict.not-qualified .verdict-icon { background: var(--failure); }
.result-verdict.not-qualified .verdict-copy > div > span { color: var(--failure); }

.accuracy-ring {
  --accuracy: 0deg;
  display: grid;
  width: 90px;
  height: 90px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--success) var(--accuracy), var(--line) 0);
}

.accuracy-ring::before { grid-area: 1 / 1; width: 72px; height: 72px; border-radius: 50%; background: var(--panel); content: ""; }
.accuracy-ring div { z-index: 1; grid-area: 1 / 1; text-align: center; }
.accuracy-ring strong, .accuracy-ring span { display: block; }
.accuracy-ring strong { font-family: "JetBrains Mono", monospace; font-size: 17px; }
.accuracy-ring span { margin-top: 2px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.not-qualified .accuracy-ring { background: conic-gradient(var(--failure) var(--accuracy), var(--line) 0); }

.primary-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 28px 14px; }
.primary-metrics article { position: relative; padding: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--panel-strong); }
.primary-metrics article::after { position: absolute; right: 0; bottom: 0; width: 22px; height: 3px; background: var(--accent); content: ""; }
.primary-metrics span, .primary-metrics small, .primary-metrics strong { display: block; }
.primary-metrics span { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .7px; text-transform: uppercase; }
.primary-metrics strong { margin: 8px 0 4px; font-family: "JetBrains Mono", monospace; font-size: 26px; letter-spacing: -1px; }
.primary-metrics small { color: var(--muted); font-size: 10px; }

.report-columns { display: grid; grid-template-columns: .85fr 1.15fr; gap: 14px; margin: 0 28px 14px; }
.report-card { border: 1px solid var(--line); background: var(--panel-strong); }
.report-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 54px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--bg); }
.report-card-heading > div { display: flex; align-items: center; gap: 10px; }
.report-card-heading > div > span { color: var(--accent); font-family: "JetBrains Mono", monospace; font-size: 9px; }
.report-card-heading h3 { margin: 0; font-size: 16px; }
.report-card-heading small { color: var(--muted); font-size: 10px; }

.mistake-totals { display: grid; grid-template-columns: repeat(3, 1fr); padding: 16px; }
.mistake-totals > div { padding: 5px 14px; border-right: 1px solid var(--line); }
.mistake-totals > div:first-child { padding-left: 0; }
.mistake-totals > div:last-child { padding-right: 0; border: 0; }
.mistake-totals span, .mistake-totals strong, .mistake-totals small { display: block; }
.mistake-totals span { color: var(--muted); font-size: 10px; }
.mistake-totals strong { margin: 6px 0 3px; font-family: "JetBrains Mono", monospace; font-size: 32px; }
.mistake-totals small { color: var(--muted); font-size: 9px; }
.full-mistake strong { color: var(--failure); }
.half-mistake strong { color: var(--accent); }

.attempt-summary { display: grid; grid-template-columns: repeat(4, 1fr); margin: 0 16px 16px; padding: 12px; background: var(--bg); }
.attempt-summary span { text-align: center; }
.attempt-summary span + span { border-left: 1px solid var(--line); }
.attempt-summary small, .attempt-summary strong { display: block; }
.attempt-summary small { color: var(--muted); font-size: 9px; text-transform: uppercase; }
.attempt-summary strong { margin-top: 4px; font-size: 17px; }

.formula-reference { margin: 0 16px 16px; padding: 15px; border: 1px solid var(--line); background: var(--bg); }
.formula-reference-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.formula-reference-heading span, .formula-reference-heading strong { display: block; }
.formula-reference-heading span { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 8px; letter-spacing: .5px; text-transform: uppercase; }
.formula-reference-heading strong { margin-top: 4px; font-size: 14px; }
.formula-reference-heading > small { padding: 4px 7px; border-radius: 2px; background: var(--accent-soft); color: var(--accent); font-size: 8px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.formula-reference-heading > small.verified { background: var(--success-soft); color: var(--success); }
.formula-reference-list { padding-top: 6px; }
.formula-reference-list > div { padding: 9px 0; border-bottom: 1px dashed var(--line); }
.formula-reference-list > div:last-child { border: 0; }
.formula-reference-list span, .formula-reference-list strong { display: block; }
.formula-reference-list span { margin-bottom: 3px; color: var(--muted); font-size: 9px; }
.formula-reference-list strong { font-family: "JetBrains Mono", monospace; font-size: 11px; line-height: 1.5; }
.formula-reference > p { margin: 8px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.formula-card > p { margin: 15px 16px 5px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.rrb-formula-equation { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 14px 16px 6px; padding: 14px 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font-family: "JetBrains Mono", monospace; font-size: 11px; line-height: 1.4; text-align: center; }
.formula-fraction { display: inline-flex; flex-direction: column; align-items: stretch; min-width: 250px; }
.formula-fraction span:first-child { padding: 0 6px 5px; border-bottom: 1px solid currentColor; }
.formula-fraction span:last-child { padding-top: 5px; }
.formula-steps { padding: 7px 16px 15px; }
.formula-steps > div { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.formula-steps > div:last-child { border: 0; }
.formula-steps > div > span { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 9px; }
.formula-steps strong, .formula-steps code { display: block; }
.formula-steps strong { margin-bottom: 3px; font-size: 10px; }
.formula-steps code { color: var(--muted); font-family: "JetBrains Mono", monospace; font-size: 9px; line-height: 1.45; white-space: normal; }
.formula-steps b { color: var(--accent); font-family: "JetBrains Mono", monospace; font-size: 12px; white-space: nowrap; }

.review-card { margin: 0 28px 14px; }
.mistake-table-wrap { overflow-x: auto; }
.mistake-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mistake-table th { padding: 12px 14px; background: var(--panel); color: var(--muted); text-align: left; font-size: 9px; letter-spacing: .6px; text-transform: uppercase; }
.mistake-table td { padding: 13px 14px; border-top: 1px solid var(--line); }
.mistake-table td:nth-child(2), .mistake-table td:nth-child(3) { font-family: "JetBrains Mono", monospace; }
.mistake-type { font-weight: 700; }
.mistake-type.full { color: var(--failure); }
.mistake-type.half { color: var(--accent); }

.no-mistakes { padding: 35px 20px; text-align: center; }
.no-mistakes > span { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 auto 10px; border-radius: 50%; background: var(--success-soft); color: var(--success); font-weight: 800; }
.no-mistakes strong { display: block; font-size: 12px; }
.no-mistakes p { margin: 4px 0 0; color: var(--muted); font-size: 9px; }

.result-rule-note { display: flex; align-items: flex-start; gap: 10px; margin: 0 28px 28px; padding: 12px 14px; border: 1px solid var(--line); background: var(--bg); }
.result-rule-note > span { display: grid; place-items: center; width: 18px; height: 18px; flex: 0 0 auto; border: 1px solid var(--accent); border-radius: 50%; color: var(--accent); font-family: serif; font-size: 10px; font-weight: 700; }
.result-rule-note p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.result-rule-note strong { color: var(--text); text-transform: capitalize; }

/* Result report: squared editorial layout and a readable exam equation. */
#resultsPanel .report-actions button,
#resultsPanel .result-verdict,
#resultsPanel .verdict-icon,
#resultsPanel .accuracy-ring,
#resultsPanel .primary-metrics article,
#resultsPanel .report-card,
#resultsPanel .mistake-formula,
#resultsPanel .rrb-formula-equation,
#resultsPanel .result-rule-note,
#resultsPanel .result-rule-note > span,
#resultsPanel .no-mistakes > span { border-radius: 0; }
#resultsPanel .result-verdict { margin-top: 18px; border-left: 4px solid var(--success); }
#resultsPanel .result-verdict.not-qualified { border-left-color: var(--failure); }
#resultsPanel .verdict-icon { width: 44px; height: 44px; }
#resultsPanel .accuracy-ring { width: 96px; height: 58px; border: 1px solid var(--line); background: linear-gradient(90deg, var(--success) var(--accuracy), var(--line) 0) bottom / 100% 3px no-repeat, var(--panel); }
#resultsPanel .accuracy-ring::before { display: none; }
#resultsPanel .accuracy-ring div { display: block; }
#resultsPanel .not-qualified .accuracy-ring { background: linear-gradient(90deg, var(--failure) var(--accuracy), var(--line) 0) bottom / 100% 3px no-repeat, var(--panel); }
#resultsPanel .report-columns { grid-template-columns: 1fr; }
#resultsPanel .mistake-formula { margin: 0 16px 16px; border-top: 1px solid var(--line); }
#resultsPanel .mistake-formula-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 0 2px; }
#resultsPanel .mistake-formula-heading > div { display: flex; align-items: center; gap: 10px; }
#resultsPanel .mistake-formula-heading > div > span { color: var(--accent); font-family: "JetBrains Mono", monospace; font-size: 9px; }
#resultsPanel .mistake-formula-heading h4 { margin: 0; font-size: 13px; }
#resultsPanel .mistake-formula-heading small { color: var(--muted); font-size: 10px; }
#resultsPanel .mistake-formula > p { margin: 10px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
#resultsPanel .rrb-formula-equation { justify-content: center; margin: 16px 0 8px; padding: 20px 8px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; color: var(--text); font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.25; }
#resultsPanel .formula-fraction { min-width: 0; font-family: Georgia, "Times New Roman", serif; font-size: 17px; }
#resultsPanel .formula-fraction span:first-child { padding: 0 10px 6px; border-bottom: 1px solid var(--text); }
#resultsPanel .formula-fraction span:last-child { padding-top: 6px; }
#resultsPanel .rrb-formula-equation.formula-simple .formula-fraction span:first-child { padding: 0; border-bottom: 0; }
#resultsPanel .rrb-formula-equation.formula-simple .formula-fraction span:last-child { display: none; }
#resultsPanel .formula-steps { padding: 4px 0 8px; }
#resultsPanel .formula-steps > div { grid-template-columns: 24px 1fr auto; padding: 7px 0; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100vw - 48px));
  margin: 46px auto 0;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

[hidden] { display: none !important; }

@media (max-width: 850px) {
  .home { grid-template-columns: 1fr; gap: 45px; padding-top: 50px; }
  .hero-copy h1 { max-width: 650px; }
  .setup-card { max-width: 620px; }
  .exam-strip { flex-wrap: wrap; }
  .exam-strip .coming-soon { display: none; }
  .exam-statusbar { grid-template-columns: 150px 1fr auto; }
  .exam-meta > span:first-child { display: none; }
  .report-columns { grid-template-columns: 1fr; }
  .primary-metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .topbar { min-height: 66px; padding: 10px 24px; }
  .header-actions { gap: 8px; }
  .mobile-hide { display: none !important; }
  .brand strong { font-size: 16px; }
  .brand small { font-size: 7px; }
  .header-note, .theme-toggle #themeLabel { display: none; }
  .theme-toggle { width: 38px; padding: 0; justify-content: center; }
  .app { width: min(100% - 32px, 1180px); }
  .home { min-height: auto; padding: 44px 0; }
  .hero-copy h1 { font-size: 42px; letter-spacing: -2px; }
  .hero-description { font-size: 14px; }
  .trust-row div { min-width: 0; flex: 1; padding-right: 12px; margin-right: 12px; }
  .setup-card { padding: 26px 20px; }
  .passage-preview { grid-template-columns: auto 1fr; }
  .passage-badges { display: none; }
  .exam-strip > p:first-child { width: 100%; }
  .exam-strip { gap: 16px 28px; }
  .exam-strip div small { display: none; }
  .candidate-card div, .candidate-card .online-status { display: none; }
  .candidate-card { padding-left: 10px; border-left: 0; }
  .exam-statusbar { grid-template-columns: 1fr auto; }
  .section-tab { display: none; }
  .exam-meta { padding: 8px 12px; }
  .exam-meta > span { display: none; }
  .timer-box { min-width: 112px; padding: 7px 14px; }
  .exam-workspace { margin: 8px; }
  .pane-heading { align-items: flex-start; }
  .passage-meta span:last-child, .typing-meta > span { display: none; }
  .reference-panel, textarea { font-size: 16px; }
  .exam-actions { align-items: flex-end; }
  .test-legend { display: grid; gap: 4px; }
  .test-legend span + span { padding-left: 0; border-left: 0; }
  .results { margin: 22px 0; }
  .report-header { align-items: flex-start; padding: 20px; }
  .report-actions { flex-direction: column-reverse; }
  .report-actions button { height: 34px; }
  .result-verdict { margin: 14px 14px 10px; padding: 18px; }
  .verdict-copy { gap: 12px; }
  .verdict-icon { width: 40px; height: 40px; }
  .verdict-copy h3 { font-size: 23px; }
  .verdict-copy p { font-size: 9px; }
  .accuracy-ring { width: 72px; height: 72px; }
  .accuracy-ring::before { width: 58px; height: 58px; }
  .accuracy-ring strong { font-size: 12px; }
  .primary-metrics { gap: 8px; margin: 0 14px 10px; }
  .primary-metrics article { padding: 14px; }
  .primary-metrics strong { font-size: 21px; }
  .report-columns { margin: 0 14px 10px; }
  .mistake-totals { grid-template-columns: 1fr; gap: 10px; }
  .mistake-totals > div, .mistake-totals > div:first-child { padding: 0 0 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .mistake-totals > div:last-child { padding-bottom: 0; border-bottom: 0; }
  .attempt-summary { grid-template-columns: 1fr 1fr; gap: 10px 0; }
  .attempt-summary span:nth-child(3) { border-left: 0; }
  .review-card { margin: 0 14px 10px; }
  .result-rule-note { margin: 0 14px 14px; }
  footer { width: calc(100% - 32px); }
  footer span:nth-child(2) { display: none; }
}

@media print {
  body { background: #fff; color: #111; }
  body::before, .topbar, footer, .report-actions, .result-rule-note { display: none !important; }
  .app { width: 100%; }
  .results { margin: 0; border: 0; box-shadow: none; }
  .report-card, .primary-metrics article, .result-verdict { break-inside: avoid; }
}

/* ---- Accounts, entitlement & paywall ---- */
.account-button {
  border: 1px solid rgba(120, 130, 150, 0.4);
  background: transparent;
  color: inherit;
  border-radius: 10px;
  min-height: 44px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}
.account-button.is-premium {
  border-color: #c2410c;
  color: #c2410c;
  background: rgba(26, 86, 219, 0.08);
}
.account-button:hover { border-color: #c2410c; }
.account-button:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 3px; }

/* Shared account dropdown (rendered by account-menu.js on every page that loads
   styles.css). app.html duplicates these inline for its own header; keeping the
   canonical copy here means legal + exam pages get the same styled menu. */
.account-menu-wrap { position: relative; }
.account-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 240px;
  z-index: 100;
  overflow: hidden;
}
.dropdown-header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}
.dropdown-header strong { display: block; font-size: 0.95rem; color: var(--text); }
.dropdown-header small { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.dropdown-device-status { padding: 9px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.78rem; }
.dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.dropdown-item:hover { background: var(--bg-soft); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: rgba(220, 38, 38, 0.1); }
.account-dropdown-icon { margin-left: 6px; font-size: 0.8em; opacity: 0.7; }
/* The explicit display above would otherwise override the [hidden] attribute
   (author display beats the UA [hidden]{display:none}); restore hiding so the
   signed-out button and guest-only items stay collapsed. */
.account-button[hidden], .dropdown-item[hidden] { display: none !important; }

.paywall-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 16, 12, 0.55);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}
.paywall-backdrop[hidden] { display: none; }
.paywall-card {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 30px 26px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow);
  text-align: center;
  animation: paywall-pop 0.22s ease-out;
}
@keyframes paywall-pop {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to { opacity: 1; transform: none; }
}
.paywall-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  font-size: 1.6rem;
  background: var(--accent-soft);
  color: var(--accent);
}
.paywall-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 12px;
}
.paywall-card h2 { margin: 0 0 8px; font-family: "Fraunces", serif; font-weight: 600; font-size: 1.5rem; }
.paywall-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; font-size: 0.95rem; }
.paywall-features {
  list-style: none;
  margin: 0 0 22px;
  padding: 16px 18px;
  text-align: left;
  display: grid;
  gap: 11px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.paywall-features li {
  position: relative;
  padding-left: 28px;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
}
.paywall-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}
.paywall-actions { display: flex; flex-direction: column; gap: 10px; }
.paywall-actions .primary-button,
.paywall-actions .secondary-button { justify-content: center; text-decoration: none; }
.paywall-dismiss {
  background: none;
  border: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
}
.paywall-dismiss:hover { color: var(--text); background: var(--bg-soft); }
.paywall-price { margin: 16px 0 0; font-size: 0.8rem; color: var(--muted); }

/* ============================================================
   Modern exam terminal (overrides the earlier warm skin):
   full-width test portal, timer restored, cool/blue palette,
   larger reading & typing areas. Later rules win by source order.
   ============================================================ */
.exam-skin-exam-terminal { background: var(--bg-soft); }
.exam-skin-exam-terminal .app,
.test-active .app { width: min(1520px, calc(100vw - 24px)); }

.exam-skin-exam-terminal .terminal {
  --exam-blue: #c2410c;
  --exam-blue-dark: #9a3412;
  --exam-blue-soft: var(--accent-soft);
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}
:root[data-theme="dark"] .exam-skin-exam-terminal .terminal { --exam-blue: #e2703a; --exam-blue-dark: #f0895a; }

/* Keep the status bar (timer + exam info) visible; hide only the candidate
   masthead and the verbose notice for a clean, focused test view. */
.exam-skin-exam-terminal .exam-masthead,
.exam-skin-exam-terminal .exam-notice { display: none; }
.exam-skin-exam-terminal .exam-statusbar { display: grid; }
.exam-skin-exam-terminal .time-track { display: block; }

.exam-skin-exam-terminal .exam-workspace { margin: 0; border: 0; background: var(--panel); }
.exam-skin-exam-terminal .pane-heading { min-height: 50px; padding: 10px 20px; border-bottom-color: var(--line); background: var(--bg); }
.exam-skin-exam-terminal .question-number { width: 28px; height: 28px; border-radius: 6px; background: var(--exam-blue); color: #fff; }
.exam-skin-exam-terminal .pane-heading small { color: var(--muted); }
.exam-skin-exam-terminal .pane-heading strong { color: var(--text); }
.exam-skin-exam-terminal .passage-meta span { border-left-color: var(--line); color: var(--muted); }

.exam-skin-exam-terminal .reference-panel {
  height: min(42vh, 400px);
  padding: 26px 44px;
  border-bottom: 3px solid var(--exam-blue);
  background: var(--panel-strong);
  color: var(--text);
}
.exam-skin-exam-terminal .reference-document { max-width: 1120px; color: var(--text); font-size: 17px; line-height: 1.75; }

.exam-skin-exam-terminal .typing-heading { min-height: 50px; border-top: 0; border-bottom: 1px solid var(--line); background: var(--bg); }
.exam-skin-exam-terminal .typing-indicator { width: 8px; height: 26px; background: var(--exam-blue); }
.exam-skin-exam-terminal .typing-meta > span { background: var(--accent-soft); color: var(--accent); }
.exam-skin-exam-terminal .typing-meta > strong { color: var(--muted); }

.exam-skin-exam-terminal textarea {
  min-height: min(36vh, 360px);
  padding: 24px 44px;
  border-top: 0;
  background: var(--panel-strong);
  color: var(--text);
  font-size: 17px;
  line-height: 1.75;
}
.exam-skin-exam-terminal textarea:focus { box-shadow: inset 0 0 0 2px var(--exam-blue); }

.exam-skin-exam-terminal .exam-actions { border-top-color: var(--line); background: var(--bg); }
.exam-skin-exam-terminal .secondary-button { border-color: var(--line); background: var(--panel); color: var(--text); }
.exam-skin-exam-terminal .submit-button { border-color: var(--exam-blue); background: var(--exam-blue); color: #fff; }
.exam-skin-exam-terminal .submit-button:hover { background: var(--exam-blue-dark); }

/* Roomier reading & typing areas on the non-skinned path too. */
.reference-panel { height: min(42vh, 400px); }
textarea { min-height: min(32vh, 320px); }

/* ============================================================
   Compact, centered test panel — simpler & less intimidating
   (replaces the full-width "wall"). Matches the approved card.
   ============================================================ */
.test-active .app,
.exam-skin-exam-terminal .app { width: min(1520px, calc(100vw - 32px)); min-height: calc(100vh - 28px); display: flex; flex-direction: column; justify-content: center; }
/* Fill the viewport on any monitor: the card is a flex column sized to the
   window height, and the passage + answer panels share the leftover space (3:2).
   No bottom gap on tall screens, no off-screen submit on short laptops. On very
   tall screens (2K/4K) max-height stops the card stretching into empty voids and
   the parent centers it. */
.exam-skin-exam-terminal .terminal { display: flex; flex-direction: column; height: calc(100vh - 28px); max-height: 1040px; margin: 14px auto; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); }
.exam-skin-exam-terminal .exam-statusbar,
.exam-skin-exam-terminal .time-track,
.exam-skin-exam-terminal .pane-heading,
.exam-skin-exam-terminal .exam-actions { flex: 0 0 auto; }
.exam-skin-exam-terminal .exam-workspace { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.exam-skin-exam-terminal .section-tab { display: none; }           /* drop "Section / Evaluated test" clutter */
.exam-skin-exam-terminal .exam-statusbar { grid-template-columns: 1fr auto; min-height: 58px; }
.exam-skin-exam-terminal .exam-meta { gap: 24px; }
.exam-skin-exam-terminal .reference-panel { flex: 3 1 0; min-height: 0; height: auto; padding: 24px 40px; }
.exam-skin-exam-terminal .reference-document { max-width: none; font-size: 16px; }
.exam-skin-exam-terminal textarea { flex: 2 1 0; min-height: 0; padding: 22px 40px; font-size: 16px; }
.test-active .topbar { display: none; }

/* ---- Mobile test screen: fit ONE viewport, never a long page-scroll ----
   The passage pane flexes + scrolls inside its own box; the answer box is a
   fixed slice directly below it, so both stay on screen and focusing the input
   can't scroll the passage away. Practice aids drop to the bottom; the
   supplementary sidebar cards are hidden (the timer is already in the top bar).
   --vvh (set from visualViewport in mobile-notice.js) keeps everything above the
   soft keyboard; 100dvh is the fallback and the full height for a plugged-in
   keyboard. 16px input font avoids iOS focus-zoom. The max-height branch also
   catches landscape phones so they get the same fit layout instead of the
   desktop sidebar layout. ---- */
@media (max-width: 700px), (max-height: 560px) {
  .test-active .app,
  .exam-skin-exam-terminal .app { width: 100%; min-height: 0; height: auto; display: block; }

  .test-active .terminal,
  .exam-skin-exam-terminal .terminal {
    height: var(--vvh, 100dvh); max-height: none; margin: 0; border: 0; border-radius: 0;
    display: flex; flex-direction: column; overflow: hidden;
  }
  .test-active .exam-statusbar, .test-active .time-track, .test-active .pane-heading, .test-active .exam-actions,
  .exam-skin-exam-terminal .exam-statusbar, .exam-skin-exam-terminal .time-track,
  .exam-skin-exam-terminal .pane-heading, .exam-skin-exam-terminal .exam-actions { flex: 0 0 auto; }

  .test-active .exam-workspace-shell,
  .exam-skin-exam-terminal .exam-workspace-shell {
    display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; gap: 0;
  }
  .test-active .exam-workspace,
  .exam-skin-exam-terminal .exam-workspace {
    display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; margin: 0;
  }

  /* Passage takes the free space, scrolls inside its own box. */
  .reference-panel,
  .exam-skin-exam-terminal .reference-panel {
    order: 1; flex: 1 1 auto; height: auto; min-height: 0; overflow-y: auto; padding: 14px 16px;
  }
  .reference-document,
  .exam-skin-exam-terminal .reference-document { font-size: 17px; line-height: 1.7; }

  /* Answer box: fixed slice, always on screen under the passage. */
  textarea#typingInput,
  .exam-skin-exam-terminal textarea {
    order: 3; flex: 0 0 auto; height: 22vh; min-height: 92px; padding: 12px 16px; font-size: 16px;
  }

  /* Order: reference heading, passage, answer heading, input, aids last. */
  .exam-workspace > .pane-heading:not(.typing-heading) { order: 0; }
  .exam-workspace > .typing-heading { order: 2; }
  /* Practice aids: compact pills, drop the label, wrap into ~2 tight rows. */
  .exam-workspace > .practice-tools {
    order: 4; flex: 0 0 auto; padding: 6px 12px; gap: 6px 8px;
  }
  .practice-tools .practice-tools-label { display: none; }
  .practice-tools .ptoggle { padding: 4px 9px; }
  .practice-tools .ptoggle span { font-size: 11px; }

  /* Reclaim space: hide supplementary sidebar cards on a phone. */
  .workspace-sidebar,
  .exam-skin-exam-terminal .workspace-sidebar { display: none !important; }

  /* Slim the orange status bar: no dead space, smaller timer, tight padding. */
  .test-active .exam-statusbar,
  .exam-skin-exam-terminal .exam-statusbar { min-height: 0; }
  .exam-meta { padding: 4px 12px; }
  .fullscreen-button { padding: 5px 8px; font-size: 8px; }
  .timer-box { min-width: 0; padding: 5px 14px; }
  .timer-box > span { font-size: 7px; }
  .timer { font-size: 17px; }
  .test-active .exam-notice,
  .exam-skin-exam-terminal .exam-notice { display: none; }

  /* Compact headings to one tight line each. */
  .pane-heading,
  .exam-skin-exam-terminal .pane-heading { min-height: 0; padding: 7px 14px; }
  .pane-heading strong,
  .exam-skin-exam-terminal .pane-heading strong { font-size: 9px; }

  /* The mobile notice must not eat the in-test viewport. */
  body.test-active > [role="note"] { display: none !important; }
}

/* Very short viewport (landscape phone, or on-screen keyboard up): claw back
   height for the passage — smaller input slice and aids on a single scroll row. */
@media (max-height: 560px) {
  textarea#typingInput,
  .exam-skin-exam-terminal textarea { height: 18vh; min-height: 70px; }
  .exam-workspace > .practice-tools { flex-wrap: nowrap; overflow-x: auto; }
}
