/* ═══════════════════════════════════════════════════════════════════════
   MAP VIEW — Property Intelligence

   The look is borrowed from where premium listing sites have converged, for
   the reason they converged there: on a map the LISTINGS are the content and
   everything else is furniture. So the ground is desaturated warm grey (set
   in map-core.js), the chrome is near-invisible, and the only saturated
   things on screen are the price pills and the one selected marker.

   Three rules hold the whole sheet together:
     · One accent, used once. The selected marker is the darkest thing in the
       viewport; nothing else competes with it.
     · Prices in the display serif, everything else in the UI sans. An agent
       scans prices, so prices get the typeface with presence.
     · Nothing moves unless the user moved it. No idle animation on a tool
       somebody stares at for an hour.

   Tokens come from dashboard-assets/style.css. Nothing is hardcoded that the
   console already declares.
   ═══════════════════════════════════════════════════════════════════════ */

/* ═══════ THE SHELL ═══════ */

#mapShell {
  --split: 42%;
  --divider: 9px;
  display: grid;
  /* ONE track declaration, used by every mode. The map pane is always the
     third track; a mode only changes how wide the first two are. Map-only
     sets both to zero (below) rather than declaring a different number of
     tracks, so the pane cannot end up in the wrong one. */
  grid-template-columns: var(--split) var(--divider) minmax(0, 1fr);
  height: calc(100vh - 300px);   /* replaced by a measured height in map-view.js */
  /* 420px is a good floor on a laptop and taller than the entire screen of a
     phone held sideways, where it hung 351px below the fold. Bounded by the
     viewport so the floor can never exceed it. */
  min-height: min(420px, 60vh);
  margin: 4px 0 18px;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--card);
  box-shadow: var(--shadow);
}
/* Map-only narrows the first two tracks to nothing. It does NOT declare a
   different grid, and it does NOT use display:none.

   That distinction was the bug. A grid item with display:none is removed
   from the grid flow, so with three tracks declared and the first two items
   hidden, #mapPane slid up into the FIRST track — and that track was 0px.
   The map was there, tiles and markers and all, drawn into a pane with no
   width. Split worked because all three items were present and the pane
   really was the third track. One view worked and the other did not, from
   the same JavaScript, because the two modes were described by two different
   pieces of CSS that had drifted apart.

   visibility:hidden keeps them in the flow and out of the tab order, and a
   zero-width track means they occupy nothing. Both modes are now the same
   three tracks and the same code, differing only in one number. */
/* The widths come from applySplit() in map-view.js, which is the one place
   that knows the mode. Declaring them here as well is how the two drifted
   apart in the first place, so this rule now only takes the hidden pane out
   of sight and out of the tab order. */
#mapShell[data-mode="map"] #mapListPane,
#mapShell[data-mode="map"] #mapResizer { visibility: hidden; }

/* While dragging the divider the map must not receive the pointer, or it
   swallows the gesture the moment the cursor crosses it. */
body.mv-dragging { user-select: none; cursor: col-resize; }
body.mv-dragging #mapPane { pointer-events: none; }

/* ═══════ MODE SWITCH ═══════ */

.mv-modes {
  display: inline-flex; gap: 2px; padding: 2px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 999px;
}
.mv-mode {
  font: inherit; font-size: 12.5px; font-weight: 600;
  /* 8px to stand 32px tall, matching the filter chips it sits beside. */
  padding: 8px 15px; border: 0; border-radius: 999px;
  /* --ink2, not --ink3: this is the unselected half of a two-state control,
     and on --bg2 the muted grey came to 4.1:1. An agent has to be able to
     read the view they are NOT currently in. */
  background: transparent; color: var(--ink2); cursor: pointer;
}
.mv-mode:hover { color: var(--ink); }
.mv-mode.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.07); }

/* ═══════ LIST PANE ═══════ */

/* min-height:0 is doing real work here, not tidying.

   A grid item and a flex item both default to min-height:auto, which means
   "never shrink below your content". So this pane grew to the full height of
   every row in the list — 8968px for the live 130 — and #mapShell, which is
   570px with overflow:hidden, simply cut it off. #mapList declared
   overflow-y:auto and never scrolled, because scrollHeight and clientHeight
   were both 8929: there was nothing to scroll, the content was all laid out
   and the clipping happened two levels up.

   The visible result was a list showing the first three properties with no
   way to reach the other 127, in both Split and Map view.

   The map preview did not catch it because its fixture is a handful of rows
   that fit inside the shell. tests/ui-audit.mjs runs the real 130. */
#mapListPane {
  display: flex; flex-direction: column; min-width: 0; min-height: 0;
  border-right: 1px solid var(--border); background: var(--card);
}
/* Was a filled band of four coloured pills — a coordinate-quality audit in
   the most valuable position on the page, duplicating the rail's own
   "Missing data" count. Now one quiet line that only speaks up when
   something actually needs doing. --ink2 not --ink3: on the sunk surface
   --ink3 is 4.05:1, which fails AA at this size. */
#mapPinBar {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 9px 13px; border-bottom: 1px solid var(--border);
  font-size: 11.5px; color: var(--ink2);
}
.mv-pb-n b { color: var(--ink); font-weight: 700; }
.mv-pb-ok { color: var(--green); font-weight: 600; }
.mv-pb-b {
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 3px 9px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border2); background: var(--card); color: var(--ink2);
}
.mv-pb-b:hover { border-color: var(--ink3); }
/* No colour. Nothing here is an error — it is a to-do list, and a red pill
   for "some positions are approximate" cried wolf on every load. */
.mv-pb-b { border: 0; padding: 0; background: none; color: var(--gold);
  text-decoration: underline; text-underline-offset: 2px; }
.mv-pb-b:hover { opacity: .75; }
.mv-pb-b.quiet { color: var(--ink3); text-decoration-color: var(--border2); }
.mv-pb-sep { color: var(--border2); }

#mapList { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px; }

.mv-row {
  display: block; width: 100%; text-align: left;
  font: inherit; cursor: pointer;
  background: transparent; border: 1px solid transparent;
  border-radius: 11px; padding: 9px 11px; margin-bottom: 2px;
}
.mv-row:hover, .mv-row.hot { background: var(--bg2); }
/* The selected row and the selected marker are the same object seen twice, so
   they carry the same weight of emphasis — a left rule rather than a fill,
   which survives being hovered at the same time. */
.mv-row.sel { background: var(--gold-lt); border-color: color-mix(in srgb, var(--gold) 34%, transparent); }
.mv-row.sold { opacity: .58; }
.mv-row:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.mv-row-1 { display: flex; align-items: baseline; gap: 7px; }
.mv-code {
  font-family: var(--mono, ui-monospace, monospace); font-size: 11.5px; font-weight: 600;
  background: var(--bg2); border-radius: 4px; padding: 1.5px 5px; color: var(--ink2);
  flex: 0 0 auto;
}
.mv-nm {
  flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* The price is the scan target in a property list, so it outranks the name
   rather than tying with it. */
.mv-pr {
  flex: 0 0 auto; font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.mv-row-2 {
  display: flex; align-items: baseline; gap: 7px; margin-top: 3px;
  font-size: 11px; color: var(--ink3);
}
.mv-loc { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-cfg { flex: 0 0 auto; }
/* The precision badge — what tells an agent whether a distance from this
   property may be quoted.
   Only the EXCEPTION is marked. An exact pin is what everything should be, so
   it says nothing; five amber chips out of seven rows discriminated nothing
   and were simply the loudest thing in the list. And the marker is structural
   (a dashed outline) rather than a tint, because the tint shared its hue with
   the selected row. 11px, not 9.5px: below 11px this fails contrast at any
   colour. */
.mv-ax {
  flex: 0 0 auto; font-size: 11px; font-weight: 500;
  padding: 0 5px; border-radius: 4px; letter-spacing: .01em;
  color: var(--ink3); border: 1px dashed var(--border2); background: none;
}
.mv-ex { display: none; }

/* ═══════ RESIZER ═══════ */

#mapResizer {
  position: relative; cursor: col-resize;
  background: var(--border); border: 0; padding: 0;
  touch-action: none;
}
#mapResizer::after {
  content: ''; position: absolute; inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 3px; height: 34px; border-radius: 3px;
  background: var(--ink3); opacity: .42;
}
#mapResizer:hover { background: color-mix(in srgb, var(--gold) 34%, var(--border)); }
#mapResizer:hover::after { opacity: .85; }
#mapResizer:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }

/* ═══════ MAP PANE ═══════ */

#mapPane { position: relative; min-width: 0; background: var(--bg2); }
#mapCanvasHost { position: absolute; inset: 0; }
.mv-canvas { position: absolute; inset: 0; }
.mv-canvas.pin-mode { cursor: crosshair; }
/* A column flex box with align-items:center shrinks each child to its own
   content width, and inside an absolutely positioned parent that collapsed the
   whole message into a ~90px ribbon reading one word per line. The inner
   wrapper owns the width instead. */
.mv-load, .mv-problem {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  padding: 24px; text-align: center; color: var(--ink3); font-size: 13px;
}
.mv-problem > div, .mv-problem > h3, .mv-problem > p { max-width: 100%; }
.mv-problem-in {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: min(460px, 100%);
}
.mv-problem-i { font-size: 30px; opacity: .5; }
.mv-problem h3 { margin: 0; font-family: var(--serif); font-size: 19px; color: var(--ink); font-weight: 600; }
.mv-problem p { margin: 0; max-width: 46ch; line-height: 1.6; }
.mv-problem .mv-fix { color: var(--ink2); }
.mv-problem .mv-still {
  margin-top: 9px; padding: 10px 13px; border-radius: 11px;
  background: var(--green-bg); color: var(--ink2); font-size: 12px;
}

/* ═══════ FLOATING PANELS OVER THE MAP ═══════ */

#mapCard, #mapPinList, #mapPinMode {
  position: absolute; z-index: 5;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 15px; box-shadow: var(--shadow-lg);
}
/* Bottom RIGHT, not bottom left.
   On the left it opened flush against the property list, and between the two
   of them there was no map left to look at — which is most of the point of
   being in Split view. Against the far edge the map stays visible in the
   middle, where the pins are, and the card sits where the reference
   dashboards put it. */
#mapCard {
  right: 14px; bottom: 14px; width: min(340px, calc(100% - 28px));
  max-height: calc(100% - 28px); overflow-y: auto; padding: 14px 16px 15px;
}
/* Above the card, because both now live on the right and this one is a
   report the agent opens, reads and dismisses. */
#mapPinList {
  z-index: 6;
  right: 14px; top: 14px; width: min(400px, calc(100% - 28px));
  max-height: calc(100% - 28px); overflow-y: auto; padding: 13px 15px 14px;
}
#mapPinMode { left: 50%; top: 14px; transform: translateX(-50%); width: min(430px, calc(100% - 28px)); padding: 12px 15px; }

.mv-card-x {
  position: absolute; right: 9px; top: 9px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--card);
  color: var(--ink3); font-size: 12px; cursor: pointer; line-height: 1;
}
.mv-card-x:hover { background: var(--bg2); color: var(--ink); }

.mv-card-hd { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; padding-right: 34px; }
.mv-card-hd b { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); }
.mv-sold {
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--red); background: var(--red-bg); padding: 2px 6px; border-radius: 4px;
}
.mv-card-sub { font-size: 12px; color: var(--ink3); margin-top: 3px; }
.mv-card-price {
  font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink);
  margin: 7px 0 0; display: flex; align-items: baseline; gap: 8px;
}
.mv-card-price i { font-family: var(--sans); font-style: normal; font-size: 11.5px; color: var(--ink3); }

.mv-prec {
  font-size: 11.5px; line-height: 1.55; margin: 9px 0 0;
  padding: 8px 11px; border-radius: 10px;
}
.mv-prec.ax { background: var(--amber-bg); color: var(--ink2); }
.mv-prec.ex { background: var(--green-bg); color: var(--ink2); }
.mv-prec b { color: var(--ink); }

.mv-link {
  font: inherit; font-size: inherit; background: none; border: 0; padding: 0;
  color: var(--gold); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
.mv-link:hover { opacity: .8; }

.mv-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.mv-btn {
  font: inherit; font-size: 11.5px; font-weight: 600;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border2); background: var(--card); color: var(--ink2);
  text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
}
.mv-btn:hover { background: var(--bg2); color: var(--ink); }
.mv-btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.mv-btn.primary:hover { background: var(--ink2); }
.mv-btn.primary[disabled] {
  background: var(--bg2); border-color: var(--border); color: var(--ink3);
  opacity: 1; cursor: not-allowed;
}
.mv-btn.ghost { border-style: dashed; }
.mv-btn.sm { font-size: 11px; padding: 4px 10px; }

/* ═══════ ANSWERS ═══════ */

.mv-answer:not(:empty) { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 11px; }
.mv-a-hd { font-size: 12.5px; font-weight: 700; color: var(--ink); margin-bottom: 7px; }
.mv-a-busy, .mv-a-note { font-size: 11.5px; color: var(--ink3); line-height: 1.55; }
.mv-a-note { margin-top: 7px; }
.mv-a-err { font-size: 12px; color: var(--red); line-height: 1.55; }

.mv-a-list { display: flex; flex-direction: column; gap: 2px; }
/* 96px for a distance like "0.6 km" was hoarding width from the one column
   that is read out loud, so every place name ellipsised — "PSBB Millennium
   School S…" in a 370px card. */
.mv-a-row {
  display: grid; grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 9px; align-items: baseline; width: 100%; text-align: left;
  font: inherit; font-size: 12px; cursor: pointer;
  background: transparent; border: 0; border-radius: 8px; padding: 6px 8px;
}
.mv-a-row:hover { background: var(--bg2); }
.mv-a-row.static { cursor: default; }
.mv-a-row.static:hover { background: transparent; }
.mv-a-d { color: var(--ink2); font-weight: 650; font-variant-numeric: tabular-nums; }
.mv-a-n { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mv-a-n i { font-style: normal; color: var(--ink3); font-size: 11.5px; margin-left: 6px; }
.mv-a-p { max-width: 84px; overflow: hidden; text-overflow: ellipsis; }
.mv-a-p { color: var(--ink3); font-size: 11px; white-space: nowrap; }

.mv-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 9px; }
.mv-chip {
  font: inherit; font-size: 12px; font-weight: 550;
  padding: 5px 11px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--ink2);
}
.mv-chip:hover { border-color: var(--ink3); }
.mv-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

.mv-dist-row { display: flex; gap: 6px; }
.mv-dist-row input {
  flex: 1 1 auto; min-width: 0; font: inherit; font-size: 12.5px;
  padding: 7px 10px; border-radius: 9px;
  border: 1px solid var(--border2); background: var(--bg); color: var(--ink);
}
.mv-dist-row input:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.mv-dist-out { margin-top: 10px; }
.mv-dist-to { font-size: 12px; color: var(--ink2); margin-bottom: 8px; }
.mv-dist-n { display: flex; flex-wrap: wrap; gap: 8px; }
.mv-dist-n span {
  flex: 1 1 96px; background: var(--bg2); border-radius: 10px; padding: 8px 10px;
}
.mv-dist-n b { display: block; font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--ink); }
.mv-dist-n i { display: block; font-style: normal; font-size: 11.5px; color: var(--ink3); margin-top: 1px; }

/* ═══════ PIN LIST / PIN MODE ═══════ */

.mv-pl-hd { display: flex; align-items: baseline; gap: 9px; padding-right: 26px; font-size: 13px; }
.mv-pl-why { font-size: 11.5px; color: var(--ink3); line-height: 1.55; margin: 5px 0 11px; }
.mv-pl-l { display: flex; flex-direction: column; gap: 8px; }
.mv-pl-r { border: 1px solid var(--border); border-radius: 11px; padding: 9px 11px; }
.mv-pl-p { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; font-size: 12.5px; }
.mv-pl-loc { color: var(--ink3); font-size: 11px; }
.mv-pl-a { font-size: 11px; color: var(--ink3); line-height: 1.5; margin: 4px 0 8px; }
.mv-pl-a i { font-style: normal; color: var(--ink2); }
.mv-pl-acts { display: flex; gap: 5px; flex-wrap: wrap; }

.mv-pm-t { font-size: 13px; font-weight: 650; color: var(--ink); }
.mv-pm-s { font-size: 11.5px; color: var(--ink3); line-height: 1.5; margin: 4px 0 10px; }
.mv-pm-a { display: flex; gap: 6px; }

.mv-empty { padding: 26px 16px; text-align: center; color: var(--ink3); font-size: 12.5px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════════════════
   MARKERS

   Rendered as HTML through an OverlayView (see map-core.js), which is what
   allows a price pill at all. The transform centres each on its point without
   measuring, so a two-character label and a nine-character one both sit
   correctly over the coordinate.
   ═══════════════════════════════════════════════════════════════════════ */

.gm-pin {
  position: absolute; transform: translate(-50%, -50%);
  cursor: pointer; user-select: none;
  font-family: var(--sans, system-ui, sans-serif);
  will-change: transform;
}
.gm-pin:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 999px; }

/* ── A property ── */
.gm-prop {
  display: flex; align-items: center; gap: 3px;
  background: var(--card, #fff);
  border: 1px solid rgba(0,0,0,.14);
  border-radius: 999px;
  padding: 3.5px 9px;
  box-shadow: 0 1px 2px rgba(0,0,0,.14), 0 3px 9px rgba(0,0,0,.10);
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}
.gm-prop .gm-p-l {
  font-family: var(--serif, Georgia, serif);
  font-size: 12px; font-weight: 600; letter-spacing: -.01em;
  color: var(--ink, #1c1917); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* The chip that says this pin is at a locality, not an address. A tooltip
   alone would not do — an agent reads the map, not the title attributes —
   but it has to sit clearly APART from the price, or "₹2.9 Cr ~" reads as a
   qualifier on the money rather than on the position. */
.gm-prop .gm-p-a {
  flex: 0 0 auto; margin-left: 2px;
  width: 13px; height: 13px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 8.5px; line-height: 1; font-weight: 700;
  color: #fff; background: var(--amber, #8a4b00);
}
.gm-prop.sel .gm-p-a { background: #e0a852; color: #3a2a10; }
.gm-prop.approx { border-style: dashed; border-color: color-mix(in srgb, var(--amber, #b45309) 52%, rgba(0,0,0,.12)); }
.gm-prop.sold { opacity: .6; }
.gm-prop.sold .gm-p-l { text-decoration: line-through; }
.gm-prop.scored .gm-p-l { color: var(--green, #15803d); }

.gm-prop:hover, .gm-prop.hot {
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 2px 4px rgba(0,0,0,.16), 0 7px 18px rgba(0,0,0,.14);
  z-index: 30;
}
/* The one saturated thing on screen. */
.gm-prop.sel {
  background: var(--ink, #1c1917); border-color: var(--ink, #1c1917);
  transform: scale(1.1); z-index: 40;
  box-shadow: 0 3px 6px rgba(0,0,0,.24), 0 10px 26px rgba(0,0,0,.20);
}
.gm-prop.sel .gm-p-l { color: #fff; }
.gm-prop.sel .gm-p-a { color: #f8d9a0; }

/* The pin being placed. */
.gm-prop.ghost {
  background: var(--gold, #b45309); border-color: var(--gold, #b45309);
  animation: mvGhost 1.1s ease-in-out 3;
}
.gm-prop.ghost .gm-p-l { color: #fff; }
/* Runs three times and stops. An indefinite pulse on a tool somebody stares
   at for an hour is exactly what the header of this sheet forbids. */
@keyframes mvGhost { 0%,100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-3px) scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .gm-prop.ghost { animation: none; } }

/* ── A locality cluster ──
   Not a circle with a number. The locality NAME plus a price range is the
   thing an agent needs at that zoom, and the count alone tells them nothing
   they can use on a call. */
.gm-cluster {
  display: flex; align-items: center; gap: 8px;
  background: var(--card, #fff);
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 999px; padding: 4px 12px 4px 5px;
  box-shadow: 0 1px 3px rgba(0,0,0,.14), 0 5px 16px rgba(0,0,0,.12);
  transition: transform .12s ease, box-shadow .12s ease;
}
.gm-cluster:hover { transform: scale(1.05); box-shadow: 0 3px 6px rgba(0,0,0,.18), 0 9px 24px rgba(0,0,0,.16); z-index: 30; }
.gm-cl-n {
  flex: 0 0 auto; min-width: 25px; height: 25px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink, #1c1917); color: #fff;
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 0 6px;
}
.gm-cluster.big .gm-cl-n { background: var(--gold, #b45309); }
.gm-cl-t { display: flex; flex-direction: column; line-height: 1.2; }
.gm-cl-t b { font-size: 11.5px; font-weight: 650; color: var(--ink, #1c1917); white-space: nowrap; }
.gm-cl-t i {
  font-family: var(--serif, Georgia, serif); font-style: normal;
  font-size: 11.5px; color: var(--ink3, #655E59); white-space: nowrap;
}

/* ═══════ NARROW ═══════
   On a phone the split is not a split: there is not room for two panes, so
   the mode switch becomes a genuine either/or and the map takes the height
   it needs to be usable. */
/* ═══════ NARROW ═══════
   There is no room for two panes on a phone, so Split is not offered: the
   mode switch becomes a genuine either/or (map-view.js forces it). Stacking
   them put a 108vh shell inside a scrolling page, left the map below the
   fold, and — because the card renders INSIDE the map pane — made tapping a
   row produce no visible response at all. */
@media (max-width: 860px) {
  #mapShell { grid-template-columns: 1fr; height: auto; }
  #mapResizer { display: none; }
  #mapShell[data-mode="map"] #mapListPane { display: none; }
  #mapShell[data-mode="map"] #mapPane { height: 68vh; }
  #mapShell[data-mode="list"] #mapPane,
  #mapShell[data-mode="split"] #mapPane { display: none; }
  #mapListPane { border-right: 0; }
  #mapList { max-height: 70vh; }

  /* The card becomes a bottom sheet on the viewport, not a box inside a pane
     that may be scrolled out of sight. */
  #mapCard {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    /* 72vh covered the map completely: a phone's map pane is about 620px of
       an 844px screen once the header has taken its share, and 72vh is 608.
       The agent tapped a pin and every other pin vanished, along with any
       sense of where the property actually is. Capped so a strip of map
       always shows above the sheet — enough to keep the bearings and to see
       that there is something to go back to. The sheet scrolls inside
       itself, which is how a phone sheet is meant to work anyway. */
    width: auto; max-height: 58vh; z-index: 260;
    border-radius: 16px 16px 0 0; border-bottom: 0;
    padding-bottom: calc(15px + env(safe-area-inset-bottom, 0px));
  }
  #mapCard::before {
    content: ''; display: block; width: 36px; height: 4px; margin: -4px auto 10px;
    border-radius: 2px; background: var(--border2);
  }
  #mapPinList, #mapPinMode {
    position: fixed; left: 8px; right: 8px; top: 8px; width: auto; z-index: 260;
    transform: none;
  }
  /* The price is never the column to drop — it is usually the question. */
  .mv-a-row { grid-template-columns: 72px minmax(0, 1fr) auto; gap: 7px; }
  .mv-a-d { font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   ADDED AFTER REVIEW
   ═══════════════════════════════════════════════════════════════════════ */

/* The facts an agent reads out loud, which the card used to omit entirely
   even though the grid card it replaced carried all of them. */
.mv-facts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.mv-fact {
  font-size: 11.5px; color: var(--ink2);
  background: var(--bg2); border-radius: 6px; padding: 3px 8px;
}
.mv-fact.ok { color: var(--green); background: var(--green-bg); font-weight: 600; }
.mv-fact.warn { color: var(--amber); background: var(--amber-bg); }

/* Four variants of one question used to sit in the action row as four equal
   pills alongside the real actions. They are questions, so they live together
   under a label, below the actions. */
.mv-asks {
  display: flex; flex-wrap: wrap; gap: 5px; align-items: center;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border);
}
.mv-asks-l {
  flex: 1 0 100%; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink3); font-weight: 700; margin-bottom: 2px;
}

/* Sending is the action the whole panel exists for, so it reads as one. */
.mv-btn.send {
  background: var(--green-bg); border-color: color-mix(in srgb, var(--green) 38%, transparent);
  color: var(--green); font-weight: 650;
}
.mv-btn.send:hover { background: color-mix(in srgb, var(--green) 18%, var(--green-bg)); color: var(--green); }

.mv-pm-l { font-size: 11.5px; color: var(--ink3); margin-top: 2px; }

/* ── FOCUS ──
   There were three focus-visible rules in the whole sheet, so a keyboard user
   tabbing the card's actions and the eight category chips could not see where
   they were — and on the black primary and the black active chip the UA ring
   is nearly invisible, which is why the dark variants get a light ring. */
.mv-btn:focus-visible, .mv-chip:focus-visible, .mv-mode:focus-visible,
.mv-pb-b:focus-visible, .mv-card-x:focus-visible, .mv-link:focus-visible,
.mv-a-row:focus-visible, .mv-dist-row input:focus-visible {
  outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 999px;
}
.mv-btn.primary:focus-visible, .mv-chip.on:focus-visible {
  outline-color: var(--gold-bg);
}
.mv-a-row:focus-visible { border-radius: 8px; }

/* A static row must not look like a control. These three were styled
   identically to the clickable nearby-property rows. */
.mv-a-row.static { border-radius: 0; padding: 6px 8px; cursor: default; }
.mv-a-row.static + .mv-a-row.static { border-top: 1px solid var(--border); }

/* A marker is tapped on a phone map, where a 24px pill is under target. */
.gm-pin::before { content: ''; position: absolute; inset: -9px; }
.gm-prop, .gm-cluster { position: relative; }

/* ═══════════════════════════════════════════════════════════════════════
   CONTEXT — Street View and ground height
   Two questions an agent used to leave the page for.
   ═══════════════════════════════════════════════════════════════════════ */

.mv-context:not(:empty) { margin-top: 11px; display: flex; flex-direction: column; gap: 8px; }

.mv-sv { display: block; position: relative; border-radius: 11px; overflow: hidden; text-decoration: none; }
/* A fixed aspect, not height:auto. Street View is requested at 336x150, but
   an unexpected reply (or a placeholder) at any other ratio then sized itself
   off its own width and turned the card into one enormous block. */
.mv-sv img {
  display: block; width: 100%; aspect-ratio: 336 / 150; height: auto;
  object-fit: cover; background: var(--bg2);
}
.mv-sv-t {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 10px 6px; font-size: 11.5px; color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,.62));
}
.mv-sv:hover img { filter: brightness(1.04); }

/* Ground height. Deliberately not a red/green risk badge: altitude is
   measured, flood risk is not, and a colour-coded verdict would be read as
   one. */
.mv-elev {
  font-size: 11.5px; line-height: 1.55; color: var(--ink2);
  background: var(--bg2); border-radius: 10px; padding: 8px 11px;
}
.mv-elev b { color: var(--ink); font-family: var(--serif); font-size: 14px; }
.mv-elev i { display: block; font-style: normal; font-size: 11.5px; color: var(--ink3); margin-top: 2px; }
.mv-elev.low, .mv-elev.lowish { border-left: 3px solid var(--amber); }

/* ═══════ TYPE-AHEAD ═══════ */

.mv-ac {
  margin-top: 5px; border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; background: var(--card); box-shadow: var(--shadow);
  max-height: 210px; overflow-y: auto;
}
.mv-ac-i {
  display: block; width: 100%; text-align: left; font: inherit;
  background: none; border: 0; border-bottom: 1px solid var(--border);
  padding: 7px 11px; cursor: pointer;
}
.mv-ac-i:last-child { border-bottom: 0; }
.mv-ac-i:hover, .mv-ac-i:focus-visible { background: var(--bg2); }
.mv-ac-i b { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.mv-ac-i i { display: block; font-style: normal; font-size: 11px; color: var(--ink3); margin-top: 1px; }

.mv-modes-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.mv-chip.sm { font-size: 11.5px; padding: 3px 9px; }

/* The travel time is the answer; the straight line is a footnote. It used to
   be given first, so an agent read out the least useful number of the three. */
.mv-dist-n span.lead { flex: 1 1 100%; background: var(--gold-lt); }
.mv-dist-n span.lead b { font-size: 21px; }

/* A caveat the agent has to notice before quoting the row above it. */
.mv-a-note.warn {
  background: var(--amber-bg, #FDF0D5);
  color: var(--amber, #8A4B00);
  border-left: 2px solid currentColor;
  padding: 6px 9px;
  border-radius: 0 4px 4px 0;
  margin: 6px 0;
}

/* ═══════ THE NAME, ON THE PIN BEING POINTED AT ═══════
   A price pill tells an agent what a property costs but not which one it is,
   and clicking every pin to find out is the thing that sends them back to
   another window. The name sits above the pill as a dark tab with a pointer
   — only while that pin is hovered or selected, because 130 of these on
   screen at once is a wall of overlapping text, not a map.

   position:absolute against the marker, so it adds no width to the pill and
   cannot push neighbouring markers around. */
.gm-p-n {
  display: none;
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 220px;
  padding: 5px 10px;
  border-radius: 7px;
  background: var(--ink, #1C1917);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 3px 10px rgba(0,0,0,.24);
  pointer-events: none;
}
/* The little pointer down to the pill. */
.gm-p-n::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--ink, #1C1917);
}
.gm-prop.sel .gm-p-n,
.gm-prop.hot .gm-p-n { display: block; }

/* ═══════ THE BOXED STATS ON THE CARD ═══════
   The three facts an agent reads out before anything else. Boxes rather than
   a run-on line because they are scanned, not read. */
.mv-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0 2px;
}
.mv-stats:has(.mv-stat:only-child) { grid-template-columns: minmax(0, 1fr); }
.mv-stat {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg);
}
.mv-stat-k {
  font-size: 11.5px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--ink3, #655E59);
}
.mv-stat-v {
  margin-top: 3px; font-size: 13px; font-weight: 650; color: var(--ink);
  /* Wraps rather than ellipsising. "1750-1900 sq ft" does not fit one line of
     a third of the card, and "1750-1900 ..." is a worse answer than two
     lines — the number is the whole reason the box is there. */
  overflow-wrap: anywhere; line-height: 1.3;
}

/* ═══════ ON A PHONE, EVERY TAP TARGET IS A THUMB ═══════
   This is the screen an agent holds standing in front of a client, and none
   of it had been measured at phone width with a property open. The question
   chips — "Nearby, 5 km", "Schools, hospitals, metro" — were 28px tall, and
   "Drop the exact pin" was an 18px line of text inside a sentence. WCAG
   exempts an inline link like that one, but a thumb does not care what the
   spec exempts.

   36px is the floor here: comfortably hit while talking to someone, without
   turning the card into a page of buttons. */
@media (max-width: 720px) {
  .mv-chip, .mv-asks .mv-chip {
    min-height: 36px; padding: 8px 13px; font-size: 12.5px;
    display: inline-flex; align-items: center;
  }
  .mv-btn { min-height: 40px; }
  .mv-asks-l { font-size: 11.5px; }
  /* Inline links get vertical room without breaking the sentence they sit
     in: the padding overlaps the line above and below rather than pushing
     them apart. */
  .mv-link { padding: 7px 0; margin: -7px 0; }
  .mv-card-x { width: 38px; height: 38px; }
}
