/* Part 107 Prep
   Visual system: a night-flight field (deep ink) with the vocabulary of a VFR
   sectional chart: Class D blue, Class E magenta, chart-paper cream, and the
   amber of an anti-collision light for anything that needs attention. */

:root {
  --ink: #0b1020;
  --ink-2: #0f1730;
  --panel: #141e38;
  --panel-2: #1a2648;
  --line: #27345c;
  --line-strong: #3a4a7a;
  --text: #e9eef9;
  --muted: #a7b2cf;
  --faint: #7684a8;
  --cream: #f3ead7;
  --blue: #5d96f5;
  --blue-deep: #2d5fcc;
  --magenta: #f05ea6;
  --magenta-deep: #c83a84;
  --amber: #ffb02e;
  --amber-deep: #d98a00;
  --green: #3fd08a;
  --red: #ff6b6b;
  --tan: #c9a97a;

  --font-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --font-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --measure: 68ch;
  --radius: 6px;
  --radius-lg: 12px;
  --gutter: 20px;
  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

#chart-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  display: block;
  background: radial-gradient(ellipse at 30% 10%, #141c3a 0%, var(--ink) 55%, #070b18 100%);
}

/* Type scale: 1.25 ratio from 17px */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 0.5em;
  color: var(--cream);
  letter-spacing: 0.005em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); margin-top: 0; }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.7rem); }
h4 { font-size: 1.2rem; }

p { margin: 0 0 1em; max-width: var(--measure); }
ul, ol { max-width: var(--measure); padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: 0.35em; }
li > ul, li > ol { margin-top: 0.35em; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #8fb6ff; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 3px;
  border-radius: 3px;
}

strong { color: #fff; font-weight: 600; }
code, .mono { font-family: var(--font-mono); font-size: 0.92em; }
code { background: rgba(255,255,255,0.06); padding: 0.1em 0.35em; border-radius: 4px; color: #f6f8ff; }
pre {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  background: #080c18;
  border: 1px solid var(--line);
  border-left: 3px solid var(--blue);
  padding: 14px 16px;
  border-radius: var(--radius);
  overflow-x: auto;
  color: #dfe7ff;
  max-width: 100%;
  margin: 0 0 1.2em;
}
pre code { background: none; padding: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--amber); color: #1a1200;
  padding: 10px 14px; border-radius: var(--radius);
  font-weight: 600; z-index: 100;
}
.skip-link:focus { top: 12px; }

/* Layout */
.wrap { width: min(100% - 2 * var(--gutter), var(--maxw)); margin-inline: auto; }
.narrow { width: min(100% - 2 * var(--gutter), 820px); margin-inline: auto; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 16, 32, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 24px;
  min-height: 64px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--cream);
  font-family: var(--font-display); font-weight: 700; font-size: 1.45rem;
  letter-spacing: 0.01em; white-space: nowrap;
}
.brand svg { width: 34px; height: 34px; flex: none; }
.brand small {
  display: block; font-family: var(--font-body); font-weight: 500;
  font-size: 0.72rem; color: var(--muted); letter-spacing: 0.08em; margin-top: -2px;
}
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.site-nav a {
  color: var(--text); text-decoration: none; font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius); font-size: 0.98rem;
}
.site-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.site-nav a[aria-current="page"] { color: var(--amber); }
.site-nav a.nav-cta {
  background: var(--amber); color: #1a1200; font-weight: 700; margin-left: 6px;
}
.site-nav a.nav-cta:hover { background: #ffc15c; color: #1a1200; }
.nav-toggle {
  display: none; margin-left: auto;
  background: none; border: 1px solid var(--line-strong); color: var(--text);
  width: 44px; height: 44px; border-radius: var(--radius); cursor: pointer;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: #0e1530; border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; padding: 8px var(--gutter) 14px; gap: 2px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 10px; font-size: 1.05rem; }
  .site-nav a.nav-cta { margin: 8px 0 0; text-align: center; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: var(--radius);
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  text-decoration: none; cursor: pointer; border: 1px solid transparent;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
  line-height: 1.2;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--amber); color: #1a1200; }
.btn-primary:hover { background: #ffc15c; color: #1a1200; }
.btn-secondary { background: transparent; color: var(--cream); border-color: var(--line-strong); }
.btn-secondary:hover { border-color: var(--cream); color: #fff; }
.btn-blue { background: var(--blue-deep); color: #fff; }
.btn-blue:hover { background: #3b70e0; color: #fff; }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--text); }
.btn-ghost:hover { background: rgba(255,255,255,0.12); color: #fff; }
.btn-danger { background: transparent; color: var(--red); border-color: rgba(255,107,107,0.4); }
.btn-danger:hover { background: rgba(255,107,107,0.1); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-lg { padding: 15px 26px; font-size: 1.08rem; }
.btn-sm { padding: 8px 12px; font-size: 0.9rem; }

/* Hero */
.hero { padding: clamp(56px, 9vw, 120px) 0 40px; position: relative; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr); gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } }
.hero h1 { margin-bottom: 0.35em; }
.hero .lede { font-size: clamp(1.1rem, 1.5vw, 1.3rem); color: var(--muted); max-width: 56ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* Chart data block: the typographic style of an airport data block on a sectional */
.data-block {
  background: rgba(15, 23, 48, 0.75);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  font-family: var(--font-display);
  color: var(--cream);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.data-block .db-title {
  font-size: 1.05rem; letter-spacing: 0.12em; color: var(--blue);
  border-bottom: 1px dashed var(--blue); padding-bottom: 8px; margin-bottom: 14px;
  text-transform: uppercase;
}
.data-block dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 0; }
.data-block dt { color: var(--muted); font-family: var(--font-body); font-size: 0.9rem; align-self: baseline; padding-top: 4px; }
.data-block dd { margin: 0; font-size: 1.6rem; font-weight: 700; line-height: 1.1; }
.data-block dd span { font-size: 0.95rem; font-weight: 500; color: var(--muted); font-family: var(--font-body); margin-left: 6px; }
.data-block .db-foot { margin-top: 14px; font-family: var(--font-body); font-size: 0.86rem; color: var(--faint); }

/* Sections */
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section-tight { padding: 36px 0; }
.section-head { max-width: 760px; margin-bottom: 32px; }
.section-head p { color: var(--muted); font-size: 1.08rem; }
.kicker { color: var(--magenta); font-weight: 600; margin-bottom: 8px; font-size: 0.95rem; }

.panel {
  background: rgba(20, 30, 56, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
}
.panel h3:first-child, .panel h2:first-child { margin-top: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* Path cards on the home page */
.path {
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(20, 30, 56, 0.72); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px; text-decoration: none; color: var(--text);
  transition: border-color 120ms ease;
}
.path:hover { border-color: var(--blue); color: var(--text); }
.path h3 { margin: 0; color: var(--cream); }
.path p { margin: 0; color: var(--muted); font-size: 0.98rem; }
.path .go { color: var(--amber); font-weight: 600; margin-top: auto; }

/* Weighting bars (what the test covers) */
.weights { list-style: none; padding: 0; margin: 0; max-width: 100%; display: grid; gap: 12px; }
.weights li { display: grid; grid-template-columns: 220px 1fr 110px; gap: 14px; align-items: center; }
@media (max-width: 640px) { .weights li { grid-template-columns: 1fr; gap: 6px; } }
.weights .bar { height: 14px; background: rgba(255,255,255,0.06); border-radius: 7px; overflow: hidden; }
.weights .bar span { display: block; height: 100%; border-radius: 7px; }
.weights .pct { color: var(--muted); font-family: var(--font-display); font-size: 1.15rem; }
.weights a { color: var(--cream); text-decoration: none; font-weight: 600; }
.weights a:hover { color: var(--amber); }
.w-reg { background: var(--blue); }
.w-air { background: var(--magenta); }
.w-wx { background: var(--tan); }
.w-load { background: var(--green); }
.w-ops { background: var(--amber); }

/* Callouts: the left border color says what kind of note it is */
.callout {
  border-left: 4px solid var(--blue);
  background: rgba(93, 150, 245, 0.08);
  padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.2em 0; max-width: var(--measure);
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout .callout-title { font-weight: 700; color: var(--cream); display: block; margin-bottom: 4px; font-family: var(--font-display); font-size: 1.15rem; }
.callout-tip { border-left-color: var(--magenta); background: rgba(240, 94, 166, 0.08); }
.callout-safety { border-left-color: var(--amber); background: rgba(255, 176, 46, 0.09); }
.callout-reg { border-left-color: var(--tan); background: rgba(201, 169, 122, 0.09); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.4em; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: rgba(255,255,255,0.05); color: var(--cream); font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; letter-spacing: 0.02em; }
tr:last-child td { border-bottom: 0; }
td.mono, th.mono { font-family: var(--font-mono); font-size: 0.9rem; white-space: nowrap; }

/* Two-column article layout with a sticky table of contents */
.article { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 48px; align-items: start; }
@media (max-width: 960px) { .article { grid-template-columns: 1fr; gap: 24px; } }
.toc { position: sticky; top: 84px; font-size: 0.95rem; }
.toc .toc-title { font-family: var(--font-display); color: var(--cream); font-size: 1.2rem; margin-bottom: 8px; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.toc li { margin: 0; }
.toc a { display: block; padding: 6px 12px; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; margin-left: -1px; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--amber); border-left-color: var(--amber); }
@media (max-width: 960px) {
  .toc { position: static; background: rgba(20,30,56,0.6); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
  .toc ol { border-left: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; }
  .toc a { padding: 4px 0; border-left: 0; }
}
.prose h2 { margin-top: 2.2em; padding-top: 0.4em; border-top: 1px solid var(--line); }
.prose h2:first-of-type { margin-top: 0; border-top: 0; padding-top: 0; }
.prose h3 { margin-top: 1.6em; }
.prose figure { margin: 1.5em 0; max-width: 100%; }
.prose figcaption { color: var(--muted); font-size: 0.92rem; margin-top: 8px; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius); }

/* Key fact grid inside study pages */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 1.2em 0 1.6em; max-width: 100%; list-style: none; padding: 0; }
.facts li { background: rgba(255,255,255,0.04); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0; }
.facts b { display: block; font-family: var(--font-display); font-size: 1.5rem; color: var(--cream); line-height: 1.1; }
.facts span { color: var(--muted); font-size: 0.9rem; }

/* Process timeline: the content is a true sequence, so steps are numbered */
.steps { list-style: none; padding: 0; margin: 0; max-width: 100%; counter-reset: step; }
.steps > li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 20px; padding: 26px 0; border-top: 1px solid var(--line); counter-increment: step; }
.steps > li:last-child { border-bottom: 1px solid var(--line); }
.steps .num {
  width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--blue);
}
.steps .num::before { content: counter(step); }
.steps h3 { margin: 6px 0 8px; }
.steps .meta { color: var(--faint); font-size: 0.9rem; margin-top: 10px; }
.steps p:last-child { margin-bottom: 0; }

/* Definition list used on the regulations page */
.reg-list { max-width: 100%; }
.reg-list .reg {
  display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px;
  padding: 16px 0; border-top: 1px solid var(--line);
}
.reg-list .reg:last-child { border-bottom: 1px solid var(--line); }
@media (max-width: 640px) { .reg-list .reg { grid-template-columns: 1fr; gap: 4px; } }
.reg .cite { font-family: var(--font-mono); font-size: 0.9rem; color: var(--tan); padding-top: 3px; }
.reg h4 { margin: 0 0 4px; font-size: 1.15rem; }
.reg p { margin: 0; color: var(--muted); }
.reg p + p { margin-top: 6px; }

/* Checklist (printable) */
.checklist { list-style: none; padding: 0; margin: 0 0 1.5em; max-width: 100%; }
.checklist li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.checklist li::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 4px; border: 2px solid var(--amber); border-radius: 4px; }

/* Link lists on the resources page */
.links { list-style: none; padding: 0; margin: 0; max-width: 100%; display: grid; gap: 10px; }
.links li { display: grid; gap: 2px; padding: 12px 14px; background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: var(--radius); }
.links a { font-weight: 600; color: var(--cream); text-decoration: none; }
.links a:hover { color: var(--amber); }
.links span { color: var(--muted); font-size: 0.93rem; }
.links .url { font-family: var(--font-mono); font-size: 0.8rem; color: var(--faint); word-break: break-all; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 36px 0 48px; margin-top: 40px; color: var(--muted); font-size: 0.92rem; background: rgba(8, 12, 24, 0.7); }
.site-footer .wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }
.site-footer p { max-width: 60ch; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.site-footer nav a { color: var(--text); text-decoration: none; }
.site-footer nav a:hover { color: var(--amber); }
.site-footer .reviewed { color: var(--faint); font-size: 0.85rem; }

/* Lightbox for the practice chart */
.zoomable { cursor: zoom-in; }
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(5, 8, 16, 0.92);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; width: auto; height: auto; border-radius: var(--radius); }
.lightbox button {
  position: absolute; top: 14px; right: 14px; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid var(--line-strong); background: var(--panel); color: #fff; font-size: 22px; cursor: pointer;
}

/* ===== Practice exam ===== */
.exam-shell { max-width: 900px; margin-inline: auto; }
.mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 820px) { .mode-grid { grid-template-columns: 1fr; } }
.mode {
  display: flex; flex-direction: column; gap: 10px; text-align: left;
  background: rgba(20, 30, 56, 0.72); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px; color: var(--text); cursor: pointer; font: inherit;
  transition: border-color 120ms ease;
}
.mode:hover, .mode:focus-visible { border-color: var(--amber); }
.mode h3 { margin: 0; }
.mode .mode-spec { font-family: var(--font-display); font-size: 1.1rem; color: var(--amber); letter-spacing: 0.04em; }
.mode p { margin: 0; color: var(--muted); font-size: 0.97rem; }
.mode select { margin-top: 6px; }

select, input[type="text"] {
  font: inherit; background: #0d1428; color: var(--text); border: 1px solid var(--line-strong);
  border-radius: var(--radius); padding: 10px 12px; width: 100%;
}
.opts { display: flex; flex-wrap: wrap; gap: 18px; margin: 18px 0 0; color: var(--muted); font-size: 0.97rem; }
.opts label { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; }
.opts input { width: 18px; height: 18px; accent-color: var(--amber); }

.exam-top {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 22px;
  position: sticky; top: 64px; background: rgba(11, 16, 32, 0.92); backdrop-filter: blur(10px); z-index: 10;
}
.exam-top .progress { flex: 1 1 200px; height: 8px; background: rgba(255,255,255,0.08); border-radius: 4px; overflow: hidden; }
.exam-top .progress span { display: block; height: 100%; background: var(--blue); transition: width 200ms ease; }
.exam-top .counter { font-family: var(--font-display); font-size: 1.25rem; color: var(--cream); }
.exam-top .timer { font-family: var(--font-mono); font-size: 1.1rem; color: var(--cream); padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.exam-top .timer.low { color: var(--amber); border-color: var(--amber); }
.exam-top .timer.critical { color: var(--red); border-color: var(--red); }

.qcard { background: rgba(20, 30, 56, 0.78); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 26px; }
.qcard .qcat { color: var(--magenta); font-weight: 600; font-size: 0.92rem; margin-bottom: 10px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.qcard .qtext { font-size: 1.22rem; line-height: 1.5; color: #fff; max-width: 100%; margin-bottom: 18px; }
.qcard figure { margin: 0 0 18px; background: var(--cream); border-radius: var(--radius); padding: 8px; }
.qcard figure img { display: block; width: 100%; height: auto; border-radius: 4px; }
.qcard figcaption { color: #4a3b22; font-size: 0.85rem; padding: 6px 4px 0; }
.choices { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; max-width: 100%; }
.choice {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; align-items: center;
  width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: rgba(255,255,255,0.03); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 12px 14px; transition: border-color 100ms ease, background-color 100ms ease;
}
.choice:hover { border-color: var(--blue); background: rgba(93,150,245,0.08); }
.choice .letter {
  width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--muted);
}
.choice[aria-checked="true"] { border-color: var(--amber); background: rgba(255,176,46,0.1); }
.choice[aria-checked="true"] .letter { background: var(--amber); border-color: var(--amber); color: #1a1200; }
.choice.correct { border-color: var(--green); background: rgba(63,208,138,0.12); }
.choice.correct .letter { background: var(--green); border-color: var(--green); color: #052313; }
.choice.wrong { border-color: var(--red); background: rgba(255,107,107,0.12); }
.choice.wrong .letter { background: var(--red); border-color: var(--red); color: #2a0808; }
.choice[disabled] { cursor: default; }

.explain { margin-top: 18px; padding: 14px 16px; border-radius: var(--radius); background: rgba(255,255,255,0.04); border: 1px solid var(--line); }
.explain .verdict { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 4px; }
.explain .verdict.ok { color: var(--green); }
.explain .verdict.bad { color: var(--red); }
.explain p { margin: 0; color: var(--text); max-width: 100%; }
.explain .ref { color: var(--tan); font-family: var(--font-mono); font-size: 0.85rem; margin-top: 6px; display: block; }

.exam-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; align-items: center; }
.exam-nav .spacer { flex: 1; }
.flag-btn[aria-pressed="true"] { color: var(--amber); border-color: var(--amber); }

.qgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; margin-top: 18px; }
.qgrid button {
  height: 40px; border-radius: var(--radius); border: 1px solid var(--line); background: rgba(255,255,255,0.03);
  color: var(--muted); font: inherit; font-family: var(--font-display); font-size: 1rem; cursor: pointer;
}
.qgrid button.answered { background: rgba(93,150,245,0.18); border-color: var(--blue); color: #fff; }
.qgrid button.flagged { box-shadow: inset 0 -3px 0 var(--amber); }
.qgrid button.current { outline: 2px solid var(--cream); outline-offset: 1px; }
.qgrid button.right { background: rgba(63,208,138,0.2); border-color: var(--green); color: #fff; }
.qgrid button.missed { background: rgba(255,107,107,0.2); border-color: var(--red); color: #fff; }
details.navbox { margin-top: 16px; }
details.navbox summary { cursor: pointer; color: var(--muted); font-weight: 600; }

/* Results */
.result-head { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; align-items: center; }
@media (max-width: 700px) { .result-head { grid-template-columns: 1fr; justify-items: center; text-align: center; } }
.ring { width: 220px; height: 220px; }
.ring text { font-family: var(--font-display); font-weight: 700; fill: var(--cream); }
.verdict-big { font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 3.4rem); font-weight: 700; line-height: 1; margin: 0 0 6px; }
.verdict-big.pass { color: var(--green); }
.verdict-big.fail { color: var(--red); }
.result-stats { display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); margin-bottom: 14px; }
.result-stats b { color: var(--cream); font-family: var(--font-display); font-size: 1.3rem; }
.cat-bars { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; max-width: 100%; }
.cat-bars li { display: grid; grid-template-columns: 200px 1fr 120px; gap: 12px; align-items: center; font-size: 0.97rem; }
@media (max-width: 640px) { .cat-bars li { grid-template-columns: 1fr; gap: 4px; } }
.cat-bars .bar { height: 12px; background: rgba(255,255,255,0.06); border-radius: 6px; overflow: hidden; }
.cat-bars .bar span { display: block; height: 100%; border-radius: 6px; background: var(--green); }
.cat-bars .bar span.weak { background: var(--red); }
.cat-bars .bar span.mid { background: var(--amber); }
.cat-bars .score { color: var(--muted); font-family: var(--font-display); font-size: 1.1rem; text-align: right; white-space: nowrap; }

.review-item { margin-top: 14px; }
.review-item .qcard { padding: 20px; }
.review-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0 8px; align-items: center; }
.review-filter .label { color: var(--muted); margin-right: 6px; }
.review-filter .btn[aria-pressed="true"] { background: var(--cream); color: #1a1200; border-color: var(--cream); }

.history { margin-top: 32px; }
.history table td, .history table th { padding: 8px 10px; font-size: 0.95rem; }
.history .pass { color: var(--green); font-weight: 600; }
.history .fail { color: var(--red); font-weight: 600; }

/* Small status chips */
.chip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; border: 1px solid var(--line-strong); color: var(--muted); }
.chip-amber { color: var(--amber); border-color: rgba(255,176,46,0.5); }
.chip-green { color: var(--green); border-color: rgba(63,208,138,0.5); }
.chip-blue { color: var(--blue); border-color: rgba(93,150,245,0.5); }

/* Print: the checklist and study pages should print cleanly */
@media print {
  #chart-bg, .site-header, .site-footer nav, .btn, .toc, .nav-toggle { display: none !important; }
  body { background: #fff; color: #111; font-size: 12pt; }
  h1, h2, h3, h4 { color: #000; }
  .panel, .callout, .facts li, .reg-list .reg, .links li { background: none; border-color: #bbb; }
  a { color: #000; }
  .checklist li::before { border-color: #000; }
}
