/* Imperious PermitLab — Proposed Demonstration for the Ohio Turnpike and Infrastructure Commission.
   Designed and proposed by Imperious Enterprise LLC. Fictional demonstration policy and synthetic data.
   Not Commission-approved permitting rules.

   Design system: DESIGN.md at the repository root, which records the ohioturnpike.org research this
   palette is anchored in. Original visual language: a guide-sign plate assembly (plate + exit tab), a
   route line in place of a step row, shape-coded status, and a pavement skip-stripe used once as the
   header edge. No Commission logo, seal, photograph or other protected artwork is reproduced.
   Local stylesheet and locally hosted fonts only: no remote font, script or image request. */

/* --- Typefaces, self-hosted ------------------------------------------------------------------------------
   Overpass (SIL OFL 1.1, The Overpass Project Authors) — derived from highway signage lettering; carries
   every plate legend, heading, tab and numeral. Licence: fonts/Overpass-OFL.txt
   Public Sans (SIL OFL 1.1) — body copy and tabular data. Licence: fonts/PublicSans-OFL.txt */
@font-face {
  font-family: "Overpass";
  src: url("fonts/Overpass-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/PublicSans-Regular.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/PublicSans-Medium.woff2") format("woff2");
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Public Sans";
  src: url("fonts/PublicSans-SemiBold.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}

:root {
  /* Sign green — an original ramp anchored on the green the Commission's own site serves (#00874d /
     #007236, read from its stylesheet). Identity, the governing policy, controlled success. */
  --green-900: #06281a;
  --green-800: #0a3d28;
  --green-700: #005c35;  /* text and links on white — 8.1:1 */
  --green-600: #00743d;  /* plate shade — white text 5.97:1 */
  --green-500: #00874d;  /* the sign green — plate fill, white text 4.59:1 */
  --green-400: #1ea866;  /* accents on dark grounds */
  --green-200: #a9dcc2;  /* keylines and muted text on green — 10.3:1 on green-900 */
  --green-150: #e8f2ed;  /* text on a green plate — 5.2:1 on green-600 */
  --green-100: #ddf0e6;
  --green-050: #f0f8f3;

  /* Slate — the second structural colour. Wayfinding chrome: navigation band, table heads, data
     surfaces. Keeps green for identity and state instead of spending it on furniture. */
  --slate-900: #0b2130;
  --slate-800: #112c3d;
  --slate-700: #16425a;  /* nav band, table heads — white text 10.7:1 */
  --slate-600: #2b5c77;
  --slate-400: #7d97a5;  /* muted text on dark — 5.4:1 on slate-900 */
  --slate-200: #c9d7df;
  --slate-100: #e4ecf1;
  --slate-050: #f4f7f9;

  /* Neutrals */
  --ink: #10181c;
  --ink-muted: #4a5b64;  /* 7.0:1 on white, 6.4:1 on slate-050 */
  --rule: #d7e0e6;
  --rule-strong: #a9b9c2;
  --surface: #ffffff;
  --sunken: var(--slate-050);
  --paper: #eef3f6;

  /* Status — warning amber and regulatory red, each always paired with a shape and a word */
  --amber-500: #f0b323;
  --amber-text: #6d4400;
  --amber-bg: #fdf1d6;
  --amber-line: #a06a00;
  --red-600: #a4192c;    /* plate fill — white text 7.6:1 */
  --red-text: #97111b;
  --red-bg: #fdecec;
  --red-line: #b3321f;

  /* High-visibility focus, the one place safety yellow is used */
  --focus: #a85600;
  --focus-dark: #f5b000;

  /* Legacy aliases kept so every template token resolves */
  --bg: var(--surface);
  --text: var(--ink);
  --muted: var(--ink-muted);
  --border: var(--rule);
  --soft: var(--sunken);
  --link: var(--green-700);
  --accent: var(--green-700);
  --accent-text: #ffffff;
  --ok-bg: var(--green-100);
  --ok-text: var(--green-700);
  --warn-bg: var(--amber-bg);
  --warn-text: var(--amber-text);
  --err-bg: var(--red-bg);
  --err-text: var(--red-text);

  /* Spacing: 4px base, no arbitrary values */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px; --s12: 48px; --s16: 64px;

  --display: "Overpass", "Public Sans", "Segoe UI", system-ui, sans-serif;
  --font: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --measure: 68ch;
  --gutter: var(--s4);
  --shell: 1200px;

  /* The guide-sign plate: outer green margin, then the white keyline, then the field. */
  --keyline: inset 0 0 0 3px var(--green-600), inset 0 0 0 4px rgba(255, 255, 255, 0.95);
}

* { box-sizing: border-box; }
html { font-size: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--green-700); text-underline-offset: 0.15em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 20;
  background: var(--green-700); color: #fff;
  font-family: var(--display); font-weight: 600;
  padding: var(--s3) var(--s4); text-decoration: none;
}
.skip-link:focus { left: 0; }

/* --- Masthead -------------------------------------------------------------------------------------------
   The header is a sign assembly on a post: deep green masthead, warning band, slate wayfinding gantry,
   closed by a pavement skip-stripe. */
.site-header { position: relative; background: var(--surface); }

/* Pavement edge: a lane skip stripe — short dash, long gap — used once in the whole system. */
.site-header::after {
  content: ""; display: block; height: 6px;
  background-color: var(--green-900);
  background-image: repeating-linear-gradient(to right,
    var(--green-200) 0 18px, transparent 18px 66px);
}

.identity-bar { background: var(--green-900); color: #fff; }
.identity-bar a { color: #fff; }
.identity-bar :focus-visible { outline-color: var(--focus-dark); }

.bar-inner {
  max-width: var(--shell); margin: 0 auto; padding: var(--s4) var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s6);
}

.brand-block { margin: 0; display: flex; align-items: center; gap: var(--s4); }
.brand {
  font-family: var(--display); font-weight: 700; font-size: 1.25rem;
  letter-spacing: -0.01em; text-decoration: none;
}
.brand:hover { text-decoration: underline; text-decoration-thickness: 2px; }

/* The mark: an original guide-sign plate — green field, white keyline inset from the edge. */
.mark {
  display: grid; place-items: center;
  width: 52px; height: 38px; flex: 0 0 auto;
  background: var(--green-500);
  border-radius: 5px;
  box-shadow: inset 0 0 0 3px var(--green-500), inset 0 0 0 4.5px #fff;
  color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 0.9375rem; letter-spacing: 0.08em;
  text-indent: 0.08em;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; gap: 2px; }
.brand-sub {
  font-family: var(--display); font-weight: 600;
  font-size: 0.6875rem; color: var(--green-200);
  letter-spacing: 0.1em; text-transform: uppercase;
}

.proposal-label {
  margin: 0 0 0 auto; max-width: 44ch;
  font-size: 0.75rem; line-height: 1.4; color: var(--green-200);
  text-align: right;
}
.proposal-label strong { color: #fff; font-weight: 500; }

/* --- Demonstration warning band -------------------------------------------------------------------------
   Styled as a roadway warning advisory: amber field, dark legend, diamond marker. */
.demo-banner {
  background: var(--amber-bg);
  color: var(--amber-text);
  border-top: 2px solid var(--amber-line);
  border-bottom: 2px solid var(--amber-line);
  font-size: 0.8125rem; line-height: 1.45;
}
.demo-banner .banner-inner {
  max-width: var(--shell); margin: 0 auto; padding: var(--s2) var(--gutter);
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3);
}
.demo-banner .banner-inner::before {
  content: "!"; flex: 0 0 auto;
  display: grid; place-items: center;
  width: 20px; height: 20px;
  background: var(--amber-500); color: #231700;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.55);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  font-family: var(--display); font-weight: 800; font-size: 0.75rem; line-height: 1;
}
.demo-banner strong {
  font-family: var(--display);
  text-transform: uppercase; letter-spacing: 0.09em; font-size: 0.71875rem; font-weight: 700;
}

/* --- Wayfinding gantry ----------------------------------------------------------------------------------- */
/* Full-bleed band whose contents still line up with the content shell: the side padding grows to the
   centring offset once the viewport is wider than the shell. */
.header-row {
  background: var(--slate-700); color: #fff;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s6);
  padding-inline: max(var(--gutter), calc((100% - var(--shell)) / 2 + var(--gutter)));
}

.nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0; }
.nav-list a {
  display: inline-block; padding: var(--s4) var(--s4);
  color: #fff; text-decoration: none;
  font-family: var(--display); font-weight: 600; font-size: 0.9375rem; letter-spacing: 0.01em;
  border-bottom: 4px solid transparent;
  transition: background-color 0.15s ease-out, border-color 0.15s ease-out;
}
.nav-list a:hover { background: var(--slate-600); border-bottom-color: var(--slate-400); }
.nav-list a:focus-visible { outline-color: var(--focus-dark); outline-offset: -3px; }
.nav-list a[aria-current="page"] {
  background: var(--slate-800); font-weight: 700;
  border-bottom-color: var(--green-400);
}

.identity {
  margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4);
  font-size: 0.8125rem; color: var(--slate-200);
}
.identity p { margin: 0; }
.identity strong { color: #fff; font-weight: 600; }
.identity form { margin: var(--s2) 0; }
.identity .button-secondary {
  padding: var(--s2) var(--s3); min-height: 36px; font-size: 0.8125rem;
  background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.75);
}
.identity .button-secondary:hover { background: #fff; color: var(--slate-800); border-color: #fff; }
.identity .button-secondary:focus-visible { outline-color: var(--focus-dark); }

/* --- Page shell ------------------------------------------------------------------------------------------ */
main {
  max-width: var(--shell); margin: 0 auto; padding: var(--s8) var(--gutter) var(--s12);
  background: transparent;
}

h1, h2, h3 { font-family: var(--display); }
h1 {
  font-size: 2rem; line-height: 1.15; letter-spacing: -0.015em; font-weight: 700;
  margin: 0 0 var(--s4);
}
h1 .badge { vertical-align: 0.25em; margin-left: var(--s3); }

/* Section heads carry a short green sign-post tick on a hairline, not a card border. */
h2 {
  position: relative;
  font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.01em; font-weight: 700;
  margin: var(--s12) 0 var(--s4); padding-top: var(--s4);
  border-top: 1px solid var(--rule);
}
h2::before {
  content: ""; position: absolute; top: -2px; left: 0;
  width: 56px; height: 4px; background: var(--green-500);
}
h3 { font-size: 1.1875rem; line-height: 1.35; font-weight: 600; margin: var(--s8) 0 var(--s2); }

p { margin: var(--s3) 0; }
.lead { font-size: 1.125rem; line-height: 1.6; max-width: var(--measure); color: var(--ink); }
.hint { color: var(--ink-muted); font-size: 0.8125rem; line-height: 1.5; margin: var(--s2) 0; max-width: var(--measure); }

.not-permit {
  background: var(--amber-bg); color: var(--amber-text);
  padding: var(--s3) var(--s4); border-left: 5px solid var(--amber-line);
  font-size: 0.875rem;
}

.code { font-weight: 400; }
code, pre { font-family: var(--mono); font-size: 0.8125rem; }
.hash { overflow-wrap: anywhere; word-break: break-all; color: var(--ink-muted); }
pre {
  background: var(--slate-900); color: #e8eef2; border: 0; border-left: 5px solid var(--slate-600);
  padding: var(--s4); overflow: auto; max-height: 28rem; line-height: 1.55;
}

/* --- The governing sign ----------------------------------------------------------------------------------
   The active policy is not a row of fields: it is the sign the whole system is reading from. A guide-sign
   plate with its exit tab above it, carrying the version, the generation, its provenance and its release. */
.policy-strip { margin: 0 0 var(--s8); }
.policy-strip p { margin: 0; }

.policy-strip__tab {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: var(--s2) var(--s4) var(--s1);
  margin-left: var(--s4);
  background: var(--green-600);
  border-radius: 5px 5px 0 0;
  box-shadow: inset 0 3px 0 var(--green-600), inset 3px 0 0 var(--green-600), inset -3px 0 0 var(--green-600),
              inset 0 4px 0 -0.5px rgba(255, 255, 255, 0.95);
  color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase;
}
.policy-strip__tab-mark { font-size: 0.8125rem; line-height: 1; }

.policy-strip__panel {
  display: flex; flex-wrap: wrap; align-items: stretch;
  background: var(--green-600);
  border-radius: 5px;
  box-shadow: var(--keyline);
  padding: var(--s2);
  color: #fff;
}

.policy-strip__item {
  padding: var(--s3) var(--s4);
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-width: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.28);
}
.policy-strip__item:last-child { border-right: 0; }
.policy-strip__item.is-wide { flex: 1 1 20rem; }

.policy-strip__label {
  display: block;
  font-family: var(--display);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--green-150);
}
.policy-strip__value {
  display: block;
  font-family: var(--display); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.01em;
  line-height: 1.15; color: #fff;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.policy-strip__value.is-hash {
  font-family: var(--mono); font-size: 0.8125rem; font-weight: 400; letter-spacing: 0;
  line-height: 1.5; white-space: normal; overflow-wrap: anywhere; color: var(--green-150);
}
.policy-strip__value.is-normal {
  font-size: 1rem; font-weight: 600; letter-spacing: 0; white-space: normal; line-height: 1.35;
}
.policy-strip__note { padding: var(--s3) var(--s4); font-size: 0.9375rem; }

/* Nothing is serving: the sign goes to warning. */
.policy-strip.is-idle .policy-strip__tab {
  background: var(--amber-line); color: #fff;
  box-shadow: inset 0 3px 0 var(--amber-line), inset 3px 0 0 var(--amber-line), inset -3px 0 0 var(--amber-line),
              inset 0 4px 0 -0.5px rgba(255, 255, 255, 0.95);
}
.policy-strip.is-idle .policy-strip__panel {
  background: var(--amber-bg); color: var(--amber-text);
  box-shadow: inset 0 0 0 3px var(--amber-bg), inset 0 0 0 4px var(--amber-line);
}
.policy-strip.is-idle .policy-strip__label { color: var(--amber-text); }
.policy-strip.is-idle .policy-strip__value { color: var(--amber-text); font-size: 1.125rem; white-space: normal; }
.policy-strip.is-idle .policy-strip__item { border-right-color: rgba(109, 68, 0, 0.3); }

/* --- The route ------------------------------------------------------------------------------------------
   Draft → Validate → Compare → Approve → Activate → Rollback is a road, not six boxes. Road already
   travelled is solid; road ahead is a skip stripe. The current step is marked with a plate. */
.flow {
  margin: 0 0 var(--s8);
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: var(--s4) var(--s6) var(--s6);
}
.flow__caption {
  margin: 0 0 var(--s6);
  font-family: var(--display);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-muted);
}
.flow__steps {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(6, 1fr);
}
.flow__step {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: var(--s1);
  padding: 0 var(--s1);
  text-align: center;
}

/* the carriageway */
.flow__step::before {
  content: ""; position: absolute; z-index: 0;
  top: 13px; left: 0; right: 0; height: 3px;
  background-color: var(--slate-200);
}
.flow__step.is-done::before,
.flow__step.is-current::before { background-color: var(--green-500); }
.flow__step.is-next::before,
.flow__step.is-stopped::before {
  background-color: transparent;
  background-image: repeating-linear-gradient(to right,
    var(--slate-200) 0 10px, transparent 10px 20px);
}
.flow__step:first-child::before { left: 50%; }
.flow__step:last-child::before { right: 50%; }

.flow__marker {
  position: relative; z-index: 1;
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--surface);
  color: var(--ink-muted);
  font-family: var(--display); font-size: 0.875rem; font-weight: 700; line-height: 1;
}
.flow__step.is-done .flow__marker { background: var(--green-500); color: #fff; }
.flow__step.is-next .flow__marker { box-shadow: 0 0 0 3px var(--surface), inset 0 0 0 2px var(--slate-200); }
.flow__step.is-stopped .flow__marker { background: var(--red-600); color: #fff; }
/* the step in hand is a plate, not a dot */
.flow__step.is-current .flow__marker {
  width: 42px; height: 30px; border-radius: 4px;
  background: var(--green-500); color: #fff;
  box-shadow: 0 0 0 3px var(--surface), inset 0 0 0 2px var(--green-500), inset 0 0 0 3px rgba(255, 255, 255, 0.95);
}

.flow__name {
  font-family: var(--display); font-weight: 700; font-size: 0.9375rem; color: var(--ink);
  margin-top: var(--s1);
}
.flow__state {
  font-family: var(--display);
  font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
  color: var(--ink-muted);
}
.flow__step.is-done .flow__name, .flow__step.is-done .flow__state { color: var(--green-700); }
.flow__step.is-current .flow__name { color: var(--green-700); }
.flow__step.is-current .flow__state { color: var(--green-700); }
.flow__step.is-stopped .flow__name, .flow__step.is-stopped .flow__state { color: var(--red-text); }
.flow__step.is-next .flow__name { color: var(--ink-muted); font-weight: 600; }

/* --- The change, as two signs -----------------------------------------------------------------------------
   What a reviewer is approving, stated the way an agency states a limit change: the legend now in force
   beside the legend that would replace it. */
.change-band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--s4);
  margin: var(--s6) 0;
}
.change-band__cell {
  display: flex; flex-direction: column; gap: var(--s2);
  padding: var(--s4) var(--s6) var(--s6);
  border-radius: 5px;
}
.change-band__cell.is-from {
  background: var(--slate-700); color: #fff;
  box-shadow: inset 0 0 0 3px var(--slate-700), inset 0 0 0 4px rgba(255, 255, 255, 0.95);
}
.change-band__cell.is-to {
  background: var(--green-600); color: #fff;
  box-shadow: inset 0 0 0 3px var(--green-600), inset 0 0 0 4px rgba(255, 255, 255, 0.95);
}
.change-band__cell.is-flag {
  background: var(--amber-bg); color: var(--amber-text);
  box-shadow: inset 0 0 0 3px var(--amber-bg), inset 0 0 0 4px var(--amber-line);
}
.change-band__label {
  display: block;
  font-family: var(--display);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--green-150);
}
.change-band__cell.is-flag .change-band__label { color: var(--amber-text); }
.change-band__figure {
  display: block;
  font-family: var(--display);
  font-size: 3.25rem; line-height: 1; font-weight: 700; letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums; white-space: nowrap; color: inherit;
}
.change-band__unit {
  font-size: 1.25rem; font-weight: 600; letter-spacing: 0; margin-left: 0.15em;
}
.change-band__cell.is-flag .change-band__figure { font-size: 1.75rem; letter-spacing: -0.01em; }
.change-band__note {
  display: block; font-family: var(--font); font-size: 0.875rem; line-height: 1.45;
  color: var(--green-150);
}
.change-band__cell.is-flag .change-band__note { color: var(--amber-text); }

/* The decisive case: one load, two readings of it. */
.case-callout {
  background: var(--amber-bg); color: var(--amber-text);
  border-left: 5px solid var(--amber-line);
  padding: var(--s4) var(--s6); margin: var(--s6) 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s8);
}
.case-callout__title {
  margin: 0; flex: 1 1 18rem;
  font-family: var(--display); font-size: 1rem; font-weight: 700; line-height: 1.35;
}
.case-callout__title .case-input {
  font-family: var(--mono); font-weight: 400; display: block; margin-top: var(--s1); font-size: 0.8125rem;
}
.case-callout__pair { display: flex; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.case-callout__side {
  display: flex; flex-direction: column; gap: 2px;
  padding: var(--s2) var(--s4);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 4px;
}
.case-callout__side .case-version {
  font-family: var(--display);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.case-callout__side .case-outcome {
  font-family: var(--display); font-size: 1.125rem; font-weight: 700; white-space: nowrap;
}
.case-callout__arrow { font-size: 1.5rem; font-weight: 700; font-family: var(--display); }

/* --- What a reversal keeps -------------------------------------------------------------------------------- */
.preserve {
  background: var(--green-050);
  border-left: 5px solid var(--green-500);
  padding: var(--s4) var(--s6); margin: var(--s6) 0;
}
.preserve__title {
  margin: 0 0 var(--s2);
  display: flex; align-items: center; gap: var(--s2);
  font-family: var(--display); font-size: 1rem; font-weight: 700; color: var(--green-700);
}
.preserve__title > span[aria-hidden] {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--green-500); color: #fff; font-size: 0.6875rem; line-height: 1;
}
.preserve ul { margin: 0; padding-left: var(--s6); }
.preserve li { margin: var(--s1) 0; font-size: 0.9375rem; }

/* --- Alerts ------------------------------------------------------------------------------------------------ */
.alert {
  padding: var(--s4) var(--s6); margin: var(--s6) 0;
  border-left: 5px solid;
  font-size: 0.9375rem;
}
.alert p { margin: var(--s2) 0; }
.alert p:first-child { margin-top: 0; }
.alert p:last-child { margin-bottom: 0; }
.alert strong { font-family: var(--display); }
.alert ul { margin: var(--s2) 0 0; padding-left: var(--s6); }
.alert .code { font-family: var(--mono); font-size: 0.8125rem; }
.alert details { background: rgba(255, 255, 255, 0.6); }
.alert-ok { background: var(--green-050); color: var(--green-700); border-color: var(--green-500); }
.alert-ok a { color: var(--green-700); }
.alert-warn { background: var(--amber-bg); color: var(--amber-text); border-color: var(--amber-line); }
.alert-warn a { color: var(--amber-text); }
.alert-error { background: var(--red-bg); color: var(--red-text); border-color: var(--red-line); }
.alert-error a { color: var(--red-text); }

/* --- Status, carried by shape as well as colour ---------------------------------------------------------
   Green plate = in force. Amber diamond = caution, the roadway warning shape. Red octagon = refused.
   The word is always present; the shape means the colour is never doing the work alone. */
.badge {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: var(--s1) var(--s3) var(--s1) var(--s2);
  border-radius: 3px;
  font-family: var(--display); font-size: 0.8125rem; font-weight: 700; line-height: 1.4;
  background: var(--slate-100); color: var(--ink); white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--rule-strong);
}
.badge > span[aria-hidden] {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 17px; height: 17px;
  background: var(--slate-600); color: #fff;
  font-size: 0.625rem; line-height: 1; font-weight: 700;
}
.badge-passed, .badge-approved, .badge-active {
  background: var(--green-100); color: var(--green-700); box-shadow: inset 0 0 0 1px var(--green-500);
}
.badge-passed > span[aria-hidden], .badge-approved > span[aria-hidden],
.badge-active > span[aria-hidden] {
  background: var(--green-500); border-radius: 2px;
}
.badge-failed, .badge-rejected {
  background: var(--red-bg); color: var(--red-text); box-shadow: inset 0 0 0 1px var(--red-line);
}
.badge-failed > span[aria-hidden], .badge-rejected > span[aria-hidden] {
  background: var(--red-600);
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
}
.badge-withdrawn, .badge-submitted {
  background: var(--amber-bg); color: var(--amber-text); box-shadow: inset 0 0 0 1px var(--amber-line);
}
.badge-withdrawn > span[aria-hidden], .badge-submitted > span[aria-hidden] {
  background: var(--amber-500); color: #231700;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  width: 19px; height: 19px; font-size: 0.5625rem;
}
.tag {
  display: inline-block; box-shadow: inset 0 0 0 1px var(--rule-strong); border-radius: 2px;
  padding: 0 var(--s2);
  font-family: var(--display); font-size: 0.6875rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink-muted); background: var(--surface);
}

/* --- Fact lists ------------------------------------------------------------------------------------------- */
.facts {
  display: grid; grid-template-columns: minmax(10rem, 17rem) 1fr;
  gap: 0; margin: var(--s4) 0 var(--s8);
  border: 1px solid var(--rule); border-left: 4px solid var(--green-500);
  background: var(--surface);
  overflow: hidden;
}
.facts dt {
  font-family: var(--display); font-weight: 700; font-size: 0.75rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-muted);
  padding: var(--s3) var(--s4); border-top: 1px solid var(--rule); background: var(--slate-050);
}
.facts dd {
  margin: 0; padding: var(--s3) var(--s4); border-top: 1px solid var(--rule);
  font-size: 0.9375rem; overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
}
.facts dd strong { font-family: var(--display); font-size: 1rem; }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }

/* --- Layout helpers --------------------------------------------------------------------------------------- */
.stack > * + * { margin-top: var(--s4); }
section { margin-bottom: var(--s8); }

/* --- Forms ------------------------------------------------------------------------------------------------ */
.field { display: flex; flex-direction: column; gap: var(--s1); max-width: 40rem; }
/* stacked fields need air between one field's hint and the next field's label */
.field + .field, .field + .field-row, .field-row + .field { margin-top: var(--s6); }
.field-row { display: flex; flex-wrap: wrap; gap: var(--s4); }
.field-row .field { flex: 1 1 12rem; }
.field-row .field + .field { margin-top: 0; }
label { font-family: var(--display); font-weight: 600; font-size: 0.9375rem; }
label.inline { font-family: var(--font); font-weight: 400; font-size: 0.9375rem; }
.field .hint { margin: 0; }

input[type="text"], input[type="password"], select, textarea {
  font: inherit; font-size: 1rem;
  padding: var(--s3);
  border: 2px solid var(--rule-strong); border-radius: 3px;
  background: #fff; color: var(--ink); width: 100%;
  min-height: 44px;
}
input[type="text"]:hover, input[type="password"]:hover, select:hover, textarea:hover { border-color: var(--slate-600); }
textarea { min-height: 3.5rem; line-height: 1.5; }
input[type="radio"], input[type="checkbox"] {
  width: 1.15rem; height: 1.15rem; margin-right: var(--s1); vertical-align: middle; accent-color: var(--green-600);
}
[aria-invalid="true"] { border-color: var(--red-line); border-width: 3px; }
.field-error {
  color: var(--red-text); font-family: var(--display); font-weight: 600; font-size: 0.875rem;
  margin: var(--s1) 0 0; display: flex; align-items: center; gap: var(--s2);
}
.field-error > span[aria-hidden] {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 17px; height: 17px; background: var(--red-600); color: #fff;
  clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%);
  font-size: 0.625rem; line-height: 1;
}

fieldset {
  border: 1px solid var(--rule); border-top: 3px solid var(--slate-700);
  padding: var(--s4) var(--s6) var(--s6); max-width: 50rem; margin: var(--s6) 0;
  background: var(--surface);
}
legend {
  font-family: var(--display); font-weight: 700; font-size: 0.75rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--slate-700); padding: 0 var(--s2);
}
fieldset p { margin: var(--s2) 0; }

.inline-form {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s4);
  margin: var(--s6) 0; padding: var(--s4) var(--s6);
  background: var(--slate-050); border: 1px solid var(--rule); border-left: 4px solid var(--slate-700);
}
.inline-form .field { max-width: 16rem; }

/* --- Buttons ------------------------------------------------------------------------------------------------ */
button, .button, .button-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.01em;
  padding: var(--s3) var(--s6); min-height: 44px;
  border-radius: 3px; border: 2px solid var(--green-600);
  background: var(--green-600); color: #fff;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background-color 0.15s ease-out, color 0.15s ease-out, border-color 0.15s ease-out;
}
.button-secondary { background: var(--surface); color: var(--green-700); }
.button-danger { background: var(--surface); color: var(--red-text); border-color: var(--red-line); }
button:hover, .button:hover { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.button-secondary:hover { background: var(--green-050); color: var(--green-700); border-color: var(--green-700); }
.button-danger:hover { background: var(--red-bg); color: var(--red-text); border-color: var(--red-line); }
button:disabled, .button:disabled {
  background: var(--slate-100); border-color: var(--rule-strong); color: var(--ink-muted); cursor: not-allowed;
}

.actions { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s6) 0; }

/* --- Panels ------------------------------------------------------------------------------------------------- */
.card {
  border: 1px solid var(--rule); border-left: 4px solid var(--green-500);
  padding: var(--s6); margin: var(--s6) 0; background: var(--surface);
}
.card h3 { margin-top: 0; }
.card p { max-width: var(--measure); }

/* --- Tables --------------------------------------------------------------------------------------------------
   Data sits under a slate head, the way a lane board sits over the carriageway. */
.table-wrap {
  overflow-x: auto; margin: var(--s6) 0;
  border: 1px solid var(--rule); background: var(--surface);
}
.table-wrap:focus-visible { outline-offset: -3px; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.875rem; }
caption {
  text-align: left; font-family: var(--display); font-weight: 700; font-size: 0.875rem;
  color: var(--ink); padding: var(--s3) var(--s4);
  background: var(--slate-050); border-bottom: 1px solid var(--rule);
}
th, td {
  text-align: left; vertical-align: top; padding: var(--s3) var(--s4);
  border-top: 1px solid var(--rule); font-variant-numeric: tabular-nums;
}
thead th {
  background: var(--slate-700); color: #fff;
  border-top: 0; border-bottom: 0;
  font-family: var(--display);
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  position: sticky; top: 0; z-index: 1;
}
tbody th[scope="row"] { font-family: var(--display); font-weight: 700; }
tbody tr:nth-child(even) > * { background: var(--slate-050); }
td code, th code { font-family: var(--mono); font-size: 0.8125rem; overflow-wrap: anywhere; }

tr.row-changed, tr.row-diff { background: var(--amber-bg); }
tr.row-changed > *, tr.row-diff > * { background: var(--amber-bg); }
tr.row-diff th[scope="row"] { box-shadow: inset 5px 0 0 var(--amber-line); color: var(--amber-text); }
tr.row-diff td { color: var(--amber-text); }
tr.row-changed th[scope="row"] { box-shadow: inset 5px 0 0 var(--amber-line); color: var(--amber-text); }
tr.row-changed td { color: var(--amber-text); }
tr.row-changed td a, tr.row-changed th a { color: var(--amber-text); }

.empty-cell { color: var(--ink-muted); font-style: normal; }

/* --- Disclosure ----------------------------------------------------------------------------------------------- */
details {
  margin: var(--s6) 0; border: 1px solid var(--rule);
  padding: var(--s2) var(--s4); background: var(--surface);
}
summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 0.875rem; padding: var(--s2) 0; }
details[open] summary { border-bottom: 1px solid var(--rule); margin-bottom: var(--s3); }

/* --- Walkthrough: a numbered route of mileposts ------------------------------------------------------------- */
.steps { padding-left: 0; list-style: none; counter-reset: step; margin: var(--s6) 0; }
.steps > li {
  counter-increment: step;
  position: relative; padding: 0 0 var(--s8) var(--s12); border-left: 3px solid var(--slate-200); margin-left: var(--s4);
}
.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
.steps > li::before {
  content: counter(step);
  position: absolute; left: calc(-1 * var(--s4) - 3px); top: 0;
  width: 34px; height: 26px; border-radius: 4px;
  background: var(--green-500); color: #fff;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 0.875rem; font-weight: 700;
  box-shadow: inset 0 0 0 2px var(--green-500), inset 0 0 0 3px rgba(255, 255, 255, 0.95);
}
.steps h2 { border-top: none; font-size: 1.1875rem; margin: 0 0 var(--s2); padding-top: 0; }
.steps h2::before { display: none; }
.steps p { margin: var(--s2) 0; max-width: var(--measure); }
.who { font-family: var(--font); font-weight: 400; color: var(--ink-muted); font-size: 0.875rem; }

/* --- Footer --------------------------------------------------------------------------------------------------- */
.site-footer {
  background: var(--slate-900); color: var(--slate-200);
  margin-top: var(--s16);
}
.site-footer .footer-inner {
  max-width: var(--shell); margin: 0 auto; padding: var(--s8) var(--gutter);
  font-size: 0.8125rem; line-height: 1.55;
}
.site-footer p { margin: var(--s3) 0; max-width: var(--measure); }
.site-footer .footer-author {
  color: #fff; font-family: var(--display); font-weight: 700; font-size: 0.875rem;
}

/* --- Responsive ------------------------------------------------------------------------------------------------ */
@media (min-width: 768px) {
  :root { --gutter: var(--s6); }
  /* pull the first nav tab's text onto the content shell's left edge */
  .nav-list { margin-left: calc(-1 * var(--s4)); }
}
@media (min-width: 1024px) { :root { --gutter: var(--s8); } }

@media (max-width: 1023px) {
  .policy-strip__item.is-wide { flex-basis: 100%; border-right: 0; }
}

@media (max-width: 767px) {
  .bar-inner { flex-direction: column; align-items: flex-start; }
  .proposal-label { margin: 0; text-align: left; max-width: none; }
  .header-row { flex-direction: column; align-items: stretch; padding: 0; }
  /* two columns so six destinations do not consume a whole screen before the content starts */
  .nav-list { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .nav-list a {
    display: block; padding: var(--s3) var(--s4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14); border-left: 4px solid transparent;
  }
  .nav-list li:nth-child(odd) a { border-right: 1px solid rgba(255, 255, 255, 0.14); }
  .nav-list a[aria-current="page"] { border-bottom-color: rgba(255, 255, 255, 0.14); border-left-color: var(--green-400); }
  .identity {
    margin-left: 0; padding: var(--s3) var(--gutter);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }
  .facts { grid-template-columns: 1fr; }
  .facts dt { border-bottom: 0; padding-bottom: var(--s1); border-top: 1px solid var(--rule); }
  .facts dd { border-top: 0; padding-top: 0; }
  .facts dt:first-of-type + dd { border-top: 0; }
  .field-row .field { flex-basis: 100%; }
  h1 { font-size: 1.625rem; }
  h2 { font-size: 1.3125rem; margin-top: var(--s8); }
  main { padding-top: var(--s6); }

  .policy-strip__panel { flex-direction: column; padding: var(--s1); }
  .policy-strip__item { border-right: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.28); }
  .policy-strip__item:last-child { border-bottom: 0; }
  .policy-strip__value { white-space: normal; font-size: 1.3125rem; }

  /* the route stands up: markers run down the left, the carriageway becomes vertical */
  .flow { padding: var(--s4); }
  .flow__steps { grid-template-columns: 1fr; }
  .flow__step {
    flex-direction: row; align-items: center; justify-content: flex-start;
    gap: var(--s3); text-align: left; padding: var(--s2) 0;
  }
  .flow__step::before {
    top: 0; bottom: 0; left: 21px; right: auto; width: 3px; height: auto;
  }
  .flow__step.is-next::before, .flow__step.is-stopped::before {
    background-image: repeating-linear-gradient(to bottom,
      var(--slate-200) 0 10px, transparent 10px 20px);
  }
  .flow__step:first-child::before { left: 21px; top: 50%; }
  .flow__step:last-child::before { left: 21px; bottom: 50%; }
  .flow__step.is-current .flow__marker { width: 42px; margin-left: -6px; }
  .flow__name { margin-top: 0; margin-left: var(--s2); }
  .flow__state { margin-left: auto; }

  .change-band__figure { font-size: 2.5rem; }
  .change-band__cell { padding: var(--s4); }
  .case-callout { padding: var(--s4); }
  .steps > li { padding-left: var(--s8); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* --- Print ------------------------------------------------------------------------------------------------------ */
@media print {
  body { background: #fff; }
  .nav-list, .identity, .skip-link, .site-header::after { display: none; }
  .identity-bar, .demo-banner, .header-row { color: #000; background: #fff; border-bottom: 1px solid #000; }
  .identity-bar a, .brand-sub, .proposal-label { color: #000; }
  .site-footer { background: #fff; color: #000; border-top: 1px solid #000; }
  .site-footer .footer-author { color: #000; }
  .policy-strip__panel, .policy-strip__tab,
  .change-band__cell.is-from, .change-band__cell.is-to { color: #000; background: #fff; box-shadow: inset 0 0 0 2px #000; }
  .policy-strip__label, .policy-strip__value, .change-band__label, .change-band__note { color: #000; }
  thead th { background: #fff; color: #000; border-bottom: 2px solid #000; }
  pre { background: #fff; color: #000; border: 1px solid #000; }
  main { padding: 0; max-width: none; }
  .table-wrap { overflow: visible; }
  thead { display: table-header-group; }
  tr, .card, .facts, .policy-strip, .flow, .change-band { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
}
