/* EPA 608 Practice Test. Visual language: the service manifold.
   Blue = low side, red = high side, yellow/gray = recovery cylinder. */
:root {
  --bg: #e7ecef;
  --surface: #f7f9fa;
  --surface-2: #dfe5e9;
  --ink: #142230;
  --muted: #566573;
  --line: #c3ccd3;
  --low: #1d58a5;      /* low-side hose and gauge */
  --high: #c22f29;     /* high-side hose and gauge */
  --yellow: #e9b31a;   /* recovery cylinder top */
  --gray: #79838c;     /* recovery cylinder body */
  --cyl: #58626b;      /* lock card body: darker gray so white text passes contrast */
  --pass: #2c7a4b;
  --pass-wash: #d6eadc;
  --fail-wash: #f5dcda;
  --focus: #1d58a5;
  --dial-face: #fbfcfc;
  --dial-ink: #142230;
  --shadow: 0 1px 0 rgba(20, 34, 48, 0.08), 0 6px 18px -12px rgba(20, 34, 48, 0.45);
  --radius-s: 6px;
  --radius-m: 12px;
  --display: "Barlow Semi Condensed", "Barlow", "Arial Narrow", system-ui, sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e151c; --surface: #16202a; --surface-2: #1e2a36; --ink: #e4eaef; --muted: #98a6b3;
    --line: #2b3946; --low: #5d93dd; --high: #ec6a62; --yellow: #f0c445; --gray: #9aa4ad;
    --cyl: #3b4650; --pass: #58b57d; --pass-wash: #173426; --fail-wash: #3a1d1c; --focus: #8bb6f0;
    --dial-face: #1b2631; --dial-ink: #e4eaef; --shadow: 0 1px 0 rgba(0,0,0,.4), 0 8px 22px -14px rgba(0,0,0,.9);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e151c; --surface: #16202a; --surface-2: #1e2a36; --ink: #e4eaef; --muted: #98a6b3;
  --line: #2b3946; --low: #5d93dd; --high: #ec6a62; --yellow: #f0c445; --gray: #9aa4ad;
  --cyl: #3b4650; --pass: #58b57d; --pass-wash: #173426; --fail-wash: #3a1d1c; --focus: #8bb6f0;
  --dial-face: #1b2631; --dial-ink: #e4eaef; --shadow: 0 1px 0 rgba(0,0,0,.4), 0 8px 22px -14px rgba(0,0,0,.9);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 17px/1.55 var(--body);
  min-height: 100vh;
}
a { color: var(--low); text-underline-offset: 2px; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px; }

/* Top bar: a strip of manifold hoses */
.top {
  position: sticky; top: 0; z-index: 5; background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.top::after {
  content: ""; display: block; height: 4px;
  background: linear-gradient(90deg, var(--low) 0 33.3%, var(--yellow) 33.3% 66.6%, var(--high) 66.6% 100%);
}
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font: 700 19px/1 var(--display); letter-spacing: .2px; }
.brand svg { width: 30px; height: 30px; flex: none; }
.top .spacer { flex: 1; }
.chip { font: 600 13px/1 var(--body); padding: 6px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.chip.pro { background: var(--yellow); color: #1b1b1b; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px; border-radius: var(--radius-s);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 16px/1 var(--body); cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.btn.low { background: var(--low); color: #fff; border-color: var(--low); }
.btn.ghost { background: transparent; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 15px; }

main { padding: 20px 0 40px; }
h1, h2, h3 { font-family: var(--display); line-height: 1.1; margin: 0 0 .4em; }
h1 { font-size: clamp(30px, 6vw, 46px); font-weight: 700; letter-spacing: -.2px; }
h2 { font-size: 26px; font-weight: 700; }
h3 { font-size: 20px; font-weight: 600; }
p { margin: 0 0 1em; max-width: 66ch; }
.muted { color: var(--muted); }
.small { font-size: 15px; }

/* Hero: the dial is the one bold element */
.hero { display: grid; grid-template-columns: 1fr; gap: 8px; align-items: center; padding: 8px 0 24px; }
.hero .dial-big { width: min(330px, 86vw); justify-self: center; }
.hero h1 { margin-top: 4px; }
.hero .facts { font-family: var(--display); font-size: 21px; color: var(--muted); margin-bottom: 18px; }
.hero .facts b { color: var(--ink); font-weight: 600; }
@media (min-width: 760px) {
  .hero { grid-template-columns: 1.15fr .85fr; gap: 32px; }
  .hero .dial-big { order: 2; width: 340px; }
}

.dial text { font-family: var(--display); }
.dial .face { fill: var(--dial-face); stroke: var(--line); }
.dial .tick { stroke: var(--dial-ink); }
.dial .num { fill: var(--dial-ink); font-size: 13px; font-weight: 600; }
.dial .zone { fill: none; stroke: var(--pass); opacity: .9; }
.dial .track { fill: none; stroke: var(--surface-2); }
.dial .needle { fill: var(--high); transition: transform .9s cubic-bezier(.2,.9,.25,1.15); transform-origin: 100px 100px; }
.dial .hub { fill: var(--dial-ink); }
.dial .read { fill: var(--dial-ink); font-size: 26px; font-weight: 700; }
.dial .unit { fill: var(--muted); font-size: 12px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .dial .needle { transition: none; } }

/* Manifold: one row per section, a colored hose on the left */
.manifold { list-style: none; margin: 0 0 22px; padding: 0; border-top: 1px solid var(--line); }
.port { border-bottom: 1px solid var(--line); }
.port a {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 4px; text-decoration: none; color: var(--ink);
}
.port a:hover .port-name { text-decoration: underline; text-underline-offset: 3px; }
.hose { width: 10px; align-self: stretch; border-radius: 5px; background: var(--c, var(--gray)); }
.port-name { display: block; font: 700 22px/1.1 var(--display); }
.port-sub { display: block; color: var(--muted); font-size: 15px; margin-top: 3px; }
.port-meter { text-align: right; font: 600 15px/1.2 var(--display); color: var(--muted); min-width: 78px; }
.port-meter b { display: block; font-size: 22px; color: var(--ink); }
.c-core { --c: var(--gray); } .c-type1 { --c: var(--yellow); } .c-type2 { --c: var(--high); } .c-type3 { --c: var(--low); }
.c-universal { --c: linear-gradient(var(--gray) 0 25%, var(--yellow) 25% 50%, var(--high) 50% 75%, var(--low) 75%); }
.c-universal .hose { background: var(--c); }

.duebar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 22px; padding: 12px 14px; border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); }
.duebar .grow { flex: 1; min-width: 180px; }

/* Panels */
.panel { background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.modes { display: grid; gap: 10px; grid-template-columns: 1fr; margin: 16px 0; }
@media (min-width: 640px) { .modes { grid-template-columns: repeat(2, 1fr); } }
.mode { display: block; padding: 16px; border-radius: var(--radius-m); border: 1px solid var(--line); background: var(--surface); text-decoration: none; color: var(--ink); }
.mode:hover { border-color: var(--ink); }
.mode h3 { margin: 0 0 4px; }
.mode p { margin: 0; color: var(--muted); font-size: 15px; }
.mode.featured { border-left: 6px solid var(--c, var(--ink)); }

.section-head { display: grid; grid-template-columns: 1fr; gap: 12px; align-items: center; }
.section-head .dial-mid { width: 200px; justify-self: center; }
@media (min-width: 640px) { .section-head { grid-template-columns: 1fr 200px; } }

.crumbs { font-size: 15px; margin-bottom: 8px; }
.crumbs a { color: var(--muted); }

/* Question */
.qcard { background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow); padding: 20px; }
.qmeta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font: 600 14px/1.3 var(--display); color: var(--muted); margin-bottom: 10px; }
.qtext { font: 600 21px/1.35 var(--display); margin: 0 0 16px; max-width: 60ch; }
.choices { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.choice {
  width: 100%; text-align: left; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start;
  padding: 12px 14px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--bg);
  cursor: pointer; font: 400 17px/1.4 var(--body);
}
.choice:hover:not([disabled]) { border-color: var(--ink); }
.choice .k { font: 700 15px/30px var(--display); text-align: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); }
.choice[aria-pressed="true"] { border-color: var(--low); box-shadow: inset 0 0 0 1px var(--low); }
.choice.right { border-color: var(--pass); background: var(--pass-wash); }
.choice.right .k { background: var(--pass); color: #fff; }
.choice.wrong { border-color: var(--high); background: var(--fail-wash); }
.choice.wrong .k { background: var(--high); color: #fff; }
.choice[disabled] { cursor: default; }

.feedback { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-s); background: var(--bg); border-left: 5px solid var(--muted); }
.feedback.ok { border-left-color: var(--pass); }
.feedback.no { border-left-color: var(--high); }
.feedback .verdict { font: 700 19px/1.2 var(--display); margin-bottom: 6px; }
.feedback .src { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }

/* Tutor (Pro only) */
.tutor { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.tutor-chat form { display: flex; gap: 8px; margin-top: 10px; }
.tutor-chat input { flex: 1; min-width: 0; min-height: 44px; padding: 0 12px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 16px; }
.tutor-chat .log { display: flex; flex-direction: column; gap: 8px; }
.tutor-chat .log:empty { display: none; }
.tutor-chat .msg { max-width: 100%; padding: 10px 12px; border-radius: var(--radius-s); overflow-wrap: anywhere; }
.tutor-chat .msg p { margin: 0; white-space: pre-wrap; font-size: 16px; font-weight: 400; }
.tutor-chat .msg.you { align-self: flex-end; background: var(--surface-2); border: 1px solid var(--line); max-width: 85%; }
.tutor-chat .msg.bot { align-self: stretch; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--low); }
.tutor-chat .msg.err { border-left-color: var(--high); }
.tutor-chat .msg.wait p, .tutor-chat .msg.meta p { color: var(--muted); font-size: 14px; }
.tutor-chat .cites { margin: 8px 0 0; padding-left: 18px; font-size: 14px; }
.tutor-chat .note { font-size: 14px; color: var(--muted); margin: 8px 0 0; }
.tutor-q p { margin: 4px 0; }

/* Exam */
.exambar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.clock { font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums; padding: 8px 12px; border-radius: var(--radius-s); background: var(--ink); color: var(--surface); }
.clock.low { background: var(--high); color: #fff; }
.qmap { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 0; }
.qmap button { width: 38px; height: 38px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); font: 600 14px/1 var(--display); cursor: pointer; }
.qmap button.done { background: var(--surface-2); }
.qmap button.cur { border-color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }

.results { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0 20px; }
.result { text-align: center; padding: 12px; border-radius: var(--radius-m); background: var(--surface); box-shadow: var(--shadow); }
.result .dial { width: 150px; }
.result .verdict { font: 700 22px/1 var(--display); margin-top: 4px; }
.result .verdict.pass { color: var(--pass); }
.result .verdict.fail { color: var(--high); }
.missed { list-style: none; padding: 0; margin: 0; }
.missed li { padding: 14px 0; border-top: 1px solid var(--line); }

/* Lock card: a recovery cylinder, yellow shoulder on a gray body */
.lock { position: relative; overflow: hidden; border-radius: var(--radius-m); background: var(--cyl); color: #fff; padding: 0 20px 20px; margin: 18px 0; }
.lock::before { content: ""; display: block; height: 14px; margin: 0 -20px 16px; background: var(--yellow); }
.lock h3 { color: #fff; }
.lock p { color: #f2f4f5; }
.lock .btn { background: #fff; color: #1b1b1b; border-color: #fff; }
.lock .btn[disabled] { opacity: .8; }
.lock a.link { color: #fff; }

.weak { list-style: none; padding: 0; margin: 8px 0 0; }
.weak li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--low); }

.banner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 14px; margin: 0 0 18px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); }
.draft { background: var(--yellow); color: #1b1b1b; padding: 10px 14px; border-radius: var(--radius-s); font-weight: 600; margin-bottom: 16px; }
.prose h2 { margin-top: 1.2em; }
.prose li { margin-bottom: .4em; max-width: 66ch; }
.prose cite { font-style: normal; }
.field { display: grid; gap: 6px; margin: 12px 0; max-width: 420px; }
.field input { min-height: 46px; padding: 0 12px; border-radius: var(--radius-s); border: 1px solid var(--line); background: var(--surface); }
.msg { margin-top: 8px; font-weight: 600; }

footer { border-top: 1px solid var(--line); padding: 20px 0 40px; color: var(--muted); font-size: 14px; }
footer nav { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
footer a { color: var(--muted); }

/* Plans (data/plans.json): Free / Standard / Pro / Team */
.toplink { color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; padding: 10px 4px; }
.toplink:hover { text-decoration: underline; }
.plans { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 14px 0; }
.plan { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 16px; display: flex; flex-direction: column; gap: 6px; }
.plan-name { margin: 0; font-size: 22px; }
.plan-price { margin: 0; font-family: var(--display); font-size: 17px; color: var(--muted); display: grid; gap: 2px; }
.plan-price b { color: var(--ink); font-size: 28px; font-weight: 700; }
.plan ul { margin: 4px 0 6px; padding-left: 18px; font-size: 15px; }
.plan li { margin-bottom: 4px; }
.plan-note { font-size: 14px; color: var(--muted); margin: 0; }
.plan .btn { margin-top: auto; }
.plan-pro { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.lock .plans { margin-bottom: 4px; }
.lock .plan { border-color: transparent; }
.lock .plan .btn { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* Public pages (tools/build_site.py) */
.skip:focus { position: fixed; left: 8px; top: 8px; width: auto; height: auto; clip: auto; z-index: 10; background: var(--surface); padding: 10px 14px; border-radius: var(--radius-s); }
.sitenav { display: flex; flex-wrap: wrap; gap: 2px 18px; padding-bottom: 8px; }
.sitenav a { color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; padding: 6px 0; }
.sitenav a:hover, .sitenav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 3px; }
.top .brand span { white-space: nowrap; }
.site main h2 { margin-top: 1.4em; }
.site main ul, .site main ol { padding-left: 22px; }
.site main li { margin-bottom: .4em; max-width: 66ch; }
.lede { font-size: 19px; }
.notice { background: var(--surface); border-left: 5px solid var(--yellow); padding: 12px 16px; border-radius: var(--radius-s); margin: 0 0 18px; max-width: 66ch; }

.quiz { background: var(--surface); border-radius: var(--radius-m); box-shadow: var(--shadow); padding: 18px; margin: 8px 0 24px; border-top: 6px solid var(--high); }
.site main .quiz-title { margin: 0 0 10px; font-size: 24px; }
.quiz .qcard { box-shadow: none; padding: 0; background: transparent; }
.quiz-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.quiz-tab { min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); font: 600 15px/1 var(--body); cursor: pointer; }
.quiz-tab[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.quiz-intro { margin-bottom: 0; }
.quiz-score { font: 700 34px/1.1 var(--display); margin: 0 0 8px; }
.quiz-result:focus { outline: none; }
.site main .quiz-per { list-style: none; padding: 0; max-width: 360px; }
.quiz-per li { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 6px 0; margin: 0; }
.quiz-upsell { margin-top: 20px; border-top: 1px dashed var(--line); padding-top: 14px; }
.quiz-upsell h3 { margin-top: 0; }

.site main .cards { list-style: none; padding: 0; display: grid; gap: 10px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .site main .cards { grid-template-columns: repeat(2, 1fr); } }
.cards li { margin: 0; max-width: none; }
.cards a { display: block; height: 100%; padding: 14px 16px; border-radius: var(--radius-m); background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--c, var(--ink)); color: var(--ink); text-decoration: none; }
.c-universal.cards li a, .cards .c-universal a { border-left-color: var(--ink); }
.cards a:hover b { text-decoration: underline; }
.cards b { display: block; font: 700 19px/1.2 var(--display); }
.cards span { display: block; color: var(--muted); font-size: 15px; margin-top: 4px; }

.site main .samples { padding-left: 0; list-style: none; counter-reset: s; }
.sample { background: var(--surface); border-radius: var(--radius-m); padding: 14px 16px; margin-bottom: 12px; max-width: none; }
.sample-q { font: 600 19px/1.35 var(--display); margin-bottom: 8px; }
.site main .sample-c { list-style: none; padding-left: 0; }
.sample-c .k { display: inline-block; width: 26px; font-weight: 700; }
.sample details { margin-top: 6px; }
.sample summary { cursor: pointer; font-weight: 600; color: var(--low); min-height: 32px; }
.sample .src { font-size: 14px; color: var(--muted); }

.tablewrap { overflow-x: auto; margin: 0 0 18px; }
table { border-collapse: collapse; width: 100%; min-width: 300px; background: var(--surface); border-radius: var(--radius-s); font-size: 16px; }
caption { text-align: left; font-size: 14px; color: var(--muted); padding: 0 0 6px; }
th, td { text-align: left; vertical-align: top; padding: 9px 10px; border-bottom: 1px solid var(--line); }
thead th { font-family: var(--display); font-size: 15px; }
tbody th { font-weight: 600; }
.site main .checks li { list-style: "✓  "; }

.footcols { display: grid; gap: 14px 24px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 14px; }
.foot-h { font: 700 15px/1.2 var(--display); color: var(--ink); margin: 0 0 6px; }
.footcols ul { list-style: none; padding: 0; margin: 0; }
.footcols li { margin: 0; }
.footcols a { display: inline-block; padding: 5px 0; }
#disclaimer { max-width: 80ch; }

@media print {
  .top, .sitenav, .quiz, .noprint, .footcols, .crumbs { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  a { color: #000; }
  .site main a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; }
  footer::before { content: "608pass.com"; display: block; font-weight: 700; margin-bottom: 6px; }
}
.site .qtext, .site .quiz-result, .site [id] { scroll-margin-top: 130px; }
