* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: #f4f6f8; color: #1c2733; line-height: 1.45; }
a { color: #0b5cad; text-decoration: none; }
a:hover { text-decoration: underline; }
/* In-text links are underlined, not distinguished by colour alone
   (Lighthouse link-in-text-block fault, Fix Run 4, Dec 2026). Card and
   button links keep their own treatment — their boxes set them apart. */
main a:not(.state-card):not(.sec-card):not(.btn) { text-decoration: underline; }
header.site { background: #0b3d6e; padding: 10px 16px; display: flex; align-items: center; justify-content: center; gap: 10px 26px; flex-wrap: wrap; }
header.site .wrap { display: flex; align-items: center; }
header.site .logo img { height: 54px; width: auto; display: block; background: #fff; border-radius: 10px; padding: 5px 10px; object-fit: contain; }
nav.main { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
nav.main a { color: #cfe2f2; font-size: 15px; font-weight: 600; }
nav.main a:hover { color: #fff; }
/* Compact phone header (Layout Fix Run 1, FPT-UI-015 / Claude): the
   header used to take ~157px on a phone (logo row + three wrapped nav
   rows). Smaller logo, tighter nav, all seven links still reachable. */
@media (max-width: 640px) {
  header.site { padding: 6px 10px; gap: 4px 12px; }
  header.site .logo img { height: 38px; padding: 3px 7px; border-radius: 8px; }
  nav.main { gap: 2px 11px; justify-content: center; }
  nav.main a { font-size: 13.5px; padding: 3px 0; }
}
@media (max-width: 400px) {
  header.site { padding: 5px 8px; gap: 3px 8px; }
  header.site .logo img { height: 34px; padding: 2px 6px; }
  nav.main { gap: 1px 8px; }
  nav.main a { font-size: 13px; padding: 2px 0; }
}
main { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }
h1 { font-size: 26px; margin-bottom: 8px; }
h2 { font-size: 20px; margin: 22px 0 10px; }
h3 { font-size: 16px; margin: 16px 0 6px; }
h2[id], h3[id] { scroll-margin-top: 14px; }
p { margin-bottom: 10px; }
ul, ol { margin: 0 0 12px 22px; }
li { margin-bottom: 6px; }
.sub { color: #44586c; margin-bottom: 16px; }
.hero { background: #0b3d6e; color: #fff; border-radius: 12px; padding: 26px 22px; margin-bottom: 18px; }
/* Homepage H1 matches the inner pages' 26px (Layout Fix Run 1, Claude). */
.hero h1 { font-size: 26px; margin-bottom: 8px; }
.hero p { color: #d7e6f5; margin-bottom: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { background: #12548f; border: 1px solid #2f6dab; color: #fff; border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 700; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.state-card { background: #fff; border: 1px solid #d7dee5; border-radius: 10px; padding: 12px; display: block; color: #1c2733; }
.state-card:hover { border-color: #0b5cad; text-decoration: none; }
.state-card .nm { font-weight: 700; font-size: 15px; }
/* Small grey helper text darkened one step (Layout Fix Run 1, Claude):
   #5a6d80 -> #44586c on card descriptions and other small grey words. */
.state-card .ct { font-size: 12px; color: #44586c; margin-top: 2px; }
/* A "soon" card used to be dimmed with opacity, but the DC card is now a
   real link (Fix Run 4) and opacity washed its text below contrast
   minimums — the muted label colour alone carries the "not ready" cue. */
.state-card.soon .ct { color: #44586c; }
.sec-card { background: #fff; border: 1px solid #d7dee5; border-radius: 10px; padding: 16px; display: block; color: #1c2733; }
.sec-card:hover { border-color: #0b5cad; text-decoration: none; }
.sec-card .t { font-weight: 800; font-size: 17px; margin-bottom: 4px; }
.sec-card .d { font-size: 13px; color: #44586c; }
.sec-card .links { font-size: 13px; margin-top: 8px; }
.test-card { background: #fff; border: 1px solid #d7dee5; border-radius: 10px; padding: 16px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.test-card .t { font-weight: 700; font-size: 17px; }
.test-card .d { font-size: 13px; color: #44586c; margin-top: 2px; }
.btn { background: #0b5cad; color: #fff; border: 0; border-radius: 8px; padding: 10px 18px; font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap; display: inline-block; }
.btn:hover { background: #094e8f; text-decoration: none; }
.btn.ghost { background: #e8eef4; color: #0b3d6e; }
.btn:disabled { opacity: .5; cursor: default; }
/* Quiz progress made a step stronger (Layout Fix Run 1, FPT-UI-012):
   taller bar, bolder "Question X of N" line. */
.progressbar { height: 12px; background: #dde5ec; border-radius: 6px; overflow: hidden; margin: 10px 0 4px; }
.progressbar i { display: block; height: 100%; background: #0b5cad; width: 0; }
.meta { font-size: 14px; color: #44586c; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.meta #qnum { font-weight: 800; color: #1c2733; }
.meta #score { font-weight: 700; }
.meta .timer { font-weight: 800; color: #b3541e; font-size: 15px; }
.qcard { background: #fff; border: 1px solid #d7dee5; border-radius: 12px; padding: 20px; margin-top: 12px; }
.qtext { font-size: 19px; font-weight: 600; margin-bottom: 14px; }
.signbox { border: 2px dashed #b3541e; background: #fff7ef; border-radius: 10px; padding: 12px 14px; font-size: 15px; margin-bottom: 14px; }
.signbox b { color: #b3541e; }
.choice { display: block; width: 100%; text-align: left; background: #f7fafc; border: 2px solid #d7dee5; border-radius: 10px; padding: 12px 14px; font-size: 16px; margin-bottom: 10px; cursor: pointer; }
.choice:hover { border-color: #0b5cad; }
.choice.right { border-color: #1e8e3e; background: #e6f4ea; }
.choice.wrong { border-color: #c5221f; background: #fce8e6; }
/* Simulator pick gets a stronger mark (Layout Fix Run 1, Claude):
   filled tint, an extra inset ring and a tick. */
.choice.sel { border-color: #0b5cad; background: #cfe0f2; box-shadow: inset 0 0 0 2px #0b5cad; }
.choice.sel::after { content: "✓"; float: right; font-weight: 800; color: #0b5cad; }
/* Locked answers stay readable (Layout Fix Run 1, FPT-UI-006): a
   disabled button's words keep the full dark colour — the browser's
   greyed-out disabled text was washing out the right answer and the
   learner's own pick. Only the un-picked, un-right choices fade, via
   the .dim class below. */
.choice:disabled { color: #1c2733; opacity: 1; cursor: default; }
.choice.dim { opacity: .55; }
/* The explanation sits in its own clear box (Layout Fix Run 1,
   FPT-UI-013) instead of a paragraph under a hairline. */
.explain { display: none; background: #f6f9fb; border: 1px solid #d7dee5; border-radius: 10px; margin-top: 12px; padding: 14px 16px; font-size: 15px; }
.explain .verdict { font-weight: 800; margin-bottom: 6px; }
.explain .src { font-size: 12px; color: #44586c; margin-top: 8px; }
.qfoot { margin-top: 16px; display: flex; justify-content: flex-end; }
.result { text-align: center; padding: 28px 16px; }
.result .score { font-size: 44px; font-weight: 800; }
.result .pass { color: #1e8e3e; }
.result .fail { color: #c5221f; }
/* Score breakdown line on the results screen (Layout Fix Run 1,
   FPT-UI-014): right / wrong / score, plainly at the top. */
.scorebreak { font-size: 16px; margin-bottom: 8px; }
.review { text-align: left; margin-top: 18px; }
/* Each reviewed question in its own card (Layout Fix Run 1, FPT-UI-008). */
.review .item { background: #fff; border: 1px solid #d7dee5; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; font-size: 15px; }
.review .item .qq { font-weight: 700; margin-bottom: 4px; }
.review .ok { color: #1e8e3e; font-weight: 700; }
.review .bad { color: #c5221f; font-weight: 700; }
.review .ca { color: #1e8e3e; font-weight: 700; }
.review .src { font-size: 12px; color: #44586c; margin-top: 4px; }
.revfilter { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 14px; }
.revfilter .btn.on { background: #0b5cad; color: #fff; }
footer.site { border-top: 1px solid #d7dee5; padding: 16px; text-align: center; font-size: 12px; color: #5a6d80; }
footer.site .flinks { margin-bottom: 8px; font-size: 13px; }
footer.site .flinks a { margin: 0 7px; display: inline-block; padding: 6px 3px; }
.note { background: #fff8e1; border: 1px solid #f0d48a; border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px; }
.state-banner { background: #eef4fb; border: 1px solid #b9d2ea; border-radius: 10px; padding: 10px 14px; font-size: 15px; margin-bottom: 14px; }
/* Topic test start card (Layout Fix Run 1, FPT-UI-016): state line,
   change link, words and start button together in one tidy card. */
.topic-start { margin-top: 4px; }
.topic-start .state-banner { margin-bottom: 10px; }
.topic-start p:last-child { margin-bottom: 0; }
.factbox { background: #eef4fa; border: 1px solid #c9dcee; border-radius: 10px; padding: 14px 16px; margin-bottom: 16px; font-size: 15px; }
.factbox div { margin-bottom: 4px; }
table.data { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #d7dee5; border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
table.data th, table.data td { text-align: left; padding: 9px 12px; font-size: 14px; border-bottom: 1px solid #e3eaf0; }
table.data th { background: #eef4fa; }
table.data tr:last-child td { border-bottom: 0; }
details.state-topics { background: #fff; border: 1px solid #d7dee5; border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
details.state-topics summary { font-weight: 700; font-size: 16px; cursor: pointer; }
details.state-topics .topics { margin-top: 10px; font-size: 14px; columns: 2; }
details.state-topics .topics div { margin-bottom: 4px; break-inside: avoid; }
.qlist .qitem { background: #fff; border: 1px solid #d7dee5; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.qlist .qitem .qq { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.qlist .qitem .choices { font-size: 14px; color: #44586c; margin: 0 0 8px 18px; }
.qlist .qitem .ans { display: none; border-top: 1px solid #e3eaf0; padding-top: 8px; font-size: 14px; }
.qlist .qitem .ans .ca { color: #1e8e3e; font-weight: 700; }
.qlist .qitem .ans .src { font-size: 12px; color: #44586c; margin-top: 4px; }
/* "Show answer" buttons at least 44px tall (Layout Fix Run 1, Claude). */
button.reveal { background: #e8eef4; color: #0b3d6e; border: 0; border-radius: 7px; padding: 10px 16px; min-height: 44px; font-size: 13px; font-weight: 700; cursor: pointer; }
.signcard { background: #fff; border: 1px solid #d7dee5; border-radius: 10px; padding: 14px 16px; margin-bottom: 10px; }
.signcard .ans { display: none; border-top: 1px solid #e3eaf0; padding-top: 8px; margin-top: 8px; font-size: 14px; }
.signcard .ans .ca { color: #1e8e3e; font-weight: 700; }
/* Compact sign-card grid (Layout Fix Run 1, FPT-UI-004): the study
   sign cards sit 3 across on desktop, 2 on tablets, 1 on phones,
   instead of one full-width card per row. */
.signgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 10px; align-items: start; }
.signgrid .signcard { margin-bottom: 0; }
@media (max-width: 900px) { .signgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .signgrid { grid-template-columns: 1fr; } }
/* Jump-link chips at the top of long grouped pages (Layout Fix Run 1,
   FPT-UI-004 / FPT-UI-005): topic or category name + count, one tap to
   that section. */
.jumpnav { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 16px; }
.jumpnav a { background: #e8eef4; color: #0b3d6e; border-radius: 999px; padding: 9px 14px; font-size: 13.5px; font-weight: 700; }
.jumpnav a:hover { background: #d7e5f2; text-decoration: none; }
/* Back to Top control on the long questions pages (FPT-UI-005). */
.totop { position: fixed; right: 14px; bottom: 14px; z-index: 20; background: #0b5cad; color: #fff; border-radius: 999px; padding: 11px 16px; font-size: 14px; font-weight: 700; box-shadow: 0 2px 8px rgba(11, 61, 110, .35); }
.totop:hover { background: #094e8f; text-decoration: none; }
input.vin { width: 100%; max-width: 420px; font-size: 18px; letter-spacing: 1px; padding: 12px 14px; border: 2px solid #d7dee5; border-radius: 10px; text-transform: uppercase; }
.vinrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.crumbs { font-size: 13px; color: #44586c; margin-bottom: 12px; }
@media (max-width: 560px) {
  .qtext { font-size: 17px; }
  details.state-topics .topics { columns: 1; }
  .test-card { flex-direction: column; align-items: stretch; }
  .test-card .btn { text-align: center; }
  /* Next button bigger and full width on phones (FPT-UI-007). */
  .qfoot { justify-content: stretch; }
  .qfoot .btn { width: 100%; padding: 15px 18px; font-size: 16px; text-align: center; }
}
.state-head { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin: 22px 0 10px; }
.state-head h2 { margin: 0; }
#state-search { flex: 0 1 280px; min-width: 190px; padding: 9px 13px; font-size: 16px; border: 1.5px solid #b9c7d3; border-radius: 8px; background: #fff; color: #1c2733; }
#state-search:focus { outline: 2px solid #0b5cad; border-color: #0b5cad; }
/* Sign pictures keep their true shape (Layout Fix Run 1, Claude):
   object-fit contains the picture inside its fixed-height slot, so a
   wide sign is letterboxed, never squeezed. */
.sign-img { display: block; height: 120px; max-width: 100%; margin: 0 auto 10px; object-fit: contain; }
.signbox .sign-img { height: 130px; margin-bottom: 8px; }
.meanings { margin: 6px 0 4px; }
.mband { border: 1px solid #d5dee7; border-radius: 12px; overflow: hidden; margin-bottom: 14px; background: #fff; }
.mband h3 { margin: 0; padding: 9px 14px; font-size: 16px; color: #fff; display: flex; justify-content: space-between; gap: 6px 14px; flex-wrap: wrap; align-items: baseline; }
.mband h3 .tag { font-weight: 400; font-size: 13px; }
.mband.reg h3 { background: #b3271e; }
.mband.warn h3 { background: #e8ae00; color: #241d00; }
.mband.guide h3 { background: #0a7a43; }
.mband.info h3 { background: #0b5cad; }
.mrow { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px 10px; padding: 12px 14px; }
.mcell { text-align: center; }
.mcell img { height: 84px; max-width: 100%; object-fit: contain; }
.mname { font-weight: 700; font-size: 12.5px; margin-top: 6px; }
.mcap { font-size: 12px; color: #44586c; }
.remember { background: #0b3d6e; color: #fff; border-radius: 12px; padding: 12px 16px; font-size: 14px; text-align: center; margin-bottom: 22px; }
.mbody { display: grid; grid-template-columns: 1fr 300px; }
.mdef { padding: 12px 14px; font-size: 13.5px; line-height: 1.55; color: #33475c; background: #f6f9fb; border-left: 1px solid #e1e9f0; }
@media (max-width: 860px) {
  .mbody { grid-template-columns: 1fr; }
  .mdef { border-left: none; border-top: 1px solid #e1e9f0; }
}
.sgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px 10px; margin: 10px 0 24px; }
.scell { text-align: center; }
.scell .mcode { font-size: 10px; color: #5a6d80; letter-spacing: .05em; margin-top: 1px; }
.scell img { height: 92px; max-width: 100%; object-fit: contain; }
.scell .noimg { height: 92px; border: 1.5px dashed #b9c8d4; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 11px; line-height: 1.35; color: #5a6d80; padding: 6px; overflow: hidden; }
@media (max-width: 1000px) { .sgrid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px) { .sgrid { grid-template-columns: repeat(3, 1fr); } .scell img, .scell .noimg { height: 76px; } }
@media (max-width: 420px) { .sgrid { grid-template-columns: repeat(2, 1fr); } }

/* Road-signs page top layout (Ricky, 16 Nov 2026): meanings chart on the
   left, the 4 category cards in ONE vertical column on the right. */
.signs-top { display: grid; grid-template-columns: 1fr 248px; gap: 16px; align-items: start; }
.signs-top .mbody { grid-template-columns: 1fr 225px; }
.side-cards { display: grid; gap: 12px; }
@media (max-width: 860px) {
  .signs-top { grid-template-columns: 1fr; }
  .signs-top .mbody { grid-template-columns: 1fr; }
  .side-cards { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 560px) { .side-cards { grid-template-columns: 1fr; } }

/* Sitemap page (/sitemap/): a plain directory of every page on the site —
   grouped link lists, nothing decorative. */
ul.smap { list-style: none; margin-left: 0; columns: 2; column-gap: 36px; }
ul.smap li { break-inside: avoid; }
@media (max-width: 640px) { ul.smap { columns: 1; } }

/* Sitemap States section (owner's pick, Dec 3, 2026): OPEN state cards in
   a grid — 4 across on desktop (>=1024px), 2 on tablet, 1 on phones —
   under a sticky A–Z jump bar. Every link in a card is visible at once.
   Card link text is 0.8em of body size with tight line spacing (1.15)
   and no gaps between lines, so cards stay short and dense; the links
   keep 5px of vertical padding each, so one line's tap box is ~25px
   tall — compact, but never under the 24px target-size floor. No fixed
   card heights — a tall card never clips its links. */
.azbar { position: sticky; top: 0; z-index: 5; background: #f4f6f8; display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 0; margin-bottom: 14px; font-weight: 700; }
.azbar a, .azbar span { min-width: 30px; text-align: center; padding: 4px 6px; border-radius: 6px; }
.azbar span.off { color: #9db0c0; font-weight: 400; }
.smap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.smap-card { background: #fff; border: 1px solid #d7dee5; border-radius: 10px; padding: 10px 12px; scroll-margin-top: 64px; }
.smap-card h3 { font-size: 15px; margin: 0 0 2px; }
.smap-card .scard-tlabel { font-size: 12px; font-weight: 700; color: #44586c; text-transform: uppercase; letter-spacing: .04em; margin: 6px 0 0; }
/* Owner tweak (Dec 3, 2026, after seeing the live cards): text one
   step smaller and lines tighter than the first build — 0.8em font,
   1.15 line-height — with the padding set so each link's tap box
   stays at ~25px tall (never under the 24px target-size floor). */
ul.scard-links { list-style: none; margin: 0; font-size: .8em; line-height: 1.15; }
ul.scard-links li { margin-bottom: 0; }
ul.scard-links a { display: block; padding: 5px 0; }
@media (max-width: 1023px) { .smap-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 767px) { .smap-grid { grid-template-columns: 1fr; } }
