/* StreetCase: calm civic "case file" look. Paper, ink, one teal, one signal orange.
   Contrast: every text color below is at least 4.5:1 on its background. */

:root {
  --paper: #f6f3ea;
  --card: #fffdf8;
  --ink: #1b2629;
  --muted: #4a5559;
  --rule: #cfc8b6;
  --teal: #0b4f5c;
  --teal-dark: #073842;
  --teal-tint: #e3eeee;
  --signal: #b23a00;
  --signal-tint: #fbe9df;
  --danger: #6b0f1a;
  --slate: #3d4d5c;
  --focus: #ffbf47;
  --radius: 6px;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { font-size: 112.5%; -webkit-text-size-adjust: 100%; } /* 18 px base */
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
}
img, svg { max-width: 100%; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--teal-dark); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; box-shadow: 0 0 0 6px var(--focus); }
main:focus { outline: none; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); margin: 0.3em 0 0.4em; }
h2 { font-size: clamp(1.45rem, 3.4vw, 1.9rem); margin: 0 0 0.6em; }
h3 { font-size: 1.2rem; margin: 1.4em 0 0.5em; }
p, ul, ol { margin: 0 0 1em; }
q { font-style: italic; }
.wrap { max-width: 72rem; margin: 0 auto; padding: 0 1rem; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.92rem; margin-top: 0.3rem; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0.5rem; background: var(--ink); color: #fff; padding: 0.6rem 1rem; z-index: 10; border-radius: var(--radius); }
.skip:focus { left: 0.5rem; }
.ico { width: 1em; height: 1em; vertical-align: -0.12em; fill: currentColor; }

/* ---------- header and footer ---------- */
.site-header { background: var(--ink); color: #fff; border-bottom: 6px solid var(--signal); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1.5rem; padding-top: 0.7rem; padding-bottom: 0.7rem; }
.brand { color: #fff; text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.2rem; display: inline-flex; align-items: center; gap: 0.55rem; }
.brand:hover { color: #fff; }
.brand-mark {
  width: 1.5rem; height: 1.5rem; border-radius: 3px; flex: none;
  background: linear-gradient(135deg, var(--paper) 0 40%, var(--signal) 40% 60%, var(--paper) 60% 100%);
}
.site-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; margin: 0; padding: 0; }
.site-nav a { color: #fff; text-decoration: none; padding: 0.3rem 0; border-bottom: 3px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--focus); color: #fff; }
.site-footer { margin-top: 3rem; padding: 2rem 0; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.92rem; }

/* ---------- buttons and forms ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem; min-height: 2.75rem; padding: 0.55rem 1rem;
  font: inherit; font-size: 0.95rem; font-weight: 600; line-height: 1.2; color: var(--teal-dark);
  background: var(--card); border: 2px solid var(--teal); border-radius: var(--radius); cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--teal-tint); color: var(--teal-dark); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
.btn-small { min-height: 2.4rem; padding: 0.35rem 0.8rem; font-size: 0.9rem; }
.btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
input[type="text"], textarea, select {
  font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--slate); border-radius: var(--radius);
  padding: 0.55rem 0.7rem; width: 100%; max-width: 100%;
}
textarea { font-family: var(--sans); line-height: 1.55; }
label { font-weight: 600; display: block; margin: 0.6rem 0 0.25rem; }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.8rem 1rem 1rem; margin: 0 0 1.2rem; background: var(--card); }
legend { font-family: var(--serif); font-weight: 700; font-size: 1.1rem; padding: 0 0.3rem; }
input[type="checkbox"], input[type="radio"] { width: 1.25rem; height: 1.25rem; accent-color: var(--teal); flex: none; margin: 0.2rem 0 0; }
.status { min-height: 1.4em; font-weight: 600; color: var(--teal-dark); }
.status-box { background: var(--card); border: 1px solid var(--rule); border-left: 6px solid var(--teal); padding: 1rem 1.2rem; margin: 2rem 0; border-radius: var(--radius); }

/* ---------- home ---------- */
.hero { background: var(--teal-tint); border-bottom: 1px solid var(--rule); padding: 2rem 0 1.5rem; }
.hero h1 { max-width: 22ch; }
.lede { font-size: 1.15rem; max-width: 42rem; }
.search { max-width: 46rem; }
.search-label { font-size: 1.15rem; font-family: var(--serif); }
.combo { position: relative; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.combo input { flex: 1 1 16rem; font-size: 1.2rem; min-height: 3.2rem; border-width: 3px; border-color: var(--teal); }
.combo .btn { min-height: 3.2rem; font-size: 1.05rem; }
#q-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 5; margin: 0.25rem 0 0; padding: 0; list-style: none;
  background: #fff; border: 2px solid var(--teal); border-radius: var(--radius); max-height: 18rem; overflow-y: auto;
  box-shadow: 0 8px 20px rgb(0 0 0 / 0.15);
}
#q-list li { padding: 0.6rem 0.8rem; cursor: pointer; border-bottom: 1px solid var(--rule); }
#q-list li[aria-selected="true"], #q-list li:hover { background: var(--teal); color: #fff; }
#q-list li[aria-selected="true"] .sug-kind, #q-list li:hover .sug-kind { color: #fff; }
.sug-kind { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.radius { background: transparent; border: 0; padding: 0; margin-top: 1rem; }
.radius legend { padding: 0; margin-bottom: 0.4rem; }
.radius-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.5rem; }
.radio { display: flex; gap: 0.6rem; font-weight: 400; margin: 0; padding: 0.6rem 0.8rem; background: var(--card); border: 2px solid var(--rule); border-radius: var(--radius); cursor: pointer; }
.radio:has(input:checked) { border-color: var(--teal); background: #fff; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 30rem), 1fr)); gap: 0 2.5rem; margin-top: 2rem; }
.big-numbers { list-style: none; padding: 0; display: grid; gap: 0.8rem; }
.big-numbers li { display: grid; grid-template-columns: minmax(6.5rem, auto) 1fr; gap: 0.8rem; align-items: baseline; border-bottom: 1px solid var(--rule); padding-bottom: 0.6rem; }
.big-numbers strong { font-family: var(--serif); font-size: 2.2rem; color: var(--signal); line-height: 1; text-align: right; }
.incidents { list-style: none; padding: 0; }
.incidents li { border-left: 4px solid var(--signal); padding: 0.3rem 0 0.3rem 0.8rem; margin-bottom: 0.7rem; background: var(--card); }
.inc-type { font-weight: 700; display: block; }
.inc-place, .inc-time { display: block; }
.inc-time { color: var(--muted); font-size: 0.92rem; }

/* ---------- cards ---------- */
.cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1rem; }
.card { background: var(--card); border: 1px solid var(--rule); border-top: 5px solid var(--teal); border-radius: var(--radius); padding: 1rem 1.1rem; }
.card h3 { margin-top: 0; }
.card .note { background: var(--signal-tint); padding: 0.5rem 0.7rem; border-radius: 4px; font-size: 0.95rem; }
.src { font-size: 0.88rem; color: var(--muted); }
.src-label { font-weight: 600; }
.tag { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid var(--slate); padding: 0 0.3rem; border-radius: 3px; }

/* ---------- report ---------- */
.report-head { background: var(--card); border-bottom: 1px solid var(--rule); padding: 1.2rem 0 1.5rem; }
.eyebrow { font-family: var(--sans); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; color: var(--muted); margin: 0; }
.step {
  display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 0.25em; margin-right: 0.35em;
  background: var(--ink); color: #fff; font-family: var(--sans); font-size: 0.75em; font-weight: 700; border-radius: 3px; vertical-align: 0.15em;
}
.eyebrow .step { font-size: 0.95em; }
.kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0 0 0.4rem; }
.scope { color: var(--muted); font-size: 0.92rem; }
.verdict { font-family: var(--serif); font-size: clamp(1.25rem, 3vw, 1.6rem); line-height: 1.4; max-width: 46rem; margin: 0.4rem 0 1rem; }
.badge { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 700; font-size: 0.85rem; padding: 0.15rem 0.55rem; border-radius: 3px; border: 2px solid; }
.badge-high { background: var(--danger); border-color: var(--danger); color: #fff; }
.badge-medium { background: var(--signal-tint); border-color: var(--signal); color: #7a2800; }
.badge-low, .badge-info { background: #eef0f2; border-color: var(--slate); color: var(--slate); }
.tally { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0.6rem; max-width: 52rem; }
.tally li { border-left: 4px solid var(--teal); padding: 0.2rem 0.7rem; background: var(--paper); }
.tally strong { display: block; font-family: var(--serif); font-size: 1.9rem; line-height: 1.1; }
.tally span { font-size: 0.9rem; color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.5rem 0 0; }

.report-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; margin-top: 1.5rem; }
.report-body { min-width: 0; }
h1, h2, h3, .finding-head { overflow-wrap: break-word; }
@media (min-width: 64rem) {
  .report-grid { grid-template-columns: 14rem minmax(0, 1fr); }
  .toc { position: sticky; top: 1rem; align-self: start; }
}
.toc { font-size: 0.92rem; }
.toc-h { font-weight: 700; margin-bottom: 0.3rem; }
.toc ol { padding-left: 1.4rem; margin: 0; }
.toc li { margin: 0.2rem 0; }
.sec { padding: 1.5rem 0 1rem; border-top: 3px solid var(--ink); margin-top: 1rem; }
.report-body > .sec:first-child { border-top: 0; margin-top: 0; padding-top: 0; }

.findings { list-style: none; padding: 0; margin: 0; counter-reset: none; }
.finding { background: var(--card); border: 1px solid var(--rule); border-left: 6px solid var(--slate); border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1rem; }
.finding-high { border-left-color: var(--danger); }
.finding-medium { border-left-color: var(--signal); }
.finding-sev { display: flex; gap: 0.6rem; align-items: center; margin: 0 0 0.3rem; font-size: 0.85rem; }
.finding-n { color: var(--muted); }
.finding-head { font-size: clamp(1.2rem, 2.6vw, 1.45rem); margin: 0.2rem 0 0.6rem; }
.why { background: var(--teal-tint); padding: 0.5rem 0.7rem; border-radius: 4px; }
.detail { color: var(--ink); }
details.more summary, .table-wrap summary, .facts-src summary { cursor: pointer; font-weight: 600; color: var(--teal); padding: 0.3rem 0; }

.glance { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.4rem 1.2rem 1rem; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); gap: 0.2rem 1.5rem; margin: 0 0 0.6rem; }
.facts div { border-bottom: 1px dotted var(--rule); padding: 0.35rem 0; }
.facts dt { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }

.map-filters { display: grid; gap: 0.1rem; }
.map-filters label { display: flex; gap: 0.6rem; font-weight: 400; margin: 0.25rem 0; }
.map-wrap { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 52rem) { .map-wrap { grid-template-columns: minmax(0, 1fr) 15rem; } }
.map { height: 26rem; min-height: 18rem; border: 2px solid var(--ink); border-radius: var(--radius); background: #e8e4d8; }
.map-legend { font-size: 0.9rem; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.6rem 0.9rem; }
.legend-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.5rem; }
.legend-h { font-weight: 700; margin: 0.3rem 0; }
.map-legend ul { list-style: none; padding: 0; margin: 0; }
.map-legend li { display: grid; grid-template-columns: 1.6rem 1fr; align-items: center; gap: 0.4rem; margin: 0.25rem 0; }
.map-legend svg { justify-self: center; }
.map-msg { color: var(--muted); }
.notable li { margin-bottom: 0.6rem; }

.chart { margin: 0 0 2rem; }
.chart figcaption { margin-bottom: 0.4rem; }
.svg-chart { width: 100%; height: auto; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); }
.svg-chart .tick, .svg-chart .val { font: 12px var(--sans); fill: var(--muted); }
.svg-chart .val { fill: var(--ink); font-weight: 700; }
/* SVG text shrinks with the viewBox: on narrow screens make chart labels bigger in chart units so they stay about 9 to 10 px. */
@media (max-width: 36rem) { .svg-chart .tick, .svg-chart .val { font-size: 21px; } }
.grid { stroke: var(--rule); stroke-width: 1; }
.fill-a { fill: var(--teal); }
.fill-c { fill: var(--slate); }
.fill-b-bg { fill: var(--signal-tint); }
.stroke-b { stroke: var(--signal); }
.outline-b { stroke: var(--signal); stroke-width: 1; }
.legend { font-size: 0.9rem; }
.key { display: inline-block; width: 1.1rem; height: 0.8rem; vertical-align: -0.05rem; margin-left: 0.6rem; border: 1px solid var(--ink); }
.key-a { background: var(--teal); }
.key-b { background: repeating-linear-gradient(45deg, var(--signal) 0 3px, var(--signal-tint) 3px 6px); }

table.data { border-collapse: collapse; width: 100%; background: var(--card); font-size: 0.95rem; margin: 0.4rem 0 1rem; }
table.data caption { text-align: left; font-weight: 700; padding: 0.4rem 0; }
table.data th, table.data td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.data thead th { background: var(--ink); color: #fff; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.glare-table td, .glare-table th { white-space: normal; }
.glare-vis { width: 40%; min-width: 9rem; }
.glare-svg { display: block; }
@media (max-width: 36rem) { .glare-vis { display: none; } }

.tier { margin-bottom: 1.2rem; }
.tier h3 { margin-bottom: 0.2rem; }
.tier-why { color: var(--muted); }
.people { list-style: none; padding: 0; }
.people li { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.7rem 0.9rem; margin-bottom: 0.6rem; overflow-wrap: anywhere; }
.why-them { color: var(--muted); font-size: 0.95rem; }
.plans li { margin-bottom: 0.7rem; }

.composer .checks, .composer .forms { list-style: none; padding: 0; margin: 0; }
.composer .checks li { display: flex; gap: 0.6rem; align-items: flex-start; padding: 0.35rem 0; border-bottom: 1px dotted var(--rule); }
.composer .checks label { font-weight: 400; margin: 0; overflow-wrap: anywhere; }
.composer .forms li { margin-bottom: 0.8rem; }
.composer textarea { min-height: 22rem; }
#bracket-warning { color: #7a2800; font-weight: 600; }
.print-only { display: none; }
.share-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.share-row input { flex: 1 1 18rem; }
.caveats li { margin-bottom: 0.5rem; }

/* ---------- region ---------- */
.region-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0.4rem 1rem; align-items: end; }
.region-controls label { margin-top: 0; }
.corridors th button { all: unset; cursor: pointer; font-weight: 700; display: inline-block; padding: 0.1rem 0; }
.corridors th button:focus-visible { outline: 3px solid var(--focus); }
.corridors tbody th { font-weight: 400; }
.compare .current th, .compare .current td { background: var(--teal-tint); font-weight: 700; }
.hbar { display: block; height: 0.8rem; background: var(--signal); min-width: 2px; }

/* ---------- prose (learn, act, about) ---------- */
.prose { max-width: 44rem; }
.prose table { border-collapse: collapse; width: 100%; background: var(--card); font-size: 0.95rem; }
.prose th, .prose td { border: 1px solid var(--rule); padding: 0.4rem 0.6rem; text-align: left; vertical-align: top; }
.prose thead th { background: var(--ink); color: #fff; }
.prose blockquote { margin: 1rem 0; padding: 0.6rem 1rem; border-left: 5px solid var(--teal); background: var(--card); }
.prose li { margin-bottom: 0.35rem; }
.summary { font-size: 1.15rem; font-family: var(--serif); }
.learn-list { list-style: none; padding: 0; }
.learn-list li { border-bottom: 1px solid var(--rule); padding: 0.8rem 0; }
.learn-list a { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; }
.draft-note { background: var(--signal-tint); border-left: 5px solid var(--signal); padding: 0.5rem 0.8rem; border-radius: 4px; }
.dir-group { margin-bottom: 2rem; }
.dir-table td, .dir-table th { overflow-wrap: anywhere; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ---------- print ---------- */
@media print {
  html { font-size: 11pt; }
  body { background: #fff; }
  .site-header, .site-nav, .toc, .skip, .head-actions, .map-filters, .map-wrap, .map-msg, .btn, .btns, .share-row,
  .composer fieldset,
  #q-list, .site-footer a { display: none !important; }
  .print-only { display: block !important; white-space: pre-wrap; font-family: var(--sans); border: 1px solid #999; padding: 0.6rem; }
  .report-grid { display: block; }
  .sec { break-inside: auto; border-top: 2px solid #000; }
  .finding, .card, .chart, .people li, table.data tr { break-inside: avoid; }
  a { color: #000; }
  .report-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.8em; color: #333; overflow-wrap: anywhere; }
  .report-head, .card, .finding, .glance, fieldset { background: #fff; }
}

/* Conditions here (site/js/render-env.js) */
.profile-line { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.profile-area { opacity: 0.35; }
.svg-chart .mark { fill: var(--card); stroke: var(--ink); stroke-width: 2; }
.lede-sm { font-size: 1.05rem; }
.env-facts th { width: 55%; font-weight: 600; }

/* ---------- projects and money (site/js/render-projects.js) ---------- */
.projects { list-style: none; padding: 0; margin: 0 0 1rem; }
.project { border-top: 1px solid var(--rule); padding: 0.75rem 0; }
.project-name { margin: 0 0 0.25rem; font-size: 1.1rem; }
.project-meta { margin: 0.15rem 0; }
.stale { border-left: 4px solid var(--signal); background: var(--signal-tint); padding: 0.5rem 0.75rem; margin: 0.5rem 0; }
.phase-steps { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }
.phase-steps li { padding: 0.25rem 0.5rem; border: 1px solid var(--rule); border-radius: var(--radius); }
.phase-steps .ps-now { border: 2px solid var(--ink); font-weight: 700; background: var(--teal-tint); }
.phase-steps .ps-todo { color: var(--muted); }
.ps-word { font-size: 0.85rem; }
.timeline { padding-left: 1.25rem; }
.timeline li { margin: 0.4rem 0; }
.money-h { margin-bottom: 0.2rem; }
.money-meta { margin-top: 0; }
.money-bars { list-style: none; padding: 0; margin: 0.5rem 0; }
.money-bars li { margin: 0 0 0.55rem; }
.money-label { display: block; font-weight: 600; font-size: 0.95rem; line-height: 1.3; overflow-wrap: anywhere; }
.money-part .money-label { font-weight: 400; padding-left: 1rem; }
.money-bar { display: block; width: 100%; height: 0.7rem; margin-top: 0.15rem; }
.money-agency { border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.4rem 0.8rem; margin: 0.6rem 0; }
.money-agency > summary { font-weight: 700; cursor: pointer; }
.note-box { border-left: 4px solid var(--ink); background: var(--card); padding: 0.5rem 0.8rem; }
.agency-words { margin: 0.75rem 0; padding: 0.5rem 1rem; border-left: 4px solid var(--teal); background: var(--card); }
.weigh li { margin: 0.35rem 0; }
@media print { .phase-steps .ps-now { background: none; } }

/* ---------- street viewer (site/street.html, site/js/street3d/) ---------- */
.illus-banner { border: 3px solid var(--ink); background: #fff3c4; padding: 0.5rem 0.9rem; margin: 0.8rem 0; border-radius: var(--radius); }
.illus-banner p { margin: 0.2rem 0; }
.compare-pick .radius-opts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr)); }
.viewer-controls { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: flex-start; }
.viewer-controls fieldset { margin: 0 0 0.6rem; padding: 0.4rem 0.8rem 0.6rem; }
.viewer-controls legend { font-size: 0.95rem; }
.viewer-controls .btn { margin: 0.15rem 0.2rem 0.15rem 0; }
.viewer-controls .btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.ctx-opt { display: inline-flex; gap: 0.4rem; align-items: center; font-weight: 400; margin-right: 0.8rem; }
#ctx-sun { min-height: 2.4rem; width: auto; max-width: 100%; display: inline-block; }
#sliderWrap label { font-weight: 600; display: block; }
#split { width: 100%; min-height: 44px; }
#stage { position: relative; width: 100%; height: 34rem; max-height: 70vh; min-height: 20rem; border: 2px solid var(--ink); border-radius: var(--radius); background: #dfe7ee; touch-action: none; overflow: hidden; }
#stage[hidden] { display: none; }
[data-view][hidden] { display: none; }
#stage canvas { display: block; width: 100%; height: 100%; }
/* Narrow screens: a smaller stage, and one-finger vertical swipes scroll the page instead of turning the view. */
@media (max-width: 36rem) { #stage { height: 50vh; max-height: 50vh; min-height: 16rem; touch-action: pan-y; } }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#labels .dim { position: absolute; transform: translate(-50%, -50%); background: rgba(255, 255, 255, 0.94); color: #111; border: 1px solid #333; font: 600 12px/1.2 var(--sans); padding: 1px 4px; border-radius: 3px; white-space: nowrap; }
#labels .tag3d { position: absolute; background: var(--ink); color: #fff; padding: 2px 8px; font: 700 13px/1.4 var(--sans); border-radius: 3px; }
#labels .gap { position: absolute; transform: translate(-50%, -50%); background: rgba(17, 17, 17, 0.82); color: #fff; border: 1px dashed #fff; font: 600 12px/1.2 var(--sans); padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.cap-note { margin: 0.4rem 0; }
.phone-only { display: none; }
@media (max-width: 36rem) {
  .phone-only { display: inline; }
  .fig-scroll { overflow-x: auto; }
  .fig-scroll svg.map2d { min-width: 640px; }
  .fig-scroll svg.xs2d { min-width: 720px; }
}
#labels .split-line { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--ink); }
.tag3d-static { position: absolute; left: 0.5rem; top: 0.5rem; margin: 0; max-width: calc(100% - 1rem); background: var(--ink); color: #fff; padding: 2px 8px; font: 700 13px/1.4 var(--sans); border-radius: 3px; pointer-events: none; }
.tag3d-static:empty { display: none; }
.map-fig, .xs-fig { margin: 0 0 1rem; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.5rem; }
.map-fig svg, .xs-fig svg { display: block; width: 100%; height: auto; }
.map-fig figcaption { font-size: 0.95rem; margin-top: 0.4rem; }
.map-legend { list-style: none; padding: 0; margin: 0 0 1rem; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; font-size: 0.95rem; }
.map-legend li { display: flex; align-items: center; gap: 0.4rem; }
.map-legend svg { background: #8c9184; border-radius: 2px; flex: none; }
.xs-problems li { margin: 0.25rem 0; }
#flat figure { margin: 0 0 1rem; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 0.5rem; }
#flat figcaption { font-weight: 700; }
.xs-svg { width: 100%; height: auto; display: block; }
.xs-tables { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 1.5rem; }
@media (min-width: 72rem) { .xs-tables.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.xs-flag { border-left: 6px solid var(--signal); background: var(--signal-tint); padding: 0.3rem 0.7rem; }
.width-math { background: var(--card); border: 1px solid var(--rule); border-left: 6px solid var(--teal); border-radius: var(--radius); padding: 0.4rem 1rem 0.6rem; margin: 1rem 0; }
.width-math .fits strong, .width-math .differs strong { font-family: var(--serif); }
.ctx-list li, .plan-ctx li { margin: 0.5rem 0; }
.ctx-cav { display: block; color: var(--muted); }
kbd { border: 1px solid #888; border-bottom-width: 2px; border-radius: 3px; padding: 0 4px; font-size: 0.85em; background: #fff; }
.street-link { margin: 0.6rem 0; }
@media print { #stage, .viewer-controls, #sliderWrap, .compare-pick { display: none; } #flat { display: block; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.in3d { font-size: 0.9rem; }
.viewer-controls .btn:disabled, .viewer-controls input:disabled + * { opacity: 0.55; cursor: not-allowed; }
