:root {
  --bg: #0b1220; --panel: #141d33; --panel2: #1c2740; --panel3: #243150;
  --line: #2a3654; --text: #eaf0fb; --muted: #9aa9c6;
  --accent: #3b82f6; --accent-2: #60a5fa; --accent-soft: rgba(59,130,246,.16);
  --good: #22c55e; --warn: #f5b73d; --bad: #ef4444;
  --radius: 16px; --radius-sm: 10px; --radius-lg: 20px;
  --shadow: 0 1px 3px rgba(0,0,0,.35), 0 6px 18px rgba(0,0,0,.30);
  --shadow-lg: 0 12px 34px rgba(0,0,0,.5);
}
body.light {
  --bg: #f5f7fb; --panel: #ffffff; --panel2: #eef2f9; --panel3: #e6ecf6;
  --line: #e3e8f1; --text: #0f1b2d; --muted: #5b6b86;
  --accent: #1277e1; --accent-2: #2d6cdf; --accent-soft: rgba(18,119,225,.10);
  --shadow: 0 1px 2px rgba(16,30,54,.06), 0 6px 20px rgba(16,30,54,.09);
  --shadow-lg: 0 14px 38px rgba(16,30,54,.16);
}
body.light .leaflet-popup-content { color: #111; }
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: Inter, -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 18px; background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 600;
}
.brand { font-weight: 800; font-size: 19px; letter-spacing: -.02em; display: flex; align-items: center; gap: 9px; }
.brand svg { display: block; }
.pill {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; font-weight: 600;
  background: var(--panel2); border: 1px solid var(--line); color: var(--muted);
}
.pill.ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, var(--line)); }
.pill.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); }
nav#tabs {
  display: flex; gap: 6px; overflow-x: auto; padding: 9px 12px; scrollbar-width: none;
  background: color-mix(in srgb, var(--panel) 88%, transparent); backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line); position: sticky; top: 50px; z-index: 600;
}
nav#tabs::-webkit-scrollbar { display: none; }
nav#tabs button {
  flex: 0 0 auto; background: transparent; color: var(--muted);
  border: 1px solid transparent; padding: 7px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s ease;
}
nav#tabs button:hover { color: var(--text); background: var(--panel2); }
nav#tabs button.active { color: #fff; background: var(--accent); border-color: var(--accent); box-shadow: 0 2px 10px var(--accent-soft); }
body.light nav#tabs button.active { color: #fff; }
main { padding: 18px; max-width: 1280px; margin: 0 auto; }
.tab { display: none; }
.tab.active { display: block; animation: fadein .22s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
h3 { margin: 22px 0 10px; font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px,1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); }
.card .n { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.card .l { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-weight: 500; }
.list { display: flex; flex-direction: column; gap: 10px; }
.row {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 12px 14px; display: flex; justify-content: space-between; gap: 10px; align-items: center;
  box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.row:hover { box-shadow: var(--shadow-lg); }
.row .sub { color: var(--muted); font-size: 13px; }
.row .right { text-align: right; white-space: nowrap; }
.mono, .mono * { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.toolbar label { font-size: 13px; color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
input, select, textarea {
  background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 9px 11px; font-size: 14px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft); }
button, .btn { background: var(--accent); border: 1px solid var(--accent); color: #fff; cursor: pointer;
  font-weight: 600; font-size: 14px; font-family: inherit; text-decoration: none; display: inline-block;
  padding: 9px 15px; border-radius: var(--radius-sm); transition: filter .15s, transform .05s, box-shadow .15s;
  box-shadow: 0 2px 8px var(--accent-soft); }
button:hover, .btn:hover { filter: brightness(1.08); }
button:active, .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
button.ghost { background: var(--panel2); color: var(--text); border-color: var(--line); box-shadow: none; }
button.ghost:hover { background: var(--panel3); filter: none; }
button.danger { background: var(--bad); border-color: var(--bad); box-shadow: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 12px; margin-bottom: 12px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
/* checkbox fields read as one row (box + text), not box-stacked-above-label */
.form-grid label:has(input[type="checkbox"]) { flex-direction: row; align-items: center; gap: 8px; }
#leaflet-map, #route-map { height: 60vh; min-height: 360px; margin: 8px 0;
  position: relative; z-index: 0; }  /* borderless (Redfin-style); own stacking context keeps zoom +/- below the sticky header */
.heat-legend { position: absolute; right: 12px; bottom: 28px; z-index: 500;
  display: flex; align-items: center; gap: 7px; padding: 6px 10px; border-radius: 9px;
  background: color-mix(in srgb, var(--panel) 88%, transparent); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-size: 11px; color: var(--muted); backdrop-filter: blur(4px); }
.heat-legend .heat-bar { width: 90px; height: 8px; border-radius: 5px;
  background: linear-gradient(90deg, hsl(225 85% 55%), hsl(150 85% 55%), hsl(60 85% 55%), hsl(0 85% 55%)); }
/* Dashboard bento grid */
.bento { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr);
  grid-template-areas:
    "stats stats stats stats"
    "weather weather weather weather"
    "trend trend ai ai"
    "trend trend ai ai"
    "area area events suggest"
    "newest newest newest newest"; }
.b-stats { grid-area: stats; } .b-weather { grid-area: weather; } .b-ai { grid-area: ai; }
.b-trend { grid-area: trend; } .b-area { grid-area: area; } .b-events { grid-area: events; }
.b-suggest { grid-area: suggest; } .b-newest { grid-area: newest; }
.b-tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px; min-width: 0; overflow: hidden; }
.b-tile > h3 { margin: 0 0 10px; font-size: 15px; }
.b-tile .list, .b-events .list, .b-suggest .list { max-height: 320px; overflow: auto; }
.b-newest .list { max-height: none; }
.b-ai { align-self: start; }
.b-weather { display: flex; align-items: center; }
.b-weather .wx-strip { margin: 0; width: 100%; }
@media (max-width: 1000px) {
  .bento { grid-template-columns: 1fr;
    grid-template-areas: "stats" "weather" "trend" "ai" "area" "events" "suggest" "newest"; }
  .b-trend, .b-ai { grid-row: auto; }
}
.link-danger { color: var(--bad); }
.ico { vertical-align: -0.18em; flex: 0 0 auto; }
/* Settings sub-tabs (Integrations / Preferences / Notifications) */
.subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 2px 0 18px;
  border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.subtabs button { background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
  padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; }
.subtabs button:hover { color: var(--text); }
.subtabs button.active { background: var(--accent); color: #fff; border-color: var(--accent);
  box-shadow: 0 2px 10px var(--accent-soft); }
.subpanel > h3:first-child { margin-top: 0; }
/* Integration credential cards (key/ID + secret/token) */
.sec-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 10px; }
.sec-head { font-size: 15px; }
.sec-field { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sec-field label { font-size: 12px; color: var(--muted); font-weight: 600; min-width: 8.5em; }
.sec-field input { flex: 1; min-width: 11em; }
[data-ic] { display: inline-flex; vertical-align: -0.18em; }
.hint { color: var(--muted); font-size: 12px; }
.summary { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 8px 0; }
.tag { font-size: 11px; padding: 2px 6px; border-radius: 6px; background: var(--panel2); border: 1px solid var(--line); color: var(--muted); }
.tag.oh { color: var(--warn); border-color: var(--warn); }
.tag.off { color: var(--bad); border-color: var(--bad); font-size: 13px; vertical-align: middle; }
a { color: var(--accent); }
.leaflet-popup-content { color: #111; }
#version-badge {
  position: fixed; right: 8px; bottom: 6px; z-index: 1000;
  font-size: 10.5px; color: var(--muted); opacity: .6;
  background: rgba(14,23,38,.7); padding: 2px 7px; border-radius: 8px;
  border: 1px solid var(--line); pointer-events: none; font-family: ui-monospace, monospace;
}
.banner { background: #3a2f10; border: 1px solid var(--warn); border-radius: var(--radius-sm);
  padding: 8px 12px; margin: 8px 12px; }
.row-main { min-width: 0; }
.row-main > div:first-child { overflow: hidden; text-overflow: ellipsis; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow); }
.filters label { font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.filters input, .filters select { padding: 6px 8px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .two-col { grid-template-columns: 1fr; } }
/* address autocomplete */
.ac-wrap { position: relative; display: inline-block; }
.ac-wrap input { min-width: 200px; }
.ac-menu { display: none; position: absolute; top: 100%; left: 0; right: 0; z-index: 1200;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px; margin-top: 2px;
  max-height: 240px; overflow: auto; }
.ac-menu div { padding: 8px 10px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--line); }
.ac-menu div:hover { background: var(--accent); color: #fff; }
/* dashboard trend line chart */
.trend-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.trend-svg { width: 100%; height: 230px; display: block; }
.trend-svg .tl { fill: var(--muted); font-size: 11px; }
.trend-svg .tg { stroke: var(--line); stroke-width: 1; }
/* bar chart */
.chart { display: flex; flex-direction: column; gap: 5px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 40px; gap: 8px; align-items: center; font-size: 13px; }
.bar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar { background: var(--panel2); border-radius: 999px; height: 18px; overflow: hidden; }
.bar-fill { background: linear-gradient(90deg, var(--accent), var(--accent-2)); height: 100%; border-radius: 999px; }
.bar-val { text-align: right; color: var(--muted); }
/* listing grid cards */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 10px; }
.gcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; text-decoration: none; color: var(--text); display: block; }
.gcard img { width: 100%; height: 90px; object-fit: cover; }
.gcard-body { padding: 8px; }
/* emoji map markers */
.emoji-marker div { font-size: 20px; text-align: center; line-height: 26px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
/* status tags */
.tag.done { color: var(--good); border-color: var(--good); }
.tag.running { color: var(--warn); border-color: var(--warn); }
.tag.error { color: var(--bad); border-color: var(--bad); }
.qrow { cursor: pointer; }
#leaflet-map, #route-map { height: 55vh; min-height: 320px; }
#map-filters { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.mf { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.mf label { font-size: 12px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.mf input, .mf select { padding: 5px 7px; }
.tile-thumb { width: 56px; height: 42px; object-fit: cover; border-radius: 6px; flex: 0 0 auto; }
.map-center-btn { font-size: 18px; line-height: 30px; text-align: center; width: 32px; height: 32px;
  background: var(--panel); color: var(--text); text-decoration: none; display: block; }
/* "you are here" dot */
.me-dot { width: 14px; height: 14px; border-radius: 50%; background: #2d8cff;
  border: 3px solid #fff; box-shadow: 0 0 0 rgba(45,140,255,.5); animation: mepulse 2s infinite; }
@keyframes mepulse {
  0% { box-shadow: 0 0 0 0 rgba(45,140,255,.5); }
  70% { box-shadow: 0 0 0 13px rgba(45,140,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(45,140,255,0); } }
/* clickable tile title + detail modal */
.tile-title { cursor: pointer; color: var(--text); font-weight: 600; }
.tile-title:hover { color: var(--accent); text-decoration: underline; }
.modal { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.6);
  display: flex; align-items: flex-start; justify-content: center; padding: 20px; overflow: auto; }
.modal-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  max-width: 680px; width: 100%; padding: 0; position: relative; margin-top: 4vh; overflow: hidden; }
.modal-close { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.45);
  border: none; color: #fff; border-radius: 999px; width: 32px; height: 32px; cursor: pointer; z-index: 2; }
/* full-bleed hero photo header */
.modal-hero { width: 100%; height: 300px; background: var(--panel2); }
.modal-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-hero-fb { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 64px; opacity: .25; }
.modal-pad { padding: 16px 20px 20px; }
.modal-pad h2 { margin: 0 8% 6px 0; font-size: 19px; }
.m-price { font-size: 27px; font-weight: 700; line-height: 1.1; }
.m-addr { color: var(--muted); font-size: 15px; margin-top: 2px; }
.stat-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 2px; font-size: 14.5px; }
.stat-strip .dot { color: var(--muted); margin: 0 7px; }
.kv, .facts { display: grid; grid-template-columns: 140px 1fr; gap: 5px 12px; font-size: 13.5px; margin: 8px 0; }
.kv .k, .facts .k { color: var(--muted); }
/* long unbroken values (URLs) must wrap, not overflow/clip the modal */
.kv > div, .facts > div { min-width: 0; overflow-wrap: anywhere; }
.facts { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }
.modal-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
/* Scout AI card */
.ai-card { background: linear-gradient(180deg, var(--accent-soft), transparent), var(--panel);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: var(--radius);
  padding: 14px 16px; margin: 14px 0; box-shadow: var(--shadow); }
.ai-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
@media (max-width: 760px) { .ai-cols { grid-template-columns: 1fr; } }
.ai-sub { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.ai-item { padding: 8px 0; border-bottom: 1px solid var(--line); }
.ai-item:last-child { border-bottom: none; }
.ai-item b { font-size: 14px; }
/* dashboard weather strip */
.wx-strip { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin: 14px 0 4px; }
.wx-strip:empty { display: none; }
.wx-cur { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.wx-cur .wx-e { font-size: 30px; }
.wx-cur .wx-t { font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.wx-cur .wx-l { font-size: 13px; color: var(--text); line-height: 1.25; }
.wx-day { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 12px; min-width: 72px; text-align: center; box-shadow: var(--shadow); }
.wx-day .wx-dn { font-size: 12px; color: var(--muted); font-weight: 600; }
.wx-day .wx-de { font-size: 22px; margin: 3px 0; }
.wx-day .wx-hl { font-size: 13px; font-weight: 700; }
.wx-day .wx-hl span { color: var(--muted); font-weight: 500; margin-left: 4px; }
.wx-day .wx-p { font-size: 11px; color: var(--accent-2); margin-top: 2px; }
/* location source chips */
.loc-chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 9px 0 3px; }
.chip { background: var(--panel2); color: var(--muted); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 600; cursor: pointer;
  text-transform: capitalize; transition: all .12s; }
.chip:hover { color: var(--text); }
.chip.on { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }

/* ---- Zillow-style 3-wide cards (Listings / Campgrounds / Events) ---- */
.cards-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards-grid { grid-template-columns: 1fr; } }
.zcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease; }
.zcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.zcard-img { height: 190px; background: var(--panel2); cursor: pointer; }
.zcard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Photoless cards: a designed gradient + crisper glyph instead of a flat empty void. */
.zcard-noimg { display: flex; align-items: center; justify-content: center; height: 100%;
  font-size: 42px; opacity: .55; color: var(--muted);
  background:
    radial-gradient(120% 90% at 50% -10%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    repeating-linear-gradient(45deg, color-mix(in srgb, var(--line) 45%, transparent) 0 1px, transparent 1px 11px),
    var(--panel2); }
.zcard-body { padding: 11px 13px; display: flex; flex-direction: column; gap: 3px; }
.zcard-body .tile-title { font-size: 15.5px; line-height: 1.25; }
.zcard-body .sub { font-size: 13px; }
.zcard-src { margin-top: 5px; }
/* Invest: score badge + signal chips */
.zcard-img { position: relative; }
.inv-score { position: absolute; top: 10px; left: 10px; z-index: 1; font-weight: 800;
  font-size: 14px; min-width: 30px; text-align: center; padding: 4px 8px; border-radius: 9px;
  color: #10233f; box-shadow: var(--shadow); }   /* dark text — readable on every badge fill (WCAG) */
.inv-score.hot { background: var(--good); }
.inv-score.warm { background: var(--warn); }
.inv-score.cool { background: #9fb1cf; }   /* fixed light slate so dark text stays high-contrast in both themes */
.inv-sigs { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.inv-sig { font-size: 11px; line-height: 1.3; padding: 3px 7px; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); }
/* Neighborhoods: ranked rows */
.neigh-row { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 10px; }
.neigh-row .inv-score { font-size: 16px; min-width: 38px; padding: 6px 8px; }
.neigh-main { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.neigh-head { font-size: 15px; }
/* Explore: sections + rows + weather */
.exp-sec { margin-bottom: 18px; }
.exp-sec h3 { font-size: 15px; margin: 0 0 8px; }
.exp-row { padding: 9px 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-sm); margin-bottom: 7px; }
.exp-row-main { font-size: 14px; }
.exp-row .inv-sigs { margin-top: 5px; }
.exp-wx { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 18px; }
.exp-wx-now { font-size: 20px; font-weight: 700; }
.exp-wx-days { display: flex; gap: 14px; flex-wrap: wrap; }
.exp-wx .wx-day { text-align: center; font-size: 12px; color: var(--muted); }
.exp-wx .wx-emoji { font-size: 20px; }
.exp-wx .wx-hl { color: var(--text); }
/* compact 2-up cards in the Map tab's right-hand results list (Zillow-style) */
.map-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.map-cards .zcard-img { height: 104px; }
.map-cards .zcard-body { padding: 8px 9px; gap: 2px; }
.map-cards .zcard-body .tile-title { font-size: 13px; }
.map-cards .zcard-body .sub { font-size: 11.5px; }
.map-cards .zcard-src { font-size: 11.5px; margin-top: 3px; }
@media (max-width: 520px) { .map-cards { grid-template-columns: 1fr; } }

/* ---- Map: map on the left, results list on the right (like Zillow) ---- */
.map-split { display: grid; grid-template-columns: 1fr 380px; gap: 14px; align-items: start; }
.map-split #leaflet-map { height: 76vh; min-height: 420px; margin: 0; }
.map-side { max-height: 76vh; overflow: auto; padding-right: 2px; }
/* desktop: the map tab fills the viewport — map stays put, only the list scrolls */
@media (min-width: 901px) {
  /* full-bleed map tab: break out of main's padding/max-width, edge-to-edge like Redfin */
  #map.tab.active { display: flex; flex-direction: column; height: calc(100vh - 110px);
    width: 100vw; margin-left: calc(50% - 50vw); }
  #map.tab.active > .toolbar, #map.tab.active > #map-filters { padding-left: 16px; padding-right: 16px; }
  #map .map-split { flex: 1 1 auto; min-height: 0; gap: 0; grid-template-columns: 1fr 470px; }
  #map .map-split #leaflet-map { height: 100%; min-height: 0; }
  #map .map-side { height: 100%; max-height: none; padding: 0 14px; }
}
@media (max-width: 900px) {
  .map-split { grid-template-columns: 1fr; }
  .map-split #leaflet-map { height: 55vh; min-height: 320px; }
  .map-side { max-height: none; }
}

/* ---- Route: origin/destination each on their own full-width line ---- */
.route-od { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.route-od > label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.route-od .ac-wrap { display: block; width: 100%; }
.route-od .ac-wrap input { width: 100%; min-width: 0; }

/* ---- Map cluster count-bubbles ---- */
.cluster { background: none; border: none; }
.cluster .cluster-dot { display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 11px;
  border: 1.5px solid rgba(255,255,255,.85); box-shadow: 0 1px 3px rgba(0,0,0,.45);
  text-shadow: 0 1px 1px rgba(0,0,0,.45); cursor: pointer; }
/* listing house icon + price chip */
.house-pin { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.house-pin svg { filter: drop-shadow(0 1px 1px rgba(0,0,0,.45)); }
.house-pin .hp-price { margin-top: 1px; background: var(--accent); color: #fff; font-size: 10.5px;
  font-weight: 700; padding: 1px 4px; border-radius: 5px; white-space: nowrap; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.house-pin.sel svg path { fill: #e67e22; }
/* "selected from a list link" pulsing ring */
.sel-ring { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #e67e22;
  box-shadow: 0 0 0 rgba(230,126,34,.5); animation: selpulse 1.6s infinite; }
@keyframes selpulse {
  0% { box-shadow: 0 0 0 0 rgba(230,126,34,.55); }
  70% { box-shadow: 0 0 0 16px rgba(230,126,34,0); }
  100% { box-shadow: 0 0 0 0 rgba(230,126,34,0); } }

/* ===== Login overlay ===== */
.login-overlay { position: fixed; inset: 0; z-index: 4000; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: color-mix(in srgb, var(--bg) 82%, #000); backdrop-filter: blur(6px); }
.login-card { width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 26px 22px;
  box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.login-card input { width: 100%; }
.login-err { color: var(--bad); font-size: 13px; min-height: 16px; text-align: center; }

/* ===== Mail ===== */
.nav-badge { display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 4px;
  font-size: 11px; line-height: 16px; text-align: center; border-radius: 9px;
  background: var(--accent); color: #fff; font-weight: 700; }
.mail-grid { display: grid; grid-template-columns: 190px 320px 1fr; gap: 12px; align-items: start; }
/* folder sidebar */
.mail-folders { display: flex; flex-direction: column; gap: 3px; }
.mail-folders .fld { display: flex; justify-content: space-between; align-items: center; gap: 6px;
  width: 100%; text-align: left; background: transparent; border: 1px solid transparent; color: var(--text);
  padding: 8px 10px; border-radius: 9px; cursor: pointer; font-size: 14px; }
.mail-folders .fld:hover { background: var(--panel2); }
.mail-folders .fld.sel { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.fld-unread { background: var(--accent); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 11px; font-weight: 700; }
.fld-total { color: var(--muted); font-size: 12px; }
.fld-row { display: flex; align-items: center; }
.fld-row .fld { flex: 1; }
.fld-del { background: transparent; border: 0; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 7px; }
.fld-del:hover { color: var(--bad); }
.fld-add, .fld-empty { background: transparent; border: 1px dashed var(--line); color: var(--muted);
  padding: 7px 10px; border-radius: 9px; cursor: pointer; font-size: 12.5px; margin: 4px 0; }
.fld-add:hover { color: var(--accent); border-color: var(--accent); }
/* message list */
.mail-cards { display: flex; flex-direction: column; gap: 1px; max-height: 76vh; overflow: auto; padding-right: 2px; }
.mail-row { position: relative; display: flex; gap: 12px; padding: 10px 14px 10px 16px;
  border-radius: 10px; cursor: pointer; transition: background-color .12s ease; }
.mail-row:hover { background: var(--panel2); }
.mail-row.sel { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.mail-av { flex-shrink: 0; width: 40px; height: 40px; border-radius: 11px; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.mail-av.big { width: 44px; height: 44px; font-size: 16px; }
.mail-rmain { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.mail-rtop { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.mail-from { font-weight: 500; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-time { flex-shrink: 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.mail-subj { font-weight: 450; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-snip { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* unread: quiet — accent dot + weight only, no background fill */
.mail-row.unseen .mail-from { font-weight: 700; }
.mail-row.unseen .mail-subj { font-weight: 650; }
.mail-row.unseen::before { content: ""; position: absolute; left: 5px; top: 50%; transform: translateY(-50%);
  width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
/* reading-pane sender block */
.mail-vfrom { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.mail-vname { font-weight: 700; font-size: 15px; }
/* reading pane */
.mail-view { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 14px 16px; min-height: 240px; }
.mail-vtop { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mail-vsubj { font-size: 20px; font-weight: 700; line-height: 1.3; }
.mail-vmeta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.mail-vactions { position: relative; display: flex; gap: 6px; flex-shrink: 0; }
.mail-kebab { padding: 4px 10px; font-size: 16px; line-height: 1; }
.mail-menu { position: absolute; right: 0; top: 110%; z-index: 50; background: var(--panel);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  display: flex; flex-direction: column; min-width: 160px; overflow: hidden; }
.mail-menu button { text-align: left; background: transparent; border: 0; color: var(--text); padding: 9px 12px; cursor: pointer; font-size: 13.5px; }
.mail-menu button:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.mail-imgbar { margin: 10px 0; padding: 7px 11px; border-radius: 9px; font-size: 12.5px;
  background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid var(--line); }
.mail-iframe { width: 100%; height: 62vh; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-top: 10px; }
.mail-body { white-space: pre-wrap; word-break: break-word; margin-top: 12px; font: 13.5px/1.55 ui-monospace, Menlo, monospace; }
.mail-headers { white-space: pre-wrap; word-break: break-word; font: 12px/1.5 ui-monospace, Menlo, monospace; max-height: 60vh; overflow: auto; }
.mail-form { display: flex; flex-direction: column; gap: 9px; }
.mail-form textarea { width: 100%; resize: vertical; font: inherit; }
@media (max-width: 900px) { .mail-grid { grid-template-columns: 1fr; } .mail-iframe { height: 50vh; } }

/* ===== TOTP QR + Admin ===== */
.totp-qr { margin: 8px 0; }
.totp-qr svg { width: 180px; height: 180px; background: #fff; padding: 8px; border-radius: 10px; display: block; }
.adm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); margin-bottom: 6px; }

/* mail empty state */
.mail-empty { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 240px; color: var(--muted); font-size: 14px; font-weight: 500; }
.mail-empty-ic { font-size: 34px; opacity: .55; }
