:root {
  --bg: #ffffff;
  --panel: #f7f6f3;
  --ink: #1c1c1a;
  --muted: #6b6b66;
  --line: #e3e1db;
  --accent: #b3552d;
  --accent-soft: #f4e3da;
  --ok: #2b7a4b;
  --dead: #a33a3a;
  --blue: #3b6ea5;
}

* { box-sizing: border-box; }
/* The app fills the window, but the map never shrinks below 540px: on a short
   window with the filters open, the page scrolls instead. */
html { height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--ink);
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

/* ── Topbar ─────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; color: inherit; text-decoration: none; min-width: 0; }
.brand-mark { display: block; width: 1.7rem; height: 1.7rem; align-self: center; flex: none; }
.brand-name { font-weight: 700; font-size: 1.1rem; }
.brand-tag { color: var(--muted); font-size: 0.8rem; }
.topbar-right { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.filters-toggle, .account-btn, .upgrade-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.85rem;
}
.upgrade-btn { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.upgrade-btn.hidden, .views-chip.hidden { display: none; }
.views-chip {
  font-size: 0.78rem; color: var(--muted);
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 0.15rem 0.6rem;
}
.account-btn .tier-tag { color: var(--accent); font-weight: 700; }

/* Modals */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(20,18,16,0.55);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--bg); border-radius: 12px; max-width: 900px; width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 1.4rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-card h2 { margin: 0 0 0.2rem; }
.modal-card .sub { color: var(--muted); font-size: 0.85rem; margin-bottom: 1rem; }
.modal-close { float: right; border: none; background: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); }

/* Pricing table */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.8rem; }
.plan {
  border: 1px solid var(--line); border-radius: 10px; padding: 1rem;
  display: flex; flex-direction: column;
}
.plan h3 { margin: 0 0 0.2rem; font-size: 1rem; }
.plan .price { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.plan .price small { font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.plan ul { list-style: none; padding: 0; margin: 0.6rem 0; font-size: 0.8rem; flex: 1; }
.plan li { padding: 0.15rem 0; color: var(--ink); }
.plan li.no { color: var(--muted); text-decoration: line-through; }
.plan button {
  border: none; border-radius: 7px; padding: 0.5rem; cursor: pointer;
  background: var(--accent); color: #fff; font-weight: 600; font-size: 0.85rem;
}
.plan button.current { background: var(--panel); color: var(--muted); border: 1px solid var(--line); cursor: default; }
.plan button:disabled { opacity: 0.6; cursor: default; }
.billing-note { font-size: 0.74rem; color: var(--muted); margin-top: 0.9rem; }

/* Sources table */
.src-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.src-table th, .src-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.src-table th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; }

/* Locked premium sections in the detail card */
.locked-box {
  margin-top: 0.6rem; border: 1px dashed var(--accent); border-radius: 8px;
  padding: 0.7rem; background: var(--accent-soft);
}
.locked-box h4 { margin: 0 0 0.3rem; font-size: 0.85rem; }
.locked-box p { margin: 0 0 0.5rem; font-size: 0.8rem; color: var(--muted); }
.locked-box button {
  border: none; background: var(--accent); color: #fff; border-radius: 6px;
  padding: 0.4rem 0.8rem; cursor: pointer; font-size: 0.82rem; font-weight: 600;
}
/* Observed price changes */
.price-hist {
  margin: 0.5rem 0; padding: 0.5rem 0.65rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  font-size: 0.8rem;
}
.ph-head { color: var(--muted); margin-bottom: 0.3rem; font-size: 0.76rem; }
.ph-row { display: flex; align-items: baseline; gap: 0.5rem; }
.ph-row span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 5.4rem; }
.ph-row b { flex: 1; }
.ph-d { font-weight: 600; font-size: 0.74rem; color: var(--muted); }
.ph-d.down { color: var(--ok); }
.ph-d.up { color: var(--dead); }

.detail-actions { display: flex; gap: 0.5rem; margin: 0.5rem 0; }
.detail-actions button {
  border: 1px solid var(--line); background: var(--bg); border-radius: 6px;
  padding: 0.35rem 0.7rem; cursor: pointer; font-size: 0.82rem;
}
.detail-actions button.saved { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── Filter panel ───────────────────────────────────── */
.filter-panel {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  padding: 0.8rem 1rem 1rem;
}
.filter-panel.collapsed { display: none; }
.filter-note {
  font-size: 0.76rem;
  color: var(--muted);
  background: var(--panel);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  margin-bottom: 0.75rem;
  display: inline-block;
}
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.75rem 1rem;
}
.fld { display: flex; flex-direction: column; gap: 0.25rem; }
.fld > label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}
.fld .row { display: flex; align-items: center; gap: 0.35rem; }
.fld .dash { color: var(--muted); }
.filter-panel input[type="number"],
.filter-panel select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  font-size: 0.85rem;
  min-width: 0;
}
.toggle-fld { flex-direction: row; align-items: center; justify-content: space-between; }
.toggle-fld > label:first-child { margin-right: auto; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #cfcdc7; border-radius: 999px; transition: 0.2s;
}
.slider::before {
  content: ""; position: absolute; height: 16px; width: 16px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(18px); }
.unit-toggle { display: flex; align-items: center; gap: 0.3rem; font-size: 0.72rem; color: var(--muted); }
/* Keep the size Min/Max placeholders readable at 1280-1366px. */
.size-row { flex-wrap: wrap; }
#f-size-min, #f-size-max { min-width: 4.5rem; flex: 1 1 4.5rem; }
.size-row .unit-toggle { flex-basis: 100%; }
.fld-help { font-size: 0.7rem; color: var(--muted); line-height: 1.3; }

/* checkbox groups */
.filter-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  align-items: center;
  margin-top: 0.9rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}
.check-group { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.check-label { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.check-group label { font-size: 0.83rem; display: flex; align-items: center; gap: 0.25rem; cursor: pointer; }
.check-group label.coming-soon, .check-group.coming-soon label { cursor: not-allowed; }
.filter-actions { margin-left: auto; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-reset {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  font-size: 0.82rem;
}

/* ── Layout ─────────────────────────────────────────── */
.layout { flex: 1 0 540px; display: flex; min-height: 0; position: relative; }
.sidebar {
  width: 360px; min-width: 280px;
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; background: var(--panel);
}
.result-meta {
  padding: 0.5rem 0.9rem; font-size: 0.78rem; color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.list { overflow-y: auto; flex: 1; }

.card {
  display: block; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line);
  cursor: pointer; color: inherit; text-decoration: none;
}
.card:hover, .card.active { background: var(--accent-soft); }
.card-title { font-weight: 600; font-size: 0.92rem; margin-bottom: 0.15rem; }
.card-sub { color: var(--muted); font-size: 0.78rem; }
.card-price { color: var(--accent); font-weight: 700; font-size: 0.95rem; }
.badge {
  display: inline-block; font-size: 0.68rem; border: 1px solid var(--line);
  border-radius: 999px; padding: 0 0.45rem; margin-left: 0.35rem;
  color: var(--muted); vertical-align: middle;
}
.badge.drop { color: #fff; background: var(--accent); border-color: var(--accent); }
/* Provenance: the source is the product, so it reads on every card. */
.card-src {
  margin-top: .28rem; font-size: .72rem; color: var(--accent);
  font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.src-from { font-size: .8rem; color: var(--muted); margin-bottom: .45rem; }
.src-from b { color: var(--ink); }

/* Place search + suggestions */
.place-fld { position: relative; }
.filter-panel input[type="search"] {
  width: 100%; padding: 0.4rem 0.5rem; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--ink);
  font-size: 0.85rem; font-family: inherit; min-width: 0;
}
.place-suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 40;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.14); margin-top: 0.2rem;
  max-height: 17rem; overflow-y: auto;
}
.place-suggest.hidden { display: none; }
.ps-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.42rem 0.6rem; cursor: pointer; font-size: 0.84rem;
}
.ps-item:hover, .ps-item.active { background: var(--accent-soft); }
.ps-item.ps-empty { color: var(--muted); cursor: default; }
.ps-item.ps-empty:hover { background: none; }
.ps-kind { flex: 0 0 auto; }
.ps-main { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ps-main small { color: var(--muted); font-size: 0.72rem; }

/* Layer switcher: sub-option under the destinations group */
.layer-only {
  display: flex; align-items: center; gap: 0.4rem;
  margin: 0.15rem 0 0.35rem 0.9rem;
  font-size: 0.78rem; color: var(--muted); cursor: pointer;
}

.map-wrap { flex: 1; min-width: 0; position: relative; }
.map { position: absolute; inset: 0; }

.layer-switcher {
  position: absolute; top: 0.8rem; left: 0.8rem; z-index: 20;
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1); max-width: 280px; font-size: 0.82rem;
}
.layer-switcher summary { cursor: pointer; padding: 0.5rem 0.7rem; font-weight: 600; }
.layer-switcher[open] { padding-top: 0; }
.layer-info-btn {
  position: absolute; top: 0.4rem; right: 0.5rem; width: 1.4rem; height: 1.4rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--bg); color: var(--muted); font: italic 700 0.78rem/1 Georgia, serif;
  cursor: pointer; padding: 0; display: inline-flex; align-items: center; justify-content: center;
}
.layer-info-btn:hover, .layer-info-btn[aria-expanded="true"] { color: var(--text, inherit); border-color: var(--muted); }
.layer-info { padding: 0.2rem 0.7rem 0.5rem; border-bottom: 1px solid var(--line); margin-bottom: 0.2rem; }
.layer-info[hidden] { display: none; }
.layer-info .layer-credit { padding: 0.5rem 0 0; }
.layer-credit { padding: 0 0.7rem 0.6rem; color: var(--muted); font-size: 0.66rem; line-height: 1.35; }
.layer-credit a { color: var(--muted); }
.layer-list .swatch { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.layer-hint { color: var(--muted); font-size: 0.72rem; }
.layer-note { padding: 0 0.7rem; color: var(--muted); font-size: 0.72rem; }
.layer-list { max-height: 320px; overflow-y: auto; padding: 0.4rem 0.7rem 0.6rem; }
.layer-cat { font-size: 0.7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; margin: 0.5rem 0 0.2rem; letter-spacing: 0.03em; }
.layer-list label { display: flex; align-items: center; gap: 0.4rem; padding: 0.12rem 0; cursor: pointer; }
.layer-list label.coming-soon { cursor: not-allowed; }
.layer-list .layer-only.layer-hint { cursor: default; }

/* ── Detail card ────────────────────────────────────── */
.detail {
  position: absolute; top: 0.8rem; right: 0.8rem; width: 380px;
  max-width: calc(100% - 1.6rem); max-height: calc(100% - 1.6rem);
  overflow-y: auto; background: var(--bg); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  padding: 1rem 1.1rem; z-index: 30;
}
.detail.hidden { display: none; }
.detail-close {
  position: absolute; top: 0.4rem; right: 0.6rem; border: none; background: none;
  font-size: 1.3rem; cursor: pointer; color: var(--muted);
}
.detail h2 { margin: 0 0 0.1rem; font-size: 1.05rem; }
.detail .ja { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.detail .price { color: var(--accent); font-size: 1.3rem; font-weight: 700; }
.detail .price small { color: var(--muted); font-weight: 400; font-size: 0.75rem; }
.detail dl {
  display: grid; grid-template-columns: auto 1fr; gap: 0.15rem 0.8rem;
  font-size: 0.85rem; margin: 0.6rem 0;
}
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.detail .desc { font-size: 0.85rem; line-height: 1.45; }
.sources { margin-top: 0.7rem; padding-top: 0.6rem; border-top: 1px dashed var(--line); }
.sources a {
  display: inline-block; margin: 0.15rem 0.3rem 0.15rem 0; padding: 0.3rem 0.6rem;
  background: var(--accent); color: #fff; border-radius: 6px; text-decoration: none; font-size: 0.82rem;
}
.sources .note { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; }
.comps {
  margin-top: 0.6rem; background: var(--panel); border-radius: 8px;
  padding: 0.55rem 0.7rem; font-size: 0.8rem;
}
.comps b { color: var(--ink); }
.verified { font-size: 0.74rem; margin-top: 0.5rem; }
.verified.ok { color: var(--ok); }
.verified.stale { color: var(--dead); }

.footer {
  padding: 0.45rem 1rem; border-top: 1px solid var(--line);
  font-size: 0.7rem; line-height: 1.4; color: var(--muted);
}
.footer p { margin: 0 0 0.2rem; }
.footer p:last-child { margin-bottom: 0; }
.footer a { color: var(--muted); }

.marker-pin {
  width: 14px; height: 14px; background: var(--accent); border: 2px solid #fff;
  border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,0.4); cursor: pointer;
}
.marker-pin.drop { background: var(--blue); }
/* Price pill on the pin. Hidden while too many pins are on screen (see
   syncPricePills) so a national view stays readable. */
.mk-price {
  display: none;
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%);
  background: var(--accent); color: #fff; font-size: 0.66rem; font-weight: 700;
  padding: 0.05rem 0.32rem; border-radius: 999px; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0,0,0,0.35); pointer-events: none;
}
.marker-pin.drop .mk-price { background: var(--blue); }
.show-prices .mk-price { display: block; }
/* NB: never set `position` on .marker-pin. MapLibre positions markers with
   .maplibregl-marker { position: absolute } and this rule has equal specificity
   but loads later, so overriding it drops every marker into normal document
   flow — pins then stack down the page instead of landing on their coordinates.
   The absolute marker is already a containing block for the pill above. */

/* Phones: the page scrolls as one column — map first, then the result list
   (which scrolls on its own), then the footer. The detail opens full-screen. */
@media (max-width: 760px) {
  body { display: block; }
  .topbar { flex-wrap: wrap; gap: 0.4rem 0.6rem; padding: 0.5rem 0.75rem; }
  .brand-tag { flex-basis: 100%; font-size: 0.72rem; }
  .topbar-right { gap: 0.35rem; }
  .filters-toggle, .account-btn, .upgrade-btn { font-size: 0.78rem; padding: 0.3rem 0.5rem; }
  .filter-panel { padding: 0.7rem 0.75rem 0.8rem; }
  .filter-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
  .filter-actions { margin-left: 0; }
  .layout { flex-direction: column; min-height: 0; }
  .map-wrap { order: -1; flex: none; height: 60vh; min-height: 320px; }
  .sidebar {
    width: 100%; min-width: 0; height: 75vh; min-height: 360px;
    border-right: 0; border-top: 1px solid var(--line);
  }
  .layer-switcher { top: 0.5rem; left: 0.5rem; max-width: calc(100% - 1rem); }
  .layer-list { max-height: 40vh; }
  .map-legend { display: none; }
  .detail {
    position: fixed; inset: 0; width: auto; max-width: none; max-height: none;
    border: 0; border-radius: 0; z-index: 90; padding: 1rem 1rem 2rem;
  }
  .detail-close { position: sticky; top: 0; float: right; z-index: 1; background: var(--bg); border-radius: 50%; width: 2.2rem; height: 2.2rem; }
  .modal { padding: 0.5rem; }
  .modal-card { padding: 1.1rem 1rem; max-height: 94vh; }
}

/* Hazard / depopulation callouts inside the detail. A mapped hazard zone is a
   material fact about the property, so it reads as a warning. There is no
   "all clear" style: many homes are mapped only to their district. */
.comps.hz-risk { border-left: 3px solid #c2410c; background: #fff7ed; }

/* Listing imagery. Stored WebP from our bucket (compressed hero + gallery). */
.card-thumb {
  width: 100%; height: 128px; object-fit: cover;
  border-radius: 6px; margin-bottom: 0.45rem; background: var(--muted-bg, #eee);
}
.detail-hero {
  width: 100%; max-height: 340px; object-fit: cover;
  border-radius: 8px; margin: 0.4rem 0 0.6rem;
}
.gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0.5rem 0;
}
.gallery a { display: block; }
.gallery img {
  display: block; width: 100%; height: 96px; object-fit: cover; border-radius: 4px; cursor: zoom-in;
}

/* Placeholder for listings that publish no photo, same height as a photo. */
.card-thumb.placeholder {
  height: 128px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.25rem; background: var(--bg); border: 1px dashed var(--line); color: var(--muted);
}
.card-thumb.placeholder small { font-size: 0.72rem; }

/* Several homes mapped to one point (often a district centre). */
.marker-pin.multi {
  width: 24px; height: 24px; background: #7a3418;
  display: flex; align-items: center; justify-content: center;
}
.mk-count { color: #fff; font-size: 0.64rem; font-weight: 700; line-height: 1; }
.marker-pin.multi .mk-price { top: 26px; background: #7a3418; }
.marker-pin:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Pin key, bottom-left of the map. */
.map-legend {
  position: absolute; left: 0.8rem; bottom: 1.6rem; z-index: 10;
  display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; max-width: calc(100% - 6rem);
  background: rgba(255,255,255,0.92); border: 1px solid var(--line); border-radius: 8px;
  padding: 0.3rem 0.6rem; font-size: 0.7rem; color: var(--muted); pointer-events: none;
}
.map-legend span { display: inline-flex; align-items: center; gap: 0.3rem; }
.lg-dot {
  display: inline-block; width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent); border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
}
.lg-dot.drop { background: var(--blue); }
.lg-dot.multi { width: 13px; height: 13px; background: #7a3418; }

/* Detail panel extras */
.detail:focus { outline: none; }
.mt-note { font-size: 0.72rem; color: var(--muted); margin-bottom: 0.3rem; }
.photo-note { font-size: 0.72rem; color: var(--muted); margin-top: 0.6rem; }
.mlit-credit { font-size: 0.7rem; color: var(--muted); margin-top: 0.5rem; line-height: 1.4; }
.ph-more { color: var(--muted); font-size: 0.72rem; margin-bottom: 0.2rem; }
.detail-actions button:disabled { cursor: not-allowed; }

/* Result line + empty state */
.link-btn {
  border: none; background: none; padding: 0; color: var(--accent);
  font: inherit; text-decoration: underline; cursor: pointer;
}
.empty { padding: 1.5rem 1rem; color: var(--muted); font-size: 0.85rem; }
.empty p { margin: 0 0 0.7rem; }
.empty .filter-reset { margin-left: 0; }

/* Data sources modal */
.modal-card h3 { font-size: 0.95rem; margin: 1.2rem 0 0.4rem; }
.modal-card p { font-size: 0.85rem; line-height: 1.5; }
.table-wrap { overflow-x: auto; }
.src-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.src-table a { color: var(--accent); white-space: nowrap; }
.credits { font-size: 0.82rem; line-height: 1.5; padding-left: 1.1rem; margin: 0.3rem 0; }
.credits a, .operator a { color: var(--accent); }
.modal-card .mlit-credit { font-size: 0.78rem; margin: 0.4rem 0; }
.operator { font-size: 0.8rem; color: var(--muted); }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%) translateY(150%);
  background: var(--ink); color: #fff; padding: 0.55rem 0.9rem; border-radius: 8px;
  font-size: 0.82rem; z-index: 200; opacity: 0; transition: 0.2s; max-width: calc(100% - 2rem);
}
.toast.show { transform: translateX(-50%); opacity: 1; }

/* Keyboard focus */
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible,
summary:focus-visible, .card:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.card:focus-visible { outline-offset: -2px; }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* "Coming soon": visible, never clickable. Every gated control is disabled,
   aria-disabled="true", title="Coming soon", class coming-soon, and carries a
   .soon-tag pill (form fields: class on the field wrapper, inputs disabled). */
.coming-soon { opacity: .55; filter: grayscale(1); cursor: not-allowed; }
.coming-soon * { pointer-events: none; }
.soon-tag {
  display: inline-block; margin-left: 0.35rem; padding: 0 0.45rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel); color: var(--muted);
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.03em; line-height: 1.5;
  text-transform: uppercase; vertical-align: middle; white-space: nowrap;
}
.upgrade-btn.coming-soon, .account-btn.coming-soon, .filter-reset.coming-soon {
  background: var(--panel); color: var(--muted); border-color: var(--line); font-weight: 400;
}
.locked-box.coming-soon button, .plan button.coming-soon { cursor: not-allowed; }

/* Phone overrides for rules defined after the main phone block above. */
@media (max-width: 760px) {
  .map-legend { display: none; }
  .topbar-right .soon-tag { font-size: 0.52rem; padding: 0 0.3rem; margin-left: 0.25rem; }
  .topbar-right .filters-toggle, .topbar-right .account-btn, .topbar-right .upgrade-btn { padding: 0.28rem 0.42rem; font-size: 0.76rem; }
}

/* Ski-area / surf-break popups */
.place-detail { color: var(--muted); font-size: 0.85em; margin-top: 0.1rem; }
.place-homes { margin-top: 0.3rem; }
.place-show {
  display: block; margin-top: 0.45rem; padding: 0.3rem 0.65rem;
  border: 1px solid var(--accent); background: #fff; color: var(--accent);
  border-radius: 6px; cursor: pointer; font: inherit; font-size: 0.85em;
}
.place-show:hover, .place-show:focus-visible { background: var(--accent-soft); }
.place-link { display: block; margin-top: 0.35rem; font-size: 0.85em; }

/* Transport hubs: type filter under the destinations group */
.layer-list .hub-types { flex-wrap: wrap; row-gap: 0; }
.layer-list .hub-types label { flex: 1 1 100%; padding: 0.05rem 0; cursor: pointer; }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
