:root {
  --concrete: #E9EBE7;
  --surface: #FFFFFF;
  --rack: #1B4F72;
  --rack-deep: #133A55;
  --ink: #1F2328;
  --muted: #5B636B;
  --line: #C9CDC6;
  --tape: #F2C318;
  --tape-soft: #FFF6D1;
  --ok: #1F7A4D;
  --bad: #B3261E;
  --info: #5B636B;
  --btn-text: #FFFFFF;
  --btn-hover: #133A55;
  --radius-sheet: 3px;
  --radius-ctl: 6px;
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --concrete: #161A1D; --surface: #1F2428; --rack: #8CC0E6; --rack-deep: #0F2D44;
    --ink: #E8EAEC; --muted: #A4ACB3; --line: #3A4248; --tape: #F2C318; --tape-soft: #3A3317;
    --ok: #5CC28E; --bad: #FF8A80; --info: #A4ACB3; --btn-text: #0D1B26; --btn-hover: #B5D7F0;
  }
}
:root[data-theme="dark"] {
  --concrete: #161A1D; --surface: #1F2428; --rack: #8CC0E6; --rack-deep: #0F2D44;
  --ink: #E8EAEC; --muted: #A4ACB3; --line: #3A4248; --tape: #F2C318; --tape-soft: #3A3317;
  --ok: #5CC28E; --bad: #FF8A80; --info: #A4ACB3; --btn-text: #0D1B26; --btn-hover: #B5D7F0;
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 16px); }
body {
  margin: 0; background: var(--concrete); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--rack); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--tape); outline-offset: 2px; border-radius: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { font-stretch: 118%; font-weight: 780; font-size: 1.1rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.brand span { color: var(--rack); }
.site-nav { display: flex; gap: 20px; font-size: 0.95rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover { color: var(--rack); text-decoration: underline; }

/* Hero */
.hero { padding: 36px 0 28px; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin: 0 0 14px; }
.crumbs a { color: var(--muted); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line); }
h1 {
  font-stretch: 122%; font-weight: 790; line-height: 1.04; letter-spacing: -0.02em;
  font-size: clamp(2.1rem, 5.2vw, 3.6rem); margin: 0 0 16px; max-width: 18ch;
}
.lede { font-size: 1.15rem; max-width: 62ch; margin: 0 0 22px; color: var(--ink); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  font: inherit; font-weight: 650; font-size: 0.98rem; cursor: pointer;
  border-radius: var(--radius-ctl); padding: 11px 18px; border: 2px solid var(--rack);
  background: var(--rack); color: var(--btn-text); text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { background: var(--btn-hover); border-color: var(--btn-hover); }
.btn.secondary { background: transparent; color: var(--rack); }
.btn.secondary:hover { background: var(--surface); color: var(--rack); border-color: var(--rack); }
.btn.small { padding: 7px 12px; font-size: 0.9rem; }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 40px; align-items: start; padding-bottom: 48px; }
@media (max-width: 920px) { .layout { grid-template-columns: minmax(0, 1fr); } .rail { order: -1; } }
main > section { margin-bottom: 44px; }
h2 { font-stretch: 112%; font-weight: 760; font-size: 1.6rem; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 10px; }
h3 { font-weight: 700; font-size: 1.1rem; margin: 22px 0 6px; }
.section-intro { margin: 0 0 18px; max-width: 64ch; color: var(--muted); }

/* Rail */
.rail { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 16px); }
@media (max-width: 920px) { .rail { position: static; } }
.facts { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sheet); padding: 18px 18px 6px; }
.facts h2 { font-size: 1.05rem; font-stretch: 100%; margin-bottom: 8px; }
.facts dl { margin: 0; }
.facts dt { font-size: 0.85rem; color: var(--muted); }
.facts dd { margin: 0 0 12px; font-weight: 650; }
.facts dd small { display: block; font-weight: 400; color: var(--muted); font-size: 0.82rem; }
.toc { margin-top: 18px; padding-left: 4px; }
.toc h2 { font-size: 1.05rem; font-stretch: 100%; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 4px 12px; color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.toc li a:hover { color: var(--rack); border-left: 2px solid var(--rack); margin-left: -2px; }
@media (max-width: 920px) { .toc { display: none; } }

/* Template sheet */
.sheet { min-width: 0; overflow-wrap: anywhere;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sheet);
  padding: 28px clamp(18px, 4vw, 40px) 30px; position: relative;
}
.sheet-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 18px; }
.sheet-bar p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.jd h3:first-child { margin-top: 0; }
.jd p, .jd li { max-width: 68ch; }
.jd ul { padding-left: 1.2em; margin: 0 0 6px; }
.jd li { margin-bottom: 4px; }
.ph { background: var(--tape-soft); border-radius: 2px; padding: 0 3px; overflow-wrap: anywhere; }
.copied-note { font-size: 0.9rem; color: var(--ok); min-height: 1.2em; margin: 0; }

/* Pay table */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sheet); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { font-size: 0.88rem; color: var(--muted); font-weight: 600; background: var(--surface); }
td.num, th.num { text-align: right; }
tr.on td { background: var(--tape-soft); font-weight: 650; }
tr.on td:first-child { box-shadow: inset 4px 0 0 var(--tape); }
tbody tr:last-child td { border-bottom: 0; }
.fine { font-size: 0.88rem; color: var(--muted); margin: 10px 0 0; max-width: 70ch; }

/* Builder: the one bold element, framed like floor-marking tape */
.builder {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sheet);
  border-top: 10px solid var(--tape); padding: 24px clamp(16px, 3.5vw, 32px) 28px;
}
.builder-grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 28px; }
@media (max-width: 760px) { .builder-grid { grid-template-columns: minmax(0, 1fr); } }
fieldset { border: 0; margin: 0 0 16px; padding: 0; }
legend, .label { font-weight: 650; font-size: 0.95rem; margin-bottom: 6px; display: block; padding: 0; }
.field { margin-bottom: 16px; }
input[type="text"], input[type="number"], select, textarea {
  font: inherit; font-size: 0.98rem; width: 100%; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-ctl); padding: 9px 11px;
}
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--tape); outline-offset: 0; border-color: var(--rack); }
.pay-row { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 8px; }
.pay-row label { font-size: 0.85rem; color: var(--muted); display: block; margin-bottom: 3px; }
.choice { display: flex; gap: 8px; flex-wrap: wrap; }
.choice label {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: var(--radius-ctl);
  padding: 7px 12px; cursor: pointer; font-size: 0.95rem; background: var(--surface);
}
.choice input { accent-color: var(--rack); margin: 0; }
.choice label:has(input:checked) { border-color: var(--rack); box-shadow: inset 0 0 0 1px var(--rack); }
.hint { font-size: 0.86rem; color: var(--muted); margin: 6px 0 0; }

.checks { list-style: none; margin: 0 0 16px; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-ctl); }
.checks li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 0.94rem; line-height: 1.45; }
.checks li:last-child { border-bottom: 0; }
.mark { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 0.75rem; font-weight: 800; color: #fff; margin-top: 1px; }
.mark.ok { background: var(--ok); }
.mark.bad { background: var(--bad); }
.mark.info { background: var(--info); }
.checks strong { font-weight: 650; }
.checks .why { display: block; color: var(--muted); font-size: 0.86rem; }
.scope-note { background: var(--tape-soft); border-radius: var(--radius-ctl); padding: 10px 12px; font-size: 0.9rem; margin: 0 0 14px; }
.output-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.output-head .label { margin: 0; }
#posting {
  white-space: pre-wrap; font-family: var(--font); font-size: 0.93rem; line-height: 1.55;
  background: var(--concrete); border: 1px solid var(--line); border-radius: var(--radius-ctl);
  padding: 14px 16px; margin: 0; max-height: 460px; overflow: auto;
}

/* Checklist (a real sequence, so it is numbered) */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 52px; max-width: 70ch; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--rack); color: var(--rack); font-weight: 750; display: grid; place-items: center; font-size: 0.95rem;
}
.steps li::after { content: ""; position: absolute; left: 17px; top: 38px; bottom: 4px; width: 2px; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps strong { display: block; font-weight: 700; }
.steps span { color: var(--muted); }

/* CTA */
.cta { background: var(--rack-deep); color: #fff; border-radius: var(--radius-sheet); padding: 28px clamp(18px, 4vw, 36px); display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center; }
.cta h2 { color: #fff; margin-bottom: 6px; }
.cta p { margin: 0; max-width: 56ch; color: #D9E4EC; }
.cta .btn { background: var(--tape); border-color: var(--tape); color: #1F2328; }
.cta .btn:hover { background: #FFD84A; border-color: #FFD84A; color: #1F2328; }
@media (max-width: 680px) { .cta { grid-template-columns: minmax(0, 1fr); } }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sheet); margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 650; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-weight: 700; color: var(--rack); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 16px 14px; max-width: 70ch; }
.faq details > div p { margin: 0 0 8px; }

.related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.related a { display: inline-block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-ctl); padding: 8px 14px; text-decoration: none; color: var(--ink); }
.related a:hover { border-color: var(--rack); color: var(--rack); }

.review { border-top: 1px solid var(--line); padding-top: 18px; font-size: 0.92rem; color: var(--muted); }
.review p { margin: 0 0 8px; max-width: 72ch; }
.review ul { margin: 0 0 10px; padding-left: 1.2em; }
.placeholder-box { border: 2px dashed var(--tape); border-radius: var(--radius-ctl); padding: 8px 12px; color: var(--ink); display: inline-block; margin-bottom: 10px; }

.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 22px 0; font-size: 0.9rem; color: var(--muted); }
.site-footer .wrap { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }
.free-tag { font-weight: 500; opacity: .8; }

/* Registration gate for the PDF */
dialog.gate {
  border: 0; border-top: 10px solid var(--tape); border-radius: var(--radius-sheet);
  padding: 0; width: min(460px, calc(100% - 32px)); max-height: calc(100% - 32px);
  background: var(--surface); color: var(--ink); box-shadow: 0 24px 60px rgba(10, 20, 30, .35);
}
dialog.gate::backdrop { background: rgba(14, 24, 32, .6); }
.gate-inner { padding: 24px 26px 22px; }
.gate h2 { font-size: 1.45rem; margin-bottom: 6px; }
.gate .sub { color: var(--muted); margin: 0 0 18px; font-size: 0.95rem; }
.gate .gets { margin: 0 0 18px; padding-left: 1.1em; font-size: 0.93rem; }
.gate .gets li { margin-bottom: 3px; }
.gate .field { margin-bottom: 12px; }
.gate .err { color: var(--bad); font-size: 0.85rem; margin: 4px 0 0; min-height: 0; }
.gate input[aria-invalid="true"], .gate select[aria-invalid="true"] { border-color: var(--bad); }
.consent { display: grid; grid-template-columns: 20px 1fr; gap: 8px; font-size: 0.88rem; line-height: 1.45; margin: 6px 0 14px; }
.consent input { margin-top: 3px; accent-color: var(--rack); }
.legal { font-size: 0.8rem; color: var(--muted); margin: 10px 0 0; }
.gate-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.gate-actions .btn { flex: 1 1 auto; justify-content: center; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--rack); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.gate-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.gate-close:hover { background: var(--concrete); color: var(--ink); }
.gate-done { text-align: left; }
.gate-done p { margin: 0 0 14px; }
.signed-in { font-size: 0.86rem; color: var(--muted); margin: 6px 0 0; }


.regions { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sheet); }
.regions summary { cursor: pointer; padding: 12px 16px; font-weight: 650; }
.regions .table-wrap { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.below-min { color: var(--bad); }
.home-hero { padding: 40px 0 24px; }
.search { max-width: 520px; margin: 0 0 8px; }
.cat { margin-bottom: 36px; }
.cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.cards a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sheet); padding: 14px 16px; text-decoration: none; color: var(--ink); height: 100%; }
.cards a:hover { border-color: var(--rack); }
.cards strong { display: block; font-size: 1.05rem; }
.cards span { color: var(--muted); font-size: 0.9rem; }
.empty { color: var(--muted); }

.title-list { list-style: none; padding: 0; margin: 0 0 6px; columns: 3 200px; column-gap: 24px; }
.title-list li { break-inside: avoid; padding: 3px 0; font-size: 0.95rem; }
.title-list.more { padding: 12px 16px; border-top: 1px solid var(--line); margin: 0; }
.excl { padding-left: 1.2em; margin: 0; }
.excl li { margin-bottom: 6px; max-width: 72ch; }
.cta .cta-link { color: var(--tape); }
.noc-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.noc-list a { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sheet); padding: 10px 14px; text-decoration: none; color: var(--ink); height: 100%; }
.noc-list a:hover { border-color: var(--rack); }
.noc-list b { color: var(--rack); font-variant-numeric: tabular-nums; margin-right: 6px; }

@media print { .site-header, .rail, .builder, .cta, .related, .site-footer, .actions { display: none; } body { background: #fff; } }

/* Additions: skip link, footer links, hubs, legal pages */
.skip { position: absolute; left: -9999px; top: 0; background: var(--rack); color: #fff; padding: 10px 16px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
.site-footer .footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer .footer-links a { color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cat-h { font-size: 1.05rem; margin: 18px 0 8px; }
.examples { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.examples > li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sheet); padding: 16px 18px; }
.examples h3 { font-size: 1.1rem; margin: 0 0 4px; }
.examples .meta { color: var(--muted); font-size: 0.88rem; margin: 0 0 8px; }
.examples p { margin: 0 0 8px; font-size: 0.95rem; }
.examples .duty-label { font-weight: 650; margin-bottom: 2px; }
.examples ul { margin: 0; padding-left: 1.1em; font-size: 0.92rem; }
.legal-page { max-width: 72ch; padding-bottom: 36px; }
.legal-page h2 { font-size: 1.25rem; margin: 24px 0 8px; }
.draft-box { border: 2px dashed var(--tape); border-radius: var(--radius-ctl); padding: 10px 14px; background: var(--tape-soft); color: #1F2328; }
