/* ── Design tokens ─────────────────────────────────── */
:root {
  --blue:        #2563eb;
  --blue-light:  #eff6ff;
  --blue-dark:   #1d4ed8;
  --orange:      #f97316;
  --green:       #16a34a;
  --red:         #dc2626;
  --gray-50:     #f8fafc;
  --gray-100:    #f1f5f9;
  --gray-200:    #e2e8f0;
  --gray-400:    #94a3b8;
  --gray-600:    #475569;
  --gray-800:    #1e293b;
  --white:       #ffffff;
  --radius:      10px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:   0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:   0 10px 15px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.05);
  --sidebar-w:   320px;
  --header-h:    64px;
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }
body {
  font-family: var(--font);
  background: var(--gray-50);
  color: var(--gray-800);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* overflow intentionally unset — pages scroll at the document level */
}

/* ── Header ─────────────────────────────────────────── */
.site-header {
  position: relative;
  height: var(--header-h);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
  z-index: 1000;
}
.header-inner { display: flex; align-items: center; gap: 20px; }
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon {
  font-size: 22px;
  color: var(--blue);
  line-height: 1;
}
.logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -0.3px;
}
.logo-city {
  color: var(--orange);
}
.tagline {
  font-size: 13px;
  color: var(--gray-400);
  border-left: 1px solid var(--gray-200);
  padding-left: 20px;
}

/* ── Main layout ─────────────────────────────────────── */
.main-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #0f172a;
  border-right: none;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 18px 16px;
  gap: 0;
}

/* ── Form fields ─────────────────────────────────────── */
.field {
  margin-bottom: 18px;
}
.field label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  margin-bottom: 8px;
}
.slider-val {
  font-size: 13px;
  font-weight: 700;
  color: #60a5fa;
  text-transform: none;
  letter-spacing: 0;
}

/* Select */
.select-wrap {
  position: relative;
}
.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #475569;
  pointer-events: none;
  font-size: 12px;
}
select {
  width: 100%;
  padding: 9px 32px 9px 12px;
  border: 1.5px solid #1e293b;
  border-radius: var(--radius);
  background: #1e293b;
  font-size: 14px;
  color: #e2e8f0;
  appearance: none;
  cursor: pointer;
  transition: border-color .15s;
}
select option { background: #1e293b; color: #e2e8f0; }
select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.2);
}

/* Pill radio group (BHK) */
.pill-group {
  display: flex;
  gap: 6px;
}
.pill input { display: none; }
.pill span {
  display: inline-block;
  padding: 6px 14px;
  border: 1.5px solid #1e293b;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: #94a3b8;
  background: transparent;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.pill:has(input:checked) span,
.pill.active span {
  background: #2563eb;
  border-color: #2563eb;
  color: var(--white);
}

/* Slider */
.slider {
  width: 100%;
  height: 4px;
  appearance: none;
  background: #1e293b;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
  margin: 4px 0;
}
.slider::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #3b82f6;
  border: 2.5px solid #0f172a;
  box-shadow: 0 1px 6px rgba(59,130,246,.5);
  cursor: pointer;
  transition: transform .1s;
}
.slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #475569;
  margin-top: 4px;
}

/* Mode buttons */
.mode-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}
.mode-btn input { display: none; }
.mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 4px 6px;
  border: 1.5px solid #1e293b;
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  transition: all .15s;
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  text-align: center;
  user-select: none;
}
.mode-btn .mode-icon { font-size: 18px; line-height: 1; margin-bottom: 3px; }
.mode-btn:has(input:checked),
.mode-btn.active {
  border-color: #3b82f6;
  background: rgba(59,130,246,.12);
  color: #60a5fa;
}

/* Primary button */
.btn-primary {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  margin-top: 4px;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 14px rgba(37,99,235,.4);
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { background: #334155; box-shadow: none; cursor: not-allowed; }
.btn-spinner { font-size: 14px; }

/* Sidebar footer / peak note */
.peak-note {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: rgba(251,191,36,.07);
  border: 1px solid rgba(251,191,36,.2);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 11px;
  color: #fbbf24;
  line-height: 1.5;
  margin-bottom: 4px;
}
.peak-note__icon { flex-shrink: 0; font-size: 14px; margin-top: 1px; }
.peak-note strong { color: #fde68a; }

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #1e293b;
  font-size: 11px;
  color: #334155;
  line-height: 1.6;
}

/* ── Content area ────────────────────────────────────── */
/* Grid gives each row a hard pixel allocation — no flex min-height ambiguity */
.content {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: 420px minmax(0, 1fr);
}

/* ── Map ─────────────────────────────────────────────── */
#map {
  height: 420px;
  background: var(--gray-100);
  position: relative;
}
.map-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--gray-400);
  font-size: 15px;
  pointer-events: none;
}
.map-hint { font-size: 13px; }
#map .leaflet-container { height: 100%; }

/* ── Results ─────────────────────────────────────────── */
#results-section {
  overflow-y: auto;
  padding: 14px 16px 20px;
  background: var(--gray-50);
}
#results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.results-header-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.results-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
#results-count {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.rc-match  { color: var(--gray-800); }
.rc-outside { font-size: 13px; font-weight: 500; color: var(--gray-400); }
#results-hub {
  font-size: 12px;
  color: var(--gray-400);
}
#results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

/* Sort pill group */
.sort-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.sort-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  margin-right: 2px;
}
.sort-btn {
  padding: 4px 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: 20px;
  background: var(--white);
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1.4;
}
.sort-btn:hover { border-color: var(--blue); color: var(--blue); }
.sort-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  font-weight: 600;
}

/* Area search input */
.area-search-input {
  height: 32px;
  padding: 0 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  font-size: 12px;
  color: var(--gray-800);
  background: var(--white);
  width: 140px;
  outline: none;
  transition: border-color .15s;
}
.area-search-input:focus { border-color: var(--blue); }
.area-search-input::placeholder { color: var(--gray-400); }

/* Toggle switch */
.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.toggle-wrap input { display: none; }
.toggle-track {
  width: 34px;
  height: 18px;
  background: var(--gray-200);
  border-radius: 9px;
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.toggle-wrap input:checked + .toggle-track { background: var(--blue); }
.toggle-wrap input:checked + .toggle-track .toggle-knob { transform: translateX(16px); }
.toggle-label-text {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
  white-space: nowrap;
}

/* ── Result card ─────────────────────────────────────── */
.result-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  cursor: pointer;
  transition: box-shadow .15s, border-color .15s, transform .1s, opacity .2s;
  animation: fadeUp .25s ease both;
  position: relative;
}
.result-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--blue);
  transform: translateY(-1px);
}
.card-dim {
  opacity: 0.42;
}
.card-dim:hover {
  opacity: 0.85;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-dim { animation: none; }

.card-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.rank {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
  min-width: 28px;
  text-align: center;
}
.rank-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  background: var(--gray-100);
  border-radius: 6px;
  padding: 3px 7px;
}
.card-title h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 5px;
  line-height: 1.2;
}
.badges { display: flex; flex-wrap: wrap; gap: 4px; }
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}
.badge-zone  { background: var(--gray-100); color: var(--gray-600); }
.badge-metro { background: #e0f2fe; color: #0369a1; }
.badge-warn  { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

/* Total cost hero */
.card-total {
  background: #f0f7ff;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-total__label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #3b82f6;
}
.card-total__value {
  font-size: 20px;
  font-weight: 800;
  color: #1d4ed8;
  letter-spacing: -0.5px;
}

/* Rent vs commute split */
.cost-split {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.cost-split__item { flex: 0 0 auto; }
.cost-split__item--right { text-align: right; }
.cost-split__label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--gray-400);
  margin-bottom: 2px;
}
.cost-split__val {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
}
.cost-split__bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  display: flex;
  overflow: hidden;
  background: var(--gray-100);
}
.cost-split__bar-rent  { background: #2563eb; transition: width .4s ease; }
.cost-split__bar-xport { background: #f97316; transition: width .4s ease; }

/* Commute info footer */
.commute-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--gray-500);
}
.rent-range { color: var(--gray-400); font-size: 11px; }

/* ── Detail panel ────────────────────────────────────── */
#detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1500;
  display: flex;
  justify-content: flex-end;
}
#detail-panel {
  width: 420px;
  max-width: 100%;
  background: var(--white);
  height: 100%;
  overflow-y: auto;
  padding: 24px;
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  animation: slideIn .2s ease;
  position: relative;
}
@keyframes slideIn {
  from { transform: translateX(100%); }
  to   { transform: translateX(0); }
}
#detail-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--gray-100);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 14px;
  cursor: pointer;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
#detail-close:hover { background: var(--gray-200); }

.detail-area-name {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-800);
  margin-bottom: 6px;
  padding-right: 40px;
}
.detail-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.detail-section { margin-bottom: 22px; }
.detail-section h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-400);
  margin-bottom: 10px;
}
.rent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rent-table th, .rent-table td {
  padding: 7px 10px;
  text-align: left;
  border-bottom: 1px solid var(--gray-100);
}
.rent-table th { font-weight: 600; color: var(--gray-600); }
.rent-table td:not(:first-child) { font-weight: 600; }
.commute-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.commute-row:last-child { border-bottom: none; }
.commute-hub { color: var(--gray-800); font-weight: 500; }
.commute-time { color: var(--blue); font-weight: 700; }

/* ── Utility ─────────────────────────────────────────── */
.hidden { display: none !important; }
.no-results, .error {
  padding: 32px;
  text-align: center;
  color: var(--gray-400);
  font-size: 14px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px dashed var(--gray-200);
}
.error { color: var(--red); border-color: #fecaca; background: #fff5f5; }

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 10px; }

/* ── Mobile ──────────────────────────────────────────── */
@media (max-width: 768px) {
  body { overflow: auto; }
  .main-layout { flex-direction: column; overflow: visible; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid #1e293b; }
  .content {
    display: block;
    overflow: visible;
  }
  #map { height: 280px; }
  #results-section { overflow: visible; height: auto; }
  .tagline { display: none; }
  #detail-panel { width: 100%; }
  #results-header { flex-direction: column; align-items: flex-start; }
  .results-header-right { flex-wrap: wrap; }
  .area-search-input { width: 100%; }

  /* Header: stack logo above scrollable nav strip */
  .site-header {
    height: auto;
    padding: 8px 16px 0;
  }
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
  }
  .site-nav {
    width: 100%;
    overflow: visible;
    flex-wrap: wrap;
    padding: 6px 0 8px;
    gap: 4px;
  }
  .nav-sep { display: none; }
  .nav-link {
    white-space: nowrap;
    font-size: 12px;
    padding: 3px 7px;
  }
  .nav-dropdown-menu {
    position: absolute;
    left: 0;
    right: auto;
    min-width: 260px;
    max-width: calc(100vw - 16px);
  }
}


/* ═══════════════════════════════════════════════════════════
   Content-page layout (SEO pages)
   ═══════════════════════════════════════════════════════════ */

body.content-layout {
  overflow-y: auto;
  height: auto;
  min-height: 100vh;
}
body.content-layout .page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 48px;
}

/* ── Nav ─────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  font-size: 13px;
}
.nav-link {
  color: var(--gray-600);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background .12s, color .12s;
}
.nav-link:hover { background: var(--gray-100); color: var(--blue); }
.nav-sep { color: var(--gray-200); }

/* ── Nav dropdown (Offices) ──────────────────────────────── */
.nav-dropdown {
  position: relative;
}
.nav-dropdown summary {
  list-style: none;
  cursor: pointer;
}
.nav-dropdown summary::-webkit-details-marker { display: none; }
.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 280px;
  max-height: 420px;
  overflow-y: auto;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-dropdown-item {
  display: block;
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-700);
  text-decoration: none;
  transition: background .1s, color .1s;
  white-space: nowrap;
  overflow-x: hidden;
  text-overflow: ellipsis;
}
.nav-dropdown-item:hover {
  background: var(--gray-100);
  color: var(--blue);
}

/* ── Breadcrumbs ─────────────────────────────────────────── */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--blue); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.bc-sep { color: var(--gray-300); }
.bc-current { color: var(--gray-600); font-weight: 500; }

/* ── Page hero ───────────────────────────────────────────── */
.page-hero {
  margin-bottom: 28px;
}
.page-hero h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--gray-800);
  line-height: 1.25;
  margin-bottom: 8px;
}
.page-hero .hero-sub {
  font-size: 15px;
  color: var(--gray-600);
  line-height: 1.5;
}
.highlight { color: var(--blue); }

/* ── Stat strip ──────────────────────────────────────────── */
.stat-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 20px;
  min-width: 120px;
  flex: 1;
}
.stat-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--blue);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label { font-size: 12px; color: var(--gray-600); }

/* ── Data table ──────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-200);
  margin-bottom: 32px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--white);
}
.data-table th {
  padding: 11px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-600);
  background: var(--gray-50);
  border-bottom: 1.5px solid var(--gray-200);
  white-space: nowrap;
}
.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-800);
  vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr.top-row { background: #f0f7ff; }
.data-table tr:hover td { background: var(--gray-50); }
.col-total { text-align: right; }
.total-val { color: var(--blue); font-weight: 700; }
.rank-cell { font-size: 16px; text-align: center; }
.area-link { color: var(--blue); text-decoration: none; font-weight: 600; }
.area-link:hover { text-decoration: underline; }
.link-subtle { color: var(--gray-400); font-size: 12px; text-decoration: none; white-space: nowrap; }
.link-subtle:hover { color: var(--blue); }
.note-cell { font-size: 12px; color: var(--gray-400); max-width: 200px; }
.table-note { font-size: 12px; color: var(--gray-400); margin-top: -24px; margin-bottom: 28px; line-height: 1.6; }

/* ── Info / related sections ─────────────────────────────── */
.info-section { margin-bottom: 32px; }
.info-section h2 {
  font-size: 19px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
}
.related-section { margin-bottom: 28px; }
.related-section h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 12px;
}
.compare-chips, .hub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 6px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: 20px;
  font-size: 13px;
  color: var(--gray-700);
  text-decoration: none;
  background: var(--white);
  transition: all .12s;
}
.chip:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.chip-hub  { background: var(--blue-light); border-color: #bfdbfe; color: var(--blue); }
.chip-area { background: #f0fdf4; border-color: #bbf7d0; color: var(--green); }
.chip-bhk  { background: #fdf4ff; border-color: #e9d5ff; color: #7e22ce; }
.chip-bhk:hover { background: #f3e8ff; border-color: #a855f7; color: #6b21a8; }

.bhk-switcher {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}
.bhk-switcher__label {
  font-size: 13px;
  color: var(--gray-500);
  margin-right: 4px;
}

/* ── Rent cards (commute page) ───────────────────────────── */
.rent-cards {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.rent-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 18px;
  min-width: 130px;
  flex: 1;
}
.rc-bhk { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--gray-400); margin-bottom: 4px; }
.rc-range { font-size: 14px; font-weight: 600; color: var(--gray-800); }
.rc-median { font-size: 12px; color: var(--blue); margin-top: 2px; }

/* ── Mode label chip ─────────────────────────────────────── */
.mode-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}

/* ── Compare page ────────────────────────────────────────── */
.compare-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 28px;
}
.compare-card {
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
}
.compare-card h2 { font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.compare-meta { display: flex; gap: 6px; margin-bottom: 12px; }
.compare-rent-highlight {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--blue-light);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
}
.cr-label { font-size: 12px; color: var(--gray-600); }
.cr-value { font-size: 17px; font-weight: 800; color: var(--blue); }
.diff-more { color: var(--red); font-size: 12px; font-weight: 600; }
.diff-less { color: var(--green); font-size: 12px; font-weight: 600; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--gray-800);
  color: #94a3b8;
  padding: 40px 20px 20px;
  margin-top: 40px;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}
.footer-col h4 {
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul a { color: #94a3b8; text-decoration: none; font-size: 13px; }
.footer-col ul a:hover { color: var(--white); }
.footer-about p { font-size: 13px; line-height: 1.7; }
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid #334155;
  font-size: 12px;
  color: #64748b;
}
.footer-bottom a { color: #64748b; }
.footer-bottom a:hover { color: var(--white); }

/* ── Mobile adjustments for content pages ────────────────── */
@media (max-width: 768px) {
  body.content-layout .page-wrap { padding: 16px 12px 32px; }
  .page-hero h1 { font-size: 22px; }
  .page-hero .hero-sub { font-size: 14px; }
  .compare-summary { grid-template-columns: 1fr; }
  .stat-strip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .stat-card { padding: 10px 14px; }
  .stat-num { font-size: 20px; }
  .info-section h2 { font-size: 17px; }
  .related-section h2 { font-size: 15px; }
  .rent-cards { flex-direction: column; }
  .rent-card { min-width: unset; }

  /* ── Table mobile optimisation ─────────────────────────── */
  /* Tighter cells so fewer columns overflow */
  .data-table th, .data-table td { padding: 8px 8px; font-size: 12px; }
  /* Allow compare-table headers (which embed area names) to wrap */
  .compare-table th { white-space: normal; min-width: 60px; }
  /* Hide non-essential columns tagged by the template */
  .hide-mobile { display: none !important; }
}

/* ── Cost-of-living grid ─────────────────────────────────── */
.section-note {
  font-size: 13px;
  color: var(--text-muted);
  margin: -4px 0 16px;
}
.col-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.col-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 14px;
  text-align: center;
}
.col-icon  { font-size: 22px; margin-bottom: 6px; }
.col-label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.col-range { font-size: 14px; font-weight: 700; color: var(--text); }
@media (max-width: 768px) {
  .col-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Ad placements ───────────────────────────────────── */

/* Ad strip inside #results-section scroll area, below the cards */
.ad-strip-tool {
  min-height: 100px;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-100);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  gap: 4px;
  margin-top: 16px;
}

/* Content pages: horizontal banner between sections */
.ad-block {
  width: 100%;
  min-height: 100px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  gap: 4px;
  margin: 0 0 32px;
}

.ad-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-400);
}

.ad-leaderboard {
  display: block;
  width: 100%;
  max-width: 728px;
  min-height: 90px;
}

/* Placeholder shimmer shown before AdSense loads */
.ad-leaderboard:not([data-ad-status]) {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: adShimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes adShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@media (max-width: 768px) {
  .ad-strip-tool { min-height: 60px; }
  .ad-leaderboard { max-width: 320px; min-height: 50px; }
}

/* Ad inside the detail slide-in panel (rectangle format, full panel width) */
.ad-block--panel {
  margin: 0 0 20px;
  border-radius: var(--radius);
  min-height: 120px;
}
.ad-block--panel .adsbygoogle {
  min-height: 120px;
}

/* ── WhatsApp share button ───────────────────────────── */
.wa-share {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #25d366;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 20px;
  text-decoration: none;
  margin-top: 12px;
  transition: background 0.15s;
}
.wa-share:hover { background: #1ebe5d; color: #fff; }
.wa-share svg { flex-shrink: 0; }

/* ── Best-value badge ────────────────────────────────── */
.badge-value {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
  margin-left: 4px;
  vertical-align: middle;
}

/* ── Data freshness note ─────────────────────────────── */
.freshness-note {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 6px;
}

/* ══════════════════════════════════════════════════════
   Guide / Article / SEO expansion pages
   ══════════════════════════════════════════════════════ */

/* ── Snapshot strip (area & hub guides) ─────────────── */
.snap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.snap-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}
.snap-val {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: 4px;
  white-space: nowrap;
}
.snap-label { font-size: 12px; color: var(--gray-500); }

/* ── Persona / who-lives-here list ───────────────────── */
.persona-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.persona-list li {
  font-size: 14px;
  color: var(--gray-700);
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border-left: 3px solid var(--blue);
  line-height: 1.5;
}

/* ── FAQ section ─────────────────────────────────────── */
.faq-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.faq-item { border: 1.5px solid var(--gray-200); border-radius: 10px; padding: 16px 20px; }
.faq-q { font-size: 15px; font-weight: 600; color: var(--gray-800); margin-bottom: 8px; }
.faq-a { font-size: 14px; color: var(--gray-600); line-height: 1.6; }

/* ── Guides index grid ───────────────────────────────── */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.guide-card {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: border-color .12s, box-shadow .12s;
  display: block;
}
.guide-card:hover { border-color: var(--blue); box-shadow: 0 2px 12px rgba(37,99,235,.08); }
.guide-card-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--blue); margin-bottom: 8px; }
.guide-card-title { font-size: 15px; font-weight: 700; color: var(--gray-800); margin-bottom: 6px; line-height: 1.4; }
.guide-card-desc { font-size: 13px; color: var(--gray-500); line-height: 1.5; }

/* ── Article (guide article) layout ─────────────────── */
.article-layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 40px;
  align-items: start;
}
.article-body { font-size: 15px; line-height: 1.75; color: var(--gray-700); }
.article-body h2 { font-size: 20px; font-weight: 700; color: var(--gray-800); margin: 32px 0 12px; }
.article-body h3 { font-size: 17px; font-weight: 600; color: var(--gray-800); margin: 24px 0 8px; }
.article-body p { margin-bottom: 16px; }
.article-body ul { padding-left: 20px; margin-bottom: 16px; }
.article-body li { margin-bottom: 6px; }
.article-body a { color: var(--blue); }
.reading-meta { font-size: 13px; color: var(--gray-400); margin-bottom: 24px; display: flex; gap: 16px; flex-wrap: wrap; }
.article-sidebar { position: sticky; top: 24px; }
.sidebar-section { background: var(--white); border: 1.5px solid var(--gray-200); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.sidebar-section h4 { font-size: 12px; font-weight: 700; color: var(--gray-500); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 10px; }
.sidebar-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.sidebar-links a { font-size: 13px; color: var(--blue); text-decoration: none; }
.sidebar-links a:hover { text-decoration: underline; }

/* ── Mode comparison table (hub guide) ──────────────── */
.mode-compare-table th, .mode-compare-table td { text-align: left; }
.mode-highlight { background: #eff6ff !important; font-weight: 600; }

/* ── Mobile ─────────────────────────────────────────── */
@media (max-width: 640px) {
  .snap-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: 1fr; }
  .article-sidebar { display: none; }
  .guide-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════
   Professional graphics additions
   ══════════════════════════════════════════════════════ */

/* ── SVG logo ────────────────────────────────────────── */
.logo-icon {
  font-size: 0;
  line-height: 0;
  display: flex;
  align-items: center;
}

/* ── Chart containers ────────────────────────────────── */
.chart-wrap {
  position: relative;
  margin: 20px 0 4px;
  border-radius: var(--radius);
  overflow: hidden;
}
.chart-wrap canvas { display: block; }
.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.chart-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
}
.chart-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--gray-500);
}
.chart-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}

/* ── Snap card icon ──────────────────────────────────── */
.snap-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}
.snap-icon--rent  { background: #eff6ff; color: #2563eb; }
.snap-icon--time  { background: #fff7ed; color: #ea580c; }
.snap-icon--zone  { background: #f0fdf4; color: #16a34a; }
.snap-icon--metro { background: #faf5ff; color: #7c3aed; }
.snap-card { transition: box-shadow .15s; }
.snap-card:hover { box-shadow: var(--shadow-md); }

/* ── Mode chip (commute table) ───────────────────────── */
.mode-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 9px;
  border-radius: 20px;
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
}
.mode-chip svg { flex-shrink: 0; opacity: .75; }
tr.top-row .mode-chip {
  background: var(--blue-light);
  border-color: #bfdbfe;
  color: var(--blue);
}
tr.top-row .mode-chip svg { opacity: 1; }

/* ── Stat card icon ──────────────────────────────────── */
.stat-card { position: relative; overflow: hidden; }
.stat-icon {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  color: #93c5fd;
}

/* ── Page hero accent ────────────────────────────────── */
.page-hero {
  border-left: 4px solid var(--blue);
  padding-left: 20px;
}
@media (max-width: 640px) {
  .page-hero { padding-left: 14px; }
}

/* ── Amenity strip (result cards + area pages) ───────── */
.amenity-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-100);
}
.amenity-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  white-space: nowrap;
}
.amenity-pill svg { flex-shrink: 0; }
.amenity-pill--good  { background: #f0fdf4; border-color: #bbf7d0; color: #15803d; }
.amenity-pill--ok    { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.amenity-pill--low   { background: var(--gray-50); border-color: var(--gray-200); color: var(--gray-400); }

/* Amenity section on area pages */
.amenity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.amenity-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 10px 12px;
  border-radius: 10px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}
.amenity-card__icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}
.amenity-card__count {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-800);
  line-height: 1;
}
.amenity-card__label {
  font-size: 11px;
  color: var(--gray-600);
  margin-top: 4px;
  font-weight: 500;
}
.amenity-card__sub {
  font-size: 9px;
  color: var(--gray-400);
  margin-top: 3px;
  line-height: 1.4;
  text-align: center;
}
.amenity-card__radius {
  font-size: 10px;
  color: var(--gray-400);
  margin-top: 2px;
}

@media (max-width: 640px) {
  .amenity-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
}
