/* ============================================================
   Calgary Houses — "estate editorial"
   Deep green accent, ink neutrals, serif display + sans body,
   photography-first cards. Dark mode keys off <html data-theme> (the OS
   by default, the header sun/moon button overrides) — see the
   :root[data-theme="dark"] palette below.
   ============================================================ */

:root {
  --green: #0E7A5F;
  --green-deep: #0a5e49;
  --ink: #1A1D29;
  --ink-soft: #4a4f60;
  --ink-faint: #767c90;
  --line: #e6e4dd;
  --paper: #faf8f3;      /* warm off-white — editorial paper */
  --card: #ffffff;
  --scrim: rgba(16, 18, 26, 0.0);
  --scrim-deep: rgba(12, 14, 20, 0.82);
  --pill-active-bg: rgba(255, 255, 255, 0.16);
  --shadow-card: 0 1px 2px rgba(26, 29, 41, 0.06), 0 12px 28px -18px rgba(26, 29, 41, 0.35);
  --shadow-lift: 0 2px 6px rgba(26, 29, 41, 0.10), 0 24px 48px -24px rgba(26, 29, 41, 0.45);

  --serif: Georgia, "Times New Roman", "Iowan Old Style", "Palatino Linotype", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --radius: 4px;
  --maxw: 1320px;

  color-scheme: light; /* form controls + scrollbars follow the switch (dark below) */
}

/* Dark palette. <html data-theme="light|dark"> is the ONE switch: the inline
   head script in index.html sets it before first paint (a stored choice from
   the header sun/moon button, else the OS's prefers-color-scheme) and app.js
   flips it live. An attribute selector rather than a media query so a single
   rule set serves both the OS default and the manual override — no duplicated
   palettes, and no light-dark() (unsupported on iOS ≤ 17.4). Every dark rule
   in this file is prefixed the same way. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --green: #38b48e;
  --green-deep: #2c9576;
  --ink: #ecebe6;
  --ink-soft: #b6b8c0;
  --ink-faint: #8a8d98;
  --line: #2a2d38;
  --paper: #14161c;
  --card: #1b1e26;
  --scrim-deep: rgba(6, 7, 10, 0.86);
  --pill-active-bg: rgba(255, 255, 255, 0.18);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 14px 30px -18px rgba(0, 0, 0, 0.7);
  --shadow-lift: 0 2px 8px rgba(0, 0, 0, 0.5), 0 28px 54px -24px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
}

/* ---------- Header ---------- */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 20;
}

.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 28px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1;
}

.wordmark__badge {
  align-self: center;
  flex-shrink: 0;
  display: block;
  border-radius: 8px;
}

.wordmark__mark {
  font-family: var(--serif);
  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.wordmark__sub {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, 2vw, 19px);
  color: var(--green);
  letter-spacing: 0.01em;
}

.results-count {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}

.results-count__num {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.results-count__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

/* ---------- Filters ---------- */

.filters {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.filters__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 18px 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  font-weight: 600;
}

.field--city { flex: 1 1 200px; min-width: 160px; }

.field input[type="text"],
.field select {
  font-family: var(--sans);
  font-size: 15px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  height: 42px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.field select {
  min-width: 140px;
  padding-right: 34px;
  /* chevron */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23767c90' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.field input[type="text"]:focus,
.field select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent);
}

/* Calgary-only market: the City box is read-only — muted ground, no focus
   ring, a small padlock on the right (the FAQ says why). */
.field input[type="text"][readonly] {
  color: var(--ink-faint);
  background-color: color-mix(in srgb, var(--card) 72%, var(--line));
  cursor: default;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='14' viewBox='0 0 12 14'%3E%3Crect x='1' y='6' width='10' height='7' rx='1.5' fill='none' stroke='%23767c90' stroke-width='1.5'/%3E%3Cpath d='M3.5 6V4a2.5 2.5 0 0 1 5 0v2' fill='none' stroke='%23767c90' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.field input[type="text"][readonly]:focus {
  border-color: var(--line);
  box-shadow: none;
}

/* Beds chips */
.chips {
  display: flex;
  gap: 6px;
}

.chip {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  height: 42px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.chip:hover { border-color: var(--green); color: var(--ink); }

.chip--active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
:root[data-theme="dark"] .chip--active { color: #06120e; }

/* Quick filters — the second line of the bar, in the beds-chip style (solid
   green = on): multi-select home-type pills ("All · Condo · Townhouse · House",
   selection logic in mapcore.js HOME_TYPES) and a lone Pool pill. flex-basis
   100% parks the row under the selects at every width; the pills wrap on
   phones. */
.quick-filters {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: -2px;
}
.quick-filters__group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.quick-filters .chips { flex-wrap: wrap; }
.quick-filters__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-faint);
  font-weight: 600;
}
.quick-filters__divider {
  width: 1px;
  height: 22px;
  background: var(--line);
}

.search-btn {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: var(--radius);
  padding: 0 26px;
  height: 42px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
  margin-left: auto;
}
:root[data-theme="dark"] .search-btn { color: #06120e; }
.search-btn:hover { background: var(--green-deep); border-color: var(--green-deep); }
.search-btn:active { transform: translateY(1px); }

/* ---------- Results grid ---------- */

.results {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px 28px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
  transition: opacity 0.18s ease;
}

/* Next-page indicator under the grid (infinite scroll). Same width as the
   grid; the negative top margin eats part of the grid's bottom padding so
   the row reads as the grid's footer, not a separate section. */
.load-more {
  max-width: var(--maxw);
  margin: -40px auto 0;
  padding: 0 28px 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-faint);
}
.load-more[hidden] { display: none; } /* the class's display would beat the UA hidden rule */
.load-more__spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--green);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Soft refresh: the previous cards stay on screen (dimmed, inert) while the
   next page is fetched — swapping through a skeleton grid reads as a reload. */
.results--refreshing {
  opacity: 0.45;
  pointer-events: none;
}

.results.is-state {
  display: block;
  min-height: 40vh;
}

/* ---------- Card ---------- */

.card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--card);
  box-shadow: var(--shadow-card);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  border: 1px solid var(--line);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}

.card__photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #ded9cf 0%, #cfc9bd 100%);
  overflow: hidden;
}
:root[data-theme="dark"] .card__photo { background: linear-gradient(135deg, #242832 0%, #1a1d26 100%); }

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.card:hover .card__img { transform: scale(1.04); }

.card__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    transparent 38%,
    rgba(12, 14, 20, 0.15) 58%,
    var(--scrim-deep) 100%
  );
  pointer-events: none;
}

.pill {
  position: absolute;
  top: 14px;
  left: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  background: var(--pill-active-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 5px 11px;
}
.pill--active {
  background: rgba(14, 122, 95, 0.9);
  border-color: rgba(255, 255, 255, 0.3);
}

.card__overlay-text {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 18px 14px;
  color: #fff;
}

.card__price {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
  line-height: 1.1;
}

.card__address {
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.94);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card__facts {
  padding: 12px 18px 15px;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.card__facts .dot { color: var(--ink-faint); }
.card__facts .num { font-variant-numeric: tabular-nums; }
/* Listing-brokerage attribution (required on every card — CREA VOW / RECA).
   Same size as the facts line it follows: the rule is "not smaller than the
   typeface used in the display of Listing data". Pulls up into the facts
   line's bottom padding so the card doesn't grow a second gutter. */
.card__listed {
  padding: 0 18px 15px;
  margin-top: -9px;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- States (loading / empty / error) ---------- */

.state {
  text-align: center;
  padding: 90px 20px;
  color: var(--ink-faint);
}
.state__title {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--ink-soft);
  margin: 0 0 8px;
}
.state__sub { font-size: 14px; margin: 0; }

.skeleton-grid {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 34px 28px 64px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 26px;
}
.skeleton {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
}
.skeleton__photo {
  aspect-ratio: 4 / 3;
  background: linear-gradient(90deg, var(--line) 0%, color-mix(in srgb, var(--line) 45%, transparent) 50%, var(--line) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
.skeleton__line {
  height: 12px;
  margin: 14px 18px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--line) 0%, color-mix(in srgb, var(--line) 45%, transparent) 50%, var(--line) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
.skeleton__line--short { width: 45%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Detail overlay ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.overlay[hidden] { display: none; }

.overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 12, 18, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fade 0.2s ease;
}

.overlay__panel {
  position: relative;
  width: min(980px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  background: var(--card);
  border-radius: 6px;
  box-shadow: var(--shadow-lift);
  animation: rise 0.24s ease;
  -webkit-overflow-scrolling: touch;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.overlay__close {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 5;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: none;
  background: rgba(12, 14, 20, 0.5);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.overlay__close:hover { background: rgba(12, 14, 20, 0.72); }

/* Page overlay only: the × rides a zero-height sticky wrapper so it stays
   pinned (on top of the FAQ's sticky mini header) while the content scrolls.
   height:0 = no layout shift; the absolute button anchors to the wrapper at
   the same 12/14 offsets as the plain absolute version. */
.overlay__close-pin {
  position: sticky;
  top: 0;
  height: 0;
  z-index: 6; /* above the mini header (2) */
}

/* Gallery */
.gallery {
  position: relative;
  background: #0c0e14;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}
.gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  transition: background 0.15s ease;
}
.gallery__nav:hover { background: #fff; }
.gallery__nav--prev { left: 14px; }
.gallery__nav--next { right: 14px; }
.gallery__counter {
  position: absolute;
  bottom: 14px;
  right: 16px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: rgba(12, 14, 20, 0.6);
  border-radius: 999px;
  padding: 4px 12px;
  letter-spacing: 0.04em;
}

.thumbs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}
.thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 60px;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.62;
  transition: opacity 0.15s ease, border-color 0.15s ease;
  padding: 0;
  background: var(--line);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { opacity: 0.9; }
.thumb--active { opacity: 1; border-color: var(--green); }

.detail-body {
  padding: 24px 30px 34px;
}

.detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
}
.detail-price {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1;
}
.detail-address {
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 7px;
}
.detail-address strong { color: var(--ink); font-weight: 600; }
/* "North Haven · Calgary, AB T2K 5Y3" under the street line — same size as
   the address (it IS the address), quieter colour. */
.detail-address__locality { display: block; margin-top: 2px; color: var(--ink-soft); }
/* Listing-brokerage attribution in the detail head — same size as the address
   line above it (CREA VOW: not smaller than the listing-data typeface). */
.detail-listed {
  font-size: 15px;
  color: var(--ink-soft);
  margin-top: 6px;
}
.detail-listed strong { color: var(--ink); font-weight: 600; }
.detail-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
  border: 1px solid color-mix(in srgb, var(--green) 45%, transparent);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}

.fact-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 24px 0;
}
.fact-tile {
  background: var(--card);
  padding: 16px 18px;
  text-align: center;
}
.fact-tile__val {
  font-family: var(--serif);
  /* 22px is the ceiling: app.js fitFactTileValues shrinks a long Type value
     (floor 70%) until its widest word fits and it holds three lines — the
     rule shared with iOS/Android. Whole words only, never a mid-word break. */
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  overflow-wrap: normal;
  hyphens: manual;
}
.fact-tile__label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-faint);
  margin-top: 4px;
}

.detail-section-title {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  margin: 26px 0 10px;
}
.detail-description {
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  white-space: pre-line;
}
.detail-meta-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.detail-meta-row .k { color: var(--ink-faint); }
.detail-meta-row .v { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.detail-compliance {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-faint);
}

/* ---------- Brokerage identity — RECA advertising compliance ----------
   Alberta (RECA) treats a real-estate website as advertising: the BROKERAGE
   (Brilliant Realty) must be identified on all advertising, as prominent as
   and adjacent to the associate (Kaya Brooklyn), and NOT only buried in a
   footer. So the brokerage appears in two places: a "Brokered by" bar in the
   sticky header (all views) and a strip on EVERY listing detail (the
   listing-page identification is also a Pillar 9 feed signing condition —
   RealEstate.md §5.3). The wordmark PNG is fixed-colour, so we ship a dark
   version (brilliant-realty.png, for light UI) and a white-knockout version
   (brilliant-realty-white.png, for dark UI) and swap on <html data-theme> —
   matching how the rest of the site themes (see the :root[data-theme="dark"]
   palette). */
.brk-logo { display: block; height: 100%; width: auto; }
.brk-logo--dark { display: none; }
:root[data-theme="dark"] .brk-logo--light { display: none; }
:root[data-theme="dark"] .brk-logo--dark { display: block; }

/* "Brokered by" bar — lives INSIDE .site-header so it sticks with it (the
   brokerage identification must stay on screen, not scroll away). border-top
   separates it from the header row; the header's own border-bottom closes it —
   same two hairlines as when the bar sat below the header. The inner is ONE
   <a href="/about"> covering logo + all text. */
.broker-bar { border-top: 1px solid var(--line); background: var(--paper); }
.broker-bar__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 9px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  text-decoration: none;
  color: inherit;
}
.broker-bar__inner:hover .broker-bar__name { text-decoration: underline; }
.broker-bar__by {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.broker-bar__logo { display: flex; height: 22px; flex: none; }
/* Full brokerage NAME as text — RECA requires the name, not just the logo, and
   at least as prominent as the associate: bold + ink vs the associate's soft. */
.broker-bar__name { font-family: var(--sans); font-size: 13px; font-weight: 700; color: var(--ink); }
.broker-bar__assoc { font-family: var(--sans); font-size: 12.5px; color: var(--ink-soft); }
@media (max-width: 640px) {
  .broker-bar__inner { padding: 8px 18px; gap: 8px; }
  .broker-bar__name { font-size: 12px; }
  .broker-bar__assoc { font-size: 11.5px; }
}

/* Per-listing brokerage strip — above the Pillar 9 / CREA disclaimer */
.detail-broker {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 15px;
}
.detail-broker__logo { display: flex; height: 30px; flex: none; }
.detail-broker__info { font-family: var(--sans); min-width: 0; }
.detail-broker__assoc { font-size: 13.5px; color: var(--ink); font-weight: 600; }
.detail-broker__brk { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
/* The brokerage strip already carries the divider, so the disclaimer that
   follows it drops its own top rule to avoid a double line. */
.detail-broker + .detail-compliance { margin-top: 14px; padding-top: 0; border-top: none; }

/* ---------- About & FAQ — in-SPA overlay pages ----------
   About/FAQ are client-side views rendered inside index.html's #pageOverlay
   (reusing the .overlay / .overlay__panel machinery), so navigating to them
   never leaves the listings document — its scroll/map/filter state is
   preserved and closing returns to the exact spot with zero reload. These
   rules were moved verbatim out of the former about.html / faq.html inline
   <style> blocks. */

/* Page overlay gets a slightly taller panel + tighter outer gutter than the
   listing detail so the About/FAQ content can breathe (blank space in the
   header/footer, content clear of the × close) and still fit without scroll. */
#pageOverlay { padding: 12px 24px; }
#pageOverlay .overlay__panel { max-height: 96vh; }

/* --- About --- */
/* Generous top padding so the content clears the × close button (top:12px,
   38px tall) with blank space above; matching footer breathing room below. */
.about-wrap { max-width: 880px; margin: 0 auto; padding: 54px 24px 44px; }
.about-back {
  display: inline-block;
  margin-bottom: 26px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--green);
  text-decoration: none;
}
.about-back:hover { text-decoration: underline; }
.about-hero { display: flex; gap: 40px; align-items: flex-start; flex-wrap: wrap; }
/* Left column stacks the photo + brokerage so the broker info sits right under
   the portrait (in the gutter beside the taller bio) — everything fits the
   viewport without scrolling instead of the brokerage hanging off the bottom. */
.about-photo-col { flex: 0 1 340px; min-width: 260px; display: flex; flex-direction: column; }
.about-photo { width: 100%; }
.about-photo > img {
  width: 100%;
  display: block;
  border-radius: 10px;
  /* No drop shadow — the border is the edge. A soft --shadow-card bled well
     past the 1px border and read as the boundary instead of the border. */
  border: 1px solid var(--line);
}
.about-bio { flex: 1 1 380px; min-width: 280px; }
.about-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--green);
  font-weight: 700;
  margin: 0 0 10px;
}
.about-name {
  font-family: var(--serif);
  font-size: 38px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.1;
}
.about-title { font-family: var(--sans); font-size: 15px; color: var(--ink-soft); margin: 0 0 14px; }
.about-bio p {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 16px;
}
.about-bio strong { color: var(--ink); }
.about-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 22px; }
.about-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  background: var(--green);
  color: #fff;
  border: 1px solid var(--green);
}
.about-cta:hover { background: var(--green-deep); border-color: var(--green-deep); }
.about-cta--ghost { background: transparent; color: var(--green); }
.about-cta--ghost:hover { background: transparent; color: var(--green-deep); }
.about-social-title {
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  font-weight: 700;
  margin: 0 0 12px;
}
.about-socials { display: flex; gap: 10px; flex-wrap: wrap; }
.social-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer; /* live profile links since 2026-09-06 (were inert placeholders) */
  max-width: 100%;
}
.social-btn:hover { border-color: var(--green); }
.social-btn svg { width: 18px; height: 18px; color: var(--green); flex: none; }
/* min-width:0 + anywhere: the email pill's long address must wrap inside the
   pill on narrow phones instead of overflowing the overlay panel. */
.social-btn__handle { color: var(--ink-faint); font-weight: 400; min-width: 0; overflow-wrap: anywhere; }

/* Brokerage block — the licensed brokerage the associate works under, below
   the realtor's bio (RECA: brokerage identified alongside the associate). */
.about-brokerage {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.about-brokerage__card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
.about-brokerage__logo { display: flex; height: 40px; flex: none; }
.about-brokerage__logo .brk-logo { height: 100%; width: auto; }
.about-brokerage__info { font-family: var(--sans); }
.about-brokerage__name {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 4px;
}
.about-brokerage__line { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 2px; line-height: 1.5; }

/* --- FAQ --- */
/* FAQ mini header — sticky at the top of the overlay panel (the overlay
   covers the real site header, and the FAQ has no other brokerage ID). Same
   look as the site header: wordmark row, hairline, broker bar. z stays under
   the × (z 5) so the close button renders above it. */
.page-mini-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.page-mini-header__brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  line-height: 1;
  width: fit-content;
  padding: 16px 28px 12px;
  text-decoration: none;
  color: inherit;
}
@media (max-width: 640px) {
  .page-mini-header__brand { padding: 14px 18px 10px; }
}

/* top padding was 54px to clear the floating × — the mini header does that now */
.faq-wrap { max-width: 760px; margin: 0 auto; padding: 28px 24px 60px; }
.faq-title { font-family: var(--serif); font-size: 34px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.faq-sub { font-family: var(--sans); color: var(--ink-soft); font-size: 15px; margin: 0 0 34px; line-height: 1.55; }
.faq-item { border-top: 1px solid var(--line); }
.faq-item:last-of-type { border-bottom: 1px solid var(--line); }
.faq-item summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 2px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-family: var(--sans);
  font-weight: 400;
  font-size: 22px;
  color: var(--green);
  flex: none;
  line-height: 1;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-soft);
  margin: 0 0 18px;
  padding: 0 2px;
}
.faq-item p + p { margin-top: -6px; }
.faq-back {
  display: inline-block;
  margin-bottom: 26px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--green);
  text-decoration: none;
}
.faq-back:hover { text-decoration: underline; }
.faq-item strong { color: var(--ink); }
.faq-buying { margin: 0 0 40px; scroll-margin-top: 120px; } /* clears the sticky mini header */
.faq-buying__title { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--ink); margin: 0 0 4px; }
.faq-buying__sub { font-family: var(--sans); color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; margin: 0 0 20px; }
.faq-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.faq-steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 18px 46px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.faq-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.faq-steps li strong { color: var(--ink); }
.faq-steps li > strong:first-child {
  display: block;
  font-family: var(--serif);
  font-size: 16.5px;
  margin-bottom: 2px;
}
.faq-note { font-family: var(--sans); font-size: 12.5px; color: var(--ink-faint, var(--ink-soft)); line-height: 1.5; margin: 4px 0 0; }
.faq-section-title { font-family: var(--serif); font-size: 24px; font-weight: 700; color: var(--ink); margin: 0 0 14px; }

@media (max-width: 640px) {
  .about-name { font-size: 30px; }
  .about-hero { gap: 26px; }
  .about-wrap, .faq-wrap { padding-left: 18px; padding-right: 18px; }
}

/* ---------- Favorites ---------- */

.fav-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 8px rgba(10, 20, 16, 0.25);
  cursor: pointer;
}

.fav-btn svg {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.8;
  transition: fill 0.15s ease, stroke 0.15s ease, transform 0.15s ease;
}

.fav-btn:hover svg { transform: scale(1.1); }

.fav-btn--on {
  background: var(--green);
}

.fav-btn--on svg {
  fill: #fff;
  stroke: #fff;
}

/* Detail overlay variant sits inline beside the status pill, not absolute. */
.detail-head__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-head__actions .fav-btn {
  position: static;
  background: var(--bg, #faf8f2);
  border: 1px solid var(--line);
  box-shadow: none;
}

.detail-head__actions .fav-btn--on {
  background: var(--green);
  border-color: var(--green);
}

/* Explicit display would defeat the [hidden] UA style — restate it. */
.view-toggle__count[hidden] {
  display: none;
}

.view-toggle__count {
  display: inline-block;
  min-width: 18px;
  padding: 1px 5px;
  margin-left: 4px;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.view-toggle__btn--active .view-toggle__count {
  background: rgba(255, 255, 255, 0.25);
}

/* ---------- Map view ---------- */

.view-toggle {
  display: inline-flex;
  align-items: center;
  margin-left: 10px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card, transparent);
}

.view-toggle__btn {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 7px 16px;
  border-radius: 999px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}

.view-toggle__btn--active {
  background: var(--green);
  color: #fff;
}

.map-wrap {
  padding: 0 32px 48px;
  max-width: 1240px;
  margin: 0 auto;
}

/* Positioning context for the map + its debug toggle / notes. */
.map-stage {
  position: relative;
}

.map {
  height: min(72vh, 720px);
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  /* Both basemaps (MapKit's layers, Leaflet's panes) use their own z-index
     stacks that can float above the fixed detail overlay — pin the whole map
     into a lower stacking context. */
  position: relative;
  z-index: 0;
  background: var(--card);
}

/* OpenStreetMap (debug basemap) has no dark variant — invert the raster tiles
   so the map doesn't glow white inside the dark shell. Apple's basemap is
   colorScheme:adaptive and needs nothing. */
:root[data-theme="dark"] .map--osm .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(0.92) contrast(0.88) saturate(0.55);
}

/* Server cluster bubble (count in view > 300). Sized inline by count. */
.cluster-bubble {
  box-sizing: border-box;
  border-radius: 50%;
  background: var(--green);
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(8, 45, 34, 0.35);
  color: #fff;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  transition: transform 120ms ease;
}
.cluster-bubble:hover {
  transform: scale(1.08);
}

/* A pill nudged out of a stack so its neighbours stay readable — same pill,
   slightly stronger border so the grid reads as "several homes right here". */
.price-pin--spread {
  border-width: 2px;
}

/* Price pill. Width is set inline per label ($469K vs $1.25M) — see
   REMapCore.pinWidth — so both basemaps position it identically. */
.price-pin {
  box-sizing: border-box;
  height: 26px;
  line-height: 24px;
  padding: 0 6px;
  text-align: center;
  white-space: nowrap;
  border-radius: 999px;
  background: #fff;
  border: 1.5px solid var(--green);
  box-shadow: 0 3px 10px rgba(8, 45, 34, 0.25);
  color: var(--green-deep);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
}

.price-pin:hover {
  background: var(--green);
  color: #fff;
}

/* Debug basemap toggle — top-right of the map, only when ?debug=1. */
.map-tools {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  font-size: 12px;
}
/* Debug-only toolbar: app.js sets `hidden` unless ?debug=1 — the explicit
   display:flex above defeated the UA [hidden] rule, so the Apple/OSM toggle
   was showing to EVERY visitor (found 2026-09-10 review). */
.map-tools[hidden] { display: none; }
.map-tools__label {
  color: var(--ink-faint);
  padding: 0 6px 0 8px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 10.5px;
}
.map-tools__btn {
  border: 0;
  border-radius: 999px;
  padding: 5px 10px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.map-tools__btn--active {
  background: var(--green);
  color: #fff;
}

/* Transient note over the map (e.g. Apple fallback). */
.map-note {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  max-width: min(420px, calc(100% - 24px));
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  color: var(--ink);
  font-size: 13px;
}

.results-count__hint {
  color: var(--ink-faint);
  font-weight: 400;
}

/* ---------- Responsive ---------- */

@media (max-width: 640px) {
  .map-wrap { padding: 0 18px 40px; }
  .site-header__inner { padding: 16px 18px; }
  .filters__inner { padding: 16px 18px; gap: 14px; }
  /* The quick-filter row wraps here; a divider opening a line is just a stray bar. */
  .quick-filters__divider { display: none; }
  .quick-filters { gap: 8px 12px; }
  .field--city { flex-basis: 100%; }
  .search-btn { margin-left: 0; flex: 1 1 100%; }
  .results { padding: 24px 18px 48px; gap: 20px; }
  .detail-body { padding: 20px 20px 28px; }
  .detail-price { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .load-more__spinner { animation: none; border-top-color: var(--line); }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- Mortgage calculator (detail overlay, active listings) ---------- */

.mort-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 14px;
  background: var(--card, transparent);
}
.mort-hero { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.mort-hero__val {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.mort-hero__unit { font-size: 13px; color: var(--ink-faint); }
.mort-chips { margin: 0 0 12px; }
.mort-rate-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.mort-rate-label { font-size: 14px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.mort-stepper { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.mort-stepper button {
  width: 38px;
  height: 30px;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 17px;
  cursor: pointer;
}
.mort-stepper button:first-child { border-right: 1px solid var(--line); }
.mort-stepper button:hover { background: var(--line); }
.mort-chips--term { margin: 0 0 0 auto; }
.mort-badge { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--green); }
.mort-disclaimer { margin: 6px 0 0; font-size: 11.5px; color: var(--ink-faint); }

/* ---------- VOW registration wall (sold market data) ---------- */

.vow-gate {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
}
.vow-gate__head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.vow-gate__lock { font-size: 22px; line-height: 1.2; }
.vow-gate__title { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); }
.vow-gate__sub { font-size: 13px; color: var(--ink-faint); margin-top: 2px; }
.vow-signin { display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
/* Provider row (Apple + Google). Locked until the consent box is ticked —
   the GIS button is a cross-origin iframe, so pointer-events is the only
   way to hold it inert. */
.vow-providers { display: flex; flex-direction: column; gap: 10px; }
.vow-providers--locked { opacity: 0.45; pointer-events: none; }
/* Fixed-height slot: the note's text changes (tick prompt, provider down,
   Google still loading) must never move the buttons above it. */
.vow-note { font-size: 12.5px; line-height: 1.4; min-height: 17.5px; color: var(--ink-soft); }
.vow-provider--unavailable { opacity: 0.5; cursor: not-allowed; }
.vow-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink-soft); }
.vow-consent input { margin-top: 2px; accent-color: var(--green); }
.vow-consent a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
/* Legal pages (Terms / Privacy) share the FAQ shell; these are the body rules. */
.legal-wrap .legal-h2 { font-family: var(--serif); font-size: 19px; font-weight: 700; color: var(--ink); margin: 26px 0 8px; }
.legal-wrap p, .legal-wrap li { font-family: var(--sans); font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 12px; }
.legal-wrap li { margin: 0 0 6px; }
.legal-wrap ul { padding-left: 20px; margin: 0 0 12px; }
.legal-wrap strong { color: var(--ink); }
.legal-wrap a, .faq-legal a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }
.legal-nav { font-size: 13.5px !important; margin-bottom: 20px !important; }
.faq-legal { font-family: var(--sans); font-size: 14.5px; line-height: 1.6; color: var(--ink-soft); margin: 0 0 18px; }
.vow-error { font-size: 12.5px; color: #b3372f; }

/* Sign in with Apple (iter 104) — Apple HIG: solid black in light mode,
   solid white in dark. Injected by vow.js wireGate into the provider row. */
.vow-apple-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 420px;
  height: 42px;
  border: none;
  border-radius: var(--radius);
  background: #000;
  color: #fff;
  font: 600 14.5px/1 var(--sans);
  letter-spacing: 0.01em;
  cursor: pointer;
}
.vow-apple-btn svg { width: 15px; height: 15px; display: block; }
.vow-apple-btn:hover { background: #1c1c1e; }
/* Sign in with Google (2026-09-12; our own button since 2026-09-15 — the
   GIS iframe button mounted async and repainted itself, which read as a
   flicker on every gate open). Google's brand look: white pill, hairline
   border, the G logo, "Sign in with Google" in a medium sans. Same width
   rules as the Apple button above it. */
.vow-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 420px;
  height: 40px;
  margin: 8px 0 2px;
  padding: 0 12px;
  border: 1px solid #dadce0;
  border-radius: 20px;
  background: #fff;
  color: #3c4043;
  font: 500 14px/1 Roboto, var(--sans);
  cursor: pointer;
}
.vow-google-btn svg { width: 18px; height: 18px; flex: none; }
.vow-google-btn:hover { background: #f8f9fa; }
.vow-provider--busy { opacity: 0.6; cursor: progress; }
:root[data-theme="dark"] .vow-apple-btn { background: #fff; color: #000; }
:root[data-theme="dark"] .vow-apple-btn:hover { background: #e8e8e8; }

/* ---------- Comps-median estimate card (VOW-gated) ---------- */

.est-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  margin-top: 12px;
}
.est-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.est-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.est-value {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.est-delta { font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.est-delta--under { color: var(--green); background: color-mix(in srgb, var(--green) 13%, transparent); }
.est-delta--over { color: #8a6a2a; background: rgba(184, 141, 56, 0.15); }
.est-track { position: relative; height: 14px; margin: 4px 2px 6px; }
.est-track__bar {
  position: absolute; inset: 5px 0; border-radius: 999px;
  background: color-mix(in srgb, var(--green) 22%, transparent);
}
.est-track__dot {
  position: absolute; top: 1px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--green); transform: translateX(-50%);
}
.est-track__list {
  position: absolute; top: 0; width: 2px; height: 14px;
  background: var(--ink); opacity: 0.55; transform: translateX(-50%);
}
.est-range { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.est-footer { margin: 10px 0 0; font-size: 11.5px; color: var(--ink-faint); }

/* ---------- Saved searches (chips row under the filter bar) ---------- */

.saved-searches-row {
  max-width: 1160px;
  margin: 0 auto;
  padding: 8px 20px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.chip--saved { display: inline-flex; align-items: center; gap: 6px; }
.chip-x {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-faint);
  padding: 0 2px;
  cursor: pointer;
}
.chip-x:hover { color: #b3372f; }
.save-search-form { display: inline-flex; align-items: center; gap: 6px; }
/* Explicit display defeats the UA [hidden] rule — restate it (same trap as
   .overlay / .map-tools / .chat-pill__badge). The form ships hidden
   (index.html) and is toggled by the "☆ Save search" chip; without this the
   name input + Save button rendered permanently and the chip was a no-op
   (found 2026-09-11 review). */
.save-search-form[hidden] { display: none; }
.save-search-form input {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: transparent;
  width: 170px;
}
.save-search-form input:focus { outline: none; border-color: var(--green); }
.save-search-submit { padding: 6px 14px; font-size: 13px; }

/* ---------- Header FAQ link ---------- */
.header-right {
  display: flex;
  align-items: center;
  /* May wrap (right-aligned) — the map view appends a "· zoom in for prices"
     hint to the count, and below ~1100px that no longer fits beside the
     store badges + About/FAQ/Chat/JD. Wrapping the count onto a second line
     beats the badges stacking vertically (their own flex-wrap kicked in
     first before this rule existed). */
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px 22px;
}
.header-link {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.header-link:hover { text-decoration: underline; }
/* The Chat entry is a <button> (action, not navigation) — strip the UA
   button chrome so it reads exactly like the About / FAQ anchors. */
.header-link--btn {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  line-height: inherit;
}

/* Light / dark switch (header): a 34px ghost disc between Chat and the
   account badge — moon on a light page (tap = go dark), sun on a dark one
   (tap = go light). The icon swap is pure CSS off <html data-theme>; app.js
   only keeps the label in step and stores the choice. */
.theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--green);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--green);
  outline: none;
  box-shadow: 0 0 0 3px rgba(14, 122, 95, 0.16);
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .theme-toggle__sun { display: none; }
:root[data-theme="dark"] .theme-toggle .theme-toggle__sun { display: block; }
:root[data-theme="dark"] .theme-toggle .theme-toggle__moon { display: none; }

/* ---------- Signed-in account badge (header) ---------- */
/* Initials avatar ("JD") + a small menu (name · email · Log out). Rendered
   by account.js off the stored VOW session; the whole block stays [hidden]
   for anonymous visitors. */
.account { position: relative; display: flex; align-items: center; }
.account[hidden] { display: none; } /* display:flex would defeat [hidden] */
.account__btn {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.account__btn:hover,
.account__btn:focus-visible,
.account__btn[aria-expanded="true"] {
  border-color: #EEC36C; /* the logo's gable-window gold */
  outline: none;
  box-shadow: 0 0 0 3px rgba(238, 195, 108, 0.28);
}
.account__avatar {
  font-family: var(--sans);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  user-select: none;
}
.account__glyph { display: block; }
.account__glyph[hidden] { display: none; }
.account__menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 32px));
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-lift);
  z-index: 30; /* above the sticky header (20), below overlays (100) */
  animation: rise 0.18s ease;
}
.account__menu[hidden] { display: none; }
.account__who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
.account__name {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.account__email {
  font-family: var(--sans);
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 2px;
  overflow-wrap: anywhere;
}
.account__email[hidden] { display: none; }
.account__logout {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.account__logout:hover,
.account__logout:focus-visible {
  background: rgba(14, 122, 95, 0.08);
  color: var(--green);
  outline: none;
}
@media (max-width: 760px) {
  /* Phone / small-tablet header: the wordmark alone is ~300px and the nav
     row (About · FAQ · Chat · JD · count) ~360px, so one row needs ~740px
     (the pre-Chat header already spilled past the viewport on phones —
     measured 2026-09-10). Wrap the nav onto a full-width second row: links
     left, count pinned right. */
  .site-header__inner { flex-wrap: wrap; row-gap: 10px; padding: 14px 18px 12px; }
  /* The row itself may wrap too: the count grows a "showing first 100 of N"
     hint on the map, which must fold under the links, never overflow. */
  .header-right { flex: 1 1 100%; flex-wrap: wrap; gap: 8px 14px; min-width: 0; }
  /* The map's long hint ("of N shown — move the map to load the rest") must
     fold under the number on phones instead of forcing the row wider than
     the viewport (.results-count is nowrap on desktop). */
  .results-count { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; white-space: normal; min-width: 0; text-align: right; }
  .account__btn { width: 30px; height: 30px; }
  .account__avatar { font-size: 11.5px; }
}

/* ---------- App store badges (header + FAQ item) ---------- */
/* Official-look badges drawn in-house (inline SVG + CSS text) so they stay
   self-hosted and theme-safe. Anchors carry NO href until the store listings
   exist — an <a> without href is inert by spec; wire the real URLs at publish.
   Footer placement tried 2026-07-14 and removed on user call (wasted space). */
.store-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 13px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: 9px;
  text-decoration: none;
  line-height: 1;
  white-space: nowrap;
  cursor: default;
}
.store-badge__icon { width: 24px; height: 24px; flex: none; }
.store-badge__text { display: flex; flex-direction: column; gap: 3px; text-align: left; }
.store-badge__pre {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}
.store-badge__name {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
/* Compact header variant */
.store-badge--sm { padding: 5px 11px 5px 9px; border-radius: 7px; gap: 7px; }
.store-badge--sm .store-badge__icon { width: 17px; height: 17px; }
.store-badge--sm .store-badge__text { gap: 2px; }
.store-badge--sm .store-badge__pre { font-size: 7.5px; }
.store-badge--sm .store-badge__name { font-size: 12px; }
/* pure-black badge melts into dark paper — official dark treatment is a
   light outline */
:root[data-theme="dark"] .store-badge { border-color: rgba(255, 255, 255, 0.35); }
@media (max-width: 900px) {
  /* Header space is scarce below ~900px (measured 2026-09-10: wordmark +
     two badges + About/FAQ/Chat/JD/count overflowed the viewport from
     ~895px down — iPad portrait included); the FAQ-item badges remain. */
  .header-right .store-badges { display: none; }
}

/* ---------- Agent chat (CTA in the detail overlay + floating panel) ---------- */
.chat-cta-row { margin: 4px 0 18px; }
.chat-cta {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 18px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.chat-cta:hover { background: var(--green-deep); }
.chat-cta__bubble { font-size: 18px; line-height: 1; }
.chat-cta__hint {
  margin-left: auto;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
}

/* Panel floats OUTSIDE the detail overlay (z above it) so overlay re-renders
   never destroy a live conversation. */
.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lift);
  z-index: 140; /* overlay is 100 — chat stays usable over it */
  overflow: hidden;
}
.chat-panel__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}
.chat-panel__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex: none;
}
/* Whole header = one link to About (× is a sibling, not inside it) */
.chat-panel__head-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.chat-panel__head-link:hover .chat-panel__name { text-decoration: underline; }
.chat-panel__brand { margin-left: auto; height: 22px; flex: none; display: flex; }
.chat-panel__who { min-width: 0; }
.chat-panel__name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.chat-panel__status {
  font-size: 11.5px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-panel__status--online { color: var(--green); font-weight: 600; }
.chat-panel__status--online::before { content: "● "; font-size: 9px; }
.chat-panel__close {
  margin-left: auto;
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 4px 6px;
}
.chat-panel__close:hover { color: var(--ink); }
.chat-panel__body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-panel__loading {
  margin: auto;
  text-align: center;
  font-size: 13.5px;
  color: var(--ink-faint);
  padding: 0 24px;
  line-height: 1.6;
}
.chat-msg { display: flex; }
.chat-msg--mine { justify-content: flex-end; }
.chat-msg--theirs { justify-content: flex-start; }
.chat-msg__bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg--mine .chat-msg__bubble {
  background: var(--green);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg--theirs .chat-msg__bubble {
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
/* Linkified URLs inside bubbles (iter 107 — the welcome's FAQ link, pasted
   listing links). Inherit the bubble's text color on both bubble tints;
   underline is the affordance. break-all so long URLs can't overflow. */
.chat-msg__bubble a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.chat-msg--system {
  justify-content: center;
  font-size: 11.5px;
  color: var(--ink-faint);
  text-align: center;
}
.chat-panel__typing {
  padding: 0 16px 6px;
  font-size: 12px;
  color: var(--ink-faint);
  font-style: italic;
}
.chat-panel__composer {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.chat-panel__composer input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  font-family: var(--sans);
  font-size: 14px;
  background: var(--card);
  color: var(--ink);
}
.chat-panel__composer input:focus { outline: none; border-color: var(--green); }
.chat-panel__send {
  border: none;
  background: var(--green);
  color: #fff;
  border-radius: 999px;
  padding: 9px 18px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.chat-panel__send:hover { background: var(--green-deep); }
/* Transport down: dim the composer until the socket redials */
.chat-panel--offline .chat-panel__composer { opacity: 0.6; }
.chat-gate { border: none; padding: 0; }
@media (max-width: 640px) {
  .chat-panel {
    right: 12px;
    bottom: 12px;
    height: min(70vh, 560px);
  }
}

/* Chat panel listing-context row — which house the conversation is about */
.chat-panel__listing {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
  text-decoration: none;
  font-size: 12px;
  min-width: 0;
}
.chat-panel__listing:hover .chat-panel__listing-text { text-decoration: underline; }
.chat-panel__listing-label {
  flex: none;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-faint);
  font-weight: 600;
}
.chat-panel__listing-text {
  color: var(--green);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-panel__listing-arrow { flex: none; color: var(--ink-faint); }

/* Back to top (list view only). Same right edge as the minimized chat pill,
   stacked above it; below overlays (100) so an open detail covers it. */
.to-top {
  position: fixed;
  right: 22px;
  bottom: 84px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 50%;
  box-shadow: var(--shadow-lift);
  cursor: pointer;
  z-index: 30; /* above the sticky header (20), below overlays (100) */
}
.to-top:hover { background: var(--green-deep); }
.to-top:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.to-top[hidden] { display: none; } /* the class's display would beat the UA hidden rule */

/* Minimized chat tab — the socket stays live; badge counts arrivals */
.chat-pill {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px 10px 12px;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  z-index: 140;
}
.chat-pill:hover { background: var(--green-deep); }
.chat-pill__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex: none;
}
.chat-pill__badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #EEC36C; /* the logo's gable-window gold */
  color: #1A1D29;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes chat-pill-pulse {
  0% { transform: scale(1); }
  35% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.chat-pill--pulse { animation: chat-pill-pulse 0.45s ease; }
@media (max-width: 640px) {
  .chat-pill { right: 12px; bottom: 12px; }
}

/* Explicit display:flex would defeat the [hidden] UA style — restate it
   (same trap as .overlay / .view-toggle__count; bit the chat panel
   2026-07-14: × set hidden but the panel stayed visible). */
.chat-panel[hidden],
.chat-pill[hidden],
.chat-pill__badge[hidden],
.chat-panel__listing[hidden],
.chat-panel__composer[hidden] {
  display: none;
}

/* Realtor photo avatars (chat header + minimized pill) */
.chat-panel__avatar--photo,
.chat-pill__avatar--photo {
  object-fit: cover;
  padding: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
}
.chat-panel__avatar--photo { border-color: var(--line); }

/* ---------- Nearby cards — schools / rapid transit / community assessments
   (City of Calgary open data; iOS NearbySchoolsCard / NearestTransitRow /
   CommunityAssessmentsCard parity). Slots are filled by nearby.js. ---------- */
.nearby-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 12px;
}
.nearby-card--row { padding: 12px 14px; }
.nearby-card__title { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); }
.nearby-card__sub { font-size: 12px; color: var(--ink-faint); margin-top: 2px; }
.nearby-card__foot { font-size: 10.5px; color: var(--ink-faint); margin-top: 12px; }
.nearby-rows { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.nearby-row { display: flex; align-items: center; gap: 10px; }
.nearby-row__body { min-width: 0; }
.nearby-row__name { font-family: var(--serif); font-size: 14px; font-weight: 600; color: var(--ink); }
.nearby-row__name--sans { font-family: var(--sans); font-size: 13px; }
.nearby-row__meta { font-size: 11px; color: var(--ink-faint); margin-top: 1px; }
.nearby-row__km {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.board-chip {
  flex: none;
  min-width: 44px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 999px;
}
.board-chip--cbe { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.board-chip--ccsd { color: #b88d38; background: rgba(184, 141, 56, 0.14); }
.board-chip--other { color: var(--ink-faint); background: color-mix(in srgb, var(--ink-faint) 14%, transparent); }
.transit-dot {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.transit-dot--red { background: #cc1a24; }
.transit-dot--blue { background: #0f57a8; }
.transit-dot--max { background: #00919e; }
.transit-dot--other { background: #8e8e93; }
.assess-hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; margin-top: 12px; }
.assess-value { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--ink); line-height: 1; }
.assess-label { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.assess-delta { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.assess-delta--up { color: var(--green); }
.assess-delta--down { color: #d9822b; }
.assess-delta small { display: block; font-size: 10px; font-weight: 400; color: var(--ink-faint); }
.assess-bars { display: flex; align-items: flex-end; gap: 6px; height: 110px; margin-top: 14px; }
.assess-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.assess-bar__fill { width: 100%; border-radius: 3px; background: color-mix(in srgb, var(--green) 35%, transparent); }
.assess-bar--latest .assess-bar__fill { background: var(--green); }
.assess-bar__year { font-size: 9px; color: var(--ink-faint); }
