/* ==========================================================================
   Home Transit Board — styling to match the real SFMTA shelter screen.
   Soft green→lavender gradient wash, lavender bloom up top, stadium line
   pills (blue = N/S, red = E/W), walking-person arrival glyphs, big rounded
   type. Responsive: tight portrait (phone on wall) / wide landscape (shelter).
   ========================================================================== */

/* --------------------------------------------------------------------------
   THEME SYSTEM. The tokens on :root below are the board's theme. Override
   them under a `:root[data-theme="your-name"]` block and add that name to
   VALID_THEMES in js/config.js to add your own city's look.
   Copyright-safe by design: the blue/red axis convention is functional, and
   no agency logo or trademarked typeface is used.
   -------------------------------------------------------------------------- */
:root {
  /* --- base (not themed) --- */
  --pad: clamp(12px, 2.2vw, 28px);
  --radius: clamp(14px, 1.8vw, 22px);

  /* === THEME: classic (default) ============================================ */
  /* Clean grotesque, the vernacular of real transit signage (no rounded). */
  --font-display: system-ui, -apple-system, "Helvetica Neue", "Segoe UI",
    "Roboto", Arial, sans-serif;

  /* Axis colors — the transit system-map convention (blue N/S, red E/W). */
  --blue: #1f3a93;        /* N/S lines: 19, 49 */
  --blue-ink: #ffffff;
  --red: #b32a24;         /* E/W lines: 1, 2, 38 */
  --red-ink: #ffffff;

  --ink: #14161b;         /* near-black, faintly cool — high contrast */
  --ink-soft: #565b66;
  --card: #ffffff;        /* solid rows, like a real sign */
  --card-line: rgba(20, 23, 30, 0.10);
  --card-shadow: 0 1px 2px rgba(20, 23, 30, 0.04), 0 6px 20px rgba(20, 23, 30, 0.05);

  /* Backgrounds (themeable): the frame behind the panel, and the panel itself. */
  --page-bg: #dfe2e7;
  --screen-bg: linear-gradient(180deg, #f7f8fa 0%, #eceef2 100%);
}


* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--page-bg);
}

body {
  font-family: var(--font-display);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* The screen surface: a clean, evenly-lit display panel (themeable). */
.screen {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: var(--pad);
  gap: var(--pad);
  overflow: hidden;
  isolation: isolate;
  background: var(--screen-bg);
}

/* ---- top bar: place + clock --------------------------------------------- */
.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--pad);
}
.place-name {
  display: block;
  font-weight: 900;
  font-size: clamp(20px, 3.4vw, 40px);
  letter-spacing: -0.01em;
  line-height: 1;
}
.place-sub {
  display: block;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: clamp(11px, 1.5vw, 18px);
  margin-top: 0.25em;
}
.clock {
  font-weight: 800;
  font-size: clamp(20px, 3.4vw, 42px);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--card-line);
  padding: 0.15em 0.5em;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  white-space: nowrap;
}

/* ---- the board ---------------------------------------------------------- */
.board {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: clamp(3px, 0.5vh, 9px);
  min-height: 0;
  overflow: hidden; /* the board fits the screen — never a page scroll */
}

.row {
  flex: 1 1 0;     /* rows share the board height evenly; all five always fit */
  min-height: 0;
  display: grid;
  grid-template-columns: auto 1fr auto auto;  /* pill | dest-cycler | times | fresh */
  align-items: center;
  gap: clamp(8px, 1.6vw, 20px);
  padding: clamp(4px, 0.8vh, 14px) clamp(10px, 1.4vw, 18px);
  background: var(--card);
  border: 1px solid var(--card-line);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

/* Destination cycler: a fixed-height viewport; only the destination text rolls
   vertically (up/down carousel) between the two directions every cycleMs. The
   times/fresh column never moves — the horizontal position is fixed. */
.dest-cycler {
  overflow: hidden;
  min-width: 0;
  height: clamp(28px, min(6vw, 5.6vh), 54px);
}
.dest-track {
  display: flex;
  flex-direction: column;
  height: 200%;
  transform: translateY(0);
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1); /* gentle */
  will-change: transform;
}
.dest-panel {
  flex: 0 0 50%;
  height: 50%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.4em;
}

/* Line pill — stadium shape, axis-colored. */
.pill {
  font-weight: 900;
  font-size: clamp(16px, min(5.4vw, 4.1vh), 42px);
  line-height: 1;
  color: #fff;
  min-width: clamp(46px, 7vw, 104px);
  text-align: center;
  padding: 0.18em 0.44em;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(40, 30, 80, 0.18);
}
.axis-ns .pill { background: var(--blue); color: var(--blue-ink); }
.axis-ew .pill { background: var(--red);  color: var(--red-ink); }

/* Mode glyph + pill share one grid cell. Glyph sits ahead of the route pill. */
.pill-wrap { display: flex; align-items: center; gap: clamp(5px, 0.9vw, 12px); }
.row-mode { display: inline-flex; color: var(--ink); flex: none; }
.row-mode .mode-ico {
  width: clamp(22px, min(4.6vw, 4.4vh), 42px);
  height: clamp(22px, min(4.6vw, 4.4vh), 42px);
}

/* Base mode-glyph sizing (contexts below override w/h). */
.mode-ico { display: inline-block; vertical-align: middle; flex: none; }

/* Destination: arrow + name. */
.dest {
  display: flex;
  align-items: baseline;
  gap: 0.4em;
  min-width: 0;
}
.arrow {
  font-weight: 900;
  font-size: clamp(16px, min(4vw, 4.2vh), 38px);
  color: var(--ink-soft);
}
.dest-name {
  font-weight: 800;
  font-size: clamp(17px, min(5vw, 4.6vh), 42px);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Arrival times. */
.times {
  display: flex;
  align-items: baseline;
  gap: 0.25em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  justify-self: end;
}
.times .t { display: inline-flex; align-items: center; gap: 1px; }
/* Walking-figure icon(s): one per standard bus, two for articulated. */
.walk-ico {
  height: clamp(17px, min(3.1vw, 3.4vh), 32px);
  width: auto;
  color: var(--ink);
  flex: none;
}
.walk-ico + .walk-ico { margin-left: -3px; } /* two figures nestle together */
.times .num {
  font-weight: 900;
  font-size: clamp(20px, min(5.2vw, 5.4vh), 50px);
  line-height: 1;
}
.times .sep { font-weight: 900; font-size: clamp(16px, min(3vw, 4vh), 38px); }
.times .unit {
  font-weight: 700;
  font-size: clamp(12px, min(2vw, 2.2vh), 24px);
  color: var(--ink-soft);
  margin-left: 0.2em;
}
.times .loading,
.times .none,
.times .err {
  font-weight: 800;
  font-size: clamp(16px, 2.2vw, 30px);
  color: var(--ink-soft);
}
.times .err { color: var(--red); }

/* Freshness dot. */
.fresh { display: flex; align-items: center; }
.dot {
  width: clamp(8px, 1vw, 13px);
  height: clamp(8px, 1vw, 13px);
  border-radius: 999px;
  background: #b9b4c9;
  box-shadow: 0 0 0 3px var(--dot-halo, rgba(255, 255, 255, 0.5));
  transition: background 0.4s ease;
}
.dot.fresh-ok    { background: #37a869; }
.dot.fresh-aging { background: #e0a13c; }
.dot.fresh-stale { background: #c8352b; }

/* ---- status bar --------------------------------------------------------- */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: clamp(11px, 1.4vw, 17px);
  font-weight: 700;
  color: var(--ink-soft);
}
/* Status can get long (mode + budget + backoff + age); truncate instead of
   overlapping the brand on narrow screens. */
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.brand { flex: none; }
.status-bad { color: var(--red); }
.brand { letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.7; }

/* Times just update — a soft fade marks the change, no sliding. */
.times.just-updated { animation: timeFade 0.35s ease; }
@keyframes timeFade {
  from { opacity: 0.35; }
  to   { opacity: 1; }
}

/* ==========================================================================
   Map view  (provisional — refined against the reference photo)
   ========================================================================== */
[hidden] { display: none !important; } /* wins over flex on the hidden view */

.mapview { flex: 1; min-height: 0; display: flex; }
.map-canvas {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--card-line);
}
/* Schematic-only background (Leaflet paints its own tiles). */
.map-canvas.map-schematic {
  background:
    radial-gradient(90% 70% at 50% 40%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 60%),
    linear-gradient(160deg, #e9e3f3 0%, #e4ead9 55%, #d6e6ce 100%);
}

/* Leaflet div-icons: strip the default 12px white box; center our content on
   the geographic point (icon origin is at the latlng, size 0). */
.map-pin-icon,
.map-corner-icon {
  background: none !important;
  border: none !important;
  width: 0 !important;
  height: 0 !important;
  overflow: visible;
}
/* Corner teardrop pin: keep its real size, just drop Leaflet's box. */
.map-corner-pin {
  background: none !important;
  border: none !important;
  filter: drop-shadow(0 2px 4px rgba(40, 30, 80, 0.35));
}
/* Keep the attribution subtle and out of the way. */
.leaflet-container .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  color: var(--ink-soft);
}
.map-pin-icon .map-pin-num,
.map-corner-icon .map-corner-dot,
.map-corner-icon .map-corner-label {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}
.map-corner-icon .map-corner-label { transform: translate(-50%, 90%); }

/* Faint street grid for orientation. */
.map-grid {
  position: absolute;
  inset: -2px;
  background-image:
    repeating-linear-gradient(0deg, rgba(120, 110, 160, 0.16) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(120, 110, 160, 0.16) 0 1px, transparent 1px 64px);
}
.map-corner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}
.map-corner-dot {
  width: clamp(10px, 1.6vh, 16px);
  height: clamp(10px, 1.6vh, 16px);
  border-radius: 999px;
  background: var(--ink);
  box-shadow: 0 0 0 6px rgba(42, 39, 64, 0.14);
}
.map-corner-label {
  font-weight: 800;
  font-size: clamp(11px, 1.7vh, 18px);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.7);
  padding: 0.1em 0.5em;
  border-radius: 999px;
}
.map-title,
.map-compass {
  position: absolute;
  top: clamp(8px, 1.4vh, 16px);
  font-weight: 800;
  font-size: clamp(11px, 1.6vh, 18px);
  color: var(--ink-soft);
  z-index: 2;
}
.map-title { left: clamp(10px, 1.6vw, 18px); }
.map-compass { right: clamp(10px, 1.6vw, 18px); font-weight: 900; }

.map-pins { position: absolute; inset: 0; z-index: 3; }
.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  transition: left 0.9s linear, top 0.9s linear; /* glide between refreshes */
  will-change: left, top;
}
.map-pin-num {
  display: inline-block;
  font-weight: 900;
  color: #fff;
  font-size: clamp(12px, 1.9vh, 22px);
  line-height: 1;
  padding: 0.16em 0.5em;
  border-radius: 999px;
  box-shadow: 0 2px 7px rgba(40, 30, 80, 0.3);
}
/* Schematic-fallback pins keep axis colors; Leaflet pins are colored per line
   inline (style="background:…") so same-axis lines are distinguishable. */
.map-pin.axis-ns .map-pin-num { background: var(--blue); }
.map-pin.axis-ew .map-pin-num { background: var(--red); }

/* Leaflet bus pins glide to the next stop when their position updates, so the
   stop-by-stop advance reads as motion rather than teleporting. */
.map-pin-icon { transition: transform 2.6s linear; }

/* Live-vehicle chip: mode glyph + route in the line color, sitting just above
   its point with a little pointer nub (matches the real shelter map). */
.map-pin-icon .map-chip {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, calc(-100% - 6px));
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px 3px 5px;
  border-radius: 999px;
  color: #fff;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(40, 30, 80, 0.34);
}
.map-chip .mode-ico {
  width: clamp(13px, 2vh, 19px);
  height: clamp(13px, 2vh, 19px);
  color: #fff;
}
.map-chip-num {
  font-size: clamp(12px, 1.9vh, 20px);
  font-variant-numeric: tabular-nums;
}
.map-chip-nub {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid; /* color set inline to the line color */
}

/* Numbered route label riding each line, in that line's color. */
.map-route-label span {
  display: inline-block;
  transform: translate(-50%, -50%);
  color: #fff;
  font-weight: 900;
  font-size: clamp(10px, 1.5vh, 16px);
  line-height: 1;
  padding: 0.1em 0.5em;
  border-radius: 999px;
  box-shadow: 0 1px 5px rgba(40, 30, 80, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   Setup menu (hidden — five clicks on the clock)
   ========================================================================== */
.setup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(30, 26, 48, 0.45);
  backdrop-filter: blur(3px);
}
.setup-card {
  position: relative;
  width: min(460px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: #fbfaff;
  color: var(--ink);
  border-radius: 18px;
  padding: clamp(18px, 3vw, 28px);
  box-shadow: 0 20px 60px rgba(30, 20, 60, 0.35);
}
/* Close (X) — the only way to dismiss besides the action buttons. No backdrop
   click, so unsaved edits are never lost by a stray tap. */
.setup-x {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: rgba(120, 110, 160, 0.14);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
}
.setup-x:hover { background: rgba(120, 110, 160, 0.24); }
.picker-card { position: relative; }
.setup-card h2 {
  margin: 0 0 4px;
  font-weight: 900;
  font-size: 24px;
}
.setup-ver {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: var(--blue);
  border-radius: 999px;
  padding: 2px 8px;
  vertical-align: middle;
  margin-left: 6px;
}
/* Location pin-picker map */
.setup-map {
  height: 220px;
  margin-top: 6px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--card-line);
}
.setup-coords {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.setup-coords code {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  background: rgba(120, 110, 160, 0.12);
  padding: 6px 10px;
  border-radius: 8px;
}
/* Logo upload */
.setup-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.setup-logo-preview {
  height: 34px;
  max-width: 120px;
  object-fit: contain;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--card-line);
  padding: 2px 4px;
}
.setup-file { cursor: pointer; }
.setup-logo-hint { font-size: 11px; color: var(--ink-soft); }
/* Uploaded logo in the footer brand slot */
.brand-logo {
  height: clamp(16px, 2.4vh, 30px);
  width: auto;
  vertical-align: middle;
  display: inline-block;
}
.setup-sub {
  margin: 0 0 18px;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 14px;
}
.setup-field {
  display: block;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 13px;
  color: var(--ink-soft);
}
.setup-field input,
.setup-field select {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--card-line);
  border-radius: 10px;
}
.setup-field input:focus,
.setup-field select:focus {
  outline: none;
  border-color: var(--blue);
}
.setup-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.setup-spacer { flex: 1; }
.setup-btn {
  font: inherit;
  font-weight: 800;
  font-size: 14px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1.5px solid var(--card-line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.setup-btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.setup-btn.ghost { border-color: transparent; color: var(--ink-soft); font-size: 12px; }
.setup-note {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-soft);
}
.setup-note code {
  background: rgba(120, 110, 160, 0.14);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 11px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Portrait / narrow (phone on the wall): tighten, drop the sub-label, shrink
   the arrow so destinations keep their room. */
@media (max-aspect-ratio: 1/1), (max-width: 560px) {
  .place-sub { display: none; }
  .row { gap: clamp(6px, 2vw, 12px); padding: clamp(6px, 1.6vw, 10px) clamp(8px, 2vw, 12px); }
  .fresh { display: none; } /* freshness moves to the status line when tight */
}

/* Landscape / wide (authentic shelter view): let it breathe. */
@media (min-aspect-ratio: 1/1) and (min-width: 900px) {
  .screen { padding: clamp(20px, 2.5vw, 40px); }
  .board { gap: clamp(6px, 0.8vw, 12px); }
}

/* ---- accessibility ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  .dot { transition: none; }
  .track { transition: none; }   /* direction change snaps, no sliding motion */
  .panel { transition: none; }
}
@media (prefers-contrast: more) {
  :root { --card: rgba(255, 255, 255, 0.85); --ink: #1c1930; }
}
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ==========================================================================
   Mobile skin — set by the iPhone app only (root gets class "mobile").
   ADDITIVE: the landscape wall display (web / iPad / Pi) never sets this class,
   so its design is untouched. Here the board becomes a compact, scrollable list.
   ========================================================================== */
.mobile .screen { padding: clamp(12px, 4vw, 18px); gap: 10px; }
.mobile .topbar { align-items: center; }
.mobile .place-name { font-size: clamp(22px, 6.5vw, 30px); }
.mobile .clock { font-size: clamp(18px, 5.5vw, 26px); }

.mobile .board {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  gap: 10px;
}
/* Two-line mobile card: pill on the left, full destination on top, times below.
   Gives the destination the whole width so it never truncates on a phone. */
.mobile .row {
  flex: 0 0 auto;               /* natural height, not stretched to fill */
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-rows: auto auto;
  column-gap: clamp(10px, 3.5vw, 16px);
  row-gap: 6px;
  align-items: center;
  padding: clamp(12px, 3.5vw, 18px) clamp(14px, 4vw, 18px);
}
.mobile .pill { grid-row: 1 / 3; align-self: center; }
.mobile .dest-cycler { grid-column: 2; grid-row: 1; height: clamp(28px, 8vw, 40px); }
.mobile .fresh { grid-column: 3; grid-row: 1; }
.mobile .times { grid-column: 2 / 4; grid-row: 2; justify-self: start; }
.mobile .pill { font-size: clamp(19px, 6.4vw, 30px); min-width: clamp(46px, 15vw, 64px); }
.mobile .arrow { font-size: clamp(16px, 5vw, 24px); }
.mobile .dest-name { font-size: clamp(18px, 5.6vw, 28px); }
.mobile .times .num { font-size: clamp(21px, 6.6vw, 32px); }
.mobile .times .sep { font-size: clamp(17px, 5vw, 26px); }
.mobile .walk-ico { height: clamp(17px, 5.4vw, 26px); }
.mobile .fresh { display: flex; }

/* ==========================================================================
   Prominent header logo lockup (user-supplied; shown when set)
   ========================================================================== */
.brandbar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
}
.brandbar-logo {
  max-height: clamp(38px, 8vh, 80px);
  max-width: 72%;
  object-fit: contain;
}
.mobile .brandbar-logo { max-height: clamp(30px, 9vw, 52px); }

/* 511 key onboarding */
.setup-keyhelp {
  font-size: 12px;
  color: var(--ink-soft);
  margin: -6px 0 14px;
  line-height: 1.5;
}
.setup-keyhelp a { color: var(--blue); font-weight: 800; text-decoration: none; margin-left: 6px; }
.setup-keyhelp ol { margin: 6px 0 0; padding-left: 18px; }

/* ==========================================================================
   Line picker (first-run + Setup)
   ========================================================================== */
.picker-overlay {
  position: fixed; inset: 0; z-index: 1100;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(30, 26, 48, 0.45);
  backdrop-filter: blur(3px);
}
.picker-card {
  width: min(460px, 100%);
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: #fbfaff; color: var(--ink);
  border-radius: 18px;
  padding: clamp(18px, 3vw, 26px);
  box-shadow: 0 20px 60px rgba(30, 20, 60, 0.35);
}
.picker-card h2 { margin: 0 0 4px; font-weight: 900; font-size: 22px; }
.picker-sub { margin: 0 0 12px; color: var(--ink-soft); font-weight: 600; font-size: 13px; }
.picker-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.picker-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--card-line);
  border-radius: 12px;
}
.picker-row.is-hidden { opacity: 0.42; }
.picker-row .pill {
  font-size: 17px; min-width: 40px; line-height: 1.1;
  padding: 4px 10px; box-shadow: none;
}
.picker-dest { display: flex; flex-direction: column; min-width: 0; }
.picker-dest span { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-dest small { color: var(--ink-soft); font-size: 12px; }
.picker-star, .picker-hide {
  background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 8px;
}
.picker-star { font-size: 22px; color: #cfc9dc; }
.picker-star.on { color: #f0a53c; }
.picker-hide { font-size: 15px; font-weight: 800; color: var(--ink-soft); }
.picker-hide.on { color: var(--red); }

/* ---- leave-now banner (intelligence layer) ------------------------------ */
/* Opt-in on the wall (CONFIG.cloud.leaveBanner); always on for mobile. A calm,
   high-signal strip: "Leave in 3 min for the 49 -> Fort Mason". */
.leave-banner {
  display: flex;
  align-items: center;
  gap: 0.5em;
  margin: calc(var(--pad) * -0.35) 0 0;
  padding: 0.5em 0.85em;
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--card-line);
  color: var(--ink);
  font-weight: 800;
  font-size: clamp(15px, 2vw, 22px);
  letter-spacing: -0.01em;
}
.leave-banner::before {
  content: "";
  width: 0.7em; height: 0.7em; border-radius: 50%;
  background: #38a169;              /* high confidence: green */
  box-shadow: 0 0 0 4px rgba(56, 161, 105, 0.16);
  flex: none;
}
.leave-banner[data-confidence="medium"]::before {
  background: #d69e2e; box-shadow: 0 0 0 4px rgba(214, 158, 46, 0.16);
}
.leave-banner[data-confidence="low"]::before {
  background: var(--ink-soft); box-shadow: 0 0 0 4px rgba(91, 86, 117, 0.14);
}

/* Optional per-row confidence tint on the freshness dot (CONFIG.cloud
   .showConfidence). Additive: does nothing unless the class is set on <html>. */
.show-confidence .row[data-confidence="low"] .num { opacity: 0.72; }
