/* MontgomeryCountySepticPermit.com
   Visual thesis: overlapping jurisdiction as registered overlay plates on a light table.
   Dark cool table surround; light hatched film panels carry all reading. */

:root {
  --table: #1e2a2f;
  --table-deep: #161f23;
  --table-edge: #33454c;
  --table-line: #3d525a;

  --film: #e9eee9;
  --film-lift: #f5f8f3;
  --film-sink: #dde5dc;
  --ink: #0d1512;
  --ink-soft: #41504a;
  --ink-faint: #5d6d66;

  --a: #a52f1b;   /* OSSF authority */
  --b: #7b2b6d;   /* city / ETJ */
  --c: #7a4e0c;   /* utility / sewer */
  --d: #0d5f86;   /* floodplain */
  --e: #24603a;   /* subdivision */

  --a-lit: #f0714f;
  --b-lit: #c079c9;
  --c-lit: #d9a63f;
  --d-lit: #5cb2dd;
  --e-lit: #6cc389;

  --law: #2c3f8a;
  --unk: #5b6a63;

  --reg: #7f9188;
  --shell: min(1220px, 100% - 2.5rem);
  --edge: 3px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--table);
  color: var(--film);
  font-family: "Figtree", "Segoe UI", system-ui, sans-serif;
  font-size: clamp(1rem, 0.97rem + 0.16vw, 1.075rem);
  line-height: 1.62;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: "Chivo", "Segoe UI", system-ui, sans-serif;
  line-height: 1.12;
  margin: 0;
  letter-spacing: -0.015em;
}

p { margin: 0 0 0.9em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; }

img, svg { max-width: 100%; }

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--film-lift);
  color: var(--ink);
  padding: 0.7rem 1.1rem;
  font-weight: 700;
}
.skip:focus { left: 0.75rem; top: 0.75rem; }

:focus-visible {
  outline: 3px solid var(--c-lit);
  outline-offset: 2px;
}

/* ---------- source marks ---------- */

.src {
  display: inline-flex;
  align-items: baseline;
  gap: 0.34em;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.1em 0.5em 0.14em;
  border: 1px solid currentColor;
  border-radius: 2px;
  white-space: nowrap;
  vertical-align: 0.08em;
  margin-right: 0.15em;
}
.src i { font-style: normal; font-size: 0.85em; }
.src-law { color: var(--law); }
.src-tceq { color: var(--d); }
.src-local { color: var(--a); }
.src-pro { color: var(--e); }
.src-private { color: var(--c); }
.src-unverified { color: var(--unk); border-style: dashed; }

/* the same marks sitting on the dark table need the lit inks */
.section-lede .src-law, .third-record .src-law, .origin-note .src-law, .readout .src-law { color: #8fa3ee; }
.section-lede .src-tceq, .third-record .src-tceq, .origin-note .src-tceq, .readout .src-tceq { color: var(--d-lit); }
.section-lede .src-local, .third-record .src-local, .origin-note .src-local, .readout .src-local { color: var(--a-lit); }
.section-lede .src-pro, .third-record .src-pro, .origin-note .src-pro, .readout .src-pro { color: var(--e-lit); }
.section-lede .src-private, .third-record .src-private, .origin-note .src-private, .readout .src-private { color: var(--c-lit); }
.section-lede .src-unverified, .third-record .src-unverified, .origin-note .src-unverified, .readout .src-unverified { color: #a8b6ae; }

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--table-deep) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--table-line);
}

.masthead-inner {
  display: flex;
  align-items: center;
  gap: 1rem 1.5rem;
  flex-wrap: wrap;
  padding: 0.7rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 40px;
  text-decoration: none;
  color: var(--film);
  margin-right: auto;
}

.brand-stack {
  display: grid;
  gap: 2px;
  transform: skewY(-14deg);
}
.brand-stack i {
  display: block;
  width: 22px;
  height: 5px;
  border: 1px solid;
}
.brand-stack i:nth-child(1) { border-color: var(--a-lit); background: color-mix(in srgb, var(--a-lit) 30%, transparent); }
.brand-stack i:nth-child(2) { border-color: var(--c-lit); background: color-mix(in srgb, var(--c-lit) 30%, transparent); }
.brand-stack i:nth-child(3) { border-color: var(--d-lit); background: color-mix(in srgb, var(--d-lit) 30%, transparent); }

.brand-words { display: grid; line-height: 1.15; }
.brand-words b {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: var(--reg);
}
.brand-words em {
  font-style: normal;
  font-family: "Chivo", sans-serif;
  font-weight: 900;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}
.brand-words em span { color: var(--reg); font-weight: 600; }

.masthead-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.15rem;
  font-size: 0.87rem;
  font-weight: 600;
}
.masthead-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: color-mix(in srgb, var(--film) 82%, transparent);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}
.masthead-nav a:hover,
.masthead-nav a:focus-visible { color: var(--film); border-bottom-color: var(--a-lit); }

.masthead-out {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--table-deep);
  background: var(--c-lit);
  padding: 0.5rem 0.8rem;
  border-radius: 2px;
}
.masthead-out:hover,
.masthead-out:focus-visible { background: #f1c469; }

/* ---------- hero ---------- */

.hero {
  padding: clamp(2.5rem, 6vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  background:
    radial-gradient(120% 80% at 62% 0%, #2b3b41 0%, var(--table) 55%, var(--table-deep) 100%);
  border-bottom: 1px solid var(--table-line);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

.eyebrow {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--c-lit);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.9rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  margin-bottom: 1.1rem;
}

.lede {
  font-size: clamp(1.05rem, 1rem + 0.5vw, 1.32rem);
  color: color-mix(in srgb, var(--film) 92%, transparent);
  max-width: 34em;
}
.lede em { font-family: "Petrona", Georgia, serif; font-style: italic; color: var(--a-lit); font-weight: 500; }
.lede-2 { color: color-mix(in srgb, var(--film) 74%, transparent); max-width: 36em; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.6rem 0 1.4rem;
}

.btn {
  display: inline-block;
  padding: 0.78rem 1.25rem;
  font-family: "Chivo", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border-radius: 2px;
  border: 2px solid transparent;
}
.btn-solid { background: var(--a-lit); color: #22120c; border-color: var(--a-lit); }
.btn-solid:hover, .btn-solid:focus-visible { background: #ff8a68; border-color: #ff8a68; }
.btn-hollow { border-color: var(--table-edge); color: var(--film); }
.btn-hollow:hover, .btn-hollow:focus-visible { border-color: var(--film); }

.scope {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-size: 0.86rem;
  color: color-mix(in srgb, var(--film) 66%, transparent);
  max-width: 40em;
  border-top: 1px solid var(--table-line);
  padding-top: 0.9rem;
}
.scope-mark {
  flex: none;
  width: 10px;
  height: 10px;
  margin-top: 0.42rem;
  border: 1px solid var(--reg);
  border-radius: 50%;
  position: relative;
}
.scope-mark::before,
.scope-mark::after {
  content: "";
  position: absolute;
  background: var(--reg);
}
.scope-mark::before { left: 4px; top: -3px; width: 1px; height: 16px; }
.scope-mark::after { top: 4px; left: -3px; height: 1px; width: 16px; }

.hero-figure { margin: 0; }
.stackfig { width: 100%; height: auto; display: block; }
.stackfig polygon { opacity: 0.95; }
.fig-code {
  font-family: "Chivo", sans-serif;
  font-weight: 900;
  font-size: 15px;
  fill: var(--film);
}
.fig-lab {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  fill: #b9c9c0;
}
.fig-parcel {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  fill: var(--ink);
}
.hero-figure figcaption {
  margin-top: 0.9rem;
  font-size: 0.83rem;
  color: color-mix(in srgb, var(--film) 62%, transparent);
  border-left: 2px solid var(--table-edge);
  padding-left: 0.75rem;
}

/* ---------- the split band ---------- */

.band {
  background: var(--table-deep);
  padding: clamp(2rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--table-line);
}
.band-title {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--reg);
  margin-bottom: 1.3rem;
}
.split-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.2rem;
}
.split-grid p {
  background: var(--film);
  color: var(--ink);
  padding: 1.1rem 1.15rem;
  border-radius: 2px;
  font-size: 0.95rem;
}
.split-grid p:nth-child(1) { border-top: var(--edge) solid var(--a); }
.split-grid p:nth-child(2) { border-top: var(--edge) solid var(--d); }
.split-grid p:nth-child(3) { border-top: var(--edge) dashed var(--unk); }
.split-grid em { font-family: "Petrona", Georgia, serif; font-style: italic; font-weight: 500; }

/* ---------- generic section ---------- */

.section { padding: clamp(2.75rem, 6vw, 5rem) 0; }
.section-head { max-width: 56rem; margin-bottom: clamp(1.6rem, 3vw, 2.6rem); }
.section-head h2 {
  font-size: clamp(1.75rem, 1.3rem + 2.1vw, 2.9rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin-bottom: 0.8rem;
}
.section-lede {
  font-size: clamp(1rem, 0.96rem + 0.28vw, 1.14rem);
  color: color-mix(in srgb, var(--film) 78%, transparent);
}
.section-lede b { color: var(--film); }

.stamp {
  display: inline-block;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--c-lit);
  border: 1px dashed currentColor;
  padding: 0.1em 0.5em;
  border-radius: 2px;
  white-space: nowrap;
}

.out, .instrument-list a, .origin-note a {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

/* ---------- the stack ---------- */

.stack-layout {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 2.5vw, 2.25rem);
  align-items: start;
}

.readout {
  position: sticky;
  top: 5.5rem;
  background: var(--table-deep);
  border: 1px solid var(--table-edge);
  border-top: var(--edge) solid var(--c-lit);
  border-radius: 2px;
  padding: 1.1rem 1.15rem 1.25rem;
}
.readout-title {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--reg);
  margin-bottom: 0.7rem;
}
.readout-line {
  font-family: "Chivo", sans-serif;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.34;
  margin-bottom: 1rem;
}
.readout-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  font-size: 0.83rem;
}
.readout-list li {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--table-line);
}
.sw { width: 14px; height: 14px; border: 1px solid; border-radius: 2px; }
.sw-a { border-color: var(--a-lit); background-image: repeating-linear-gradient(0deg, var(--a-lit) 0 1.5px, transparent 1.5px 4px); }
.sw-b { border-color: var(--b-lit); background-image: repeating-linear-gradient(45deg, var(--b-lit) 0 1.5px, transparent 1.5px 4px); }
.sw-c { border-color: var(--c-lit); background-image: radial-gradient(var(--c-lit) 1px, transparent 1.2px); background-size: 4px 4px; }
.sw-d { border-color: var(--d-lit); background-image: repeating-linear-gradient(45deg, var(--d-lit) 0 1px, transparent 1px 4px), repeating-linear-gradient(-45deg, var(--d-lit) 0 1px, transparent 1px 4px); }
.sw-e { border-color: var(--e-lit); background-image: repeating-linear-gradient(0deg, var(--e-lit) 0 1.5px, transparent 1.5px 4px); background-size: 6px 4px; }
.sw-name { overflow-wrap: anywhere; }
.sw-state {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--reg);
  text-align: right;
}
.readout-list li[data-state="applies"] .sw-state { color: var(--a-lit); font-weight: 600; }
.readout-list li[data-state="out"] .sw-state { color: #7f9188; text-decoration: line-through; }
.readout-list li[data-state="out"] .sw-name { opacity: 0.55; }

.readout-warn {
  font-size: 0.79rem;
  color: color-mix(in srgb, var(--film) 62%, transparent);
  border-top: 1px solid var(--table-line);
  padding-top: 0.7rem;
}
.readout-warn em { font-family: "Petrona", Georgia, serif; font-style: italic; }

.readout-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.8rem; }
.mini-btn {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  color: var(--film);
  border: 1px solid var(--table-edge);
  border-radius: 2px;
  padding: 0.65rem 0.85rem;
  min-height: 40px;
  cursor: pointer;
}
.mini-btn:hover, .mini-btn:focus-visible { border-color: var(--c-lit); color: var(--c-lit); }
.mini-btn[hidden] { display: none; }

.plates { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }

.plate {
  background: var(--film);
  color: var(--ink);
  border-radius: 2px;
  padding: 1.15rem clamp(1rem, 2.2vw, 1.6rem) 1.35rem;
  border-left: 6px solid var(--layer, var(--ink));
  box-shadow: 0 10px 26px -20px #000;
}
.plate[data-layer="a"] { --layer: var(--a); }
.plate[data-layer="b"] { --layer: var(--b); }
.plate[data-layer="c"] { --layer: var(--c); }
.plate[data-layer="d"] { --layer: var(--d); }
.plate[data-layer="e"] { --layer: var(--e); }

.plate[data-state="out"] { background: var(--film-sink); }
.plate[data-state="applies"] { box-shadow: 0 0 0 2px var(--layer), 0 10px 26px -20px #000; }

.plate-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  margin-bottom: 0.85rem;
}
.plate-code {
  font-family: "Chivo", sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--layer);
}
.hatch {
  width: 30px;
  height: 22px;
  border: 1px solid var(--layer);
  border-radius: 2px;
  flex: none;
}
.hatch-a { background-image: repeating-linear-gradient(0deg, var(--a) 0 2px, transparent 2px 5px); }
.hatch-b { background-image: repeating-linear-gradient(45deg, var(--b) 0 2px, transparent 2px 5px); }
.hatch-c { background-image: radial-gradient(var(--c) 1.2px, transparent 1.4px); background-size: 5px 5px; }
.hatch-d { background-image: repeating-linear-gradient(45deg, var(--d) 0 1.2px, transparent 1.2px 5px), repeating-linear-gradient(-45deg, var(--d) 0 1.2px, transparent 1.2px 5px); }
.hatch-e { background-image: repeating-linear-gradient(0deg, var(--e) 0 2px, transparent 2px 5px); background-size: 8px 5px; }

.plate-head h3 {
  font-size: clamp(1.15rem, 1.05rem + 0.4vw, 1.42rem);
  font-weight: 700;
  margin-right: auto;
}
.echo {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border: 1px dashed currentColor;
  border-radius: 2px;
  padding: 0.2em 0.5em;
  display: none;
}
.js .echo { display: inline-block; }
.plate[data-state="applies"] .echo { color: var(--layer); border-style: solid; }
.plate[data-state="out"] .echo { color: var(--ink-faint); text-decoration: line-through; }

.plate-what {
  font-family: "Chivo", sans-serif;
  font-size: clamp(1rem, 0.96rem + 0.3vw, 1.14rem);
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink);
  margin-bottom: 1.1rem;
}

.plate-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 1.6rem;
}
.plate-field h4 {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.4rem;
}
.plate-field p, .plate-field li { font-size: 0.92rem; color: var(--ink-soft); }
.plate-field strong { color: var(--ink); }
.plate-not { grid-column: 1 / -1; border-top: 1px dashed color-mix(in srgb, var(--ink) 28%, transparent); padding-top: 0.8rem; }
.plate-body > .plate-field:has(.plain-list) { grid-column: 1 / -1; }

.instrument-list, .plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.instrument-list li, .plain-list li {
  padding-left: 1rem;
  position: relative;
}
.instrument-list li::before, .plain-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 6px;
  height: 6px;
  background: var(--layer, var(--ink-faint));
}
.plain-list.tight { gap: 0.45rem; }
.plate-caution {
  margin-top: 0.6rem;
  font-size: 0.86rem !important;
  font-family: "Petrona", Georgia, serif;
  font-style: italic;
  color: var(--ink) !important;
}

.gate-callout {
  background: color-mix(in srgb, var(--d) 12%, var(--film-lift));
  border-left: var(--edge) solid var(--d);
  padding: 0.75rem 0.85rem;
  font-size: 0.95rem !important;
  color: var(--ink) !important;
}

.triage {
  margin: 1.1rem 0 0;
  border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent);
  border-radius: 2px;
  padding: 0.65rem 0.85rem 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.2rem;
  align-items: center;
  background: var(--film-lift);
}
.triage legend {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 0.4rem;
}
.triage label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  min-height: 44px;
}
.triage input { width: 1.15rem; height: 1.15rem; accent-color: var(--layer); flex: none; }
.triage label:has(input:checked) { color: var(--layer); }

/* ---------- agents ---------- */

.agents-section { background: var(--table-deep); }

.agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.agent {
  background: var(--film);
  color: var(--ink);
  border-radius: 2px;
  padding: 1.3rem clamp(1rem, 2vw, 1.5rem) 1.4rem;
  border-top: var(--edge) solid var(--a);
}
.agent-sjra { border-top-color: var(--d); }

.agent-kind { margin-bottom: 0.7rem; }

.durable-note {
  margin-bottom: clamp(1rem, 2vw, 1.4rem);
  border-left: var(--edge) solid var(--reg);
  padding-left: 1rem;
  font-size: 0.95rem;
  color: color-mix(in srgb, var(--film) 82%, transparent);
  max-width: 62em;
}
.durable-note strong { color: var(--film); }

.verified-row dt { color: var(--ink-soft); }
.verified-row dd {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}
.kind {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 2px;
  padding: 0.18em 0.55em;
  display: inline-block;
}
.kind-gov { color: var(--e); }
.kind-ref { color: var(--d); }
.kind-co { color: var(--c); }

.agent h3 {
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.55rem);
  font-weight: 700;
  margin-bottom: 0.65rem;
}
.agent-area { font-size: 0.95rem; color: var(--ink-soft); }

.agent-facts {
  margin: 1rem 0;
  display: grid;
  gap: 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}
.agent-facts > div {
  display: grid;
  grid-template-columns: minmax(8.5rem, 0.75fr) minmax(0, 1.6fr);
  gap: 0.4rem 0.9rem;
  padding: 0.42rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 12%, transparent);
}
.agent-facts dt {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.18em;
}
.agent-facts dd { margin: 0; font-size: 0.92rem; overflow-wrap: anywhere; }

.agent-sub {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.55rem;
}
.agent .plain-list li { font-size: 0.9rem; color: var(--ink-soft); }
.agent .plain-list li::before { background: var(--a); }
.agent-sjra .plain-list li::before { background: var(--d); }
.agent-order { font-size: 0.93rem; color: var(--ink-soft); }
.water { font-family: "Petrona", Georgia, serif; font-style: italic; color: var(--d); font-weight: 500; }
.agent-links { display: flex; flex-wrap: wrap; gap: 0.5rem 1.2rem; margin-top: 1rem; font-size: 0.92rem; }

.third-record {
  margin-top: 1.25rem;
  background: color-mix(in srgb, var(--film) 8%, transparent);
  border: 1px dashed var(--table-edge);
  border-radius: 2px;
  padding: 0.9rem 1.05rem;
  font-size: 0.92rem;
  color: color-mix(in srgb, var(--film) 84%, transparent);
}
.third-record .src { color: var(--d-lit); }
.third-record strong { color: var(--film); }
.sjra-route {
  margin-top: clamp(1.5rem, 3vw, 2.5rem);
  background: var(--film);
  color: var(--ink);
  border-radius: 2px;
  border-top: var(--edge) solid var(--d);
  padding: 1.3rem clamp(1rem, 2vw, 1.6rem) 1.4rem;
}
.sjra-route-title { font-size: clamp(1.15rem, 1.05rem + 0.5vw, 1.45rem); font-weight: 700; margin-bottom: 0.5rem; }
.sjra-route-note { font-size: 0.93rem; color: var(--ink-soft); margin-bottom: 1.1rem; }
.sjra-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem 2rem;
}
.sjra-cols h4, .sjra-maint h4 {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 0.6rem;
}
.numbered, .flow {
  margin: 0 0 0.8rem;
  padding-left: 1.35rem;
  display: grid;
  gap: 0.4rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.flow { list-style: none; padding-left: 0; counter-reset: f; }
.flow li { position: relative; padding-left: 1.6rem; counter-increment: f; }
.flow li::before {
  content: counter(f);
  position: absolute;
  left: 0;
  top: 0.1em;
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--d);
  border: 1px solid var(--d);
  border-radius: 50%;
  width: 1.15rem;
  height: 1.15rem;
  display: grid;
  place-items: center;
}
.flow li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 0.55rem;
  top: 1.35rem;
  bottom: -0.4rem;
  width: 1px;
  background: color-mix(in srgb, var(--d) 45%, transparent);
}
.sjra-doc-note { font-size: 0.85rem; color: var(--ink-faint); font-family: "Petrona", Georgia, serif; font-style: italic; }
.sjra-maint { margin-top: 1.2rem; border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); padding-top: 1rem; }
.sjra-maint p { font-size: 0.92rem; color: var(--ink-soft); }

.agents-boundary {
  margin-top: 1.25rem;
  font-family: "Chivo", sans-serif;
  font-size: clamp(1rem, 0.95rem + 0.35vw, 1.18rem);
  color: var(--film);
  border-left: var(--edge) solid var(--a-lit);
  padding-left: 1rem;
}

/* ---------- work ---------- */

.work-grid { display: grid; gap: clamp(1rem, 2vw, 1.4rem); }
.work {
  background: var(--film);
  color: var(--ink);
  border-radius: 2px;
  padding: 1.2rem clamp(1rem, 2vw, 1.5rem) 1.3rem;
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  gap: 0 1.25rem;
  align-items: start;
}
.work-no {
  font-family: "Chivo", sans-serif;
  font-weight: 900;
  font-size: 2rem;
  line-height: 0.9;
  color: color-mix(in srgb, var(--ink) 55%, transparent);
  grid-row: 1 / span 6;
  margin: 0;
}
.work h3 { font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.42rem); font-weight: 700; margin-bottom: 0.5rem; }
.work-sum { font-size: 0.96rem; color: var(--ink-soft); }
.work-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem 1.6rem;
  margin-top: 0.5rem;
}
.work-cols h4 {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0.7rem 0 0.4rem;
}
.work-cols h4:first-child { margin-top: 0; }
.work-cols ul { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.35rem; }
.work-cols li, .work-cols p { font-size: 0.9rem; color: var(--ink-soft); }
.work-extra {
  margin-top: 0.9rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  border-top: 1px dashed color-mix(in srgb, var(--ink) 25%, transparent);
  padding-top: 0.75rem;
}
.work-link { margin-top: 0.9rem; font-size: 0.93rem; }

/* ---------- counter ---------- */

.submit-section { background: var(--table-deep); }
.counter-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0.7rem;
}
.counter-list li {
  background: var(--film);
  color: var(--ink);
  border-left: var(--edge) solid var(--a);
  border-radius: 2px;
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  font-weight: 500;
}
.counter-foot { margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; font-size: 0.93rem; }

/* ---------- origin legend ---------- */

.legend {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0.8rem;
}
.legend li {
  background: var(--film);
  color: var(--ink);
  border-radius: 2px;
  padding: 0.9rem 1rem 1rem;
}
.legend li p { font-size: 0.88rem; color: var(--ink-soft); margin: 0.55rem 0 0; }

.origin-note {
  border: 1px solid var(--table-edge);
  border-left: var(--edge) solid var(--a-lit);
  border-radius: 2px;
  padding: 1.1rem 1.2rem;
  font-size: 0.98rem;
  color: color-mix(in srgb, var(--film) 86%, transparent);
}
.origin-note strong { color: var(--film); }

/* ---------- instruments ---------- */

.instruments-section { background: var(--table-deep); }
.instruments {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 0.8rem;
}
.instruments li {
  background: var(--film);
  color: var(--ink);
  border-radius: 2px;
  padding: 0.95rem 1.05rem 1.05rem;
  border-top: 2px solid var(--d);
  display: grid;
  gap: 0.35rem;
}
.inst-no {
  font-family: "Spline Sans Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.instruments a { font-size: 1rem; }
.instruments p { font-size: 0.86rem; color: var(--ink-soft); margin: 0; }
.q { font-family: "Petrona", Georgia, serif; font-style: italic; color: var(--ink); }

/* ---------- handoffs ---------- */

.handoff-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: clamp(1rem, 2vw, 1.6rem);
  align-items: start;
}
.handoff-group {
  background: var(--film);
  color: var(--ink);
  border-radius: 2px;
  padding: 1rem 1.1rem 1.15rem;
}
.handoff-group h3 { margin-bottom: 0.8rem; }
.handoff-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.handoff-group li { border-top: 1px solid color-mix(in srgb, var(--ink) 14%, transparent); padding-top: 0.7rem; }
.handoff-group li:first-child { border-top: 0; padding-top: 0; }
.handoff-group p { font-size: 0.86rem; color: var(--ink-soft); margin: 0.25rem 0 0; }

/* ---------- footer ---------- */

.foot {
  background: var(--table-deep);
  border-top: 1px solid var(--table-line);
  padding: clamp(2rem, 4vw, 3rem) 0;
}
.foot-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 1.5rem 2.5rem;
  align-items: start;
}
.foot-inner > * { min-width: 0; }
.foot-brand {
  font-family: "Chivo", sans-serif;
  font-weight: 900;
  font-size: clamp(0.92rem, 0.8rem + 0.5vw, 1.05rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
  overflow-wrap: anywhere;
}
.foot-brand span { color: var(--reg); }
.foot-line { font-size: 0.87rem; color: color-mix(in srgb, var(--film) 64%, transparent); }
.foot-disclaimer { font-size: 0.85rem; color: color-mix(in srgb, var(--film) 70%, transparent); }

/* ---------- responsive ---------- */

@media (max-width: 1080px) {
  .stack-layout { grid-template-columns: 1fr; }
  .readout { position: static; }
}

@media (max-width: 980px) {
  .masthead { position: static; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-figure { max-width: 30rem; }
  .split-grid { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: 1fr; }
  .foot-inner { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --shell: min(1220px, 100% - 1.75rem); }
  .plate-body { grid-template-columns: 1fr; }
  .sjra-cols { grid-template-columns: 1fr; }
  .work-cols { grid-template-columns: 1fr; }
  .work { grid-template-columns: 1fr; gap: 0; }
  .work-no { grid-row: auto; font-size: 1.4rem; margin-bottom: 0.3rem; }
  .agent-facts > div { grid-template-columns: 1fr; gap: 0.1rem; }
}

@media (max-width: 420px) {
  :root { --shell: min(1220px, 100% - 1.25rem); }
  .masthead-inner { padding: 0.6rem 0; }
  .masthead-out { width: 100%; justify-content: center; }
  .brand { margin-right: 0; }
  .triage { flex-direction: column; align-items: flex-start; gap: 0; }
  .btn { width: 100%; text-align: center; }
  .readout-list li { grid-template-columns: 14px minmax(0, 1fr); }
  .sw-state { grid-column: 2; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- print: the worksheet you take to the office ---------- */

@media print {
  :root { --shell: 100%; }

  body {
    background: #fff;
    color: #000;
    font-size: 10.5pt;
    line-height: 1.4;
  }

  .masthead, .hero-figure, .hero-actions, .skip,
  .readout-tools, .handoff-section, .foot-line { display: none !important; }

  .hero, .section, .foot, .band {
    padding: 0 0 0.5rem;
    background: #fff !important;
    border: 0;
  }

  .band-title { color: #000 !important; }
  .split-grid p {
    background: #fff !important;
    color: #000 !important;
    border: 1pt solid #000 !important;
    page-break-inside: avoid;
  }

  .hero h1 { font-size: 20pt; }
  .hero h1::after {
    content: " — jurisdiction worksheet";
    font-weight: 400;
    font-size: 12pt;
  }
  .lede, .lede-2, .section-lede, .scope, .durable-note,
  .origin-note, .third-record, .agents-boundary, .readout-warn, .foot-disclaimer {
    color: #000 !important;
  }

  .section-head h2 { font-size: 14pt; page-break-after: avoid; }
  .eyebrow { color: #444 !important; font-size: 8pt; }

  .plate, .agent, .work, .legend li, .instruments li,
  .counter-list li, .sjra-route, .readout, .origin-note, .third-record {
    background: #fff !important;
    color: #000 !important;
    border: 1pt solid #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 0.35rem;
  }

  .plate-field p, .plate-field li, .work-cols li, .work-cols p,
  .agent-facts dd, .instruments p, .legend li p, .sjra-doc-note {
    color: #000 !important;
  }

  .hatch, .sw { display: none !important; }
  .echo { display: inline-block !important; border: 1pt solid #000; }

  .triage { border: 1pt solid #000; background: #fff; }
  .triage label { min-height: 0; }

  a { text-decoration: none; color: #000 !important; }
  .instrument-list a::after,
  .instruments a::after,
  .agent-links a::after,
  .counter-foot a::after,
  .work-link a::after,
  .origin-note a::after {
    content: " [" attr(href) "]";
    font-family: "Spline Sans Mono", monospace;
    font-size: 8pt;
    word-break: break-all;
  }
  a[aria-hidden="true"], a span[aria-hidden="true"] { display: none; }

  .agents-boundary { border-left: 2pt solid #000; }
  .stack-layout, .plate-body, .sjra-cols, .work-cols,
  .agent-grid, .instruments, .legend, .counter-list, .split-grid { grid-template-columns: 1fr !important; }
}
