@font-face {
  font-family: Inter;
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}
:root {
  color-scheme: dark;
  font: 16px/1.5 Inter, "Segoe UI", sans-serif;
  --ink: #f2f1eb;
  --muted: #b6bbbe;
  --line: #43474b;
  --paper: #24272a;
  --ground: #191b1e;
  --well: #181a1c;
  --raised: #303438;
  --primary: #ffc568;
  --on-primary: #271d0b;
  --focus: #ffe0a6;
  color: var(--ink);
  background: var(--ground);
  accent-color: var(--primary);
}
* { box-sizing: border-box; }
body { margin: 0; }
h1,h2,h3,p,figure { margin: 0; }
h1,h2,h3 { font-family: "Space Grotesk", Inter, sans-serif; font-weight: 500; line-height: 1.12; text-wrap: balance; }
h1 { font-size: 3.15rem; letter-spacing: -.04em; }
h2 { font-size: 1.6rem; letter-spacing: -.025em; }
h3 { font-size: 1.16rem; }
a { color: var(--primary); text-underline-offset: .2em; }
button, input, select, textarea { font: inherit; }
button, summary, label:has(input[type=checkbox]) { cursor: pointer; }
button, input::file-selector-button {
  min-height: 44px; max-width: 100%; border: 1px solid #777c80; border-radius: 5px;
  padding: .57rem .95rem; color: var(--ink); background: var(--raised); font-weight: 600; line-height: 1.35;
}
button:hover:enabled, input::file-selector-button:hover { background: #404449; border-color: #959a9b; }
button.primary, button[aria-pressed=true] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
button.primary:hover:enabled, button[aria-pressed=true]:hover:enabled { background: #ffda96; }
button:disabled, input:disabled { opacity: .52; cursor: default; }
input:not([type=checkbox],[type=file]), select, textarea {
  min-width: 0; max-width: 100%; border: 1px solid #777c80; border-radius: 5px;
  padding: .65rem .8rem; background: var(--well); color: var(--ink); caret-color: var(--primary);
}
textarea { display: block; width: 100%; resize: vertical; line-height: 1.5; }
input[type=file] { display: block; width: 100%; min-width: 0; font-size: .89rem; }
input::file-selector-button { margin-right: .5rem; font-size: .86rem; cursor: pointer; }
input[type=checkbox] { accent-color: var(--primary); width: 18px; height: 18px; flex: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--primary); color: var(--on-primary); }
[hidden] { display: none !important; }
main { max-width: 1280px; margin: auto; padding-inline: clamp(1rem, 4vw, 4rem); }
.skip-link { position: absolute; top: 0; left: .5rem; padding: .6rem; background: var(--well); transform: translateY(-130%); z-index: 2; }
.skip-link:focus { transform: none; }
main { padding-block: 2.5rem 4rem; }
.page-title { margin-bottom: 1.8rem; }
.page-title p { color: var(--muted); max-width: 72ch; margin-top: .55rem; }
.job-layout { display: grid; align-items: start; grid-template-columns: minmax(0,1.65fr) minmax(290px,1fr); gap: 1.25rem; }
.card, .example-panel, .template { min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.card { padding: clamp(1rem, 2.4vw, 2rem); }
.brief > h2, .markup-form > h2 { margin-bottom: 1.15rem; }
label, summary { font-weight: 550; }
.muted, .privacy-note, .example-note { color: var(--muted); font-size: .92rem; }
#hint { margin: .3rem 0 .7rem; max-width: 65ch; }
#brief { min-height: 8rem; }
details { min-width: 0; }
summary { min-height: 44px; padding: .65rem 0; }
summary::marker { color: var(--primary); }
.sources, .lookup-choice { margin-block: .85rem; }
.sources { border-block: 1px solid var(--line); }
.sources summary { padding-block: .85rem; }
summary:hover { color: var(--primary); }
.lookup-choice { display: flex; align-items: start; gap: .6rem; min-height: 44px; font-size: .93rem; }
.lookup-choice input { margin: .2rem 0 0; }
.lookup-choice small { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
.actions, .card-title { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.brief-actions { margin: 1.25rem 0 .65rem; }
.privacy-note { font-size: .83rem; }
.resources { min-width: 0; display: grid; gap: .85rem; }
.example-panel { overflow: hidden; background: #222528; }
.reference-survey { position: relative; overflow: hidden; background: var(--well); }
.survey-image { display: block; width: 100%; height: clamp(215px,19vw,280px); }
.survey-image image { filter: saturate(.7) brightness(.81); }
.pavement-edges polyline { fill: none; stroke: #ffca68; stroke-width: 1.65px; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.reference-survey figcaption { position: absolute; bottom: .7rem; left: .8rem; display: flex; align-items: center; gap: .5rem; background: #202225; color: var(--ink); padding: .24rem .55rem; border-radius: 3px; font-size: .76rem; }
.reference-survey figcaption::before { content: ""; width: 1.2rem; border-top: 2px solid #ffca68; }
.example-body { padding: 1.15rem 1.35rem; }
.example-body h2 { font-size: 1.5rem; }
.example-body > p { margin-top: .3rem; }
.example-note { color: var(--muted); }
.example-body button { margin-top: .9rem; }
.example-body .credit { color: var(--muted); margin-top: .85rem; font-size: .76rem; }
.credit a { color: inherit; }
.template { background: transparent; padding: .2rem 1.1rem; }
.template[open] { padding-bottom: 1rem; }
.template p { font-size: .9rem; color: var(--muted); }
.intake-sources, .markup-form { display: grid; gap: 1rem; }
.intake-sources { padding-bottom: 1rem; }
.intake-sources label, .intake-field label, .file-label { display: block; }
.intake-sources label + input, .file-label input, .file-label textarea { margin-top: .4rem; }
.intake-sources textarea { margin-top: .4rem; }
.intake-sources label:not(:first-child) { margin-top: .6rem; }
.intake-sources img, #registered img { display: block; max-width: 100%; max-height: 22rem; object-fit: contain; margin-top: .6rem; }
.message:not(:empty) { background: #343331; border-radius: 6px; padding: .7rem .95rem; margin-block: 1rem; overflow-wrap: anywhere; }
#intake, #result, #workspace { margin-top: 1.25rem; }
#registered { margin: 1rem 0; color: var(--muted); }
#registered img { border-radius: 6px; }
.research-tools { background: var(--raised); padding: .15rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.research-tools[open] { padding-bottom: 1rem; }
.research-tools li { margin-block: .45rem; max-width: 76ch; }
.research-tools details, #review-content details { border-top: 1px solid var(--line); margin-top: .55rem; }
.research-tools p { max-width: 72ch; margin-bottom: .6rem; }
#wa-lookup, #count-selection { display: flex; flex-wrap: wrap; align-items: end; gap: .65rem; }
#wa-lookup label, #count-selection label { display: block; max-width: 100%; }
#wa-lookup input, #count-selection select { display: block; }
#count-rows, #lookup-results { overflow-wrap: anywhere; }
.field-group { border-top: 1px solid var(--line); }
.field-group > summary { padding: .85rem .1rem; font-size: 1.06rem; }
.field-count { color: var(--primary); font-size: .88rem; margin-left: .5rem; font-variant-numeric: tabular-nums; }
.field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.25rem; padding-block: .5rem 1.25rem; }
.intake-field, #handoff, #source-notes { min-width: 0; overflow-wrap: anywhere; }
.intake-field input, .intake-field textarea { width: 100%; margin: .45rem 0; }
.intake-field p { font-size: .93rem; }
.intake-field .stale-decision { color: #ffd49b; font-weight: 650; }
.handoff-block { background: var(--well); padding: 1.15rem; border-radius: 8px; margin: 1.25rem 0; }
#handoff { white-space: pre-wrap; font: inherit; }
.card-title { justify-content: space-between; margin-bottom: .8rem; }
.sheet-frame, .canvas { overflow: auto; background: #101214; border-radius: 7px; padding: .65rem; }
.sheet-frame img, .canvas svg { display: block; width: 100%; height: auto; }
.sheet-frame.enlarged img { min-width: 1800px; }
#planner-review { margin-bottom: 1rem; }
.markup-form { max-width: 54rem; }
.markup-form > h2 { margin-bottom: 0; }
#workspace > p, #sheets { margin-block: .9rem; }
#sheets { display: flex; flex-wrap: wrap; gap: .5rem; }
.badge { color: #ffce84; font-size: .9rem; }
#source-notes { white-space: pre-line; margin-top: .7rem; }
@media (max-width: 780px) {
  .job-layout { grid-template-columns: 1fr; }
  .resources { grid-template-columns: 1fr; }
  .example-panel { display: grid; grid-template-columns: minmax(120px,.75fr) 1fr; }
  .survey-image { height: 100%; min-height: 200px; }
}
@media (max-width: 600px) {
  main { padding-block: 1.35rem 2.5rem; }
  h1 { font-size: 2.15rem; }
  .page-title { margin-bottom: 1.1rem; }
  .field-grid { grid-template-columns: 1fr; }
  .actions button { flex: 1 1 12rem; }
  .card-title .actions { width: 100%; }
  .research-tools { padding-inline: .65rem; }
}
@media (max-width: 420px) {
  .example-panel { display: block; }
  .survey-image { min-height: 0; height: 180px; }
  .brief-actions { display: grid; }
}
