/* ---------- tokens ---------- */
:root {
  --font: "PingFang TC", "Noto Sans TC", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ink: #1c2430;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --surface: #ffffff;
  --surface-2: #f3f4f6;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --accent: #e8622a;
  --accent-ink: #b44616;
  --accent-soft: #fdece4;
  --focus: #2563eb;
  --sel: #e8622a33;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.1);
  --shadow-2: 0 4px 6px -1px rgba(16, 24, 40, 0.08), 0 10px 24px -6px rgba(16, 24, 40, 0.16);
  --shadow-3: 0 12px 32px -8px rgba(16, 24, 40, 0.28), 0 2px 6px rgba(16, 24, 40, 0.08);
  --r: 12px;
  --r-s: 8px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --w: 400px;
}
:root[data-theme="dark"] {
  --ink: #eceef1;
  --ink-2: #c3c8d1;
  --ink-3: #98a0ad;
  --surface: #1c1f24;
  --surface-2: #272b32;
  --line: #2f343c;
  --line-2: #3c424c;
  --accent: #f0794a;
  --accent-ink: #ffa27a;
  --accent-soft: #3a261d;
  --focus: #7aa2ff;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 10px 24px -6px rgba(0, 0, 0, 0.6);
  --shadow-3: 0 12px 32px -8px rgba(0, 0, 0, 0.7), 0 2px 6px rgba(0, 0, 0, 0.4);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body { font-family: var(--font); color: var(--ink); background: #e2dfda; font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
:root[data-theme="dark"] body { background: #2a2c31; }
::selection { background: var(--sel); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
#map { position: absolute; inset: 0; }
#map:focus-visible { outline: none; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- search ---------- */
.search {
  position: absolute; top: 12px; left: 12px; z-index: 20;
  width: var(--w); max-width: calc(100vw - 24px);
  display: flex; flex-direction: column; gap: 8px;
}
.search-bar {
  position: relative; display: flex; align-items: center; gap: 2px;
  height: 48px; padding: 0 6px 0 6px;
  background: var(--surface); border-radius: var(--r);
  box-shadow: var(--shadow-2); border: 1px solid transparent;
  transition: box-shadow 180ms var(--ease), border-color 180ms var(--ease);
}
.search-bar:focus-within { border-color: var(--line-2); box-shadow: var(--shadow-3); }
.search.open .search-bar { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.brand { all: unset; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; cursor: pointer; }
.brand:hover .brand-mark { transform: translateY(-1px); }
.brand:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 17px; line-height: 1;
  transition: transform 160ms var(--ease);
}
.q {
  flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 15px; padding: 0 6px; outline: none; caret-color: var(--accent);
}
.q::placeholder { color: var(--ink-3); }
.q::-webkit-search-cancel-button { display: none; }
.ib {
  all: unset; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  color: var(--ink-2); cursor: pointer; transition: background 120ms var(--ease), color 120ms var(--ease);
}
.ib:hover { background: var(--surface-2); color: var(--ink); }
.ib:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ib-accent { color: var(--accent); }
.ib-accent:hover { background: var(--accent-soft); color: var(--accent-ink); }
.progress {
  position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 40% 100%; background-repeat: no-repeat; opacity: 0; transition: opacity 120ms;
}
.search.loading .progress { opacity: 1; animation: slide 900ms linear infinite; }
@keyframes slide { from { background-position: -40% 0; } to { background-position: 140% 0; } }

.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  all: unset; flex: none; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px;
  border-radius: 999px; background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-1);
  font-size: 13px; cursor: pointer; white-space: nowrap; border: 1px solid transparent;
  transition: background 120ms, color 120ms, border-color 120ms, transform 160ms var(--ease);
}
.chip svg { width: 16px; height: 16px; }
.chip:hover { color: var(--ink); border-color: var(--line-2); }
.chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.chip.active { background: var(--accent); color: #fff; }
.search.open .chips { display: none; }

.panel {
  margin-top: -8px; background: var(--surface); border-radius: 0 0 var(--r) var(--r);
  box-shadow: var(--shadow-3); border-top: 1px solid var(--line);
  max-height: min(60vh, 520px); display: flex; flex-direction: column;
  animation: pop 160ms var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.results { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.results::-webkit-scrollbar { width: 8px; }
.results::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 2px solid var(--surface); }
.res {
  display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px;
  padding: 8px 14px 8px 12px; cursor: pointer; min-height: 52px;
}
.res:hover, .res[aria-selected="true"] { background: var(--surface-2); }
.res[aria-selected="true"] .res-ic { background: var(--accent-soft); color: var(--accent-ink); }
.res-ic {
  width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2);
  display: grid; place-items: center;
}
.res-ic svg { width: 18px; height: 18px; }
.res-main { min-width: 0; }
.res-name { display: block; font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-name mark { background: transparent; color: var(--ink); font-weight: 700; }
.res-sub { display: block; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.res-sub b { font-weight: 500; color: var(--ink-2); }
.res-dist { font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.res-empty { padding: 22px 16px 20px; text-align: center; color: var(--ink-2); }
.res-empty strong { color: var(--ink); font-weight: 600; }
.res-empty small { display: block; margin-top: 6px; color: var(--ink-3); font-size: 12.5px; }
.panel-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3);
}
.panel-foot:empty { display: none; }
.panel-foot kbd {
  font: inherit; font-size: 11px; padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line-2);
  background: var(--surface-2); color: var(--ink-2); margin: 0 1px;
}

/* ---------- directions ---------- */
.route {
  position: absolute; top: 12px; left: 12px; z-index: 20; width: var(--w); max-width: calc(100vw - 24px);
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; max-height: calc(100vh - 24px); animation: pop 160ms var(--ease);
}
.route-head { display: flex; align-items: center; gap: 6px; padding: 8px 8px 0; }
.seg { display: inline-flex; margin: 0 auto; background: var(--surface-2); border-radius: 999px; padding: 3px; gap: 2px; }
.seg-b { all: unset; height: 28px; padding: 0 14px; border-radius: 999px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg-b[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 600; }
.seg-b:focus-visible { outline: 2px solid var(--focus); }
.ib-sm { width: 30px; height: 30px; }
.route-stops { position: relative; padding: 10px 10px 6px 10px; display: flex; flex-direction: column; gap: 6px; }
.route-stops::before { content: ""; position: absolute; left: 21px; top: 34px; bottom: 30px; border-left: 2px dotted var(--line-2); }
.stop { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 4px 0 6px; border-radius: var(--r-s); background: var(--surface-2); border: 1px solid transparent; transition: border-color 120ms, background 120ms; }
.stop:focus-within { border-color: var(--accent); background: var(--surface); }
.stop-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; box-sizing: border-box; }
.stop-a { border: 3px solid var(--ink-2); background: var(--surface); }
.stop-b { background: var(--accent); border: 3px solid var(--accent); }
.stop-in { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; outline: none; height: 100%; caret-color: var(--accent); }
.stop-in::placeholder { color: var(--ink-3); }
.stop-in::-webkit-search-cancel-button { display: none; }
.route-sugg { border-top: 1px solid var(--line); max-height: 260px; }
.route-hint { padding: 6px 14px 12px; font-size: 12.5px; color: var(--ink-3); }
.route-sum { padding: 10px 14px 12px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.route-kpi { display: flex; align-items: baseline; gap: 10px; }
.route-time { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.route-dist { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.route-via { font-size: 12.5px; color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--accent-ink); padding: 0 6px; height: 28px; align-self: flex-start; margin-top: 2px; }
.btn-ghost:hover { background: var(--accent-soft); }
.steps { list-style: none; margin: 0; padding: 4px 0 8px; overflow-y: auto; border-top: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.step { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 8px 14px; font-size: 13px; }
.step + .step { border-top: 1px solid var(--line); }
.step-ic { color: var(--ink-2); display: grid; place-items: center; height: 20px; }
.step-ic svg { width: 18px; height: 18px; }
.step-txt b { font-weight: 600; }
.step-dist { color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; padding-top: 1px; }
.route-err { padding: 10px 14px 12px; color: var(--ink-2); font-size: 13px; border-top: 1px solid var(--line); }
.mk-ab { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.3); border: 2px solid #fff; animation: drop 420ms var(--ease); }
.mk-a { background: #1c2430; }
.mk-b { background: var(--accent); }

/* ---------- toolbar + maplibre controls ---------- */
.toolbar { position: absolute; top: 12px; right: 12px; z-index: 10; display: flex; flex-direction: column; gap: 6px; }
.tb {
  all: unset; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow-2); cursor: pointer;
  transition: color 120ms, background 120ms, transform 160ms var(--ease);
}
.tb:hover { color: var(--ink); }
.tb:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.tb[aria-pressed="true"] { background: var(--accent); color: #fff; }
.maplibregl-ctrl-top-right { top: 150px; right: 2px; }
.maplibregl-ctrl-top-right .maplibregl-ctrl { margin: 0 10px 8px 0; }
.maplibregl-ctrl-group { border-radius: 10px; box-shadow: var(--shadow-2) !important; background: var(--surface); overflow: hidden; }
.maplibregl-ctrl-group button { width: 40px; height: 40px; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--line); }
:root[data-theme="dark"] .maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(0.9); }
.maplibregl-ctrl-group button:hover { background: var(--surface-2); }
.maplibregl-ctrl-group button:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-scale {
  font-family: var(--font); font-size: 11px; color: var(--ink-2); background: color-mix(in srgb, var(--surface) 80%, transparent);
  border-color: var(--ink-3); border-width: 0 1.5px 1.5px; border-radius: 0 0 3px 3px;
}
.maplibregl-ctrl-attrib { font-family: var(--font); font-size: 11px; background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--ink-2); border-radius: 6px 0 0 0; }
.maplibregl-ctrl-attrib a { color: var(--ink-2); }
:root[data-theme="dark"] .maplibregl-ctrl-attrib a { color: var(--ink-2); }

/* ---------- popups (reverse geocode / poi) ---------- */
.maplibregl-popup { font-family: var(--font); max-width: 300px !important; }
.maplibregl-popup-content { border-radius: var(--r); padding: 0; box-shadow: var(--shadow-3); background: var(--surface); color: var(--ink); overflow: hidden; }
.maplibregl-popup-close-button { display: none; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--surface); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--surface); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--surface); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--surface); }
.pp { padding: 12px 14px 10px; min-width: 220px; }
.pp-label { font-size: 14.5px; font-weight: 600; line-height: 1.35; }
.pp-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.pp-coord { font-size: 12px; color: var(--ink-3); margin-top: 6px; font-variant-numeric: tabular-nums; }
.pp-actions { display: flex; gap: 4px; margin: 10px -6px -4px; }
.pp-actions .btn { height: 30px; font-size: 12.5px; padding: 0 10px; box-shadow: none; }
.pp-skel { height: 14px; width: 60%; border-radius: 4px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- marker ---------- */
.mk { width: 34px; height: 44px; cursor: pointer; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.3)); transform-origin: 50% 100%; animation: drop 420ms var(--ease); }
@keyframes drop { 0% { transform: translateY(-18px) scale(0.9); opacity: 0; } 100% { transform: none; opacity: 1; } }
.mk svg { width: 100%; height: 100%; display: block; }

/* ---------- place card ---------- */
.card {
  position: absolute; left: 12px; bottom: 28px; z-index: 15; width: var(--w); max-width: calc(100vw - 24px);
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-3); padding: 14px 14px 12px;
  animation: pop 180ms var(--ease);
}
.card-head { display: grid; grid-template-columns: 40px 1fr 36px; gap: 12px; align-items: start; }
.card-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; }
.card-icon svg { width: 20px; height: 20px; }
.card-titles { min-width: 0; padding-top: 2px; }
.card-name { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.3; text-wrap: balance; }
.card-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }
.card-meta dt { font-size: 11.5px; color: var(--ink-3); letter-spacing: 0.01em; }
.card-meta dd { margin: 2px 0 0; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
.card-actions { display: flex; gap: 6px; margin-top: 12px; }
.btn {
  all: unset; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-s);
  background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: background 120ms, color 120ms, opacity 120ms;
}
.btn:hover { background: var(--line); }
.btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; margin-left: auto; }
.btn-primary:hover { background: var(--accent-ink); }
.btn-ic svg { width: 16px; height: 16px; display: block; }

/* ---------- toast ---------- */
.toast {
  position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); z-index: 30;
  max-width: min(92vw, 520px); padding: 10px 16px; border-radius: 10px;
  background: var(--ink); color: var(--surface); box-shadow: var(--shadow-3); font-size: 13px; line-height: 1.5;
  animation: pop 180ms var(--ease);
}

/* ---------- layers panel ---------- */
.layers {
  position: absolute; top: 12px; right: 60px; z-index: 18; width: 332px; max-width: calc(100vw - 72px);
  max-height: calc(100vh - 24px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow-3);
  animation: pop 180ms var(--ease); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.ly-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.ly-h { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.ly-sec { padding: 14px 16px 10px; }
.ly-sec + .ly-sec { border-top: 1px solid var(--line); }
.ly-th { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ly-t { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 0.04em; }
.ly-src { font-size: 11px; color: var(--ink-3); opacity: 0.8; white-space: nowrap; }
.ly-note { margin: 6px 0 2px; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.ly-note code { font: 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); padding: 2px 5px; border-radius: 4px; }
.ly-foot { padding: 10px 16px 12px; border-top: 1px solid var(--line); font-size: 11px; line-height: 1.5; color: var(--ink-3); }

/* basemap picker */
.bms { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bm {
  all: unset; display: flex; flex-direction: column; gap: 6px; cursor: pointer; border-radius: 10px; padding: 3px;
  transition: transform 160ms var(--ease);
}
.bm:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.bm-thumb {
  position: relative; display: block; aspect-ratio: 3 / 2; border-radius: 8px; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.12); background: #ece9e3; transition: box-shadow 160ms var(--ease);
}
.bm-thumb svg, .bm-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; }
:root[data-theme="dark"] .bm-streets .t-land { fill: #2a2d33; }
:root[data-theme="dark"] .bm-streets .t-park { fill: #2e3b31; }
:root[data-theme="dark"] .bm-streets .t-road { stroke: #4a505c; }
:root[data-theme="dark"] .bm-streets .t-hw { stroke: #8a6a45; }
.bm-sat { background: radial-gradient(120% 90% at 30% 20%, #3b4f3a, #1f2a30 65%, #142030); }
.bm-sat img[data-missing] { display: none; }
.bm-name { font-size: 12.5px; color: var(--ink-2); text-align: center; line-height: 1; }
.bm:hover .bm-thumb { box-shadow: inset 0 0 0 1px rgba(16, 24, 40, 0.3); }
.bm[aria-checked="true"] .bm-thumb { box-shadow: 0 0 0 2px var(--accent), inset 0 0 0 1px var(--surface); }
.bm[aria-checked="true"] .bm-name { color: var(--accent-ink); font-weight: 600; }
.bm[aria-disabled="true"] { cursor: not-allowed; }
.bm[aria-disabled="true"] .bm-thumb { filter: grayscale(1); opacity: 0.45; }
.bm[aria-disabled="true"] .bm-name { color: var(--ink-3); }

/* switch rows */
.sw { display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 4px 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.sw-minor { min-height: 34px; padding-left: 0; }
.sw-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sw-name { font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.sw-minor .sw-name { font-size: 12.5px; color: var(--ink-2); }
.sw-sub { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.sw input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.sw-track {
  position: relative; flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--line-2);
  transition: background 160ms var(--ease);
}
.sw-track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.3); transition: transform 180ms var(--ease);
}
.sw input:checked + .sw-track { background: var(--accent); }
.sw input:checked + .sw-track::after { transform: translateX(16px); }
.sw input:focus-visible + .sw-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.sw:hover .sw-track { filter: brightness(0.96); }
.sw.off { cursor: not-allowed; }
.sw.off .sw-name, .sw.off .sw-sub { color: var(--ink-3); }
.sw.off .sw-track { opacity: 0.4; }

/* admin popup */
.pp-crumb { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.pp-code { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; color: var(--ink-2); }
.pp-code code { font: 12.5px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.04em; background: var(--surface-2); padding: 3px 6px; border-radius: 5px; color: var(--ink); }
.pp-kind { display: inline-block; font-size: 11px; color: var(--accent-ink); background: var(--accent-soft); border-radius: 999px; padding: 1px 7px; margin-left: 6px; vertical-align: 2px; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  :root { --w: 100%; }
  .search { top: 8px; left: 8px; max-width: calc(100vw - 16px); }
  .toolbar { top: 108px; right: 8px; flex-direction: row; }
  .search.open ~ .toolbar { display: none; }
  .maplibregl-ctrl-top-right { top: 156px; }
  .maplibregl-ctrl-group .maplibregl-ctrl-zoom-in, .maplibregl-ctrl-group .maplibregl-ctrl-zoom-out { display: none; }
  .kbd-hint { display: none; }
  .route { top: 8px; left: 8px; max-width: calc(100vw - 16px); max-height: 70vh; }
  .card { left: 0; right: 0; bottom: 0; width: auto; max-width: none; border-radius: 16px 16px 0 0; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  .layers { top: auto; right: 0; left: 0; bottom: 0; width: auto; max-width: none; max-height: 72vh; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .ly-head { padding-top: 12px; }
  .card-meta { grid-template-columns: 1fr; }
  .toast { bottom: 24px; }
  .panel { max-height: 55vh; }
}
@media (prefers-reduced-motion: reduce) {
  .mk, .panel, .card, .toast, .layers { animation: none; }
}
