/* POCx4 CDS Curbside Studio — app chrome on top of Parametrix tokens. */

:root {
  /* validated chart palette (dataviz six-checks; see docs/INFORMATION_ARCHITECTURE.md) */
  --chart-1: #EE3D24;
  --chart-2: #0073BB;
  --chart-3: #D9A400;
  --act-parking: #0073BB;
  --act-prohibit: #EE3D24;
  --act-loading: #D9A400;
  --act-stopping: #2E8540;
  --act-none: #B3B4B5;
  --ink: #333333;
  --ink-2: #676768;
  --ink-3: #8a8a8c;
  --line: #E5E5E5;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(51,51,51,.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--surface-2); font-size: 14.5px; line-height: 1.45; }

/* ---------------------------------------------------------------- header */
:root { --banner-h: 46px; }
.app-header {
  display: flex; align-items: center; gap: 14px;
  background: var(--pmx-charcoal); color: #fff;
  height: var(--banner-h); padding: 0 16px;
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.brand-logo { height: 22px; width: auto; }
.app-name {
  font: 700 15px var(--pmx-font-headline); color: #fff; white-space: nowrap;
  padding-right: 6px; border-right: 1px solid #55555a; margin-right: 2px;
}
.tabs { display: flex; gap: 2px; }
.tab {
  font: 600 13px var(--pmx-font-body); color: #d8d8da;
  background: none; border: 0; border-bottom: 3px solid transparent;
  padding: 13px 11px 10px; cursor: pointer; white-space: nowrap;
}
.tab:hover { color: #fff; }
.tab.active { color: #fff; border-bottom-color: var(--pmx-red); }

/* ---------------------------------------------------------------- layout */
main { padding: 0; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.tab-panel:not(#tab-map) { max-width: 1280px; margin: 0 auto; padding: calc(var(--banner-h) + 20px) 24px 60px; }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 14px;
}
.panel h3 {
  font-size: 13px; margin: 0 0 8px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-2);
  font-family: var(--pmx-font-body); font-weight: 800;
}
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }

.hint { color: var(--ink-3); font-size: 12.5px; margin: 6px 0; }
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 800;
  padding: 1px 7px; border-radius: 9px; vertical-align: 1px;
}
.badge.closed { background: #ECF3F8; color: #0073BB; }
.badge.open   { background: #FDF3E3; color: #8a6100; }
.badge.local  { background: #FBE8E5; color: #B62B15; }
.badge.dirty  { background: var(--pmx-red); color: #fff; }

/* ------------------------------------------------------------- stat tiles */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 14px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--pmx-red);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px;
}
.stat-tile .label { font-size: 12px; color: var(--ink-2); }
.stat-tile .value { font: 600 28px var(--pmx-font-body); color: var(--ink); }
.stat-tile .note { font-size: 11.5px; color: var(--ink-3); }

/* ----------------------------------------------------------------- charts */
figure.chart { margin: 0; padding: 0; }
figure.chart figcaption { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
figure.chart figcaption .t { font-weight: 800; font-size: 14px; }
figure.chart figcaption .s { color: var(--ink-3); font-size: 12px; }
figure.chart .table-toggle {
  margin-left: auto; font-size: 11.5px; color: var(--pmx-link);
  background: none; border: 0; cursor: pointer; padding: 2px 4px;
}
.chart svg { display: block; width: 100%; height: auto; }
.chart .grid line { stroke: #EFEFEF; stroke-width: 1; }
.chart .axis text { fill: var(--ink-3); font-size: 10.5px; font-family: var(--pmx-font-body); }
.chart .axis line, .chart .axis path { stroke: var(--line); }
.chart-table { max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.chart-table table { border-collapse: collapse; width: 100%; font-size: 12px; }
.chart-table th, .chart-table td { padding: 4px 9px; border-bottom: 1px solid #F0F0F0; text-align: right; font-variant-numeric: tabular-nums; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-table thead th { position: sticky; top: 0; background: var(--surface-2); }

.chart-tooltip {
  position: fixed; z-index: 200; pointer-events: none;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 4px 14px rgba(51,51,51,.18); padding: 8px 10px; font-size: 12px;
  max-width: 260px;
}
.chart-tooltip .tt-title { color: var(--ink-2); margin-bottom: 3px; }
.chart-tooltip .tt-row { display: flex; align-items: center; gap: 6px; }
.chart-tooltip .tt-key { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.chart-tooltip .tt-val { font-weight: 800; }
.chart-tooltip .tt-lbl { color: var(--ink-2); }

.legend { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 12px; margin: 6px 0 2px; }
.legend .li { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.legend .sw { width: 13px; height: 13px; border-radius: 3px; flex: none; }
.legend .sw.line { height: 3px; border-radius: 2px; }
.legend .sw.hatch {
  background-image: repeating-linear-gradient(45deg, currentColor 0 2px, transparent 2px 5px);
}

/* filter row */
.filter-row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin: 0 0 14px; }
.filter-row label { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-right: 5px; }
select, input[type="text"], input[type="number"] {
  font: 13px var(--pmx-font-body); color: var(--ink);
  border: 1px solid #cfcfd1; border-radius: 6px; padding: 5px 8px; background: #fff;
}
button.btn {
  font: 600 13px var(--pmx-font-body); border-radius: 6px; cursor: pointer;
  border: 1px solid #cfcfd1; background: #fff; color: var(--ink); padding: 6px 12px;
}
button.btn:hover { border-color: var(--ink-2); }
button.btn.primary { background: var(--pmx-red); border-color: var(--pmx-red); color: #fff; }
button.btn.primary:hover { background: #d43015; }
button.btn.active { background: var(--pmx-charcoal); border-color: var(--pmx-charcoal); color: #fff; }
button.btn:disabled { opacity: .45; cursor: default; }

/* ------------------------------------------------------------- map studio */
#tab-map.active {
  display: block; position: fixed;
  top: var(--banner-h); left: 0; right: 0; bottom: 0;
}
#map-layout { position: relative; width: 100%; height: 100%; }
#map-center { position: absolute; inset: 0; display: flex; flex-direction: column; }
#gmap { flex: 1; min-height: 200px; background: #E8E6E1; position: relative; }

#map-side-left, #map-side-right {
  position: absolute; top: 12px; z-index: 20;
  max-height: calc(100% - 88px); overflow-y: auto;
  padding: 0; background: none; transition: transform .18s ease, opacity .18s ease;
}
#map-side-left  { left: 12px;  width: 264px; }
#map-side-right { right: 46px; width: 400px; }
#map-side-left .panel, #map-side-right .panel {
  background: rgba(255,255,255,.96); backdrop-filter: blur(3px);
  box-shadow: 0 2px 10px rgba(51,51,51,.18); margin-bottom: 10px;
}
#map-side-left.collapsed  { transform: translateX(-284px); opacity: 0; pointer-events: none; }
#map-side-right.collapsed { transform: translateX(460px);  opacity: 0; pointer-events: none; }

.panel-collapse {
  position: absolute; top: 12px; z-index: 21;
  width: 22px; height: 34px; border: 1px solid var(--line); background: #fff;
  border-radius: 5px; cursor: pointer; color: var(--ink-2); font-size: 10px;
  box-shadow: 0 2px 8px rgba(51,51,51,.18);
}
.panel-collapse.left  { left: 282px; }
.panel-collapse.left.collapsed  { left: 12px; }

/* bottom bar: day/time selector + macro toggle, centered together */
#bottom-bar {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 14px; z-index: 20;
  display: flex; align-items: stretch; gap: 10px;
  flex-wrap: wrap; justify-content: center;
  max-width: calc(100% - 40px); width: max-content;
}

/* macro toggle: Curb Viewer | Scenario Planner */
#macro-toggle {
  flex: none; display: flex; align-items: center;
  background: rgba(255,255,255,.97); border: 1px solid var(--line);
  border-radius: 9px; padding: 3px; gap: 3px;
  box-shadow: 0 2px 10px rgba(51,51,51,.18);
}
.macro-btn {
  font: 700 13px var(--pmx-font-body); color: var(--ink-2);
  background: none; border: 0; border-radius: 7px;
  padding: 7px 16px; cursor: pointer;
}
.macro-btn:hover { color: var(--ink); }
.macro-btn.active {
  background: var(--pmx-charcoal); color: #fff;
  box-shadow: inset 0 -3px 0 var(--pmx-red);
}

/* right rail: Street View / Scenario Planner drawer toggles */
#right-rail {
  position: absolute; right: 0; top: 12px; z-index: 22;
  display: flex; flex-direction: column; gap: 8px;
}
.rail-btn {
  writing-mode: vertical-rl;
  font: 600 12.5px var(--pmx-font-body); letter-spacing: .03em;
  color: var(--ink-2); background: rgba(255,255,255,.96);
  border: 1px solid var(--line); border-right: 0;
  border-radius: 7px 0 0 7px;
  padding: 14px 8px; cursor: pointer;
  box-shadow: 0 2px 8px rgba(51,51,51,.16);
}
.rail-btn:hover { color: var(--ink); }
.rail-btn.active {
  background: var(--pmx-charcoal); color: #fff; border-color: var(--pmx-charcoal);
  box-shadow: inset 3px 0 0 var(--pmx-red);
}

/* the scenario drawer holds the full planner; give it a solid backdrop so
   filter rows and headings never float transparently over the map */
#drawer-scenario, #drawer-cds, #drawer-metrics, #drawer-sym {
  background: rgba(249,250,251,.97); backdrop-filter: blur(4px);
  border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 4px 18px rgba(51,51,51,.20);
  padding: 12px;
}
#drawer-scenario .panel, #drawer-cds .panel, #drawer-metrics .panel, #drawer-sym .panel { box-shadow: none; }

/* Everything inside the map sidebars must fit the sidebar. Grid and flex
   children default to min-width:auto, so an intrinsically wide child (a text
   input, a long table) blows the track past its container - min-width:0 plus
   an explicit scroll container is the fix. */
#map-side-left, #map-side-right { overflow-x: hidden; }
#map-side-left .panel, #map-side-right .panel { min-width: 0; max-width: 100%; }

#drawer-scenario .kpi-row, #drawer-metrics .kpi-row { grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); }
#drawer-scenario .card-grid { grid-template-columns: minmax(0, 1fr); }
#drawer-scenario .stat-tile .value, #drawer-metrics .stat-tile .value { font-size: 22px; }
#drawer-scenario .filter-row { gap: 8px 10px; }

/* form controls shrink instead of pushing the panel wide */
#drawer-scenario input, #drawer-scenario select,
#drawer-cds input, #drawer-cds select,
#map-side-left input, #map-side-left select {
  min-width: 0; max-width: 100%;
}
/* any grid/flex child in a sidebar may shrink below its intrinsic width */
#map-side-left .field-row > *, #map-side-right .field-row > *,
#map-side-left .chips, #map-side-right .chips { min-width: 0; max-width: 100%; }
#map-side-left .chips, #map-side-right .chips { flex-wrap: wrap; }
#map-side-left .policy-card, #map-side-right .policy-card { min-width: 0; }
#map-side-left .sec, #map-side-right .sec { min-width: 0; }
#map-side-left p, #map-side-right p,
#map-side-left dd, #map-side-right dd { overflow-wrap: anywhere; }
#drawer-scenario input[type="range"] { flex: 1 1 90px; }
#drawer-scenario .field-row, #drawer-cds .field-row { grid-template-columns: 104px minmax(0, 1fr); }
#drawer-scenario .field-row > div, #drawer-cds .field-row > div { display: flex; align-items: center; gap: 6px; min-width: 0; }
#map-side-left .field-row { grid-template-columns: 96px minmax(0, 1fr); }

/* rows of chips/buttons wrap rather than overflow */
#drawer-scenario .change-item, #drawer-scenario .filter-row,
#drawer-scenario .policy-card .pc-head { flex-wrap: wrap; }
#drawer-scenario .change-item .what,
#map-side-left .change-item .what { min-width: 0; overflow-wrap: anywhere; }

/* charts and wide tables stay inside: svg scales, matrix scrolls on its own */
#drawer-scenario svg, #drawer-cds svg, #drawer-metrics svg { max-width: 100%; height: auto; }
#drawer-scenario .scroll-x, #drawer-metrics .scroll-x { max-width: 100%; overflow-x: auto; }
#drawer-scenario table.matrix, #drawer-metrics table.matrix { min-width: 420px; }
#drawer-scenario .chart-table, #drawer-metrics .chart-table { max-width: 100%; overflow: auto; }
#drawer-scenario pre, #drawer-scenario code { white-space: pre-wrap; overflow-wrap: anywhere; }

.map-setup {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(249,250,251,.97); z-index: 10; padding: 30px;
}
/* An author `display` declaration beats the UA's [hidden]{display:none}, so
   without this the near-opaque setup panel keeps covering the map. */
.map-setup[hidden] { display: none; }
.map-setup .panel { max-width: 620px; }
.map-setup code { background: #F2F2F2; padding: 1px 5px; border-radius: 4px; font-size: 12.5px; }
.map-setup ol { padding-left: 20px; } .map-setup li { margin: 6px 0; }
.key-row { display: flex; gap: 8px; margin-top: 10px; }
.key-row input { flex: 1; }

.map-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 19; width: min(620px, calc(100% - 560px));
  display: flex; align-items: center; gap: 12px;
  background: rgba(253,243,227,.97); border: 1px solid #F0DFC0; border-radius: 8px;
  color: #6b5426; font-size: 12px; padding: 7px 12px;
  box-shadow: 0 2px 8px rgba(51,51,51,.15);
}
.map-banner button { margin-left: auto; flex: none; }

.scrubber {
  flex: 0 1 560px; min-width: 300px;
  background: rgba(51,51,51,.94); color: #fff; padding: 8px 14px;
  border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.3);
  display: flex; align-items: center; gap: 12px; font-size: 12.5px;
}
/* the leading "Policies in effect at" caption must not wrap when the bar narrows */
.scrubber > span:first-child { white-space: nowrap; }
.scrubber select { background: #46464a; color: #fff; border-color: #5a5a5e; }
.scrubber input[type="range"] { flex: 1; accent-color: var(--pmx-red); }
.scrubber .time-lbl { font-weight: 800; min-width: 118px; font-variant-numeric: tabular-nums; }

#layer-controls label { display: flex; gap: 7px; align-items: center; font-size: 13px; padding: 3px 0; cursor: pointer; }

#edit-tools { display: flex; flex-wrap: wrap; gap: 6px; }

.map-attrib {
  position: absolute; right: 6px; bottom: 6px; z-index: 15;
  background: rgba(255,255,255,.85); color: #55555a;
  font-size: 10.5px; padding: 2px 7px; border-radius: 4px;
  pointer-events: none;
}

/* inspector */
#inspector .sec { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 10px; }
#inspector .kv { display: grid; grid-template-columns: 118px 1fr; gap: 2px 10px; font-size: 12.5px; }
#inspector .kv dt { color: var(--ink-3); } #inspector .kv dd { margin: 0; overflow-wrap: anywhere; }
#inspector h4 { margin: 4px 0 6px; font-size: 13.5px; }
.policy-card { border: 1px solid var(--line); border-left: 3px solid var(--pmx-charcoal); border-radius: 6px; padding: 8px 10px; margin: 8px 0; background: #fff; }
.policy-card.editing { border-left-color: var(--pmx-red); }
.policy-card .pc-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.policy-card .pc-head .act { font-weight: 800; font-size: 13px; color: var(--ink); }
.rule-line { font-size: 12.5px; margin: 3px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.chip {
  font-size: 11px; font-weight: 600; background: #F2F2F2; border-radius: 9px;
  padding: 1px 8px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px;
}
.chip.local { background: #FBE8E5; color: #B62B15; }
.chip button { border: 0; background: none; cursor: pointer; font-size: 11px; color: inherit; padding: 0; }
.field-row { display: grid; grid-template-columns: 112px 1fr; gap: 6px 8px; align-items: center; margin: 4px 0; font-size: 12.5px; }
.field-row label { color: var(--ink-2); font-size: 12px; }

/* Street View drawer: the close control sits top-left, ahead of the title.
   Esc does the same job (map.js). */
.sv-head { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.sv-head h3 { margin: 0; }
.sv-head .sv-x { font-size: 20px; margin-left: -4px; }
#pano { height: 260px; border-radius: 6px; overflow: hidden; background: #ddd; }
.pano-fallback {
  height: 100%; display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center; text-align: center;
  background: var(--pmx-gray-4); color: var(--ink-2); font-size: 12.5px; padding: 14px;
}
.pano-fallback p { margin: 0; }
.pano-fallback .btn { text-decoration: none; }

/* framework tab */
.fw-obj { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 12px 14px; }
.fw-obj h4 { margin: 0 0 4px; } .fw-obj .req { color: var(--ink); font-size: 12.5px; }
.fw-obj .fields { font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.fw-note { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.enum-vals { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
table.matrix { border-collapse: collapse; width: 100%; font-size: 12px; }
table.matrix th, table.matrix td { border-bottom: 1px solid #F0F0F0; padding: 6px 9px; text-align: left; vertical-align: top; }
table.matrix thead th { background: var(--surface-2); position: sticky; top: 0; }
.scroll-x { overflow-x: auto; }

/* export tab */
.exp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.exp-table-pick label { display: flex; gap: 8px; align-items: center; padding: 3px 0; font-size: 13px; }
.change-item { font-size: 12.5px; padding: 5px 0; border-bottom: 1px solid #F2F2F2; display: flex; gap: 8px; align-items: center; }
.change-item .what { flex: 1; overflow-wrap: anywhere; }
pre.preview { background: #2e2e31; color: #e8e8ea; border-radius: 6px; padding: 10px 12px; font-size: 11px; overflow-x: auto; max-height: 220px; }

/* ------------------------------------------------------------- auth gate */
.auth-veil {
  position: fixed; inset: 0; z-index: 1000;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.auth-card {
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--pmx-red);
  border-radius: var(--radius); box-shadow: 0 8px 30px rgba(51,51,51,.14);
  padding: 34px 40px; max-width: 440px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.auth-logo { height: 34px; width: auto; margin-bottom: 4px; }
.auth-card h2 { margin: 0; }
.auth-btn-slot { min-height: 44px; display: flex; justify-content: center; }
.auth-actions { display: flex; gap: 8px; }
.auth-error { color: var(--pmx-red); font-size: 12.5px; margin: 0; }
.auth-note { font-size: 11px; color: var(--ink-3); margin: 8px 0 0; }

/* The invitation door (docs/ADR-005): shown in place of the other two when
   the page was opened on an /invite/<token> link. */
.auth-invite { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.auth-invite-h { margin: 0; font-size: 16px; }
.auth-invite .hint { margin: 0; }
.auth-input {
  font: inherit; font-size: 13px; text-align: center;
  border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; width: 100%; max-width: 280px;
}
.auth-input:focus { outline: 2px solid rgba(0,115,187,.35); outline-offset: -1px; }

/* An issued invitation link in Settings. Tinted because it is the one thing
   on the panel that cannot be read again once it scrolls away. */
.invite-box {
  margin: 10px 0 4px; padding: 10px 12px;
  background: #FFFDF5; border: 1px solid #F4E39C; border-left: 3px solid var(--pmx-yellow);
  border-radius: var(--radius);
}

.user-chip { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.profile-wrap { position: relative; }
.profile-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: 1px solid transparent; border-radius: 7px;
  padding: 4px 8px; cursor: pointer;
}
.profile-btn:hover { border-color: #5a5a5e; }
.chip-avatar { width: 26px; height: 26px; border-radius: 50%; }
.chip-initials {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  background: var(--pmx-red); color: #fff;
  font: 700 11px var(--pmx-font-body);
  display: flex; align-items: center; justify-content: center;
}
.chip-name { font: 600 12.5px var(--pmx-font-body); color: #e4e4e6; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-caret { color: #8d8d93; font-size: 10px; }
.chip-signout {
  font: 600 11.5px var(--pmx-font-body); color: #d8d8da; background: none;
  border: 1px solid #5a5a5e; border-radius: 5px; padding: 4px 10px; cursor: pointer;
}
.chip-signout:hover { color: #fff; border-color: #9a9a9e; }

/* profile dropdown */
.profile-dd {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 600;
  width: 300px; background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-top: 3px solid var(--pmx-red);
  border-radius: 10px; box-shadow: 0 10px 34px rgba(0,0,0,.28);
  padding: 14px 16px;
}
.pd-head { display: flex; gap: 12px; align-items: center; padding-bottom: 10px;
  border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.pd-avatar { width: 42px; height: 42px; border-radius: 50%; flex: none; }
.pd-initials { background: var(--pmx-red); color: #fff;
  font: 700 16px var(--pmx-font-body);
  display: flex; align-items: center; justify-content: center; }
.pd-name { font: 700 14.5px var(--pmx-font-body); color: var(--ink); }
.pd-mail { font-size: 12.5px; color: var(--ink-3); overflow-wrap: anywhere; }
.pd-row { display: flex; justify-content: space-between; gap: 12px;
  font-size: 13px; padding: 4px 0; color: var(--ink); }
.pd-k { color: var(--ink-3); flex: none; }
.pd-dim { color: var(--ink-3); }
.pd-actions { display: flex; gap: 8px; margin-top: 12px; }
.pd-actions .btn { flex: 1; }

/* loading veil */
.loading-veil { position: fixed; inset: 0; background: var(--surface-2); z-index: 999; display: flex; align-items: center; justify-content: center; }
.loading-card { background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--pmx-red); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 30px; display: flex; flex-direction: column; gap: 6px; }
.loading-veil[hidden] { display: none; }

@media (max-width: 900px) {
  #map-side-right { width: 300px; }
  .map-banner { display: none; }
}

/* ------- Curb Policy Manager: apply-paint mode + environments (additive) */
/* floating notice over the map while a policy is being applied by clicking */
.apply-banner {
  position: absolute; bottom: 74px; left: 50%; transform: translateX(-50%);
  z-index: 21; max-width: min(560px, calc(100% - 40px));
  display: flex; align-items: center; gap: 10px;
  background: rgba(51,51,51,.95); color: #fff;
  border-radius: 8px; font-size: 12.5px; padding: 8px 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.apply-banner .btn { flex: none; }

/* "N ids" badge on a unique-policy group row */
.badge.ids { background: #EFEFF1; color: #46464a; }

/* Environments panel: pills + status + actions, all wrapping in the drawer */
.env-pills { display: flex; gap: 6px; flex-wrap: wrap; }
.env-pills .btn { flex: 0 1 auto; }
.env-status { font-size: 12px; color: var(--ink-2); margin: 5px 0 0; overflow-wrap: anywhere; }
.env-status.sel { font-weight: 700; color: var(--ink); }
.env-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.env-actions .btn { font-size: 11.5px; padding: 3px 9px; }

/* ------------------------------------------------ Curb Policy Manager page */
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; }
.pm-card { margin-bottom: 0; }
.pm-card.pm-open { grid-column: 1 / -1; }
.pm-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.pm-title { font-family: var(--pmx-font-headline); font-size: 16px; }
.pm-usage { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }
.pm-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pm-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 26px; align-items: start; }
.pm-mini { font-size: 11.5px; padding: 2px 9px; margin-left: 6px; }
.pm-mini.active { background: var(--pmx-charcoal); border-color: var(--pmx-charcoal); color: #fff; }
.pm-grid .field-row { grid-template-columns: 128px minmax(0, 1fr); }
.pm-grid input, .pm-grid select { min-width: 0; max-width: 100%; }

.pm-sentence { font-size: 14px; color: var(--ink); }
.pm-live {
  background: var(--pmx-gray-4); border-left: 3px solid var(--pmx-red);
  border-radius: 6px; padding: 8px 12px; margin: 6px 0 12px;
  font-size: 13.5px; display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline;
}
.pm-live-k { color: var(--ink-3); font-size: 12px; }

/* -------------------------------------------- Curb Policy Manager table */
.pm-tablewrap { overflow-x: auto; border-radius: var(--radius); }
.pm-table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.pm-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--pmx-charcoal); color: #fff;
  font: 800 11.5px var(--pmx-font-body); letter-spacing: .05em; text-transform: uppercase;
  text-align: left; padding: 10px 12px;
  border-bottom: 2px solid var(--pmx-red);
  white-space: nowrap;
}
.pm-table thead th.num { text-align: right; }
.pm-table thead th.pm-sort { cursor: pointer; user-select: none; }
.pm-table thead th.pm-sort:hover { color: #fff; background: #3f3f45; }
.pm-table thead th .pm-arrow { color: #9a9a9e; font-size: 10px; }
.pm-table thead th.on .pm-arrow { color: var(--pmx-red); }

.pm-table tbody tr.pm-row { cursor: pointer; }
.pm-table tbody tr.pm-row:nth-child(even) { background: var(--surface-2); }
.pm-table tbody tr.pm-row:hover { background: #F0F4F8; }
.pm-table tbody tr.pm-row.open { background: #FBE8E5; }
.pm-table td {
  padding: 8px 12px; border-bottom: 1px solid #F0F0F0;
  vertical-align: middle; white-space: nowrap;
}
.pm-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.pm-dot {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  margin-right: 8px; vertical-align: -1px;
}
.pm-dot.proh { border-radius: 2px; }
.pm-act { font-weight: 700; }
.pm-muted { color: var(--ink-3); }
.pm-cell-who, .pm-cell-when { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.pm-cell-flags .badge { margin-right: 4px; }
.pm-cell-actions { text-align: right; }
.pm-cell-actions .btn { margin-left: 4px; }

.pm-table tr.pm-edit-row td {
  background: #fff; border-bottom: 2px solid var(--pmx-red);
  padding: 14px 18px 18px; white-space: normal; cursor: default;
}
.pm-editor { max-width: 1100px; }
@media (max-width: 900px) {
  .pm-cell-who, .pm-cell-when { max-width: 120px; }
}

.pm-days { display: inline-flex; gap: 2px; align-items: center; }
.pm-day {
  font: 700 9.5px var(--pmx-font-body); color: #b9b9bd;
  background: var(--pmx-gray-4); border-radius: 3px; padding: 2px 3px;
  letter-spacing: .02em;
}
.pm-day.on { background: var(--pmx-charcoal); color: #fff; }

/* ------------------------------------------------------- symbology editor */
/* layer picker - grouped by the geometry class inferred from the data */
.sym-pick { margin-bottom: 8px; }
.sym-select {
  font: inherit; font-size: 12px; padding: 4px 6px; min-width: 0; width: 100%;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}

/* the one selected layer's editor */
.sym-editor {
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; background: #fff;
}
.sym-editor-head {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.sym-editor-foot {
  margin-top: 9px; display: flex; align-items: center; gap: 8px;
  justify-content: space-between; flex-wrap: wrap;
}
.sym-editor-foot > button { white-space: nowrap; }
/* how the geometry class was inferred, so the classification is not magic */
.sym-geom { font-size: 9.5px; line-height: 1.3; min-width: 0; flex: 1 1 60%; }
.sym-fields {
  display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 8px; align-items: center;
}
.sym-flabel { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }
/* toggles sit at their natural width instead of filling the grid column */
.sym-fields > button { justify-self: start; }
.sym-range { display: flex; align-items: center; gap: 7px; min-width: 0; }
.sym-range input[type="range"] { min-width: 0; flex: 1; accent-color: var(--pmx-red); }
.sym-val {
  font-size: 10.5px; color: var(--ink-3); min-width: 38px; text-align: right;
  flex: none; font-variant-numeric: tabular-nums;
}
#symbology-body input[type="color"] {
  width: 26px; height: 26px; padding: 0; border: 1px solid var(--line);
  border-radius: 5px; background: none; cursor: pointer; flex: none;
}
#symbology-body input[type="range"] { accent-color: var(--pmx-red); }

/* live sample of the selected layer */
.sym-preview { flex: 1; min-width: 20px; display: flex; align-items: center; }
.sym-preview-line { display: block; width: 100%; height: 0; }
.sym-preview-dot { display: block; border-radius: 50%; flex: none; }
.sym-preview-poly { display: block; width: 100%; height: 20px; border-radius: 3px; }

/* --------------------------------------------------------- CDS validator */
.val-input {
  width: 100%; min-height: 180px; resize: vertical;
  font: 12px ui-monospace, Consolas, monospace;
  border: 1px solid #cfcfd1; border-radius: 7px; padding: 10px 12px;
  color: var(--ink); background: #fff;
}
.val-verdict.ok { border-top: 4px solid #3FB549; }
.val-verdict.bad { border-top: 4px solid var(--pmx-red); }
.val-verdict h3 { text-transform: none; letter-spacing: 0; font-size: 16px; }

.val-summary { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 6px; }
.val-sum-cell { display: flex; flex-direction: column; }
.val-sum-cell strong { font-size: 15px; overflow-wrap: anywhere; }
.val-flag { font-weight: 800; }
.val-flag.y { color: #2E8540; }
.val-flag.n { color: var(--pmx-red); }
.val-flag.m { color: var(--ink-3); }
tr.pm-row.val-bad { background: #FBE8E5 !important; }
.val-table td .hint { font-size: 11px; }

.macro-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.macro-btn[disabled]:hover { color: inherit; }

.api-card .api-url {
  font-family: ui-monospace, Consolas, monospace; font-size: 11.5px;
  background: var(--paper-2, #F4F4F3); border: 1px solid var(--line, #DBDDDC);
  border-radius: 6px; padding: 5px 8px; margin: 6px 0;
  overflow-wrap: anywhere; user-select: all;
}

/* ------------------------------------------------------- CDS graph loader */
/* The Data panel loads CDS as a graph - one slot per Curbs API component -
   so it reads as a structure, not as another list of layer checkboxes. */
.layer-group {
  font: 700 10.5px var(--pmx-font-body); text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-3);
  margin: 12px 0 4px; padding-top: 8px; border-top: 1px solid var(--line);
}
#layer-controls .layer-group:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
label.layer-absent { opacity: .5; }
label.layer-absent .hint { font-size: 11px; }

.cds-slots { display: flex; flex-direction: column; gap: 6px; }
.cds-slot {
  border: 1px solid var(--line); border-left: 3px solid #B3B4B5;
  border-radius: 6px; padding: 6px 8px; background: #fff;
}
.cds-slot.bad { border-left-color: var(--pmx-red); background: #FDF6F5; }
.cds-slot.cds-drop, .cds-drop { outline: 2px dashed #0073BB; outline-offset: 2px; }
.cds-slot-head { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.cds-slot-name { font: 600 12.5px var(--pmx-font-body); color: var(--ink); }
.cds-slot-ep {
  font: 11px ui-monospace, Consolas, monospace; color: var(--ink-3); margin: 1px 0 3px;
}
.cds-slot-state { display: flex; align-items: baseline; gap: 6px; font-size: 12px; }
.cds-slot-state strong { font-size: 14px; }
.cds-slot-state.empty { color: var(--ink-3); font-style: italic; }
.cds-slot-src {
  color: var(--ink-3); font-size: 11px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.cds-slot-actions { display: flex; gap: 4px; margin-top: 4px; }
.cds-slot-actions .btn { margin-left: 0; }

.cds-graph {
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line);
}
.cds-graph-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font: 700 10.5px var(--pmx-font-body); text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-3); margin-bottom: 4px;
}
.cds-graph-head .val-flag { text-transform: none; letter-spacing: 0; font-size: 11.5px; }
.cds-graph-stat { display: flex; justify-content: space-between; font-size: 12px; padding: 1px 0; }
.cds-graph-stat span { color: var(--ink-3); }
.cds-edge {
  display: flex; justify-content: space-between; gap: 8px;
  font: 11px ui-monospace, Consolas, monospace; padding: 1px 0; color: var(--ink-2);
}
.cds-edge-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cds-detail {
  font: 10.5px ui-monospace, Consolas, monospace; color: var(--ink-3);
  padding: 2px 0 4px 6px; border-left: 2px solid var(--line);
  margin: 0 0 4px 4px; overflow-wrap: anywhere;
}

/* ------------------------------------------------ CDS graph panel: systems */
.cds-sysrow {
  border-left: 3px solid var(--line); padding: 3px 0 3px 7px; margin-bottom: 4px;
}
.cds-sysrow-head { display: flex; align-items: center; gap: 6px; }
.cds-sysrow-name {
  font: 600 12.5px var(--pmx-font-body); color: var(--ink);
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cds-sysrow-parts { font-size: 11px; color: var(--ink-3); overflow-wrap: anywhere; }

/* ------------------------------------------------------------ load wizard */
.wiz-veil {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(51,51,51,.46);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
/* the veil is display:flex, so the hidden attribute needs saying explicitly */
.wiz-veil[hidden] { display: none; }
body.modal-open { overflow: hidden; }

.wiz {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,.3);
  width: min(940px, 100%); max-height: min(720px, 100%);
  display: flex; flex-direction: column; overflow: hidden;
}
.wiz-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 14px 18px 12px; border-bottom: 1px solid var(--line);
}
.wiz-head h3 { margin: 0; font: 700 16px var(--pmx-font-headline); color: var(--ink); }
.wiz-head .hint { margin: 3px 0 0; }
.wiz-x {
  border: 0; background: none; cursor: pointer; font-size: 22px; line-height: 1;
  color: var(--ink-3); padding: 0 2px;
}
.wiz-x:hover { color: var(--ink); }

.wiz-body { display: flex; min-height: 0; flex: 1; }

.wiz-steps {
  list-style: none; margin: 0; padding: 14px 0; width: 168px; flex: none;
  border-right: 1px solid var(--line); background: var(--surface-2);
}
.wiz-step {
  display: flex; align-items: center; gap: 9px; padding: 8px 14px;
  cursor: pointer; font: 600 12.5px var(--pmx-font-body); color: var(--ink-3);
  border-left: 3px solid transparent;
}
.wiz-step:hover { color: var(--ink); }
.wiz-step-n {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px;
  background: #E9E9EC; color: var(--ink-2);
}
.wiz-step.here { color: var(--ink); border-left-color: var(--pmx-red); background: var(--surface); }
.wiz-step.here .wiz-step-n { background: var(--pmx-red); color: #fff; }
.wiz-step.done .wiz-step-n { background: var(--pmx-charcoal); color: #fff; }

.wiz-panel { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wiz-panel-head { padding: 14px 18px 8px; }
.wiz-panel-head h4 { margin: 0; font: 700 14px var(--pmx-font-headline); color: var(--ink); }
.wiz-panel-head .hint { margin: 2px 0 0; }
.wiz-stage { padding: 4px 18px 18px; overflow-y: auto; flex: 1; min-height: 0; }
.wiz-h5 {
  font: 700 10.5px var(--pmx-font-body); text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); margin: 16px 0 6px; padding-top: 8px; border-top: 1px solid var(--line);
}
.wiz-stage > .wiz-h5:first-child { margin-top: 4px; padding-top: 0; border-top: 0; }
.wiz-foot-note { margin-top: 12px; }

.wiz-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 11px 18px; border-top: 1px solid var(--line); background: var(--surface-2);
}
.wiz-note { font-size: 12px; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.wiz-nav { display: flex; gap: 6px; flex: none; }
.wiz-nav .btn { margin-left: 0; }

/* ---- step 1: system cards */
.wiz-syscards { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 10px; }
.wiz-syscard {
  border: 1px solid var(--line); border-top: 3px solid var(--sys, #B3B4B5);
  border-radius: 6px; padding: 10px 11px; background: #fff;
}
.wiz-syscard-head { display: flex; align-items: center; gap: 6px; }
.wiz-swatch {
  width: 14px; height: 14px; flex: none; border-radius: 3px;
  border: 1px solid rgba(0,0,0,.18); cursor: pointer; padding: 0;
}
.wiz-sysname {
  flex: 1; min-width: 0; font: 600 13px var(--pmx-font-body); color: var(--ink);
  border: 1px solid transparent; background: none; padding: 2px 4px; border-radius: 4px;
}
.wiz-sysname:hover { border-color: var(--line); }
.wiz-sysname:focus { border-color: #0073BB; background: #fff; outline: none; }
.wiz-syscard-head .btn { margin-left: 0; }
.wiz-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 4px; }
.wiz-chip {
  font-size: 11px; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 1px 8px; color: var(--ink-2);
}
.wiz-empty { font-size: 12px; color: var(--ink-3); font-style: italic; margin: 8px 0 4px; }
.wiz-syscard-acts { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.wiz-syscard-acts .btn { margin-left: 0; }
.wiz-add { margin-top: 10px; }

/* ---- step 2: which system am I filling */
.wiz-sysstrip { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 10px; }
.wiz-systab {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; border-radius: 14px;
  padding: 3px 11px; font: 600 12px var(--pmx-font-body); color: var(--ink-2);
}
.wiz-systab:hover { border-color: var(--ink-3); }
.wiz-systab.active { background: var(--pmx-charcoal); border-color: var(--pmx-charcoal); color: #fff; }
.wiz-systab-n { font-weight: 400; opacity: .75; font-size: 11px; }
.wiz-dot { width: 9px; height: 9px; flex: none; border-radius: 50%; background: #B3B4B5; }

/* ---- step 3: tables */
.wiz-tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wiz-tbl th {
  text-align: left; font: 700 10.5px var(--pmx-font-body); text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-3); padding: 4px 8px 4px 0;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.wiz-tbl td { padding: 5px 8px 5px 0; border-bottom: 1px solid #F2F2F2; }
.wiz-tbl td:first-child { display: table-cell; }
.wiz-tbl th.num, .wiz-tbl td.num { text-align: right; padding-right: 0; }
.wiz-tbl th.num:not(:last-child), .wiz-tbl td.num:not(:last-child) { padding-right: 14px; }
.wiz-tbl td.nil { color: var(--ink-3); }
.wiz-tbl td.cross { color: #0073BB; font-weight: 700; }
.wiz-tbl td.bad { color: var(--pmx-red); font-weight: 700; }
.wiz-tbl tr.bad td:first-child { color: var(--pmx-red); }
.wiz-tbl td .wiz-dot { display: inline-block; margin-right: 6px; vertical-align: middle; }
.wiz-stage code {
  font: 11.5px ui-monospace, Consolas, monospace;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 3px; padding: 0 4px;
}

/* ---- step 4: the numbers that decide whether to load */
.wiz-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.wiz-stat {
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 12px;
  background: var(--surface-2); min-width: 96px;
}
.wiz-stat strong { display: block; font: 700 17px var(--pmx-font-headline); color: var(--ink); }
.wiz-stat span {
  font: 600 10.5px var(--pmx-font-body); text-transform: uppercase;
  letter-spacing: .05em; color: var(--ink-3);
}
.wiz-stat.good strong { color: #2E8540; }
.wiz-stat.bad strong { color: var(--pmx-red); }

@media (max-width: 700px) {
  .wiz-body { flex-direction: column; }
  .wiz-steps {
    width: auto; display: flex; overflow-x: auto; padding: 6px;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .wiz-step { border-left: 0; border-bottom: 3px solid transparent; white-space: nowrap; }
  .wiz-step.here { border-left: 0; border-bottom-color: var(--pmx-red); }
}

/* ------------------------------------------------- reference layers (rail) */
/* User context - ArcGIS / GeoJSON / shapefile - listed under the CDS kinds in
   the Layers panel. Each row is one layer: on/off, colour, what it holds. */
.ref-row {
  border: 1px solid var(--line); border-radius: 5px;
  padding: 5px 7px; margin: 0 0 5px; background: var(--surface-2);
}
.ref-row-head { display: flex; align-items: center; gap: 6px; }
#layer-controls .ref-row-on { flex: 1; min-width: 0; padding: 0; }
.ref-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600;
}
.ref-color {
  width: 22px; height: 18px; flex: none; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 3px; background: none;
}
.ref-row-meta { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.ref-row-warn {
  font-size: 11px; color: #8A5A1F; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ref-row-acts { display: flex; gap: 4px; margin-top: 5px; }
.ref-row-acts .btn { margin-left: 0; }

/* ------------------------------------------------------- add-layer dialog */
.layer-add { width: min(680px, 100%); }
.layer-add .wiz-panel { min-height: 0; }
.layer-add .wiz-stage { padding-top: 0; }
.wiz-note.bad { color: var(--pmx-red); font-weight: 600; }
.la-busy::after {
  content: ""; display: inline-block; width: 9px; height: 9px; margin-left: 7px;
  border: 2px solid var(--line); border-top-color: var(--pmx-red);
  border-radius: 50%; vertical-align: -1px; animation: la-spin .7s linear infinite;
}
@keyframes la-spin { to { transform: rotate(360deg); } }

.la-row { display: flex; gap: 6px; align-items: center; }
.la-row .btn { margin-left: 0; flex: none; }
.la-input {
  flex: 1; min-width: 0; font: 12.5px var(--pmx-font-body); color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; background: #fff;
}
.la-input:focus { border-color: #0073BB; outline: none; }

.la-drop {
  border: 1.5px dashed var(--line); border-radius: 6px; background: var(--surface-2);
  padding: 18px 14px; text-align: center;
}
.la-drop p { margin: 0 0 8px; font-size: 12.5px; color: var(--ink-2); }
.la-drop .btn { margin-left: 0; }
.la-drop.over { border-color: var(--pmx-red); background: #FDF1EF; }
.la-drop.busy { opacity: .6; }

.la-list { display: flex; flex-direction: column; gap: 4px; }
.la-listrow {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  text-align: left; cursor: pointer; background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 4px; padding: 6px 9px;
  font: 12.5px var(--pmx-font-body);
}
.la-listrow:hover { border-color: #0073BB; background: var(--surface-2); }
.la-listrow .hint { margin: 0; flex: none; }

.la-added { display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 12.5px; }
.la-added .hint { margin: 0; }
.la-added-name { font-weight: 600; color: var(--ink); }
.la-swatch {
  width: 11px; height: 11px; flex: none; border-radius: 2px;
  border: 1px solid rgba(0,0,0,.18);
}

/* ------------------------------------------ Add Data: the three routes in */
/* One box, three buttons, each opening its own wizard. Stacked rather than
   gridded because the drawer is narrow and a three-column grid there turns
   every label into two lines. */
.add-routes { display: flex; flex-direction: column; gap: 8px; }
.add-route {
  display: grid; grid-template-columns: 26px 1fr; gap: 2px 10px;
  align-items: center; text-align: left; width: 100%;
  padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink);
  font: inherit;
}
.add-route:hover { border-color: var(--pmx-red); background: #FFF7F5; }
.add-route:focus-visible { outline: 2px solid var(--pmx-blue); outline-offset: 1px; }
.add-route.disabled, .add-route:disabled { opacity: .5; cursor: default; }
.add-route.disabled:hover, .add-route:disabled:hover {
  border-color: var(--line); background: var(--surface);
}
.add-route-icon {
  grid-row: 1 / span 2; align-self: start;
  font-size: 17px; line-height: 1.1; color: var(--pmx-red); text-align: center;
}
.add-route-label { font: 700 13.5px var(--pmx-font-headline); color: var(--ink); }
.add-route-blurb { font-size: 11.5px; line-height: 1.35; color: var(--ink-3); }

.add-inview {
  display: flex; flex-direction: column; gap: 1px;
  padding: 6px 0; border-top: 1px solid #F2F2F2;
}
.add-inview:first-of-type { border-top: 0; padding-top: 0; }
.add-inview strong { font-size: 12.5px; color: var(--ink); }
.add-inview .hint { margin: 0; }

/* -------------------------------------------- describe-this-curb dialog */
.wiz.dw { width: min(820px, 100%); }
.dw-live {
  display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline;
  border-left: 3px solid var(--pmx-charcoal); background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 7px 10px; margin: 4px 0 10px;
  font-size: 12.5px; color: var(--ink);
}
.dw-live-k { color: var(--ink-3); font-size: 11.5px; }
.dw-discard { font-size: 11px; padding: 2px 8px; margin-left: 6px; }

/* quiet "Drawing on" mark, bottom-left of the map, while a draw is live.
   Sits above the Google logo's row; inert so it never takes a map click. */
.draw-indicator {
  position: absolute; left: 10px; bottom: 40px; z-index: 21;
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(51,51,51,.72); color: #e6e6e8;
  font: 500 10.5px var(--pmx-font-body); letter-spacing: .02em;
  padding: 3px 8px 3px 7px; border-radius: 999px;
  pointer-events: none; user-select: none;
}
.draw-indicator-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--pmx-red);
  animation: draw-pulse 1.6s ease-in-out infinite;
}
@keyframes draw-pulse { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }

/* The finish handle of a draw in progress: the last placed vertex, as an HTML
   control so both renderers share one look (canvasmap.js pins it in the host,
   map.js in a Google OverlayView). Twice the size of the other vertices, a
   pulse once the line is long enough to be a curb, red under the pointer:
   that is the whole instruction, with no caption. Inert until a second
   vertex arms it - one point is not a curb, and a pen tip should not look
   clickable. */
.draw-end {
  position: absolute; z-index: 5; box-sizing: border-box;
  width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--pmx-red);
  pointer-events: none; user-select: none; touch-action: none;
  transition: transform .12s ease, background-color .12s ease;
}
.draw-end.armed { pointer-events: auto; cursor: pointer; }
.draw-end.armed::before {
  content: ""; position: absolute; inset: -2.5px; border-radius: 50%;
  border: 2px solid var(--pmx-red);
  animation: draw-end-pulse 1.5s ease-out infinite;
}
.draw-end.armed:hover { background: var(--pmx-red); transform: scale(1.3); }
.draw-end.armed:hover::before { animation: none; opacity: 0; }
/* white core on hover, so the red disc still reads as a point on the red line */
.draw-end.armed:hover::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%; background: #fff;
}
@keyframes draw-end-pulse {
  0%   { transform: scale(1);   opacity: .75; }
  100% { transform: scale(2.4); opacity: 0; }
}

.dw-choice {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 8px; background: var(--surface);
}
.dw-choice.active { border-color: var(--pmx-red); background: #FFF7F5; }
.dw-choice-head {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  font-size: 13px; color: var(--ink);
}
.dw-steps { margin: 6px 0 0; padding-left: 20px; font-size: 12.5px; color: var(--ink-2); }
.dw-steps li { margin: 3px 0; }
