/* iHomeData search app. Dark, mobile first. Desktop: list beside an always-on map. */
:root {
  color-scheme: dark;
  --bg: #0b1210; --panel: #111a17; --panel-2: #16211d; --raise: #1c2924;
  --line: #24332d; --line-strong: #345046;
  --ink: #edf3ef; --muted: #9db0a5; --faint: #7d9186;
  --accent: #e58a69; --accent-strong: #f0a184; --accent-ink: #1d0f09; --accent-soft: rgba(229, 138, 105, .14);
  --good: #57d3a4; --good-soft: rgba(87, 211, 164, .13);
  --warm: #f1b562; --warm-soft: rgba(241, 181, 98, .13);
  --danger: #ff8d7e;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 18px; --radius-sm: 12px;
  --serif: Fraunces, Georgia, serif;
  --sans: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --topbar: 64px; --tabbar: 64px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom));
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
/* Interface icons only; the map draws its own SVG. */
.topbar svg, .search-field svg, .button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; top: 8px; left: 8px; z-index: 50; transform: translateY(-160%); padding: 12px 16px; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius-sm); }
.skip-link:focus { transform: none; }
[hidden] { display: none !important; }

/* Top bar; on phones the tabs become a bottom bar. */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: var(--topbar); padding: max(8px, env(safe-area-inset-top)) 16px 8px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-size: 19px; font-weight: 800; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; }
.wordmark-light { font-weight: 400; color: var(--muted); }
.topbar .brand-mark { width: 30px; height: 30px; color: var(--accent); stroke-width: 2; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr;
  background: var(--panel); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tab { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tabbar); border: 0; background: none; font-weight: 650; color: var(--muted); }
.tab[aria-current="page"] { color: var(--ink); box-shadow: inset 0 3px 0 var(--accent); }
.tab-count:not(:empty) { padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.account { position: relative; display: flex; align-items: center; gap: 8px; }
.credits-pill { min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel); color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.account-button.is-avatar { width: 44px; padding: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 800; font-size: 18px; }
.credits-pill strong { color: var(--ink); }
.credits-pill:hover { border-color: var(--accent); color: var(--ink); }
.credits-pill.is-low { border-color: var(--warm); color: var(--warm); }
.plan { display: flex; flex-direction: column; max-height: 92dvh; }
.plan-meter { height: 10px; border-radius: 999px; background: var(--raise); overflow: hidden; }
.plan-meter span { display: block; height: 100%; background: var(--accent); }
.plan-cards { display: grid; gap: 10px; }
.plan-card { padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel-2); display: grid; gap: 8px; }
.plan-card.is-current { border-color: var(--accent); }
.plan-card ul { margin: 0; padding-left: 20px; color: var(--muted); }
.plan-price { font-size: 26px; font-weight: 800; }
.plan-price span { font-size: 16px; font-weight: 500; color: var(--muted); }
.cost-table { width: 100%; border-collapse: collapse; }
.cost-table td { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cost-table td:last-child { text-align: right; font-weight: 650; white-space: nowrap; }
@media (max-width: 719px) { .credits-pill { padding: 0 10px; } }
@media (min-width: 720px) { .plan-cards { grid-template-columns: 1fr 1fr; } }
.account-button { min-height: 44px; min-width: 44px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel-2); font-weight: 650; }
.account-button:hover { border-color: var(--accent); }
.account-menu { position: absolute; right: 0; top: 54px; z-index: 40; min-width: 280px; padding: 12px; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.account-email { font-weight: 650; }
.account-credits { color: var(--muted); margin-bottom: 8px; }
.menu-item { display: block; width: 100%; min-height: 44px; text-align: left; padding: 0 10px; border: 0; border-radius: 8px; background: none; }
.menu-item:hover { background: var(--raise); }

/* Lead tiles */
.leadbar { padding: 12px 16px 0; }
.lead-tiles { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.lead {
  flex: 0 0 auto; min-width: 150px; min-height: 76px; display: grid; align-content: center; gap: 2px; padding: 10px 16px; text-align: left;
  scroll-snap-align: start; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s, transform .15s;
}
.lead:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.lead-count { font-size: 24px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.lead-label { color: var(--muted); font-weight: 500; }
.lead[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.lead[aria-pressed="true"] .lead-count { color: var(--accent-strong); }
.lead[aria-pressed="true"] .lead-label { color: var(--ink); }

/* Search pane */
.workspace { padding: 12px 16px 16px; }
.search { display: grid; grid-template-columns: 1fr; gap: 8px; }
.search-field { position: relative; min-width: 0; }
.search-field svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search input, .search select, .field input, .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
}
.search input { padding-left: 44px; font-size: 17px; }
.search input::placeholder, .field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.search input:focus, .search select:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font-weight: 650; text-decoration: none; white-space: nowrap; }
.button-primary { background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { background: var(--accent-strong); }
.button-quiet { background: var(--panel-2); border-color: var(--line-strong); }
.button-quiet:hover { border-color: var(--accent); }
.button-block { width: 100%; }
.button:disabled { opacity: .6; cursor: progress; }
.link-button { border: 0; background: none; padding: 0; min-height: 44px; font-weight: 650; color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
.icon-button { min-width: 44px; min-height: 44px; border: 0; background: none; font-size: 28px; line-height: 1; border-radius: 999px; color: var(--muted); }
.icon-button:hover { background: var(--raise); color: var(--ink); }
.pill { display: inline-block; min-width: 24px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.toolbar .button { padding: 0 14px; }
.segmented { display: inline-flex; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--panel-2); }
.segment { min-height: 44px; min-width: 58px; padding: 0 14px; border: 0; border-radius: 9px; background: none; font-weight: 650; color: var(--muted); }
.segment[aria-pressed="true"] { background: var(--raise); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.summary-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.summary { color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding-left: 14px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--panel-2); }
.chip button { min-width: 44px; min-height: 44px; border: 0; border-radius: 999px; background: none; font-size: 20px; color: var(--muted); }
.notice { margin-top: 12px; padding: 16px; border-radius: var(--radius-sm); background: var(--accent-soft); border: 1px solid rgba(229, 138, 105, .35); }
.notice .button { margin-top: 12px; }

.results { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.card {
  position: relative; display: block; width: 100%; text-align: left; padding: 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); transition: border-color .15s, background .15s, transform .15s;
}
.card:hover, .card.is-active { border-color: var(--accent); background: var(--panel-2); }
.card-top { display: flex; justify-content: space-between; gap: 12px; }
.card-top > div { min-width: 0; }
.card-address, .card-owner, .property-title h2 { overflow-wrap: anywhere; }
.card-address { font-family: var(--serif); font-size: 21px; font-weight: 500; line-height: 1.2; }
.card-value { text-align: right; white-space: nowrap; }
.card-value strong { display: block; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.card-value span { color: var(--faint); }
.card-place { color: var(--muted); margin-top: 2px; }
.card-owner { margin-top: 8px; font-weight: 600; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; color: var(--muted); }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { padding: 2px 10px; border-radius: 999px; background: var(--raise); color: var(--muted); border: 1px solid var(--line); }
.tag-good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.tag-warm { background: var(--warm-soft); color: var(--warm); border-color: transparent; }
.saved-mark { color: var(--accent-strong); font-weight: 700; }
.load-more { display: flex; width: 100%; margin-top: 12px; }
.skeleton { height: 150px; border-radius: var(--radius); background: linear-gradient(90deg, var(--panel), var(--raise), var(--panel)); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Result selection */
/* Grid items default to their content's width; let long one-line text truncate instead. */
.results > li, .card-wrap { min-width: 0; }
.card-wrap { position: relative; }
.card { overflow: hidden; }
.card-wrap .card { padding-left: 56px; }
.pick { position: absolute; left: 6px; top: 10px; z-index: 1; display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; cursor: pointer; }
.pick input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.bulk-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; padding: 8px 8px 8px 14px;
  background: var(--raise); border: 1px solid var(--accent); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.bulk-count { flex: 1; font-weight: 700; }
.bulk-bar .button { min-height: 44px; padding: 0 14px; }

/* Map */
.mappane { display: none; margin-top: 12px; }
.mappane.is-shown { display: block; }
.map { position: relative; z-index: 0; isolation: isolate; height: calc(100dvh - 330px); min-height: 340px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel-2); }
.map-status { margin-top: 8px; color: var(--muted); }
.leaflet-container { font: 16px/1.4 var(--sans); background: var(--panel-2); }
.leaflet-tooltip { font-size: 16px; background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-strong); box-shadow: var(--shadow); }
.leaflet-tooltip-top::before { border-top-color: var(--line-strong); }
.leaflet-bar a { background: var(--panel-2); color: var(--ink); border-color: var(--line); width: 36px; height: 36px; line-height: 36px; }
.leaflet-control-attribution { background: rgba(11, 18, 16, .8) !important; color: var(--muted); }
.leaflet-control-attribution a { color: var(--muted); }
/* Darken the street map to match the app. */
.leaflet-tile-pane { filter: brightness(.7) contrast(1.1) saturate(.6) hue-rotate(185deg) invert(1) brightness(.95); }
.map.is-satellite .leaflet-tile-pane { filter: none; }
.map-toggle { min-height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel-2); color: var(--ink); font: 600 16px var(--sans); box-shadow: var(--shadow); cursor: pointer; }
.map-toggle[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* Saved view */
.saved-inner { width: min(1200px, 100%); margin: 0 auto; padding: 20px 16px 32px; }
.page-title { font-family: var(--serif); font-weight: 500; font-size: 34px; }
.saved-grid { display: grid; gap: 8px; }
.section-title { margin: 20px 0 10px; font-size: 18px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.row { display: flex; align-items: center; gap: 4px; padding: 6px 6px 6px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.row:hover { border-color: var(--line-strong); }
.row-main { flex: 1; min-height: 44px; border: 0; background: none; text-align: left; padding: 6px 8px; }
.row-main strong { display: block; }
.row-main span { color: var(--muted); }
.check { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 0; accent-color: var(--accent); }
.row.done .row-main strong { text-decoration: line-through; color: var(--muted); }
.overdue { color: var(--warm); font-weight: 650; }
.empty { padding: 18px; color: var(--muted); background: var(--panel); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); }
.empty .button { margin-top: 12px; }

/* Dialogs: bottom sheet or full screen on phones. */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--panel); }
dialog::backdrop { background: rgba(3, 7, 6, .65); }
.sheet, .modal { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh; border-radius: var(--radius) var(--radius) 0 0; border-top: 1px solid var(--line-strong); }
.panel { width: 100%; max-width: 100%; height: 100dvh; max-height: 100dvh; margin: 0; }
.sheet form, .modal form { display: flex; flex-direction: column; max-height: 92dvh; }
.sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 18px; border-bottom: 1px solid var(--line); }
.sheet-header h2 { font-size: 20px; }
.sheet-body { padding: 18px; overflow-y: auto; display: grid; gap: 16px; }
.sheet-footer { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.field { display: grid; gap: 6px; font-weight: 600; border: 0; margin: 0; padding: 0; min-width: 0; }
.field legend { font-weight: 600; padding: 0; margin-bottom: 6px; }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range label { display: grid; gap: 4px; font-weight: 500; }
.hint { color: var(--muted); font-weight: 400; }
.error { color: var(--danger); font-weight: 600; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 400; }
.choice input { width: 22px; height: 22px; accent-color: var(--accent); }
.switch { text-align: center; color: var(--muted); }

/* Property panel */
.property-head { position: sticky; top: 0; z-index: 3; background: var(--panel); border-bottom: 1px solid var(--line); }
.property-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 0 18px; }
.property-bar .hint { font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.property-title { padding: 4px 18px 12px; }
.property-title h2 { font-family: var(--serif); font-weight: 500; font-size: 30px; line-height: 1.15; }
.property-sub { color: var(--muted); margin-top: 4px; }
.property-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ptabs { display: flex; gap: 2px; overflow-x: auto; padding: 0 10px; scrollbar-width: none; }
.ptab { flex: none; min-height: 48px; padding: 0 14px; border: 0; background: none; color: var(--muted); font-weight: 650; box-shadow: inset 0 -3px 0 transparent; }
.ptab[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--accent); }
.ptab:hover { color: var(--ink); }
.property-body { padding: 18px; display: grid; gap: 18px; }
.property-body h3 { font-size: 18px; margin-bottom: 8px; }
.stat-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { padding: 14px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.stat span { display: block; color: var(--muted); }
.stat strong { display: block; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 650; }
.box { padding: 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-sm); display: grid; gap: 12px; }
.comps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.comps li { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.comps li:last-child { border-bottom: 0; }
.comps span { color: var(--muted); }
.links { display: grid; gap: 2px; }
.links a { display: flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--accent-strong); }
.score { display: flex; align-items: center; gap: 16px; }
.score-ring { --pct: 0; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--accent) calc(var(--pct) * 1%), var(--raise) 0); }
.score-ring strong { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; background: var(--panel-2); font-size: 24px; font-weight: 800; }
.working { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--raise); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.calc-out { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.good { color: var(--good); }
.bad { color: var(--danger); }
.source-note { color: var(--faint); }
.property-body .button { white-space: normal; text-align: center; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar) + 12px + env(safe-area-inset-bottom)); z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px;
  background: var(--ink); color: var(--bg); border-radius: var(--radius-sm); box-shadow: var(--shadow);
}
.toast .link-button { color: var(--bg); }

@media (min-width: 720px) {
  body { padding-bottom: 0; }
  .topbar { padding: 8px 24px; }
  .tabs { position: static; display: flex; gap: 4px; background: none; border: 0; padding: 0; }
  .tab { min-height: 44px; padding: 0 16px; border-radius: 999px; }
  .tab[aria-current="page"] { background: var(--raise); box-shadow: inset 0 0 0 1px var(--line-strong); }
  .leadbar { padding: 16px 24px 0; }
  .lead { min-width: 170px; }
  .workspace { padding: 14px 24px 24px; }
  .search { grid-template-columns: 1fr 200px auto auto; }
  .results { grid-template-columns: 1fr 1fr; }
  .sheet, .modal { width: min(540px, 92vw); margin: auto; border-radius: var(--radius); border: 1px solid var(--line-strong); }
  .panel { width: min(640px, 100vw); margin: 0 0 0 auto; border-left: 1px solid var(--line-strong); }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .facts { grid-template-columns: repeat(3, 1fr); }
  .saved-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
  .toast { left: auto; right: 24px; bottom: 24px; max-width: 480px; }
}

/* Phones: search first, compact lead chips, floating List/Map switch. */
@media (max-width: 719px) {
  .search-view { display: flex; flex-direction: column; }
  .workspace, .listpane { display: contents; }
  .search-view > .leadbar, .search, .toolbar, .summary-row, .chips, .notice, .mappane, .results, .load-more { margin-left: 16px; margin-right: 16px; }
  .search { order: 1; margin-top: 12px; grid-template-columns: 1fr auto auto; gap: 8px; }
  .filters-button { padding: 0 12px; }
  .filters-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .credits-word { display: none; }
  .credits-pill { min-width: 44px; }
  .wordmark { font-size: 18px; gap: 8px; }
  .search-field { grid-column: 1 / -1; }
  .search .button { min-height: 48px; }
  .leadbar { order: 2; padding: 10px 0 0; }
  .lead-tiles { gap: 8px; padding: 0 0 4px; scrollbar-width: none; }
  .lead-tiles::-webkit-scrollbar { display: none; }
  .lead { min-width: 0; min-height: 56px; padding: 6px 14px; border-radius: 999px; display: flex; align-items: baseline; gap: 6px; }
  .lead-count { font-size: 17px; }
  .lead-label { white-space: nowrap; }
  .toolbar { order: 3; margin-top: 0; }
  .summary-row { order: 4; }
  .chips { order: 5; }
  .notice { order: 6; }
  .mappane { order: 7; }
  .results { order: 8; }
  .load-more { order: 9; width: auto; margin-bottom: 88px; }
  .results { margin-bottom: 8px; }
  /* List/Map floats above the bottom bar, where a thumb can reach it. */
  .segmented { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 14px + env(safe-area-inset-bottom)); z-index: 25;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5); border-color: var(--line-strong); background: var(--panel-2); }
  .segment[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
  .has-selection .segmented { display: none; }
  #bulk-all { display: none; }
  .bulk-bar { flex-wrap: nowrap; gap: 6px; padding-left: 12px; }
  .bulk-count { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bulk-bar .button { padding: 0 12px; }
  .bulk-bar { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(var(--tabbar) + 10px + env(safe-area-inset-bottom)); z-index: 26; margin: 0; }
  .map-mode .map { height: calc(100dvh - var(--topbar) - var(--tabbar) - 250px); min-height: 360px; }
  .toast { bottom: calc(var(--tabbar) + 78px + env(safe-area-inset-bottom)); }
  .card { padding: 12px 14px 12px 52px; }
  .pick { left: 2px; top: 6px; }
  .card-address { font-size: 18px; }
  .card-value strong { font-size: 17px; }
  .card-value span, .card-county { display: none; }
  .card-place, .card-meta span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .card-place { max-width: 100%; }
  .card-owner { margin-top: 4px; }
  .card-meta { display: block; margin-top: 2px; }
  .card-meta span { display: block; }
  .card-tags { margin-top: 8px; gap: 4px; }
  .card-tags .tag:nth-child(n+3) { display: none; }
  .summary-row { margin-top: 8px; }
  .summary-row .button { min-height: 44px; padding: 0 12px; }
  .property-title h2 { font-size: 25px; }
  .property-title { padding-bottom: 8px; }
  .property-actions { flex-wrap: nowrap; }
  .property-actions .button { flex: 1 1 0; min-width: 0; padding: 0 10px; }
  .property-body { padding: 16px; }
}

/* Phones in map mode: the map comes right after the controls. */
@media (max-width: 1099px) {
  .map-mode .load-more { display: none !important; }
}

/* Wide screens: list beside an always-visible map. */
@media (min-width: 1100px) {
  .search-view { display: flex; flex-direction: column; height: calc(100dvh - var(--topbar)); }
  .workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(440px, 520px) 1fr; gap: 0; padding: 14px 0 0; }
  .listpane { min-height: 0; overflow-y: auto; padding: 0 20px 24px 24px; }
  .search { grid-template-columns: 1fr 170px; }
  .search .button-primary { grid-column: 1 / -1; }
  .filters-button { grid-column: 1 / -1; justify-self: start; }
  .segmented { display: none; }
  .results { grid-template-columns: 1fr; }
  .mappane, .mappane.is-shown { display: flex; flex-direction: column; margin: 0; padding: 0 24px 24px 4px; min-height: 0; }
  .map { flex: 1; height: auto; min-height: 0; }
}

/* Printing a postcard: only the card prints. */
.print-area { display: none; }
@media print {
  body { background: #fff; color: #000; padding: 0; }
  body > *:not(.print-area) { display: none !important; }
  .print-area { display: block; }
  .print-card { width: 6in; min-height: 4in; padding: .4in; border: 1px dashed #999; margin: 0 auto .3in; break-inside: avoid; font: 13pt/1.45 Georgia, serif; white-space: pre-wrap; }
  .print-address { display: flex; flex-direction: column; justify-content: center; padding-left: 3.2in; font: 13pt/1.4 Arial, sans-serif; text-transform: uppercase; }
  .print-address p { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
