/* ============================================================================
   MarketTimeline.com — Institutional Trust Theme
   "Bloomberg meets the Financial Times" — US property analytics palette
   Single-file production CSS. Replaces the legacy RealStats.ae gold theme.
   ============================================================================ */

/* ----------------------------------------------------------------------------
   1. Design Tokens (CSS Custom Properties)
---------------------------------------------------------------------------- */
:root {
  /* === BACKGROUND SURFACE HIERARCHY === */
  --bg-primary:    #FBFAF7;   /* cream editorial canvas */
  --bg-secondary:  #FFFFFF;   /* cards, panels */
  --bg-tertiary:   #F1F4F9;   /* table headers, hover, muted inputs */
  --bg-glass:      rgba(255,255,255,0.85);

  /* === NAVY (institutional brand) === */
  --navy:          #0B2540;
  --navy-primary:  #0B2540;
  --navy-800:      #112D52;
  --navy-700:      #1E3A66;
  --navy-600:      #294876;

  /* === TEAL ACCENT SYSTEM (replaces gold) === */
  --teal:          #0EA5A4;
  --teal-primary:  #0EA5A4;
  --teal-light:    #14C2C0;
  --teal-dark:     #0B7A78;
  --teal-subtle:   rgba(14,165,164,0.08);
  --teal-border:   rgba(14,165,164,0.20);
  --teal-gradient: linear-gradient(135deg, #0B7A78 0%, #14C2C0 50%, #0B7A78 100%);

  /* === LEGACY GOLD ALIASES (mapped to teal so PHP inline styles still work) === */
  --gold-primary:  var(--teal);
  --gold-light:    var(--teal-light);
  --gold-dark:     var(--teal-dark);
  --gold-subtle:   var(--teal-subtle);
  --gold-border:   var(--teal-border);
  --gold-gradient: var(--teal-gradient);
  --gold:          var(--teal);
  --gold-bg:       var(--teal-subtle);

  /* === TEXT HIERARCHY === */
  --text-primary:   #0B2540;   /* matches navy — type uses brand color */
  --text-secondary: #475569;
  --text-tertiary:  #94A3B8;
  --text-teal:      var(--teal);
  --text-gold:      var(--teal); /* legacy alias */

  /* === DATA VISUALIZATION PALETTE === */
  --chart-positive: #10B981;   /* up / sales / growth */
  --chart-negative: #F97066;   /* down (warm coral, less alarming than pure red) */
  --chart-neutral:  #6366F1;   /* indigo */
  --chart-secondary:#8B5CF6;
  --chart-amber:    #F59E0B;
  --chart-sky:      #38BDF8;

  /* === BORDERS (navy-tinted) === */
  --border-subtle:  rgba(11,37,64,0.05);
  --border-default: rgba(11,37,64,0.10);
  --border-strong:  rgba(11,37,64,0.18);

  /* === SHADOWS === */
  --shadow-sm:    0 1px 2px rgba(11,37,64,0.05), 0 1px 0 rgba(11,37,64,0.02);
  --shadow-md:    0 4px 12px rgba(11,37,64,0.07), 0 2px 4px rgba(11,37,64,0.04);
  --shadow-lg:    0 12px 32px rgba(11,37,64,0.10), 0 4px 8px rgba(11,37,64,0.05);
  --shadow-xl:    0 20px 48px rgba(11,37,64,0.14), 0 8px 16px rgba(11,37,64,0.08);
  --shadow-teal:  0 0 0 1px rgba(14,165,164,0.20), 0 4px 16px rgba(14,165,164,0.18);
  --shadow-data:  0 0 0 1px rgba(11,37,64,0.04);
  --rs-shadow:        var(--shadow-md);
  --rs-shadow-lg:     var(--shadow-lg);
  --rs-shadow-hover:  0 12px 32px rgba(11,37,64,0.12), 0 0 0 1px var(--teal-border);

  /* === TYPOGRAPHY === */
  --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
  --font-display: 'Fraunces', 'Source Serif Pro', Georgia, serif;

  --text-xs:   0.64rem;
  --text-sm:   0.8rem;
  --text-base: 1rem;
  --text-md:   1.125rem;
  --text-lg:   1.25rem;
  --text-xl:   1.563rem;
  --text-2xl:  1.953rem;
  --text-3xl:  2.441rem;
  --text-4xl:  3.052rem;

  --weight-light:    300;
  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-extrabold:800;

  --leading-tight:   1.1;
  --leading-snug:    1.3;
  --leading-normal:  1.5;
  --leading-relaxed: 1.7;

  --tracking-tight:  -0.025em;
  --tracking-normal: 0;
  --tracking-wide:   0.05em;
  --tracking-wider:  0.1em;

  /* === SPACING === */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* === RADIUS === */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 9999px;
  --rs-radius:    var(--radius-lg);
  --rs-radius-sm: var(--radius-md);

  /* === LAYOUT HEIGHTS === */
  --header-h:   64px;
  --nav-h:      52px;
  --total-top:  116px;
  --ctrl-h:     42px;

  /* === SEMANTIC STATUS === */
  --green:    #10B981;
  --green-bg: rgba(16,185,129,0.10);
  --red:      #F97066;
  --red-bg:   rgba(249,112,102,0.10);
  --blue:     var(--teal-dark);
  --blue-bg:  var(--teal-subtle);

  /* === INK / DARK INSTITUTIONAL SURFACES === */
  --ink-900:        #081A2E;
  --ink-850:        #0B2540;
  --ink-800:        #0F2B4F;
  --ink-700:        #133161;
  --ink-text-1:     #FFFFFF;
  --ink-text-2:     rgba(255,255,255,0.72);
  --ink-text-3:     rgba(255,255,255,0.45);
  --ink-border:     rgba(255,255,255,0.10);
  --ink-border-strong: rgba(255,255,255,0.18);

  /* === TRUST SIGNAL TOKENS === */
  --trust-verified-bg:     rgba(16,185,129,0.10);
  --trust-verified-fg:     #047857;
  --trust-verified-border: rgba(16,185,129,0.22);
  --trust-source-bg:       var(--teal-subtle);
  --trust-source-fg:       var(--teal-dark);
  --trust-source-border:   var(--teal-border);

  /* === PREMIUM TIER (teal, no gold) === */
  --premium:           var(--teal);
  --premium-bg:        var(--teal-subtle);
  --premium-border:    var(--teal-border);
  --premium-grad:      var(--teal-gradient);
  --gold-premium:        var(--teal);
  --gold-premium-bg:     var(--teal-subtle);
  --gold-premium-border: var(--teal-border);
  --gold-premium-grad:   var(--teal-gradient);

  /* === RTL HELPER === */
  --rs-flip: 1;

  /* === LEGACY ALIASES (PHP inline styles) === */
  --bg:          var(--bg-primary);
  --bg-card:     var(--bg-secondary);
  --white:       #FFFFFF;
  --border:      var(--border-default);
  --border-light:var(--border-subtle);
  --text-1:      var(--text-primary);
  --text-2:      var(--text-secondary);
  --text-3:      var(--text-tertiary);
  --rs-border:   var(--border-default);
  --rs-card-bg:  var(--bg-secondary);
  --rs-sticky-top: calc(var(--total-top) + 16px);
}
[dir=rtl] { --rs-flip: -1; }

/* ----------------------------------------------------------------------------
   2. Global Base
---------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: light; }

body {
  font-family: var(--font-primary) !important;
  background: var(--bg-primary) !important;
  color: var(--text-primary) !important;
  font-size: 14px;
  line-height: var(--leading-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary) !important;
  color: var(--text-primary) !important;
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
}

p { color: var(--text-secondary); margin-top: 0; }

a { color: var(--teal); text-decoration: none; transition: color 150ms ease; }
a:hover { color: var(--teal-dark); }

hr { border: 0; border-top: 1px solid var(--border-default); margin: 24px 0; }

small { font-size: 0.82em; color: var(--text-tertiary); }

::selection { background: var(--teal-subtle); color: var(--text-primary); }

/* Tabular numerics — data values */
.font-mono, .tabular-nums, .rs-num {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
  letter-spacing: -0.01em;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-default); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Skip link */
.skip-to-content {
  position: absolute; top: -40px; left: 8px;
  background: var(--navy); color: #fff;
  padding: 8px 14px; border-radius: 8px;
  font-weight: 600; font-size: 0.85rem;
  z-index: 100000;
  transition: top 200ms ease;
}
.skip-to-content:focus {
  top: 8px; color: #fff; outline: 2px solid var(--teal-light); outline-offset: 2px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ----------------------------------------------------------------------------
   3. MOFI Layout Overrides
---------------------------------------------------------------------------- */
.page-wrapper { background: var(--bg-primary) !important; min-height: 100vh; }
.page-wrapper .page-body-wrapper {
  margin-inline-start: 0 !important;
  background: var(--bg-primary) !important;
}
.page-body-wrapper .page-body {
  padding: 28px 28px 60px !important;
  background: var(--bg-primary) !important;
  min-height: calc(100vh - var(--total-top)) !important;
  margin-top: var(--total-top) !important;
}
body.has-trust-strip .page-body-wrapper .page-body {
  margin-top: calc(var(--total-top) + 36px) !important;
}
.sidebar-wrapper:not(.rs-navbar) { display: none !important; }
.page-header { display: none !important; }
.footer { display: none !important; }

.page {
  padding: 20px 24px 60px;
  max-width: 1440px;
  margin: var(--total-top) auto 0;
  background: var(--bg-primary);
  min-height: calc(100vh - var(--total-top));
}
body.has-trust-strip .page {
  margin-top: calc(var(--total-top) + 36px);
}

.container-fluid { max-width: 1440px; margin: 0 auto; }

/* ----------------------------------------------------------------------------
   4. Page Loader
---------------------------------------------------------------------------- */
#pageLoader {
  position: fixed; inset: 0;
  background: var(--bg-primary);
  z-index: 99999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 24px;
  transition: opacity .4s ease, visibility .4s ease;
}
#pageLoader.hide { opacity: 0; visibility: hidden; pointer-events: none; }
.rs-loader-brand {
  font-family: var(--font-primary);
  font-size: 2rem; font-weight: 800; color: var(--text-primary);
  letter-spacing: -.03em;
}
.rs-loader-brand em { font-style: normal; color: var(--teal); }
.rs-loader-brand sup { color: var(--teal); font-size: 0.55em; font-weight: 700; }
.rs-loader-bar {
  width: 160px; height: 2px;
  background: var(--border-default);
  border-radius: 99px; overflow: hidden;
}
.rs-loader-fill {
  height: 100%; background: var(--teal-gradient); border-radius: 99px;
  animation: rsLoad 1.2s ease-out forwards;
}
@keyframes rsLoad { from { width: 0 } to { width: 100% } }

/* ----------------------------------------------------------------------------
   5. Top Bar (.rs-topbar)
---------------------------------------------------------------------------- */
.rs-topbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-default);
  display: flex; align-items: center; gap: 20px;
  padding: 0 24px;
  z-index: 1040;
  box-shadow: var(--shadow-sm);
}
.rs-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}
.rs-brand:hover { color: var(--text-primary); }
.rs-brand-mark {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--teal-gradient);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem;
  letter-spacing: -.02em;
  box-shadow: 0 2px 6px rgba(14,165,164,0.30);
}
.rs-brand-text {
  font-size: 1.05rem; font-weight: 800; letter-spacing: -0.025em;
  line-height: 1; color: var(--text-primary);
}
.rs-brand-text em { font-style: normal; color: var(--teal); }
.rs-brand-tld {
  font-size: 0.68rem; color: var(--text-tertiary); font-weight: 600;
  letter-spacing: 0.04em;
}
.rs-topbar-divider {
  width: 1px; height: 28px; background: var(--border-default); align-self: center;
}
.rs-search { flex: 1; max-width: 560px; }
.rs-search-inner {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 40px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 0 14px;
  transition: all 150ms ease;
}
.rs-search-inner:hover {
  border-color: var(--teal-border);
  background: #fff;
}
.rs-search-inner:focus-within {
  border-color: var(--teal);
  background: #fff;
  box-shadow: 0 0 0 4px var(--teal-subtle);
}
.rs-search-inner svg, .rs-search-inner i { color: var(--text-tertiary); width: 16px; height: 16px; flex-shrink: 0; }
.rs-search-inner input {
  flex: 1; border: 0; background: transparent; outline: none;
  color: var(--text-primary); font-size: 0.88rem;
  font-family: var(--font-primary);
}
.rs-search-inner input::placeholder { color: var(--text-tertiary); }
.rs-search-kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 2px 6px;
  background: var(--bg-secondary);
}
.rs-topbar-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
}

/* ----------------------------------------------------------------------------
   6. Navbar (.rs-navbar)
---------------------------------------------------------------------------- */
.rs-navbar {
  position: fixed; top: var(--header-h); left: 0; right: 0;
  height: var(--nav-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-default);
  z-index: 1039;
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.rs-navbar::-webkit-scrollbar { height: 0; }
.rs-nav-item {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  color: var(--text-secondary);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: all 150ms ease;
  position: relative;
}
.rs-nav-item svg, .rs-nav-item i {
  width: 15px; height: 15px;
  color: var(--text-tertiary);
  transition: color 150ms ease;
}
.rs-nav-item:hover {
  color: var(--text-primary);
  background: var(--teal-subtle);
}
.rs-nav-item:hover svg, .rs-nav-item:hover i { color: var(--teal); }
.rs-nav-item.active {
  color: var(--teal-dark);
  background: var(--teal-subtle);
  font-weight: 600;
}
.rs-nav-item.active svg, .rs-nav-item.active i { color: var(--teal); }
.rs-nav-item.active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 2px;
  background: var(--teal);
  border-radius: 2px 2px 0 0;
}
.rs-nav-sep {
  width: 1px; height: 22px;
  background: var(--border-default);
  margin: 0 8px;
  flex-shrink: 0;
}
.rs-nav-group-label {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  font-weight: 700;
  padding: 0 6px;
}

/* ----------------------------------------------------------------------------
   7. Trust Strip (.rs-trust-strip)
---------------------------------------------------------------------------- */
.rs-trust-strip {
  position: fixed;
  top: calc(var(--header-h) + var(--nav-h));
  left: 0; right: 0;
  height: 36px;
  background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
  border-bottom: 1px solid var(--border-default);
  z-index: 1038;
}
.rs-trust-strip-inner {
  max-width: 1440px; margin: 0 auto;
  height: 100%;
  display: flex; align-items: center; gap: 14px;
  padding: 0 24px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  overflow-x: auto;
  white-space: nowrap;
}
.rs-trust-strip-inner::-webkit-scrollbar { height: 0; }
.rs-trust-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.74rem;
  font-weight: 600;
  border: 1px solid var(--border-default);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}
.rs-trust-verified {
  background: var(--trust-verified-bg);
  color: var(--trust-verified-fg);
  border-color: var(--trust-verified-border);
}
.rs-trust-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(16,185,129,0.20);
  animation: rsPulse 2s infinite;
}
@keyframes rsPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.rs-trust-sep {
  width: 1px; height: 14px;
  background: var(--border-default);
}
.rs-trust-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.rs-trust-item svg, .rs-trust-item i {
  width: 13px; height: 13px;
  color: var(--teal);
}
.rs-trust-fresh { color: var(--teal-dark); font-weight: 600; }
.rs-trust-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--teal);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
}
.rs-trust-link:hover { color: var(--teal-dark); }
.rs-trust-link svg, .rs-trust-link i { width: 12px; height: 12px; }

/* ----------------------------------------------------------------------------
   8. Cards
---------------------------------------------------------------------------- */
.card {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-sm) !important;
  margin-bottom: 20px !important;
  overflow: hidden;
  transition: all 200ms ease;
}
.card:hover {
  box-shadow: var(--shadow-md) !important;
  border-color: var(--border-default) !important;
}
.card .card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border-subtle) !important;
  padding: 18px 22px !important;
  font-weight: 700;
  color: var(--text-primary);
}
.card .card-body { padding: 22px !important; }
.card .card-footer {
  background: var(--bg-tertiary) !important;
  border-top: 1px solid var(--border-subtle) !important;
  padding: 14px 22px !important;
}

.rs-data-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-data);
  position: relative;
}
.rs-data-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--teal-gradient);
  opacity: 0;
  transition: opacity 200ms ease;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.rs-data-card:hover::before { opacity: 1; }

.rs-terminal {
  background: var(--ink-850);
  color: var(--ink-text-1);
  border-radius: var(--radius-lg);
  border: 1px solid var(--ink-border);
  padding: 24px;
  font-family: var(--font-mono);
  position: relative;
  overflow: hidden;
}
.rs-terminal::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
}
.rs-terminal h1, .rs-terminal h2, .rs-terminal h3,
.rs-terminal h4, .rs-terminal h5, .rs-terminal h6 {
  color: var(--ink-text-1) !important;
}

/* ----------------------------------------------------------------------------
   9. KPI Cards (.rs-kpi-card)
---------------------------------------------------------------------------- */
.rs-kpi-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  height: 100%;
  position: relative;
  overflow: hidden;
  transition: all 220ms cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-primary);
}
.rs-kpi-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--teal);
  opacity: 0;
  transition: opacity 200ms ease;
}
.rs-kpi-card:hover {
  border-color: var(--teal-border);
  box-shadow: var(--rs-shadow-hover);
  transform: translateY(-2px);
  color: var(--text-primary);
}
.rs-kpi-card:hover::before { opacity: 1; }
.rs-kpi-card.d-block { display: block; }
a.rs-kpi-card { text-decoration: none; }

.rs-kpi-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--teal-subtle);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--teal);
}
.rs-kpi-icon-wrap svg, .rs-kpi-icon-wrap i {
  width: 18px; height: 18px;
  stroke: var(--teal); color: var(--teal);
}
.rs-kpi-label {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 6px;
}
.rs-kpi-value {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 6px;
}
.rs-kpi-footer {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.rs-kpi-footer a { color: var(--teal); }
.rs-kpi-footer a:hover { color: var(--teal-dark); }
.rs-kpi-trend {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
}
.rs-kpi-trend.up   { color: var(--green); background: rgba(16,185,129,0.10); }
.rs-kpi-trend.down { color: var(--red);   background: rgba(249,112,102,0.12); }
.rs-kpi-trend.flat { color: var(--text-tertiary); background: var(--bg-tertiary); }

/* ----------------------------------------------------------------------------
   10. Light page hero (.rs-page-hero)
---------------------------------------------------------------------------- */
.rs-page-hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-700) 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  margin-bottom: 28px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.rs-page-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--teal-gradient);
}
.rs-page-hero::after {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(14,165,164,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.rs-page-hero h1, .rs-page-hero h2 {
  color: #fff !important;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.02em;
  position: relative; z-index: 1;
  margin: 0 0 8px;
}
.rs-page-hero p, .rs-page-hero .lead {
  color: rgba(255,255,255,0.78);
  position: relative; z-index: 1;
  margin: 0;
}
.rs-page-hero .rs-page-hero-eyebrow {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--teal-light);
  font-weight: 700;
  margin-bottom: 10px;
  display: inline-block;
  position: relative; z-index: 1;
}

/* ----------------------------------------------------------------------------
   11. Homepage Hero (.hero — full dark institutional)
---------------------------------------------------------------------------- */
.hero {
  position: relative;
  background:
    radial-gradient(circle at 85% 10%, rgba(14,165,164,0.18) 0%, transparent 55%),
    radial-gradient(circle at 10% 90%, rgba(99,102,241,0.10) 0%, transparent 50%),
    linear-gradient(135deg, var(--ink-850) 0%, var(--ink-900) 100%);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: 44px 44px 36px;
  margin-bottom: 32px;
  overflow: hidden;
  border: 1px solid var(--ink-border);
  box-shadow: var(--shadow-xl);
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--teal-gradient);
  z-index: 2;
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  opacity: 0.5;
}
.hero > * { position: relative; z-index: 1; }
.hero-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  margin-bottom: 28px;
}
.hero-eyebrow {
  display: flex; align-items: center; gap: 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--teal-light);
  margin-bottom: 14px;
}
.hero-eyebrow .live {
  display: inline-flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.72);
  letter-spacing: 0.08em;
  text-transform: none;
  font-weight: 500;
  font-size: 0.74rem;
}
.hero-eyebrow .ldot, .pulse-live {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal-light);
  box-shadow: 0 0 0 3px rgba(20,194,192,0.30);
  animation: rsPulseDot 2s infinite;
  display: inline-block;
}
@keyframes rsPulseDot {
  0%, 100% { box-shadow: 0 0 0 3px rgba(20,194,192,0.30); }
  50%      { box-shadow: 0 0 0 6px rgba(20,194,192,0.10); }
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.6vw, 2.85rem);
  font-weight: 600;
  color: #fff !important;
  letter-spacing: -0.025em;
  line-height: 1.12;
  margin: 0 0 10px;
  max-width: 820px;
}
.hero-title em {
  font-style: italic;
  color: var(--teal-light);
  font-weight: 600;
}
.hero-asof {
  font-size: 0.84rem;
  color: var(--ink-text-2);
  font-family: var(--font-mono);
  font-weight: 400;
  letter-spacing: 0.01em;
}
.hero-controls {
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.hero-btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 150ms ease;
  backdrop-filter: blur(8px);
}
.hero-btn-ghost:hover {
  background: rgba(20,194,192,0.16);
  border-color: var(--teal-light);
  color: #fff;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0;
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 26px;
}
.hero-stat {
  padding: 4px 24px 4px 0;
  position: relative;
}
.hero-stat + .hero-stat {
  border-left: 1px solid rgba(255,255,255,0.08);
  padding-left: 24px;
}
.hero-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-text-3);
  font-weight: 700;
  margin-bottom: 8px;
}
.hero-stat-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 1.85rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 4px;
}
.hero-stat-meta {
  font-size: 0.78rem;
  color: var(--ink-text-2);
}

/* ----------------------------------------------------------------------------
   12. Filter Bar (.rs-filter-bar)
---------------------------------------------------------------------------- */
.rs-filter-bar {
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: var(--rs-sticky-top);
  z-index: 50;
}
.rs-filter-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-tertiary);
  font-weight: 700;
}
.rs-range-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 150ms ease;
}
.rs-range-btn:hover {
  background: var(--teal-subtle);
  border-color: var(--teal-border);
  color: var(--teal-dark);
}
.rs-range-btn.active, .rs-range-btn[aria-pressed="true"] {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

/* ----------------------------------------------------------------------------
   13. Tables
---------------------------------------------------------------------------- */
.table {
  background: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 0 !important;
}
.table thead th {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 16px !important;
  border-bottom: 1px solid var(--border-default) !important;
  border-top: 0 !important;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.table tbody td {
  padding: 14px 16px !important;
  border-top: 1px solid var(--border-subtle) !important;
  vertical-align: middle;
  color: var(--text-primary);
  font-size: 0.88rem;
}
.table tbody tr { transition: background 100ms ease; }
.table tbody tr:hover { background: var(--bg-tertiary) !important; }
.table tbody tr:hover td { color: var(--text-primary); }

.table th[data-sort], .table th.sortable {
  cursor: pointer; user-select: none;
}
.table th[data-sort]:hover, .table th.sortable:hover {
  color: var(--teal-dark) !important;
  background: var(--teal-subtle) !important;
}
.table th[aria-sort="ascending"]::after  { content: ' \2191'; color: var(--teal); }
.table th[aria-sort="descending"]::after { content: ' \2193'; color: var(--teal); }

.rs-table-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: auto;
  max-height: 70vh;
  position: relative;
  box-shadow: var(--shadow-sm);
}
.rs-table-wrap .table thead th {
  position: sticky; top: 0; z-index: 3;
  background: var(--bg-tertiary) !important;
}
.rs-table-wrap .table th:first-child,
.rs-table-wrap .table td:first-child {
  position: sticky; left: 0;
  background: var(--bg-secondary);
  z-index: 1;
  border-right: 1px solid var(--border-subtle);
}
.rs-table-wrap .table thead th:first-child {
  z-index: 4;
  background: var(--bg-tertiary) !important;
}
.rs-table-wrap .table tbody tr:hover td:first-child {
  background: var(--bg-tertiary);
}

/* ----------------------------------------------------------------------------
   14. Badges
---------------------------------------------------------------------------- */
.rs-badge-up, .rs-badge-down, .rs-badge-tier, .rs-badge-neutral {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.rs-badge-up {
  color: var(--green);
  background: rgba(16,185,129,0.10);
  border: 1px solid rgba(16,185,129,0.20);
}
.rs-badge-up::before { content: '\25B2'; font-size: 0.65em; }
.rs-badge-down {
  color: var(--red);
  background: rgba(249,112,102,0.12);
  border: 1px solid rgba(249,112,102,0.22);
}
.rs-badge-down::before { content: '\25BC'; font-size: 0.65em; }
.rs-badge-neutral {
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  border: 1px solid var(--border-default);
}
.rs-badge-tier {
  color: var(--teal-dark);
  background: var(--teal-subtle);
  border: 1px solid var(--teal-border);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rs-badge-prop {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.rs-badge-prop.single-family { color: var(--teal-dark); background: var(--teal-subtle); border-color: var(--teal-border); }
.rs-badge-prop.condo         { color: #6366F1; background: rgba(99,102,241,0.10); border-color: rgba(99,102,241,0.22); }
.rs-badge-prop.townhouse     { color: #8B5CF6; background: rgba(139,92,246,0.10); border-color: rgba(139,92,246,0.22); }
.rs-badge-prop.multi-family  { color: #F59E0B; background: rgba(245,158,11,0.10); border-color: rgba(245,158,11,0.22); }
.rs-badge-prop.land          { color: #10B981; background: rgba(16,185,129,0.10); border-color: rgba(16,185,129,0.22); }

/* ----------------------------------------------------------------------------
   15. Buttons
---------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--ctrl-h);
  padding: 0 18px;
  border-radius: 10px;
  font-family: var(--font-primary);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 180ms cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}
.btn:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.btn-sm {
  height: 34px;
  padding: 0 14px;
  font-size: 0.8rem;
  border-radius: 8px;
}
.btn-lg {
  height: 50px;
  padding: 0 24px;
  font-size: 0.95rem;
  border-radius: 12px;
}

.btn-primary {
  background: var(--teal) !important;
  color: #fff !important;
  border-color: var(--teal) !important;
  box-shadow: 0 1px 2px rgba(14,165,164,0.20);
}
.btn-primary:hover {
  background: var(--teal-dark) !important;
  border-color: var(--teal-dark) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(14,165,164,0.30);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: transparent !important;
  color: var(--navy) !important;
  border: 1px solid var(--border-strong) !important;
}
.btn-secondary:hover {
  background: var(--bg-tertiary) !important;
  border-color: var(--navy) !important;
  color: var(--navy) !important;
}

.btn-outline-primary {
  background: transparent !important;
  color: var(--teal-dark) !important;
  border: 1px solid var(--teal-border) !important;
}
.btn-outline-primary:hover {
  background: var(--teal-subtle) !important;
  border-color: var(--teal) !important;
  color: var(--teal-dark) !important;
}

.btn-dark {
  background: var(--navy) !important;
  color: #fff !important;
  border-color: var(--navy) !important;
}
.btn-dark:hover {
  background: var(--navy-800) !important;
  border-color: var(--navy-800) !important;
}

.rs-btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 150ms ease;
}
.rs-btn-ghost:hover {
  background: var(--teal-subtle);
  border-color: var(--teal-border);
  color: var(--teal-dark);
}

/* ----------------------------------------------------------------------------
   16. Forms
---------------------------------------------------------------------------- */
.form-control, .form-select, .form-input {
  height: var(--ctrl-h);
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 10px !important;
  color: var(--text-primary) !important;
  font-family: var(--font-primary);
  font-size: 0.88rem;
  padding: 0 14px !important;
  box-shadow: none !important;
  transition: all 150ms ease;
}
.form-control:hover, .form-select:hover {
  border-color: var(--border-strong) !important;
}
.form-control:focus, .form-select:focus {
  border-color: var(--navy) !important;
  outline: 0;
  box-shadow: 0 0 0 4px var(--teal-subtle) !important;
}
.form-control::placeholder { color: var(--text-tertiary); }

textarea.form-control {
  height: auto;
  min-height: 96px;
  padding: 12px 14px !important;
  line-height: var(--leading-normal);
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.input-group { gap: 0; }
.input-group-text {
  background: var(--bg-tertiary) !important;
  border: 1px solid var(--border-default) !important;
  color: var(--text-tertiary) !important;
  font-size: 0.84rem;
}

/* Select2 override */
.select2-container--default .select2-selection--single {
  height: var(--ctrl-h) !important;
  border: 1px solid var(--border-default) !important;
  border-radius: 10px !important;
  background: var(--bg-secondary) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: var(--ctrl-h) !important;
  padding-left: 14px !important;
  color: var(--text-primary) !important;
}
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--navy) !important;
  box-shadow: 0 0 0 4px var(--teal-subtle) !important;
}
.select2-dropdown {
  border: 1px solid var(--border-default) !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow-md);
}
.select2-results__option--highlighted {
  background: var(--teal-subtle) !important;
  color: var(--teal-dark) !important;
}

/* ----------------------------------------------------------------------------
   17. Tabs (.rs-tabs)
---------------------------------------------------------------------------- */
.rs-tabs {
  display: flex; align-items: center; gap: 4px;
  border-bottom: 1px solid var(--border-default);
  margin-bottom: 22px;
  overflow-x: auto;
}
.rs-tab-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px;
  padding: 0 16px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 150ms ease;
  margin-bottom: -1px;
}
.rs-tab-btn:hover { color: var(--text-primary); }
.rs-tab-btn.active, .rs-tab-btn[aria-selected="true"] {
  color: var(--teal-dark);
  border-bottom-color: var(--teal);
  font-weight: 600;
}

/* Bootstrap nav-tabs override */
.nav-tabs {
  border-bottom: 1px solid var(--border-default) !important;
}
.nav-tabs .nav-link {
  color: var(--text-secondary) !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  background: transparent !important;
  padding: 10px 16px !important;
}
.nav-tabs .nav-link.active {
  color: var(--teal-dark) !important;
  border-bottom-color: var(--teal) !important;
  background: transparent !important;
}

/* ----------------------------------------------------------------------------
   18. Skeletons + Spinners
---------------------------------------------------------------------------- */
.rs-skeleton {
  background: linear-gradient(90deg,
    var(--bg-tertiary) 0%,
    rgba(11,37,64,0.06) 50%,
    var(--bg-tertiary) 100%);
  background-size: 200% 100%;
  animation: rsShimmer 1.6s ease-in-out infinite;
  border-radius: 6px;
  display: inline-block;
}
@keyframes rsShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.rs-skeleton-line   { height: 12px; width: 100%; }
.rs-skeleton-title  { height: 24px; width: 60%; }
.rs-skeleton-circle { border-radius: 50%; width: 40px; height: 40px; }

.rs-spinner {
  width: 18px; height: 18px;
  border: 2px solid var(--teal-subtle);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: rsSpin 0.8s linear infinite;
  display: inline-block;
}
@keyframes rsSpin { to { transform: rotate(360deg); } }

/* ----------------------------------------------------------------------------
   19. Command Palette
---------------------------------------------------------------------------- */
.rs-cmd-overlay {
  position: fixed; inset: 0;
  background: rgba(11,37,64,0.55);
  backdrop-filter: blur(6px);
  z-index: 100050;
  display: none;
  align-items: flex-start; justify-content: center;
  padding-top: 12vh;
}
.rs-cmd-overlay.open { display: flex; }
.rs-cmd-modal {
  background: var(--bg-secondary);
  width: 100%;
  max-width: 640px;
  border-radius: 14px;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-default);
  overflow: hidden;
}
.rs-cmd-search-wrap {
  display: flex; align-items: center; gap: 10px;
  height: 56px;
  padding: 0 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.rs-cmd-search-wrap svg, .rs-cmd-search-wrap i {
  color: var(--text-tertiary);
}
.rs-cmd-search-wrap input {
  flex: 1; border: 0; outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
}
.rs-cmd-search-wrap input::placeholder { color: var(--text-tertiary); }
.rs-cmd-results {
  max-height: 60vh; overflow-y: auto;
  padding: 8px;
}
.rs-cmd-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-primary);
  text-decoration: none;
  cursor: pointer;
  transition: background 100ms ease;
}
.rs-cmd-item .rs-cmd-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--teal-subtle);
  color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.rs-cmd-item .rs-cmd-title { font-weight: 600; font-size: 0.9rem; }
.rs-cmd-item .rs-cmd-sub   { font-size: 0.78rem; color: var(--text-tertiary); }
.rs-cmd-item:hover, .rs-cmd-item.active, .rs-cmd-item[aria-selected="true"] {
  background: var(--teal-subtle);
  color: var(--text-primary);
}
.rs-cmd-empty {
  padding: 28px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.86rem;
}

/* ----------------------------------------------------------------------------
   20. Typography Utilities
---------------------------------------------------------------------------- */
.rs-display, .rs-display-md {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--text-primary);
}
.rs-display-lg {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 3.4vw, 2.85rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
}
.rs-display-xl {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.5rem, 4.2vw, 3.85rem);
  letter-spacing: -0.035em;
  line-height: 1.05;
  color: var(--text-primary);
}
.rs-eyebrow {
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--teal);
}
.rs-caption {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}
.text-teal-gradient, .text-gold-gradient {
  background: var(--teal-gradient);
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.text-teal { color: var(--teal) !important; }
.text-navy { color: var(--navy) !important; }
.text-muted { color: var(--text-tertiary) !important; }
.text-success { color: var(--green) !important; }
.text-danger  { color: var(--red) !important; }

/* ----------------------------------------------------------------------------
   21. Animations / .rs-stagger
---------------------------------------------------------------------------- */
.rs-stagger > * {
  opacity: 0;
  transform: translateY(10px);
  animation: rsFadeUp 480ms ease-out forwards;
}
.rs-stagger > *:nth-child(1) { animation-delay: 40ms; }
.rs-stagger > *:nth-child(2) { animation-delay: 80ms; }
.rs-stagger > *:nth-child(3) { animation-delay: 120ms; }
.rs-stagger > *:nth-child(4) { animation-delay: 160ms; }
.rs-stagger > *:nth-child(5) { animation-delay: 200ms; }
.rs-stagger > *:nth-child(6) { animation-delay: 240ms; }
.rs-stagger > *:nth-child(7) { animation-delay: 280ms; }
.rs-stagger > *:nth-child(8) { animation-delay: 320ms; }
.rs-stagger > *:nth-child(9) { animation-delay: 360ms; }
.rs-stagger > *:nth-child(n+10) { animation-delay: 400ms; }
@keyframes rsFadeUp {
  to { opacity: 1; transform: translateY(0); }
}
[data-rs-animate] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 600ms ease, transform 600ms ease;
}
[data-rs-animate].in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ----------------------------------------------------------------------------
   22. Toasts
---------------------------------------------------------------------------- */
.rs-toast-stack {
  position: fixed;
  bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 100100;
  max-width: 380px;
}
.rs-toast {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-left: 3px solid var(--teal);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow-lg);
  font-size: 0.86rem;
  color: var(--text-primary);
  min-width: 280px;
  animation: rsToastIn 280ms ease-out;
}
@keyframes rsToastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.rs-toast.success { border-left-color: var(--green); }
.rs-toast.error   { border-left-color: var(--red); }
.rs-toast.warning { border-left-color: var(--chart-amber); }
.rs-toast-icon {
  width: 22px; height: 22px;
  flex-shrink: 0;
  color: var(--teal);
}
.rs-toast.success .rs-toast-icon { color: var(--green); }
.rs-toast.error .rs-toast-icon   { color: var(--red); }
.rs-toast.warning .rs-toast-icon { color: var(--chart-amber); }
.rs-toast-title { font-weight: 700; margin-bottom: 2px; }
.rs-toast-msg   { color: var(--text-secondary); font-size: 0.82rem; }
.rs-toast-close {
  margin-left: auto;
  background: transparent;
  border: 0;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

/* ----------------------------------------------------------------------------
   23. Empty States
---------------------------------------------------------------------------- */
.rs-empty {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  color: var(--text-secondary);
}
.rs-empty-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--teal-subtle);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
  color: var(--teal);
}
.rs-empty-icon svg, .rs-empty-icon i {
  width: 24px; height: 24px;
}
.rs-empty-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.rs-empty-sub {
  font-size: 0.86rem;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

/* ----------------------------------------------------------------------------
   24. Section heading (.rs-section-h)
---------------------------------------------------------------------------- */
.rs-section-h {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 32px 0 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.rs-section-h h2 {
  font-size: 1.18rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.rs-section-h .rs-section-link {
  font-size: 0.82rem;
  color: var(--teal);
  font-weight: 600;
  text-decoration: none;
}
.rs-section-h .rs-section-link:hover {
  color: var(--teal-dark);
}

/* ----------------------------------------------------------------------------
   25. State link grid (homepage)
---------------------------------------------------------------------------- */
.rs-state-link {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  color: var(--text-primary);
  transition: all 150ms ease;
  text-decoration: none;
}
.rs-state-link:hover {
  border-color: var(--teal-border);
  background: var(--teal-subtle);
  color: var(--teal-dark);
  transform: translateY(-1px);
}
.rs-state-link-code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 7px;
  background: var(--bg-tertiary);
  border-radius: 6px;
  color: var(--text-tertiary);
  letter-spacing: 0.06em;
}
.rs-state-link:hover .rs-state-link-code {
  background: rgba(14,165,164,0.15);
  color: var(--teal-dark);
}
.rs-state-link-name {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ----------------------------------------------------------------------------
   26. Breadcrumbs
---------------------------------------------------------------------------- */
.rs-breadcrumb { margin-bottom: 12px; }
.rs-breadcrumb ol {
  list-style: none;
  padding: 0; margin: 0 0 20px;
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 0.82rem;
}
.rs-breadcrumb li { color: var(--text-tertiary); }
.rs-breadcrumb li + li::before {
  content: '/';
  margin-right: 8px;
  color: var(--text-tertiary);
}
.rs-breadcrumb a { color: var(--text-secondary); }
.rs-breadcrumb a:hover { color: var(--teal); }
.rs-breadcrumb [aria-current=page] {
  color: var(--text-primary);
  font-weight: 600;
}

/* ----------------------------------------------------------------------------
   27. Persona tracks (homepage)
---------------------------------------------------------------------------- */
.mt-persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.mt-persona-card {
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 24px;
  transition: all 200ms;
  text-decoration: none;
  color: inherit;
  display: block;
  position: relative;
  overflow: hidden;
}
.mt-persona-card:hover {
  border-color: var(--teal-border);
  box-shadow: 0 12px 32px rgba(11,37,64,0.10), 0 0 0 1px var(--teal-border);
  transform: translateY(-2px);
}
.mt-persona-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--teal);
  opacity: 0;
  transition: opacity 200ms;
}
.mt-persona-card:hover::before { opacity: 1; }
.mt-persona-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  background: var(--teal-subtle);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.mt-persona-icon svg { width: 22px; height: 22px; stroke: var(--teal); }
.mt-persona-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 6px;
}
.mt-persona-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 12px;
}
.mt-persona-cta {
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 600;
}

/* ----------------------------------------------------------------------------
   28. Trust ribbons + Source cite + Forecast band
---------------------------------------------------------------------------- */
.mt-trust-ribbon {
  display: flex; align-items: center; gap: 12px;
  background: var(--teal-subtle);
  border: 1px solid var(--teal-border);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 24px;
}
.mt-trust-ribbon-icon { color: var(--teal); flex-shrink: 0; }
.mt-trust-ribbon-text {
  font-size: 0.88rem;
  color: var(--text-primary);
  margin: 0;
}
.mt-trust-ribbon-text strong { color: var(--teal-dark); }

.mt-source-cite {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  display: flex; align-items: center; gap: 6px;
  padding: 10px 16px;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-subtle);
}
.mt-source-cite a { color: var(--teal); }
.mt-source-cite a:hover { color: var(--teal-dark); }

.mt-forecast-band {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  padding: 8px 14px;
  background: var(--teal-subtle);
  border-left: 3px solid var(--teal);
  border-radius: 0 6px 6px 0;
}

/* ----------------------------------------------------------------------------
   29. FAQ Accordion
---------------------------------------------------------------------------- */
.mt-faq-item {
  border-bottom: 1px solid var(--border-subtle);
  padding: 16px 0;
}
.mt-faq-q {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
}
.mt-faq-q::-webkit-details-marker { display: none; }
.mt-faq-q::after {
  content: '+';
  font-size: 1.4rem;
  color: var(--teal);
  transition: transform 200ms;
  line-height: 1;
}
.mt-faq-item[open] .mt-faq-q::after { transform: rotate(45deg); }
.mt-faq-a {
  margin-top: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ----------------------------------------------------------------------------
   30. Hero search (large search on homepage)
---------------------------------------------------------------------------- */
.mt-hero-search {
  max-width: 720px;
  margin: 0 auto;
}
.mt-hero-search input {
  width: 100%;
  height: 60px;
  font-size: 1.05rem;
  padding: 0 24px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  font-family: var(--font-primary);
}
.mt-hero-search input::placeholder {
  color: rgba(255,255,255,0.45);
}
.mt-hero-search input:focus {
  outline: none;
  border-color: var(--teal-light);
  background: rgba(255,255,255,0.10);
  box-shadow: 0 0 0 4px rgba(20,194,192,0.18);
}

/* ----------------------------------------------------------------------------
   31. Footer
---------------------------------------------------------------------------- */
.rs-footer {
  background: #0B2540;
  color: rgba(255,255,255,0.72);
  padding: 56px 24px 24px;
  margin-top: 64px;
  border-top: 1px solid var(--teal);
}
.rs-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.rs-footer-col h6 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.5) !important;
  margin-bottom: 12px;
  font-weight: 700;
}
.rs-footer-col a {
  display: block;
  color: rgba(255,255,255,0.72);
  padding: 4px 0;
  font-size: 0.86rem;
  text-decoration: none;
  transition: color 150ms;
}
.rs-footer-col a:hover { color: var(--teal-light); }
.rs-footer-brand {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.025em;
  margin-bottom: 4px;
}
.rs-footer-brand em { color: var(--teal-light); font-style: normal; }
.rs-footer-brand sup { color: var(--teal-light); font-size: 0.55em; }
.rs-footer-tag {
  color: var(--teal-light);
  font-style: italic;
  font-size: 0.9rem;
  margin-bottom: 12px;
}
.rs-footer-meta {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.55);
  max-width: 320px;
}
.rs-footer-bottom {
  max-width: 1200px;
  margin: 32px auto 0;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.10);
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  flex-wrap: wrap;
  gap: 12px;
}
.rs-footer-bottom a { color: rgba(255,255,255,0.55); }
.rs-footer-bottom a:hover { color: var(--teal-light); }

/* ----------------------------------------------------------------------------
   32. Pagination
---------------------------------------------------------------------------- */
.pagination {
  display: inline-flex; gap: 4px;
  list-style: none;
  padding: 0; margin: 0;
}
.page-item .page-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px;
  padding: 0 12px;
  border-radius: 8px !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-secondary) !important;
  background: var(--bg-secondary) !important;
  font-size: 0.84rem;
  font-weight: 500;
  transition: all 150ms ease;
}
.page-item .page-link:hover {
  background: var(--teal-subtle) !important;
  border-color: var(--teal-border) !important;
  color: var(--teal-dark) !important;
}
.page-item.active .page-link {
  background: var(--navy) !important;
  border-color: var(--navy) !important;
  color: #fff !important;
}
.page-item.disabled .page-link {
  color: var(--text-tertiary) !important;
  background: transparent !important;
}

/* ----------------------------------------------------------------------------
   33. Alerts
---------------------------------------------------------------------------- */
.alert {
  border: 1px solid var(--border-default);
  border-radius: 10px;
  padding: 14px 18px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.alert-info, .alert-primary {
  background: var(--teal-subtle);
  border-color: var(--teal-border);
  color: var(--teal-dark);
}
.alert-success {
  background: rgba(16,185,129,0.10);
  border-color: rgba(16,185,129,0.22);
  color: #047857;
}
.alert-danger, .alert-warning-strong {
  background: rgba(249,112,102,0.10);
  border-color: rgba(249,112,102,0.22);
  color: #B91C1C;
}
.alert-warning {
  background: rgba(245,158,11,0.10);
  border-color: rgba(245,158,11,0.22);
  color: #92400E;
}

/* ----------------------------------------------------------------------------
   34. Misc utilities
---------------------------------------------------------------------------- */
.rs-divider {
  height: 1px;
  background: var(--border-default);
  margin: 24px 0;
}
.rs-tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}
.rs-tag-teal {
  background: var(--teal-subtle);
  color: var(--teal-dark);
  border-color: var(--teal-border);
}
.rs-rounded { border-radius: var(--radius-lg) !important; }
.rs-rounded-md { border-radius: var(--radius-md) !important; }
.rs-shadow-sm { box-shadow: var(--shadow-sm) !important; }
.rs-shadow-md { box-shadow: var(--shadow-md) !important; }
.rs-shadow-lg { box-shadow: var(--shadow-lg) !important; }

.bg-tertiary { background: var(--bg-tertiary) !important; }
.bg-secondary { background: var(--bg-secondary) !important; }
.bg-navy { background: var(--navy) !important; color: #fff !important; }
.bg-teal-subtle { background: var(--teal-subtle) !important; }

/* ----------------------------------------------------------------------------
   35. Charts container
---------------------------------------------------------------------------- */
.rs-chart-wrap {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 22px;
}
.rs-chart-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.rs-chart-sub {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}
.apexcharts-tooltip {
  background: var(--navy) !important;
  color: #fff !important;
  border: 0 !important;
  box-shadow: var(--shadow-lg) !important;
  border-radius: 8px !important;
}
.apexcharts-tooltip-title {
  background: var(--navy-800) !important;
  border-bottom-color: var(--ink-border) !important;
  color: #fff !important;
}

/* Leaflet map override */
.leaflet-container {
  border-radius: var(--radius-lg);
  font-family: var(--font-primary);
}
.leaflet-popup-content-wrapper {
  border-radius: 10px !important;
  box-shadow: var(--shadow-lg) !important;
}

/* ----------------------------------------------------------------------------
   36. Accessibility
---------------------------------------------------------------------------- */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible,
.btn:focus-visible,
a:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

/* ----------------------------------------------------------------------------
   37. Responsive Breakpoints
---------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  .rs-topbar { padding: 0 16px; gap: 12px; }
  .rs-topbar-divider { display: none; }
  .rs-search { max-width: 320px; }
  .rs-navbar { padding: 0 16px; }
  .page-body-wrapper .page-body { padding: 22px 18px 60px !important; }
  .hero { padding: 32px 24px 28px; }
  .hero-title { font-size: clamp(1.5rem, 5vw, 2.2rem); }
  .rs-page-hero { padding: 28px 24px; }
  .rs-footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; }
}

@media (max-width: 767.98px) {
  body { font-size: 13.5px; }
  .rs-topbar { height: 56px; }
  .rs-navbar { height: 48px; top: 56px; }
  :root { --header-h: 56px; --nav-h: 48px; --total-top: 104px; }
  .rs-search { display: none; }
  .rs-trust-strip { display: none; }
  body.has-trust-strip .page-body-wrapper .page-body {
    margin-top: var(--total-top) !important;
  }
  .hero { padding: 26px 20px; border-radius: var(--radius-lg); }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .hero-stat + .hero-stat { border-left: 0; padding-left: 0; }
  .hero-stat:nth-child(odd) { border-right: 1px solid rgba(255,255,255,0.08); padding-right: 16px; }
  .hero-stat:nth-child(even) { padding-left: 16px; }
  .hero-stat:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 16px; margin-top: 16px; }
  .rs-kpi-value { font-size: 1.4rem; }
  .rs-footer-inner { grid-template-columns: 1fr; }
  .rs-footer-bottom { flex-direction: column; align-items: flex-start; }
  .rs-filter-bar { padding: 12px; }
}

@media (max-width: 575.98px) {
  .page-body-wrapper .page-body { padding: 16px 12px 60px !important; }
  .container-fluid { padding-left: 12px; padding-right: 12px; }
  .hero { padding: 22px 16px; }
  .hero-title { font-size: 1.4rem; }
  .hero-stat-val { font-size: 1.4rem; }
  .rs-kpi-card { padding: 18px; }
  .card .card-body { padding: 16px !important; }
  .btn { padding: 0 14px; font-size: 0.82rem; }
  .rs-cmd-modal { margin: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .rs-stagger > * { opacity: 1; transform: none; }
  [data-rs-animate] { opacity: 1; transform: none; }
}

@media print {
  .rs-topbar, .rs-navbar, .rs-trust-strip, .rs-footer,
  #pageLoader, .rs-cmd-overlay, .rs-toast-stack { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .page-body-wrapper .page-body { margin-top: 0 !important; padding: 0 !important; }
  .card, .rs-kpi-card, .rs-data-card {
    box-shadow: none !important;
    border-color: #ddd !important;
    page-break-inside: avoid;
  }
  .hero, .rs-page-hero {
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
  .hero h1, .hero-title, .hero-stat-val, .hero-stat-label, .hero-stat-meta,
  .rs-page-hero h1, .rs-page-hero h2 { color: #000 !important; }
}

/* ----------------------------------------------------------------------------
   38. Bootstrap row/column tweaks for our card grids
---------------------------------------------------------------------------- */
.row.g-3 > [class*="col-"] { display: flex; }
.row.g-3 > [class*="col-"] > .rs-kpi-card,
.row.g-3 > [class*="col-"] > .card,
.row.g-3 > [class*="col-"] > .rs-data-card,
.row.g-3 > [class*="col-"] > a.rs-kpi-card { width: 100%; }

/* ----- Property page: FAQ accordion ----- */
.mt-faq-item {
  border-bottom: 1px solid rgba(0,0,0,0.08);
  padding: 0.85rem 0;
}
.mt-faq-item:last-child { border-bottom: none; }
.mt-faq-item > summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  position: relative;
  padding-right: 1.5rem;
}
.mt-faq-item > summary::-webkit-details-marker { display: none; }
.mt-faq-item > summary::after {
  content: '+';
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  font-weight: 400;
  color: #9A7B3E;
  font-size: 1.25rem;
  line-height: 1;
}
.mt-faq-item[open] > summary::after { content: '−'; }
.mt-faq-answer {
  margin-top: 0.5rem;
  color: #4B5563;
  line-height: 1.55;
}

/* End of MarketTimeline.com institutional theme */
