:root {
  --ink: #17181C;
  --ink-2: #464A54;
  --ink-3: #61656F;
  --line: #ECECEA;
  --line-2: #DCDCD8;
  --bg: #FFFFFF;
  --soft: #F5F5F3;       /* neutral block */
  --soft-2: #ECECE9;
  --card: #FFFFFF;
  --accent: #3D6BF5;     /* links + focus */
  --accent-soft: #E6EDFF;
  --display: 'Bricolage Grotesque', 'Public Sans', system-ui, sans-serif;
  --radius: 12px;
  --topbar: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Public Sans', system-ui, sans-serif; color: var(--ink); background: var(--bg); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Top bar */
.topbar { height: var(--topbar); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px; background: var(--card); border-bottom: 1px solid var(--line); position: relative; z-index: 1000; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; color: var(--ink); text-decoration: none; }
.brand svg { color: var(--accent); }
.topbar-actions { display: flex; gap: 8px; align-items: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { background: #F7F8FA; }
.btn-ghost { border-color: var(--line-2); }
.btn-icon { width: 44px; padding: 0; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1E40AF; }
.btn-primary:disabled { background: #DADDE3; border-color: #DADDE3; color: var(--ink-2); cursor: not-allowed; }
.btn-big { height: 56px; font-size: 16px; border-radius: var(--radius); width: 100%; }

/* Search screen */
.view-search { display: flex; justify-content: center; padding: 48px 20px 64px; }
.search-card { width: 100%; max-width: 640px; display: flex; flex-direction: column; gap: 28px; }
.intro h1 { margin: 0 0 8px; font-size: clamp(30px, 5vw, 44px); line-height: 1.1; letter-spacing: -0.02em; font-weight: 800; }
.intro p { margin: 0; font-size: 17px; color: var(--ink-2); }
.field { display: flex; flex-direction: column; gap: 8px; position: relative; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend { font-size: 14px; font-weight: 700; padding: 0; margin-bottom: 8px; }
fieldset.field > legend + * { margin-top: 0; }
.address-box { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); color: var(--ink-3); }
.address-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.address-box input { flex: 1; border: 0; background: transparent; height: 100%; font-size: 16px; color: var(--ink); outline: none; min-width: 0; }
.suggestions { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 20; margin: 0; padding: 6px; list-style: none; background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(22, 24, 29, 0.12); }
.suggestions li { padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: 15px; }
.suggestions li[aria-selected="true"], .suggestions li:hover { background: var(--accent-soft); }
.suggestions .empty { color: var(--ink-3); cursor: default; }
.suggestions .empty:hover { background: none; }

.categories { display: flex; flex-direction: column; gap: 10px; }
.cat-card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.cat-card.on { border-color: var(--c); box-shadow: inset 4px 0 0 var(--c); }
.cat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.dot.square { border-radius: 3px; }
.importance { display: inline-flex; background: #F0F1F4; border-radius: 10px; padding: 3px; }
.importance button { height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; font-size: 13px; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.importance button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(22, 24, 29, 0.12); }
.cat-card:not(.on) .cat-extra { display: none; }
.cat-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; min-height: 44px; }
.importance { flex-wrap: wrap; }
.cat-card:not(.on) .importance button[aria-checked="true"] { color: var(--ink-2); }
.cat-extra { display: flex; flex-direction: column; gap: 12px; padding-left: 22px; }
.chains, .uni-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.label { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-right: 4px; }
.chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); font-size: 13px; font-weight: 700; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--c); border-color: var(--c); color: #fff; }
.uni-row select { height: 44px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; background: var(--card); font-size: 14px; flex: 1; min-width: 220px; }
.pick { position: relative; display: flex; flex-direction: column; gap: 6px; }
.pick-box { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--card); color: var(--ink-3); }
.pick-box:focus-within { border-color: var(--c); box-shadow: 0 0 0 3px var(--accent-soft); }
.pick-box input { flex: 1; border: 0; background: transparent; outline: none; font-size: 14px; color: var(--ink); min-width: 0; height: 100%; }
.pick .suggestions { top: 48px; }
/* Chosen place: text grows and wraps, button stays right; only drops below on very narrow cards */
.pick-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 44px; padding: 6px 6px 6px 12px; border: 1px solid color-mix(in srgb, var(--c) 30%, #fff); border-radius: 10px; background: color-mix(in srgb, var(--c) 6%, #fff); font-size: 14px; }
.pick-pin { flex: none; color: var(--c); }
.pick-text { flex: 1 1 160px; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pick-name { font-weight: 700; overflow-wrap: anywhere; }
.pick-sub { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.pick-sub:empty { display: none; }
.pick-clear { flex: none; margin-left: auto; height: 32px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); font-size: 13px; font-weight: 700; white-space: nowrap; cursor: pointer; }
.pick-clear:hover { border-color: var(--c); }
.hint { margin: -12px 0 0; text-align: center; font-size: 13px; color: var(--ink-3); }

/* Results screen */
.view-results { display: flex; flex-wrap: wrap; min-height: calc(100vh - var(--topbar)); }
.map { flex: 999 1 560px; min-width: 0; min-height: 420px; height: calc(100vh - var(--topbar)); }
.panel { flex: 1 1 340px; max-width: 440px; height: calc(100vh - var(--topbar)); overflow-y: auto; background: var(--card); border-left: 1px solid var(--line); padding: 24px; display: flex; flex-direction: column; gap: 22px; }
@media (max-width: 920px) {
  .map { height: 55vh; }
  .panel { max-width: none; height: auto; border-left: 0; border-top: 1px solid var(--line); }
}

.panel h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.panel .address { margin: 4px 0 0; font-size: 14px; color: var(--ink-2); }
.overall { display: flex; align-items: center; gap: 16px; padding: 16px; border-radius: var(--radius); background: #F7F8FA; border: 1px solid var(--line); }
.ring { --p: 0; width: 76px; height: 76px; flex: none; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--ring) calc(var(--p) * 1%), #E4E7EC 0); }
.ring span { width: 60px; height: 60px; border-radius: 50%; background: #F7F8FA; display: grid; place-items: center; font-size: 22px; font-weight: 800; }
.overall strong { display: block; font-size: 18px; }
.overall p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.4; }
.notice { font-size: 13px; line-height: 1.45; color: #6B4E00; background: #FFF7E0; border: 1px solid #F2DFA6; border-radius: 10px; padding: 10px 12px; }
.notice button { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; font-size: 13px; }

.cat-section { display: flex; flex-direction: column; gap: 10px; }
.cat-head { display: flex; align-items: center; gap: 10px; }
.cat-head h3 { margin: 0; font-size: 16px; font-weight: 800; flex: 1; }
.badge { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 7px; border-radius: 6px; background: #F0F1F4; color: var(--ink-2); }
.badge.must { background: var(--ink); color: #fff; }
.cat-score { font-weight: 800; font-size: 15px; min-width: 32px; text-align: right; }
.bar { height: 6px; border-radius: 3px; background: #ECEEF1; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--c); border-radius: 3px; }
.headline { margin: 0; font-size: 14px; color: var(--ink-2); }
.headline strong { font-size: 26px; color: var(--ink); letter-spacing: -0.01em; margin-right: 4px; }
.places { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.places li + li { border-top: 1px solid var(--line); }
.place { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 14px; border: 0; background: var(--card); text-align: left; cursor: pointer; min-height: 52px; }
.place:hover { background: #F7F8FA; }
.place.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--c); }
.place .name { font-weight: 700; font-size: 14px; display: block; }
.place .meta { font-size: 12px; color: var(--ink-3); display: block; margin-top: 1px; }
.place .time { font-weight: 700; font-size: 14px; white-space: nowrap; }
.empty-cat { margin: 0; font-size: 14px; color: var(--ink-3); padding: 12px 14px; border: 1px dashed var(--line-2); border-radius: var(--radius); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.tile span { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.tile b { font-size: 17px; font-weight: 800; }
.tile.soon { border-style: dashed; background: #F9FAFB; }
.tile.soon b { font-size: 13px; color: var(--ink-2); }
.small { margin: 0; font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.panel-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.loading { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; flex: 1; color: var(--ink-2); font-weight: 600; }
.spinner { width: 32px; height: 32px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }

/* Map pins */
.pin { width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.pin-dot { display: block; width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35); transition: transform 0.15s; }
.pin-dot.top { width: 20px; height: 20px; }
.pin.selected .pin-dot { transform: scale(1.35); box-shadow: 0 0 0 3px #16181D, 0 2px 6px rgba(0, 0, 0, 0.35); }
.pin-home { cursor: default; }
.pin-dest span { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; box-shadow: 0 0 0 3px #fff, 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.pin-dest { width: 40px; height: 40px; }
.pin-dest.selected span { transform: scale(1.15); }
.maplibregl-popup-content { font-family: 'Public Sans', system-ui, sans-serif; font-size: 13px; border-radius: 8px; padding: 8px 12px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); }
@media (prefers-reduced-motion: reduce) { .pin-dot, .pin-dest span { transition: none; } }

/* Dialog + toast */
.dialog { border: 0; border-radius: 16px; padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(22, 24, 29, 0.25); }
.dialog::backdrop { background: rgba(22, 24, 29, 0.4); }
.dialog-body { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.dialog-body h2 { margin: 0; font-size: 20px; }
.dialog-body input { height: 44px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; }
.dialog-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; font-weight: 600; z-index: 2000; }

/* Ranking */
.cat-row { flex-wrap: wrap; }
.drag-handle { width: 32px; height: 44px; margin-left: -6px; border: 0; border-radius: 8px; background: transparent; color: #9AA0AB; cursor: grab; display: grid; place-items: center; flex: none; touch-action: none; }
.drag-handle:hover { background: #F0F1F4; color: var(--ink-2); }
.drag-handle:active { cursor: grabbing; }
.rank { --strength: 1; width: 26px; height: 26px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff; background: rgba(22, 24, 29, var(--strength)); }
.rank:empty { background: transparent; border: 2px dashed var(--line-2); }
.small-rank { width: 22px; height: 22px; font-size: 12px; }
.cat-title { flex: 1; min-width: 140px; }
.cat-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); flex: none; }
.cat-card:not(.on) { background: #FAFAFB; }
.cat-card:not(.on) .cat-title { color: var(--ink-3); }
.cat-card { transition: box-shadow 0.15s; }
.drag-ghost { opacity: 0.35; }
.drag-chosen { box-shadow: 0 10px 30px rgba(22, 24, 29, 0.18); }
.cat-extra { padding-left: 62px; }
@media (max-width: 560px) { .cat-extra { padding-left: 0; } }
.custom-name { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.custom-name input { flex: 1; min-width: 200px; height: 44px; border: 1px solid var(--line-2); border-radius: 10px; padding: 0 12px; font-size: 14px; background: var(--card); }
.pick-help.warn { color: #B45309; font-weight: 700; }
.cat-head .cat-icon { width: 26px; height: 26px; }
@media (prefers-reduced-motion: reduce) { .cat-card { transition: none; } }

/* On/off switch */
.switch { position: relative; width: 46px; height: 28px; flex: none; border: 0; border-radius: 999px; background: #CDD1D8; cursor: pointer; padding: 0; transition: background 0.15s; }
.switch .knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch[aria-checked="true"] { background: var(--c); }
.switch[aria-checked="true"] .knob { transform: translateX(18px); }
.cat-card .switch::after { content: ''; position: absolute; inset: -8px; } /* bigger tap target */
@media (prefers-reduced-motion: reduce) { .switch, .switch .knob { transition: none; } }

/* Add / remove preferences */
.card-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.flag-btn, .remove-btn { height: 36px; min-width: 36px; padding: 0 9px; border: 0; border-radius: 999px; background: transparent; color: #9AA0AB; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 800; }
.flag-btn:hover, .remove-btn:hover { background: #F0F1F4; color: var(--ink); }
/* Deal-breaker toggle: always labelled, grey until switched on */
.flag-btn { padding: 0 12px 0 10px; border: 1px solid var(--line-2); color: #9AA0AB; }
.flag-btn:hover { border-color: #9AA0AB; }
.flag-btn[aria-pressed="true"] { background: #FFF1E6; border-color: #F5C9A3; color: #B45309; }
.flag-btn[aria-pressed="true"] svg { fill: currentColor; }
.badge.must { display: inline-flex; align-items: center; gap: 4px; background: #FFF1E6; color: #B45309; }
.badge.must svg { fill: currentColor; }
.available-wrap { padding-top: 6px; }
.available { display: flex; flex-wrap: wrap; gap: 8px; }
.add-chip { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px 0 10px; border: 1.5px dashed var(--line-2); border-radius: 999px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 700; cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s; }
.add-chip svg:nth-child(2) { color: var(--c); }
.add-chip:hover { border-style: solid; border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, #fff); color: var(--ink); }
.empty-prefs { margin: 0; padding: 18px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-3); font-size: 14px; }
.cat-card.just-added { animation: pop-in 0.45s ease-out; }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cat-card.just-added { animation: none; } .add-chip { transition: none; } }

/* Rank weight: live share of the score on each card */
.rank-note { margin: -6px 0 4px; font-size: 13px; color: var(--ink-3); }
.weight { --w: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; cursor: help; }
.weight-bar { width: 44px; height: 6px; border-radius: 3px; background: #ECEEF1; overflow: hidden; }
.weight-bar span { display: block; height: 100%; width: calc(var(--w) * 1%); background: var(--c); border-radius: 3px; transition: width 0.25s ease; }
.weight-pct { min-width: 30px; }
.cat-weight { font-size: 12px; font-weight: 700; color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .weight-bar span { transition: none; } }

/* ---------- Results panel v1.6: resizable + calmer layout ---------- */
.panel { container-type: inline-size; gap: 18px; padding: 22px 22px 18px; }
.panel-resizer { display: none; }
@media (min-width: 921px) {
  .view-results { flex-wrap: nowrap; }
  .panel { flex: none; width: var(--panel-w, 420px); max-width: none; }
  .panel-resizer { display: block; position: relative; z-index: 5; flex: none; width: 12px; margin: 0 -6px; cursor: col-resize; touch-action: none; }
  .panel-resizer::before { content: ''; position: absolute; top: 0; bottom: 0; left: 5px; width: 2px; background: transparent; transition: background 0.15s; }
  .panel-resizer::after { content: ''; position: absolute; top: 50%; left: 1px; width: 10px; height: 44px; margin-top: -22px; border-radius: 5px; background: var(--card); border: 1px solid var(--line-2); box-shadow: 0 1px 3px rgba(22, 24, 29, 0.12); }
  .panel-resizer:hover::before, .panel-resizer.dragging::before, .panel-resizer:focus-visible::before { background: var(--accent); }
  .panel-resizer:hover::after, .panel-resizer.dragging::after, .panel-resizer:focus-visible::after { border-color: var(--accent); }
  .panel-resizer:focus-visible { outline: none; }
}
body.resizing { cursor: col-resize; user-select: none; }
body.resizing .map { pointer-events: none; }

.panel-head .eyebrow { margin: 0 0 2px; font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.panel-head h2 { font-size: 18px; line-height: 1.3; }
.overall { padding: 14px 16px; }
.overall.capped { background: #FFF7F0; border-color: #F5D3B8; }
.overall.capped .ring span { background: #FFF7F0; }
.overall.capped p { color: #8A4508; }

.sections { display: flex; flex-direction: column; }
.sections .cat-section { gap: 10px; padding: 16px 0; border-top: 1px solid var(--line); }
.sections .cat-section:first-child { border-top: 0; padding-top: 2px; }
.cat-head { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.cat-titles { min-width: 0; }
.cat-head h3 { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-meta { margin: 1px 0 0; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12px; font-weight: 600; color: var(--ink-3); }
.deal { display: inline-flex; align-items: center; gap: 4px; color: #B45309; font-weight: 700; }
.deal svg { fill: currentColor; }
.deal.missed { color: #B42318; }
.cat-score { font-size: 20px; min-width: 36px; font-variant-numeric: tabular-nums; }
.cat-section.missed .cat-score { color: #B42318; }
.bar { height: 4px; }
.headline strong { font-size: 22px; margin-right: 5px; }

.places .place { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 12px; min-height: 44px; padding: 9px 12px; }
.places .place .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place .dist { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.place .time { min-width: 50px; text-align: right; font-variant-numeric: tabular-nums; }
.place.dest { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.dest-addr { font-size: 12px; color: var(--ink-3); }
.modes { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--ink-3); }
.modes b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }

.panel-foot { display: flex; flex-direction: column; gap: 6px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* Wide panel: two columns of sections */
@container (min-width: 640px) {
  .sections { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; align-items: start; }
  .sections .cat-section:nth-child(2) { border-top: 0; }
}
.topbar-actions .btn { white-space: nowrap; }
@media (max-width: 480px) {
  .topbar { padding: 0 12px; }
  .topbar-actions { gap: 6px; }
  .topbar-actions .btn-ghost { height: 40px; padding: 0 10px; font-size: 13px; }
  .topbar-actions .btn-icon { width: 40px; height: 40px; }
}

/* ---------- v2.0 look: colour blocks ----------
   One rule: no outlines, no shadows. Shapes are blocks of colour.
   Neutral things are grey blocks; each preference is a block of its own colour (--c),
   with --tint for the block and --deep for text/icons on it. */
[style*="--c"] { --tint: color-mix(in srgb, var(--c) 20%, #fff); --deep: color-mix(in srgb, var(--c) 62%, #17181C); }
h1, h2, h3, .brand, .rank, .cat-score, .ring span, .headline strong, .overall strong, .tile b { font-family: var(--display); }

/* Chrome */
.topbar { border-bottom: 1px solid var(--line); }
.brand { font-size: 20px; letter-spacing: -0.02em; }
.brand svg { color: var(--ink); }
.btn { border: 0; background: var(--soft); border-radius: 12px; }
.btn:hover { background: var(--soft-2); }
.btn-ghost { border: 0; }
.btn:active:not(:disabled) { transform: scale(0.97); }

/* Hero */
.view-search { padding-top: 64px; }
.intro h1 { font-size: clamp(38px, 6.4vw, 62px); line-height: 0.98; letter-spacing: -0.04em; font-weight: 780; margin-bottom: 14px; max-width: 12ch; }
.intro p { font-size: 18px; max-width: 52ch; text-wrap: pretty; }
.field > label, .field > legend { font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }
.address-box { height: 62px; border: 0; border-radius: 18px; background: var(--soft); color: var(--ink); transition: background 0.15s, box-shadow 0.15s; }
.address-box input { font-size: 17px; font-weight: 500; }
.address-box:focus-within { background: #fff; border: 0; box-shadow: 0 0 0 2px var(--ink); }
.suggestions { border: 0; border-radius: 16px; box-shadow: 0 12px 32px rgba(23, 24, 28, 0.14); }

/* Preference cards = colour blocks */
.categories { gap: 12px; }
.cat-card, .cat-card.on { background: var(--tint); border: 0; box-shadow: none; border-radius: 22px; padding: 14px 16px 16px 12px; }
.cat-row { gap: 10px; }
.rank { width: 34px; height: auto; background: none; border-radius: 0; color: var(--deep); opacity: var(--strength); font-size: 40px; font-weight: 800; letter-spacing: -0.05em; line-height: 0.85; }
.cat-title { font-size: 16px; color: var(--ink); }
.cat-icon { background: rgba(255, 255, 255, 0.75); color: var(--deep); border-radius: 50%; }
.cat-extra { padding-left: 84px; }
@media (max-width: 560px) { .cat-extra { padding-left: 0; } }
.drag-handle { color: color-mix(in srgb, var(--deep) 55%, transparent); }
.drag-handle:hover { background: rgba(255, 255, 255, 0.55); color: var(--deep); }
.drag-chosen { box-shadow: 0 14px 34px rgba(23, 24, 28, 0.16); }

.weight { color: var(--deep); }
.weight-bar { background: rgba(255, 255, 255, 0.7); }
.weight-bar span { background: var(--deep); }
.flag-btn { border: 0; background: rgba(255, 255, 255, 0.55); color: color-mix(in srgb, var(--deep) 70%, #fff); }
.flag-btn:hover { background: rgba(255, 255, 255, 0.85); color: var(--deep); }
.flag-btn[aria-pressed="true"] { background: var(--deep); color: #fff; border: 0; }
.flag-btn[aria-pressed="true"] svg { fill: currentColor; }
.remove-btn { color: color-mix(in srgb, var(--deep) 60%, #fff); }
.remove-btn:hover { background: rgba(255, 255, 255, 0.6); color: var(--deep); }

.label { color: var(--deep); }
.chip { height: 34px; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.45); color: color-mix(in srgb, var(--deep) 65%, #fff); }
.chip[aria-pressed="true"] { background: #fff; border: 0; color: var(--deep); }
.pick-box { border: 0; border-radius: 14px; background: #fff; }
.pick-box:focus-within { border: 0; box-shadow: 0 0 0 2px var(--deep); }
.pick-help { color: color-mix(in srgb, var(--deep) 75%, #fff); }
.pick-chosen { border: 0; border-radius: 14px; background: #fff; }
.pick-pin { color: var(--deep); }
.pick-clear { border: 0; border-radius: 10px; background: var(--tint); color: var(--deep); }
.pick-clear:hover { background: color-mix(in srgb, var(--c) 30%, #fff); }
.custom-name input { border: 0; border-radius: 14px; background: #fff; }
.custom-name input:focus { outline: none; box-shadow: 0 0 0 2px var(--deep); }

/* Add buttons = grey blocks that pick up their colour on hover */
.available { gap: 8px; }
.add-chip { height: 42px; border: 0; border-radius: 999px; background: var(--soft); color: var(--ink); padding: 0 16px 0 12px; }
.add-chip svg:first-child { color: var(--ink-3); }
.add-chip svg:nth-child(2) { color: var(--deep); }
.add-chip:hover { border: 0; background: var(--tint); color: var(--ink); }
.add-chip:active { transform: scale(0.97); }
.empty-prefs { border: 0; background: var(--soft); border-radius: 22px; }

/* Main button */
.btn-big { height: 60px; font-size: 17px; border-radius: 18px; }
.btn-primary { background: var(--ink); border: 0; color: #fff; }
.btn-primary:hover { background: #2C2E34; }
.btn-primary:disabled { background: var(--soft); color: var(--ink-3); }

/* Results panel: the same blocks */
.panel { border-left: 1px solid var(--line); gap: 14px; }
@media (max-width: 920px) { .panel { border-top: 1px solid var(--line); } }
.panel-head h2 { font-size: 21px; letter-spacing: -0.02em; line-height: 1.2; }
.overall { border: 0; border-radius: 22px; padding: 16px 18px; background: var(--soft); }
.overall.band-good { background: #D9F4EA; }
.overall.band-ok { background: #FFF0C2; }
.overall.band-poor { background: #FFE1DF; }
.overall.band-capped { background: #FFE6CF; }
.overall.capped p { color: #8F3D06; }
.ring { background: conic-gradient(var(--ring) calc(var(--p) * 1%), rgba(255, 255, 255, 0.75) 0); }
.ring span { background: #fff; font-size: 24px; letter-spacing: -0.03em; }
.overall strong { font-size: 20px; letter-spacing: -0.01em; }

.sections { gap: 12px; }
.sections .cat-section, .sections .cat-section:first-child { background: var(--tint); border: 0; border-radius: 20px; padding: 14px 14px 14px; gap: 10px; }
.cat-head h3 { font-size: 16px; letter-spacing: -0.01em; }
.cat-head .cat-icon { width: 28px; height: 28px; }
.small-rank { width: 22px; font-size: 26px; }
.cat-meta { color: var(--deep); opacity: 0.85; }
.deal, .deal.missed { color: var(--ink); }
.deal.missed { color: #C42B1C; }
.cat-score { font-size: 26px; letter-spacing: -0.03em; color: var(--deep); }
.cat-section.missed .cat-score { color: #C42B1C; }
.bar { height: 6px; background: rgba(255, 255, 255, 0.7); }
.bar span { background: var(--deep); }
.headline { color: var(--deep); }
.headline strong { font-size: 26px; letter-spacing: -0.03em; }
.places { border: 0; border-radius: 14px; background: #fff; }
.places li + li { border-top: 1px solid color-mix(in srgb, var(--c) 14%, #fff); }
.places .place { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; background: #fff; }
.place .who { min-width: 0; display: flex; flex-direction: column; }
.place .addr { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.place:hover { background: color-mix(in srgb, var(--c) 7%, #fff); }
.place.active { background: color-mix(in srgb, var(--c) 14%, #fff); box-shadow: none; }
.place.dest { border: 0; border-radius: 14px; background: #fff; }
.modes { color: var(--deep); }
.empty-cat { border: 0; background: rgba(255, 255, 255, 0.7); border-radius: 14px; }
.notice { border: 0; border-radius: 14px; }
.panel-foot { border-top: 0; }
.panel-resizer::after { border: 0; background: var(--soft-2); }

/* Dialog */
.dialog { border-radius: 22px; }
.dialog-body input { border: 0; background: var(--soft); border-radius: 12px; }

@media (prefers-reduced-motion: reduce) { .btn:active, .add-chip:active { transform: none; } .address-box { transition: none; } }

/* ---------- v2.1: brighter tints, clearer controls inside cards ---------- */
[style*="--c"] { --tint: var(--t, color-mix(in srgb, var(--c) 20%, #fff)); --deep: color-mix(in srgb, var(--c) 72%, #17181C); }
.cat-meta, .weight, .label, .headline, .modes { color: color-mix(in srgb, var(--c) 60%, #17181C); }

/* Inputs: white pills with a soft ring (the one exception to "no outlines": things you type in) */
.address-box { background: #fff; border-radius: 999px; box-shadow: 0 0 0 1.5px var(--line-2); padding: 0 22px; }
.address-box:hover { box-shadow: 0 0 0 1.5px #C4C4BF; }
.address-box:focus-within { box-shadow: 0 0 0 2px var(--ink); }
.pick-box { height: 46px; border-radius: 999px; padding: 0 16px; background: #fff; box-shadow: none; color: var(--deep); }
.pick-box input::placeholder { color: color-mix(in srgb, var(--deep) 55%, #fff); }
.pick-box:focus-within { box-shadow: 0 0 0 2px var(--c); }
.pick .suggestions { top: 50px; }
.pick-chosen { border-radius: 18px; }
.custom-name input { border-radius: 999px; padding: 0 16px; }
.custom-name input:focus { box-shadow: 0 0 0 2px var(--c); }
.pick-help { padding-left: 16px; }

/* Chains: selected = solid colour + tick; not selected = faded, no tick */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; background: rgba(255, 255, 255, 0.5); color: color-mix(in srgb, var(--deep) 55%, #fff); font-weight: 700; }
.chip:hover { background: rgba(255, 255, 255, 0.85); color: var(--deep); }
.chip[aria-pressed="true"] { background: var(--deep); color: #fff; padding-left: 10px; }
.chip[aria-pressed="true"]::before { content: ''; width: 14px; height: 14px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.chip[aria-pressed="true"]:hover { background: color-mix(in srgb, var(--deep) 88%, #000); color: #fff; }

/* "+ Add" buttons preview their colour (lighter than a card) */
.add-chip { background: color-mix(in srgb, var(--tint) 55%, #fff); }
.add-chip:hover { background: var(--tint); }

/* ---------- v2.2: centred hero + red pin ---------- */
.intro { text-align: center; }
.intro h1 { max-width: 15ch; margin-inline: auto; }
.intro p { margin-inline: auto; }
.field > label[for="address"] { text-align: center; }
.address-box > svg { color: #F2473F; } /* warm red, same vividness as the category colours */
.intro h1 { max-width: 18ch; text-wrap: balance; }
.intro p { text-wrap: balance; }

/* ---------- v2.3: Soley brand ---------- */
.brand { gap: 8px; font-size: 23px; font-weight: 800; letter-spacing: -0.03em; }
.brand .brand-mark { flex: none; }

/* ---------- v2.4: results cards mirror the landing cards ---------- */
.sections .cat-section, .sections .cat-section:first-child { border-radius: 22px; padding: 14px 14px 14px 12px; gap: 12px; }
.cat-head { grid-template-columns: auto auto minmax(0, 1fr) auto auto; gap: 10px; }
.panel .rank { width: 28px; font-size: 34px; text-align: center; }
.cat-head h3 { color: var(--ink); }
.cat-meta { color: var(--ink-3); opacity: 1; font-weight: 600; }
.deal-pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--deep); color: #fff; font-size: 12px; font-weight: 800; white-space: nowrap; }
.deal-pill svg { fill: currentColor; }
.deal-pill.missed { background: #D92D20; }
.score-chip { display: inline-flex; align-items: center; gap: 8px; }
.score-chip .weight-bar { width: 40px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.75); overflow: hidden; }
.score-chip .weight-bar span { display: block; height: 100%; background: var(--deep); border-radius: 3px; }
.cat-score { font-size: 24px; color: var(--ink); min-width: 0; }
.cat-section.missed .cat-score { color: #D92D20; }

/* One white box per card */
.box { background: #fff; border-radius: 16px; overflow: hidden; }
.box .headline { margin: 0; padding: 12px 14px 6px; color: var(--ink-2); font-size: 14px; }
.box .headline strong { color: var(--ink); font-size: 24px; }
.box .places { border-radius: 0; background: transparent; }
.box .places li { border-top: 1px solid var(--line); }
.box .places li + li { border-top: 1px solid var(--line); }
.box .place.dest { border-radius: 0; padding: 12px 14px 8px; }
.box .place.dest .headline { padding: 0; }
.box .modes { margin: 0; padding: 10px 14px 12px; border-top: 1px solid var(--line); color: var(--ink-3); }
.box .modes b { color: var(--ink); }
.box .empty-cat { margin: 0; padding: 14px; background: transparent; color: var(--ink-3); }
.dest-addr { color: var(--ink-3); }
.place.active { background: color-mix(in srgb, var(--c) 10%, #fff); }
@media (max-width: 380px) { .score-chip .weight-bar { display: none; } }

.cat-head { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.cat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 3px; white-space: nowrap; }
.deal-pill { height: 20px; padding: 0 8px; font-size: 11px; gap: 4px; }
.deal-pill svg { width: 10px; height: 10px; }

/* ---------- v2.5: travel modes ---------- */
/* "Get there by" switch on landing cards: same language as the chain chips */
.mode-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(255, 255, 255, 0.5); }
.seg button { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px 0 11px; border: 0; border-radius: 999px; background: transparent;
  color: color-mix(in srgb, var(--deep) 60%, #fff); font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.15s, color 0.15s; }
.seg button:hover { color: var(--deep); background: rgba(255, 255, 255, 0.7); }
.seg button[aria-checked="true"] { background: var(--deep); color: #fff; }
.seg button:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .seg button { transition: none; } }

/* Results: mode shown next to the weight, alternatives in the commute footer */
.mode-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--deep); font-weight: 700; }
.box .modes { align-items: center; }
.box .modes .alt { display: inline-flex; align-items: center; gap: 5px; }
.box .modes .alt svg { color: var(--ink-3); }
.panel-foot a { color: inherit; text-decoration: underline; }

/* ---------- v2.6: mode switch lives on the results cards ---------- */
.box-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 10px 6px 14px; }
.box-top .headline { padding: 0; margin: 0; flex: 1 1 auto; min-width: 0; }
.box-top .place.dest { padding: 2px 0; flex: 1 1 auto; min-width: 0; background: transparent; }
.box-top .place.dest:hover { background: transparent; }
.box-top .place.dest:hover .headline strong { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.box-top .empty-cat { padding: 4px 0; }

.mode-switch { flex: none; display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: color-mix(in srgb, var(--tint) 70%, #fff); }
.mode-switch button { display: inline-flex; align-items: center; gap: 6px; height: 30px; min-width: 30px; justify-content: center; padding: 0 8px;
  border: 0; border-radius: 999px; background: transparent; color: color-mix(in srgb, var(--deep) 65%, #fff); font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background 0.15s, color 0.15s, padding 0.15s; }
.mode-switch button span { display: none; }
.mode-switch button:hover { color: var(--deep); background: rgba(255, 255, 255, 0.85); }
.mode-switch button[aria-checked="true"] { background: var(--deep); color: #fff; padding: 0 12px 0 10px; }
.mode-switch button[aria-checked="true"] span { display: inline; }
.mode-switch button:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; }
.cat-section.is-updating .box > :not(.box-top), .cat-section.is-updating .box-top .headline, .cat-section.is-updating .box-top .place { opacity: 0.45; transition: opacity 0.15s; }
@media (prefers-reduced-motion: reduce) { .mode-switch button { transition: none; } }

/* ---------- v2.8: map markers make both ends of every line obvious ---------- */
.pin { width: auto; height: auto; min-width: 24px; min-height: 24px; }
.pin-dot { width: 12px; height: 12px; background: var(--c); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(23, 24, 28, 0.3); }
.pin-badge { display: none; width: 30px; height: 30px; border-radius: 50%; place-items: center; background: var(--c); color: #fff;
  border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(23, 24, 28, 0.28); transition: transform 0.15s; }
.pin.is-end .pin-dot { display: none; }
.pin.is-end .pin-badge { display: grid; }
.pin.selected .pin-dot { transform: scale(1.3); box-shadow: 0 0 0 2.5px #17181C; }
.pin.selected .pin-badge { transform: scale(1.12); box-shadow: 0 0 0 2.5px #17181C; }
.pin:focus-visible { outline: none; }
.pin:focus-visible .pin-dot, .pin:focus-visible .pin-badge { box-shadow: 0 0 0 2.5px var(--accent); }

/* Start: white dot with a thick ink ring (the logo's centre) + an ink label */
.pin-home { position: relative; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 5px solid #17181C;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9), 0 2px 6px rgba(23, 24, 28, 0.3); cursor: default; z-index: 2; }
.home-label { position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 5px;
  max-width: 220px; padding: 5px 11px 5px 9px; border-radius: 999px; background: #17181C; color: #fff; font: 700 12px/1.2 'Public Sans', system-ui, sans-serif;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 6px rgba(23, 24, 28, 0.25); pointer-events: none; }
.maplibregl-marker:has(.pin-home) { z-index: 3; }
@media (prefers-reduced-motion: reduce) { .pin-badge { transition: none; } }

/* ---------- v2.9: clear click targets, map filter, loading, animated lines ---------- */
/* Rows are the clickable part of every card (one place or several): a dot on the left fills in
   for the place the map line goes to, like the dots and badges on the map. The headline is plain text. */
.places .place { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; }
.row-dot { width: 10px; height: 10px; border-radius: 50%; background: color-mix(in srgb, var(--c) 28%, #fff); transition: background 0.15s, transform 0.15s; }
.place:hover .row-dot { background: color-mix(in srgb, var(--c) 60%, #fff); }
.place.active .row-dot { background: var(--c); transform: scale(1.2); }
.place.active { background: color-mix(in srgb, var(--c) 10%, #fff); }
.box .places li:first-child { border-top: 1px solid var(--line); }
.box-top { padding: 10px 10px 10px 14px; }

/* Preference hidden on the map: its card fades a little so the link is clear */
.cat-section .box { transition: opacity 0.2s; }
.cat-section.off-map .box { opacity: 0.55; }

/* Mode switch: spinner on the mode that's loading */
.mode-switch button.is-loading svg { display: none; }
.mode-switch button.is-loading::before { content: ''; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; animation: spin 0.8s linear infinite; }

/* Map overlays: filter chips (top-left) and a loading pill (bottom-left). Light shadow for legibility on the map. */
.map-filters { position: absolute; top: 10px; left: 10px; right: 56px; z-index: 2; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.map-filters::-webkit-scrollbar { display: none; }
.map-chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 13px/1 'Public Sans', system-ui, sans-serif; white-space: nowrap; box-shadow: 0 1px 4px rgba(23, 24, 28, 0.18);
  --deep: color-mix(in srgb, var(--c) 72%, #17181C); background: var(--deep); color: #fff; transition: background 0.15s, color 0.15s, transform 0.1s; }
.map-chip[aria-pressed="false"] { background: rgba(255, 255, 255, 0.94); color: color-mix(in srgb, var(--deep) 55%, #fff); }
.map-chip[aria-pressed="false"]:hover { color: var(--deep); }
.map-chip:active { transform: scale(0.96); }
.map-chip:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; }
.map-busy { position: absolute; left: 10px; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 10px;
  border-radius: 999px; background: #fff; color: var(--ink-2); font: 700 12px/1 'Public Sans', system-ui, sans-serif; box-shadow: 0 1px 4px rgba(23, 24, 28, 0.18); }
.spinner-sm { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin 0.8s linear infinite; }

/* Pins of a hidden preference shrink and fade out */
.pin > span { transition: opacity 0.25s, transform 0.25s; }
.pin.is-hidden { pointer-events: none; }
.pin.is-hidden > span { opacity: 0; transform: scale(0.4); }
@media (prefers-reduced-motion: reduce) {
  .row-dot, .pin > span, .map-chip, .cat-section .box { transition: none; }
  .mode-switch button.is-loading::before, .spinner-sm { animation-duration: 2.4s; }
}
@media (max-width: 560px) {
  .map-chip { height: 30px; font-size: 12px; padding: 0 10px 0 8px; gap: 5px; }
  /* Fade the right edge so it's clear the chips scroll */
  .map-filters { -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
}

/* ---------- v3.1: bigger map markers, scaled together ---------- */
.pin { min-width: 28px; min-height: 28px; }
.pin-dot { width: 16px; height: 16px; border-width: 2.5px; }
.pin-badge { width: 34px; height: 34px; border-width: 3px; }
.pin-home { width: 26px; height: 26px; border-width: 6px; }
.home-label { bottom: calc(100% + 10px); }
/* Panel rows use the same dot language as the map */
.row-dot { width: 12px; height: 12px; }

/* ---------- v3.3: back-to-address button (map control, under zoom) ---------- */
.home-ctrl { display: grid !important; place-items: center; color: #17181C; }
.home-ctrl:disabled { color: #B8BBC0; cursor: default; }


/* ---------- v4.4: one route in focus ---------- */
/* Clicking a card's header focuses its route on the map; the focused card's icon turns solid (selected = solid deep colour). */
.sections .cat-head { cursor: pointer; }
.cat-section .cat-head .cat-icon { transition: background 0.15s, color 0.15s; }
.cat-section.is-focus .cat-head .cat-icon { background: var(--deep); color: #fff; }
@media (prefers-reduced-motion: reduce) { .cat-section .cat-head .cat-icon { transition: none; } }

/* ---------- v4.5: hovering a card previews its route ---------- */
@media (hover: hover) { .sections .cat-section:not(.is-focus):hover { background: color-mix(in srgb, var(--tint) 92%, var(--c)); } }
.sections .cat-section { transition: background 0.15s; }
@media (prefers-reduced-motion: reduce) { .sections .cat-section { transition: none; } }

/* ---------- v5.0: clearer ranking, friendlier choices, hero score, panel pills ---------- */

/* Reorder: a slim column of ▲ grip ▼ (arrows for tap/click, grip for dragging) */
.reorder { display: flex; flex-direction: column; align-items: center; flex: none; width: 32px; margin-left: -6px; }
.reorder .drag-handle { width: 32px; height: 26px; margin: 0; }
.move-btn { width: 32px; height: 20px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  color: color-mix(in srgb, var(--deep) 60%, transparent); }
.move-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.6); color: var(--deep); }
.move-btn:disabled { visibility: hidden; }
.move-btn:focus-visible { outline: 2px solid var(--deep); outline-offset: 1px; }
.cat-card.just-moved { animation: nudge 0.3s ease-out; }
@keyframes nudge { from { transform: scale(0.985); } to { transform: none; } }

/* How much it matters: dots + words (landing and results) */
.matters { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 800; color: var(--deep); white-space: nowrap; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 7px; height: 7px; border-radius: 50%; background: color-mix(in srgb, var(--deep) 22%, transparent); transition: background 0.2s; }
.pips i.on { background: var(--deep); }
.cat-name { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; flex: 1; min-width: 0; }
.cat-name .title-input { width: calc(100% + 8px); }
@media (prefers-reduced-motion: reduce) { .pips i { transition: none; } .cat-card.just-moved { animation: none; } }

/* Your own places: the card title is the name */
.title-input { min-width: 0; height: 28px; margin-left: -8px; padding: 0 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ink);
  font: 700 16px/1 'Public Sans', system-ui, sans-serif; text-overflow: ellipsis; }
.title-input::placeholder { color: color-mix(in srgb, var(--deep) 60%, #fff); }
.title-input:hover { background: rgba(255, 255, 255, 0.55); }
.title-input:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px var(--deep); }

/* Nearest / A specific one */
.near-seg { align-self: flex-start; }
.near-note { margin: 0; font-size: 13px; color: color-mix(in srgb, var(--deep) 80%, #fff); }
.cat-card .specific-only { display: none; }
.cat-card.is-specific .specific-only { display: block; }
.cat-card.is-specific .near-only { display: none; }
.near-only { display: flex; flex-direction: column; gap: 8px; }

/* Results: the overall score is the hero */
.overall.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 22px 20px 20px; }
.overall.hero .ring { width: 104px; height: 104px; margin-bottom: 4px; }
.overall.hero .ring span { width: 84px; height: 84px; font-size: 34px; }
.overall.hero strong { font-size: 26px; letter-spacing: -0.02em; }
.overall.hero .summary { margin: 0; max-width: 34ch; font-size: 15px; line-height: 1.45; color: var(--ink); font-weight: 600; }
.overall.hero .overall-note { margin: 2px 0 0; font-size: 12px; color: var(--ink-3); }
.overall.hero.capped .overall-note { color: #8F3D06; font-weight: 700; }

/* "On the map" pills: always reachable, they stick to the top while the cards scroll */
.map-toggles { position: sticky; top: 0; z-index: 5; display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin: 0 -2px; padding: 10px 2px; background: #fff; }
.map-toggles-label { flex: none; font-size: 13px; font-weight: 800; color: var(--ink-2); }
.pill-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.pill-row::-webkit-scrollbar { display: none; }
.map-pill { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 13px/1 'Public Sans', system-ui, sans-serif; white-space: nowrap;
  --deep: color-mix(in srgb, var(--c) 72%, #17181C); background: var(--deep); color: #fff; transition: background 0.15s, color 0.15s, transform 0.1s; }
.map-pill[aria-pressed="false"] { background: var(--soft); color: var(--ink-3); }
.map-pill[aria-pressed="false"]:hover { color: var(--deep); }
.map-pill:active { transform: scale(0.96); }
.map-pill:focus-visible { outline: 2px solid var(--deep); outline-offset: 2px; }
@media (min-width: 561px) { .pill-row { flex-wrap: wrap; overflow: visible; } }
@media (max-width: 560px) {
  .pill-row { -webkit-mask-image: linear-gradient(to right, #000 88%, transparent); mask-image: linear-gradient(to right, #000 88%, transparent); }
}

/* Card verdict instead of a bare number */
.verdict { display: inline-flex; align-items: center; gap: 8px; }
.verdict .weight-bar { width: 40px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.75); overflow: hidden; }
.verdict .weight-bar span { display: block; height: 100%; background: var(--deep); border-radius: 3px; }
.verdict-word { font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--deep); }
.cat-section.missed .verdict-word { color: #D92D20; }
@media (max-width: 380px) { .verdict .weight-bar { display: none; } }
.cat-head { grid-template-columns: auto auto minmax(0, 1fr) auto; }
.cat-meta .matters { font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .map-pill { transition: none; } }

/* ---------- v5.1: more breathing room, one-line chains, gentle motion ---------- */
.categories { gap: 16px; }
.cat-card, .cat-card.on { padding: 18px 20px 20px 14px; gap: 14px; }
.cat-extra { gap: 14px; }
.sections { gap: 16px; }
.sections .cat-section, .sections .cat-section:first-child { padding: 18px 18px 18px 14px; gap: 14px; }
.panel { gap: 20px; }
.cat-meta { margin-top: 5px; }

/* Supermarket chains: question on its own line, the four chips on one line */
.chains { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.chain-row { display: flex; flex-wrap: nowrap; gap: 6px; max-width: 100%; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.chain-row::-webkit-scrollbar { display: none; }
.chain-row .chip { flex: none; height: 32px; padding: 0 12px; font-size: 13px; gap: 5px; }
.chain-row .chip[aria-pressed="true"] { padding-left: 9px; }

/* Verdict word on its own (no bar) */
.verdict { font-family: var(--display); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--deep); white-space: nowrap; }
.cat-section.missed .verdict { color: #D92D20; }

/* Whole result card is clickable (focuses its route) */
.sections .cat-section { cursor: pointer; }
.sections .cat-section .box { cursor: auto; }

/* Motion: quick, light, and off for anyone who prefers reduced motion */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
.panel.entering .overall.hero { animation: rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.panel.entering .map-toggles { animation: rise 0.35s 0.06s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.panel.entering .cat-section { animation: rise 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(0.1s + var(--i, 0) * 0.06s); }
.cat-card .near-only, .cat-card .specific-only { animation: fade-in 0.22s ease-out; }
.map-pill { transition: background 0.18s, color 0.18s, transform 0.12s; }
.map-pill:active { transform: scale(0.93); }
.cat-icon { transition: background 0.2s, color 0.2s, transform 0.2s; }
.cat-section.is-focus .cat-head .cat-icon { transform: scale(1.08); }
.view-results:not([hidden]) .panel { animation: fade-in 0.25s ease-out; }
@media (prefers-reduced-motion: reduce) {
  .panel.entering .overall.hero, .panel.entering .map-toggles, .panel.entering .cat-section,
  .cat-card .near-only, .cat-card .specific-only, .view-results:not([hidden]) .panel { animation: none; }
  .map-pill, .cat-icon { transition: none; }
}

/* ---------- v5.2 ---------- */
/* "On the map" row: full panel width, solid, covers the panel padding while stuck, soft fade underneath */
.map-toggles { margin: 0 -22px; padding: 12px 22px; top: 0; }
.map-toggles::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 14px; pointer-events: none;
  background: linear-gradient(#fff, rgba(255, 255, 255, 0)); }
@media (min-width: 921px) { .map-toggles { top: -22px; padding-top: 22px; margin-top: -10px; } }

/* Locked (clicked) card: solid icon plus a slightly stronger card colour */
.sections .cat-section.is-focus { background: color-mix(in srgb, var(--tint) 78%, var(--c)); }
.sections .cat-section { transition: background 0.3s ease; }
.verdict { font-size: 16px; letter-spacing: -0.01em; text-align: right; }

/* Ranking tip: a light neutral block with an up/down icon */
.rank-note { display: flex; align-items: center; gap: 12px; margin: 2px 0 6px; padding: 12px 16px; border-radius: 16px; background: var(--soft);
  font-size: 14px; color: var(--ink-2); line-height: 1.4; }
.rank-note svg { flex: none; color: var(--ink); }
.rank-note strong { color: var(--ink); font-weight: 700; }

/* Landing: faint logo in the background, drawn on load */
.view-search { position: relative; overflow: hidden; }
.search-card { position: relative; z-index: 1; }
.bg-logo { position: absolute; z-index: 0; top: -150px; right: calc(50% - 920px); width: 600px; height: 600px; opacity: 0.07; pointer-events: none; }
.bg-logo.bl { top: auto; right: auto; bottom: -200px; left: calc(50% - 860px); width: 520px; height: 520px; transform: rotate(140deg); }
.bg-logo line { stroke-width: 5; stroke-linecap: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw-ray 0.9s cubic-bezier(0.3, 0.7, 0.2, 1) forwards; animation-delay: calc(0.2s + var(--d) * 0.12s); }
.bg-logo circle:not(.core) { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: pop-dot 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) forwards; animation-delay: calc(0.8s + var(--d) * 0.12s); }
.bg-logo .core { transform-box: fill-box; transform-origin: center; animation: pop-dot 0.5s cubic-bezier(0.3, 1.5, 0.5, 1) both; }
@keyframes draw-ray { to { stroke-dashoffset: 0; } }
@keyframes pop-dot { from { transform: scale(0); } to { transform: scale(1); } }
@media (max-width: 720px) { .bg-logo { width: 360px; height: 360px; top: -140px; right: -190px; opacity: 0.06; } .bg-logo.bl { display: none; } }

/* Landing entrance: headline, subtext, then the form */
.view-search:not([hidden]) .intro h1 { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.view-search:not([hidden]) .intro p { animation: rise 0.7s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.view-search:not([hidden]) .search-card > .field { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: 0.2s; }
.view-search:not([hidden]) .search-card > fieldset.field { animation-delay: 0.3s; }
.view-search:not([hidden]) .search-card > #search-btn { animation: rise 0.7s 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

/* A bit slower overall, so the motion is noticeable */
.panel.entering .overall.hero { animation-duration: 0.55s; }
.panel.entering .map-toggles { animation-duration: 0.55s; animation-delay: 0.1s; }
.panel.entering .cat-section { animation-duration: 0.6s; animation-delay: calc(0.15s + var(--i, 0) * 0.1s); }
.cat-card .near-only, .cat-card .specific-only { animation-duration: 0.35s; }
.cat-card.just-added { animation-duration: 0.6s; }
.map-pill { transition: background 0.28s, color 0.28s, transform 0.18s; }
.cat-icon { transition: background 0.3s, color 0.3s, transform 0.3s; }
.pips i { transition: background 0.3s; }

@media (prefers-reduced-motion: reduce) {
  .bg-logo line { animation: none; stroke-dashoffset: 0; }
  .bg-logo circle, .bg-logo .core { animation: none; transform: none; }
  .view-search:not([hidden]) .intro h1, .view-search:not([hidden]) .intro p, .view-search:not([hidden]) .search-card > .field,
  .view-search:not([hidden]) .search-card > #search-btn { animation: none; }
  .sections .cat-section { transition: none; }
}
/* On narrow screens the page scrolls (not the panel), so let the pill row stick to the window */
@media (max-width: 920px) { .panel { overflow: visible; } }

/* ---------- v5.4 ---------- */
/* Suggestion lists always float above the rest of the form (entrance animations create stacking layers) */
.search-card > .field:focus-within, .cat-card:focus-within { position: relative; z-index: 30; }
#search-btn { position: relative; z-index: 1; }

/* Spinner in a search box while the address lookup runs */
.address-box::after, .pick-box::after { content: ''; flex: none; width: 16px; height: 16px; margin-left: auto; border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 22%, transparent); border-top-color: currentColor; opacity: 0;
  transition: opacity 0.2s; animation: spin 0.8s linear infinite; }
.address-box.is-searching::after, .pick-box.is-searching::after { opacity: 1; }
.address-box input, .pick-box input { flex: 1; min-width: 0; }
@media (prefers-reduced-motion: reduce) { .address-box::after, .pick-box::after { animation-duration: 2.4s; } }

/* ---------- v5.7 UI fixes ---------- */
/* Address label lines up with the other section labels */
.field > label[for="address"] { text-align: left; }

/* Place name field: reads as the card title; on hover/focus it becomes a white pill with the
   same 2px ring as the other search boxes. Text never moves (negative margin = padding). */
.title-input, .cat-name .title-input { height: 32px; margin-left: -12px; padding: 0 12px; width: calc(100% + 12px); border-radius: 999px;
  transition: background 0.15s, box-shadow 0.15s; text-overflow: ellipsis; }
.title-input:hover { background: rgba(255, 255, 255, 0.55); }
.title-input:focus { background: #fff; box-shadow: 0 0 0 2px var(--c); text-overflow: clip; }

/* Supermarket chips: fade the right edge so it's clear they scroll; the extra right padding
   means the last chip sits clear of the fade once you've scrolled to the end */
.chain-row { padding: 2px 28px 2px 2px; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }

@media (max-width: 560px) {
  /* Landing card header on phones: × stays on the title row, Deal-breaker sits under the title */
  .cat-row { flex-wrap: wrap; row-gap: 0; }
  .cat-row .card-actions { display: contents; }
  .cat-row .cat-title { flex: 1 1 0; min-width: 0; }
  .cat-row .remove-btn { order: 3; }
  .cat-row::after { content: ''; order: 4; flex-basis: 100%; height: 0; }
  .cat-row .flag-btn { order: 5; margin: 2px 0 0 80px; }

  /* Result cards: long titles wrap instead of being cut off by the verdict */
  .sections .cat-head h3 { white-space: normal; line-height: 1.2; }
  .sections .cat-head .verdict { max-width: 6.5em; white-space: normal; text-align: right; line-height: 1.15; font-size: 14px; }
  /* Headline time gets the full width; the mode switch goes underneath */
  .box-top { flex-wrap: wrap; row-gap: 8px; }
  .box-top .headline, .box-top .place.dest { flex-basis: 100%; }
}

/* ---------- v5.8 ---------- */
/* Place name field as an underlined title: nothing boxes it in, so it can't clash with the icon.
   Dashed line when empty or hovered (it's editable); a solid line in the card colour grows in while typing. */
.title-input, .cat-name .title-input, .title-input:hover, .title-input:focus {
  height: 28px; margin-left: 0; padding: 0 0 2px; width: 100%; border: 0; border-radius: 0; box-shadow: none; outline: none;
  background:
    linear-gradient(var(--c), var(--c)) 0 100% / 0% 2px no-repeat,
    repeating-linear-gradient(to right, color-mix(in srgb, var(--deep) 45%, transparent) 0 4px, transparent 4px 8px) 0 100% / 0% 1.5px no-repeat,
    transparent;
  transition: background-size 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.title-input:placeholder-shown, .title-input:hover { background-size: 0% 2px, 100% 1.5px; }
.title-input:focus { background-size: 100% 2px, 0% 1.5px; }
.title-input:focus-visible { outline: none; }

/* Settings dialog: same input as the address box, ink link, tidy button row */
.dialog-body input { height: 52px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--soft); outline: none; transition: box-shadow 0.15s; }
.dialog-body input:focus { box-shadow: 0 0 0 2px var(--ink); }
.dialog-body .small a { color: var(--ink); font-weight: 700; text-decoration-thickness: 1.5px; text-underline-offset: 2px; }
@media (max-width: 480px) {
  .dialog-actions .spacer { display: none; }
  .dialog-actions [value="cancel"], .dialog-actions #save-settings { flex: 1; }
  .dialog-actions #clear-cache { order: 2; flex-basis: 100%; }
}

/* Dropdowns match the rounder inputs */
.suggestions { border-radius: 18px; }

/* ---- Motion (all off with reduced motion) ---- */
@keyframes soley-pop { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes soley-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes soley-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes soley-swap { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes soley-toast { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes soley-chip { 0% { transform: scale(0.85); opacity: 0; } 70% { transform: scale(1.04); opacity: 1; } 100% { transform: none; } }

.dialog[open] { animation: soley-pop 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.dialog[open]::backdrop { animation: soley-fade 0.3s ease-out; }
.suggestions:not([hidden]) { animation: soley-drop 0.18s ease-out; }
.pick-box:not([hidden]), .pick-chosen:not([hidden]) { animation: soley-swap 0.25s ease-out; }
.toast:not([hidden]) { animation: soley-toast 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.add-chip.just-added { animation: soley-chip 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
.just-updated .box-top .headline, .just-updated .verdict, .overall.just-updated p,
.just-updated .places .time, .just-updated .places .dist { animation: soley-swap 0.35s ease-out; }
.places .row-dot { transition: background 0.2s, transform 0.2s; }
.places .place.active .row-dot { transform: scale(1.15); }

@media (prefers-reduced-motion: reduce) {
  .title-input, .dialog[open], .dialog[open]::backdrop, .suggestions:not([hidden]), .pick-box:not([hidden]), .pick-chosen:not([hidden]),
  .toast:not([hidden]), .add-chip.just-added, .just-updated .box-top .headline, .just-updated .verdict, .overall.just-updated p,
  .just-updated .places .time, .just-updated .places .dist, .places .row-dot { animation: none; transition: none; }
}

/* ---------- v5.9 ---------- */
/* Phone landing cards: Deal-breaker lines up with the content below it (same left edge as the toggle/search) */
@media (max-width: 560px) { .cat-row .flag-btn { margin: 4px 0 0; } }

/* Validation: the button keeps its "not ready" look but stays pressable; pressing it marks each
   field that needs attention with a red ring and a short line under it (in the same type as the hints) */
#search-btn.not-ready { background: var(--soft); color: var(--ink-3); }
#search-btn.not-ready:hover { background: #ECECE9; }
.field-error { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: 13px; font-weight: 700; line-height: 1.35; color: #C42B1C; }
.field-error[hidden] { display: none; }
.field-error svg { flex: none; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.field > .field-error { margin-top: 8px; }
.has-error .address-box, .has-error .address-box:focus-within,
.cat-card.has-error .pick-box, .cat-card.has-error .pick-box:focus-within { box-shadow: 0 0 0 2px #E5484D; }
.cat-card.has-error .chain-row .chip:not([aria-pressed="true"]) { box-shadow: inset 0 0 0 1.5px #E5484D; }
.field-error:not([hidden]) { animation: soley-swap 0.25s ease-out; }
@media (prefers-reduced-motion: reduce) { .field-error:not([hidden]) { animation: none; } }

/* ---------- v6.0: the logo in motion ---------- */
.brand-mark line, .logo-loader line, .logo-mini line, .burst line { stroke-width: 5; stroke-linecap: round; }
.brand-mark circle, .logo-loader circle, .logo-mini circle, .burst circle { transform-box: fill-box; transform-origin: center; }

/* Topbar logo: rays draw out one by one, then the dots pop (on load and when a check finishes) */
.brand-mark.drawing .ray line { stroke-dasharray: 60; animation: draw-in 0.6s cubic-bezier(0.3, 0.7, 0.2, 1) both; animation-delay: calc(var(--d) * 0.08s); }
.brand-mark.drawing .ray circle { animation: pop-dot 0.4s cubic-bezier(0.3, 1.5, 0.5, 1) both; animation-delay: calc(0.3s + var(--d) * 0.08s); }
@keyframes draw-in { from { stroke-dashoffset: 60; } to { stroke-dashoffset: 0; } }

/* Main loader: the logo draws itself, holds, then pulls its rays back in, on a loop */
.loading .logo-loader { width: 64px; height: 64px; flex: none; }
.logo-loader .ray line { stroke-dasharray: 60; animation: loader-ray 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite; animation-delay: calc(var(--d) * 0.09s); }
.logo-loader .ray circle { animation: loader-dot 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite; animation-delay: calc(var(--d) * 0.09s); }
@keyframes loader-ray { 0% { stroke-dashoffset: 60; } 35%, 65% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 60; } }
@keyframes loader-dot { 0%, 20% { transform: scale(0); } 38%, 62% { transform: scale(1); } 80%, 100% { transform: scale(0); } }

/* Small loader (search boxes, "Loading routes"): faint logo whose dots light up in turn */
.logo-mini { width: 18px; height: 18px; flex: none; }
.logo-mini .ray { opacity: 0.25; animation: mini-ray 1s ease-in-out infinite; animation-delay: calc(var(--d) * 0.2s); }
@keyframes mini-ray { 0%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
.address-box::after, .pick-box::after { content: none; }
.address-box .logo-mini, .pick-box .logo-mini { margin-left: auto; opacity: 0; transition: opacity 0.2s; }
.address-box.is-searching .logo-mini, .pick-box.is-searching .logo-mini { opacity: 1; }
.address-box:not(.is-searching) .logo-mini .ray, .pick-box:not(.is-searching) .logo-mini .ray { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .brand-mark .ray line, .brand-mark .ray circle, .logo-loader .ray line, .logo-loader .ray circle, .logo-mini .ray { animation: none; }
  .logo-mini .ray { opacity: 1; }
}
/* Marker order: the address sits above the plain dots, line-end badges above the address label
   (a supermarket right next door was being hidden under "200 Lygon St") */
.maplibregl-marker.pin-home { z-index: 3; }
.maplibregl-marker.pin.is-end { z-index: 4; }

/* ---------- v6.1 ---------- */
/* Search-box loader big enough to notice: about the height of the text in the box */
.address-box .logo-mini { width: 28px; height: 28px; }
.pick-box .logo-mini { width: 24px; height: 24px; }
.address-box .logo-mini .ray, .pick-box .logo-mini .ray { opacity: 0.3; }
@keyframes mini-ray { 0%, 100% { opacity: 0.3; } 30% { opacity: 1; } }
