/* Bunny playground. Map-first: the map fills the window, the top bar and
   panels float over it. Slate surfaces, one hi-vis amber accent reserved for
   the Optimize action and solve progress. Light and dark follow the system.
   No inline styles anywhere (strict CSP); JS sets only custom properties. */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("/vendor/inter/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Slate surfaces */
  --canvas: #e6eaf0;
  --surface: #ffffff;
  --surface-2: #f4f6f9;
  --surface-3: #e9edf2;
  --line: #e2e6ec;
  --line-strong: #c9d0da;
  --ink: #172031;
  --ink-2: #455166;
  --ink-3: #5e697d;

  /* The one accent: hi-vis amber */
  --accent: #f4a81d;
  --accent-hover: #e99a07;
  --accent-ink: #1f1602;
  --accent-soft: #fdf0d5;
  --focus: #a15c00;

  --ok: #17723e;
  --ok-soft: #e2f3e8;
  --danger: #bb2a33;
  --danger-soft: #fde9e9;
  --warn-ink: #6f4300;
  --warn-soft: #fff3d9;

  --pin-neutral: #556075;
  --pin-ring: #ffffff;

  --edge: rgba(17, 25, 40, 0.06);
  --shadow-float: 0 0 0 1px var(--edge), 0 1px 2px rgba(17, 25, 40, 0.05), 0 10px 30px -10px rgba(17, 25, 40, 0.22);
  --shadow-pop: 0 0 0 1px var(--edge), 0 2px 4px rgba(17, 25, 40, 0.06), 0 18px 48px -12px rgba(17, 25, 40, 0.32);
  --shadow-lift: 0 1px 2px rgba(17, 25, 40, 0.12);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --gap: 12px;
  --topbar-h: 56px;
  --panel-l: 344px;
  --panel-r: 376px;
  --speed: 180ms;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #0c1117;
    --surface: #151b25;
    --surface-2: #1b2230;
    --surface-3: #232c3b;
    --line: #262f3e;
    --line-strong: #364156;
    --ink: #e8edf4;
    --ink-2: #b2bccb;
    --ink-3: #8b96a8;

    --accent: #f7b13a;
    --accent-hover: #ffc35c;
    --accent-ink: #1f1602;
    --accent-soft: #3a2b0e;
    --focus: #ffc35c;

    --ok: #56c487;
    --ok-soft: #15301f;
    --danger: #ff6b70;
    --danger-soft: #3a1a1e;
    --warn-ink: #ffd383;
    --warn-soft: #33270e;

    --pin-neutral: #a3afc2;
    --pin-ring: #0f141c;

    --edge: rgba(255, 255, 255, 0.08);
    --shadow-float: 0 0 0 1px var(--edge), 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 36px -10px rgba(0, 0, 0, 0.6);
    --shadow-pop: 0 0 0 1px var(--edge), 0 2px 6px rgba(0, 0, 0, 0.45), 0 22px 52px -12px rgba(0, 0, 0, 0.7);
    --shadow-lift: 0 1px 2px rgba(0, 0, 0, 0.5);
  }
}

/* ---- base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 20px;
  letter-spacing: -0.006em;
  font-feature-settings: "cv11" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

button, select, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: 16px; top: -48px; z-index: 50;
  background: var(--ink); color: var(--surface); padding: 8px 14px; border-radius: var(--r-sm);
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 16px; }

.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num, .kpi-value, .strip-time, kbd { font-variant-numeric: tabular-nums; }

/* ---- buttons and fields --------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent;
  font-weight: 550; white-space: nowrap;
  transition: background-color var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
.btn .icon { width: 16px; height: 16px; }
.btn:disabled { opacity: 0.5; }

.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 650; }
.btn-primary:not(:disabled):hover { background: var(--accent-hover); }
.btn-soft { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.btn-soft:not(:disabled):hover { background: var(--surface-3); }
.btn-quiet { color: var(--ink-2); }
.btn-quiet:not(:disabled):hover { background: var(--surface-2); color: var(--ink); }
.btn-ink { background: var(--ink); color: var(--surface); }
.btn-ink:not(:disabled):hover { background: var(--ink-2); }
.btn-danger { color: var(--danger); padding: 0 10px; }
.btn-danger:not(:disabled):hover { background: var(--danger-soft); }

.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--ink-3);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .icon { width: 16px; height: 16px; }

.link-btn {
  border: 0; background: none; padding: 0; color: var(--ink-2); font-weight: 500;
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px;
}
.link-btn:hover { color: var(--ink); text-decoration-color: currentColor; }

input, select, textarea {
  height: 34px; min-width: 0; max-width: 100%;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); padding: 0 10px;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease);
}
textarea { height: auto; padding: 8px 10px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent);
}
input[type="number"] { font-variant-numeric: tabular-nums; }
input[type="time"] { padding: 0 8px; font-variant-numeric: tabular-nums; }
input[type="color"] { width: 44px; padding: 3px; cursor: pointer; }

input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: none;
  width: 16px; height: 16px; padding: 0; margin: 0; border-radius: 5px;
  border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer;
  display: inline-grid; place-content: center;
}
input[type="checkbox"]::before {
  content: ""; width: 9px; height: 9px; transform: scale(0);
  transition: transform 120ms var(--ease);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  background: var(--surface);
}
input[type="checkbox"]:checked { background: var(--ink); border-color: var(--ink); }
input[type="checkbox"]:checked::before { transform: scale(1); }

select {
  appearance: none; -webkit-appearance: none; padding-right: 28px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

kbd {
  font: inherit; font-size: 11px; line-height: 16px; font-weight: 600;
  padding: 0 5px; border-radius: 5px; background: rgba(31, 22, 2, 0.12);
}

.hint { color: var(--ink-3); font-size: 12.5px; line-height: 18px; }
.note { color: var(--ink-3); font-size: 12.5px; line-height: 18px; margin-bottom: 8px; }

/* ---- top bar -------------------------------------------------------------- */

.topbar {
  position: fixed; z-index: 20; top: var(--gap); left: var(--gap); right: var(--gap);
  min-height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 10px 0 14px;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-float);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mark { width: 30px; height: 30px; flex: none; }
.mark-bg { fill: var(--ink); }
.mark-route { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; }
.mark-start { fill: var(--surface); }
.mark-end { fill: var(--accent); }
.brand h1 { font-size: 15px; line-height: 20px; font-weight: 650; letter-spacing: -0.015em; white-space: nowrap; }
.badge {
  font-size: 11.5px; line-height: 18px; font-weight: 550; color: var(--ink-2);
  padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 999px; white-space: nowrap;
}

.scenario-bar {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding-left: 16px; border-left: 1px solid var(--line);
}
.sample-pick { display: flex; align-items: center; gap: 4px; min-width: 0; }
.select-field { position: relative; display: flex; align-items: center; min-width: 0; }
.select-label {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 12.5px; color: var(--ink-3); pointer-events: none;
}
.select-field select { border-color: transparent; background-color: var(--surface-2); font-weight: 550; }
.select-field select:hover { border-color: var(--line-strong); }
#region { padding-left: 62px; }
#sample { padding-left: 66px; max-width: 260px; }
#goal { padding-left: 92px; }

.solve-actions { position: relative; margin-left: auto; display: flex; align-items: center; gap: 10px; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 28px; padding: 0 12px 0 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 550; color: var(--ink-2); background: var(--surface-2);
  white-space: nowrap; font-variant-numeric: tabular-nums;
}
.chip-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.chip[data-state="ready"] .chip-dot { background: var(--ok); }
.chip[data-state="solved"] { color: var(--ok); background: var(--ok-soft); }
.chip[data-state="solved"] .chip-dot { background: var(--ok); }
.chip[data-state="busy"] .chip-dot { background: var(--accent); animation: pulse 1s ease-in-out infinite; }
.chip[data-state="stale"] { color: var(--warn-ink); background: var(--warn-soft); }
.chip[data-state="stale"] .chip-dot { background: var(--accent); }
.chip[data-state="error"] { color: var(--danger); background: var(--danger-soft); }
.chip[data-state="error"] .chip-dot { background: var(--danger); }

#optimize { height: 38px; padding: 0 12px 0 16px; border-radius: 10px; font-size: 14.5px; }
#optimize kbd { margin-left: 2px; }
.spinner {
  display: none; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(31, 22, 2, 0.25); border-top-color: var(--accent-ink);
  animation: spin 0.8s linear infinite;
}
body.is-solving #optimize { opacity: 1; cursor: progress; }
body.is-solving #optimize .spinner { display: inline-block; }
body.is-solving #optimize kbd { display: none; }

.progress {
  position: absolute; left: 14px; right: 14px; bottom: 0; height: 2px;
  overflow: hidden; border-radius: 2px; pointer-events: none;
}
.progress-bar {
  display: block; height: 100%; width: 0; background: var(--accent); border-radius: 2px;
  opacity: 0; transform-origin: left;
}
body.is-solving .progress-bar { opacity: 1; animation: budget var(--budget, 2000ms) var(--ease) forwards; }
.progress-bar.is-done { opacity: 0; width: 100%; transition: opacity 400ms ease 120ms; }

/* Turnstile shows itself only when it needs the visitor (interaction-only). */
.check-pop {
  position: absolute; top: calc(100% + 14px); right: 0; z-index: 30;
  width: 332px; padding: 14px; border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--shadow-pop);
  display: none;
}
.check-pop.is-open { display: block; }
.check-pop-title { font-weight: 600; margin-bottom: 10px; }
.turnstile-slot { max-width: 100%; overflow: hidden; }

/* ---- toast ---------------------------------------------------------------- */

.toast {
  position: fixed; z-index: 25; left: 50%; top: calc(var(--gap) * 2 + var(--topbar-h) + 4px);
  transform: translate(-50%, -6px);
  display: flex; align-items: flex-start; gap: 10px;
  width: max-content; max-width: min(540px, calc(100vw - 32px));
  padding: 10px 8px 10px 14px; border-radius: var(--r-md);
  background: var(--ink); color: var(--surface); box-shadow: var(--shadow-pop);
  opacity: 0; pointer-events: none;
  transition: opacity var(--speed) var(--ease), transform var(--speed) var(--ease);
}
.toast.is-open { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast-text { font-size: 13.5px; line-height: 20px; padding-top: 4px; padding-bottom: 4px; }
.toast-icon { display: grid; place-items: center; padding-top: 5px; }
.toast-icon .icon { width: 18px; height: 18px; }
.toast[data-kind="error"] .toast-icon { color: #ff8a8e; }
.toast[data-kind="ok"] .toast-icon { color: #6fd69b; }
.toast-close { color: inherit; opacity: 0.7; }
.toast-close:hover { opacity: 1; background: rgba(255, 255, 255, 0.12); color: inherit; }
@media (prefers-color-scheme: dark) {
  .toast { background: #f1f4f8; color: #172031; }
  .toast[data-kind="error"] .toast-icon { color: #c62f37; }
  .toast[data-kind="ok"] .toast-icon { color: #1b7f45; }
  .toast-close:hover { background: rgba(23, 32, 49, 0.08); }
}

/* ---- dock and panels ------------------------------------------------------- */

.map-wrap { position: fixed; inset: 0; z-index: 0; }
.map { width: 100%; height: 100%; background: var(--canvas); }

.dock {
  position: fixed; z-index: 10;
  top: calc(var(--gap) * 2 + var(--topbar-h)); bottom: var(--gap); left: var(--gap); right: var(--gap);
  display: flex; justify-content: space-between; align-items: flex-start; gap: var(--gap);
  pointer-events: none;
}
.sheet-handle { display: none; }

.panel {
  pointer-events: auto; display: flex; flex-direction: column; min-height: 0; max-height: 100%;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-float);
}
.panel:focus { outline: none; }
.panel-edit { width: var(--panel-l); height: 100%; overflow: hidden; }
.panel-results { width: var(--panel-r); overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }

/* Collapsible panels (desktop): an edge button hides a panel and a pill in
   its corner brings it back. app.js sets body[data-edit|data-plan]. */
.panel-top { flex: none; display: flex; align-items: center; gap: 4px; margin: 12px 8px 0 12px; }
.panel-top .tabs { flex: 1; min-width: 0; margin: 0; }
#collapse-edit .icon { transform: rotate(180deg); }
.panel-collapse:focus-visible, .panel-pill:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.panel-pill {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border: 0; border-radius: 999px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-float);
  font: inherit; font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.panel-pill:hover { background: var(--surface-2); }
.panel-pill .icon { width: 16px; height: 16px; color: var(--ink-3); }
.pill-plan .icon { transform: rotate(180deg); }
.panel-pill[hidden] { display: none; }
@media (min-width: 1024px) {
  body[data-edit="collapsed"] #editor { display: none; }
  body[data-plan="collapsed"] #results { display: none; }
  body[data-plan="collapsed"] .maplibregl-ctrl-bottom-right { right: var(--gap); }
}

.tabs {
  flex: none; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  margin: 12px 12px 0; padding: 3px; border-radius: 10px; background: var(--surface-3);
}
.tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; border: 0; border-radius: 8px; background: transparent;
  color: var(--ink-2); font-weight: 550; font-size: 13.5px;
  transition: background-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); }
.tab .count { font-size: 11.5px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tab-plan { display: none; }

.tabpanel { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 12px 12px; scrollbar-gutter: stable; }
.panel-intro { display: flex; flex-direction: column; gap: 10px; padding: 12px 4px 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.empty-line { color: var(--ink-3); padding: 18px 4px; text-align: center; }

.panel-foot {
  flex: none; display: flex; flex-direction: column; gap: 6px;
  padding: 12px 16px 14px; border-top: 1px solid var(--line);
}
.foot-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; font-size: 12.5px; }
.foot-links a { color: var(--ink-3); }

/* ---- editor lists ---------------------------------------------------------- */

.list { list-style: none; margin: 0; padding: 0; }
.list > li { border-radius: var(--r-md); }
.list > li + li { margin-top: 2px; }

.row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px; border-radius: var(--r-md);
}
.row:hover { background: var(--surface-2); }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-title { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts { display: flex; flex-wrap: wrap; column-gap: 10px; color: var(--ink-3); font-size: 12.5px; line-height: 18px; }
.facts .flag { color: var(--ink-2); }
.row .edit { flex: none; height: 28px; padding: 0 10px; font-size: 13px; }
.list li.error > .row, .list li.error > details > summary { background: var(--danger-soft); box-shadow: inset 0 0 0 1.5px var(--danger); }

.seq {
  flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font-size: 11px; font-weight: 650; color: var(--route-ink, #fff); background: var(--route, var(--pin-neutral));
  font-variant-numeric: tabular-nums;
}
.seq.empty { width: 8px; height: 8px; margin: 0 7px; }
.seq.unassigned { background: var(--surface); border: 2.5px solid var(--danger); width: 16px; height: 16px; margin: 0 3px; }
.depot-glyph {
  flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink); color: var(--surface);
}
.depot-glyph .icon { width: 16px; height: 16px; }

/* Vehicle rows: a <details> per vehicle. */
.van-row details { border-radius: var(--r-md); }
.van-row details[open] { background: var(--surface-2); }
.van-row summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--r-md);
}
.van-row summary::-webkit-details-marker { display: none; }
.van-row summary:hover { background: var(--surface-2); }
.van-row details[open] summary:hover { background: var(--surface-3); }
.vehicle-badge {
  position: relative; flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  color: var(--route, var(--ink-2)); background: color-mix(in srgb, var(--route, var(--ink-3)) 14%, var(--surface));
}
.vehicle-badge .icon { width: 20px; height: 20px; }
.chev { color: var(--ink-3); transition: transform var(--speed) var(--ease); }
.van-row details[open] .chev { transform: rotate(90deg); }

.van-editor {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px;
  padding: 4px 10px 12px;
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field > .field-label, .skills legend { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.field input, .field select { width: 100%; }
.field .unit-input { position: relative; }
.unit-input input { padding-right: 34px; }
.unit-input .unit { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-size: 12.5px; pointer-events: none; }
.span-2 { grid-column: 1 / -1; }
.pair { display: flex; align-items: center; gap: 6px; }
.pair input { flex: 1; }
.pair .dash { color: var(--ink-3); }
.type-note { font-size: 12.5px; line-height: 18px; color: var(--ink-3); }
.editor-actions { display: flex; justify-content: space-between; align-items: center; }

.segmented {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px;
  padding: 3px; border-radius: 10px; background: var(--surface-3); border: 0; margin: 0;
}
.segmented legend { padding: 0; margin-bottom: 5px; }
.seg-option { position: relative; display: block; }
.seg-option input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.seg-face {
  display: flex; align-items: center; justify-content: center; gap: 8px; height: 32px; border-radius: 8px;
  color: var(--ink-2); font-weight: 550; transition: background-color var(--speed) var(--ease);
}
.seg-face .icon { width: 20px; height: 20px; }
.seg-option input:checked + .seg-face { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lift); }
.seg-option input:focus-visible + .seg-face { outline: 2px solid var(--focus); outline-offset: 1px; }

.skills { display: flex; flex-wrap: wrap; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.skills legend { padding: 0; margin-bottom: 6px; }
.skill {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px 0 8px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface);
  font-size: 13px; cursor: pointer; transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease);
}
.skill:hover { border-color: var(--ink-3); }
.skill:has(input:checked) { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, var(--surface)); }

/* ---- map popover (stop / depot editor) ----------------------------------- */

.maplibregl-popup { z-index: 3; }
.maplibregl-popup-content {
  max-height: calc(100vh - 150px); overflow-y: auto; overscroll-behavior: contain;
  padding: 16px; border-radius: var(--r-md); background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow-pop); font-family: var(--font);
}
.maplibregl-popup-anchor-top .maplibregl-popup-tip, .maplibregl-popup-anchor-top-left .maplibregl-popup-tip, .maplibregl-popup-anchor-top-right .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip, .maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip { border-top-color: var(--surface); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }
.maplibregl-popup-close-button {
  top: 10px; right: 10px; width: 28px; height: 28px; border-radius: var(--r-sm);
  font-size: 20px; line-height: 1; color: var(--ink-3);
}
.maplibregl-popup-close-button:hover { background: var(--surface-2); color: var(--ink); }

.pop { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px 10px; width: min(300px, 76vw); }
.pop-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding-right: 26px; }
.pop-head h3 { font-size: 15px; line-height: 20px; font-weight: 650; }
.pop-head .pop-id { color: var(--ink-3); font-size: 12.5px; font-weight: 500; }
.pop .span-3 { grid-column: 1 / -1; }
.pop .switch { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }

.why {
  grid-column: 1 / -1; display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2);
}
.why-head { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.why-sub { font-size: 12.5px; color: var(--ink-3); }
.reasons { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.reasons li { position: relative; padding-left: 14px; font-size: 13px; line-height: 18px; color: var(--ink-2); }
.reasons li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--route, var(--ink-3)); }
.why.is-unassigned .reasons li::before { background: var(--danger); }

/* ---- results --------------------------------------------------------------- */

.results-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 16px 18px 10px; background: var(--surface);
}
.results-head h2 { font-size: 17px; line-height: 22px; font-weight: 650; letter-spacing: -0.015em; }
.results-meta { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.results-head .results-meta { margin-left: auto; }
.results-head .panel-collapse { align-self: center; margin: -6px -10px -6px -4px; }

.empty-state { padding: 4px 18px 20px; }
.empty-title { font-weight: 600; margin-bottom: 4px; }
.empty-text { color: var(--ink-3); font-size: 13px; line-height: 19px; }
body.is-solving .empty-state .empty-title::after {
  content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 8px; vertical-align: -1px;
  border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

.stale-banner {
  margin: 0 18px 10px; padding: 9px 12px; border-radius: var(--r-sm);
  background: var(--warn-soft); color: var(--warn-ink); font-weight: 600; font-size: 13px;
}
#results-body { padding: 0 18px 18px; transition: opacity var(--speed) var(--ease); }
.panel-results.stale #results-body, body.is-solving .panel-results #results-body { opacity: 0.55; }

.block { margin-top: 18px; }
.block h3 { font-size: 13.5px; line-height: 20px; font-weight: 650; margin-bottom: 8px; }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.kpi { padding: 10px 12px 11px; border-radius: var(--r-md); background: var(--surface-2); min-width: 0; }
.kpi dt { font-size: 12.5px; color: var(--ink-3); }
.kpi dd { margin: 0; }
.kpi-value { display: block; font-size: 22px; line-height: 28px; font-weight: 650; letter-spacing: -0.025em; }
.kpi-value .of { font-size: 15px; font-weight: 550; color: var(--ink-3); letter-spacing: -0.01em; }
.kpi-sub { display: block; font-size: 12px; line-height: 16px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.checks-summary {
  display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 10px; padding: 8px 12px;
  border: 0; border-radius: var(--r-sm); background: var(--ok-soft); color: var(--ok);
  font-weight: 600; font-size: 13px; text-align: left;
}
.checks-summary .icon { width: 16px; height: 16px; stroke-width: 2.2; }
.checks-summary .go { margin-left: auto; font-weight: 500; opacity: 0.85; }
.checks-summary:hover .go { text-decoration: underline; text-underline-offset: 3px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.checks li { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: start; font-size: 13px; line-height: 18px; }
.checks .icon { width: 16px; height: 16px; margin-top: 1px; color: var(--ok); stroke-width: 2.2; }
.check-label { font-weight: 600; }
.check-detail { color: var(--ink-3); }

.vehicles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.van-route {
  --route: var(--ink-3);
  position: relative; width: 100%; text-align: left; display: grid;
  grid-template-columns: 34px 1fr; column-gap: 10px; row-gap: 8px; align-items: center;
  padding: 10px 12px 11px 10px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface);
  transition: border-color var(--speed) var(--ease), background-color var(--speed) var(--ease);
}
.van-route:hover { border-color: var(--line-strong); }
.van-route[aria-pressed="true"] {
  border-color: var(--route); background: color-mix(in srgb, var(--route) 7%, var(--surface));
  box-shadow: inset 0 0 0 1px var(--route);
}
.van-route .name { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.van-route .facts { margin-top: 1px; }
.meters { grid-column: 1 / -1; display: flex; gap: 14px; }
.meter { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meter-label { display: flex; justify-content: space-between; font-size: 12px; line-height: 16px; color: var(--ink-3); }
.meter-label .num { color: var(--ink-2); font-weight: 600; }
.meter-track { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.meter-fill { display: block; height: 100%; width: calc(var(--pct, 0) * 1%); border-radius: 3px; background: var(--route); }

/* Timeline: a line diagram in the route's colour. */
.strip { list-style: none; margin: 0; padding: 0; --route: var(--ink-3); }
.strip-item { position: relative; display: grid; grid-template-columns: 44px 24px 1fr; column-gap: 10px; padding-bottom: 14px; }
.strip-item::before {
  content: ""; position: absolute; left: 65px; top: 22px; bottom: -2px; width: 3px; border-radius: 2px;
  background: color-mix(in srgb, var(--route) 55%, transparent);
}
.strip-item:last-child::before { display: none; }
.strip-time { font-size: 12.5px; line-height: 22px; font-weight: 600; color: var(--ink-2); text-align: right; }
.strip-node {
  position: relative; z-index: 1; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--route); color: var(--route-ink, #fff); font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 3px var(--surface);
}
.strip-item.is-depot .strip-node { border-radius: 7px; background: var(--ink); color: var(--surface); }
.strip-item.is-depot .strip-node .icon { width: 14px; height: 14px; }
.strip-body { min-width: 0; padding-top: 1px; }
.strip-title { display: block; font-weight: 550; line-height: 20px; }
button.strip-title {
  border: 0; background: none; padding: 0; text-align: left; cursor: pointer;
  text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px;
}
button.strip-title:hover { text-decoration-color: var(--line-strong); }
.strip-item .facts { margin-top: 1px; }
.facts .wait { color: var(--warn-ink); }
.why-toggle {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; padding: 2px 6px 2px 4px; border: 0; border-radius: 6px;
  background: transparent; color: var(--ink-2); font-size: 12.5px; font-weight: 550;
}
.why-toggle:hover { background: var(--surface-2); color: var(--ink); }
.why-toggle .icon { width: 14px; height: 14px; transition: transform var(--speed) var(--ease); }
.why-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }
.strip .reasons { margin-top: 6px; }

.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.unassigned-groups { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.ua-group { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px 12px; background: var(--surface); }
.ua-reason { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 18px; font-weight: 550; color: var(--ink); }
.ua-reason .seq.unassigned { flex: none; margin: 1px 0 0; }
.ua-reason-text { flex: 1; min-width: 0; }
.ua-count {
  flex: none; font-size: 12px; font-weight: 600; color: var(--danger); background: var(--danger-soft);
  padding: 0 8px; border-radius: 999px; line-height: 20px; font-variant-numeric: tabular-nums;
}
.ua-stops { list-style: none; margin: 8px 0 0; padding: 0 0 0 26px; display: flex; flex-wrap: wrap; gap: 4px 6px; }
.ua-stop {
  font: inherit; font-size: 12.5px; line-height: 22px; padding: 0 8px; border-radius: 999px; cursor: pointer;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid transparent;
}
.ua-stop:hover { border-color: var(--line-strong); color: var(--ink); }
.ua-stop:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.ua-more { padding-left: 26px; margin-top: 6px; }
.ua-extra { padding-left: 26px; margin-top: 6px; font-size: 12.5px; color: var(--ink-3); }

.scope-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 2px 4px 8px; }
.scope-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.scope-label { font-size: 11.5px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.02em; }
.scope-field select { width: 100%; height: 32px; font-size: 13px; text-overflow: ellipsis; }
.scope-field select:disabled { opacity: 0.55; cursor: default; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px 10px; }
.filter-chip {
  font: inherit; font-size: 12.5px; font-weight: 550; line-height: 26px; padding: 0 10px; border-radius: 999px;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid transparent; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.filter-chip:hover:not(:disabled) { border-color: var(--line-strong); color: var(--ink); }
.filter-chip:disabled { opacity: 0.45; cursor: default; }
.filter-chip[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.filter-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.filter-chip .n { font-variant-numeric: tabular-nums; opacity: 0.75; }
.filter-note { padding: 0 4px 8px; font-size: 12.5px; color: var(--ink-3); }
.pin.filtered-out { display: none; }

.results-foot { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; font-size: 13px; }
.cta {
  margin-top: 16px; padding: 14px; border-radius: var(--r-md);
  background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; align-items: flex-start;
}
.cta p { font-weight: 600; }

/* ---- map marks -------------------------------------------------------------- */

.pin {
  display: grid; place-items: center; padding: 0; margin: 0; border: 0; cursor: pointer;
  font-family: var(--font); font-variant-numeric: tabular-nums; line-height: 1;
}
.pin-stop {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--pin-neutral); border: 2px solid var(--pin-ring);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: opacity var(--speed) var(--ease);
}
.pin-stop.assigned {
  width: 22px; height: 22px; background: var(--route); color: var(--route-ink, #fff);
  font-size: 11px; font-weight: 650; border-color: #fff;
}
.pin-stop.unassigned {
  width: 18px; height: 18px; background: var(--surface); border: 3px solid var(--danger);
  box-shadow: 0 0 0 2px var(--pin-ring), 0 1px 4px rgba(0, 0, 0, 0.35);
}
.pin-stop.high::after {
  content: ""; position: absolute; top: -4px; right: -4px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--pin-ring);
  box-shadow: 0 0 0 1px rgba(17, 25, 40, 0.55); /* reads on every route colour and on the map */
}
.pin-depot {
  width: 28px; height: 28px; border-radius: 9px; background: var(--ink); color: var(--surface);
  border: 2px solid var(--pin-ring); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}
.pin-depot .icon { width: 16px; height: 16px; stroke-width: 1.9; }
/* Dimming goes through Marker.setOpacity (MapLibre writes opacity inline). */
.pin.lift { z-index: 2; }
.pin.error { outline: 3px solid var(--danger); outline-offset: 3px; animation: ring 1.2s ease-out 2; }
.pin:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

/* MapLibre controls, restyled to match. */
.maplibregl-ctrl-group {
  background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-float); overflow: hidden;
}
.maplibregl-ctrl-group:not(:empty) { box-shadow: var(--shadow-float); }
.maplibregl-ctrl-group button { width: 34px; height: 34px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
.maplibregl-ctrl button:not(:disabled):hover { background-color: var(--surface-2); }
@media (prefers-color-scheme: dark) {
  .maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.4); }
}
.maplibregl-ctrl.maplibregl-ctrl-attrib {
  background: color-mix(in srgb, var(--surface) 82%, transparent); color: var(--ink-2);
  font-size: 11px; line-height: 16px; padding: 2px 8px; border-radius: 8px 0 0 0;
}
.maplibregl-ctrl-attrib a { color: var(--ink-2); }
.maplibregl-ctrl-bottom-right { right: calc(var(--panel-r) + var(--gap) * 2); bottom: var(--gap); transition: right 180ms var(--ease); }
.maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib { border-radius: 8px; margin: 0; }

/* ---- lead dialog ------------------------------------------------------------ */

dialog {
  border: 0; padding: 0; border-radius: var(--r-lg);
  width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: rgba(12, 17, 23, 0.5); }
#lead-form { display: flex; flex-direction: column; gap: 14px; padding: 22px; }
#lead-form h2 { font-size: 18px; line-height: 24px; font-weight: 650; letter-spacing: -0.015em; }
.lead-intro { color: var(--ink-3); margin-top: -8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.form-field label { font-size: 12.5px; font-weight: 550; color: var(--ink-2); }
.form-field input, .form-field select, .form-field textarea { width: 100%; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 19px; color: var(--ink-2); }
.consent input { margin-top: 2px; }
.consent a { color: var(--ink); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }
.status { min-height: 20px; font-size: 13px; }
.status:empty { min-height: 0; }
.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

/* ---- privacy notice page ---------------------------------------------------- */

body.doc { overflow: auto; height: auto; background: var(--canvas); }
.doc-body {
  max-width: 680px; margin: 32px auto; padding: 32px 36px; background: var(--surface);
  border-radius: var(--r-lg); box-shadow: var(--shadow-float); line-height: 23px; font-size: 15px;
}
.doc-body h1 { font-size: 26px; line-height: 32px; font-weight: 650; letter-spacing: -0.02em; margin-bottom: 12px; }
.doc-body h2 { font-size: 16px; line-height: 22px; font-weight: 650; margin: 28px 0 8px; }
.doc-body p, .doc-body ul { margin: 0 0 12px; }
.doc-body ul { padding-left: 20px; }
.doc-body li { margin-bottom: 6px; }

/* ---- motion ----------------------------------------------------------------- */

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.35; } }
@keyframes budget { from { width: 0; } to { width: 92%; } }
@keyframes ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--danger) 55%, transparent); } to { box-shadow: 0 0 0 12px transparent; } }

/* ---- phones and tablets: a bottom sheet ------------------------------------ */

@media (max-width: 1023px) {
  :root { --gap: 8px; --sheet-h: 44vh; }
  body[data-sheet="full"] { --sheet-h: 72vh; }
  @supports (height: 1dvh) {
    :root { --sheet-h: 44dvh; }
    body[data-sheet="full"] { --sheet-h: 72dvh; }
  }
  body[data-sheet="min"] { --sheet-h: 64px; }

  .topbar {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions" "bar bar";
    gap: 6px 10px; padding: 8px 8px 8px 12px; min-height: 0;
  }
  .brand { grid-area: brand; }
  .solve-actions { grid-area: actions; }
  .scenario-bar { grid-area: bar; padding-left: 0; border-left: 0; }
  .wide-only { display: none; }
  .chip { height: 26px; max-width: 132px; padding: 0 10px 0 8px; font-size: 12px; gap: 6px; }
  #solve-chip-text { overflow: hidden; text-overflow: ellipsis; }
  .scenario-bar .select-field select { height: 32px; }
  #region { padding-left: 10px; max-width: 132px; }
  #sample { padding-left: 10px; }
  #goal { padding-left: 10px; max-width: 124px; }
  .select-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #optimize { height: 36px; }
  #optimize kbd { display: none; }
  .check-pop { position: fixed; top: 112px; left: var(--gap); right: var(--gap); width: auto; }

  .toast { top: 112px; }

  .dock {
    top: auto; left: 0; right: 0; bottom: 0; height: var(--sheet-h);
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: 0 -8px 30px -12px rgba(17, 25, 40, 0.35);
    pointer-events: auto; transition: height 200ms var(--ease);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sheet-handle {
    display: grid; place-items: center; flex: none; width: 100%; height: 22px; padding: 0;
    border: 0; background: transparent; cursor: pointer;
  }
  .grabber { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); }
  .panel { box-shadow: none; border-radius: 0; background: transparent; }
  .panel-edit { width: auto; height: auto; flex: 1; min-height: 0; }
  .panel-results { width: auto; flex: 1; min-height: 0; display: none; }
  .tabs { margin: 0 12px; }
  .tab-plan { display: inline-flex; }
  .panel-collapse, .panel-pill, .panel-pill[hidden] { display: none; }
  .panel-top { margin: 0; }
  .panel-top .tabs { margin: 0 12px; }
  .tabpanel { padding: 0 12px 12px; }

  body[data-view="plan"] .panel-edit { flex: none; }
  body[data-view="plan"] .panel-edit .tabpanel, body[data-view="plan"] .panel-foot { display: none; }
  body[data-view="plan"] .panel-results { display: flex; }
  /* Not sticky in the sheet: with a sticky header here, headless Chromium
     captured a blank band across the map canvas. */
  .results-head { position: static; padding-top: 12px; }
  .panel-foot { padding: 10px 16px 12px; }

  .maplibregl-ctrl-bottom-right { right: 0; bottom: calc(var(--sheet-h) + 4px); }
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib { border-radius: 8px 0 0 8px; }
  .maplibregl-ctrl-group { display: none; }
}

@media (max-width: 420px) {
  .badge { display: none; }
  #sample { max-width: 120px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; animation-iteration-count: 1 !important; }
  .spinner, body.is-solving .empty-state .empty-title::after { animation: none; border-top-color: var(--accent-ink); }
  .chip[data-state="busy"] .chip-dot { animation: none; }
  body.is-solving .progress-bar { animation: none; width: 100%; opacity: 0.6; }
  .dock { transition: none; }
}

/* ---- Design your own -------------------------------------------------------- */

.design-own .icon { width: 16px; height: 16px; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; gap: 4px; }
.btn-sm .icon { width: 14px; height: 14px; }
.toast-action {
  font: inherit; font-size: 13.5px; font-weight: 650; color: inherit; background: rgba(255, 255, 255, 0.14);
  border: 0; border-radius: 8px; height: 28px; padding: 0 12px; cursor: pointer; white-space: nowrap; align-self: center;
}
.toast-action:hover { background: rgba(255, 255, 255, 0.24); }
.toast-action[hidden] { display: none; }

.guide {
  position: fixed; z-index: 15; width: 300px;
  bottom: var(--gap); left: calc(var(--panel-l) + var(--gap) * 2);
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-float);
  padding: 12px 14px 14px;
}
.guide[hidden] { display: none; }
body[data-edit="collapsed"] .guide { left: var(--gap); }
.guide-short { display: none; }
.guide-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.guide-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.guide-progress { margin-left: auto; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.guide-step { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.guide-mark {
  display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  font-size: 12px; font-weight: 650; color: var(--ink-2); background: var(--surface-3);
}
.guide-mark .icon { width: 14px; height: 14px; }
.guide-step.is-done .guide-mark { background: var(--ok); color: var(--surface); }
.guide-label { font-size: 13.5px; font-weight: 600; line-height: 24px; }
.guide-step.is-done .guide-label { color: var(--ink-2); }
.guide-detail { font-size: 12.5px; color: var(--ink-3); line-height: 17px; }
.guide-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.guide-actions:empty { display: none; }

@media (max-width: 1023px) {
  /* Below the toast (top 112px) so an Undo stays reachable. */
  .guide, body[data-edit="collapsed"] .guide { top: 170px; bottom: auto; left: var(--gap); right: var(--gap); width: auto; padding: 8px 10px; }
  .guide-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .guide-short { display: inline; }
  .guide-head { margin-bottom: 4px; }
  .guide-steps { flex-direction: row; gap: 6px; }
  .guide-step { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
  .guide-detail, .guide-step:not([data-step="optimize"]) .guide-actions { display: none; }
  .guide-step[data-step="optimize"] .guide-label { display: none; }
  .guide-step[data-step="optimize"] { flex: none; }
  .guide-step[data-step="optimize"] .guide-mark { display: none; }
  .guide-actions { margin-top: 0; }
  .guide-label { font-size: 12px; line-height: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .guide-mark { width: 20px; height: 20px; flex: none; }
}
/* The top bar is tight: the button keeps its text only where it fits, and
   the title's "route planner" goes first. */
@media (max-width: 1499px) {
  .wide-only { display: none; }
  #sample { max-width: 220px; }
}
@media (max-width: 1279px) {
  .design-own { padding: 0 10px; }
  .design-own-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
