/* ============================================================
   台北租屋快照 — "editorial property journal" theme
   Warm newsprint paper · ink · 朱砂紅 vermilion accent ·
   jade/gold badges. System fonts only. ZERO external resources.
   ============================================================ */

:root {
  --paper:      #f2ece0;
  --paper-2:    #fbf7ef;
  --paper-3:    #e8dfcd;
  --ink:        #1b1714;
  --ink-soft:   #5c534a;
  --ink-faint:  #8a7f72;
  --rule:       #cfc3ac;
  --rule-soft:  #e0d6c3;
  --vermilion:  #c93a22;   /* 朱砂紅 — primary accent */
  --vermilion-d:#a22c18;
  --jade:       #2f6d5c;   /* 降價 / price-drop */
  --gold:       #a9791c;   /* 新上架 / Δ */
  --pet:        #17798a;   /* 可養寵物 — DISTINCT teal (never --gold, which .badge--new uses) */
  --shadow:     0 1px 0 #fff, 0 10px 26px -14px rgba(43,32,20,.45);
  --serif: Georgia, "Noto Serif TC", "Source Han Serif TC", "Songti TC",
           "Times New Roman", serif;
  --sans: "Helvetica Neue", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei",
          system-ui, -apple-system, sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas,
          "Noto Sans Mono", monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--paper);
  /* Layered atmosphere: soft vignette + fine newsprint grain, no images. */
  background-image:
    radial-gradient(120% 80% at 50% -10%, rgba(255,255,255,.55), transparent 60%),
    repeating-linear-gradient(0deg, rgba(120,100,70,.035) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(120,100,70,.028) 0 1px, transparent 1px 3px);
  line-height: 1.5;
}

/* ---------- Masthead ---------- */
.masthead { padding: 22px clamp(16px, 4vw, 48px) 0; }
.masthead__rule { height: 3px; background: var(--ink); box-shadow: 0 3px 0 -1px var(--vermilion); }
.masthead__inner {
  display: flex; flex-wrap: wrap; gap: 16px;
  align-items: flex-end; justify-content: space-between;
  padding: 18px 2px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand__seal {
  font-family: var(--serif); font-size: 30px; line-height: 1;
  color: var(--paper-2); background: var(--vermilion);
  width: 54px; height: 54px; display: grid; place-items: center;
  border-radius: 4px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.28);
  transform: rotate(-3deg);
}
.brand__title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(28px, 5vw, 46px); margin: 0; letter-spacing: .04em;
  line-height: 1;
}
.brand__sub {
  margin: 6px 0 0; font-size: 12px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--ink-faint);
}
.dateline { text-align: right; }
.dateline__label { display: block; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-faint); }
.dateline__value { font-family: var(--mono); font-size: 22px; font-weight: 600; color: var(--vermilion); }
/* Rolling-window mode packs 「近N天 · from ~ to」 into the same slot: slightly
   smaller and non-wrapping so the masthead keeps its one-line rhythm. */
.dateline__value--range { font-size: clamp(14px, 1.7vw, 17px); letter-spacing: 0; white-space: nowrap; }
.dateline__meta { display: block; font-size: 12px; color: var(--ink-soft); }

/* ---------- Layout ---------- */
.layout {
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  gap: 28px; align-items: start;
  padding: 26px clamp(16px, 4vw, 48px) 40px;
}
@media (max-width: 880px) { .layout { grid-template-columns: 1fr; } }

/* ---------- Sidebar column (filters) ----------
   A sticky scroll container for the filter panel, so a long filter stack scrolls
   inside the sidebar instead of dragging the results grid down the page. The
   panel carries the card chrome; this is a bare scroller. */
.sidecol {
  position: sticky; top: 18px;
  display: flex; flex-direction: column; gap: 18px;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  /* Reserve the scrollbar's width so opening/closing it never reflows the panels. */
  scrollbar-gutter: stable;
}
@media (max-width: 880px) {
  .sidecol { position: static; max-height: none; overflow: visible; }
}

/* ---------- Filter panel ---------- */
.panel {
  flex: none;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--ink);
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel__heading {
  font-family: var(--serif); font-size: 20px; margin: 0 0 16px;
  padding-bottom: 10px; border-bottom: 1px solid var(--rule-soft);
  display: flex; justify-content: space-between; align-items: baseline;
}
.panel__heading span { font-family: var(--sans); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }

.field { margin-bottom: 14px; }
.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field--inline { margin-bottom: 4px; }
.field--inline .check { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.field > label, .field legend {
  display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  color: var(--ink-soft); margin-bottom: 5px;
}
.field legend { padding: 0; }
.hint-inline { font-weight: 400; color: var(--ink-faint); }
.hint { margin: 5px 0 0; font-size: 11px; color: var(--ink-faint); }

input[type="text"], input[type="number"], input[type="search"],
input[type="date"], select {
  width: 100%; font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: #fff; border: 1px solid var(--rule);
  border-radius: 2px; padding: 8px 10px;
  transition: border-color .15s, box-shadow .15s;
}
select[multiple] { padding: 4px; }
input:focus, select:focus {
  outline: none; border-color: var(--vermilion);
  box-shadow: 0 0 0 3px rgba(201,58,34,.16);
}
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--vermilion); width: 16px; height: 16px; }

/* ---------- Range presets: segmented radio group (單日 / 近7天 / 近兩週 / 近一個月)
   The <input>s are collapsed to zero size (never display:none — they must stay
   keyboard-reachable and submit with the GET form); the adjacent <label> IS the
   visible segment. Ink/paper/border tokens are the .btn--ghost ones, and the
   checked segment flips to vermilion like .btn--primary. ---------- */
.field--range legend { margin-bottom: 6px; }
.seg {
  display: flex; overflow: hidden;
  border: 1px solid var(--rule); border-radius: 2px; background: #fff;
}
.seg input {
  -webkit-appearance: none; appearance: none;
  width: 0; height: 0; margin: 0; padding: 0; border: 0; opacity: 0;
}
.seg label {
  flex: 1 1 0; min-width: 0; text-align: center; cursor: pointer;
  font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--ink-soft);
  padding: 8px 2px; border-right: 1px solid var(--rule-soft);
  transition: background .15s, color .15s, box-shadow .15s;
  user-select: none; white-space: nowrap;
}
.seg label:last-of-type { border-right: 0; }
.seg label:hover { background: var(--paper-3); }
.seg input:checked + label {
  background: var(--vermilion); color: #fff;
  box-shadow: inset 0 -2px 0 var(--vermilion-d);
}
.seg input:checked + label:hover { background: var(--vermilion-d); }
/* Focus stays visible without a native ring on a zero-size input. */
.seg input:focus-visible + label { outline: 2px solid var(--vermilion); outline-offset: -2px; }

/* Window mode locks the single-date picker (mutual exclusion): greyed + inert,
   but the value is KEPT so switching back to 單日 restores the same date. */
input[type="date"].is-locked,
input[type="date"]:disabled {
  background: var(--paper-3); color: var(--ink-faint);
  border-style: dashed; cursor: not-allowed; opacity: .75;
}

/* The SAME lock treatment for 包含已下架: rolling windows force-include delisted
   listings, so the toggle is inert there. Greyed + dashed underline (inset, so
   nothing reflows) + not-allowed cursor; the checkbox keeps the user's own
   checked state — locking never resets a choice. */
.check.is-locked {
  color: var(--ink-faint); cursor: not-allowed;
  box-shadow: inset 0 -1px 0 var(--rule);
}
.check.is-locked input {
  accent-color: var(--ink-faint); cursor: not-allowed; opacity: .7;
}

.actions { display: flex; gap: 10px; margin-top: 18px; }
.btn {
  font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: .06em;
  padding: 10px 18px; border-radius: 2px; cursor: pointer; border: 1px solid transparent;
  transition: transform .12s, background .15s, box-shadow .15s;
}
.btn--primary { flex: 1; background: var(--vermilion); color: #fff; box-shadow: 0 6px 16px -8px var(--vermilion); }
.btn--primary:hover { background: var(--vermilion-d); transform: translateY(-1px); }
.btn--ghost { background: transparent; color: var(--ink-soft); border-color: var(--rule); }
.btn--ghost:hover { background: var(--paper-3); }
.btn:active { transform: translateY(0); }
.noscript { margin-top: 14px; font-size: 12px; color: var(--ink-soft); border-left: 3px solid var(--gold); padding-left: 10px; }
.noscript code { font-family: var(--mono); background: var(--paper-3); padding: 1px 4px; }

/* ---------- Results ---------- */
.results__bar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
  justify-content: space-between; border-bottom: 2px solid var(--ink);
  padding-bottom: 10px; margin-bottom: 20px;
}
.results__count { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 700; }
.results__count b { color: var(--vermilion); font-family: var(--mono); }
.results__meta { margin: 0; font-size: 12px; letter-spacing: .06em; color: var(--ink-faint); }

/* ---------- Per-source status banner (partial / failed snapshots) ---------- */
.status-banner {
  display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center;
  margin: 0 0 18px; padding: 10px 14px;
  border: 1px solid var(--rule); border-left: 3px solid var(--gold);
  background: rgba(169,121,28,.08);
}
.status-banner[hidden] { display: none; }
.status-banner__item {
  font-size: 12px; font-weight: 600; letter-spacing: .03em; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px;
}
.status-banner__item::before { content: "▲"; font-size: 10px; color: var(--gold); }

/* ONE track definition for both the flat results grid and the per-hour blocks
   (.hour-row__cards), so a card is exactly the same size whether the page is
   grouped by hour or not: as many 268px+ columns as fit, wrapping onto further
   lines as needed, collapsing to a single column on a narrow screen. */
.grid,
.hour-row__cards {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
}

/* ---------- Card ---------- */
.card {
  background: var(--paper-2); border: 1px solid var(--rule);
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  animation: rise .5s cubic-bezier(.2,.7,.3,1) both;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.card:hover { transform: translateY(-4px); border-color: var(--ink-faint); box-shadow: 0 1px 0 #fff, 0 20px 34px -18px rgba(43,32,20,.6); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.card__media { position: relative; aspect-ratio: 16 / 10; background: var(--paper-3); overflow: hidden; border-bottom: 1px solid var(--rule); }
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.card:hover .card__media img { transform: scale(1.05); }
.card__noimg { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 40px; color: var(--rule); }

.badge { position: absolute; font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 4px 9px; border-radius: 2px; color: #fff; z-index: 2; }
.badge--source { top: 10px; left: 10px; background: var(--ink); }
.badge--source.rakuya { background: var(--jade); }
.badge--drop { top: 10px; right: 10px; background: var(--vermilion); }
.badge--new { bottom: 10px; right: 10px; background: var(--gold); }
.badge--removed { bottom: 10px; left: 10px; background: var(--ink-soft); }

.card__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card__price { display: flex; align-items: baseline; gap: 8px; }
.card__price .amount { font-family: var(--mono); font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.card__price .unit { font-size: 13px; color: var(--ink-faint); }
.card__price .unitprice { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--vermilion); }

.card__title { font-family: var(--serif); font-size: 17px; line-height: 1.35; margin: 0; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.delta { font-family: var(--mono); font-size: 12px; padding: 4px 8px; border-radius: 2px; align-self: flex-start; }
.delta--down { color: var(--jade); background: rgba(47,109,92,.1); }
.delta--up { color: var(--vermilion); background: rgba(201,58,34,.1); }

.specs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.specs li { font-size: 13px; color: var(--ink-soft); display: flex; gap: 6px; min-width: 0; }
.specs .k { color: var(--ink-faint); flex: none; }
.specs .v { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card__foot { margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--rule); }
.card__link {
  font-size: 13px; font-weight: 700; letter-spacing: .04em; color: var(--vermilion);
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.card__link:hover { color: var(--vermilion-d); text-decoration: underline; }
.card__link::after { content: "↗"; font-size: 14px; }

/* ---------- Empty states ---------- */
.empty {
  grid-column: 1 / -1; text-align: center; padding: 60px 24px;
  border: 1px dashed var(--rule); background: rgba(255,255,255,.4);
  animation: rise .5s both;
}
.empty__glyph { font-family: var(--serif); font-size: 54px; color: var(--rule); line-height: 1; }
.empty__title { font-family: var(--serif); font-size: 22px; margin: 14px 0 6px; }
.empty__body { color: var(--ink-soft); font-size: 14px; margin: 0 auto; max-width: 46ch; }
.empty code { font-family: var(--mono); background: var(--paper-3); padding: 2px 7px; border-radius: 2px; color: var(--ink); }

/* ---------- Pager ---------- */
.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 30px; }
.pager button {
  font-family: var(--mono); font-size: 14px; min-width: 40px; padding: 8px 12px;
  background: var(--paper-2); border: 1px solid var(--rule); color: var(--ink);
  cursor: pointer; border-radius: 2px; transition: all .15s;
}
.pager button:hover:not(:disabled) { border-color: var(--vermilion); color: var(--vermilion); }
.pager button[aria-current="true"] { background: var(--ink); color: var(--paper-2); border-color: var(--ink); }
.pager button:disabled { opacity: .4; cursor: default; }
.pager .gap { border: none; background: none; cursor: default; }

/* ---------- Footer ---------- */
.foot {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 48px) 34px; border-top: 1px solid var(--rule);
  font-size: 12px; color: var(--ink-faint);
}
.foot__health { font-family: var(--mono); }
.foot__health.ok { color: var(--jade); }
.foot__health.bad { color: var(--vermilion); }

/* ============================================================
   逐時排列 / Hour rows — the results grid, one BLOCK per capture hour.

   Layout, per hour: a full-width heading LINE ("08:00 · 12 件") on its own row,
   then that hour's cards wrapping beneath it across as many lines as the hour
   needs, then the next hour's heading. Nothing scrolls sideways — a busy hour
   simply makes its block taller. The card area reuses the .grid track above, so
   card size and wrapping behave identically inside and outside an hour block.
   ============================================================ */
.hourgrid { display: flex; flex-direction: column; gap: 34px; }

.hour-row { display: block; }

/* The heading line. Full width, cards start on the NEXT line; the rule under it
   separates one hour's cards from the next hour's heading. */
.hour-row__label {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px;
  margin: 0 0 16px; padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}
.hour-row__hour {
  font-family: var(--mono); font-size: 20px; font-weight: 700;
  letter-spacing: -.01em; color: var(--ink); line-height: 1.15;
}
.hour-row__count {
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--vermilion);
}
/* Pushed to the far end of the heading line, where it explains the group
   without competing with the hour itself. */
.hour-row__note { margin-left: auto; font-size: 11px; color: var(--ink-faint); }

/* Hours with no recorded capture time (snapshots predating hour tracking):
   quieter heading + a hairline rule, so it reads as a remainder bucket. */
.hour-row--undated .hour-row__hour { font-size: 16px; font-weight: 600; color: var(--ink-soft); }
.hour-row--undated .hour-row__label { border-bottom: 1px solid var(--rule); }

@media (max-width: 880px) {
  .hourgrid { gap: 26px; }
  .hour-row__label { margin-bottom: 12px; }
  .hour-row__hour { font-size: 18px; }
  /* The note would squeeze the count off the line on a phone — give it its own. */
  .hour-row__note { margin-left: 0; flex-basis: 100%; }
}

/* ============================================================
   Map view (地圖) — full-screen Leaflet overlay + real-estate pins.
   Theme-matched to the editorial newsprint / vermilion look.
   ============================================================ */

/* Results-bar tools: meta line + map button sit together on the right. */
.results__tools { display: flex; align-items: center; gap: 12px; }
.btn--map {
  flex: none; display: inline-flex; align-items: center; gap: 7px;
  background: var(--ink); color: var(--paper-2); border-color: var(--ink);
  padding: 7px 15px; font-size: 13px; letter-spacing: .08em;
}
.btn--map::before { content: "◎"; font-size: 13px; color: var(--vermilion); }
.btn--map:hover { background: var(--vermilion); border-color: var(--vermilion); transform: translateY(-1px); }
.btn--map:hover::before { color: #fff; }
/* Hide the map button until app.js marks <html> as .js — no JS, no map (#17).
   The id selector outranks .btn--map so the default is truly hidden. */
#map-btn { display: none; }
.js #map-btn { display: inline-flex; }

/* Overlay */
.map-modal {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; flex-direction: column;
  background: var(--paper);
  animation: mapfade .22s ease both;
}
.map-modal[hidden] { display: none; }
@keyframes mapfade { from { opacity: 0; } to { opacity: 1; } }

.map-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px clamp(14px, 3vw, 28px);
  background: var(--paper-2); border-bottom: 3px solid var(--ink);
  box-shadow: 0 3px 0 -1px var(--vermilion);
}
.map-modal__title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.map-modal__glyph {
  font-family: var(--serif); font-size: 22px; line-height: 1; color: var(--paper-2);
  background: var(--vermilion); width: 40px; height: 40px; flex: none;
  display: grid; place-items: center; border-radius: 4px; transform: rotate(-3deg);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.28);
}
.map-modal__heading { display: flex; flex-direction: column; min-width: 0; }
.map-modal__heading strong { font-family: var(--serif); font-size: 20px; letter-spacing: .03em; }
/* Rolling-window mode prefixes the count with the dateline it replaces —
   「近N天 · from ~ to（含已下架）」 — plus a narrowing hint when the 2000-pin cap
   trips, so let the line wrap inside the header instead of overflowing it. */
.map-modal__count {
  font-family: var(--mono); font-size: 13px; color: var(--vermilion);
  overflow-wrap: anywhere; line-height: 1.45;
}
.map-modal__close {
  flex: none; width: 42px; height: 42px; font-size: 28px; line-height: 1;
  background: transparent; color: var(--ink); border: 1px solid var(--rule);
  border-radius: 3px; cursor: pointer; transition: all .15s;
}
.map-modal__close:hover { background: var(--vermilion); color: #fff; border-color: var(--vermilion); }

/* Precision legend (#8): decodes the three pin colours (approximate location). */
.map-legend {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  padding: 6px clamp(14px, 3vw, 28px);
  background: var(--paper-2); border-bottom: 1px solid var(--rule-soft);
  font-size: 11px; letter-spacing: .04em; color: var(--ink-soft);
}
.map-legend__item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.map-legend .sw { width: 12px; height: 12px; border-radius: 2px; display: inline-block; flex: none; }
.map-legend .sw--station { background: var(--vermilion); }
.map-legend .sw--district { background: var(--jade); }
.map-legend .sw--city { background: var(--ink-faint); }

.map { flex: 1; min-height: 0; width: 100%; background: var(--paper-3); z-index: 1; }

/* Friendly failure / empty message (floats over the map area). */
.map-modal__msg {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 1200; max-width: min(90vw, 420px); margin: 0;
  padding: 18px 22px; text-align: center;
  background: var(--paper-2); border: 1px solid var(--rule);
  border-top: 3px solid var(--gold); box-shadow: var(--shadow);
  font-size: 14px; color: var(--ink-soft);
}
.map-modal__msg[hidden] { display: none; }

.map-modal__attr {
  margin: 0; padding: 6px clamp(14px, 3vw, 28px);
  font-size: 11px; color: var(--ink-faint); background: var(--paper-2);
  border-top: 1px solid var(--rule-soft);
}

/* ---------- Real-estate price pin (L.divIcon) ---------- */
.price-pin { background: none; border: none; }
.price-pin > span {
  display: block; position: relative;
  min-width: 46px; height: 26px; padding: 0 9px;
  font-family: var(--mono); font-size: 13px; font-weight: 700; line-height: 26px;
  text-align: center; color: #fff; white-space: nowrap;
  background: var(--ink); border-radius: 4px;
  box-shadow: 0 3px 8px -2px rgba(20,15,10,.6);
  transition: transform .12s, background .15s;
}
/* Tail pointing down at the exact coordinate. */
.price-pin > span::after {
  content: ""; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: var(--ink); border-bottom: 0;
}
.price-pin:hover > span { transform: translateY(-2px) scale(1.04); z-index: 1000; }

/* Precision accent: station = vermilion, district = jade, city = muted. */
.price-pin--station > span { background: var(--vermilion); }
.price-pin--station > span::after { border-top-color: var(--vermilion); }
.price-pin--district > span { background: var(--jade); }
.price-pin--district > span::after { border-top-color: var(--jade); }
.price-pin--city > span { background: var(--ink-faint); }
.price-pin--city > span::after { border-top-color: var(--ink-faint); }
/* Delisted (已下架) pins read muted + struck, overriding the precision colour.
   Placed AFTER the precision rules so it wins the equal-specificity cascade (#7). */
.price-pin--removed > span {
  background: var(--ink-faint); text-decoration: line-through; opacity: .72;
}
.price-pin--removed > span::after { border-top-color: var(--ink-faint); }

/* ---------- Popup (theme the default Leaflet popup) ---------- */
.leaflet-popup-content-wrapper {
  background: var(--paper-2); color: var(--ink);
  border: 1px solid var(--rule); border-top: 3px solid var(--ink);
  border-radius: 3px; box-shadow: 0 14px 34px -14px rgba(43,32,20,.6);
}
.leaflet-popup-content { margin: 12px 14px; font-family: var(--sans); }
.leaflet-popup-tip { background: var(--paper-2); border: 1px solid var(--rule); }

.mpopup { display: flex; flex-direction: column; gap: 6px; min-width: 190px; }
.mpopup__price { display: flex; align-items: baseline; gap: 6px; }
.mpopup__price .amount { font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--vermilion); }
.mpopup__price .unit { font-size: 12px; color: var(--ink-faint); }
.mpopup__price .unitprice { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--ink-soft); }
.mpopup__title { font-family: var(--serif); font-size: 15px; font-weight: 600; line-height: 1.35; }
.mpopup__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: .04em;
  padding: 1px 7px; border-radius: 2px; color: #fff;
}
.chip--drop { background: var(--jade); }
.chip--removed { background: var(--ink-soft); }
.chip--pet { background: var(--pet); }
/* Finding H: card-level inline chip row under the title (mirrors the map popup
   chips, same --pet color) with a slightly heavier treatment so it reads as a
   real indicator — and zero collision with the 4 absolute media badges. */
.card__flags { display: flex; flex-wrap: wrap; gap: 6px; margin: 3px 0 0; }
.card__flags .chip { font-size: 11px; padding: 2px 8px; }
.mpopup__meta { font-size: 12px; color: var(--ink-soft); }
.mpopup__addr { font-size: 11px; color: var(--ink-faint); }
.mpopup__prec { font-size: 11px; color: var(--jade); letter-spacing: .02em; }
.mpopup__link {
  margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--vermilion);
  text-decoration: none; align-self: flex-start; padding-top: 6px;
  border-top: 1px dashed var(--rule); width: 100%;
}
.mpopup__link:hover { color: var(--vermilion-d); text-decoration: underline; }
.mpopup__link::after { content: " ↗"; }

/* Cluster bubbles take the ink/vermilion palette instead of Leaflet green. */
.marker-cluster div { background: rgba(201,58,34,.82); color: #fff; font-family: var(--mono); font-weight: 700; }
.marker-cluster span { line-height: 30px; }
.marker-cluster { background: rgba(27,23,20,.28); }

/* Responsive: stack the head a touch tighter on phones. */
@media (max-width: 620px) {
  .map-modal__heading strong { font-size: 17px; }
  .map-modal__glyph { width: 34px; height: 34px; font-size: 18px; }
  .price-pin > span { min-width: 40px; font-size: 12px; }
}
