:root {
  --accent: #d9480f;
  --ink: #0A0B0F;
  --muted: #5B6270;
  --line: #E3E6EC;
  --bg: #F6F7F9;
  --soft: #EEF0F3;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --open: #2b8a3e;
  --closed: #a61e1e;
  --panel-w: 380px;
  font-family: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { display: grid; grid-template-columns: var(--panel-w) 1fr; background: var(--bg); overflow: hidden; }
button { font: inherit; cursor: pointer; color: var(--ink); -webkit-tap-highlight-color: transparent; }
code { font-size: .9em; background: var(--soft); padding: 1px 4px; border-radius: 4px; }

/* ---------- Panel ---------- */
#panel { display: flex; flex-direction: column; height: 100dvh; border-right: 1px solid var(--line); background: var(--bg); min-height: 0; }
.top { display: flex; justify-content: space-between; align-items: flex-start; padding: 18px 18px 8px; }
.wordmark { margin: 0; font-size: 1.65rem; font-weight: 800; letter-spacing: -0.05em; line-height: 1; white-space: nowrap; }
.wm-o { width: 0.54em; height: 0.54em; vertical-align: -0.012em; margin-right: 0.035em; }
.wm-prod { color: var(--accent); font-weight: 700; }
.city { margin: 8px 0 0; font-family: var(--mono); font-size: .7rem; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
#app-subtitle { margin: 8px 0 0; color: var(--muted); font-size: .88rem; }
.searchbar { display: flex; gap: 8px; padding: 6px 18px 10px; }
#search { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; }
#search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.gauge text { font-family: var(--mono); letter-spacing: -0.04em; }
.li-status, .status { font-family: var(--mono); }
#toggle-filters { padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
#toggle-filters[aria-expanded="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

#filters { display: none; padding: 0 18px 6px; overflow-y: auto; max-height: 52vh; border-bottom: 1px solid var(--line); }
body.filters-open #filters { display: block; }
.filter-group { border: 0; padding: 0; margin: 0 0 12px; }
.filter-group legend { font-family: var(--mono); font-size: .66rem; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; min-height: 34px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .84rem; }
.chip:hover { border-color: #C5CBD5; }
.chip[aria-pressed="true"] { background: var(--accent-fill, var(--accent)); color: #fff; border-color: var(--accent-fill, var(--accent)); }
.ci { display: inline-grid; place-items: center; color: var(--muted); margin-left: -2px; }
.chip[aria-pressed="true"] .ci { color: #fff !important; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }

.countbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 18px; font-family: var(--mono); font-size: .7rem; color: var(--muted); }
.link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 600; }
#list { list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 1; min-height: 0; }
#list > li { border-radius: 12px; margin-bottom: 2px; }
#list > li.is-open { background: #fff; box-shadow: 0 1px 0 var(--line), 0 4px 18px rgba(10,11,15,.07); margin: 6px 0 10px; }
#list .row { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: none; border: 0; border-radius: 12px; padding: 10px; }
#list .row:hover { background: var(--soft); }
#list li.is-open .row:hover { background: none; }
.cat-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--soft); display: grid; place-items: center; }
.cat-ic svg { width: 16px; height: 16px; }
.chev { flex: none; color: var(--muted); transition: transform .15s; }
li.is-open .chev { transform: rotate(180deg); }
.li-detail { padding: 0 14px 14px 52px; }
.li-detail .addr { margin: 0 0 2px; color: var(--muted); font-size: .86rem; }
.li-detail .status { margin: 0 0 4px; font-weight: 600; font-size: .8rem; }
.li-detail .links { margin: 10px 0 4px; }
.li-detail .section:first-of-type { margin-top: 6px; }
.price { font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.li-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.li-body strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.li-badge { flex: none; display: grid; place-items: center; }
.gauge { display: block; }
.gauge-na { width: 34px; height: 34px; border-radius: 50%; border: 3.5px solid #E6E9EE; display: grid; place-items: center; font-size: .62rem; color: #9a948a; font-weight: 600; }
.oicons { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.oi { width: 20px; height: 20px; border-radius: 6px; display: inline-grid; place-items: center; background: var(--soft); color: #3a3a3a; font-size: 9px; font-weight: 800; letter-spacing: -.02em; }
.oi svg { width: 13px; height: 13px; }
.oi.app { color: #fff; }
.oi-row { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.oi-row .item { display: inline-flex; align-items: center; gap: 6px; font-size: .84rem; color: inherit; text-decoration: none; }
.oi-row .item .oi { width: 26px; height: 26px; border-radius: 8px; font-size: 11px; }
.oi-row .item .oi svg { width: 16px; height: 16px; }
.health-big { display: flex; align-items: center; gap: 14px; }
.health-big .label { font-size: .84rem; color: var(--muted); line-height: 1.4; }
.health-big .label b { display: block; color: var(--ink); font-size: .95rem; }
.li-body strong { font-size: .95rem; }
.li-meta { font-size: .8rem; color: var(--muted); }
.li-status, .status { font-size: .78rem; color: var(--muted); }
.open { color: var(--open) !important; }
.closed { color: var(--closed) !important; }
#list .more { padding: 14px 10px; font-size: .82rem; color: var(--muted); }
#panel footer { padding: 10px 18px; font-size: .72rem; color: var(--muted); border-top: 1px solid var(--line); }

/* ---------- Map ---------- */
#map-wrap { position: relative; min-width: 0; }
#map { position: absolute; inset: 0; }
#legend { position: absolute; left: 12px; bottom: 44px; background: rgba(255,255,255,.95); border-radius: 12px; padding: 10px 12px; box-shadow: 0 2px 12px rgba(0,0,0,.12); font-size: .78rem; max-width: 220px; }
#legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
#legend li { display: flex; align-items: center; gap: 6px; }
.mode-switch { display: flex; background: var(--soft); border-radius: 8px; padding: 2px; margin-bottom: 8px; }
.mode-switch button { flex: 1; border: 0; background: none; border-radius: 6px; padding: 4px 8px; font-size: .75rem; }
.mode-switch button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }

#detail { position: absolute; top: 12px; left: 12px; width: 360px; max-height: calc(100% - 24px); overflow-y: auto; background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 6px 30px rgba(0,0,0,.18); }
#detail .close { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--muted); }
#detail h2 { margin: 2px 0 4px; font-size: 1.25rem; padding-right: 20px; }
#detail .eyebrow { display: flex; align-items: center; gap: 6px; margin: 0; font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
#detail .addr { margin: 0 0 4px; color: var(--muted); font-size: .88rem; }
#detail .status { margin: 0 0 12px; font-weight: 600; font-size: .85rem; }
.section { border-top: 1px solid var(--line); padding: 10px 0; }
.section h3 { margin: 0 0 6px; font-family: var(--mono); font-weight: 500; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 3px 9px; border-radius: 999px; background: var(--soft); font-size: .8rem; }
.tag.yes { background: #e6f4ea; color: #1e5a2b; }
.tag.no { background: var(--soft); color: #999; text-decoration: line-through; }
.score { display: flex; align-items: baseline; gap: 8px; }
.score b { font-size: 1.6rem; }
.hours summary { cursor: pointer; font-size: .85rem; font-weight: 600; padding: 8px 0; border-top: 1px solid var(--line); }
.hours table { font-size: .84rem; border-collapse: collapse; }
.hours th { text-align: left; padding: 2px 16px 2px 0; font-weight: 500; color: var(--muted); }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.links a { padding: 7px 12px; border-radius: 8px; background: var(--ink); color: #fff; text-decoration: none; font-size: .84rem; }
.links a:first-child { background: var(--accent-fill, var(--accent)); }
#detail h2 { letter-spacing: -0.03em; font-weight: 800; }
.li-body strong { letter-spacing: -0.015em; font-weight: 700; }
.source { font-size: .72rem; color: var(--muted); margin: 6px 0 0; }
.source a { color: inherit; }

/* ---------- Token prompt ---------- */
.token-prompt { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 10; }
.token-prompt form { background: #fff; padding: 22px; border-radius: 14px; width: min(440px, 92vw); }
.token-prompt h2 { margin-top: 0; }
.token-prompt input { width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0 12px; font: inherit; }
.token-prompt button { padding: 10px 16px; border: 0; border-radius: 8px; background: var(--ink); color: #fff; }

.mobile-only { display: none !important; }
.ghost { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px; }

/* ---------- Mobile ---------- */
@media (max-width: 760px) {
  body { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .mobile-only { display: inline-flex !important; }
  #panel { height: auto; border-right: 0; border-bottom: 1px solid var(--line); z-index: 2; }
  #list, #panel footer, .countbar { display: none; }
  body.show-list #panel { height: 100dvh; }
  body.show-list #list, body.show-list .countbar { display: flex; }
  body.show-list #list { display: block; }
  body.show-list #map-wrap { display: none; }
  #map-wrap { height: 100%; }
  #detail { top: auto; bottom: 0; left: 0; right: 0; width: auto; max-height: 60%; border-radius: 16px 16px 0 0; }
  #legend { bottom: 12px; font-size: .72rem; }
  #legend { display: none; }
  body.has-detail #legend { display: none; }
}

/* Health as a small attribute */
.hchip { display: inline-flex; align-items: center; gap: 3px; height: 20px; padding: 0 6px 0 4px; border-radius: 6px; background: var(--soft); font-family: var(--mono); font-size: .72rem; }
.hchip svg { width: 13px; height: 13px; fill: currentColor; stroke: currentColor; }
.hchip b { color: var(--ink); font-weight: 700; }
.hline { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .84rem; color: var(--muted); }

/* Premium map chrome */
.mapboxgl-ctrl-group { border-radius: 12px !important; box-shadow: 0 4px 16px rgba(10,11,15,.12) !important; overflow: hidden; border: 1px solid var(--line); }
.mapboxgl-ctrl-group button { width: 36px !important; height: 36px !important; }
.mapboxgl-ctrl-top-right { top: 6px; right: 6px; }
#legend { background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(12px) saturate(1.4); backdrop-filter: blur(12px) saturate(1.4); border: 1px solid rgba(227,230,236,.8); box-shadow: 0 6px 24px rgba(10,11,15,.10); bottom: 16px; }
#detail { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); background: rgba(255,255,255,.94); border: 1px solid rgba(227,230,236,.9); }
.links a.ghost-link { background: #fff; color: var(--ink); border: 1px solid var(--line); }

/* ---------- Liquid glass layout: panels float over a full-bleed map ---------- */
:root {
  --glass: rgba(250, 251, 252, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-blur: blur(24px) saturate(1.8);
  --glass-edge: 1px solid rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 12px 40px rgba(10, 11, 15, 0.14), 0 2px 6px rgba(10, 11, 15, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.75), inset 0 0 0 0.5px rgba(255, 255, 255, 0.4);
}
body { display: block; background: #E9ECEF; }
#map-wrap { position: fixed; inset: 0; }
#panel {
  position: fixed; z-index: 3; top: 12px; left: 12px; bottom: 12px; width: var(--panel-w); height: auto;
  border: var(--glass-edge); border-radius: 22px; overflow: hidden;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}
#panel footer { border-top: 1px solid rgba(10, 11, 15, 0.06); }
#filters { border-bottom: 1px solid rgba(10, 11, 15, 0.06); }
#search, #toggle-filters, .chip, .ghost { background: rgba(255, 255, 255, 0.72); border-color: rgba(10, 11, 15, 0.08); }
#list .row:hover { background: rgba(255, 255, 255, 0.5); }
#list > li.is-open {
  background: var(--glass-strong); border: var(--glass-edge);
  box-shadow: 0 6px 22px rgba(10, 11, 15, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.cat-ic, .oi, .hchip { background: rgba(255, 255, 255, 0.7); }
.section { border-top-color: rgba(10, 11, 15, 0.07); }
#legend { left: calc(var(--panel-w) + 24px); bottom: 16px; background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: var(--glass-edge); box-shadow: var(--glass-shadow); border-radius: 14px; }
#detail { background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: var(--glass-edge); box-shadow: var(--glass-shadow); border-radius: 22px; }
.mapboxgl-ctrl-group { background: var(--glass) !important; -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: var(--glass-edge) !important; }
.mapboxgl-ctrl-group button + button { border-top-color: rgba(10, 11, 15, 0.08) !important; }

@media (max-width: 760px) {
  #panel { top: 8px; left: 8px; right: 8px; bottom: auto; width: auto; max-height: calc(100dvh - 16px); border-radius: 20px; }
  body.show-list #panel { bottom: 8px; height: auto; }
  body.show-list #map-wrap { display: block; }
  #detail { left: 8px; right: 8px; bottom: 8px; max-height: 62%; border-radius: 22px; }
}
/* Fallback where blur isn't supported: keep panels readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #panel, #detail, #legend { background: rgba(250, 251, 252, 0.96); }
}
.links a { display: inline-flex; align-items: center; gap: 6px; }
.links a svg { flex: none; }

/* Map / List switch: floating pill on phones */
@media (max-width: 760px) {
  #toggle-view {
    position: fixed; z-index: 6; left: 50%; transform: translateX(-50%);
    bottom: calc(22px + env(safe-area-inset-bottom));
    display: inline-flex; align-items: center; gap: 8px;
    padding: 13px 22px; border: 0; border-radius: 999px;
    background: var(--ink); color: #fff; font-weight: 700; font-size: .98rem; letter-spacing: -0.01em;
    box-shadow: 0 10px 30px rgba(10, 11, 15, 0.28), 0 2px 6px rgba(10, 11, 15, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  #toggle-view:active { transform: translateX(-50%) scale(0.97); }
  body.has-detail #toggle-view { display: none !important; }
  body.show-list #list { padding-bottom: 84px; }
}
@media (max-width: 760px) { #app-subtitle { display: none; } .city { margin-top: 6px; } }

/* Let the map run under Safari's toolbars: size it to the large viewport, and match the page
   background to the map so any leftover strip blends in. */
html, body { background: #F5F5F3; }
#map-wrap { top: 0; left: 0; right: 0; bottom: auto; height: 100vh; height: 100lvh; }

/* Switch rows (on/off filters) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.switches { display: flex; flex-direction: column; background: rgba(255,255,255,.66); border: 1px solid rgba(10,11,15,.06); border-radius: 14px; overflow: hidden; margin-bottom: 16px; }
.sw-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px; cursor: pointer; }
.sw-row + .sw-row { border-top: 1px solid rgba(10,11,15,.06); }
.sw-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--soft); color: var(--ink); flex: none; }
.sw-ic svg { width: 15px; height: 15px; }
.sw-label { flex: 1; font-size: .92rem; font-weight: 500; }
.sw-row input { position: absolute; opacity: 0; pointer-events: none; }
.sw { width: 44px; height: 26px; border-radius: 999px; background: #D5D9E0; position: relative; transition: background .18s; flex: none; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(10,11,15,.25); transition: transform .18s; }
.sw-row input:checked ~ .sw { background: var(--accent-fill, var(--accent)); }
.sw-row input:checked ~ .sw::after { transform: translateX(18px); }
.sw-row input:focus-visible ~ .sw { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Help "?" button and icon key */
.top { gap: 12px; }
.help-btn { flex: none; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid rgba(10,11,15,.1); background: rgba(255,255,255,.75); font-weight: 600; font-size: .86rem; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 1px 2px rgba(10,11,15,.06); }
.help-btn[aria-expanded="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
#key-backdrop { position: fixed; inset: 0; z-index: 7; background: rgba(10,11,15,.12); }
#key, #settings {
  position: fixed; z-index: 8; top: 12px; left: calc(var(--panel-w) + 24px); width: 340px; max-height: calc(100dvh - 24px); overflow-y: auto;
  padding: 18px 20px 20px; border-radius: 22px; border: var(--glass-edge);
  background: rgba(250,251,252,.82); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); box-shadow: var(--glass-shadow);
}
#key header, #settings header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
#key h2, #settings h2 { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.03em; }
#key .close, #settings .close { border: 0; background: none; font-size: 1.5rem; line-height: 1; color: var(--muted); width: 36px; height: 36px; }
.k-sec { padding: 12px 0 4px; border-top: 1px solid rgba(10,11,15,.07); }
.k-sec:first-of-type { border-top: 0; }
.k-sec h3 { margin: 0 0 8px; font-family: var(--mono); font-weight: 500; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.k-note { margin: -2px 0 8px; font-size: .8rem; color: var(--muted); }
.k-sec ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.k-sec li { display: flex; align-items: center; gap: 8px; font-size: .86rem; }
.k-ic { flex: none; display: grid; place-items: center; min-width: 26px; height: 26px; border-radius: 8px; background: rgba(255,255,255,.8); }
.k-ic svg { width: 15px; height: 15px; }
.k-ic .oi, .k-ic .hchip { background: transparent; }
@media (max-width: 760px) {
  #key, #settings { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 75dvh; }
}

/* Text attribute chips in list rows */
.achip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 6px; background: rgba(255,255,255,.7); font-size: .72rem; font-weight: 500; color: var(--ink); white-space: nowrap; }
.achip svg { width: 12px; height: 12px; }
.achip.is-open { color: var(--open); }
.achip.is-closed { color: var(--closed); }

/* Map/List pill: dark glass, calm next to the orange accents */
@media (max-width: 760px) {
  #toggle-view {
    background: rgba(10, 11, 15, 0.82);
    -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 10px 30px rgba(10, 11, 15, 0.28), 0 2px 6px rgba(10, 11, 15, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    color: #fff;
  }
}

/* The map runs under Safari's toolbars (100lvh), so anything pinned to the bottom must use the
   visible area instead: fixed positioning for the sheet, and lift Mapbox's logo/attribution by
   the hidden toolbar height (100lvh - 100dvh). */
@media (max-width: 760px) {
  #detail { position: fixed; z-index: 4; bottom: calc(8px + env(safe-area-inset-bottom)); max-height: min(62dvh, 560px); overflow-y: auto; overscroll-behavior: contain; }
  .mapboxgl-ctrl-bottom-left, .mapboxgl-ctrl-bottom-right { bottom: calc(100lvh - 100dvh); }
}

/* Near me */
#near {
  flex: none; width: 44px; display: grid; place-items: center; padding: 0;
  border: 1px solid rgba(10,11,15,.08); border-radius: 10px; background: rgba(255,255,255,.72); color: var(--ink);
}
#near svg { color: var(--accent); }
#near.is-on { background: var(--accent-fill, var(--accent)); border-color: var(--accent-fill, var(--accent)); }
#near.is-on svg { color: #fff; }
#near.is-busy svg { animation: near-pulse 1s ease-in-out infinite; }
@keyframes near-pulse { 50% { opacity: .35; } }
.dist { flex: none; font-family: var(--mono); font-size: .72rem; color: var(--muted); }
@media (max-width: 760px) {
}

/* Active filters: badge on the button + a clear bar */
.fbadge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 7px; padding: 0 6px; border-radius: 999px; background: var(--accent-fill, var(--accent)); color: #fff; font-family: var(--mono); font-size: .72rem; font-weight: 700; }
#toggle-filters { display: inline-flex; align-items: center; }
#toggle-filters.has-active { border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
#toggle-filters[aria-expanded="true"] .fbadge { background: #fff; color: var(--ink); }
#activebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -2px 18px 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 10%, rgba(255,255,255,.7)); font-size: .82rem; font-weight: 500; }
#activebar[hidden] { display: none; }
#active-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#clear { flex: none; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--ink); color: #fff; font-weight: 600; font-size: .8rem; }

/* Header buttons + settings */
.hdr-btns { display: flex; gap: 6px; flex: none; }
.help-btn.icon-only { width: 34px; padding: 0; justify-content: center; }
#settings-btn[aria-expanded="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: rgba(10,11,15,.06); }
.seg button { height: 38px; border: 0; border-radius: 9px; background: none; font-weight: 600; font-size: .88rem; }
.seg button[aria-checked="true"] { background: #fff; box-shadow: 0 1px 4px rgba(10,11,15,.14); }

/* ---------- Dark mode ---------- */
[data-theme="dark"] {
  --ink: #ECEEF2;
  --muted: #9AA1AE;
  --line: rgba(255,255,255,.10);
  --bg: #0B0D12;
  --soft: rgba(255,255,255,.07);
  --open: #51CF66;
  --closed: #FF6B6B;
  --glass: rgba(22, 24, 30, 0.66);
  --glass-strong: rgba(34, 37, 45, 0.78);
  --glass-edge: 1px solid rgba(255, 255, 255, 0.10);
  --glass-shadow: 0 12px 40px rgba(0,0,0,.45), 0 2px 6px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.08);
  color-scheme: dark;
}
[data-theme="dark"] html, [data-theme="dark"] body, html[data-theme="dark"], html[data-theme="dark"] body { background: #0B0D12; }
[data-theme="dark"] #search, [data-theme="dark"] #toggle-filters, [data-theme="dark"] .chip, [data-theme="dark"] .ghost,
[data-theme="dark"] .help-btn, [data-theme="dark"] #near { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.10); color: var(--ink); }
[data-theme="dark"] #search::placeholder { color: #7D8492; }
[data-theme="dark"] .cat-ic, [data-theme="dark"] .oi, [data-theme="dark"] .hchip, [data-theme="dark"] .achip, [data-theme="dark"] .k-ic, [data-theme="dark"] .tag { background: rgba(255,255,255,.08); color: var(--ink); }
[data-theme="dark"] .ci { color: #9AA1AE; }
[data-theme="dark"] #list .row:hover { background: rgba(255,255,255,.05); }
[data-theme="dark"] .links a { background: #ECEEF2; color: #0A0B0F; }
[data-theme="dark"] .links a:first-child { background: var(--accent-fill, var(--accent)); color: #fff; }
[data-theme="dark"] .links a.ghost-link { background: rgba(255,255,255,.08); color: var(--ink); border-color: rgba(255,255,255,.12); }
[data-theme="dark"] #toggle-filters[aria-expanded="true"], [data-theme="dark"] .help-btn[aria-expanded="true"], [data-theme="dark"] #clear { background: #ECEEF2; color: #0A0B0F; border-color: #ECEEF2; }
[data-theme="dark"] #toggle-filters[aria-expanded="true"] .fbadge { background: var(--accent-fill, var(--accent)); color: #fff; }
[data-theme="dark"] #activebar { background: color-mix(in srgb, var(--accent) 18%, rgba(22,24,30,.7)); }
[data-theme="dark"] .section, [data-theme="dark"] .k-sec, [data-theme="dark"] #panel footer, [data-theme="dark"] #filters { border-color: rgba(255,255,255,.08); }
[data-theme="dark"] .hours summary { border-top-color: rgba(255,255,255,.08); }
[data-theme="dark"] #key, [data-theme="dark"] #settings { background: rgba(22,24,30,.84); }
[data-theme="dark"] #key-backdrop { background: rgba(0,0,0,.35); }
[data-theme="dark"] .seg { background: rgba(255,255,255,.07); }
[data-theme="dark"] .seg button[aria-checked="true"] { background: rgba(255,255,255,.16); box-shadow: none; }
[data-theme="dark"] .mapboxgl-ctrl-group button .mapboxgl-ctrl-icon { filter: invert(1); }
[data-theme="dark"] #toggle-view { background: rgba(236, 238, 242, 0.88); color: #0A0B0F; border-color: rgba(255,255,255,.4); }

/* You-are-here dot */
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #2E6BFF; border: 3px solid #fff; box-shadow: 0 0 0 0 rgba(46,107,255,.45), 0 2px 6px rgba(10,11,15,.3); animation: me-pulse 2s ease-out infinite; }
@keyframes me-pulse { 0% { box-shadow: 0 0 0 0 rgba(46,107,255,.45), 0 2px 6px rgba(10,11,15,.3); } 100% { box-shadow: 0 0 0 18px rgba(46,107,255,0), 0 2px 6px rgba(10,11,15,.3); } }

/* Reset view (bottom-left, appears after the map is moved) */
#reset-view {
  position: fixed; z-index: 5; left: calc(var(--panel-w) + 24px); bottom: 16px;
  display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 15px 0 12px; border-radius: 999px;
  border: var(--glass-edge); background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow); font-weight: 600; font-size: .88rem; color: var(--ink);
}
#reset-view[hidden] { display: none; }
#legend { left: auto; right: 12px; bottom: 44px; }
@media (max-width: 760px) {
  #reset-view { left: 12px; bottom: calc(22px + env(safe-area-inset-bottom)); height: 50px; padding: 0 16px 0 14px; }
  #reset-view span { display: none; }
  #reset-view { width: 50px; padding: 0; justify-content: center; }
  body.show-list #reset-view, body.has-detail #reset-view { display: none; }
}

/* Expanded card: flat and quiet, no glowing top edge */
#list > li.is-open { border: 1px solid rgba(10, 11, 15, 0.06); box-shadow: 0 4px 16px rgba(10, 11, 15, 0.06); }
[data-theme="dark"] #list > li.is-open { background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.05); box-shadow: none; }

/* New in town + score trend */
.achip.new { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); font-weight: 700; }
.trend { font-style: normal; font-size: .58rem; margin-left: 2px; }
.trend.up { color: var(--open); }
.trend.down { color: var(--closed); }
.htrail { margin-left: auto; font-family: var(--mono); font-size: .76rem; color: var(--ink); display: inline-flex; gap: 4px; align-items: center; }
.htrail .arr { color: var(--muted); }

/* Credit (matches Armchair: muted line, only the name is a link) */
.credit { display: block; margin-top: 4px; color: var(--muted); white-space: nowrap; }
.credit a { color: var(--ink); text-decoration: none; font-weight: 500; }
.credit a:hover { color: var(--accent); }
.about p { margin: 0 0 10px; font-size: .86rem; line-height: 1.5; color: var(--muted); }
.about .fine { font-size: .72rem; margin: 10px 0 0; }
.about .fine.credit { margin-top: 6px; }

/* Toast */
#toast {
  position: fixed; z-index: 9; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px);
  max-width: min(92vw, 420px); padding: 11px 16px; border-radius: 14px;
  background: rgba(10, 11, 15, 0.86); color: #fff; font-size: .86rem; line-height: 1.4; text-align: center;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: 0 10px 30px rgba(10,11,15,.25);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 761px) { #toast { bottom: 24px; left: calc(50% + var(--panel-w) / 2); } }
[data-theme="dark"] #toast { background: rgba(236,238,242,.92); color: #0A0B0F; }

/* ---------- Help me pick ---------- */
#decide-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 0 18px 10px; height: 44px; border-radius: 12px; border: 0;
  background: color-mix(in srgb, var(--accent) 12%, rgba(255,255,255,.75)); color: var(--accent);
  font-weight: 700; font-size: .95rem; letter-spacing: -0.01em;
}
#decide-btn[hidden] { display: none; }
#decide-btn:hover { background: color-mix(in srgb, var(--accent) 18%, rgba(255,255,255,.8)); }
[data-theme="dark"] #decide-btn { background: color-mix(in srgb, var(--accent) 20%, rgba(22,24,30,.6)); }

#decide {
  position: fixed; z-index: 10; inset: 12px auto 12px calc(var(--panel-w) + 24px); width: 420px;
  display: flex; flex-direction: column; border-radius: 24px; overflow: hidden;
  border: var(--glass-edge); background: rgba(246, 247, 249, 0.9); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
}
#decide[hidden] { display: none; }
[data-theme="dark"] #decide { background: rgba(18, 20, 26, 0.9); }
@media (max-width: 760px) { #decide { inset: 8px; width: auto; } body.deciding #toggle-view { display: none !important; } }
.dc-top { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; padding: 10px 10px 0; }
.dc-top h2 { margin: 0; text-align: center; font-size: 1rem; font-weight: 800; letter-spacing: -0.02em; }
.dc-icon { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; display: grid; place-items: center; color: var(--ink); }
.dc-icon:hover { background: var(--soft); }
.dc-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 22px 22px; overflow-y: auto; }
.dc-dots { display: flex; gap: 6px; justify-content: center; margin: 6px 0 14px; }
.dc-dots i { width: 28px; height: 4px; border-radius: 999px; background: rgba(10,11,15,.12); }
.dc-dots i.on { background: var(--accent-fill, var(--accent)); }
[data-theme="dark"] .dc-dots i { background: rgba(255,255,255,.14); }
[data-theme="dark"] .dc-dots i.on { background: var(--accent-fill, var(--accent)); }
.dc-count { margin: 0; text-align: center; font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.dc-q { margin: 6px 0 18px; text-align: center; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.1; }
.dc-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dc-opt {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 14px; min-height: 92px;
  padding: 14px; border-radius: 16px; border: 1px solid rgba(10,11,15,.06); background: rgba(255,255,255,.85); text-align: left;
  font-weight: 650; font-size: .95rem; letter-spacing: -0.01em; transition: transform .12s, border-color .12s;
}
.dc-opt:active { transform: scale(.97); }
.dc-opt:hover, .dc-opt.is-on { border-color: var(--accent-fill, var(--accent)); }
.dc-opts .dc-opt:not(:has(.dc-oi)) { min-height: 64px; justify-content: center; }
.dc-oi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.dc-oi svg, .dc-oi .oi { width: 18px; height: 18px; background: transparent; }
[data-theme="dark"] .dc-opt { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.08); }
.dc-wait { margin: auto; color: var(--muted); }

.dc-stack { position: relative; flex: 1; min-height: 380px; max-height: 520px; margin-top: 6px; }
.dc-card {
  position: absolute; inset: 0; display: flex; flex-direction: column; padding: 22px; border-radius: 22px;
  background: #fff; border: 1px solid rgba(10,11,15,.06); box-shadow: 0 10px 30px rgba(10,11,15,.10);
  transform: translateY(calc(var(--i) * 10px)) scale(calc(1 - var(--i) * 0.04)); transform-origin: 50% 0;
  transition: transform .22s ease, opacity .22s ease; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab;
}
.dc-card.dragging { transition: none; cursor: grabbing; }
.dc-card.out-right { transform: translateX(120%) !important; opacity: 0; }
.dc-card.out-left { transform: translateX(-120%) !important; opacity: 0; }
.dc-card.static { position: relative; inset: auto; transform: none; cursor: default; }
[data-theme="dark"] .dc-card { background: #1C1F26; border-color: rgba(255,255,255,.07); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.dc-hero { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.dc-why { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.dc-why li { display: flex; align-items: center; gap: 10px; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }

.dc-card .dc-name { margin-top: 14px; }
.dc-hero svg { width: 30px; height: 30px; }
.dc-name { margin: 24px 0 4px; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.04em; line-height: 1.08; }
.dc-sub { margin: 0 0 4px; color: var(--muted); font-size: .92rem; }
.dc-addr { margin: 0 0 12px; color: var(--muted); font-size: .84rem; }
.dc-chips { gap: 6px; }
.dc-stamp { position: absolute; top: 22px; padding: 6px 12px; border-radius: 10px; font-weight: 800; font-size: 1rem; letter-spacing: .02em; opacity: 0; border: 2.5px solid; }
.dc-stamp.yes { right: 22px; color: var(--open); opacity: var(--yes, 0); }
.dc-stamp.no { right: 22px; color: var(--muted); opacity: var(--no, 0); }
.dc-actions { display: flex; align-items: center; justify-content: center; gap: 28px; padding-top: 22px; }
.dc-left { font-family: var(--mono); font-size: .72rem; color: var(--muted); min-width: 56px; text-align: center; }
.dc-round { width: 64px; height: 64px; border-radius: 50%; border: 0; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(10,11,15,.12); }
.dc-round.no { background: #fff; color: var(--ink); }
.dc-round.yes { background: var(--accent-fill, var(--accent)); color: #fff; }
.dc-round:active { transform: scale(.94); }
[data-theme="dark"] .dc-round.no { background: rgba(255,255,255,.1); }

.dc-match { display: flex; flex-direction: column; gap: 14px; }
.dc-match .dc-card { min-height: 260px; }
.dc-match-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dc-primary, .dc-secondary { display: grid; place-items: center; height: 50px; border-radius: 14px; font-weight: 700; text-decoration: none; border: 0; font-size: .95rem; }
.dc-primary { background: var(--accent-fill, var(--accent)); color: #fff; }
.dc-secondary { background: var(--ink); color: var(--bg, #fff); }
[data-theme="dark"] .dc-secondary { background: #ECEEF2; color: #0A0B0F; }
.dc-link { border: 0; background: none; color: var(--muted); font-weight: 600; padding: 10px; }
.dc-empty { margin: auto; text-align: center; }
.dc-empty p { color: var(--muted); }
.dc-empty .dc-primary { margin-top: 14px; padding: 0 22px; }

/* Swipe guidance */
.dc-hint { display: flex; justify-content: space-between; margin: 14px 4px 0; font-size: .8rem; font-weight: 600; }
.dc-hint span:first-child { color: var(--muted); }
.dc-hint span:last-child { color: var(--open); }
.dc-act { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dc-act > span { font-size: .78rem; font-weight: 600; color: var(--muted); }
.dc-actions { padding-top: 14px; }
.dc-card.demo { animation: dc-demo 1.6s ease-in-out 1; }
@keyframes dc-demo {
  0%, 100% { transform: none; --no: 0; --yes: 0; }
  20% { transform: translateX(-34px); --no: .9; --yes: 0; }
  40% { transform: none; --no: 0; --yes: 0; }
  62% { transform: translateX(34px); --yes: .9; --no: 0; }
  82% { transform: none; --no: 0; --yes: 0; }
}
@property --yes { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --no { syntax: '<number>'; inherits: true; initial-value: 0; }

/* Level swipe: tint the card edge toward the decision instead of tilting it */
.dc-card { box-shadow: 0 10px 30px rgba(10,11,15,.10), inset 0 0 0 calc(var(--yes, 0) * 2.5px) var(--open), inset 0 0 0 calc(var(--no, 0) * 2.5px) var(--muted); }
[data-theme="dark"] .dc-card { box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 0 0 calc(var(--yes, 0) * 2.5px) var(--open), inset 0 0 0 calc(var(--no, 0) * 2.5px) var(--muted); }

/* Card visual: map preview with the type icon on top */
.dc-card { padding: 0 0 20px; overflow: hidden; }
.dc-card > *:not(.dc-visual):not(.dc-stamp) { margin-left: 20px; margin-right: 20px; }
.dc-visual { position: relative; height: 150px; background: var(--soft); flex: none; }
.dc-map { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.dc-visual .dc-hero { position: absolute; left: 16px; bottom: -22px; width: 56px; height: 56px; border-radius: 16px; background: #fff; box-shadow: 0 4px 14px rgba(10,11,15,.14); }
.dc-visual .dc-hero::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: color-mix(in srgb, var(--c) 14%, transparent); }
.dc-visual .dc-hero svg { position: relative; width: 26px; height: 26px; }
[data-theme="dark"] .dc-visual .dc-hero { background: #1C1F26; }
.dc-card .dc-why { margin-top: 34px; }
.dc-card .dc-stamp { top: 14px; }
.dc-card.enter { animation: dc-enter .25s ease both; }
@keyframes dc-enter { from { opacity: 0; } to { opacity: 1; } }
.dc-match .dc-card { min-height: 0; }

/* Deck v2: next/back navigation, actions on the card */
.dc-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.dc-card-actions .dc-primary, .dc-card-actions .dc-secondary { height: 44px; font-size: .9rem; border-radius: 12px; }
.dc-card .dc-chips { margin-top: 10px; }
.dc-card .dc-why { margin-top: 32px; }
.dc-stack { min-height: 0; max-height: none; flex: none; height: 470px; }
.dc-actions { justify-content: space-between; gap: 12px; padding-top: 14px; }
.dc-nav { display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px; border-radius: 999px; border: 1px solid rgba(10,11,15,.08); background: rgba(255,255,255,.85); font-weight: 700; font-size: .95rem; color: var(--ink); }
.dc-nav.next { background: var(--ink); color: #fff; border-color: var(--ink); }
.dc-nav:disabled { opacity: .35; }
[data-theme="dark"] .dc-nav { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.1); }
[data-theme="dark"] .dc-nav.next { background: #ECEEF2; color: #0A0B0F; }
.dc-hint span:last-child { color: var(--muted); }
.dc-hint span:first-child { color: var(--ink); }
.dc-card.out-right { transform: translateX(120%) !important; opacity: 0; }
.dc-card.enter-left { animation: dc-enter-left .22s ease both; }
@keyframes dc-enter-left { from { transform: translateX(-60%); opacity: 0; } to { transform: none; opacity: 1; } }
.dc-card { box-shadow: 0 10px 30px rgba(10,11,15,.10); }
[data-theme="dark"] .dc-card { box-shadow: 0 10px 30px rgba(0,0,0,.4); }
@media (max-height: 760px) { .dc-stack { height: 420px; } .dc-visual { height: 120px; } }
#decide[data-view="deck"] .dc-body { justify-content: center; }

/* Deck v3: cards stack in one grid cell so the deck sizes to the card (no clipping, no gap) */
.dc-stack { display: grid; height: auto !important; min-height: 0; max-height: none; flex: none; }
.dc-stack > .dc-card { grid-area: 1 / 1; position: relative; inset: auto; }
#decide[data-view="deck"] .dc-body { justify-content: center; gap: 0; }
.dc-card { padding-bottom: 18px; }
.dc-card .dc-why { margin-top: 34px; gap: 10px; }
.dc-why li { font-size: .98rem; }
.dc-wi { flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--soft); color: var(--ink); }
.dc-wi svg { width: 15px; height: 15px; }
.dc-wi .oi { background: transparent; width: 15px; height: 15px; }
.dc-card .dc-name { margin-top: 16px; font-size: 1.55rem; }
.dc-card .dc-addr { margin-bottom: 0; }
.dc-card .dc-chips { margin-top: 12px; }
.dc-card-actions { margin-top: 16px; }
.dc-actions { padding-top: 16px; }
.dc-visual { height: 132px; }

/* Deck v4: one fixed card size, fixed slots, smooth hand-off */
.dc-stack { display: grid; height: clamp(430px, 60dvh, 540px) !important; --p: 0; }
.dc-stack > .dc-card {
  grid-area: 1 / 1; position: relative; inset: auto; height: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; padding: 0 0 18px;
  --k: max(0, calc(var(--i) - var(--p)));
  transform: translate3d(0, calc(var(--k) * 10px), 0) scale(calc(1 - var(--k) * 0.04));
  transition: transform .26s cubic-bezier(.2,.8,.2,1), opacity .26s ease; will-change: transform;
}
.dc-stack.dragging > .dc-card:not(.is-top) { transition: none; }
.dc-stack > .dc-card.dragging { transition: none; }
.dc-stack > .dc-card.out-left { transform: translate3d(-115%, 0, 0) !important; opacity: 0; }
.dc-stack > .dc-card.out-right { transform: translate3d(115%, 0, 0) !important; opacity: 0; }
.dc-visual { height: 128px; flex: none; }
.dc-main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 34px 20px 0; overflow: hidden; }
.dc-main .dc-name { margin: 0 0 4px; font-size: 1.5rem; line-height: 1.1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dc-main .dc-sub { margin: 0; font-size: .86rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-main .dc-chips { margin-top: 10px; }
.dc-main .dc-why { margin: 14px 0 0; gap: 8px; }
.dc-main .dc-why li { font-size: .94rem; }
.dc-card .dc-card-actions { margin: auto 20px 0; padding-top: 12px; }
.dc-card > *:not(.dc-visual):not(.dc-stamp):not(.dc-main) { margin-left: 20px; margin-right: 20px; }

.dc-stack > .dc-card > .dc-main { margin: 0; }

/* Header buttons: icon-only on phones, labeled on desktop */
.help-btn .lbl { display: none; }
@media (min-width: 761px) {
  .help-btn .lbl { display: inline; }
  .help-btn.icon-only { width: auto; padding: 0 12px 0 10px; }
}
@media (max-width: 760px) {
  #help { width: 34px; padding: 0; justify-content: center; }
}

/* Deck v5: stable height, reserved hint space, back card slides in from the left */
.dc-stack { height: clamp(430px, 60vh, 540px) !important; }
@supports (height: 1svh) { .dc-stack { height: clamp(430px, 60svh, 540px) !important; } }
.dc-hint { transition: opacity .25s; }
.dc-hint.done { opacity: 0; }
.dc-stack > .dc-card.is-prev { transition: none; box-shadow: 0 16px 40px rgba(10,11,15,.22); }
.dc-stack > .dc-card.is-prev.settling { transition: transform .26s cubic-bezier(.2,.8,.2,1); }
[data-theme="dark"] .dc-stack > .dc-card.is-prev { box-shadow: 0 16px 40px rgba(0,0,0,.55); }

/* Gentler finish: slightly longer, soft deceleration, fade starts a beat later */
.dc-stack { --dc-dur: .42s; --dc-ease: cubic-bezier(.16, 1, .3, 1); }
.dc-stack > .dc-card { transition: transform var(--dc-dur) var(--dc-ease), opacity calc(var(--dc-dur) * .8) ease calc(var(--dc-dur) * .2); }
.dc-stack > .dc-card.is-prev.settling { transition: transform var(--dc-dur) var(--dc-ease); }
.dc-stack.dragging > .dc-card:not(.is-top), .dc-stack > .dc-card.dragging, .dc-stack > .dc-card.is-prev:not(.settling) { transition: none; }

/* Home-screen app: clear the notch / Dynamic Island and the home indicator */
#panel { top: calc(12px + env(safe-area-inset-top)); }
#decide { top: calc(12px + env(safe-area-inset-top)); bottom: calc(12px + env(safe-area-inset-bottom)); }
#key, #settings { top: calc(12px + env(safe-area-inset-top)); }
@media (max-width: 760px) {
  #panel { top: calc(8px + env(safe-area-inset-top)); left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right)); }
  body.show-list #panel { bottom: calc(8px + env(safe-area-inset-bottom)); }
  #decide { top: calc(8px + env(safe-area-inset-top)); bottom: calc(8px + env(safe-area-inset-bottom)); }
  #key, #settings { top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); }
  .standalone .mapboxgl-ctrl-bottom-left, .standalone .mapboxgl-ctrl-bottom-right { bottom: env(safe-area-inset-bottom); }
}
.install p { margin: 0; font-size: .86rem; line-height: 1.5; color: var(--muted); }
.install svg { vertical-align: -2px; color: var(--accent); }
.install b { color: var(--ink); }

/* Desktop hover pin: grows smoothly with a name label */
.pin-hover { display: flex; align-items: flex-end; gap: 6px; pointer-events: none; }
.pin-hover .ph-pin { width: 22px; height: 22px; transform-origin: 0 100%; transform: scale(.85); transition: transform .18s cubic-bezier(.2,.9,.3,1.3); filter: drop-shadow(0 3px 6px rgba(10,11,15,.3)); }
.pin-hover .ph-pin svg { width: 100%; height: 100%; display: block; }
.pin-hover .ph-label {
  margin-bottom: 14px; padding: 4px 9px; border-radius: 8px; white-space: nowrap; font-size: .8rem; font-weight: 650; letter-spacing: -0.01em;
  background: var(--glass-strong, rgba(255,255,255,.9)); color: var(--ink); border: 1px solid rgba(10,11,15,.08);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 4px 14px rgba(10,11,15,.14);
  opacity: 0; transform: translateX(-4px); transition: opacity .15s ease, transform .15s ease;
}
.pin-hover:not(.show) { visibility: hidden; transition: visibility 0s .18s; }
.pin-hover.show .ph-pin { transform: scale(1.3); }
.pin-hover.show .ph-label { opacity: 1; transform: none; }
.pin-hover.no-label .ph-label { display: none; }
[data-theme="dark"] .pin-hover .ph-label { background: rgba(28,31,38,.9); border-color: rgba(255,255,255,.1); }

/* Click popup: small glass label card above the pin */
.ok-popup .mapboxgl-popup-content {
  padding: 10px 12px 11px; border-radius: 14px; font-family: inherit; color: var(--ink);
  background: rgba(250,251,252,.88); -webkit-backdrop-filter: blur(18px) saturate(1.6); backdrop-filter: blur(18px) saturate(1.6);
  border: 1px solid rgba(10,11,15,.08); box-shadow: 0 10px 30px rgba(10,11,15,.18);
  animation: pp-in .18s ease both;
}
.ok-popup .mapboxgl-popup-tip { display: none; }
@keyframes pp-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.pp-eyebrow { display: flex; align-items: center; gap: 6px; margin: 0 0 2px; font-family: var(--mono); font-size: .62rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.pp-name { margin: 0; font-size: .98rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.pp-meta { margin-top: 6px; }
[data-theme="dark"] .ok-popup .mapboxgl-popup-content { background: rgba(22,24,30,.88); border-color: rgba(255,255,255,.1); box-shadow: 0 10px 30px rgba(0,0,0,.45); }
