/* RouteLogic Route Planner — built to be read over screen share.
   Heavy weights so nothing dissolves in video compression. Every colour comes
   from theme.css, which is what makes the light theme a real design rather
   than an inversion. */

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

html, body { height: 100%; min-width: 1280px; min-height: 760px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: auto;
}

/* ============================== scrollbars ===============================
   The OS default is a light-grey slab that sits on the dark panel like a
   sticker. These are the app's own colours, and the thumb only reaches full
   contrast on hover so it recedes while you're reading the crew list. */

/* Firefox only. Chrome ignores ::-webkit-scrollbar on any element that also
   sets scrollbar-width/-color, and the standard properties can't do the
   rounded thumb or the hover state — so gate them to browsers without the
   pseudo-element. */
@supports not selector(::-webkit-scrollbar) {
  * {
    scrollbar-width: thin;
    scrollbar-color: var(--thumb) transparent;
  }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--thumb);
  border: 2px solid transparent;                /* inset — reads as a slim pill */
  background-clip: padding-box;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: var(--thumb-hover); background-clip: padding-box; }
::-webkit-scrollbar-thumb:active { background: var(--cc-lt); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ================================ topbar ================================= */

.top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: var(--cc);
  border-bottom: 1px solid #063d27;
  min-width: 1280px;
  white-space: nowrap;
}

.logo { flex: none; height: 42px; width: 63px; object-fit: cover; border-radius: 8px; }

.top-title { flex: 1 1 auto; min-width: 150px; }
/* Explicit white — the header sits on the brand green in both themes, so it
   must not inherit the light theme's dark ink. */
.top-title h1 { margin: 0; font-size: 18px; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.top-title p { margin: 1px 0 0; font-size: 12.5px; color: rgba(255,255,255,.66); }
.top-title p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-title > p { display: none; }
.brand-by { display: block; margin-top: -1px; color: rgba(255,255,255,.68); font-size: 11.5px; font-weight: 400; letter-spacing: .02em; }

.seg { display: flex; flex: none; border: 1.5px solid rgba(255,255,255,.28); border-radius: 9px; overflow: hidden; }
.seg button {
  padding: 9px 18px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.72);
  font: 700 14px/1 inherit;
  font-family: inherit;
  cursor: pointer;
}
.seg button.on { background: #fff; color: var(--cc); }

.top-actions { display: flex; flex: none; gap: 6px; }
.top-actions > a.btn { display: none; }

.btn {
  padding: 9px 12px;
  border: 1.5px solid rgba(255,255,255,.34);
  border-radius: 9px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font: 700 14px/1 inherit;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,.2); }
.btn.ghost { background: transparent; color: rgba(255,255,255,.7); }

.crew-ctl {
  display: flex; flex: none; align-items: center; gap: 8px;
  padding: 5px 10px 5px 13px;
  border: 1.5px solid rgba(255,255,255,.28);
  border-radius: 9px;
}
.ctl-k { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255,255,255,.6); }
.ctl-v { min-width: 16px; text-align: center; font-size: 17px; font-weight: 800; color: #fff; }
.crew-ctl button {
  width: 27px; height: 27px;
  border: 0; border-radius: 7px;
  background: rgba(255,255,255,.14);
  color: #fff; font: 700 17px/1 inherit; font-family: inherit; cursor: pointer;
}
.crew-ctl button:hover { background: rgba(255,255,255,.28); }

.points-nav { position: relative; display: inline-flex; align-items: center; gap: 5px; }
.points-nav > span:first-child { color: #ffd45c; font-size: 16px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.points-nav #pointsTotal { min-width: 18px; padding: 2px 5px; border-radius: 999px; background: rgba(0,0,0,.2); color: #fff; text-align: center; font-size: 11px; }
.points-badge { position: absolute; right: -7px; top: -9px; min-width: 19px; height: 19px; padding: 0 5px; display: grid; place-items: center; border: 2px solid var(--cc); border-radius: 999px; background: #f2b632; color: #1c1604; font-size: 9px; line-height: 1; }
.points-badge[hidden] { display: none; }

.settings-wrap { position: relative; flex: none; }
.settings-btn { width: 40px; height: 38px; display: grid; place-items: center; border: 1.5px solid rgba(255,255,255,.38); border-radius: 10px; background: rgba(255,255,255,.1); color: #fff; font: 700 19px/1 inherit; font-family: inherit; cursor: pointer; }
.settings-btn:hover, .settings-btn[aria-expanded="true"] { background: rgba(255,255,255,.22); }
.settings-menu { position: absolute; z-index: 80; right: 0; top: calc(100% + 10px); width: 218px; padding: 8px; border: 1px solid var(--line-2); border-radius: 13px; background: var(--panel); color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.32); }
.settings-menu[hidden] { display: none; }
.settings-menu::before { content: ""; position: absolute; right: 13px; top: -6px; width: 10px; height: 10px; border-left: 1px solid var(--line-2); border-top: 1px solid var(--line-2); background: var(--panel); transform: rotate(45deg); }
.settings-menu a { position: relative; display: flex; align-items: center; gap: 11px; padding: 11px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-size: 13.5px; }
.settings-menu a:hover, .settings-menu a:focus-visible { background: var(--panel-3); outline: none; }
.settings-menu a span { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: var(--track); color: var(--cc); font-size: 13px; }
.settings-menu a b { font-weight: 700; }

/* ================================= days ================================== */

.days {
  flex: none;
  display: flex;
  gap: 6px;
  padding: 10px 22px;
  background: var(--track);
  border-bottom: 1px solid var(--line);
  min-width: 1280px;
  overflow-x: auto;
}
.day {
  display: flex; flex: none; align-items: baseline; gap: 9px;
  padding: 8px 17px;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
}
.day:hover { border-color: var(--line-2); color: var(--ink); }
.day.on { background: var(--cc-lt); border-color: var(--cc-lt); color: var(--accent-on); }
.day.over { border-color: var(--danger-line); }
.day-n { font-size: 14px; font-weight: 800; }
.day-v { font-size: 12px; font-weight: 600; opacity: .75; }

/* ================================ layout ================================= */

/* minmax(0,1fr) on the row is what actually lets the sidebar scroll — a grid
   track defaults to auto, which sizes to content and pushes the overflow off
   the bottom of the page instead of into the panel's own scroller. */
.shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  transition: grid-template-columns .18s ease;
  min-width: 1280px;
  min-height: 610px;
}
.shell.collapsed { grid-template-columns: 0 minmax(0, 1fr); }

.side {
  grid-column: 1;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.shell.collapsed .side { display: none; }

.side-toggle {
  position: absolute;
  left: 0; top: 14px;
  z-index: 7;
  width: 26px; height: 46px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 9px 9px 0;
  background: var(--panel);
  color: var(--muted);
  font: 700 15px/1 inherit;
  font-family: inherit;
  cursor: pointer;
}
.side-toggle:hover { color: var(--ink); background: var(--panel-2); }

.headline { margin-bottom: 14px; line-height: 1.25; }

.warn {
  margin-bottom: 14px;
  padding: 10px 12px;
  border: 1px solid var(--danger-line);
  border-radius: 9px;
  background: var(--danger-bg);
  color: var(--danger-ink);
  font-size: 12.5px;
  line-height: 1.45;
  font-weight: 600;
}
.warn[hidden] { display: none; }

.scope { display: flex; gap: 5px; margin-bottom: 12px; }
.scope button {
  flex: 1;
  padding: 7px 10px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font: 700 12.5px/1 inherit;
  font-family: inherit;
  cursor: pointer;
}
.scope button.on { background: var(--panel-3); border-color: var(--cc-lt); color: var(--ink); }
.headline .big { font-size: 30px; font-weight: 800; color: var(--cc-lt); letter-spacing: -.02em; }
.headline .small { font-size: 13.5px; color: var(--muted); }

/* ================================ stats ================================== */

.stats { display: flex; flex-direction: column; gap: 2px; margin-bottom: 26px; }

.stat {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border-radius: 9px;
}

.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }

.stat-vals { display: flex; align-items: baseline; gap: 7px; grid-column: 1 / -1; }
.v-before { font-size: 16px; font-weight: 600; color: var(--muted-2); text-decoration: line-through; }
.v-arrow { color: var(--faint); font-size: 13px; }
.v-after { font-size: 20px; font-weight: 800; color: var(--ink); letter-spacing: -.01em; }

.stat-delta {
  grid-row: 1;
  grid-column: 2;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: var(--ok-bg);
  color: var(--cc-lt);
}
.stat-delta.bad { background: var(--danger-bg); color: var(--danger-ink); }

/* ================================ crews ================================== */

.side-h { margin: 0 0 3px; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.side-note { margin: 0 0 12px; font-size: 12.5px; color: var(--muted-2); }
.model-status {
  margin: 0 0 13px; padding: 7px 9px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel-2); color: var(--muted);
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
}

.crews { display: flex; flex-direction: column; gap: 9px; }

.crew {
  width: 100%;
  padding: 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: var(--panel-2);
  color: inherit;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.crew:hover { border-color: var(--line-2); background: var(--panel-3); }
.crew.on { border-color: var(--cc-lt); background: var(--panel-3); }

.crew-head { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; }
.crew-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.crew-name { flex: 1; font-size: 14.5px; font-weight: 700; }
.crew-size {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--chip);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
}
.crew-size.bad { background: var(--danger-bg); color: var(--danger-ink); }

.crew-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.cg { display: flex; flex-direction: column; gap: 1px; }
.cg-k { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted-2); }
.cg-v { font-size: 14px; font-weight: 700; }

.bar { display: flex; height: 7px; border-radius: 4px; overflow: hidden; background: var(--track); }
.bar-drive { background: var(--drive); }
.bar-work { background: var(--cc-lt); }

.legend { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.legend-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.sw { width: 15px; height: 7px; border-radius: 3px; flex: none; }
.sw.drive { background: var(--drive); }
.sw.work { background: var(--cc-lt); }
.sw.ring { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--cc-lt); background: transparent; }
.legend p { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted-2); }

/* ================================= map =================================== */

/* Pinned to column 2. Collapsing hides .side with display:none, which takes it
   out of grid flow — without this the map auto-places into the 0px track and
   disappears instead of widening. */
.mapwrap { grid-column: 2; position: relative; min-width: 700px; background: radial-gradient(1200px 800px at 50% 40%, var(--map-glow), var(--bg)); }

#map { width: 100%; height: 100%; display: block; }

/* The stops panel and the collapse tab live over the top-right of the map, so
   push MapLibre's zoom buttons clear of both. */
.mapwrap .maplibregl-ctrl-top-right { top: 8px; right: 8px; }
.mapwrap.has-stops .maplibregl-ctrl-top-right,
.mapwrap.has-parcel .maplibregl-ctrl-top-right { right: 366px; }

.flag {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--danger-bg);
  color: var(--danger-ink);
  font-size: 10.5px;
  font-weight: 800;
}

.btn:is(a) { text-decoration: none; display: inline-flex; align-items: center; }

/* =============================== overlays ================================ */

/* Now carries a crew dot, a headline and a detail line, so it is a row of
   parts rather than a single string. Centred over the map but pushed below
   the search box, which owns the top-left. */
.flash {
  position: absolute;
  left: 50%; top: 18px;
  transform: translate(-50%, -14px);
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: min(680px, calc(100% - 96px));
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--cc-lt);
  color: var(--accent-on);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 10;
}
.flash.show { opacity: 1; transform: translate(-50%, 0); }

/* The parcel card and selected route are one stack. The parcel sits above the
   route; when it closes, flex layout moves the route straight back to the top. */
.map-panels {
  position: absolute;
  right: 18px; top: 18px; bottom: 70px;
  z-index: 9;
  width: 330px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.stops {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--glass);
  overflow-y: auto;
  backdrop-filter: blur(6px);
  pointer-events: auto;
}
.stops[hidden] { display: none; }

.stops-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 13.5px;
  font-weight: 800;
}
.stops-close {
  border: 0; background: transparent; color: var(--muted);
  font-size: 16px; cursor: pointer; padding: 2px 5px;
}

.stop { display: flex; gap: 11px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.stop:last-child { border-bottom: 0; }
.stop.selected {
  margin: 0 -8px;
  padding: 9px 8px;
  border-radius: 9px;
  background: var(--chip);
  box-shadow: inset 3px 0 0 var(--cc-lt);
}
.stop-n {
  flex: none;
  width: 23px; height: 23px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--chip);
  font-size: 11.5px; font-weight: 800;
  color: var(--cc-lt);
}
.stop-body { min-width: 0; }
.stop-name { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.twice {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--chip);
  color: var(--cc-lt);
  font-size: 10.5px;
  font-weight: 800;
  vertical-align: 1px;
}

.spinner {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: var(--scrim);
  color: var(--cc-lt);
  font-size: 15px;
  font-weight: 700;
  z-index: 5;
}
body.busy .spinner { display: grid; }
.stop-meta { font-size: 11.5px; color: var(--muted-2); margin-top: 1px; }

/* ============================= address search ============================
   Sits over the top-left of the map, clear of the collapse tab. */

.mapsearch {
  position: absolute;
  left: 40px; top: 12px;
  z-index: 9;
  width: min(340px, calc(100% - 60px));
}
.mapsearch form {
  display: flex; gap: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--glass);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(8px);
}
.mapsearch input {
  flex: 1; min-width: 0;
  padding: 10px 13px;
  border: 0; background: transparent; color: var(--ink);
  font: 400 13.5px/1 inherit; font-family: inherit;
}
.mapsearch input::placeholder { color: var(--muted-2); }
.mapsearch input:focus { outline: none; }
.mapsearch form:focus-within { border-color: var(--accent); }
.mapsearch form > button {
  flex: none; padding: 0 14px;
  border: 0; border-left: 1px solid var(--line);
  background: transparent; color: var(--accent);
  font: 800 12.5px/1 inherit; font-family: inherit;
  letter-spacing: .06em; text-transform: uppercase; cursor: pointer;
}
.mapsearch form > button:hover { background: var(--panel-3); }

.results {
  margin-top: 8px;
  max-height: 300px; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 6px;
  background: color-mix(in srgb, var(--panel) 94%, transparent);
  box-shadow: 0 18px 42px rgba(0,0,0,.24), 0 2px 8px rgba(0,0,0,.12);
  backdrop-filter: blur(16px);
}
.results[hidden] { display: none; }
.res {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 10px;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink);
  font-family: inherit; cursor: pointer;
}
.res + .res { margin-top: 2px; }
.res:hover, .res:focus-visible {
  outline: none;
  border-color: var(--line-2);
  background: var(--panel-3);
}
.res-icon {
  position: relative; width: 32px; height: 32px; border-radius: 10px;
  background: var(--chip); color: var(--accent);
}
.res-icon::before {
  content: ""; position: absolute; left: 10px; top: 7px;
  width: 10px; height: 10px; border: 2px solid currentColor; border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}
.res-icon::after {
  content: ""; position: absolute; left: 14px; top: 11px;
  width: 4px; height: 4px; border-radius: 50%; background: currentColor;
}
.res-copy { min-width: 0; }
.res-t { display: block; font-size: 13.5px; line-height: 1.25; font-weight: 800; }
.res-s {
  display: block; margin-top: 3px;
  font-size: 11.5px; line-height: 1.25; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.res-none { padding: 11px 12px; font-size: 12.5px; color: var(--muted); }

.search-pin-help {
  display: grid; grid-template-columns: 30px minmax(0,1fr) 24px; align-items: center; gap: 9px;
  margin-top: 8px; padding: 9px 10px;
  border: 1px solid color-mix(in srgb, #e0a63b 45%, var(--line));
  border-radius: 12px; background: color-mix(in srgb, var(--panel) 92%, transparent);
  color: var(--ink); box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.search-pin-help[hidden] { display: none; }
.search-pin-help > span:nth-child(2) { min-width: 0; }
.search-pin-help strong, .search-pin-help small { display: block; }
.search-pin-help strong { font-size: 12.5px; }
.search-pin-help small { margin-top: 1px; color: var(--muted); font-size: 10.5px; }
.search-pin-help-icon {
  width: 26px; height: 26px; border: 7px solid #e0a63b; border-radius: 50%;
  box-shadow: 0 0 0 4px color-mix(in srgb, #e0a63b 24%, transparent);
}
.search-pin-help button {
  width: 24px; height: 24px; padding: 0; border: 0; border-radius: 7px;
  background: transparent; color: var(--muted); font: 700 18px/1 inherit; cursor: pointer;
}
.search-pin-help button:hover { background: var(--panel-3); color: var(--ink); }

/* MapLibre DOM markers used while a searched or stored location is being
   corrected. The pin itself is intentionally larger than a route dot so the
   grab target remains usable at browser zoom levels above 100%. */
.cc-drag-pin { position: relative; width: 42px; height: 42px; cursor: grab; }
.cc-drag-pin:active { cursor: grabbing; }
.cc-drag-pin-core {
  position: absolute; inset: 6px; border-radius: 50% 50% 50% 10%;
  transform: rotate(-45deg); border: 3px solid var(--panel);
  box-shadow: 0 5px 16px rgba(0,0,0,.38), 0 0 0 6px rgba(255,255,255,.15);
}
.cc-drag-pin-core::after {
  content: ""; position: absolute; inset: 8px; border-radius: 50%;
  background: rgba(255,255,255,.9);
}
.cc-drag-pin-search .cc-drag-pin-core { background: #e0a63b; }
.cc-drag-pin-property .cc-drag-pin-core { background: var(--cc-lt); }
.cc-drag-pin-label {
  position: absolute; left: 50%; top: 44px; transform: translateX(-50%);
  width: max-content; max-width: 220px; padding: 5px 8px; border-radius: 7px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  box-shadow: 0 4px 14px rgba(0,0,0,.25); font: 700 11px/1.2 inherit;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; pointer-events: none;
}

.pin-adjuster {
  position: absolute; left: 50%; bottom: 74px; z-index: 12;
  width: min(520px, calc(100% - 40px)); padding: 16px;
  transform: translateX(-50%); border: 1px solid var(--line-2); border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 96%, transparent); color: var(--ink);
  box-shadow: 0 22px 60px rgba(0,0,0,.42); backdrop-filter: blur(16px);
}
.pin-adjuster[hidden] { display: none; }
.pin-adjust-head { display: flex; align-items: center; gap: 11px; }
.pin-adjust-head > div { min-width: 0; }
.pin-adjust-head strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.pin-adjust-kicker { display: block; margin-bottom: 2px; color: var(--cc-lt); font-size: 9.5px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.pin-adjust-symbol { width: 30px; height: 30px; flex: none; border: 8px solid var(--cc-lt); border-radius: 50%; box-shadow: 0 0 0 4px var(--chip); }
.pin-adjuster > p { margin: 11px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.pin-adjust-coords { display: block; margin-top: 8px; color: var(--muted-2); font: 600 10.5px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; }
.pin-adjust-status { min-height: 18px; color: var(--cc-lt) !important; font-weight: 700; }
.pin-adjust-status.error { color: var(--danger-ink) !important; }
.pin-adjust-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.pin-adjust-actions .btn { min-height: 38px; }
.pin-adjust-actions .btn:not(.primary) { background: var(--panel-2); border-color: var(--line-2); color: var(--ink); }
.pin-adjust-actions .btn:not(.primary):hover { background: var(--panel-3); }
.pin-adjust-actions .primary { background: var(--cc); color: #fff; border-color: var(--cc); }
.pin-adjust-actions .primary:hover { background: var(--cc-dk); }
.mapwrap.has-stops .pin-adjuster,
.mapwrap.has-parcel .pin-adjuster { left: calc(50% - 170px); width: min(520px, calc(100% - 390px)); }

.stop-pin-fix {
  margin-top: 7px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px;
  background: transparent; color: var(--cc-lt); font: 800 10.5px/1 inherit; cursor: pointer;
}
.stop-pin-fix:hover { background: var(--chip); border-color: var(--line-2); }

/* The stops panel would otherwise start level with the search box. */
.mapwrap.has-stops .mapsearch { width: min(340px, calc(100% - 400px)); }

/* ------------------------------ won flash ------------------------------- */

.flash-dot {
  width: 11px; height: 11px; border-radius: 50%;
  flex: none; margin-right: 2px;
}
.flash-t { font-weight: 800; }
.flash-s { font-size: 12.5px; font-weight: 600; opacity: .82; }

.stop-addr { font-size: 12px; color: var(--muted); margin-top: 1px; }

.maplibregl-popup-content .cc-stop-tag {
  display: inline-block;
  margin: 0 0 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--cc-lt);
  color: var(--accent-on);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* ============================ map legend ================================= */

.maplegend {
  position: absolute; left: 14px; bottom: 14px; z-index: 7;
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 9px 13px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 11px;
  backdrop-filter: blur(8px);
  font-size: 12px; color: var(--muted);
}
.maplegend .lg { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.maplegend .ln { width: 26px; height: 0; border-top-width: 3px; border-radius: 2px; display: inline-block; }
.maplegend .ln.solid   { border-top-style: solid;  border-top-color: var(--cc-lt); }
.maplegend .ln.home    { border-top-style: dashed; border-top-color: var(--cc-lt); }
.maplegend .ln.reentry { border-top-style: dashed; border-top-color: var(--cc-lt); }

.parcel-toggle { cursor: pointer; user-select: none; }
.parcel-toggle input { accent-color: var(--cc-lt); margin: 0; }
.parcel-toggle b { color: var(--cc-lt); font-weight: 700; font-size: 11px; }

/* ============================ parcel card ================================ */

.parcel-card {
  position: relative;
  flex: 0 1 auto;
  width: 100%;
  max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 16px 15px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 14px;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px rgba(0,0,0,.34);
  pointer-events: auto;
  touch-action: pan-y;
  will-change: transform;
}
.mapwrap.has-stops .parcel-card { max-height: 45%; }
.parcel-card[hidden] { display: none; }
.parcel-card.dragging { z-index: 2; box-shadow: 0 18px 44px rgba(0,0,0,.46); }
.pc-head {
  display: flex; align-items: flex-start; gap: 10px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.parcel-card.dragging .pc-head { cursor: grabbing; }
.pc-head h3 { margin: 0; font-size: 15px; line-height: 1.3; flex: 1; }
.pc-close {
  flex: none; width: 24px; height: 24px; border-radius: 7px;
  border: 1px solid var(--line); background: transparent;
  color: var(--muted); font: 700 15px/1 inherit; cursor: pointer;
}
.pc-close:hover { color: var(--ink); }
.pc-sub { margin: 2px 0 10px; font-size: 12px; color: var(--muted); }

.pc-rows { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; margin: 0; }
.pc-rows dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pc-rows dd { margin: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; word-break: break-word; }

.pc-note {
  margin: 11px 0 0; padding: 8px 10px;
  background: var(--panel-2); border-radius: 9px;
  font-size: 11.5px; line-height: 1.45; color: var(--muted);
}
.pc-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--line);
  font-size: 12px;
}
.pc-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.pc-muted { color: var(--muted); }

/* ========================== crew points office ========================== */

body.points-open { overflow: hidden; }
.points-dashboard { position: fixed; inset: 0; z-index: 200; padding: 22px; background: rgba(2,16,10,.76); backdrop-filter: blur(7px); }
.points-dashboard[hidden] { display: none; }
.points-shell { width: min(1180px, calc(100vw - 44px)); height: min(820px, calc(100vh - 44px)); margin: 0 auto; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line-2); border-radius: 22px; background: var(--panel); color: var(--ink); box-shadow: 0 30px 90px rgba(0,0,0,.5); animation: office-in .2s ease-out; }
@keyframes office-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.points-office-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--line); background: var(--cc); color: #fff; }
.points-office-head h1 { margin: 0; font-size: 25px; line-height: 1.1; }
.points-office-head p { margin: 3px 0 0; color: rgba(255,255,255,.68); font-size: 12.5px; }
.points-office-kicker { display: block; margin-bottom: 3px; color: #8ce1b6; font-size: 10px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.points-office-close { width: 40px; height: 40px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font: 400 28px/1 inherit; cursor: pointer; }
.points-office-close:hover { background: rgba(255,255,255,.2); }
.points-office-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 290px minmax(0,1fr); }

.points-rail { min-height: 0; overflow-y: auto; padding: 18px; border-right: 1px solid var(--line); background: var(--panel-2); }
.points-rail > h2 { margin: 0 0 11px; color: var(--muted); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.office-crew { width: 100%; margin-bottom: 9px; padding: 12px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--panel); color: var(--ink); font: inherit; font-family: inherit; text-align: left; cursor: pointer; }
.office-crew:hover { border-color: var(--line-2); }
.office-crew.selected { border-color: var(--cc); box-shadow: 0 0 0 3px rgba(0,72,46,.1); }
.office-crew-top { display: flex; align-items: center; gap: 8px; }
.office-crew-top i { width: 10px; height: 10px; flex: none; border-radius: 50%; }
.office-crew-top strong { flex: 1; font-size: 14px; }
.office-queue { padding: 3px 6px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); font-size: 9px; }
.office-crew-nums { display: flex; gap: 9px; margin: 8px 0 3px; color: var(--muted); font-size: 11px; }
.office-crew-nums span:first-child { color: var(--cc); font-weight: 800; }
.office-crew small { color: var(--muted-2); font-size: 10.5px; }
.rail-reminder { margin-top: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.rail-reminder strong { font-size: 12px; }
.rail-reminder p { margin: 4px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.45; }

.points-detail { min-width: 0; overflow-y: auto; padding: 22px 25px 35px; }
.points-hero { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.points-hero-title { display: flex; align-items: center; gap: 11px; }
.points-hero-title > i { width: 14px; height: 14px; border-radius: 50%; }
.points-hero h2 { margin: 0; font-size: 22px; }
.points-hero p { margin: 1px 0 0; color: var(--muted); font-size: 11.5px; }
.standing-pill { min-width: 185px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel-2); text-align: right; }
.standing-pill span, .standing-pill strong { display: block; }
.standing-pill span { color: var(--muted); font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.standing-pill strong { margin-top: 2px; font-size: 12px; }
.office-metrics { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin: 18px 0 23px; }
.office-metric { padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.office-metric strong, .office-metric span { display: block; }
.office-metric strong { color: var(--cc); font-size: 24px; line-height: 1; }
.office-metric.m1 strong { color: #b57705; }
.office-metric span { margin-top: 6px; color: var(--muted); font-size: 10.5px; }
.detail-section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 11px; }
.detail-section-head h3 { margin: 0; font-size: 16px; }
.detail-section-head p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.queue-count { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--warn-bg); color: var(--warn-ink); font-size: 12px; }
.points-empty { display: flex; flex-direction: column; align-items: center; padding: 28px; border: 1px dashed var(--line-2); border-radius: 14px; background: var(--panel-2); text-align: center; }
.points-empty > span { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 50%; background: rgba(40,180,105,.14); color: var(--cc); font-size: 20px; }
.points-empty strong { font-size: 13px; }
.points-empty p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }

.pending-card { margin-bottom: 12px; padding: 15px; border: 1.5px solid var(--line); border-radius: 15px; background: var(--panel-2); }
.pending-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pending-top h4 { margin: 0; font-size: 14.5px; }
.pending-top p { margin: 2px 0 0; color: var(--muted); font-size: 10.5px; }
.review-age { padding: 4px 7px; border-radius: 999px; background: rgba(40,180,105,.12); color: var(--cc); font-size: 9.5px; font-weight: 800; }
.review-age.overdue { background: var(--warn-bg); color: var(--warn-ink); }
.pending-facts { display: flex; gap: 7px; flex-wrap: wrap; margin: 11px 0 13px; }
.pending-facts span { padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--muted); font-size: 9.5px; }
.pending-facts .pending-chip { color: #9b6200; font-weight: 800; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.review-field { display: block; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.review-label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 5px; font-size: 10.5px; }
.review-label small { color: var(--muted); }
.review-field select, .review-outcome select { width: 100%; height: 32px; padding: 0 8px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--input); color: var(--ink); font: 600 10.5px/1 inherit; font-family: inherit; }
.review-outcome { display: flex; align-items: center; gap: 12px; margin-top: 9px; padding: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.review-outcome > span { flex: none; font-size: 10.5px; font-weight: 800; }
.review-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 11px; }
.review-actions p { max-width: 430px; margin: 0; color: var(--muted); font-size: 9.5px; line-height: 1.4; }
.review-save { flex: none; padding: 9px 12px; border: 0; border-radius: 9px; background: var(--cc); color: #fff; font: 800 11px/1 inherit; font-family: inherit; cursor: pointer; }
.review-save:disabled { opacity: .42; cursor: not-allowed; }
.reviewed-head { margin-top: 24px; }
.reviewed-list { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.reviewed-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.reviewed-row:last-child { border-bottom: 0; }
.reviewed-row strong, .reviewed-row span { display: block; }
.reviewed-row strong { font-size: 11.5px; }
.reviewed-row span { color: var(--muted); font-size: 9.5px; }
.reviewed-row > b { color: var(--cc); font-size: 12px; }
.score-policy { margin-top: 20px; padding: 14px; border-left: 3px solid var(--cc); border-radius: 0 10px 10px 0; background: var(--panel-2); }
.score-policy strong { font-size: 12px; }
.score-policy p { margin: 3px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.5; }

@media (max-width: 900px) {
  .points-dashboard { padding: 0; }
  .points-shell { width: 100vw; height: 100vh; border: 0; border-radius: 0; }
  .points-office-body { grid-template-columns: 240px minmax(0,1fr); }
  .office-metrics { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .points-shell { animation: none; }
}
