/* Layout: map fills the screen; a left rail holds search, filters, list and detail.
   On phones the rail becomes a bottom sheet with a drag handle.
   One look by choice: prairie daylight, set explicitly. */
:root {
  --ground: #e6ece9; --panel: #fbfcfb; --ink: #12252d; --ink2: #4d626b; --line: #d5deda; --soft: #eef3f0;
  --construction: #d9480f; --approved: #a87900; --planned: #4f52c9; --open: #0a7a5e; --stalled: #6d787d; --bond: #2b6c95;
  --sans: "Overpass", "Highway Gothic", "Segoe UI", system-ui, sans-serif;
  --mono: "Overpass Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --rail: 384px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--ground); color: var(--ink); font: 15px/1.45 var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: #1c5d86; }
:focus-visible { outline: 3px solid #1c5d86; outline-offset: 2px; }
[hidden] { display: none !important; }

#map { position: fixed; inset: 0 0 0 var(--rail); background: var(--ground); }
#rail { position: fixed; inset: 0 auto 0 0; width: var(--rail); background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; z-index: 5; min-height: 0;
  padding-top: env(safe-area-inset-top, 0px); padding-left: env(safe-area-inset-left, 0px); }

.head { padding: 18px 20px 12px; display: grid; gap: 4px; }
.head h1 { margin: 0; font-size: 27px; line-height: 1; font-weight: 900; letter-spacing: -.02em; text-wrap: balance; }
.head p { margin: 0; color: var(--ink2); font-size: 14px; }
.tools { padding: 0 20px 12px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; border-bottom: 1px solid var(--line); }
.search { width: 100%; height: 40px; border: 1px solid #b9c6c1; border-radius: 4px; padding: 2px 12px 0; background: #fff; }
.search::placeholder { color: #64767e; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 2px 10px 0 8px; border: 1px solid var(--line); border-radius: 16px; background: #fff; font-size: 13.5px; font-weight: 600; }
.chip[aria-pressed="false"] { background: transparent; color: #6b7c83; font-weight: 400; text-decoration: line-through; text-decoration-color: #9aa8ad; }
.chip[aria-pressed="false"] svg { opacity: .35; }
.chip svg { margin-top: -2px; }
.chip b { font: 600 12.5px/1 var(--mono); color: var(--ink2); }
.row { display: flex; gap: 8px; }
.row select { flex: 1; min-width: 0; height: 36px; border: 1px solid var(--line); border-radius: 4px; background: #fff; padding: 2px 6px 0; font-size: 13.5px; }
.count { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 20px 8px; font-size: 13.5px; color: var(--ink2); }
.count label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; white-space: nowrap; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

.list { list-style: none; margin: 0; padding: 0; }
.item { display: grid; grid-template-columns: 22px 1fr auto; gap: 2px 10px; width: 100%; text-align: left; border: 0; background: none; padding: 11px 20px; border-top: 1px solid var(--line); }
.item:hover { background: var(--soft); }
.item svg { grid-row: 1 / 3; margin-top: 1px; }
.item .nm { font-weight: 700; line-height: 1.25; min-width: 0; }
.item .co { font: 600 13px/1.5 var(--mono); white-space: nowrap; }
.item .mt { grid-column: 2 / 4; color: var(--ink2); font-size: 13.5px; }
.empty { padding: 24px 20px; color: var(--ink2); }
.empty button { margin-top: 8px; }

.foot { border-top: 1px solid var(--line); padding: 9px 20px calc(9px + env(safe-area-inset-bottom, 0px)); display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--ink2); }
.link { border: 0; background: none; padding: 0; color: #1c5d86; text-decoration: underline; text-underline-offset: 2px; }

/* detail */
.detail { padding: 14px 20px 24px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.back { justify-self: start; border: 1px solid var(--line); background: #fff; border-radius: 4px; height: 34px; padding: 2px 12px 0; font-size: 13.5px; font-weight: 600; }
.pill { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; }
.detail h2 { margin: 0; font-size: 25px; line-height: 1.08; font-weight: 800; letter-spacing: -.015em; text-wrap: balance; }
.detail .where { color: var(--ink2); margin: 0; }
.detail p { margin: 0; }
.state { border-left: 0; background: var(--soft); border-radius: 6px; padding: 12px 14px; display: grid; gap: 4px; }
.state small { color: var(--ink2); font-size: 13px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 0 18px; margin: 0; }
.facts dt { color: var(--ink2); padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.facts dd { margin: 0; padding: 7px 0; border-top: 1px solid var(--line); text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.facts dd small { display: block; font-weight: 400; color: var(--ink2); font-size: 13px; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { border: 1px solid var(--ink); background: var(--ink); color: #fff; height: 38px; border-radius: 4px; padding: 2px 14px 0; font-weight: 700; font-size: 14px; }
.btn.alt { background: #fff; color: var(--ink); border-color: #b9c6c1; }
.btn:hover { filter: brightness(1.15); } .btn.alt:hover { background: var(--soft); filter: none; }
.sub { font-size: 14px; font-weight: 800; margin: 4px 0 -6px; }
.note { font-size: 13.5px; color: var(--ink2); }
.srcs { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; font-size: 13.5px; }
.srcs li { min-width: 0; overflow-wrap: anywhere; }
.srcs span { color: var(--ink2); display: block; }
.tall { width: 100%; height: auto; display: block; }

.gal { margin: 0 -20px; background: var(--soft); border-block: 1px solid var(--line); }
.track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; } .track::-webkit-scrollbar { display: none; }
.track figure { flex: 0 0 100%; margin: 0; scroll-snap-align: start; min-width: 0; }
.track button { display: block; width: 100%; border: 0; padding: 0; background: #dfe6e2; position: relative; cursor: zoom-in; }
.track img { display: block; width: 100%; height: 236px; object-fit: cover; }
.spr { display: block; position: relative; overflow: hidden; background: #dfe6e2; } .spr > span { position: absolute; display: block; background-repeat: no-repeat; }
.track .spr { --gh: 236px; width: 100%; height: var(--gh); } .track .spr > span { left: 50%; top: 50%; transform: translate(-50%, -50%); width: max(100%, calc(var(--gh) * var(--ar))); aspect-ratio: var(--ar); }
.lb .spr { width: min(100%, calc((100dvh - 150px) * var(--ar))); aspect-ratio: var(--ar); margin: 0 auto; background: #0d1b21; } .lb .spr > span { inset: 0; }
.track .kind { position: absolute; top: 10px; left: 12px; background: rgba(18, 28, 32, .78); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; padding: 3px 8px 2px; border-radius: 4px; pointer-events: none; }
.ring { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #12252d88, inset 0 0 0 1px #12252d55; pointer-events: none; }
.track figcaption { padding: 9px 20px 10px; font-size: 13.5px; line-height: 1.35; } .track figcaption small { display: block; color: var(--ink2); font-size: 12.5px; margin-top: 1px; } .track figcaption small a { color: inherit; text-underline-offset: 2px; }
.galnav { display: flex; align-items: center; justify-content: space-between; padding: 0 20px 10px; font-size: 13px; color: var(--ink2); } .galnav button { border: 1px solid #b9c6c1; background: #fff; border-radius: 4px; width: 40px; height: 32px; padding-top: 2px; }
.official { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; border: 1px solid #b9c6c1; border-radius: 4px; padding: 9px 14px 7px; text-decoration: none; color: var(--ink); background: #fff; font-size: 14px; } .official:hover { background: var(--soft); } .official span { color: var(--ink2); font-size: 13px; text-align: right; min-width: 0; }
.tog { display: inline-flex; gap: 12px; } .tag { grid-column: 3; justify-self: end; align-self: center; font: 600 11.5px/1 var(--mono); color: var(--ink2); border: 1px solid #b9c6c1; border-radius: 3px; padding: 3px 4px 1px; } .item .mt { grid-column: 2 / 3; }
.light { width: min(1160px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: #0d1b21; color: #fff; } .lb { display: grid; } .lb img { width: 100%; max-height: calc(100dvh - 150px); object-fit: contain; display: block; background: #0d1b21; }
.lbc { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px 14px; } .lbc b { display: block; } .lbc span { font-size: 13px; color: #c4d2d6; } .lbc a { color: #bfe0ee; } .lbn { display: flex; gap: 8px; }

.mode { margin-top: 10px; box-shadow: none; align-self: start; justify-self: start; } .mode button { height: 34px; padding: 2px 16px 0; }
.money { padding: 12px 20px 4px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.money .hero { margin: 0; display: grid; gap: 2px; } .money .hero b { font-size: 34px; line-height: 1; font-weight: 800; letter-spacing: -.02em; } .money .hero span { color: var(--ink2); font-size: 14px; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bars button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; width: 100%; text-align: left; background: none; border: 0; padding: 6px 6px 5px; margin: 0 -6px; border-radius: 4px; width: calc(100% + 12px); }
.bars button:hover, .bars button:focus-visible { background: var(--soft); }
.bars .bn { font-weight: 700; font-size: 14px; min-width: 0; } .bars .bv { font: 600 13px/1.5 var(--mono); } .bars small { grid-column: 1 / -1; color: var(--ink2); font-size: 12.5px; }
.bars .bt { grid-column: 1 / -1; height: 10px; } .bars .bt i { display: block; height: 10px; background: #1d4d5c; border-radius: 0 4px 4px 0; }
.money .note { margin: 0; font-size: 13px; color: var(--ink2); } .money .zf { margin: 0; font-size: 14px; }
.bondt { display: grid; grid-template-columns: 18px 1fr; gap: 0 8px; font-size: 14px; cursor: pointer; padding-bottom: 6px; } .bondt input { margin: 2px 0 0; accent-color: #2b6c95; width: 16px; height: 16px; } .bondt small { grid-column: 2; color: var(--ink2); font-size: 12.5px; }
.sizekey { position: fixed; left: calc(var(--rail) + 16px); bottom: calc(40px + env(safe-area-inset-bottom, 0px)); z-index: 4; background: #ffffffe6; border: 1px solid var(--line); border-radius: 5px; padding: 7px 10px 6px; font-size: 12px; pointer-events: none; }
.sizekey b { display: block; font-size: 12px; margin-bottom: 3px; } .sizekey svg { display: block; }

/* map furniture */
.mapctl { position: fixed; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); z-index: 4; display: grid; gap: 8px; justify-items: end; }
.seg { display: inline-flex; background: #fff; border: 1px solid #b9c6c1; border-radius: 5px; overflow: hidden; box-shadow: 0 1px 4px #12252d22; }
.seg button { border: 0; background: none; height: 38px; padding: 2px 14px 0; font-weight: 700; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.seg.v { flex-direction: column; } .seg.v button { width: 38px; padding: 0; font-size: 19px; line-height: 1; border-left: 0; } .seg.v button + button { border-top: 1px solid var(--line); }
.layers { background: #fff; border: 1px solid #b9c6c1; border-radius: 5px; box-shadow: 0 1px 4px #12252d22; min-width: 110px; }
.layers > button { width: 100%; border: 0; background: none; height: 38px; padding: 2px 14px 0; font-weight: 700; font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.layers .body { width: 262px; padding: 2px 14px 12px; display: grid; gap: 9px; font-size: 14px; }
.layers label { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; cursor: pointer; line-height: 1.3; }
.layers label small { display: block; color: var(--ink2); font-size: 13px; }
.layers input { margin: 2px 0 0; accent-color: var(--ink); width: 16px; height: 16px; }
.scale { position: fixed; left: calc(var(--rail) + 16px); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 4; font: 600 12px/1 var(--mono); color: var(--ink); pointer-events: none; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.scale i { display: block; height: 6px; margin-top: 5px; border: 2px solid var(--ink); border-top: 0; }
.tip { position: fixed; z-index: 6; pointer-events: none; background: var(--ink); color: #fff; padding: 7px 10px 5px; border-radius: 4px; font-size: 13.5px; max-width: 260px; line-height: 1.3; }
.tip small { display: block; color: #c4d2d6; font-size: 12.5px; }
.maplibregl-ctrl-attrib { font: 11.5px/1.4 var(--sans) !important; background: #fffd !important; }
.maplibregl-canvas:focus-visible { outline-offset: -3px; }

dialog { border: 0; border-radius: 8px; padding: 0; width: min(640px, calc(100vw - 32px)); max-height: min(760px, calc(100dvh - 48px)); color: var(--ink); background: var(--panel); box-shadow: 0 20px 60px #12252d55; }
dialog::backdrop { background: #12252d88; }
.about { padding: 24px 26px 28px; display: grid; gap: 14px; }
.about h2 { margin: 0; font-size: 24px; font-weight: 800; } .about h3 { margin: 8px 0 -8px; font-size: 16px; } .about p { margin: 0; max-width: 65ch; }
.about ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
.about dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 14px; margin: 0; } .about dt { font-weight: 700; display: flex; gap: 8px; align-items: center; } .about dd { margin: 0; }
.about .x { justify-self: end; margin-bottom: -44px; }
.load { position: fixed; inset: 0 0 0 var(--rail); display: grid; place-content: center; z-index: 3; color: var(--ink2); pointer-events: none; text-align: center; padding: 24px; }
.grip { display: none; }

@media (max-width: 760px) {
  :root { --rail: 0px; }
  #rail { inset: auto 0 0 0; width: auto; height: 86dvh; border-right: 0; border-top: 1px solid var(--line); border-radius: 14px 14px 0 0; box-shadow: 0 -6px 24px #12252d2e; transition: transform .28s cubic-bezier(.2,.8,.2,1); transform: translateY(calc(86dvh - 188px)); padding-top: 0; }
  #rail[data-snap="half"] { transform: translateY(calc(86dvh - 54dvh)); }
  #rail[data-snap="full"] { transform: none; }
  #rail[data-snap="peek"] .scroll { overflow: hidden; }
  .grip { display: block; width: 100%; height: 26px; border: 0; background: none; padding: 0; touch-action: none; flex: none; }
  .grip::after { content: ""; display: block; width: 44px; height: 5px; border-radius: 3px; background: #a9b8b3; margin: 0 auto; }
  .head { padding: 0 max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
  #rail.reading .head { display: none; }
  .gal { margin: 0 -16px; } .track img { height: 210px; } .track .spr { --gh: 210px; } .track figcaption, .galnav { padding-left: 16px; padding-right: 16px; } .galnav button { width: 48px; height: 40px; }
  .head h1 { font-size: 23px; } .head p { font-size: 13.5px; }
  .tools, .count, .item, .detail, .foot { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .search { height: 44px; font-size: 16px; } .chip { height: 36px; } .row select { height: 42px; font-size: 16px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 2px; scrollbar-width: none; } .chip { flex: none; }
  .mapctl { top: calc(10px + env(safe-area-inset-top, 0px)); right: calc(10px + env(safe-area-inset-right, 0px)); left: 10px; justify-items: end; }
  .seg button { height: 42px; } .layers > button { height: 42px; } .seg.v { display: none; }
  .scale { left: 14px; bottom: 202px; }
  .sizekey { left: 10px; bottom: 228px; transform: scale(.85); transform-origin: left bottom; }
  .money { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); } .money .hero b { font-size: 30px; }
  .load { inset: 0 0 188px 0; }
  .maplibregl-ctrl-bottom-right { bottom: 188px !important; }
  .about dl { grid-template-columns: 1fr; gap: 2px; } .about dd { margin-bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) { #rail { transition: none; } }
