/* Map page: the navy header, a navy band with the search and the three live counts, a paper row of
   filters, then a full-bleed map. Filters live in a side panel on wide screens (1024px and up) and
   in a bottom sheet below that. Details open beside or over the map. Every panel has a navy head. */
body.map-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.map-main { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---------- toolbar ---------- */
.toolbar { position: relative; z-index: 35; color: var(--ink); }
.toolbar-row { display: flex; align-items: center; gap: 10px 14px; min-width: 0; padding: 10px 20px; }
.toolbar-row.bar { background: var(--brand-navy-2); --focus: var(--brand-green); }
.toolbar-row.quick { background: var(--paper); border-bottom: 1px solid var(--hairline); gap: 8px; }
.search { position: relative; flex: 0 0 340px; min-width: 0; }
.search input {
  height: 44px; min-height: 44px; padding: 0 14px 0 42px; border-radius: var(--radius); font-size: 16px; border: 1px solid transparent;
  background-color: #ffffff; color: #1a1a1a;
}
.search input::placeholder { color: #5f6b7a; opacity: 1; font-size: 15px; }
.search input::-webkit-search-cancel-button { display: none; }
.search .search-icon { position: absolute; left: 12px; top: 12px; color: #5f6b7a; pointer-events: none; display: flex; }
.suggest {
  position: absolute; left: 0; right: 0; top: 48px; margin: 0; padding: 6px; list-style: none; background: var(--surface); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); z-index: 50; max-height: 60vh; overflow-y: auto;
}
.suggest li { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-s); cursor: pointer; font-size: 15px; min-height: 44px; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--accent-wash); }
.suggest li .n { margin-left: auto; color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.suggest li.empty { display: block; cursor: default; color: var(--ink-2); }
.suggest li.empty strong { color: var(--ink); }
.suggest li.empty:hover { background: none; }

/* The live counts: three, never the combined "past deadline" alone. Each is also a filter. */
.counters { display: flex; align-items: stretch; gap: 6px; min-width: 0; overflow: hidden; padding: 3px; margin: -3px; }
.counter {
  display: inline-flex; align-items: baseline; gap: 8px; min-height: 44px; padding: 7px 13px 0; border: 0; border-radius: var(--radius); background: none;
  color: var(--on-navy); text-align: left; white-space: nowrap; font-size: 14px; line-height: 1.3; box-shadow: inset 0 0 0 1px transparent;
}
/* the three counts read as tabs: each has an edge, the chosen one turns to paper */
button.counter { cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); }
button.counter:hover { background: rgba(255, 255, 255, 0.1); }
button.counter[aria-pressed="true"] { background: var(--paper-raised); color: var(--brand-navy); box-shadow: inset 0 -3px 0 var(--brand-green); --dot-ring: var(--pin-outline); --fresh: rgba(10, 37, 64, 0.14); }
.counter b { font-size: 22px; line-height: 1.2; }
.counter .c-label { display: inline-flex; align-items: center; gap: 6px; color: var(--on-navy-2); }
button.counter[aria-pressed="true"] .c-label { color: #3a4e66; }
.counter .dot { width: 11px; height: 11px; align-self: center; }
.counter .c-short { display: none; }
.counter.is-placeholder { align-items: center; padding-top: 0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); min-width: 150px; }
.counter.all:not(button) { align-items: center; padding-top: 0; }
.counter.is-placeholder .skel { width: 100%; }
.counter.is-placeholder .skel-line { height: 16px; }
.upd { font-size: 13px; color: var(--on-navy-3); white-space: nowrap; flex: none; }
.foot-upd { display: none; }
.map-tight .upd, .map-tight .upd.is-stale { display: none; }
.map-tight .foot-upd { display: inline; }
.panel-title:focus, .list-head h2:focus { outline: none; }
.view-switch { flex: none; margin-left: auto; }
.view-switch button { display: inline-flex; align-items: center; gap: 6px; }
#open-filters .n { background: #ffffff; color: var(--brand-navy); border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.quick .chips { flex-wrap: nowrap; }
.quick .btn, .quick .chip { min-height: 44px; }
.quick .cat-chip { padding: 0 12px 0 10px; }
#near-me, .quick .share-btn { background: var(--paper-raised); }
#share-host { order: 5; margin-left: auto; flex: none; }
.district-quick { order: 6; flex: none; }
.district-quick select { width: 150px; min-height: 44px; border-radius: var(--radius); padding-left: 14px; background-color: var(--paper-raised); border-color: var(--chip-border); font-weight: 600; font-size: 14px; }
.street-chip { background: var(--chip-on-bg); border-color: var(--chip-on-bg); color: var(--chip-on-ink); font-weight: 600; }

/* ---------- body ---------- */
.map-body { flex: 1; min-height: 0; position: relative; display: flex; }
.map-wrap { position: relative; flex: 1; min-width: 0; container-type: inline-size; }
#map { position: absolute; inset: 0; background: var(--map-bg); }
.panel { width: 340px; flex: none; overflow-y: auto; background: var(--surface); color: var(--ink); border-right: 1px solid var(--hairline); padding: 0 20px 16px; display: flex; flex-direction: column; }
.panel[hidden] { display: none; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; margin: 0 -20px; padding: 0 20px 12px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 -20px 12px; padding: 8px 10px 8px 20px; background: var(--brand-navy); --focus: var(--brand-green); border-bottom: 2px solid var(--brand-green); flex: none; }
.panel-title { font-family: var(--font); font-size: 20px; font-weight: var(--display-weight); letter-spacing: var(--display-tracking); color: var(--on-navy); }
.panel fieldset { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
.panel legend { font: 600 12px/1.3 var(--font); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); padding: 0; margin-bottom: 8px; }
.panel .seg { display: flex; }
.panel .seg button { flex: 1 1 auto; padding: 0 6px; font-size: 14px; }
.panel .seg button[disabled] { color: var(--muted); cursor: not-allowed; }
.panel .hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.panel .chips { display: grid; grid-template-columns: 1fr 1fr; }
.panel .chips .chip { justify-content: flex-start; gap: 6px; padding: 0 6px 0 9px; min-width: 0; min-height: 44px; font-size: 13px; }
.panel .chips .chip .chip-icon { width: 24px; height: 24px; margin-left: -3px; }
.panel select, .panel input { min-height: 44px; }
.panel .custom-deadline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; font-size: 15px; color: var(--ink-2); }
.panel .custom-deadline select { flex: 1 1 100%; }
.panel .custom-deadline input { width: 96px; }
.panel details.more { margin-top: 16px; border-top: 1px solid var(--hairline); padding-top: 6px; }
.panel details.more > summary { cursor: pointer; font-weight: 600; font-size: 15px; min-height: 44px; display: flex; align-items: center; color: var(--link); }
.panel .two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.panel .two input { min-width: 0; }
@media screen and (max-width: 359px) { .panel .two { grid-template-columns: minmax(0, 1fr); } }
.panel-actions { flex: none; background: var(--surface); padding: 12px 0 0; display: flex; gap: 10px; border-top: 1px solid var(--hairline); }
.panel-actions .btn { min-height: 44px; }
.panel-actions .btn.primary { flex: 1; }
.panel .state-card { margin-top: 6px; flex-direction: column; gap: 10px; }
.results { list-style: none; margin: 8px 0 0; padding: 0; }
.results li + li { border-top: 1px solid var(--hairline); }
.results button {
  all: unset; box-sizing: border-box; display: grid; grid-template-columns: 24px 1fr; gap: 2px 10px; width: 100%; padding: 12px 4px; cursor: pointer;
  border-radius: var(--radius-s);
}
.results button:hover { background: var(--surface-2); }
.results button:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.results .icon { grid-row: span 2; color: var(--ink-2); margin-top: 2px; }
.results .where { font-weight: 600; font-size: 15px; }
.results .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 13px; color: var(--ink-2); }

/* ---------- things on the map ---------- */
.floating { background: var(--surface); color: var(--ink); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); }
.intro { position: absolute; left: 16px; bottom: 30px; width: 380px; z-index: 20; max-height: calc(100% - 42px); overflow-y: auto; border-color: var(--brand-navy); }
.intro-head { position: relative; background: var(--brand-navy); padding: 16px 52px 15px 20px; border-radius: 5px 5px 0 0; border-bottom: 3px solid var(--brand-green); --focus: var(--brand-green); }
.intro h2 { font-family: var(--font); font-size: 20px; line-height: 1.25; font-weight: var(--display-weight); letter-spacing: var(--display-tracking); color: var(--on-navy); }
.intro-body { padding: 6px 20px 18px; }
.intro p { margin-top: 8px; color: var(--ink-2); font-size: 15px; }
.intro .states { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; margin-top: 10px; font-size: 15px; }
.intro .states span { display: inline-flex; align-items: center; gap: 8px; }
.intro .states .wide { grid-column: 1 / -1; align-items: flex-start; line-height: 1.35; }
.intro .states .wide .dot { margin-top: 3px; flex: none; }
.intro .ring-line { display: flex; align-items: center; gap: 10px; }
.intro .ring-line svg { flex: none; display: block; }
.intro .actions { display: flex; gap: 8px; margin-top: 14px; }
.intro .actions .btn { min-height: 44px; }
.intro .actions .btn.go { padding: 0 22px; }
.intro .x, .detail .x, .panel .x, .disc-panel .x {
  position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; background: none; border-radius: var(--radius-s); cursor: pointer; color: var(--on-navy);
  display: flex; align-items: center; justify-content: center;
}
.panel .x, .disc-panel .x { position: static; flex: none; }
.intro .x:hover, .detail .x:hover, .panel .x:hover, .disc-panel .x:hover { background: rgba(255, 255, 255, 0.14); }
/* The map's top edge (UX2a): the legend at the left, the data notice centered in the room beside it, so neither covers the other.
   The zoom buttons sit at the bottom right, above the map credit. */
.map-top { position: absolute; inset: 10px 12px; z-index: 21; display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; gap: 8px; pointer-events: none; }
/* The legend (UX2): a card like every other floating card, a navy top edge, a spaced-capitals title, one column of keys, and
   beside each key the count of what the map shows right now in the overview's split (never a sum). Capped at 250px. */
.map-legend { flex: none; width: max-content; max-width: min(250px, 100%); max-height: 100%; overflow-y: auto; pointer-events: auto; font-size: 13px; border-top: 3px solid var(--brand-navy); }
.map-legend[hidden] { display: none; }
.legend-toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-width: 44px; min-height: 44px; padding: 0 10px 0 14px;
  border: 0; border-radius: 0 0 var(--radius) var(--radius); background: none; color: var(--ink-2); font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
}
.legend-toggle:hover { background: var(--surface-2); }
.legend-toggle:focus-visible { outline-offset: -3px; }       /* inside the panel, which clips what lies past its edge */
.legend-toggle .chev { width: 18px; height: 18px; flex: none; }
.legend-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
@media (prefers-reduced-motion: no-preference) { .legend-toggle .chev { transition: transform 0.15s ease-out; } }
.map-legend .items { list-style: none; margin: 0; padding: 0 14px 10px; display: grid; gap: 1px; }
.map-legend .items[hidden] { display: none; }
.map-legend .row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 9px; white-space: nowrap; min-height: 26px; }
.map-legend .row .dot { width: 12px; height: 12px; }
.map-legend .row .n { font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; text-align: right; min-width: 3.5ch; }
.map-legend .row.ring { grid-template-columns: auto minmax(0, 1fr); border-top: 1px solid var(--hairline); margin-top: 5px; padding-top: 6px; }
.map-legend .row svg { flex: none; }
.toast { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: var(--brand-navy); color: #fff; padding: 8px 16px; border-radius: var(--radius); font-size: 14px; z-index: 30; max-width: calc(100% - 24px); text-align: center; border-bottom: 2px solid var(--brand-green); }
/* what lies over the map while it has nothing to show: a loading note, an error, or the empty state */
.map-state { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 22; width: min(440px, calc(100% - 24px)); display: flex; justify-content: center; }
.map-state[hidden] { display: none; }
.map-state .state-card { box-shadow: var(--shadow); width: 100%; }
.loading-pill { display: inline-flex; align-items: center; gap: 10px; background: var(--brand-navy); color: #fff; padding: 10px 18px; border-radius: var(--radius); font-size: 15px; font-weight: 600; box-shadow: var(--shadow); border-bottom: 2px solid var(--brand-green); }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: no-preference) { .spinner { animation: spin 0.9s linear infinite; } }
.map-notice { flex: 1 1 240px; min-width: 0; display: flex; justify-content: center; pointer-events: none; }
.map-notice:empty { display: none; }
.map-notice .notice { pointer-events: auto; box-shadow: var(--shadow); max-width: 640px; }
/* BOS1 Stop C: under 768px the refused notice (one short line and "Details") is one bar across the map's top, above the legend's
   button, so its line has the map's whole width */
@media screen and (max-width: 767px) {
  .map-notice:has(.notice.refused) { order: -1; flex-basis: 100%; }
  .map-notice .notice.refused { width: 100%; max-width: none; }
}
/* the smallest ring is 38px; its tap area is still 44px */
.cluster { display: grid; place-items: center; min-width: 44px; min-height: 44px; cursor: pointer; filter: drop-shadow(0 1px 2px rgba(10, 37, 64, 0.3)); }
.cluster text { font: 700 13px var(--font); fill: #1a1a1a; text-anchor: middle; }
.cluster.s text { font-size: 12px; }
/* The selected request sits above every ring (X4): a navy halo with a white edge, so it reads on a ring as on the map. */
.maplibregl-marker.sel-mark {
  z-index: 2; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; pointer-events: none;
  background: var(--select-wash); box-shadow: inset 0 0 0 2.5px var(--select), 0 0 0 1.5px #ffffff;
}
.sel-mark .sel-pin { position: relative; width: 15px; height: 15px; box-shadow: 0 0 0 1.5px var(--pin-outline); }
.sel-mark .sel-pin.unc::after { content: ""; position: absolute; inset: 0; margin: auto; width: 5.6px; height: 5.6px; border-radius: 50%; background: var(--hollow-center); }
.maplibregl-popup { z-index: 3; }
.maplibregl-popup-content { background: #ffffff; color: #1a1a1a; border-radius: var(--radius); padding: 10px 12px; box-shadow: var(--shadow); font: 14px/1.4 var(--font); }
.preview strong { display: block; font-size: 15px; }
.preview .where { color: #55534e; display: block; margin-top: 2px; }
.preview .status { margin-top: 6px; }
.maplibregl-ctrl-group button { width: 44px; height: 44px; }
/* the map credit's own button is 24px: the button grows to 44px around the same icon, the pill keeps its size */
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button {
  width: 44px; height: 44px; top: -10px; right: -10px; background-size: 24px; background-position: center; background-repeat: no-repeat; background-color: transparent; border-radius: 50%;
}
.maplibregl-ctrl-group { border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 10px rgba(10, 37, 64, 0.22) !important; }

/* ---------- details: a navy head with the repair type and the block, then the facts on paper ---------- */
.detail { position: absolute; top: 12px; right: 12px; width: 392px; max-height: calc(100% - 24px); overflow-y: auto; z-index: 30; border-color: var(--brand-navy); }
.detail-head { position: relative; background: var(--brand-navy); padding: 14px 52px 13px 20px; border-radius: 5px 5px 0 0; border-bottom: 3px solid var(--brand-green); --focus: var(--brand-green); }
.detail-body { padding: 4px 20px 20px; }
.detail h2 { font-family: var(--font); font-size: 22px; line-height: 1.25; font-weight: var(--display-weight); display: flex; align-items: center; gap: 8px; letter-spacing: var(--display-tracking); color: var(--on-navy); }
.detail h2 .icon { color: var(--on-navy-2); }
.detail h2:focus { outline: none; }
.detail .where { color: var(--on-navy-2); margin-top: 2px; }
.detail .state-help { color: var(--ink-2); font-size: 14px; margin-top: 6px; }
.detail .headline { font-family: var(--font); font-variant-numeric: lining-nums; font-size: 28px; line-height: 1.2; font-weight: 600; letter-spacing: -0.02em; margin-top: 12px; }
.detail .state-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; }
.timeline { margin-top: 14px; }
.timeline .bar { display: flex; height: 10px; gap: 2px; }
.timeline .bar span { height: 10px; min-width: 3px; }
.timeline .bar span:first-child { border-radius: 5px 0 0 5px; }
.timeline .bar span:last-child { border-radius: 0 5px 5px 0; }
.timeline .bar .rest { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--hairline); }
.timeline .bar .window { background: var(--tl-window); }
.timeline .bar .green { background: var(--st-green); }
.timeline .bar .yellow { background: var(--st-yellow); }
.timeline .bar .red { background: var(--st-red); }
.timeline .bar .dark_red { background: var(--st-dark-red); }
.timeline .caps { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.timeline .caps span { display: inline-flex; align-items: center; gap: 6px; }
.timeline .caps .k { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.timeline .caps .k.window { background: var(--tl-window); }
.timeline .caps .k.rest { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--axis); }
.timeline .caps .k.green { background: var(--st-green); }
.timeline .caps .k.yellow { background: var(--st-yellow); }
.timeline .caps .k.red { background: var(--st-red); }
.timeline .caps .k.dark_red { background: var(--st-dark-red); }
.detail dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 16px 0 0; font-size: 15px; }
.detail dt { color: var(--ink-2); }
.detail dd { margin: 0; }
.detail dd small { display: block; color: var(--muted); font-size: 13px; }
.detail .box { margin-top: 14px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--tint); font-size: 14px; color: var(--ink-2); border-left: 3px solid var(--brand-navy); }
.detail .box strong { color: var(--ink); }
.detail .box.warn { background: var(--warn-bg); color: var(--warn-ink); border-left-color: #c79a2b; }
.detail .actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---------- list view ---------- */
.list-view { flex: 1; min-width: 0; overflow: auto; background: var(--page); color: var(--ink); padding: 16px 20px 32px; }
.list-inner { max-width: 1160px; margin: 0 auto; }
.list-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 4px; }
.list-sub { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); }
.list-head h2 { font-family: var(--font); font-size: 22px; font-weight: var(--display-weight); letter-spacing: var(--display-tracking); font-variant-numeric: lining-nums; }
.list-head .field { display: flex; align-items: center; gap: 8px; }
.list-head select { width: auto; min-height: 44px; }
.list-card { padding: 0 12px 4px; }
.list-view table.data tbody tr { cursor: pointer; }
.list-view table.data tbody tr:hover td, .list-view table.data tbody tr:hover th { background: var(--tint); }
.list-card { border-top-width: 1px; }
/* UX2: a data table. Rows about 50px, a sticky head while the list scrolls, the district on one line, dates and the
   deadline chip in tabular figures, the badge on the same line as the chip. */
.list-view table.data th, .list-view table.data td { padding: 8px 10px; }
.list-view table.data thead th { position: sticky; top: 0; z-index: 2; }
.list-view table.data tbody th { font-weight: 600; }
.list-view table.data td:nth-child(3), .list-view table.data td:nth-child(4), .list-view table.data td:nth-child(5) { white-space: nowrap; }
.list-view table.data td:nth-child(4), .list-view table.data td:nth-child(5) { font-variant-numeric: tabular-nums; }
.list-view table.data td:last-child { white-space: nowrap; }
.list-view .status { font-variant-numeric: tabular-nums; }
.list-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.list-chips .chip { min-height: 36px; font-size: 13px; padding: 0 10px 0 11px; }
.list-chips .chips-label { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-right: 4px; }
@media (pointer: coarse), (max-width: 1023px) { .list-chips .chip { min-height: 44px; } }
.list-view table.data td:last-child .badge { margin-left: 6px; }
/* Below 1024px a row becomes a small card, label beside value, so no column is ever cut off. */
@media screen and (max-width: 1023px) {
  table.data.stack-md thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data.stack-md, table.data.stack-md tbody, table.data.stack-md tr, table.data.stack-md th, table.data.stack-md td { display: block; width: 100%; }
  table.data.stack-md tr { padding: 10px 0; border-bottom: 1px solid var(--hairline); }
  table.data.stack-md th, table.data.stack-md td { border: 0; padding: 2px 0; }
  table.data.stack-md tbody th { font-size: 15px; padding-bottom: 4px; }
  table.data.stack-md td { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: right; }
  table.data.stack-md td::before { content: attr(data-label); color: var(--ink-2); text-align: left; flex: none; max-width: 55%; }
  .list-view table.data td:last-child { flex-wrap: wrap; justify-content: flex-end; row-gap: 4px; white-space: normal; }
  .list-view table.data td:last-child::before { margin-right: auto; }
  .list-view table.data td:last-child .badge { margin-left: 0; }
}
@media screen and (min-width: 720px) and (max-width: 1023px) {
  .panel { max-width: 640px; margin: 0 auto; }                 /* tablets: a centered sheet, not edge to edge */
  table.data.stack-md tbody { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
  table.data.stack-md tbody tr:last-child { border-bottom: 1px solid var(--hairline); }
}
.list-view .rowbtn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; min-height: 34px; }
@media (pointer: coarse), (max-width: 1023px) { .list-view .rowbtn { min-height: 44px; } }
.list-view .rowbtn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.pager .btns { display: flex; gap: 8px; }
.pager .btn { min-height: 44px; }
.sheet-backdrop { position: fixed; inset: 0; background: rgba(10, 37, 64, 0.5); z-index: 38; }
.map-page .site-footer { padding: 4px 20px; min-height: 0; }
.map-page .foot-brand { min-height: 36px; }
@media (pointer: coarse), (max-width: 1023px) { .map-page .foot-brand { min-height: 44px; } }
/* A city's required disclaimer (D7) on the map (FT1): the footer's "Data disclaimer" opens it in a small panel at the lower right,
   just above the footer and, from 768px up, above the map's credit and left of its zoom buttons (--disc-bottom and --disc-right, set
   as it opens), over the map, which does not move. Modal: Esc, its close button or a tap outside closes it. */
.disc-panel {
  position: fixed; inset: auto var(--disc-right, 20px) var(--disc-bottom, 56px) auto; margin: 0; padding: 0; width: min(440px, calc(100vw - 24px)); max-width: none;
  max-height: calc(100dvh - var(--disc-bottom, 56px) - 12px); overflow: auto; border: 1px solid var(--hairline); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.disc-panel::backdrop { background: rgba(10, 37, 64, 0.24); }
.disc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 2px 16px; border-radius: 5px 5px 0 0;
  background: var(--brand-navy); border-bottom: 2px solid var(--brand-green); --focus: var(--brand-green);
}
.disc-head h2 { margin: 0; font-size: 16px; font-weight: 600; color: var(--on-navy); }
.disc-text { margin: 0; padding: 12px 16px 8px; font-size: 14px; line-height: 1.55; }
.disc-src { margin: 0; padding: 0 16px 14px; font-size: 13px; color: var(--ink-2); }
/* Wherever the time since the last update leads the footer line (below 1280px) the link takes "How it works"' place, which the
   header already offers, so the line stays one line */
@media screen and (max-width: 1279px) { .map-page .site-footer.has-disc .more { display: none; } }
/* and below 900px it takes the 12px sides every other page's footer has there (app.css), the room the link needs at 768px */
@media screen and (min-width: 720px) and (max-width: 899px) { .map-page .site-footer.has-disc { padding-left: 12px; padding-right: 12px; } }

/* ---------- below 1360px: Share keeps its icon and its name for screen readers; the repair types keep the room ---------- */
@media screen and (min-width: 1024px) and (max-width: 1359px) {
  .quick .share-btn { font-size: 0; gap: 0; padding: 0; width: 44px; justify-content: center; }
}
/* ---------- below 1280px, or whenever the counts do not fit beside the search: they get their own row ---------- */
@media screen and (max-width: 1279px) {
  .toolbar-row.bar { flex-wrap: wrap; }
  .search { flex: 1 1 300px; }
  .counters { order: 3; flex-basis: 100%; }
  .counter { flex: 1 1 0; }
  /* where the counts take their own row the time leads the footer line instead; when the data has stopped arriving it is
     marked there (and in the notice on the map), never squeezed into the search row (UX2, M6) */
  .upd, .upd.is-stale { display: none; }
  .foot-upd { display: inline; }
}
.map-stack .toolbar-row.bar { flex-wrap: wrap; }
.map-stack .search { flex: 1 1 300px; }
.map-stack .counters { order: 3; flex-basis: 100%; }
.map-stack .counter { flex: 1 1 0; }
/* ---------- below 1024px: filters and results become a bottom sheet ---------- */
@media screen and (max-width: 1023px) {
  .panel {
    position: fixed; left: 0; right: 0; bottom: 0; width: auto; max-height: 86dvh; z-index: 70; border-right: 0;
    border-radius: 14px 14px 0 0; box-shadow: var(--shadow); padding: 0 16px 20px;
  }
  .panel-head { margin: 0 -16px 12px; padding: 6px 6px 6px 16px; border-radius: 14px 14px 0 0; }
  .sheet-backdrop { z-index: 65; }
  .panel-body { margin: 0 -16px; padding: 0 16px 12px; }
  .panel.results-mode { max-height: 44dvh; }
  .quick { overflow-x: auto; scrollbar-width: none; position: relative; }
  .quick::-webkit-scrollbar { display: none; }
  .quick > * { flex: none; }
  /* The row scrolls sideways: the chips fade out at the edge there is more toward, so a cut chip reads as "scroll"
     (Milestone 1D). The row's paper and its edge belong to the toolbar, so only the chips fade, not the paper. */
  .toolbar { background: var(--paper); border-bottom: 1px solid var(--hairline); }
  .toolbar-row.quick { border-bottom: 0; }
  .quick.fade-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
  .quick.fade-start { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px); mask-image: linear-gradient(to right, transparent, #000 56px); }
  .quick.fade-start.fade-end {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent);
  }
  /* one slim footer line on the map: the header already carries the mark */
  .map-page .foot-brand { display: none; }
  /* Share sits beside "Near me", in view without scrolling the row */
  #share-host { order: 0; margin-left: 0; }
}
@media screen and (min-width: 1024px) {
  .sheet-backdrop { display: none; }
  /* The repair types take the room that is left. With a street or a deadline chip added they can outgrow it:
     then they scroll sideways inside their own box, and the last one fades to show there is more. */
  .quick .chips { flex: 1 1 0; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; }
  .quick .chips::-webkit-scrollbar { display: none; }
  .quick .chips > * { flex: none; }
  .quick .chips.is-clipped { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  #share-host { margin-left: 0; }
}
/* ---------- phones ---------- */
@media screen and (max-width: 719px) {
  /* The header is one row: the brand, the city by its short name, and "Menu" for the pages (Milestone 1D) */
  .map-page .site-header { flex-wrap: nowrap; gap: 8px; min-height: 0; padding: 4px 8px 4px 12px; }
  .map-page .brand { min-width: 0; }
  .map-page .city-picker { margin-left: auto; }
  .map-page .city-picker select { width: 92px; max-width: none; }
  .map-page .menu-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-width: 44px; min-height: 44px; padding: 0 12px 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.34); border-radius: var(--radius); background: rgba(255, 255, 255, 0.08); color: var(--on-navy);
    font-size: 14px; font-weight: 600; cursor: pointer;
  }
  .map-page .menu-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.2); }
  .map-page .site-nav { display: none; }
  .map-page .site-header.nav-open .site-nav {
    display: flex; flex-direction: column; gap: 2px; position: absolute; top: 100%; left: 0; right: 0; width: auto; margin: 0; padding: 6px 12px 12px;
    background: var(--brand-navy); border-bottom: 2px solid var(--brand-green); box-shadow: var(--shadow); overflow: visible;
  }
  .map-page .site-header.nav-open .site-nav a { min-height: 48px; font-size: 16px; padding: 0 12px; }
  .toolbar-row { padding: 6px 12px; gap: 6px; }
  .search { flex: 1 1 0; }
  .search input { padding: 0 8px 0 38px; }
  .search input::placeholder { font-size: 15px; }
  .search .search-icon { left: 10px; }
  .view-switch .icon { display: none; }
  .view-switch button { padding: 0 12px; }
  /* The three counts are one short row: the number (with its dot), then a short label on one line. The full label is
     the button's text for screen readers (.c-full) and is said in full in the map's note on a tap (Milestone 1D). */
  .counters { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.2fr) minmax(0, 1fr); gap: 6px; }
  .counter {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 5px; row-gap: 1px;
    min-height: 44px; padding: 4px 8px; white-space: normal; min-width: 0;
  }
  .counter.is-placeholder { min-width: 0; min-height: 44px; display: flex; justify-content: center; }
  .counter b { grid-column: 2; grid-row: 1; font-size: 18px; line-height: 1.1; }
  .counter.all b { grid-column: 1 / -1; }
  .counter .c-label { display: contents; font-size: 12.5px; line-height: 1.2; }
  .counter .c-label .dot { grid-column: 1; grid-row: 1; margin: 0; width: 10px; height: 10px; }
  .counter .c-short { display: block; grid-column: 1 / -1; grid-row: 2; font-size: 12.5px; line-height: 1.2; }
  .counter .c-full { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .panel.results-mode { max-height: 40dvh; }
  .district-quick { display: none; }
  .intro { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: calc(100% - 16px); }
  .intro-head { padding: 13px 48px 12px 16px; }
  .intro h2 { font-size: 20px; }
  .intro-body { padding: 2px 16px 14px; }
  .intro p { margin-top: 6px; }
  .intro .actions { margin-top: 10px; }
  .map-top { inset: 8px; }
  /* A sheet over the lower part of the map; the pin stays in view above it. */
  .detail {
    position: absolute; top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 62%; border-radius: 14px 14px 0 0; z-index: 45;
    border-width: 1px 0 0;
  }
  .detail-head { border-radius: 13px 13px 0 0; padding: 12px 48px 11px 16px; }
  .detail-body { padding: 2px 16px 20px; }
  .list-view { padding: 12px 12px 24px; }
  /* one slim line: the header already carries the mark */
  .map-page .site-footer { padding: 6px 12px; font-size: 12px; line-height: 1.35; }
  .map-page .site-footer .more, .map-page .foot-brand { display: none; }
  .disc-panel { right: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .panel, .detail { animation: rise 0.16s ease-out; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}
@media screen and (max-width: 379px) {
  .map-page .menu-btn { padding: 0; }
  .map-page .menu-label { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media screen and (max-width: 359px) {
  .counter { padding: 4px 6px; }
  .counter .c-short { font-size: 12px; }
  .map-page .brand-name { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
