/* ============================================================================
   chrome.css — shared site chrome (header / nav / mobile menu / footer /
   saved-panel). Linked once per public page, alongside tokens.css.

   R2 consolidation. Sections land in slices:
     [3a] HEADER + nav + active-state          ← this slice
     [3b] mobile menu + footer                  (folded from per-page <style>)
     [3c] saved-panel + bookmarks               (folded from index/results)

   Canonical header lineage (bare <header> + .header-inner + .header-right)
   is the single source of truth; the legacy pillar lineage (.site-header /
   .site-header-inner) is retired as pages adopt <!--SITE_HEADER-->.
   ========================================================================== */

/* ── Base ──────────────────────────────────────────────────────────────────
   Site-wide body font. Was declared per-page in each local <style>; a page that
   omitted it (buildings.html) fell back to the browser serif. Home it here once
   so every page — current and future — inherits the brand typeface. Pages that
   still declare their own body font simply override with the same value. */
body { font-family: 'Inter', system-ui, sans-serif; }

/* ── Header shell ──────────────────────────────────────────────────────── */
header {
  position: sticky; top: 0; z-index: 100;
  background: var(--surface-dark);
  border-bottom: 1px solid rgba(255,255,255,.06);
  padding: 16px 20px;
}
.header-inner {
  position: relative;
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

/* ── Logo ──────────────────────────────────────────────────────────────── */
.logo {
  --mark-h: 36px;
  display: inline-flex; align-items: center; gap: 11px;
  text-decoration: none;
}
.logo-text {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: var(--fs-7);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.03em;
  color: var(--text-on-dark) !important;
}
.logo-text span { color: var(--text-on-dark); font-style: italic; }
/* Brand mark (white house-key, sits on the dark chrome bands). The source SVG
   has built-in padding, so the rendered height runs a little larger than the
   visible mark: the visible glyph is inset --mark-inset on every side (see
   --mark-inset below). Each logo container declares its own --mark-h; the mark
   height and the tagline's glyph alignment are both derived from it, so a
   resize can only ever be made in ONE place. */
.brand-mark { width: auto; display: block; flex: none; height: var(--mark-h); }
/* The mark's visible-glyph inset, as a fraction of the SVG frame. The house path
   spans x 16..84 at stroke-width 7 (visible 12.5..87.5) inside a 1.12x scale
   wrapper about the centre: 50 - (12.5 - 50) * 1.12 = 8.0 per 100 viewBox units.
   It was 12.5% before the mark was bumped on 8 Jul (a940081). If the mark SVG's
   geometry or scale wrapper changes, this constant is the ONE place to update. */
.logo, .ftr-logo, .menu-drawer-logo { --mark-inset: 0.08; }

/* ── Primary nav (grouped disclosure dropdowns) ────────────────────────── */
.header-nav {
  display: flex; align-items: center; gap: 2px;
  flex: 1; margin: 0 16px;
}

/* Shared look: dropdown trigger buttons + the plain Mortgage link */
.nav-trigger, .nav-link {
  font-family: 'Inter', sans-serif;
  font-size: var(--fs-2);
  font-weight: 500;
  color: var(--text-on-dark);
  background: transparent;
  border: none;
  padding: 8px 14px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px;
  transition: color .2s, background .2s;
}
.nav-trigger:hover, .nav-link:hover { color: var(--text-on-dark); background: rgba(255,255,255,.06); }

.nav-group { position: relative; }
.nav-chevron { width: 16px; height: 16px; opacity: .8; transition: transform .2s; }
.nav-trigger[aria-expanded="true"] { color: var(--text-on-dark); background: rgba(255,255,255,.06); }
.nav-trigger[aria-expanded="true"] .nav-chevron { transform: rotate(180deg); }

/* Dropdown panel */
.nav-dropdown {
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 192px;
  background: var(--surface-dark);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 120;
}
.nav-group.open .nav-dropdown { display: block; }
.nav-dropdown a, .nav-dropdown .nav-dropdown-action {
  display: block; width: 100%; text-align: left;
  font-family: 'Inter', sans-serif;
  font-size: var(--fs-2); font-weight: 500;
  color: var(--text-subtle);
  background: transparent; border: none;
  padding: 8px 12px; border-radius: 6px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav-dropdown a:hover, .nav-dropdown .nav-dropdown-action:hover {
  color: var(--text-on-dark); background: rgba(255,255,255,.06);
}

/* Header search — collapsed to a toggle icon in the right cluster; the field
   drops from the header as a panel (anchored to .header-inner, position:relative). */
.nav-search-toggle {
  width: 42px; height: 42px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.12); border-radius: 50%;
  background: transparent; color: var(--text-on-dark); cursor: pointer;
  transition: all .2s;
}
.nav-search-toggle:hover { border-color: var(--accent); }
.nav-search-toggle[aria-expanded="true"] { border-color: var(--accent); background: rgba(255,255,255,.06); }
.nav-search-toggle svg { width: 20px; height: 20px; pointer-events: none; }
.nav-search {
  position: absolute; top: calc(100% + 12px); right: 0;
  width: min(360px, calc(100vw - 40px));
  display: none; z-index: 130;
  background: var(--surface-dark);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  padding: 10px;
  box-shadow: var(--shadow-lg);
}
.nav-search.open { display: block; }
.nav-search-icon {
  position: absolute; left: 13px; width: 18px; height: 18px;
  color: var(--text-on-dark); pointer-events: none;
}
.nav-search-input {
  font-family: 'Inter', sans-serif; font-size: var(--fs-3);
  color: var(--text-on-dark);
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 10px;
  padding: 10px 15px 10px 40px;
  width: 100%;
  transition: border-color .2s, background .2s;
}
.nav-search-input::placeholder { color: rgba(255,255,255,.55); }
.nav-search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255,255,255,.08);
}
.nav-search-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  width: 100%; max-width: 100%;
  background: var(--surface-dark);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  max-height: 340px; overflow-y: auto;
  z-index: 120;
}
.nav-search-results.open { display: block; }
.nav-search-results .ns-item {
  display: block; width: 100%; text-align: left;
  font-family: 'Inter', sans-serif; font-size: var(--fs-2); font-weight: 500;
  color: var(--text-subtle); background: transparent; border: none;
  padding: 8px 12px; border-radius: 6px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color .15s, background .15s;
}
.nav-search-results .ns-item:hover, .nav-search-results .ns-item.active {
  color: var(--text-on-dark); background: rgba(255,255,255,.06);
}
.nav-search-results .ns-item .ns-tag { font-size: var(--fs-1); color: var(--text-subtle); margin-left: 6px; }
.nav-search-results .ns-empty { padding: 10px 12px; font-size: var(--fs-2); color: var(--text-subtle); }

/* Active-nav highlight - driven by <body data-page="...">. The parent trigger
   lights up for any child page; the plain link lights on its own page.
   index / community / results highlight nothing (Search is now an input, not a link).
   About Us = about / methodology / newsletter; Market Insights = dubai-property-prices /
   market / map / blog. Keep this in step with the header partial's dropdown contents. */
body[data-page="market"]                        #navTriggerMarket,
body[data-page="dubai-property-prices"]         #navTriggerMarket,
body[data-page="dubai-property-price-per-sqft"] #navTriggerMarket,
body[data-page="map"]                           #navTriggerMarket,
body[data-page="blog"]                          #navTriggerMarket,
body[data-page="methodology"]                   #navTriggerAbout,
body[data-page="about"]                         #navTriggerAbout,
body[data-page="newsletter"]                    #navTriggerAbout,
body[data-page="dubai-mortgage-calculator"]     #navTriggerTools,
body[data-page="verify"]                        #navTriggerTools {
  color: var(--accent-2-soft);
}
body[data-page="admin"] .nav-link[href="/kk-fattybear"] {
  color: var(--accent-2-soft); font-weight: 600;
}

/* ── Header-right cluster (Saved / About / hamburger) ──────────────────── */
.header-right { display: flex; align-items: center; gap: 6px; }

.bookmarks-btn {
  position: relative;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  color: var(--text-on-dark);
  transition: all .2s;
  flex-shrink: 0;
}
.bookmarks-btn:hover { border-color: var(--accent); color: var(--text-on-dark); }
.bookmarks-btn svg { width: 20px; height: 20px; }
.bookmarks-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 20px; height: 20px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-1);
  font-weight: 700;
  border-radius: 50%;
  display: none;
  align-items: center; justify-content: center;
}
.bookmarks-badge.visible { display: flex; }

/* R4 dark-mode toggle — matches the circular header buttons; hover to lime (reads
   on the dark chrome, where --accent does not). The icon is a contrast disc, not
   the sun/moon cliché. */
.theme-toggle {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%;
  cursor: pointer; background: transparent;
  color: var(--text-on-dark);
  transition: all .2s;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent-2-soft); color: var(--accent-2-soft); }
.theme-toggle svg { width: 19px; height: 19px; pointer-events: none; }

/* (.about-btn removed — the About-This-Data trigger now lives inside the
   About Us dropdown and the mobile drawer, no standalone header button.) */

.hamburger-btn {
  width: 42px; height: 42px;
  display: none !important; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%; cursor: pointer;
  background: transparent; color: var(--text-subtle);
  transition: all .2s; flex-shrink: 0;
}
.hamburger-btn:hover { border-color: var(--accent); color: var(--text-on-dark); }
.hamburger-btn svg { width: 20px; height: 20px; pointer-events: none; }

/* ── Tablet / mobile (≤900px): hide the dropdown nav, show the hamburger ── */
@media (max-width: 900px) {
  header { padding: 14px 12px; }
  .header-inner { gap: 6px; }
  .header-right { flex-shrink: 0; gap: 6px; }
  .logo-text { font-size: var(--fs-6); }
  .logo { --mark-h: 30px; }
  .header-nav { display: none; }
  .nav-search-toggle { display: none; }   /* drawer carries search on mobile */
  .hamburger-btn { display: flex !important; }
}

/* ============================================================================
   Mobile drawer — accordion groups + search (NEW chrome, sitewide).
   The drawer shell (.menu-overlay/.menu-drawer/.menu-nav/.menu-footer/…) is
   still styled per-page inline (folds out in each page's restyle); these
   classes are brand-new to the drawer, so per the 3c rule their CSS ships here
   now. !important overrides the inline `.menu-nav a,.menu-nav button` base
   (page <style> loads after chrome.css, so it wins ties otherwise).
   ========================================================================== */
.menu-group-trigger { justify-content: space-between !important; width: 100%; }
.menu-chevron { width: 16px; height: 16px; flex-shrink: 0; opacity: .7; transition: transform .2s; }
.menu-group-trigger[aria-expanded="true"] .menu-chevron { transform: rotate(180deg); }
.menu-group-items { display: none; }
.menu-group-items.open { display: block; }
.menu-group-items a, .menu-group-items button { padding-left: 40px !important; font-size: var(--fs-2) !important; }

.menu-flat-link { display: flex; align-items: center; }

/* flex-wrap so the results list wraps onto its own full-width row BELOW the input,
   rather than being squeezed beside it (the input is width:100%). */
.menu-search { position: relative; display: flex; flex-wrap: wrap; align-items: center; padding: 8px 20px; }
.menu-search-icon { position: absolute; left: 32px; width: 16px; height: 16px; color: var(--text-subtle); pointer-events: none; }
.menu-search-input {
  width: 100%;
  font-family: 'Inter', sans-serif; font-size: var(--fs-2);
  color: var(--text-on-dark); background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.10); border-radius: 8px;
  padding: 9px 12px 9px 34px;
}
.menu-search-input::placeholder { color: var(--text-subtle); }
.menu-search-input:focus { outline: none; border-color: var(--accent); }
.menu-search-results { flex: 0 0 100%; padding: 4px 20px 0; }
.menu-search-results .ms-item {
  display: block; width: 100%; text-align: left;
  font-family: 'Inter', sans-serif; font-size: var(--fs-2); font-weight: 500;
  color: var(--text-subtle); background: transparent; border: none;
  padding: 8px; border-radius: 6px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.menu-search-results .ms-item:hover, .menu-search-results .ms-item.active { color: var(--text-on-dark); background: rgba(255,255,255,.06); }
.menu-search-results .ms-empty { padding: 8px; font-size: var(--fs-2); color: var(--text-subtle); }

/* ============================================================================
   Saved-transactions panel (3c) — ported sitewide. The .bookmarks-* header
   button lives above (3a); these are the slide-in panel + its compare button.
   index/results still carry inline copies (fold out in the restyle); chrome.css
   is the go-forward single source and the ONLY source on the 7 pillar pages.
   ========================================================================== */
.saved-panel {
  position: fixed;
  top: 0; right: -360px;
  width: 340px; height: 100vh;
  height: 100dvh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 32px rgba(0,0,0,.12);
  z-index: 150;
  transition: right .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.saved-panel.open { right: 0; }

.saved-overlay {
  position: fixed; inset: 0; z-index: 149;
  background: rgba(0,0,0,.3);
  display: none;
  backdrop-filter: blur(2px);
}
.saved-overlay.open { display: block; }

.saved-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.saved-title {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: var(--fs-4);
  font-weight: 700;
  color: var(--text);
}
.saved-count-badge {
  font-family: 'Inter', sans-serif;
  font-size: var(--fs-1);
  font-weight: 600;
  background: var(--accent);
  color: var(--on-accent);
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 8px;
}
.saved-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  cursor: pointer; color: var(--text-muted);
  border-radius: 50%;
  transition: background .2s;
}
.saved-close:hover { background: var(--surface-alt); }

.saved-body {
  flex: 1; overflow-y: auto;
  padding: 12px 0;
}
.saved-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  font-size: var(--fs-3);
  line-height: 1.6;
}
.saved-empty svg {
  width: 36px; height: 36px;
  color: var(--text-subtle);
  margin-bottom: 12px;
}

.saved-item {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  display: flex; align-items: flex-start;
  gap: 10px;
}
.saved-item:last-child { border-bottom: none; }
.saved-item:hover { background: var(--surface-alt); }
.saved-item-info { flex: 1; min-width: 0; }
.saved-item-area {
  font-size: var(--fs-2);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-item-project {
  font-size: var(--fs-1);
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-item-price {
  font-family: 'Inter Tight', 'Inter', sans-serif;
  font-size: var(--fs-3);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.saved-item-meta {
  font-size: var(--fs-1);
  color: var(--text-muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.saved-remove {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  cursor: pointer; color: var(--text-subtle);
  border-radius: 4px;
  flex-shrink: 0;
  transition: color .2s;
  font-size: var(--fs-4);
  padding: 0;
}
.saved-remove:hover { color: var(--danger); }

.saved-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.saved-clear-btn {
  width: 100%;
  padding: 9px;
  font-family: 'Inter', sans-serif;
  font-size: var(--fs-2);
  font-weight: 500;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .2s;
}
.saved-clear-btn:hover { border-color: var(--danger); color: var(--danger); }

.compare-btn {
  width: 100%; padding: 9px;
  font-family: 'Inter', sans-serif; font-size: var(--fs-2); font-weight: 600;
  background: var(--accent); color: var(--on-accent);
  border: none; border-radius: 6px; cursor: pointer;
  margin-top: 8px; transition: opacity .2s;
}
.compare-btn:hover { opacity: .85; }
.compare-btn:disabled { opacity: .4; cursor: default; }

/* ============================================================================
   CHROME BUILDING BLOCKS — footer + mobile-drawer base, folded
   sitewide so every page (incl. new pages) inherits them with ZERO page-local
   CSS. The 9 legacy pages still carry inline copies that override these via
   cascade order (page <style> loads after chrome.css); those shed during each
   page's restyle. chrome.css is the single go-forward source.
   ========================================================================== */

/* ── Footer ─────────────────────────────────────────────────────────────── */
.ftr-inner { max-width: 1080px; margin: 0 auto; }

.ftr-news {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding-bottom: 24px; margin-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.ftr-news-title { font-family: 'Inter Tight', sans-serif; font-weight: 700; font-size: var(--fs-4); color: var(--text-on-dark); letter-spacing: -.01em; }
.ftr-news-sub { font-size: var(--fs-2); color: rgba(255,255,255,.72); margin-top: 4px; max-width: 420px; line-height: 1.5; }
.ftr-news-form { display: flex; flex-direction: column; gap: 6px; min-width: 300px; }
.ftr-news-row { display: flex; gap: 8px; }
.ftr-input {
  font-family: 'Inter', sans-serif; font-size: var(--fs-2); color: var(--text-on-dark);
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 8px;
  padding: 10px 14px; width: 240px; outline: none; transition: border-color .2s, background .2s;
}
.ftr-input::placeholder { color: var(--text-subtle); }
.ftr-input:focus { border-color: var(--accent); background: rgba(255,255,255,.08); }
.ftr-btn {
  font-family: 'Inter', sans-serif; font-size: var(--fs-2); font-weight: 700; color: var(--surface-dark);
  background: var(--accent-2-soft); border: none; border-radius: 8px;
  padding: 10px 18px; cursor: pointer; white-space: nowrap; transition: opacity .2s;
}
.ftr-btn:hover { opacity: .9; }
.ftr-btn:disabled { opacity: .6; cursor: default; }
.ftr-news-micro { font-size: var(--fs-1); color: rgba(255,255,255,.72); }
.ftr-ok { font-size: var(--fs-2); color: var(--text-on-dark); font-weight: 600; display: none; padding: 4px 0; }
.ftr-err { font-size: var(--fs-2); color: var(--danger); display: none; padding: 4px 0; }

.ftr-bottom { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.ftr-logo { --mark-h: 34px; display: inline-flex; align-items: center; gap: 9px; font-family: 'Inter Tight', sans-serif; font-size: var(--fs-7); font-weight: 700; color: var(--text-on-dark); text-decoration: none; }
.ftr-logo-text span { color: var(--text-on-dark); font-style: italic; }
.ftr-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ftr-links { display: flex; align-items: center; gap: 10px; font-size: var(--fs-2); }
.ftr-links a { color: var(--text-on-dark); text-decoration: none; transition: color .2s; }
.ftr-links a:hover { color: var(--accent-2-soft); }
.ftr-links span { color: var(--text-on-dark); }
.ftr-attr { font-size: var(--fs-1); color: rgba(255,255,255,.72); text-align: center; line-height: 1.6; }
.ftr-attr a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.ftr-social { display: flex; align-items: center; justify-content: flex-end; gap: 16px; }
.ftr-social a { color: var(--text-on-dark); display: inline-flex; transition: color .2s; }
.ftr-social a:hover { color: var(--accent-2-soft); }

@media (max-width: 640px) {
  .ftr-news { flex-direction: column; align-items: stretch; text-align: center; }
  .ftr-news-form { align-items: center; min-width: 0; }
  .ftr-news-row { justify-content: center; }
  .ftr-input { width: 100%; }
  .ftr-bottom { display: flex; flex-direction: column; gap: 16px; text-align: center; }
  .ftr-social { justify-content: center; }
}


/* ── Mobile drawer base (accordion classes already defined above) ───────── */
.menu-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.menu-overlay.open { opacity: 1; pointer-events: auto; }
.menu-drawer { position: fixed; top: 0; right: -300px; bottom: 0; width: 280px; z-index: 401; background: var(--surface-dark); border-left: 1px solid rgba(255,255,255,.08); transition: right .28s cubic-bezier(.4,0,.2,1); display: flex; flex-direction: column; }
.menu-drawer.open { right: 0; }
.menu-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,.06); }
.menu-drawer-logo { --mark-h: 22px; display: inline-flex; align-items: center; gap: 8px; font-family: 'Inter Tight', sans-serif; font-size: var(--fs-4); font-weight: 700; color: var(--text-on-dark); }
.menu-drawer-logo-text span { color: var(--text-on-dark); font-style: italic; }
.menu-close { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: none; background: transparent; cursor: pointer; color: var(--text-muted); border-radius: 50%; transition: background .2s; }
.menu-close:hover { background: rgba(255,255,255,.06); color: var(--text-on-dark); }
.menu-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.menu-nav a, .menu-nav button { display: flex; align-items: center; gap: 14px; padding: 13px 20px; font-family: 'Inter', sans-serif; font-size: var(--fs-3); font-weight: 500; color: var(--text-subtle); text-decoration: none; transition: all .15s; width: 100%; background: transparent; border: none; cursor: pointer; text-align: left; }
.menu-nav a:hover, .menu-nav button:hover { background: rgba(255,255,255,.04); color: var(--text-on-dark); }
.menu-nav-divider { height: 1px; background: rgba(255,255,255,.06); margin: 8px 0; }
.menu-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.06); font-family: 'Inter', sans-serif; font-size: var(--fs-1); color: var(--text-subtle); }

/* ── Simple content-page scaffold (about / legal / faq / future text pages) ─
   Shared so these pages never fork their own layout — default building block
   for prose pages; override only with a documented reason. */
.page-hero { padding: 64px 20px 28px; max-width: 1080px; margin: 0 auto; text-align: left; }
.page-hero .eyebrow { font-size: var(--fs-1); font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px; }
.page-hero h1 { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 700; font-size: clamp(1.9rem, 5vw, 2.8rem); letter-spacing: -.03em; line-height: 1.1; margin: 0 0 16px; color: var(--text); }
.page-hero h1 .h1-accent { color: var(--accent); font-style: italic; }
.page-hero p { max-width: none; margin: 0; font-size: var(--fs-4); line-height: 1.7; color: var(--text-muted); }
.page-content { max-width: var(--page-max); margin: 0 auto; padding: var(--page-pad); }
.page-content section { margin-top: 40px; }
.page-content h2 { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 700; font-size: var(--fs-5); letter-spacing: -.02em; margin: 0 0 12px; color: var(--text); }
.page-content h3 { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 600; font-size: var(--fs-4); margin: 20px 0 6px; color: var(--text); }
.page-content p { font-size: var(--fs-4); line-height: 1.75; color: var(--text-muted); margin: 0 0 14px; }
.page-content a:not(.page-cta) { color: var(--accent); text-decoration: none; }
.page-content a:not(.page-cta):hover { text-decoration: underline; }
.page-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; background: var(--accent-2-soft); color: var(--surface-dark); text-decoration: none; font-weight: 700; font-size: var(--fs-3); padding: 11px 20px; border-radius: var(--radius, 10px); transition: background var(--transition), transform var(--transition), box-shadow var(--transition); }
.page-cta:hover { background: var(--lime-hover); transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
/* Standard gap below a page hero's lede before its CTA. Scoped (0,2,0) so it beats
   ".page-hero p { margin:0 }" (the 8px base alone read too tight — e.g. methodology). */
.page-hero .page-cta { margin-top: 20px; }

/* Lime-pill CTA — the newsletter/alert submit button + the community CTA-card link.
   Lives here (not page-local) because the alerts.js widget renders <button class="cta-btn">
   on BOTH community and results; a page-local rule left it unstyled on results. */
.cta-btn { display: inline-flex; align-items: center; gap: 9px; background: var(--lime); color: var(--lime-ink) !important; font-weight: 700; padding: 11px 13px 11px 24px; border-radius: var(--radius-pill); font-size: var(--fs-3); transition: background var(--transition); }
.cta-btn:hover { background: var(--lime-hover); color: var(--lime-ink) !important; text-decoration: none; }

/* Island CTA (6.2) — the trailing chevron sits in a nested dark circle for depth, and
   nudges on hover. Applied to the flagship lime CTAs (.cta-btn) and the hero .page-cta;
   their inline "→" is removed in markup so the island is the only arrow. */
.cta-btn::after, .page-cta::after {
  content: ""; width: 1.55em; height: 1.55em; flex: none; border-radius: 50%;
  background-color: var(--surface-dark);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A7FF00' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l6 6-6 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: center; background-size: .82em;
  transition: transform var(--transition);
}
.cta-btn:hover::after, .page-cta:hover::after { transform: translateX(2px); }
.page-cta { gap: 10px; padding-right: 14px; }

/* Cross-link banner → /verify (community + deal pages). F2 trust layer. */
.verify-cta { display: flex; align-items: center; gap: 14px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); border: 1px solid var(--accent-soft); border-radius: 12px; padding: 14px 18px; }
.verify-cta > svg { flex: none; width: 26px; height: 26px; color: var(--accent); }
.verify-cta .vcta-text { flex: 1; min-width: 0; font-size: var(--fs-2); line-height: 1.4; color: var(--text); }
.verify-cta .vcta-text b { font-weight: 700; }
.verify-cta a.vcta-btn { flex: none; text-decoration: none; font-family: 'Inter', sans-serif; font-weight: 600; font-size: var(--fs-2); padding: 9px 15px; border-radius: var(--radius); background: var(--accent); color: var(--on-accent); white-space: nowrap; transition: transform var(--transition), box-shadow var(--transition); }
.verify-cta a.vcta-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
@media (max-width: 560px) { .verify-cta { flex-wrap: wrap; } .verify-cta .vcta-text { flex-basis: 100%; } }

/* R1 geo Phase 2: "Explore nearby" community chips (community pages). */
.nearby-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.nearby-chip {
  display: inline-flex; align-items: center;
  font-family: 'Inter', sans-serif; font-size: var(--fs-2); font-weight: 600;
  color: var(--accent); text-decoration: none;
  padding: 8px 14px; border-radius: 20px;
  border: 1px solid var(--accent-soft); background: var(--surface);
  transition: background .15s, border-color .15s;
}
.nearby-chip:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); border-color: var(--accent); }

/* Hero -> first content block: tighter gap + short gold lead rule (pillar pages).
   The :first-child selectors outrank the per-page `.section` / `.page-content section`
   top-margins on specificity (0,3,0 / 0,2,1) regardless of source order, so this is a
   single shared change with no page-local CSS and no markup edits. faq (h2 first child),
   blog index and newsletter are not prose sections and are intentionally not matched. */
.content > .section:first-child,
.data-wrap > .section:first-child,
.page-content > section:first-child { margin-top: 12px; }
.content > .section:first-child::before,
.data-wrap > .section:first-child::before,
.page-content > section:first-child::before {
  content: ""; display: block; width: 44px; height: 3px;
  background: var(--accent-2-soft); border-radius: 2px; margin-bottom: 18px;
}

/* ── Back to top (shared; injected sitewide via <!--BACK_TO_TOP-->) ──────────
   Hidden until scrolled past 400px — chrome.js toggles .visible. Tokenised
   (was hardcoded #161925 inline on index/results). */
.back-to-top {
  position: fixed; bottom: 28px; right: 20px;
  width: 42px; height: 42px;
  background: var(--surface-dark); color: var(--text-on-dark);
  border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.2);
  opacity: 0; transform: translateY(10px);
  transition: opacity .25s, transform .25s;
  z-index: 90; pointer-events: none;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--accent); }
.back-to-top svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .back-to-top { right: auto; left: 20px; } }

/* ============================================================================
   BLOG — article prose + index cards + funnel components
   ----------------------------------------------------------------------------
   Article body markup comes from rendered markdown, so it carries no classes;
   we style the elements under `.page-content.prose`. The double-class scope
   (0,2,1) deliberately outranks the base `.page-content h2/h3/p` rules (0,1,1)
   so the article spacing/rhythm wins regardless of source order. Everything is
   token-based, so a palette swap re-themes the blog with no extra work.
   Links inherit the existing `.page-content a:not(.page-cta)` rule above.
   ============================================================================ */

/* hero meta line under the post title (date · reading time · tag) */
.post-meta { font-size: var(--fs-2); color: var(--text-subtle); margin: 0; }
.post-meta .dot { margin: 0 8px; opacity: .5; }

/* lead / standfirst — first paragraph, auto-classed at render time */
.page-content.prose .lead { font-size: var(--fs-5); line-height: 1.7; color: var(--text); margin: 0 0 22px; }

/* heading rhythm (overrides base .page-content spacing) + h4 markdown emits */
.page-content.prose h2 { margin: 36px 0 12px; }
.page-content.prose h3 { margin: 28px 0 6px; }
.page-content.prose h4 { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 600; font-size: var(--fs-3); text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin: 22px 0 6px; }

/* lists */
.page-content.prose ul, .page-content.prose ol { margin: 0 0 16px; padding-left: 22px; color: var(--text-muted); font-size: var(--fs-4); line-height: 1.75; }
.page-content.prose li { margin: 0 0 6px; }
.page-content.prose li::marker { color: var(--accent); }

/* blockquote — the article takeaway */
.page-content.prose blockquote { margin: 22px 0; padding: 14px 20px; border-left: 3px solid var(--accent); background: var(--surface-alt); border-radius: 0 var(--radius) var(--radius) 0; }
.page-content.prose blockquote p { margin: 0; font-size: var(--fs-4); font-style: italic; color: var(--text); }

/* emphasis + rule */
.page-content.prose strong { color: var(--text); font-weight: 700; }
.page-content.prose em { font-style: italic; }
.page-content.prose hr { border: none; border-top: 1px solid var(--border); margin: 36px 0; }

/* images + figures */
.page-content.prose img { max-width: 100%; height: auto; border-radius: var(--radius); display: block; }
.page-content.prose figure { margin: 26px 0; }
.page-content.prose figcaption { font-size: var(--fs-2); color: var(--text-subtle); text-align: center; margin-top: 8px; }

/* inline code + code block (data-flavoured posts) */
.page-content.prose code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: .86em; background: var(--surface-alt); color: var(--text); padding: 1px 6px; border-radius: var(--radius-sm); }
.page-content.prose pre { background: var(--surface-dark); color: var(--text-on-dark); padding: 16px 18px; border-radius: var(--radius); overflow-x: auto; margin: 20px 0; font-size: var(--fs-2); line-height: 1.6; }
.page-content.prose pre code { background: none; color: inherit; padding: 0; }

/* tables — community comparisons etc. */
.page-content.prose table { width: 100%; border-collapse: collapse; margin: 22px 0; font-size: var(--fs-3); }
.page-content.prose th, .page-content.prose td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.page-content.prose th { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 600; color: var(--text); background: var(--surface-alt); }
.page-content.prose td { color: var(--text-muted); }
.page-content.prose tbody tr:last-child td { border-bottom: none; }

/* ── Funnel components (drop into a post via raw HTML in the markdown) ──────── */

/* data callout — a headline stat pulled from the dataset */
.stat-callout { display: flex; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 18px 22px; margin: 26px 0; box-shadow: var(--shadow); }
.stat-callout .figure { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 700; font-size: var(--fs-7); letter-spacing: -.02em; color: var(--accent); line-height: 1; white-space: nowrap; }
.stat-callout .label { font-size: var(--fs-3); color: var(--text-muted); line-height: 1.5; }

/* in-post CTA card — routes the reader into /results or /communities */
.post-cta-card { background: var(--surface-dark); color: var(--text-on-dark); border-radius: var(--radius-lg); padding: 26px 28px; margin: 32px 0; text-align: center; }
.post-cta-card h3 { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 700; font-size: var(--fs-5); margin: 0 0 8px; color: var(--text-on-dark); }
.post-cta-card p { color: var(--text-on-dark); opacity: .8; font-size: var(--fs-3); margin: 0 0 16px; }

/* article foot — tags + back-to-index */
.page-content.prose .post-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); margin-top: 36px; padding-top: 18px; flex-wrap: wrap; }
.post-foot .tags { display: flex; gap: 8px; flex-wrap: wrap; }
.post-foot .tag { font-size: var(--fs-1); font-weight: 600; color: var(--accent); background: var(--surface-alt); padding: 4px 10px; border-radius: 999px; }

/* ── Blog index (/blog) — post cards ──────────────────────────────────────── */
.blog-list { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.blog-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 22px 24px; text-decoration: none; transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition); }
.blog-card:hover { border-color: var(--accent); box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.blog-card .blog-card-meta { font-size: var(--fs-2); color: var(--text-subtle); margin-bottom: 8px; }
.blog-card .blog-card-meta .dot { margin: 0 7px; opacity: .5; }
.blog-card h2 { font-family: 'Inter Tight', 'Inter', sans-serif; font-weight: 700; font-size: var(--fs-5); letter-spacing: -.02em; color: var(--text); margin: 0 0 8px; }
.blog-card p { font-size: var(--fs-3); line-height: 1.6; color: var(--text-muted); margin: 0 0 12px; }
.blog-card .blog-card-more { font-size: var(--fs-2); font-weight: 600; color: var(--accent); }
.blog-empty { text-align: center; color: var(--text-muted); padding: 40px 0; }

/* R2-BRAND-TAGLINE */
/* Brand tagline (Discover. Decide. Invest). Logo containers become a column:
   [mark + wordmark] lockup on top, tagline below, left-aligned to the glyph. */
.logo, .ftr-logo, .menu-drawer-logo { flex-direction: column; align-items: flex-start; }
.logo { gap: 4px; }
.ftr-logo { gap: 3px; }
.menu-drawer-logo { gap: 2px; }
.logo .brand-lockup { display: inline-flex; align-items: center; gap: 4px; }
.ftr-logo .brand-lockup { display: inline-flex; align-items: center; gap: 3px; }
.menu-drawer-logo .brand-lockup { display: inline-flex; align-items: center; gap: 3px; }
.logo-tagline {
  font-family: 'Inter', sans-serif; font-style: italic; font-weight: 500;
  line-height: 1; letter-spacing: .01em; color: var(--accent-2-soft);
  white-space: nowrap;
  /* Left-align to the VISIBLE glyph, not the SVG frame. Derived, never hand-set:
     the mark is inset --mark-inset on each side, so the tagline needs exactly
     that much left margin. Resize a mark via --mark-h and this follows. */
  margin-left: calc(var(--mark-h) * var(--mark-inset));
}
.logo .logo-tagline { font-size: .72rem; }
.ftr-logo .logo-tagline { font-size: .62rem; }
.menu-drawer-logo .logo-tagline { font-size: .52rem; }
@media (max-width: 900px) {
  .logo .logo-tagline { font-size: .62rem; }   /* margin follows --mark-h: 30px */
}

/* Site-wide keyboard focus ring (UIUX #18) — same pattern as verify.html */
:where(a, button, select, input, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --accent (purple) is near-invisible on the dark chrome bands. The dark
   containers are: <header> (which also encloses .nav-dropdown and .nav-search,
   both dark panels), <footer>, and .menu-drawer. The saved panel is NOT dark
   (.saved-panel sits on var(--surface), white) so it's intentionally excluded —
   --accent already reads at ~11:1 there. */
:where(header, footer, .menu-drawer) :where(a, button, select, input, textarea, summary, [tabindex]):focus-visible {
  outline-color: var(--accent-2-soft);
}

/* C7 — a quiet, recurring reminder that every price is a registered SOLD price
   (what was actually paid), not an asking/listing price like the portals show.
   Shared across results, deal, community + homepage so the framing is consistent. */
.sold-line { font-size: var(--fs-2); line-height: 1.55; color: var(--text-muted); margin: 2px 0 0; }
.sold-line strong { color: var(--text); font-weight: 600; }
.sold-note { font-size: var(--fs-1); line-height: 1.5; color: var(--text-subtle); margin-top: 8px; }

/* ============================================================================
   R4-fix — DARK-MODE LEAFLET OVERRIDES
   ----------------------------------------------------------------------------
   The vendored Leaflet CSS hardcodes the popup wrapper/tip + zoom controls white,
   and the Esri "World_Light_Gray_Base" tiles are permanently light. In dark mode
   the popup content (var(--text)/--text-muted) then renders light-on-white and
   vanishes, and the tiles are a jarring bright block. These rules only bite when
   <html data-theme="dark">; the `[data-theme=…]` prefix out-specifies both the
   vendor rules and the page-inline .kk-* rules regardless of load order.
   Filter is scoped to .leaflet-tile so pins/labels/controls keep true colours.
   ============================================================================ */
:root[data-theme="dark"] .leaflet-tile {
  filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.92);
}
:root[data-theme="dark"] .leaflet-popup-content-wrapper,
:root[data-theme="dark"] .leaflet-popup-tip { background: var(--surface); }
:root[data-theme="dark"] .leaflet-popup-content-wrapper {
  border: 1px solid var(--border); box-shadow: var(--shadow-lg);
}
:root[data-theme="dark"] .leaflet-popup-close-button { color: var(--text-muted); }
:root[data-theme="dark"] .leaflet-bar a,
:root[data-theme="dark"] .leaflet-bar a:hover {
  background: var(--surface); color: var(--text); border-bottom-color: var(--border);
}
/* .kk-maplabel keeps its fixed near-white pill (it sits over the now-darkened
   tiles); only pin its text dark so it isn't white-on-white. */
:root[data-theme="dark"] .kk-maplabel { color: #0F1419; }

/* ============================================================================
   Editorial SVG trend chart (kk-svg-chart.js) — shared across the community,
   /market and /dubai-property-prices trend charts. The <svg> carries a 940x250
   viewBox and scales to its container width (height auto keeps the ratio). Text
   fills use theme tokens so axis/annotation labels stay legible in both themes.
   ============================================================================ */
/* overflow:visible so a font/data-dependent edge label (or a large-magnitude axis
   value) can never be clipped by the viewBox — the 404 clipping failure mode. */
/* The chart now draws in container-pixel space (kk-svg-chart.js sizes the viewBox to the
   container width + a viewport-aware aspect), so height:auto yields the right height and
   scaling stays uniform; min-height is just a floor for the rare pre-layout fallback. */
svg.kk-chart { display: block; width: 100%; height: auto; min-height: 180px; overflow: visible; }
svg.kk-chart .kkc-axis,
svg.kk-chart .kkc-xlab { font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 500; fill: var(--text-subtle); }
svg.kk-chart .kkc-anno { font-family: 'Inter Tight', 'Inter', sans-serif; font-size: 10px; font-weight: 600; fill: var(--text-muted); }

/* Visually-hidden but screen-reader-available (shared; was page-local in results.html).
   Used for the chart data-tables (F2) and other AT-only text. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Inline SVG trend glyph (6.1, window.kkArrow) — sizes to the surrounding text, inherits its colour. */
.kk-arrow { display: inline-block; width: .72em; height: .72em; vertical-align: -1px; margin-right: 3px; flex: none; }

/* W1 — numbers-as-hero: currency/unit affixes (AED, /sqft) recede so the figure dominates.
   em-relative → scales with any number size; pair it with a non-breaking space at the call
   site so "AED 1,563" never wraps onto two lines. */
.num-affix { font-size: .56em; font-weight: 600; color: var(--text-muted); letter-spacing: 0; }

/* W3 — flagship card: a thin accent tab at the top edge marks a page's primary insight.
   overflow:hidden clips it to the card's rounded corners; the outset shadow is unaffected. */
.card-flag { position: relative; overflow: hidden; }
.card-flag::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: var(--accent); pointer-events: none; }

/* W5 — low-confidence state: a limited-data card recedes (neutral muted surface, flat, no
   float, defined by a hairline) so the eye weights it below the confident elevated cards. */
.card.is-lowdata, .kpi-box.is-lowdata { background: var(--surface-muted); box-shadow: none; border-color: var(--border); }

/* Staggered settle-in for KPI / card rows on load (4.2). Subtle, and the global
   prefers-reduced-motion guard above collapses it to an instant appear. */
@keyframes kk-settle { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.kk-stagger > * { animation: kk-settle .5s var(--ease) both; }
.kk-stagger > *:nth-child(1) { animation-delay: .03s; }
.kk-stagger > *:nth-child(2) { animation-delay: .09s; }
.kk-stagger > *:nth-child(3) { animation-delay: .15s; }
.kk-stagger > *:nth-child(4) { animation-delay: .21s; }
.kk-stagger > *:nth-child(5) { animation-delay: .27s; }
.kk-stagger > *:nth-child(n+6) { animation-delay: .33s; }

/* Faint grain on the dark bands (5.2) — a value-add texture, not a marketing flourish.
   Scoped to the footer + dark CTA cards (NOT the sticky header, to keep the nav clean);
   sits behind content, ignores pointer events, and is theme-neutral (overlay blend). */
footer, .cta-card { position: relative; }
footer > *, .cta-card > * { position: relative; z-index: 1; }
footer::before, .cta-card::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; border-radius: inherit;
  opacity: .05; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================================
   Data-page shared components: filter / sort / pagination / autocomplete / search.
   Promoted from results.html + buildings.html page-local <style> (19 Jul); filter-row
   is the buildings superset (handles input[type=number] + cursor:text). index.html
   keeps its own copies (loads after chrome.css, so its overrides still win).
   ============================================================================ */
/* Search box */
.search-wrap { max-width: 680px; margin: 0 auto; }
.search-box-row { position: relative; margin-bottom: 14px; }
.search-icon {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--text-subtle); pointer-events: none;
}
#searchInput {
  width: 100%;
  padding: 16px 16px 16px 48px;
  font-family: 'Inter', sans-serif;
  font-size: var(--fs-4);
  background: var(--surface);
  border: 1.5px solid var(--border-ui);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: var(--shadow);
}
#searchInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
#searchInput::placeholder { color: var(--text-subtle); }

/* Autocomplete */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 50;
  max-height: 240px;
  overflow-y: auto;
  display: none;
}
.autocomplete-list.open { display: block; }
.autocomplete-item {
  padding: 10px 14px;
  font-size: var(--fs-3);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
  display: flex; align-items: center; gap: 8px;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.selected { background: var(--surface-alt); }
.autocomplete-type {
  font-size: var(--fs-1);
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.autocomplete-type.area { background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 20%, transparent); }
.autocomplete-match { font-weight: 600; color: var(--text); }
.autocomplete-sub { font-size: var(--fs-1); color: var(--text-muted); }

/* Filter row */
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.filter-row select,
.filter-row input[type="text"],
.filter-row input[type="number"] {
  flex: 1; min-width: 120px; max-width: 220px;
  padding: 9px 12px;
  font-family: 'Inter', sans-serif; font-variant-numeric: tabular-nums;
  font-size: var(--fs-2);
  background: var(--surface);
  border: 1.5px solid var(--border-ui);
  border-radius: var(--radius);
  color: var(--text);
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
  appearance: none;
  -webkit-appearance: none;
  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' stroke='%235E6A7B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.filter-row input[type="text"],
.filter-row input[type="number"] {
  background-image: none;
  padding-right: 12px;
  cursor: text;
}
.filter-row select:focus,
.filter-row input:focus { border-color: var(--accent); }
:root[data-theme="dark"] .filter-row select { 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' stroke='%239C97A8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* Sort select */
.sort-select {
  font-family: 'Inter', sans-serif;
  font-size: var(--fs-1);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid var(--border-ui);
  border-radius: 20px;
  padding: 4px 26px 4px 10px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%235E6A7B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color .2s;
  outline: none;
}
.sort-select:hover { border-color: var(--accent); }
:root[data-theme="dark"] .sort-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239C97A8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); }

/* Pagination */
.pagination {
  max-width: 1080px; margin: 20px auto 0;
  display: flex; justify-content: center; gap: 10px;
}
.page-btn {
  font-family: 'Inter', sans-serif; font-variant-numeric: tabular-nums;
  font-size: var(--fs-2);
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  background: var(--surface);
  color: var(--text-muted);
  transition: all .2s;
}
.page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.page-btn:disabled { opacity: .35; cursor: default; }
.page-btn.active { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }

@media (max-width: 640px) {
  .search-wrap { padding: 0 4px; }
  #searchInput { font-size: var(--fs-3); }
  .filter-row { gap: 8px; padding: 0 4px; }
  .filter-row select,
  .filter-row input[type="text"],
  .filter-row input[type="number"] {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    max-width: 100%;
    font-size: var(--fs-2);
  }
}

/* ============================================================================
   Reduced-motion (F4) — one global guard. Respects the OS "reduce motion" setting
   by neutralising every animation + transition (skeleton shimmer, spinners,
   slide-ups, the staggered load settle, hover transitions). JS motion is already
   reduced-motion-aware (kkKpi checks the media query); this covers all CSS.
   ============================================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0 !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
