/* Roadready — Irish driving test practice.

   The world: Irish national primary direction signage. The premise is that a
   sign already does what this app has to do — it tells you where you are, what
   is ahead, and how far — so the interface is built as sign faces rather than
   as a dashboard of cards. Green panels with an inset white keyline carry the
   important readings; everything else is a destination stack, ruled with
   hairlines. There are no cards and no shadows anywhere: a sign face is flat,
   and rank comes from the size of the panel and its position, never from
   elevation.

   The palette is the pinned one, converted from its HSL triplets into the
   plain custom properties this app runs on (there is still no build step). Two
   derivations were needed before it could carry text, and both are measured,
   not guessed:

   1. A darker green. --green (#339933, the pinned primary) measures 3.66:1
      against white and 3.31:1 as text on the page — large-text grades, both of
      them. Any panel carrying small white text therefore uses --sign, the same
      hue at 24% lightness, which measures 8.05:1 against white. The pinned
      green stays exactly where it grades: large fills, the monumental figures,
      progress fills and the active marker.

   2. Text-safe twins for the greys and the red. The pinned muted foreground
      lands at 4.46 on the page background and 3.97 on the muted surface, both
      short of AA for body text; --ink-dim is the same hue two steps darker and
      clears 5.73 / 5.10. The pinned destructive is 4.47 as text, so --red-ink
      carries red type at 5.91 while the pinned value stays the fill, where
      white on it measures 4.93.

   One colour is added outright: the palette has no amber, and Spot the Offence
   needs three outcomes tellable apart at a glance — illegal, wrongly accused,
   and legal. Derived at this palette's own register rather than bolted on.

   Colour is never the only carrier of a verdict. Right and wrong come back as
   the signs a driver would actually meet: a green direction panel, or a red
   regulatory roundel. Shape says it before hue does, which is how the road
   works and how anyone who cannot separate the two reads it.

   Every text pair below clears WCAG AA, verified against the rendered DOM
   rather than against this stylesheet. */

:root{
  /* --- the pinned palette ------------------------------------------- */
  --bg:#F0F5F0;            /* 120 20% 95% */
  --ink:#2B3B2B;           /* 120 15% 20% */
  --green:#339933;         /* 120 50% 40% — large fills only, 3.66:1 on white */
  --green-fg:#EBFAEB;      /* 120 60% 95% */
  --soft:#CDE4D5;          /* 140 30% 85% */
  --soft-ink:#24422E;      /* 140 30% 20% — 8.27 on --soft */
  --pale:#E3E8E3;          /* 120 10% 90% */
  --line:#C2D6C9;          /* 140 20% 80% */
  --red:#D92626;           /* 0 70% 50% — fill; white on it 4.93 */
  --rail:#E7EFE7;          /* 120 20% 92% */
  --rail-ink:#435B43;      /* 120 15% 31% — 6.36 on --rail */
  --radius:.5rem;          /* 0.5rem, pinned */

  /* --- derived, because the pinned values do not grade as text ------- */
  --sign:#1F5C1F;          /* white 8.05 · on bg 7.29 — panels and green type */
  --ink-dim:#456845;       /* bg 5.73 · pale 5.10 · soft 4.72 */
  --red-ink:#B62020;       /* bg 5.91 */
  --amber:#F29E0D;         /* ink on it 5.49 */
  --amber-ink:#97640C;     /* bg 4.59 */
  --line-strong:#568164;   /* 4.03 on bg — for outlines that ARE the control */
  --on-sign-dim:#BADEBA;   /* 5.46 on --sign — secondary text inside a panel */
  --radius-lg:.75rem;      /* the big sign faces, scaled from the pinned radius */

  --font:"Overpass",ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}

/* Self-hosted, not fetched from a CDN: the app is precached to work with no
   signal, and a font request to a third party on every visit would defeat that
   as well as leaking every learner's visit. Overpass is the road-signage
   relative of the lettering this design is built on, under the SIL Open Font
   Licence — see app/assets/fonts/README.txt. Variable, so the whole 400–800
   range is one 39 kB file. */
@font-face{
  font-family:"Overpass";
  font-style:normal; font-weight:400 700; font-display:swap;
  src:url("assets/fonts/overpass-latin.woff2") format("woff2");
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg); color:var(--ink);
  font:16px/1.55 var(--font);
  -webkit-font-smoothing:antialiased;
  /* Sign lettering is set tight. This is the single strongest tell that the
     type belongs to this world rather than to a default UI stack. */
  letter-spacing:-.011em;
}
button,input,select{font:inherit;color:inherit;letter-spacing:inherit}
button{cursor:pointer}
h1,h2,h3{margin:0;line-height:1.15;letter-spacing:-.03em;color:var(--ink);font-weight:700}
a{color:var(--sign);text-underline-offset:.18em;text-decoration-thickness:1px}
a:hover{color:var(--ink)}

/* The parts of the page the browser draws still belong to the design. */
::selection{background:var(--green);color:#fff}
:root{caret-color:var(--sign);accent-color:var(--sign);scrollbar-color:var(--line-strong) var(--bg)}
:focus-visible{outline:3px solid var(--sign);outline-offset:2px;border-radius:2px}
::-webkit-scrollbar{width:12px;height:12px}
::-webkit-scrollbar-track{background:var(--bg)}
::-webkit-scrollbar-thumb{background:var(--line-strong);border:3px solid var(--bg);border-radius:99px}
::-webkit-scrollbar-thumb:hover{background:var(--sign)}

.ico{width:1em;height:1em;display:inline-block;vertical-align:-.13em;flex:0 0 auto}
.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* ---------- the shell ----------
   A pale rail of route markers, not a dark sidebar. The content beside it runs
   to the edge of its column rather than floating in a centred card. */
.app{display:flex;min-height:100vh}
.rail{width:236px;background:var(--rail);border-right:1px solid var(--line);
  padding:26px 14px 20px;position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;z-index:10}
.main{margin-left:236px;width:calc(100% - 236px);padding:22px 40px 72px;max-width:1400px}

.brand{display:flex;gap:11px;align-items:center;padding:0 8px 24px}
.brand-mark{width:36px;height:36px;border-radius:var(--radius);display:block}
.brand strong{display:block;font-size:16px;color:var(--ink);letter-spacing:-.03em;line-height:1.1}
.brand span{font-size:12px;color:var(--rail-ink);letter-spacing:-.005em}

.nav{display:grid;gap:2px}
/* A route marker: the name, and a hairline that becomes a solid panel when you
   are on it. Nothing is enclosed until it is the place you are. */
.nav button{border:0;background:transparent;text-align:left;padding:10px 12px;border-radius:var(--radius);
  color:var(--rail-ink);font-weight:700;font-size:15px;display:flex;align-items:center;gap:12px;width:100%}
.nav button .ico{font-size:19px;color:var(--ink-dim)}
.nav button:hover{background:var(--pale);color:var(--ink)}
.nav button:hover .ico{color:var(--sign)}
.nav button.active{background:var(--sign);color:#fff;font-weight:700}
.nav button.active .ico{color:#fff}

.rail-foot{margin-top:auto;display:grid;gap:10px;padding:0 4px}
/* The rulebook is the one thing in the rail that is a sign in its own right. */
.rail-sign{background:var(--sign);color:#fff;border-radius:var(--radius);padding:14px 14px 13px;position:relative}
.rail-sign::after{content:"";position:absolute;inset:5px;border:1.5px solid rgba(255,255,255,.7);
  border-radius:calc(var(--radius) - 2px);pointer-events:none}
.rail-sign strong{display:block;font-size:14px;letter-spacing:-.02em}
.rail-sign p{margin:3px 0 10px;font-size:12px;color:var(--on-sign-dim);line-height:1.4}
.rail-sign .rb-actions{display:grid;gap:5px;position:relative;z-index:1}
.rail-sign button,.rail-sign a{background:transparent;color:#fff;border:1.5px solid rgba(255,255,255,.75);
  border-radius:calc(var(--radius) - 2px);padding:6px 9px;font-size:12.5px;font-weight:700;
  text-align:center;text-decoration:none;display:block}
.rail-sign button:hover,.rail-sign a:hover{background:rgba(255,255,255,.16);border-color:#fff;color:#fff}

.rail-read{display:flex;justify-content:space-between;align-items:baseline;gap:10px;
  padding:9px 10px;border-radius:var(--radius);background:var(--pale);color:var(--ink-dim);font-size:12.5px;font-weight:700}
.rail-read b{color:var(--ink);font-size:15px;font-variant-numeric:tabular-nums;letter-spacing:-.02em}

/* ---------- the confirmation strip ----------
   Where you are and who is driving. A thin rule under it, nothing more. */
.topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;
  min-height:40px;margin:0 0 24px;padding-bottom:14px;border-bottom:1px solid var(--line)}
.back{border:1.5px solid var(--line-strong);background:transparent;border-radius:var(--radius);
  padding:7px 13px 7px 10px;color:var(--sign);font-weight:700;font-size:14px;display:flex;align-items:center;gap:7px}
.back .ico{transform:scaleX(-1);font-size:15px}
.back:hover{border-color:var(--sign);background:var(--pale)}
.back[hidden]{display:none}
.profile{display:flex;align-items:center;gap:10px;font-weight:700;font-size:14px}
.avatar{width:32px;height:32px;border-radius:var(--radius);background:var(--sign);color:#fff;
  display:grid;place-items:center;font-size:14px;font-weight:700}

/* ---------- sign faces ----------
   The gantry: the one monumental reading on a screen. Inset keyline, tight
   caps, tabular figures — the parts that make a direction sign legible at
   speed are the same parts that make a reading legible at a glance. */
.gantry{background:var(--sign);color:#fff;border-radius:var(--radius-lg);
  padding:30px 32px;position:relative;isolation:isolate}
.gantry::after{content:"";position:absolute;inset:9px;border:2px solid rgba(255,255,255,.85);
  border-radius:calc(var(--radius-lg) - 3px);pointer-events:none}
.gantry-grid{display:grid;grid-template-columns:1fr auto;gap:28px;align-items:end;position:relative;z-index:1}
/* The route patch rides at the left of the panel, above the destination, the
   way a route number sits above the places it leads to. */
.gantry .patch{margin-bottom:14px}
.figure{font-size:clamp(54px,8.5vw,96px);font-weight:700;letter-spacing:-.04em;line-height:.86;
  font-variant-numeric:tabular-nums;margin:10px 0 0;display:flex;align-items:baseline;gap:14px}
.figure small{font-size:clamp(17px,2vw,22px);font-weight:700;color:var(--on-sign-dim);letter-spacing:-.02em}
.gantry .note{margin:12px 0 0;font-size:14.5px;color:var(--on-sign-dim);max-width:46ch;line-height:1.45}
.gantry h1{color:#fff;font-size:clamp(30px,4vw,44px);letter-spacing:-.035em}
.gantry .sub{margin:8px 0 0;font-size:15px;color:var(--on-sign-dim);max-width:52ch}

/* The route patch: a white plate with green figures, as a route number is
   carried on a green sign. */
.patch{background:#fff;color:var(--sign);border-radius:5px;padding:3px 9px;
  font-weight:700;font-size:13px;font-variant-numeric:tabular-nums;letter-spacing:-.01em;
  display:inline-flex;align-items:center;gap:6px;white-space:nowrap}
.patch .ico{font-size:14px}
.patch.pale{background:var(--pale);color:var(--sign)}
.patch.warn{background:var(--red);color:#fff}

/* The distance readings that ride along the gantry's right edge. */
.readings{display:grid;gap:14px;justify-items:end;text-align:right;position:relative;z-index:1}
.reading{display:grid;gap:2px}
.reading b{font-size:26px;font-weight:700;font-variant-numeric:tabular-nums;letter-spacing:-.03em;line-height:1}
.reading span{font-size:12.5px;color:var(--on-sign-dim);font-weight:700}

/* The exit arrow: the primary action, and the largest arrow on the panel. */
.exit{display:inline-flex;align-items:center;gap:11px;background:var(--sign);color:#fff;
  border:0;border-radius:var(--radius);padding:13px 18px;font-weight:700;font-size:16px;letter-spacing:-.02em}
.exit .ico{font-size:22px}
.exit:hover{background:var(--ink)}
.exit:disabled{opacity:.5;cursor:not-allowed}
/* On a green panel the arrow inverts, because a green button on a green sign
   is not a button. */
.gantry .exit,.verdict.right .exit{background:#fff;color:var(--sign)}
.gantry .exit:hover,.verdict.right .exit:hover{background:var(--green-fg);color:var(--sign)}

/* ---------- section headings ---------- */
.section{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin:44px 0 14px}
.section h2{font-size:21px}
.section p{margin:5px 0 0;color:var(--ink-dim);font-size:14px}
.section:first-child{margin-top:0}
.page-head{margin:0 0 26px}
.page-head h1{font-size:clamp(28px,3.4vw,38px)}
.page-head .subtitle{color:var(--ink-dim);margin:9px 0 0;font-size:15.5px;max-width:62ch}

/* ---------- the destination stack ----------
   Every list in this app is one of these: name at the left, the figure
   right-aligned in a tabular column, a chevron at the rail. No cards. */
.stack{border-top:1px solid var(--line)}
.dest{display:grid;grid-template-columns:34px minmax(0,1fr) auto auto 20px;gap:18px;align-items:center;
  width:100%;text-align:left;padding:17px 6px;background:transparent;
  border:0;border-bottom:1px solid var(--line);color:inherit}
button.dest:hover{background:var(--pale)}
button.dest:hover .dest-chev{color:var(--sign);transform:translateX(2px)}
.dest .ico.mark{font-size:22px;color:var(--sign)}
.dest h3{font-size:16px;letter-spacing:-.025em;margin:0 0 3px}
.dest p{font-size:13.5px;color:var(--ink-dim);margin:0;line-height:1.4}
.dest .num{font-variant-numeric:tabular-nums;font-weight:700;font-size:14.5px;white-space:nowrap;text-align:right}
.dest .num span{display:block;font-weight:700;font-size:12px;color:var(--ink-dim);margin-top:2px}
.dest-chev{color:var(--line-strong);font-size:19px;transition:transform .18s cubic-bezier(.16,1,.3,1),color .18s}
.dest.flat{grid-template-columns:34px minmax(0,1fr) auto}

/* ---------- distance bars ----------
   Progress is a distance run, drawn as the sign's own hatching would be. */
.bar{height:7px;border-radius:99px;background:var(--pale);overflow:hidden}
/* Driven by --p (0 to 1) and scaled rather than resized: animating width makes
   the browser lay the page out again on every frame of a purely visual change. */
.bar i{display:block;height:100%;width:100%;background:var(--green);
  transform:scaleX(var(--p,0));transform-origin:left center;
  transition:transform .5s cubic-bezier(.16,1,.3,1)}
.bar.on-sign{background:rgba(255,255,255,.28)}
.bar.on-sign i{background:#fff}
.bar.warn i{background:var(--red)}

/* ---------- buttons ---------- */
.btn{border:1.5px solid var(--line-strong);background:transparent;color:var(--ink);
  padding:10px 15px;border-radius:var(--radius);font-weight:700;font-size:14.5px;
  display:inline-flex;align-items:center;gap:8px}
.btn:hover{border-color:var(--sign);color:var(--sign);background:var(--pale)}
.btn .ico{font-size:16px}
.btn.primary{background:var(--sign);border-color:var(--sign);color:#fff}
.btn.primary:hover{background:var(--ink);border-color:var(--ink);color:#fff}
.btn.soft{background:var(--soft);border-color:var(--soft);color:var(--soft-ink)}
.btn.soft:hover{border-color:var(--sign);background:var(--soft);color:var(--sign)}
.btn.danger{background:transparent;border-color:var(--red-ink);color:var(--red-ink)}
.btn.danger:hover{background:var(--red);border-color:var(--red);color:#fff}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn-row{display:flex;gap:10px;flex-wrap:wrap}

/* A plate is a small toggle drawn as a sign plate, not a pill. */
/* A session length is a route patch: a white plate with a green numeral, the
   way a route number is carried on a green sign. The one you are on inverts. */
.plate{padding:7px 13px;border-radius:5px;border:0;background:#fff;
  font-weight:700;font-size:13.5px;font-variant-numeric:tabular-nums;color:var(--sign);
  letter-spacing:-.01em;box-shadow:inset 0 0 0 1.5px var(--line)}
.plate:hover{box-shadow:inset 0 0 0 1.5px var(--sign)}
.plate.on{background:var(--sign);color:#fff;box-shadow:inset 0 0 0 1.5px var(--sign)}
.plate-row{display:flex;gap:7px;flex-wrap:wrap}

/* ---------- the quiz ---------- */
.run{margin-bottom:22px}
.run-top{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:11px}
.run-title{display:flex;gap:11px;align-items:center;font-weight:700;font-size:17px;letter-spacing:-.025em}
.run-title .ico{font-size:22px;color:var(--sign)}
.run-count{font-size:13.5px;color:var(--ink-dim);font-weight:700;font-variant-numeric:tabular-nums}
.quiz-title{font-size:clamp(22px,2.6vw,28px);margin:22px 0 0;max-width:30ch}
.quiz-hint{color:var(--ink-dim);margin:9px 0 0;font-size:15px;max-width:58ch}
.question{font-size:16px;font-weight:700;margin:22px 0 12px;letter-spacing:-.02em}

/* Diagrams and sign faces sit on white, because that is the ground the RSA's
   own artwork is drawn for and tinting it would misrepresent a sign. */
.plate-face{border:1.5px solid var(--line);border-radius:var(--radius);background:#fff;
  margin:20px 0 0;display:grid;place-items:center;overflow:auto;padding:14px}
.plate-face svg{width:100%;height:auto;max-width:780px;display:block}
.plate-face.street{overflow-x:auto;justify-items:start}
.plate-face.street svg{min-width:760px}
.plate-face.sign{padding:30px}
.plate-face.sign img{max-height:200px;max-width:100%;object-fit:contain}

.choices{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.choices.stack-1{grid-template-columns:1fr}
.choice{padding:15px 16px;border:1.5px solid var(--line-strong);border-radius:var(--radius);
  background:transparent;text-align:left;font-weight:700;font-size:15px;
  display:flex;gap:12px;align-items:center;width:100%;color:var(--ink)}
.choice:hover:not(:disabled){border-color:var(--sign);background:var(--pale)}
.choice.selected{border-color:var(--sign);border-width:2.5px;background:var(--soft);color:var(--soft-ink)}
.choice.right{border-color:var(--sign);border-width:2.5px;background:var(--soft);color:var(--sign)}
.choice.wrong{border-color:var(--red);border-width:2.5px;background:#fff;color:var(--red-ink)}
.choice:disabled{cursor:default}
/* The marker is the whole control — there is no label to fall back on — so it
   takes the strong line rather than the hairline. */
.marker{width:21px;height:21px;border:2px solid var(--line-strong);border-radius:50%;
  display:grid;place-items:center;flex:0 0 auto;color:inherit}
.selected .marker,.right .marker,.wrong .marker{border-color:currentColor}
.selected .marker::after,.right .marker::after{content:"";width:10px;height:10px;border-radius:50%;background:currentColor}
.wrong .marker .ico{width:13px;height:13px}
.quiz-actions{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:20px}
/* Once the verdict is up, a spent Check button is clutter sitting between the
   question and its answer. */
.quiz-actions.answered{display:none}

/* A row of facts about one thing. Separated by a drawn dot with real space on
   both sides, because a middle dot typed into a sentence inherits the font's
   sidebearings and reads as though the space after it were missing. */
.meta-row{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 10px;
  font-size:13.5px;color:var(--ink-dim);margin:8px 0 0}
.meta-row span{display:flex;align-items:baseline;gap:10px}
.meta-row span+span::before{content:"";width:3px;height:3px;border-radius:50%;
  background:var(--line-strong);align-self:center;flex:0 0 auto}

/* ---------- the verdict ----------
   Shape carries the answer before colour does, exactly as it does on the road:
   right comes back as a direction panel, wrong as a regulatory roundel. */
.verdict{margin-top:22px;border-radius:var(--radius-lg);padding:22px 24px;position:relative;
  animation:arrive .42s cubic-bezier(.16,1,.3,1) both}
.verdict.right{background:var(--sign);color:#fff}
.verdict.right::after{content:"";position:absolute;inset:8px;border:2px solid rgba(255,255,255,.8);
  border-radius:calc(var(--radius-lg) - 3px);pointer-events:none}
/* No card, no border, no ground of its own: the roundel is the sign, at the
   scale the green panel's keyline carries the correct case. A regulatory sign
   stops you by being a red ring, not by being a box with a red badge in it. */
.verdict.wrong{background:transparent;padding:22px 0 0}
.verdict-head{display:flex;gap:22px;align-items:flex-start;position:relative;z-index:1}
.roundel{width:84px;height:84px;border-radius:50%;flex:0 0 auto;display:grid;place-items:center;
  border:11px solid var(--red);color:var(--red);background:transparent;font-size:34px}
.panel-mark{width:46px;height:46px;border-radius:6px;flex:0 0 auto;display:grid;place-items:center;
  background:#fff;color:var(--sign);font-size:22px}
.verdict h3{font-size:19px;letter-spacing:-.025em;margin:0}
.verdict.right h3{color:#fff}
.verdict.wrong h3{color:var(--ink);font-size:23px;margin-top:6px}
.verdict p{margin:7px 0 0;font-size:15px;line-height:1.5}
.verdict.right p{color:var(--on-sign-dim)}
.verdict.wrong p{color:var(--ink-dim)}
.verdict .body{position:relative;z-index:1;min-width:0}
@keyframes arrive{from{opacity:0;transform:translateY(14px) scale(.985)}to{opacity:1;transform:none}}

/* The citation. This is the app's whole credibility argument, so it is set as a
   quotation with the section and page under it, never as a muted footnote. */
.cite{margin:14px 0 0;padding:13px 16px;border-radius:var(--radius);font-size:14.5px;line-height:1.5}
.verdict.right .cite{background:rgba(255,255,255,.14);color:#fff}
.verdict.wrong .cite{background:transparent;color:var(--ink);border-radius:0;
  border-top:1px solid var(--line);padding:15px 0 0}
.verdict.wrong .cite+.cite{margin-top:16px}
.verdict.wrong>.verdict-head>.body{padding-bottom:4px}
.cite cite{display:block;margin-top:7px;font-size:12.5px;font-style:normal;font-weight:700;letter-spacing:.01em}
.verdict.right .cite cite{color:#E3F5E3}   /* 4.95 on the cite's own tinted ground */
.verdict.wrong .cite cite{color:var(--ink-dim)}
.marks{list-style:none;padding:0;margin:12px 0 0;display:grid;gap:6px}
.marks li{display:flex;gap:9px;font-size:14.5px;align-items:baseline}
.marks li .ico{font-size:14px}
.verdict.right .marks li.ok .ico{color:#fff}
.verdict.wrong .marks li.ok .ico{color:var(--sign)}
.verdict.wrong .marks li.no .ico{color:var(--red-ink)}
.verdict.right .marks li.no .ico{color:#FFD2D2}

/* ---------- parked cars ---------- */
.pcar{cursor:pointer}
.pcar .body{transition:fill .12s}
.pcar:hover .body{fill:var(--line-strong)}
.pcar:focus{outline:none}
.pcar:focus .tick{stroke:var(--sign);stroke-width:2.5;stroke-dasharray:3 3}
.pcar.picked .body{fill:var(--sign)}
.pcar.illegal .body{fill:var(--red)}
.pcar.falsehit .body{fill:var(--amber)}
.pcar.legal .body{fill:var(--green);opacity:.5}
.pcar.locked{cursor:default}

/* ---------- the stopping-distance track ---------- */
.track{width:100%;padding:6px 2px 0}
.track-road{position:relative;height:104px;background:var(--ink);border-radius:6px;overflow:hidden}
/* The centre line of the carriageway, drawn as the dashes it actually is. */
.track-road::after{content:"";position:absolute;left:0;right:0;top:30px;height:3px;
  background:repeating-linear-gradient(to right,#fff 0 26px,transparent 26px 46px);opacity:.55}
.track-car{position:absolute;left:8px;top:14px;color:#fff;z-index:2}
.track-cone,.track-truth{position:absolute;top:52px;transform:translateX(-50%);text-align:center;z-index:3}
.track-cone .ico,.track-truth .ico{font-size:17px;display:block;margin:0 auto}
.track-cone{color:var(--amber)}
.track-truth{color:#fff}
.track-truth .stopline{display:block;width:4px;height:26px;background:#fff;margin:0 auto}
.track-cone b,.track-truth b{font-size:12px;white-space:nowrap;font-variant-numeric:tabular-nums;display:block;margin-top:2px}
.track input[type=range]{width:100%;margin:12px 0 0}
.track-ends{display:flex;justify-content:space-between;font-size:12px;color:var(--ink-dim);
  font-variant-numeric:tabular-nums;font-weight:700}

/* ---------- week chart ---------- */
.bars{height:170px;display:flex;align-items:flex-end;gap:10px;border-bottom:1.5px solid var(--line-strong);padding:0 2px}
.barcol{flex:1;background:var(--pale);border-radius:4px 4px 0 0;min-height:4px;position:relative}
.barcol.on{background:var(--sign)}
.barcol b{position:absolute;top:-20px;left:0;right:0;text-align:center;font-size:12px;
  color:var(--ink-dim);font-variant-numeric:tabular-nums;font-weight:700}
.days{display:flex;color:var(--ink-dim);font-size:12px;margin-top:8px;padding:0 2px;font-weight:700}
.days span{flex:1;text-align:center}

/* ---------- tables ---------- */
.table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
.table th,.table td{text-align:left;padding:13px 12px;border-bottom:1px solid var(--line);font-size:14.5px}
.table th{font-size:12.5px;color:var(--ink-dim);font-weight:700;letter-spacing:.01em}
.table td:first-child,.table th:first-child{padding-left:2px}
.table tr:last-child td{border-bottom:0}
.table td.bad{color:var(--red-ink);font-weight:700}

/* ---------- forms ---------- */
.field input{border:1.5px solid var(--line-strong);border-radius:var(--radius);padding:10px 13px;
  background:transparent;color:var(--ink);outline:none;width:280px;max-width:100%}
.field input::placeholder{color:var(--ink-dim)}
.field input:focus{border-color:var(--sign)}
.setting{display:flex;justify-content:space-between;align-items:center;gap:20px;
  padding:18px 2px;border-bottom:1px solid var(--line)}
.setting:last-child{border-bottom:0}
.setting h3{font-size:15.5px;margin:0 0 4px;letter-spacing:-.02em}
.setting p{font-size:13.5px;color:var(--ink-dim);margin:0;max-width:56ch;line-height:1.45}
.toggle{width:46px;height:26px;border-radius:99px;background:transparent;padding:3px;
  border:1.5px solid var(--line-strong);flex:0 0 auto;transition:background .18s,border-color .18s}
.toggle::after{content:"";display:block;width:18px;height:18px;background:var(--line-strong);
  border-radius:50%;transition:transform .22s cubic-bezier(.16,1,.3,1),background .18s}
.toggle.on{background:var(--sign);border-color:var(--sign)}
.toggle.on::after{transform:translateX(20px);background:#fff}

/* ---------- notices ---------- */
.notice{padding:14px 16px;border-radius:var(--radius);background:var(--soft);color:var(--soft-ink);
  font-size:14px;line-height:1.5;display:flex;gap:11px;align-items:flex-start}
.notice .ico{font-size:18px;flex:0 0 auto;margin-top:1px;color:var(--sign)}
.notice a{color:var(--sign)}

/* ---------- milestones ---------- */
.stage{display:flex;gap:15px;padding:18px 2px;border-bottom:1px solid var(--line)}
.stage:last-child{border-bottom:0}
.stage .mark{flex:0 0 28px;height:28px;border-radius:50%;display:grid;place-items:center;font-size:14px;
  border:1.5px solid var(--line-strong);color:var(--ink-dim);background:transparent}
.stage.done .mark{background:var(--sign);color:#fff;border-color:var(--sign)}
.stage h3{font-size:16px;letter-spacing:-.025em}
.stage .real{font-size:13.5px;color:var(--ink-dim);margin:4px 0 0}
.reqs{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:7px}
.reqs li{display:flex;align-items:center;gap:11px;font-size:13px;color:var(--ink-dim);font-variant-numeric:tabular-nums}
.reqs li.ok{color:var(--sign);font-weight:700}
.reqs .wbar{flex:0 0 76px;height:6px;border-radius:99px;background:var(--pale);overflow:hidden}
.reqs .wbar i{display:block;height:100%;background:var(--green)}
.reqs li.ok .wbar i{background:var(--sign)}

/* ---------- weak rules ---------- */
.weak{list-style:none;margin:0;padding:0}
.weak li{display:flex;align-items:center;gap:12px;font-size:14px;padding:11px 2px;border-bottom:1px solid var(--line)}
.weak li:last-child{border-bottom:0}
.weak .wbar{flex:0 0 84px;height:6px;border-radius:99px;background:var(--pale);overflow:hidden}
.weak .wbar i{display:block;height:100%;background:var(--red)}
.weak .wl{flex:1;min-width:0}
.weak .wn{color:var(--ink-dim);font-size:12.5px;white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:700}

/* ---------- rulebook ---------- */
.chapter{display:flex;gap:15px;align-items:center;width:100%;text-align:left;
  padding:16px 6px;background:transparent;border:0;border-bottom:1px solid var(--line);color:inherit}
.chapter:hover{background:var(--pale)}
.chapter .num{flex:0 0 34px;height:34px;border-radius:5px;background:#fff;color:var(--sign);
  box-shadow:inset 0 0 0 1.5px var(--line);
  display:grid;place-items:center;font-weight:700;font-size:14px;font-variant-numeric:tabular-nums}
.chapter:hover .num{box-shadow:inset 0 0 0 1.5px var(--sign)}
.chapter h3{font-size:15.5px;margin:0;letter-spacing:-.025em}
.chapter p{margin:3px 0 0;font-size:13px;color:var(--ink-dim)}
.chapter .dest-chev{margin-left:auto}
.headings{padding:6px 6px 16px 55px;display:grid;gap:1px;border-bottom:1px solid var(--line);background:var(--pale)}
.heading-link{display:flex;justify-content:space-between;gap:16px;padding:9px 12px;
  border-radius:5px;text-decoration:none;color:var(--ink);font-size:14px}
.heading-link:hover{background:#fff;color:var(--sign)}
.heading-link span:last-child{color:var(--ink-dim);font-size:12.5px;white-space:nowrap;
  font-weight:700;font-variant-numeric:tabular-nums}
.heading-link:hover span:last-child{color:var(--sign)}

/* ---------- bookmarks ---------- */
.bookmark{padding:17px 6px;display:flex;gap:15px;align-items:center;border-bottom:1px solid var(--line)}
.bookmark:last-child{border-bottom:0}
.bookmark .ico.mark{font-size:22px;color:var(--sign);flex:0 0 auto}
.bookmark .q{font-weight:700;font-size:15px;letter-spacing:-.02em}
.bookmark .meta{font-size:12.5px;color:var(--ink-dim);margin-top:4px}

/* ---------- results ---------- */
.results{text-align:center;padding:52px 20px;background:var(--sign);color:#fff;
  border-radius:var(--radius-lg);position:relative}
.results::after{content:"";position:absolute;inset:9px;border:2px solid rgba(255,255,255,.85);
  border-radius:calc(var(--radius-lg) - 3px);pointer-events:none}
.results h2{color:#fff;font-size:24px;position:relative;z-index:1}
.results .big{font-size:clamp(64px,11vw,112px);font-weight:700;letter-spacing:-.045em;
  margin:14px 0 2px;font-variant-numeric:tabular-nums;line-height:.9;position:relative;z-index:1}
.results .big span{font-size:26px;color:var(--on-sign-dim);font-weight:700;letter-spacing:-.02em}
.results p{color:var(--on-sign-dim);font-size:16px;position:relative;z-index:1;margin:10px 0 0}
.results .row{display:flex;gap:11px;justify-content:center;margin-top:26px;flex-wrap:wrap;position:relative;z-index:1}
.results .btn{border-color:rgba(255,255,255,.7);color:#fff}
.results .btn:hover{background:rgba(255,255,255,.16);border-color:#fff;color:#fff}
.results .btn.primary{background:#fff;border-color:#fff;color:var(--sign)}
.results .btn.primary:hover{background:var(--green-fg);color:var(--sign)}

/* ---------- misc ---------- */
.empty{text-align:center;padding:56px 20px;color:var(--ink-dim);font-size:15px}
.empty h3{font-size:19px;margin-bottom:9px}
.reader{max-width:70ch}
.footer{color:var(--ink-dim);font-size:13px;margin-top:48px;padding-top:20px;
  border-top:1px solid var(--line);line-height:1.6;max-width:74ch}
.footer a{color:var(--sign)}
.footer em{font-style:italic}
.grid-2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:36px}
.block{min-width:0}
.block h3{font-size:17px;letter-spacing:-.025em}
.block .subtitle{color:var(--ink-dim);font-size:13.5px;margin:5px 0 16px}
.big-figure{font-size:clamp(52px,7vw,76px);font-weight:700;letter-spacing:-.04em;
  font-variant-numeric:tabular-nums;line-height:1;color:var(--sign)}
.big-figure.plain{color:var(--ink)}
/* An em-dash set at 76px reads as a rule someone forgot to remove. An empty
   metric says what it is waiting for, at the size of a sentence. */
.big-figure.waiting{font-size:19px;font-weight:700;letter-spacing:-.02em;color:var(--ink-dim);
  line-height:1.4;max-width:34ch;text-align:left}

/* ---------- adaptation ---------- */
@media(max-width:1080px){
  .rail{width:74px;padding:20px 8px 16px}
  .brand>div:not(.brand-mark),.nav span,.rail-foot{display:none}
  .nav button{justify-content:center;padding:12px 0}
  .nav button .ico{font-size:21px}
  .main{margin-left:74px;width:calc(100% - 74px);padding:20px 24px 64px}
  .grid-2{grid-template-columns:1fr;gap:32px}
  .gantry-grid{grid-template-columns:1fr;align-items:start;gap:22px}
  .readings{justify-items:start;text-align:left;grid-auto-flow:column;gap:28px}
}
@media(max-width:760px){
  /* The rail becomes a bottom sign bar rather than disappearing: hiding it
     outright would leave no way to reach anything but the dashboard. */
  .rail{position:fixed;inset:auto 0 0 0;width:100%;height:auto;flex-direction:row;
    padding:6px 4px calc(6px + env(safe-area-inset-bottom));z-index:30;
    border-right:0;border-top:1px solid var(--line)}
  .brand,.rail-foot{display:none}
  .nav{display:flex;width:100%;gap:2px}
  .nav button{flex:1;flex-direction:column;gap:3px;padding:8px 2px;justify-content:center}
  .nav button .ico{font-size:20px}
  .nav span{display:block;font-size:11px;font-weight:700;letter-spacing:-.01em}
  .main{margin:0;width:100%;padding:16px 18px 96px}
  .gantry{padding:24px 20px}
  .gantry::after{inset:7px}
  .choices{grid-template-columns:1fr}
  .dest{grid-template-columns:30px minmax(0,1fr) auto;gap:14px}
  .dest .streakcol{display:none}
  .dest-chev{display:none}
  .readings{grid-auto-flow:row;gap:14px}
  .field input{width:100%}
  .setting{flex-direction:column;align-items:flex-start;gap:12px}
  .table th:nth-child(3),.table td:nth-child(3){display:none}
}
@media(prefers-reduced-motion:reduce){
  *{transition:none!important;animation:none!important}
}
