/* The explore map component (ADR-0056): the same look in the home page box and on /map. */

/* The component's own colours, in one block (DESIGN.md, the Tokens Only Rule). Two kinds, and the difference is
   what the thing sits on. A panel sits on the page, so it takes the theme's token and matches the panels around
   it: on the home that is `themes/lottruth.css`, and the fallback stands in on /map, which carries no theme.
   Chrome sits on the map tiles, and both basemaps (streets and aerial, services/web/src/mapconfig.ts) are light
   in either colour scheme, so chrome keeps one fill and one ink and does not follow the page into the dark.
   Measured 2026-11-22: before this block the lot card's dark was #1b2630, a cold navy, while every other panel on
   the page was the theme's #1B1C1A. One card in the wrong dark, because its colours were written twice. */
.xm-box{--xm-paper:var(--panel,#fff);--xm-ink:var(--ink,#14212b);--xm-muted:var(--muted,#5b6670);--xm-line:var(--line,#c9cfc4);--xm-tint:var(--tint,#eef0ec);--xm-act:var(--act,#2e4a5f);--xm-act-ink:var(--act-ink,#fff);--xm-brand-text:var(--brand-text,#2e4a5f);--xm-chrome:#fff;--xm-chrome-ink:#14212b;--xm-chrome-line:#c9cfc4;--xm-chrome-muted:#5b6670}
@media(prefers-color-scheme:dark){.xm-box{--xm-paper:var(--panel,#1b1c1a);--xm-ink:var(--ink,#eceee4);--xm-muted:var(--muted,#b2b3aa);--xm-line:var(--line,#3b3c37);--xm-tint:var(--tint,#1f2a33);--xm-act:var(--act,#365a75);--xm-brand-text:var(--brand-text,#a9c3d8)}}

.xm-box{position:relative;overflow:hidden;background:#e9ece6;font:16px/1.4 system-ui,-apple-system,sans-serif;color:var(--xm-chrome-ink)}
.xm-embed{height:520px;border:3px solid var(--rule,#14212b)}
.xm-page{position:fixed;inset:0}
.xm-box.maplibregl-pseudo-fullscreen,.xm-box:fullscreen{height:100%;border:0}
.xm-canvas{position:absolute;inset:0}
/* a control on the map is square and flat (DESIGN.md, the Square Control Rule and the Soft Lift Rule): a 2px ink
   rule holds it off the imagery, where a shadow used to */
.xm-switch{position:absolute;top:10px;left:10px;display:flex;z-index:3;border:2px solid var(--xm-chrome-ink)}
.xm-page .xm-switch{top:calc(70px + env(safe-area-inset-top))}
.xm-switch button{border:0;background:var(--xm-chrome);color:var(--xm-chrome-ink);font:600 14px system-ui,sans-serif;padding:9px 14px;cursor:pointer;min-height:40px}
.xm-switch button[aria-pressed="true"]{background:var(--xm-chrome-ink);color:var(--xm-chrome)}
.xm-hint{position:absolute;top:58px;left:10px;margin:0;background:rgba(20,33,43,.85);color:#fff;font-size:13px;padding:6px 10px;z-index:3}
.xm-page .xm-hint{top:calc(118px + env(safe-area-inset-top))}
.xm-credit{position:absolute;left:4px;bottom:2px;margin:0;font-size:10.5px;color:var(--xm-chrome-ink);background:rgba(255,255,255,.75);padding:1px 5px;z-index:2;max-width:70%}
.xm-sheet{position:absolute;left:0;right:0;bottom:0;max-width:620px;margin:0 auto;background:var(--xm-paper);color:var(--xm-ink);padding:16px 16px calc(16px + env(safe-area-inset-bottom));box-shadow:0 -6px 24px rgba(0,0,0,.25);z-index:4;max-height:65%;overflow:auto}
.xm-sheet h2{margin:0 40px 2px 0;font-size:19px;line-height:1.25}
.xm-sub{margin:0 0 10px;color:var(--xm-muted);font-size:14px}
.xm-x{position:absolute;top:8px;right:8px;width:38px;height:38px;border:0;background:var(--xm-tint);color:var(--xm-ink);font-size:22px;cursor:pointer}
.xm-dl{display:grid;grid-template-columns:minmax(110px,40%) 1fr;gap:5px 12px;margin:0 0 12px;font-size:15px}
.xm-dl dt{color:var(--xm-muted)}.xm-dl dd{margin:0;font-weight:600;overflow-wrap:anywhere}
.xm-go{display:flex;gap:10px;flex-wrap:wrap;margin:0}
/* the card's price line (main, v0.77.0), in the component's own tokens like every other colour here */
.xm-price{margin:8px 0 0;font-size:13px;color:var(--xm-muted)}
.xm-buy{flex:1 1 220px;text-align:center;background:var(--xm-act);color:var(--xm-act-ink);font-weight:700;padding:13px 16px;text-decoration:none}
.xm-open{flex:0 1 auto;text-align:center;border:2px solid var(--xm-brand-text);color:var(--xm-brand-text);font-weight:700;padding:11px 16px;text-decoration:none}
.xm-wait{margin:0;color:var(--xm-muted)}
.xm-search{position:absolute;top:calc(10px + env(safe-area-inset-top));left:10px;right:10px;max-width:560px;margin:0 auto;display:flex;align-items:center;gap:8px;background:var(--xm-chrome-ink);padding:6px 6px 6px 14px;z-index:5}
.xm-home{color:#fff;font-weight:800;text-decoration:none;white-space:nowrap;font-size:15px}
.xm-search input{flex:1;min-width:0;border:0;background:var(--xm-chrome);color:var(--xm-chrome-ink);font-size:16px;padding:11px 12px;border-radius:0}
.xm-search ul{position:absolute;top:100%;left:0;right:0;margin:0;padding:0;list-style:none;background:var(--xm-chrome);border:2px solid var(--xm-chrome-ink);border-top:0;max-height:60vh;overflow:auto}
.xm-search ul button{display:block;width:100%;text-align:left;border:0;border-top:1px solid var(--xm-chrome-line);background:var(--xm-chrome);padding:12px 14px;font:inherit;cursor:pointer;color:var(--xm-chrome-ink)}
.xm-search ul button span{display:block;color:var(--xm-chrome-muted);font-size:14px}.xm-none{padding:12px 14px;color:var(--xm-chrome-muted)}
@media(max-width:720px){.xm-embed{height:420px}}
.xm-lot{height:440px;border:1px solid var(--line,#c9cfc4);margin:6px 0 22px}.xm-h{margin:22px 0 6px}@media(max-width:720px){.xm-lot{height:360px}}
.xm-switch .xm-hz{margin-left:6px}
/* the lot card: compact; on a wide map a card at the side, so the lot stays in view (2026-11-19) */
.xm-sheet{padding:12px 14px calc(12px + env(safe-area-inset-bottom));max-height:48%}
.xm-sheet h2{font-size:17px}.xm-sub{margin:0 0 6px;font-size:13px}
.xm-dl{font-size:14px;gap:3px 10px;margin:0 0 10px;grid-template-columns:auto 1fr}
.xm-buy{padding:10px 12px;font-size:15px}.xm-open{padding:8px 12px;font-size:15px}
.xm-x{width:32px;height:32px;font-size:19px;top:6px;right:6px}
@media(min-width:760px){.xm-box:not(.xm-lot) .xm-sheet,.xm-lot .xm-sheet{left:auto;right:12px;bottom:auto;top:62px;width:320px;max-height:calc(100% - 80px);margin:0;box-shadow:0 6px 24px rgba(0,0,0,.25)}}
.xm-tz{border-top:1px solid var(--xm-line);margin:0 0 10px;padding-top:8px}.xm-tz-h{margin:0 0 4px;font-weight:700;font-size:14px}
.xm-tz ul{margin:0;padding:0;list-style:none;display:grid;gap:3px;font-size:13.5px}.xm-tz li::before{content:"";display:inline-block;width:8px;height:6px;margin-right:7px;border:2px solid currentColor;border-top-width:4px;border-radius:2px;vertical-align:0;opacity:.6}
/* buttons sized to the card, side by side (2026-11-19: "buy button is too big") */
.xm-go{gap:8px;flex-wrap:nowrap}.xm-buy{flex:1 1 auto;padding:8px 10px;font-size:14px;white-space:nowrap}.xm-open{flex:0 0 auto;padding:6px 10px;font-size:14px}
/* the way to the report stays on the card (measured 2026-11-22, iPhone width 390): the records above it are taller
   than the card is on a phone, which pushed both buttons 86px past the card's own bottom edge, out of sight unless
   the reader thought to scroll a card they could see all of. The actions hold the foot and the records scroll behind
   them, so what the card is for is never the part that falls off. */
.xm-sheet .xm-go{position:sticky;bottom:0;background:var(--xm-paper);border-top:1px solid var(--xm-line);padding:8px 0 0;margin-top:2px}
.xm-hzl{margin:0 0 8px}.xm-hzl:empty{display:none}.xm-chip{display:inline-flex;align-items:center;gap:5px;font-size:12.5px;margin:0 8px 4px 0}.xm-chip i{width:11px;height:11px;display:inline-block;border:1px solid var(--xm-line)}.xm-hzl-none{margin:0;font-size:12.5px;color:var(--xm-muted)}
/* the map key (2026-11-19: "hazard colors don't mean anything to me"): a panel over the map, drawn the way the lot
   card is, which DESIGN.md allows a shadow on at this one place */
.xm-legend{position:absolute;left:10px;bottom:26px;z-index:3;background:var(--xm-paper);color:var(--xm-ink);border:1px solid var(--xm-line);box-shadow:0 2px 10px rgba(0,0,0,.25);padding:8px 10px;max-width:250px;max-height:45%;overflow:auto}
.xm-legend-h{margin:0 0 4px;font:700 12px/1.2 system-ui,sans-serif;letter-spacing:.04em;text-transform:uppercase;color:var(--xm-muted)}
.xm-legend button{display:flex;align-items:center;gap:7px;width:100%;text-align:left;border:0;background:none;padding:4px 0;font:13px/1.25 system-ui,sans-serif;color:var(--xm-ink);cursor:pointer}
.xm-legend button i{flex:none;width:14px;height:14px;border:1px solid var(--xm-line)}
.xm-legend button[aria-pressed="false"]{opacity:.45;text-decoration:line-through}
/* controls (2026-11-19): map type is a segmented control, layers are on/off toggles with a check */
.xm-controls{position:absolute;top:10px;left:10px;z-index:3;display:flex;flex-wrap:wrap;gap:8px;align-items:center;max-width:calc(100% - 70px)}
.xm-page .xm-controls{top:calc(70px + env(safe-area-inset-top))}
.xm-controls .xm-switch{position:static;display:inline-flex;background:var(--xm-chrome);padding:0;border:2px solid var(--xm-chrome-ink)}
.xm-controls .xm-switch button{background:transparent;color:var(--xm-chrome-ink);padding:7px 14px;min-height:34px;font:600 14px system-ui,sans-serif}
.xm-controls .xm-switch button+button{border-left:1px solid var(--xm-chrome-line)}
.xm-controls .xm-switch button[aria-checked="true"]{background:var(--xm-chrome-ink);color:var(--xm-chrome);border-left-color:var(--xm-chrome-ink)}
.xm-layers{display:inline-flex;flex-wrap:wrap;gap:6px}  /* three toggles are three units, not one: on a 390px phone they wrapped as a block and cut 'Terrain' off
     at the map's right edge (measured 2026-11-22) */
.xm-tg{display:inline-flex;align-items:center;gap:6px;border:2px solid var(--xm-chrome-ink);background:var(--xm-chrome);color:var(--xm-chrome-ink);font:600 14px system-ui,sans-serif;padding:6px 12px;min-height:36px;cursor:pointer}
.xm-tg::before{content:"";width:14px;height:14px;border:2px solid var(--xm-chrome-muted);background:var(--xm-chrome);flex:none}
.xm-tg[aria-pressed="true"]::before{background:var(--xm-act) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8l3 3 7-7' fill='none' stroke='%23fff' stroke-width='2.4'/%3E%3C/svg%3E") center/12px no-repeat;border-color:var(--xm-act)}
.xm-hint{top:auto;bottom:26px;left:50%;transform:translateX(-50%);padding:6px 12px}
.xm-page .xm-hint{top:auto}
.xm-elev .maplibregl-popup-content{padding:6px 10px;font:13px/1.3 system-ui,sans-serif;color:var(--xm-chrome-ink);border-radius:0;box-shadow:none;border:1px solid var(--xm-chrome-ink)}
.xm-home{padding:6px 10px 6px 4px}.xm-home:hover{text-decoration:underline}
/* the library's own zoom and locate buttons come rounded with a shadow; they are controls like any other */
.xm-box .maplibregl-ctrl-group{border-radius:0;box-shadow:none;border:2px solid var(--xm-chrome-ink);background:var(--xm-chrome)}
.xm-box .maplibregl-ctrl-group button{border-radius:0}
.xm-box .maplibregl-ctrl-group button+button{border-top:1px solid var(--xm-chrome-line)}
/* the map needs scripting; without it the box says so and points at the pages that hold the same records */
.xm-nojs{display:grid;align-content:center;gap:10px;min-height:100%;box-sizing:border-box;padding:24px;background:var(--xm-paper);color:var(--xm-ink);font-size:15.5px;line-height:1.5}
.xm-nojs p{margin:0;max-width:52ch}.xm-nojs b{font-weight:700}.xm-nojs a{color:var(--xm-brand-text)}
/* a phone: the open lot card covers the map's foot, so the zoom buttons under it hide while it is open (pinch zooms);
   2026-11-23 walkthrough: they sat under the card and could not be tapped */
.xm-box:has(.xm-sheet:not([hidden])) .maplibregl-ctrl-bottom-right{display:none} /* any width: the desktop card covers them too in the hero row (2026-11-25) */

/* compact card (2026-11-25, the lead: "too big, see the scrollbar"): smaller type and spacing, the price inside the
   pinned button row so it never sits under it, and a narrower desktop card; the whole card fits the home's map */
.xm-sheet{padding:10px 12px calc(10px + env(safe-area-inset-bottom))}
.xm-sheet h2{font-size:15.5px;margin-right:34px}.xm-sub{margin:0 0 6px;font-size:12.5px}
.xm-dl{font-size:13px;gap:2px 10px;margin:0 0 8px;grid-template-columns:auto 1fr}
.xm-tz{margin:0 0 6px;padding-top:6px}.xm-tz-h{font-size:13px;margin:0 0 3px}.xm-tz ul{font-size:12.5px;gap:1px}
.xm-chip{font-size:12.5px}
.xm-sheet .xm-go{flex-wrap:wrap;padding:6px 0 0}.xm-buy{padding:8px 10px;font-size:14px}
.xm-go .xm-price{flex:1 0 100%;margin:4px 0 0;font-size:11.5px;line-height:1.35}
@media(min-width:760px){.xm-box:not(.xm-lot) .xm-sheet,.xm-lot .xm-sheet{width:288px;top:56px;max-height:calc(100% - 68px)}}
@media(max-width:759px){.xm-sheet{max-height:70%}} /* the compact card fits whole on a phone */
