/* ============================================================
   מערכת הערכת מחיר לנכסים – Vibrant Edition 🎨
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Heebo:wght@300;400;500;600;700;800;900&display=swap');

:root {
  /* === Minimal Clean Palette — Linear/Notion style === */
  /* Pleasant indigo accent, soft grays, lots of whitespace */
  --primary: #5b6cff;          /* Soft indigo — main brand */
  --primary-hover: #4a5be5;
  --primary-soft: #eef0ff;     /* Tint for backgrounds */
  --primary-line: #c7cdff;     /* Border accent */

  --success: #10b981;          /* Calm green */
  --success-soft: #d1fae5;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --info: #06b6d4;
  --info-soft: #cffafe;

  /* Legacy aliases — all mapped to new minimal palette */
  --purple: #5b6cff;
  --purple-deep: #4a5be5;
  --pink: #f472b6;
  --pink-deep: #db2777;
  --orange: #f59e0b;
  --orange-deep: #d97706;
  --teal: #06b6d4;
  --cyan: #06b6d4;
  --indigo: #5b6cff;
  --amber: #f59e0b;
  --rose: #f472b6;
  --emerald: #10b981;
  --navy: #1e293b;
  --sage: #6b7280;
  --gold: #f59e0b;

  /* Tints */
  --bg-warm: #fafafa;
  --bg-cream: #ffffff;
  --tint-navy: #eef0ff;
  --tint-sage: #f9fafb;
  --tint-gold: #fef3c7;
  --tint-teal: #cffafe;
  --tint-purple: #eef0ff;
  --tint-pink: #fdf2f8;
  --tint-orange: #fef3c7;
  --tint-indigo: #eef0ff;
  --tint-amber: #fef3c7;

  /* Background — clean off-white */
  --bg-page: #fafafa;
  --bg-card: #ffffff;
  --bg-subtle: #f9fafb;
  --bg-hover: #f3f4f6;

  /* Text — clear hierarchy */
  --text: #111827;             /* Strong text */
  --text-medium: #4b5563;      /* Medium */
  --text-soft: #6b7280;        /* Soft */
  --muted: #9ca3af;            /* Muted */
  --white: #ffffff;
  --card-bg: #ffffff;

  /* Borders — minimal */
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --border-light: #f3f4f6;

  /* Shadows — extremely subtle */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 0 3px rgba(91, 108, 255, 0.15);
  --shadow-color: 0 4px 16px;

  /* Radii — generous */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* Gradients — single soft accent */
  --grad-hero: linear-gradient(135deg, #5b6cff 0%, #818cf8 100%);
  --grad-purple: linear-gradient(135deg, #5b6cff 0%, #4a5be5 100%);
  --grad-pink: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
  --grad-sunset: linear-gradient(135deg, #f59e0b 0%, #fb923c 100%);
  --grad-ocean: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --grad-mint: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
  --grad-fire: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --grad-cotton: linear-gradient(135deg, #fafafa 0%, #f3f4f6 50%, #eef0ff 100%);
}

* { box-sizing: border-box; }

body {
  font-family: 'Heebo', 'Segoe UI', sans-serif;
  margin: 0;
  direction: rtl;
  line-height: 1.6;
  font-size: 15px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;

  /* Clean minimal background */
  background: #fafafa;
  background-attachment: fixed;
  background-size: 200% 200%;
  animation: backgroundShift 25s ease infinite;
}

@keyframes backgroundShift {
  0%, 100% { background-position: 0% 0%, 100% 0%, 100% 100%, 0% 100%, 50% 50%, 100% 50%, 0% 0%; }
  50%      { background-position: 10% 5%, 90% 5%, 90% 95%, 10% 95%, 55% 55%, 95% 55%, 0% 0%; }
}

/* Floating decorative blobs - more of them, more vivid */
.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  pointer-events: none;
  animation: float 18s infinite ease-in-out;
}
.bg-blob.b1 {
  width: 520px; height: 520px;
  background: linear-gradient(135deg, #5b6cff, #818cf8);
  top: -120px; right: -100px;
  opacity: 0.55;
}
.bg-blob.b2 {
  width: 450px; height: 450px;
  background: linear-gradient(135deg, #06b6d4, #6366f1);
  bottom: -100px; left: -120px;
  animation-delay: -6s;
  opacity: 0.55;
}
.bg-blob.b3 {
  width: 380px; height: 380px;
  background: linear-gradient(135deg, #5b6cff, #818cf8);
  top: 40%; right: -100px;
  animation-delay: -12s;
  opacity: 0.45;
}
.bg-blob.b4 {
  width: 360px; height: 360px;
  background: linear-gradient(135deg, #34d399, #14b8a6);
  top: 55%; left: -80px;
  animation-delay: -3s;
  opacity: 0.45;
}
.bg-blob.b5 {
  width: 300px; height: 300px;
  background: linear-gradient(135deg, #c084fc, #e879f9);
  top: 25%; left: 40%;
  animation-delay: -9s;
  opacity: 0.35;
}

/* Decorative geometric shapes */
.bg-shape {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  opacity: 0.12;
  animation: spinSlow 30s linear infinite;
}
.bg-shape.s1 {
  top: 15%; right: 8%;
  width: 80px; height: 80px;
  border: 4px solid var(--purple);
  border-radius: 20px;
  transform: rotate(15deg);
}
.bg-shape.s2 {
  top: 65%; right: 12%;
  width: 60px; height: 60px;
  background: var(--pink);
  border-radius: 50%;
  animation: float 12s ease-in-out infinite;
}
.bg-shape.s3 {
  bottom: 20%; left: 10%;
  width: 70px; height: 70px;
  border: 4px solid var(--orange);
  border-radius: 50%;
  animation-direction: reverse;
}
.bg-shape.s4 {
  top: 25%; left: 12%;
  width: 50px; height: 50px;
  background: var(--teal);
  transform: rotate(45deg);
  animation: spinSlow 20s linear infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px,-40px) scale(1.08); }
  66% { transform: translate(-30px,30px) scale(0.92); }
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

h1, h2, h3, h4 {
  margin: 0 0 0.6em;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
h1 { font-size: 1.7rem; }
h2 { font-size: 1.5rem; margin-bottom: 1rem; }
h3 {
  font-size: 1.1rem;
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--purple-deep);
}

a { color: var(--purple); text-decoration: none; font-weight: 600; transition: color 0.15s; }
a:hover { color: var(--pink); }

.muted { color: var(--muted); font-size: 0.92rem; }
.hidden { display: none !important; }

/* ============================================================ MARKET INSIGHTS ============================================================ */
.market-insights {
  margin: 2rem 0;
  padding: 1.8rem 2rem;
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: slideIn 0.5s;
}
.market-insights::before {
  content: '🧠';
  position: absolute;
  top: -20px; right: -20px;
  font-size: 9rem;
  opacity: 0.06;
  pointer-events: none;
}
.market-insights h3 {
  color: white;
  margin-top: 0;
  font-size: 1.3rem;
}
.market-insights h3::before { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.mi-summary {
  background: rgba(255,255,255,0.08);
  padding: 1rem 1.3rem;
  border-radius: 10px;
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.2rem;
  border-right: 4px solid #fbbf24;
}
.mi-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}
.mi-stat {
  background: rgba(255,255,255,0.1);
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
  border: 2px solid transparent;
}
.mi-stat.good { border-color: #10b981; background: linear-gradient(135deg, rgba(16,185,129,0.15), rgba(16,185,129,0.05)); }
.mi-stat.fair { border-color: #fbbf24; background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(251,191,36,0.05)); }
.mi-stat.down { border-color: #ef4444; background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(239,68,68,0.05)); }
.mi-stat-num {
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
}
.mi-stat.good .mi-stat-num { color: #34d399; }
.mi-stat.fair .mi-stat-num { color: #fbbf24; }
.mi-stat.down .mi-stat-num { color: #f87171; }
.mi-stat-label {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-top: 0.3rem;
}
.mi-section h4 { color: white; margin: 1rem 0 0.6rem; font-size: 1rem; opacity: 0.95; }
.mi-yearly-bars {
  display: flex;
  align-items: end;
  gap: 0.4rem;
  height: 140px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 0.5rem;
}
.mi-year-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  cursor: pointer;
}
.mi-bar {
  width: 100%;
  background: linear-gradient(180deg, #fbbf24, #f59e0b);
  border-radius: 4px 4px 0 0;
  transition: all 0.2s;
  min-height: 8px;
}
.mi-year-bar:hover .mi-bar { background: linear-gradient(180deg, #fcd34d, #fbbf24); transform: scaleX(1.1); }
.mi-year-label {
  font-size: 0.7rem;
  margin-top: 0.3rem;
  opacity: 0.7;
}
.mi-year-val {
  font-size: 0.68rem;
  opacity: 0.85;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.mi-footer {
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.78rem;
  opacity: 0.7;
  text-align: center;
}

/* ============================================================ CLAUDE REAL AI ANALYSIS ============================================================ */
.claude-real-analysis {
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 100%);
  color: white;
  padding: 1.5rem 1.8rem;
  border-radius: var(--r-lg);
  margin: 1rem 0;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: slideIn 0.5s;
}
.claude-real-analysis::before {
  content: '🤖';
  position: absolute;
  top: -15px; left: -15px;
  font-size: 7rem;
  opacity: 0.08;
  pointer-events: none;
}
.claude-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.2);
  padding-bottom: 0.6rem;
}
.claude-badge {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: var(--text);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.95rem;
}
.claude-tokens {
  font-size: 0.75rem;
  opacity: 0.7;
  font-family: 'JetBrains Mono', monospace;
}
.claude-content {
  font-size: 1rem;
  line-height: 1.85;
  font-weight: 400;
  white-space: pre-wrap;
}
.claude-footer {
  margin-top: 1rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.78rem;
  opacity: 0.75;
}

/* ============================================================ FRESHNESS TAGS ============================================================ */
.freshness-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-right: 0.5rem;
}
.freshness-tag.fresh-now,
.freshness-tag.fresh-day {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #047857;
}
.freshness-tag.fresh-week {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  color: #92400e;
}
.freshness-tag.fresh-old {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
}

/* ============================================================ SETTINGS TAB ============================================================ */
.settings-section {
  background: var(--bg-soft, #f8fafc);
  padding: 1.5rem;
  border-radius: var(--r);
  margin-bottom: 1.2rem;
  border: 1px solid var(--border);
}
.settings-section h3 { margin-top: 0; margin-bottom: 0.5rem; font-size: 1.1rem; }
.settings-section h3::before { background: var(--grad-primary); }
.settings-section .muted { margin-bottom: 1rem; font-size: 0.88rem; }
.setting-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0;
  cursor: pointer;
  user-select: none;
  font-weight: 600;
  color: var(--text);
}
.setting-toggle input { width: 18px; height: 18px; accent-color: var(--purple); cursor: pointer; }
.settings-info {
  margin-top: 2rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--tint-purple), var(--tint-pink));
  border-radius: var(--r);
}
.settings-info h4 { margin-top: 0; font-size: 1.05rem; }
.package-features {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.8rem;
  font-size: 0.95rem;
  font-weight: 600;
}

/* ============================================================ STRICT MODE BANNER ============================================================ */
.strict-banner {
  background: linear-gradient(135deg, #047857 0%, #059669 100%);
  color: white;
  padding: 0.7rem 2rem;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  flex-wrap: wrap;
  text-align: center;
  border-bottom: 2px solid rgba(255,255,255,0.2);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.strict-banner strong { font-size: 0.95rem; }
.strict-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255,255,255,0.18);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  user-select: none;
  font-size: 0.85rem;
}
.strict-toggle input { width: 16px; height: 16px; cursor: pointer; accent-color: #fbbf24; }
.strict-toggle:has(input:not(:checked)) {
  background: rgba(239,68,68,0.4);
}
.strict-toggle:has(input:not(:checked)) span::before { content: 'כבוי – '; }

/* ============================================================ DISCLAIMER BANNER ============================================================ */
.disclaimer-banner {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-bottom: 3px solid var(--amber);
  color: #78350f;
  padding: 0.9rem 2rem;
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: center;
  position: relative;
  z-index: 51;
  box-shadow: 0 4px 12px rgba(245,158,11,0.15);
}
.disclaimer-banner strong { color: #7c2d12; }

/* ============================================================ METHODS GRID ============================================================ */
.methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}
.method-card {
  background: white;
  padding: 1rem 1.1rem;
  border-radius: var(--r);
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
  position: relative;
}
.method-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--purple); }
.method-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 0.4rem;
}
.method-head strong { color: var(--purple-deep); font-size: 0.95rem; }
.method-weight {
  background: var(--grad-sunset);
  color: white;
  font-size: 0.72rem;
  padding: 0.18rem 0.55rem;
  border-radius: 12px;
  font-weight: 800;
}
.method-desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.6rem;
  line-height: 1.5;
}
.method-est {
  font-size: 1.3rem;
  font-weight: 900;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.method-sub {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
  font-weight: 500;
}

/* ============================================================ TOPBAR ============================================================ */
.topbar {
  background: var(--grad-hero);
  background-size: 300% 300%;
  animation: gradientShift 15s ease infinite;
  color: white;
  padding: 1.4rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  box-shadow: 0 10px 40px rgba(139, 92, 246, 0.25);
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom-right-radius: 32px;
  border-bottom-left-radius: 32px;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}
.brand { display: flex; align-items: center; gap: 1.2rem; }
.brand h1 {
  color: white;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.brand .subtitle {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.95;
  font-weight: 500;
}
.brand-mark {
  font-size: 1.9rem;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(20px);
  border: 2px solid rgba(255,255,255,0.4);
  color: white;
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  font-weight: 900;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  animation: wobble 6s ease-in-out infinite;
}
@keyframes wobble {
  0%, 100% { transform: rotate(-5deg) scale(1); }
  50% { transform: rotate(5deg) scale(1.05); }
}

.tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  background: rgba(255,255,255,0.18);
  padding: 0.4rem;
  border-radius: 18px;
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.25);
}
.tab {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.95);
  padding: 0.65rem 1.2rem;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tab:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}
.tab.active {
  background: white;
  color: var(--purple-deep);
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  transform: translateY(-2px);
}
.tab.active span { animation: bounce 0.6s ease; }
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ============================================================ LAYOUT ============================================================ */
.container { max-width: 1300px; margin: 2rem auto; padding: 0 1.5rem; }

.panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2.5rem;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255,255,255,0.7);
  animation: slideIn 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.panel::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  background: var(--grad-cotton);
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.4;
  z-index: 0;
  pointer-events: none;
}
.panel > * { position: relative; z-index: 1; }
.panel h2 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
}
.panel > .muted { margin-bottom: 1.8rem; }

/* Panels with personality - each tab a different theme */
#tab-profile::before { background: var(--grad-cotton); }
#tab-property::before { background: linear-gradient(135deg, #818cf8, #a5b4fc); }
#tab-comparables::before { background: linear-gradient(135deg, #fcd34d, #fb7185); }
#tab-valuation::before { background: linear-gradient(135deg, #6ee7b7, #67e8f9); }
#tab-report::before { background: linear-gradient(135deg, #a5b4fc, #818cf8); }

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================ FORMS ============================================================ */
.field { margin-bottom: 1.2rem; }
.field label {
  display: block;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.45rem;
  color: var(--text-soft);
  letter-spacing: 0.01em;
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: white;
  color: var(--text);
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(139,92,246,0.06);
}
.field input::placeholder, .field textarea::placeholder {
  color: #c7d2fe;
  font-weight: 400;
}
.field input:hover, .field select:hover, .field textarea:hover {
  box-shadow: 0 4px 12px rgba(139,92,246,0.1);
  transform: translateY(-1px);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(139,92,246,0.15), 0 4px 12px rgba(139,92,246,0.15);
  transform: translateY(-1px);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.8rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .container { padding: 0 1rem; margin: 1rem auto; }
  .panel { padding: 1.5rem; }
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 0.7rem;
  margin: 1.2rem 0;
}
.checkbox-grid label {
  background: white;
  padding: 0.8rem 1.1rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 2px solid transparent;
  font-size: 0.93rem;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  user-select: none;
  box-shadow: 0 2px 6px rgba(139,92,246,0.06);
}
.checkbox-grid label:hover {
  background: var(--tint-purple);
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(139,92,246,0.15);
}
.checkbox-grid label:has(input:checked) {
  background: var(--grad-purple);
  color: white;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(139,92,246,0.4);
  transform: translateY(-2px);
}
.checkbox-grid label:has(input:checked) input { accent-color: white; }
.checkbox-grid input {
  width: 18px;
  height: 18px;
  accent-color: var(--purple);
  cursor: pointer;
  margin: 0;
}

/* ============================================================ BUTTONS ============================================================ */
.btn-primary, .btn-secondary, .btn-link, .btn-danger {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.85rem 1.7rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--grad-purple);
  color: white;
  box-shadow: 0 6px 20px rgba(139,92,246,0.35);
  position: relative;
  overflow: hidden;
}
.btn-primary::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(139,92,246,0.45);
}
.btn-primary:hover::before { left: 100%; }
.btn-primary:active { transform: translateY(0); }
.btn-primary.big {
  font-size: 1.1rem;
  padding: 1.1rem 2.4rem;
  border-radius: var(--r);
  background: var(--grad-sunset);
  box-shadow: 0 10px 30px rgba(251,146,60,0.4);
}
.btn-primary.big:hover {
  box-shadow: 0 14px 38px rgba(251,146,60,0.55);
}
.btn-secondary {
  background: white;
  color: var(--purple-deep);
  border: 2px solid var(--purple);
  box-shadow: 0 4px 12px rgba(139,92,246,0.12);
}
.btn-secondary:hover {
  background: var(--purple);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(139,92,246,0.3);
}
.btn-link {
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: var(--r-sm);
}
.btn-link:hover {
  color: var(--pink-deep);
  background: var(--tint-pink);
}
.btn-danger {
  background: var(--grad-fire);
  color: white;
  box-shadow: 0 6px 20px rgba(239,68,68,0.35);
}
.btn-danger:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(239,68,68,0.45); }

.actions { display: flex; gap: 0.9rem; align-items: center; margin-top: 1.8rem; flex-wrap: wrap; }
.saved-indicator {
  color: var(--emerald);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.4rem 0.9rem;
  background: #d1fae5;
  border-radius: 20px;
  animation: pop 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes pop {
  0% { opacity: 0; transform: scale(0.8); }
  60% { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* ============================================================ LOGO UPLOADER ============================================================ */
.logo-uploader { text-align: center; }
.logo-uploader > label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: var(--text-soft);
  font-size: 1rem;
}
.logo-preview {
  width: 220px;
  height: 220px;
  border: 3px dashed var(--purple);
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  margin: 0 auto 1rem;
  background: var(--grad-cotton);
  overflow: hidden;
  transition: all 0.3s;
  cursor: pointer;
  position: relative;
}
.logo-preview::after {
  content: '📸';
  position: absolute;
  bottom: 12px; left: 12px;
  background: white;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 1.1rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.logo-preview:hover::after { opacity: 1; }
.logo-preview:hover {
  border-color: var(--pink);
  transform: scale(1.03) rotate(-1deg);
  box-shadow: 0 20px 40px rgba(139,92,246,0.25);
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview .placeholder { color: var(--purple-deep); font-size: 1rem; font-weight: 600; }

/* ============================================================ COMPARABLES ============================================================ */
.import-bar {
  display: flex; gap: 0.7rem; flex-wrap: wrap;
  padding: 1.3rem;
  background: linear-gradient(135deg, var(--tint-purple), var(--tint-pink));
  border-radius: var(--r);
  margin-bottom: 1.2rem;
  border: 2px solid white;
  box-shadow: var(--shadow);
}

.comparable-counters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.comparable-counters > span {
  background: white;
  padding: 1.2rem 1.3rem;
  border-radius: var(--r);
  display: flex; flex-direction: column; gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: all 0.25s;
  border: 2px solid transparent;
}
.comparable-counters > span::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 5px;
  height: 100%;
  background: var(--grad-purple);
}
.comparable-counters > span:nth-child(1)::before { background: var(--grad-purple); }
.comparable-counters > span:nth-child(2)::before { background: var(--grad-mint); }
.comparable-counters > span:nth-child(3)::before { background: var(--grad-ocean); }
.comparable-counters > span:nth-child(4)::before { background: var(--grad-sunset); }

.comparable-counters > span:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.comparable-counters strong {
  font-size: 1.9rem;
  font-weight: 900;
  line-height: 1;
}
.comparable-counters > span:nth-child(1) strong { color: var(--purple-deep); }
.comparable-counters > span:nth-child(2) strong { color: var(--emerald); }
.comparable-counters > span:nth-child(3) strong { color: var(--cyan); }
.comparable-counters > span:nth-child(4) strong { color: var(--orange-deep); }

@media (max-width: 700px) {
  .comparable-counters { grid-template-columns: repeat(2, 1fr); }
}

.filter-bar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  padding: 0.8rem;
  background: white;
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.filter-bar input, .filter-bar select {
  padding: 0.6rem 0.95rem;
  border: 2px solid transparent;
  background: var(--tint-purple);
  border-radius: var(--r-sm);
  font-family: inherit;
  flex: 1; min-width: 180px;
  font-size: 0.93rem;
  transition: all 0.18s;
  font-weight: 500;
}
.filter-bar input:focus, .filter-bar select:focus {
  outline: none;
  border-color: var(--purple);
  background: white;
}

.comparables-list { display: grid; gap: 0.9rem; }
.comp-card {
  background: white;
  border: 2px solid transparent;
  border-radius: var(--r);
  padding: 1.3rem;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 1.2rem;
  align-items: center;
  transition: all 0.25s;
  position: relative;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.comp-card::before {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 6px;
  background: linear-gradient(180deg, var(--purple), var(--pink));
  border-radius: var(--r) 0 0 var(--r);
  opacity: 0.5;
  transition: opacity 0.2s;
}
.comp-card:hover {
  border-color: var(--purple);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
.comp-card:hover::before { opacity: 1; }
.comp-card.selected {
  border-color: var(--orange);
  background: linear-gradient(to left, rgba(251,146,60,0.06), white);
  box-shadow: 0 8px 20px rgba(251,146,60,0.2);
}
.comp-card.selected::before { background: linear-gradient(180deg, var(--orange), var(--rose)); opacity: 1; }
.comp-card .checkbox { display: grid; place-items: center; }
.comp-card .checkbox input {
  width: 24px; height: 24px;
  accent-color: var(--orange);
  cursor: pointer;
}
.comp-card .info { display: grid; gap: 0.4rem; }
.comp-card .row1 { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.comp-card .badge {
  font-size: 0.74rem;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.badge.sold { background: var(--grad-mint); color: white; }
.badge.sold::before { content: '✓'; font-weight: 900; }
.badge.listed { background: var(--grad-ocean); color: white; }
.badge.listed::before { content: '●'; font-size: 0.6rem; }
.badge.source {
  background: var(--tint-purple);
  color: var(--purple-deep);
  border: 1px solid var(--purple);
}
.comp-card .price {
  font-size: 1.4rem;
  font-weight: 900;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-right: auto;
}
.comp-card .details { font-size: 0.9rem; color: var(--text-soft); }
.comp-card .actions-mini { display: flex; flex-direction: column; gap: 0.4rem; }
.comp-card .actions-mini button {
  background: white;
  border: 2px solid var(--border);
  padding: 0.45rem 0.9rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.15s;
  font-family: inherit;
  color: var(--text-soft);
}
.comp-card .actions-mini button:hover {
  border-color: var(--purple);
  color: var(--purple-deep);
  background: var(--tint-purple);
}
.comp-card .actions-mini .comp-delete:hover {
  border-color: var(--rose);
  color: var(--rose);
  background: var(--tint-pink);
}

/* ============================================================ VALUATION RESULT ============================================================ */
.valuation-result {
  margin: 2rem 0;
  padding: 2.5rem;
  background: var(--grad-cotton);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
  border: 3px solid white;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.5s;
}
.valuation-result::before {
  content: '';
  position: absolute;
  top: -80px; right: -80px;
  width: 280px; height: 280px;
  background: var(--grad-sunset);
  border-radius: 50%;
  opacity: 0.25;
  filter: blur(40px);
  animation: float 12s ease-in-out infinite;
}
.valuation-result::after {
  content: '💎';
  position: absolute;
  top: 20px; left: 24px;
  font-size: 3rem;
  opacity: 0.4;
  filter: drop-shadow(0 4px 10px rgba(139,92,246,0.3));
  animation: bounce 3s ease-in-out infinite;
}
.valuation-result .headline {
  font-size: 1rem;
  color: var(--text-soft);
  margin-bottom: 0.6rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
}
.valuation-result .range {
  font-size: 3rem;
  font-weight: 900;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
  line-height: 1.1;
  position: relative;
  z-index: 1;
}
.valuation-result .midpoint {
  color: var(--text-soft);
  font-size: 1.05rem;
  margin-bottom: 1.4rem;
  position: relative;
  z-index: 1;
  font-weight: 500;
}
.valuation-result .confidence {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.92rem;
  margin-bottom: 1.4rem;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-sm);
}
.confidence::before {
  content: '';
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.confidence.high { background: white; color: #047857; }
.confidence.high::before { background: var(--emerald); box-shadow: 0 0 0 4px rgba(16,185,129,0.25); animation: pulse 2s infinite; }
.confidence.medium { background: white; color: #92400e; }
.confidence.medium::before { background: var(--amber); box-shadow: 0 0 0 4px rgba(245,158,11,0.25); animation: pulse 2s infinite; }
.confidence.low { background: white; color: #991b1b; }
.confidence.low::before { background: var(--rose); box-shadow: 0 0 0 4px rgba(244,63,94,0.25); animation: pulse 2s infinite; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.valuation-result .breakdown {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(10px);
  padding: 1.4rem;
  border-radius: var(--r);
  margin-top: 1.4rem;
  font-size: 0.92rem;
  border: 1px solid white;
  position: relative;
  z-index: 1;
}
.valuation-result .breakdown h4 {
  margin: 0 0 0.9rem;
  color: var(--purple-deep);
  font-size: 1.05rem;
}
.valuation-result .breakdown table { width: 100%; border-collapse: collapse; }
.valuation-result .breakdown td {
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid rgba(139,92,246,0.1);
  font-size: 0.92rem;
}
.valuation-result .breakdown tr:last-child td { border-bottom: none; }
.valuation-result .breakdown td:first-child { color: var(--text-soft); font-weight: 500; }
.valuation-result .breakdown td:last-child {
  text-align: left;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-weight: 800;
  color: var(--purple-deep);
}

.warning-box {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-right: 4px solid var(--amber);
  padding: 1.2rem 1.4rem;
  border-radius: var(--r-sm);
  margin: 1.2rem 0;
  font-size: 0.95rem;
  position: relative;
  z-index: 1;
  box-shadow: var(--shadow-sm);
}
.warning-box strong { color: #92400e; }
.warning-box ul { margin: 0.5rem 0 0; padding-right: 1.2rem; }

/* ============================================================ MODALS ============================================================ */
.modal {
  position: fixed; inset: 0;
  background: rgba(30,27,75,0.7);
  backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 1rem;
  animation: fadeIn 0.2s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-content {
  background: white;
  padding: 2.5rem;
  border-radius: var(--r-lg);
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 30px 80px rgba(0,0,0,0.3);
  animation: slideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-top: 6px solid;
  border-image: var(--grad-purple) 1;
}
@keyframes slideUp { from { transform: translateY(40px) scale(0.95); opacity: 0; } to { transform: translateY(0) scale(1); opacity: 1; } }
.modal-content.wide { max-width: 940px; }
.modal-content h2 { margin-top: 0; }
.modal-content ol { padding-right: 1.5rem; }
.modal-content ol li { margin-bottom: 0.6rem; }
.modal-close {
  position: absolute;
  left: 1rem; top: 1rem;
  background: var(--tint-purple);
  border: none;
  width: 38px; height: 38px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: grid; place-items: center;
  transition: all 0.2s;
  color: var(--purple-deep);
  font-weight: 700;
}
.modal-close:hover {
  background: var(--rose);
  color: white;
  transform: rotate(90deg);
}
.modal-content code {
  background: var(--text);
  color: #f0abfc;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  font-size: 0.88rem;
  direction: ltr;
  display: inline-block;
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-weight: 600;
}

/* ============================================================ REPORT ============================================================ */
.report-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1.3rem;
  background: linear-gradient(135deg, var(--tint-purple), var(--tint-pink));
  border-radius: var(--r);
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
}
.report-option {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.93rem;
  background: white;
  padding: 0.6rem 1rem;
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.18s;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.report-option:hover { border-color: var(--purple); transform: translateY(-1px); }
.report-option input { accent-color: var(--purple); }

.report-preview {
  background: white;
  padding: 3rem;
  border-radius: var(--r);
  box-shadow: var(--shadow);
  min-height: 800px;
  border: 1px solid var(--border);
}

/* ============================================================ REPORT DOCUMENT ============================================================ */
.report-doc {
  font-family: 'Heebo', 'Segoe UI', sans-serif;
  color: var(--text);
  max-width: 820px;
  margin: 0 auto;
}
.report-doc .doc-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.5rem;
  margin-bottom: 2rem;
  background: var(--grad-cotton);
  border-radius: var(--r-lg);
  position: relative;
  overflow: hidden;
}
.report-doc .doc-header::after {
  content: '';
  position: absolute;
  bottom: -40px; left: -40px;
  width: 150px; height: 150px;
  background: var(--grad-sunset);
  border-radius: 50%;
  opacity: 0.25;
  filter: blur(30px);
}
.report-doc .doc-logo img { max-width: 130px; max-height: 130px; object-fit: contain; }
.report-doc .doc-title h1 {
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.1rem;
  margin: 0 0 0.4rem;
  font-weight: 900;
}
.report-doc .doc-title .subtitle { color: var(--text-soft); font-size: 1rem; font-weight: 500; }
.report-doc .doc-broker {
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.7;
  background: white;
  padding: 1rem 1.3rem;
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 1;
}
.report-doc .doc-broker .agency {
  font-weight: 900;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.15rem;
  margin-bottom: 0.3rem;
}

.report-doc section.doc-section { margin-bottom: 2.2rem; page-break-inside: avoid; }
.report-doc section.doc-section h2 {
  font-size: 1.3rem;
  color: white;
  padding: 0.6rem 1.1rem;
  background: var(--grad-purple);
  border-radius: var(--r-sm);
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow);
  display: inline-block;
  -webkit-text-fill-color: white;
}
.report-doc .doc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem 1.5rem;
  font-size: 0.95rem;
}
.report-doc .doc-grid > div {
  padding: 0.5rem 0.8rem;
  background: var(--tint-purple);
  border-radius: var(--r-sm);
}
.report-doc .doc-grid .label {
  font-weight: 700;
  color: var(--purple-deep);
  margin-left: 0.4rem;
}
.report-doc .doc-features {
  display: flex; flex-wrap: wrap; gap: 0.5rem;
  margin-top: 1rem;
}
.report-doc .doc-features span {
  background: var(--grad-purple);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.86rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.report-doc .doc-valuation {
  background: var(--grad-sunset);
  padding: 2rem;
  border-radius: var(--r-lg);
  text-align: center;
  box-shadow: var(--shadow-lg);
  color: white;
  position: relative;
  overflow: hidden;
}
.report-doc .doc-valuation::before {
  content: '';
  position: absolute;
  top: -50px; right: -50px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  filter: blur(20px);
}
.report-doc .doc-valuation .range {
  font-size: 2.4rem;
  font-weight: 900;
  color: white;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0,0,0,0.2);
  position: relative;
}
.report-doc .doc-valuation .midpoint {
  color: rgba(255,255,255,0.95);
  margin: 0.6rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  position: relative;
}
.report-doc .doc-valuation .confidence-note {
  display: inline-block;
  margin-top: 0.8rem;
  padding: 0.5rem 1.3rem;
  border-radius: 20px;
  font-weight: 800;
  background: white;
  color: var(--orange-deep);
  font-size: 0.93rem;
  box-shadow: var(--shadow);
  position: relative;
}

.report-doc table.comp-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.87rem;
  margin-top: 0.6rem;
  border-radius: var(--r-sm);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.report-doc table.comp-table th {
  background: var(--grad-purple);
  color: white;
  padding: 0.75rem 0.6rem;
  text-align: right;
  font-weight: 700;
  font-size: 0.86rem;
}
.report-doc table.comp-table td {
  padding: 0.65rem 0.6rem;
  border-bottom: 1px solid var(--border);
}
.report-doc table.comp-table tr:nth-child(even) td { background: var(--tint-purple); }
.report-doc table.comp-table tr:hover td { background: var(--tint-pink); }

.report-doc .doc-footer {
  margin-top: 3rem;
  padding: 1.2rem;
  background: var(--grad-cotton);
  border-radius: var(--r);
  font-size: 0.9rem;
  color: var(--text-soft);
  text-align: center;
  font-weight: 600;
}
.report-doc .disclaimer {
  margin-top: 2rem;
  padding: 1.3rem 1.5rem;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-right: 4px solid var(--amber);
  font-size: 0.86rem;
  border-radius: var(--r-sm);
  line-height: 1.6;
  box-shadow: var(--shadow-sm);
}
.report-doc .disclaimer strong { color: #92400e; }

/* ============================================================ PRINT ============================================================ */
.print-only { display: none; }

@media print {
  body { background: white; }
  body::before, body::after { display: none; }
  .no-print { display: none !important; }
  .print-only { display: block !important; }
  #printReport { padding: 0; }
  .report-doc { max-width: none; }
  @page { size: A4; margin: 1.3cm; }
}

/* ============================================================ SEARCH BAR & DUAL LISTS ============================================================ */
.search-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.5rem 1.8rem;
  background: linear-gradient(135deg, var(--tint-purple), var(--tint-pink), var(--tint-orange));
  border-radius: var(--r);
  margin-bottom: 1.5rem;
  border: 2px solid white;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}
.search-summary { font-size: 0.95rem; flex: 1; min-width: 260px; }
.search-summary strong { display: block; color: var(--purple-deep); margin-bottom: 0.3rem; font-size: 0.85rem; }
.search-summary #searchParams {
  font-weight: 600;
  color: var(--text);
  font-size: 1rem;
}

.dual-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 1024px) { .dual-lists { grid-template-columns: 1fr; } }

.comp-section {
  background: white;
  border-radius: var(--r);
  padding: 1.3rem;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
}
.comp-section.section-listed { border-color: var(--cyan); }
.comp-section.section-sold { border-color: var(--emerald); }

.comp-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.8rem;
  border-bottom: 2px dashed var(--border);
  margin-bottom: 0.8rem;
}
.comp-section-header h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text);
}
.comp-section-header h3::before { display: none; }
.section-listed h3 { color: #0e7490; }
.section-sold h3 { color: #047857; }
.comp-section-meta {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 600;
}
.comp-section-meta .sel-count {
  color: var(--orange-deep);
  font-weight: 800;
}

.comp-section-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}
.comp-section-tools .btn-link {
  font-size: 0.82rem;
  padding: 0.3rem 0.6rem;
}
.comp-filter {
  flex: 1;
  min-width: 100px;
  padding: 0.5rem 0.8rem;
  border: 1.5px solid var(--border);
  background: var(--bg-soft, #f8fafc);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.88rem;
}
.comp-filter:focus { outline: none; border-color: var(--purple); background: white; }

.comp-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 600px;
  overflow-y: auto;
  padding-left: 0.3rem;
}

.comp-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 0.8rem;
  align-items: center;
  background: #fafbff;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  padding: 0.7rem 0.9rem;
  transition: all 0.15s;
  position: relative;
}
.comp-row:hover {
  border-color: var(--purple);
  background: white;
  transform: translateX(-2px);
  box-shadow: var(--shadow-sm);
}
.comp-row.selected {
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
  border-color: var(--orange);
  box-shadow: 0 4px 12px rgba(251,146,60,0.2);
}
.row-check { display: grid; place-items: center; cursor: pointer; }
.row-check input {
  width: 20px; height: 20px;
  accent-color: var(--orange);
  cursor: pointer;
}
.row-main { min-width: 0; }
.row-addr {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}
.row-addr strong {
  color: var(--text);
  font-weight: 700;
}
.row-source {
  font-size: 0.7rem;
  background: var(--tint-purple);
  color: var(--purple-deep);
  padding: 0.12rem 0.5rem;
  border-radius: 10px;
  font-weight: 700;
}
.row-specs {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  font-size: 0.83rem;
  color: var(--muted);
  font-weight: 500;
}
.row-price {
  text-align: left;
  white-space: nowrap;
}
.price-main {
  font-weight: 800;
  font-size: 1rem;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.price-ppsm {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}
.row-actions {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}
.row-actions a, .row-actions button {
  background: white;
  border: 1.5px solid var(--border);
  width: 30px; height: 30px;
  border-radius: 6px;
  display: grid; place-items: center;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.15s;
  color: var(--text-soft);
  font-family: inherit;
}
.row-actions a:hover { border-color: var(--purple); color: var(--purple); }
.row-actions .comp-delete:hover { border-color: var(--rose); color: var(--rose); }

.empty-list {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-style: italic;
  background: #fafbff;
  border-radius: var(--r-sm);
}

.advanced-tools {
  margin: 1rem 0;
}
.advanced-tools details {
  background: white;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  padding: 0.7rem 1rem;
  box-shadow: var(--shadow-sm);
}
.advanced-tools summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-soft);
  font-size: 0.9rem;
  user-select: none;
}
.advanced-tools summary:hover { color: var(--purple-deep); }
.advanced-content {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
  flex-wrap: wrap;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--border);
}

.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--tint-purple);
  border-top-color: var(--purple);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.fetch-loading { display: flex; align-items: center; gap: 1rem; }

/* ============================================================ ARCHIVE ============================================================ */
.archive-toolbar {
  display: flex;
  gap: 0.7rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  padding: 1rem;
  background: var(--grad-soft, linear-gradient(135deg, #f5f3ff, #fdf2f8));
  border-radius: var(--r);
  border: 2px solid white;
  align-items: center;
}
.archive-toolbar input,
.archive-toolbar select {
  padding: 0.6rem 0.95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  font-size: 0.95rem;
  background: white;
}
.archive-toolbar input { flex: 1; min-width: 220px; }
.archive-toolbar input:focus, .archive-toolbar select:focus {
  outline: none;
  border-color: var(--purple);
}

.archive-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}
.arch-stat {
  background: white;
  padding: 1rem 1.2rem;
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  box-shadow: var(--shadow-sm);
  border-right: 4px solid var(--purple);
}
.arch-stat strong {
  font-size: 1.4rem;
  font-weight: 900;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.arch-stat span { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

.archive-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.archive-card {
  background: white;
  border: 2px solid transparent;
  border-radius: var(--r);
  padding: 1.2rem 1.4rem;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 1.2rem;
  align-items: center;
  transition: all 0.18s;
  box-shadow: var(--shadow-sm);
}
.archive-card:hover {
  border-color: var(--purple);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.arch-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}
.arch-head strong { font-size: 1.02rem; color: var(--text); }
.arch-date {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg-soft, #f8fafc);
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
  font-weight: 600;
}
.arch-details {
  font-size: 0.88rem;
  color: var(--text-soft);
  font-weight: 500;
}
.arch-details .badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.55rem;
  border-radius: 10px;
  margin-right: 0.3rem;
}
.arch-details .badge.high { background: #d1fae5; color: #047857; }
.arch-details .badge.medium { background: #fef3c7; color: #92400e; }
.arch-details .badge.low { background: #fee2e2; color: #991b1b; }

.arch-price {
  text-align: center;
  min-width: 140px;
}
.arch-mid {
  font-size: 1.25rem;
  font-weight: 900;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.arch-range {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
}

.arch-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.arch-actions button {
  padding: 0.5rem 0.9rem;
  font-size: 0.84rem;
  white-space: nowrap;
}

.archive-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  background: var(--bg-soft, #f8fafc);
  border-radius: var(--r);
  font-style: italic;
}

@media (max-width: 768px) {
  .archive-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .arch-actions { flex-direction: row; justify-content: center; }
}

/* ============================================================ RELIABILITY BOX ============================================================ */
.reliability-box {
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, var(--tint-purple), var(--tint-amber));
  border-radius: var(--r-lg);
  border: 3px solid white;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.5s;
}
.reliability-box h3 {
  margin-top: 0;
  font-size: 1.3rem;
}
.reliability-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
@media (max-width: 600px) { .reliability-main { grid-template-columns: 1fr; text-align: center; } }
.rel-ring-wrap { display: grid; place-items: center; }
.rel-side { display: flex; flex-direction: column; gap: 0.8rem; }
.rel-grade {
  padding: 0.6rem 1.2rem;
  border-radius: 20px;
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  display: inline-block;
  align-self: flex-start;
  box-shadow: var(--shadow);
}
.rel-summary {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text);
  background: white;
  padding: 0.9rem 1.1rem;
  border-radius: var(--r-sm);
  border-right: 4px solid var(--purple);
}
.rel-details {
  background: white;
  border-radius: var(--r);
  padding: 0.8rem 1rem;
  box-shadow: var(--shadow-sm);
}
.rel-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--purple-deep);
  font-size: 0.95rem;
  padding: 0.3rem 0;
}
.rel-list { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.7rem; }
.rel-row {
  display: grid;
  grid-template-columns: 200px 1fr 60px 80px;
  gap: 0.8rem;
  align-items: center;
  font-size: 0.88rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--border);
}
.rel-row:last-child { border-bottom: none; }
.rel-label { color: var(--text); font-weight: 600; }
.rel-track {
  background: var(--tint-purple);
  height: 12px;
  border-radius: 6px;
  overflow: hidden;
}
.rel-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.6s ease;
}
.rel-score { font-weight: 800; font-family: 'JetBrains Mono', monospace; text-align: left; }
.rel-weight { font-size: 0.78rem; color: var(--muted); font-weight: 500; text-align: left; }
@media (max-width: 700px) {
  .rel-row { grid-template-columns: 1fr; gap: 0.3rem; }
}

/* ============================================================ GAUGE WIDGET ============================================================ */
.gauge-wrap {
  margin: 1.5rem auto 0.8rem;
  max-width: 380px;
  position: relative;
}
.gauge-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(139,92,246,0.25));
}
.gauge-label {
  display: flex;
  justify-content: space-between;
  padding: 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-soft);
  margin-top: -0.3rem;
}
.gauge-label .gauge-mid { color: var(--purple-deep); }

/* ============================================================ BUILDING FILE ============================================================ */
.building-file-display {
  margin-top: 1.2rem;
  padding: 1.8rem 2rem;
  background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
  border-radius: var(--r-lg);
  border: 2px solid white;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.4s;
}
.bf-alerts-list { display: flex; flex-direction: column; gap: 0.6rem; }
.bf-alert {
  padding: 0.9rem 1.1rem;
  border-radius: var(--r-sm);
  border-right: 4px solid;
  background: white;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s;
}
.bf-alert:hover { transform: translateX(-2px); box-shadow: var(--shadow); }
.bf-alert.bf-critical { background: #fee2e2; border-color: var(--rose); color: #991b1b; }
.bf-alert.bf-important { background: #fed7aa; border-color: var(--orange); color: #9a3412; }
.bf-alert.bf-warning { background: #fef3c7; border-color: var(--amber); color: #92400e; }
.bf-alert.bf-info { background: #dbeafe; border-color: var(--indigo); color: #1e40af; }
.bf-alert-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.bf-alert-head strong { font-size: 1rem; }
.bf-icon { font-size: 1.3rem; }
.bf-desc { font-size: 0.9rem; line-height: 1.55; }
.bf-items { margin: 0.5rem 0 0; padding-right: 1.4rem; font-size: 0.85rem; }
.bf-items li { margin-bottom: 0.2rem; }

.bf-section { margin-top: 1.2rem; }
.bf-section h4 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  color: var(--purple-deep);
  font-weight: 800;
}
.bf-rights {
  background: white;
  padding: 1rem 1.2rem;
  border-radius: var(--r-sm);
  border-right: 4px solid var(--purple);
}
.bf-tama h4 { color: var(--orange-deep); }
.bf-pb h4 { color: var(--rose); }

/* === Radius-based permits grid === */
.radius-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
  margin-top: 0.7rem;
}
.radius-card {
  background: white;
  border-radius: var(--r-sm);
  padding: 0.9rem 1rem;
  border: 2px solid;
  box-shadow: var(--shadow-sm);
  transition: all 0.18s;
}
.radius-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.radius-card.radius-critical { background: linear-gradient(135deg,#fee2e2,#fecaca); border-color: var(--rose); }
.radius-card.radius-important { background: linear-gradient(135deg,#fed7aa,#fdba74); border-color: var(--orange); }
.radius-card.radius-warning { background: linear-gradient(135deg,#fef3c7,#fde68a); border-color: var(--amber); }
.radius-card.radius-info { background: linear-gradient(135deg,#dbeafe,#bfdbfe); border-color: var(--indigo); }

.radius-head {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed rgba(0,0,0,0.1);
}
.radius-count {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}
.radius-card.radius-critical .radius-count { color: #991b1b; }
.radius-card.radius-important .radius-count { color: #9a3412; }
.radius-card.radius-warning .radius-count { color: #92400e; }
.radius-card.radius-info .radius-count { color: #1e40af; }
.radius-label { font-weight: 700; font-size: 0.95rem; }

.radius-items { margin: 0; padding: 0; list-style: none; font-size: 0.85rem; }
.radius-items li {
  padding: 0.35rem 0;
  border-bottom: 1px dashed rgba(0,0,0,0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
}
.radius-items li:last-child { border-bottom: none; }
.radius-items strong { font-weight: 600; }
.dist-tag {
  background: rgba(255,255,255,0.7);
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.permit-type {
  background: rgba(255,255,255,0.5);
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-size: 0.75rem;
}

/* === Neighbor analysis === */
.neighbor-trend {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  background: white;
  padding: 0.8rem 1rem;
  border-radius: var(--r-sm);
}
.trend-bar {
  flex: 1;
  height: 12px;
  background: #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}
.trend-fill { height: 100%; border-radius: 6px; transition: width 0.6s; }
.trend-label { font-weight: 800; font-size: 0.9rem; white-space: nowrap; }

.neighbor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.7rem;
}
.n-card {
  background: white;
  padding: 0.9rem;
  border-radius: var(--r-sm);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: all 0.2s;
}
.n-card:hover { transform: translateY(-2px); }
.n-card.tama { border-color: var(--orange); }
.n-card.pinui { border-color: var(--rose); }
.n-card .n-num {
  font-size: 1.8rem;
  font-weight: 900;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.n-card.tama .n-num { background: var(--grad-sunset); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.n-card.pinui .n-num { background: var(--grad-fire); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.n-card .n-label { font-size: 0.78rem; color: var(--muted); font-weight: 700; }

/* ============================================================ DIRECTION GRID ============================================================ */
.direction-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  background: #eef2ff;
  padding: 0.8rem;
  border-radius: var(--r-sm);
  margin-top: 0.3rem;
  border: 1px solid #c7d2fe;
}
.direction-grid label {
  background: #ffffff;
  color: #1e293b;
  padding: 0.55rem 0.7rem;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 1.5px solid #cbd5e1;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  justify-content: center;
  transition: all 0.15s;
  user-select: none;
}
.direction-grid label:hover { border-color: var(--purple-light); transform: translateY(-1px); }
.direction-grid label:has(input:checked) {
  background: var(--grad-purple);
  color: white;
  border-color: var(--purple);
  box-shadow: 0 4px 10px rgba(139,92,246,0.3);
}
.direction-grid input { display: none; }
@media (max-width: 600px) { .direction-grid { grid-template-columns: repeat(2, 1fr); } }

/* ============================================================ DIAGNOSTICS ============================================================ */
.diag-results { display:flex; flex-direction:column; gap:0.5rem; margin-top:0.8rem; }
.diag-row {
  background: white;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1rem;
  align-items: center;
  font-size: 0.88rem;
  box-shadow: var(--shadow-sm);
}
.diag-name { font-weight: 700; }
.diag-info { font-family: 'JetBrains Mono', monospace; font-size: 0.82rem; color: var(--text-soft); }
.diag-info code { background: rgba(0,0,0,0.06); padding: 0.1rem 0.4rem; border-radius: 4px; font-size: 0.78rem; }
@media (max-width:600px){.diag-row{grid-template-columns:1fr}}

/* ============================================================ MAP PREVIEW ============================================================ */
.map-preview {
  background: white;
  border-radius: var(--r);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  margin-top: 0.5rem;
}
.map-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.map-header strong { color: var(--purple-deep); font-size: 1rem; }
.map-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.map-link {
  background: var(--tint-purple);
  color: var(--purple-deep);
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.15s;
}
.map-link:hover { background: var(--purple); color: white; }
.map-link.gov { background: var(--tint-amber); color: var(--orange-deep); }
.map-link.gov:hover { background: var(--orange); color: white; }
.map-link.waze { background: #d1fae5; color: #047857; }
.map-link.waze:hover { background: var(--emerald); color: white; }
.map-iframe-wrap {
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
}
.map-iframe-wrap iframe {
  width: 100%;
  height: 320px;
  border: 0;
  display: block;
}

/* ============================================================ HOUSE EXTRAS (private/villa/cottage) ============================================================ */
.house-extras {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 2px solid var(--amber);
  border-radius: var(--r);
  padding: 1.5rem 1.8rem;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
  animation: slideIn 0.4s;
}
.house-extras::before {
  content: '🏡';
  position: absolute;
  top: -10px; left: -10px;
  font-size: 6rem;
  opacity: 0.08;
  pointer-events: none;
}
.house-extras h3 {
  margin-top: 0;
  color: #92400e;
  position: relative;
  z-index: 1;
}
.house-extras h3::before { background: var(--grad-sunset); }
.house-extras h4 {
  color: #78350f;
  margin: 0.8rem 0 0.5rem;
  font-size: 0.95rem;
}
.unit-section {
  background: rgba(255,255,255,0.7);
  padding: 1rem 1.2rem;
  border-radius: var(--r-sm);
  margin-top: 1rem;
  border-right: 4px solid var(--orange);
}

/* ============================================================ SHARE BUTTONS ============================================================ */
.share-email {
  background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
  color: white !important;
  border: none !important;
}
.share-email:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37,99,235,0.4) !important;
}
.share-whatsapp {
  background: linear-gradient(135deg, #25d366, #128c7e) !important;
  color: white !important;
  border: none !important;
}
.share-whatsapp:hover {
  background: linear-gradient(135deg, #128c7e, #075e54) !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37,211,102,0.4) !important;
}

/* ============================================================ BALCONIES ============================================================ */
.balconies-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}
.balcony-row {
  display: grid;
  grid-template-columns: 1fr 110px auto 34px;
  gap: 0.6rem;
  align-items: center;
  background: white;
  padding: 0.6rem 0.8rem;
  border-radius: var(--r-sm);
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.balcony-row:hover { border-color: var(--purple-light); }
.balcony-row .b-type {
  padding: 0.55rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  background: var(--tint-purple);
  font-weight: 600;
  color: var(--purple-deep);
}
.balcony-row .b-size {
  padding: 0.55rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-family: inherit;
  text-align: center;
  font-weight: 700;
}
.balcony-row .b-suffix {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.88rem;
}
.balcony-row .b-remove {
  background: var(--tint-pink);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--rose);
  font-weight: 800;
  font-size: 0.95rem;
  transition: all 0.15s;
  font-family: inherit;
}
.balcony-row .b-remove:hover { background: var(--rose); color: white; transform: rotate(90deg); }

/* ============================================================ PPSM SUMMARY ============================================================ */
.ppsm-summary {
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, var(--tint-amber) 0%, var(--tint-orange) 100%);
  border-radius: var(--r-lg);
  border: 3px solid white;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.5s;
}
.ppsm-summary h3 {
  margin-top: 0;
  font-size: 1.3rem;
  color: var(--orange-deep);
}
.ppsm-summary h3::before { background: var(--grad-sunset); }
.ppsm-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 768px) { .ppsm-cards { grid-template-columns: 1fr; } }
.ppsm-card {
  background: white;
  padding: 1.3rem;
  border-radius: var(--r);
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: all 0.2s;
}
.ppsm-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.ppsm-card.highlight {
  background: var(--grad-sunset);
  color: white;
  transform: scale(1.05);
}
.ppsm-card.highlight .ppsm-label,
.ppsm-card.highlight .ppsm-sub { color: rgba(255,255,255,0.95); }
.ppsm-label {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-bottom: 0.4rem;
  font-weight: 600;
}
.ppsm-value {
  font-size: 1.8rem;
  font-weight: 900;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}
.ppsm-card.highlight .ppsm-value {
  background: none;
  -webkit-text-fill-color: white;
  color: white;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.ppsm-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.3rem;
}
.ppsm-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.7rem;
  font-size: 0.88rem;
  background: white;
  border-radius: var(--r-sm);
  overflow: hidden;
}
.ppsm-table th {
  background: var(--purple-deep);
  color: white;
  padding: 0.6rem 0.8rem;
  text-align: right;
  font-weight: 600;
}
.ppsm-table td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--border); }
.ppsm-table tr:nth-child(even) td { background: var(--tint-purple); }
.ppsm-table .tag {
  font-size: 0.7rem;
  padding: 0.12rem 0.55rem;
  border-radius: 10px;
  font-weight: 700;
  margin-left: 0.4rem;
}
.ppsm-table .tag.sold { background: #d1fae5; color: #047857; }
.ppsm-table .tag.listed { background: #dbeafe; color: #1d4ed8; }

/* ============================================================ PRICE HISTORY ============================================================ */
.price-history-box {
  margin: 2rem 0;
  padding: 2rem;
  background: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 100%);
  border-radius: var(--r-lg);
  border: 3px solid white;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.5s;
}
.price-history-box h3 {
  margin-top: 0;
  font-size: 1.3rem;
}
.history-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}
.hstat {
  background: white;
  padding: 1rem 1.2rem;
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  border: 2px solid transparent;
  transition: all 0.2s;
}
.hstat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.hstat strong {
  font-size: 1.5rem;
  font-weight: 900;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hstat span { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.hstat.trend.up strong {
  background: var(--grad-mint);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hstat.trend.down strong {
  background: var(--grad-fire);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.history-chart {
  width: 100%;
  height: auto;
  background: white;
  border-radius: var(--r);
  border: 1px solid var(--border);
  padding: 0.8rem;
  box-shadow: var(--shadow-sm);
}
.history-chart .point circle { transition: r 0.15s; cursor: pointer; }
.history-chart .point circle:hover { r: 7; }

/* ============================================================ AUTOCOMPLETE ============================================================ */
.ac-results {
  position: absolute;
  top: 100%;
  right: 0;
  left: 0;
  background: white;
  border-radius: var(--r-sm);
  box-shadow: 0 12px 32px rgba(15,23,42,0.18), 0 0 0 1px rgba(139,92,246,0.15);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
  margin-top: 4px;
  animation: acFade 0.15s ease;
  border: 2px solid var(--purple);
}
@keyframes acFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.ac-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 0.7rem;
  padding: 0.65rem 0.9rem;
  cursor: pointer;
  font-size: 0.93rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
  transition: background 0.12s;
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.active {
  background: linear-gradient(90deg, var(--tint-purple), var(--tint-pink));
}
.ac-item.active {
  background: linear-gradient(90deg, var(--purple), var(--pink));
  color: white;
}
.ac-item.active .ac-type { background: rgba(255,255,255,0.25); color: white; }
.ac-icon { font-size: 1.1rem; text-align: center; }
.ac-label {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-item.active .ac-label { color: white; }
.ac-label mark {
  background: var(--accent-light, #fbbf24);
  color: var(--text);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 800;
}
.ac-item.active .ac-label mark { background: white; color: var(--purple-deep); }
.ac-type {
  font-size: 0.72rem;
  padding: 0.18rem 0.6rem;
  background: var(--tint-purple);
  color: var(--purple-deep);
  border-radius: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* ============================================================ GOV DATA ============================================================ */
.gov-data {
  margin-top: 1.2rem;
  padding: 1.2rem;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: var(--r);
  border: 2px solid white;
}
.gov-data > h4 {
  margin: 0 0 0.8rem;
  color: #1e40af;
  font-size: 1.05rem;
  font-weight: 800;
}
.gov-card {
  background: white;
  padding: 1rem 1.2rem;
  border-radius: var(--r-sm);
  margin-bottom: 0.7rem;
  box-shadow: var(--shadow-sm);
  border-right: 4px solid;
  transition: all 0.2s;
}
.gov-card:hover { transform: translateX(-2px); box-shadow: var(--shadow); }
.gov-card.socio { border-color: var(--purple); }
.gov-card.demo { border-color: var(--cyan); }
.gov-card.permits { border-color: var(--orange); }
.gov-card.planning { border-color: var(--emerald); }
.gov-card.schools { border-color: var(--pink); }
.gov-card.elections { border-color: var(--indigo); }

.parties-list { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.5rem; }
.party-bar {
  display: grid;
  grid-template-columns: 140px 1fr 55px;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.85rem;
}
.party-name { font-weight: 700; color: var(--text); }
.party-track {
  background: var(--tint-purple);
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
}
.party-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo), var(--purple));
  border-radius: 7px;
  transition: width 0.6s;
}
.party-pct {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 800;
  color: var(--indigo);
  text-align: left;
}
.gov-card-title {
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: #1e40af;
  font-size: 0.95rem;
}

.cluster-display {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.8rem;
  align-items: center;
  margin: 0.5rem 0;
}
.cluster-num {
  font-size: 2rem;
  font-weight: 900;
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.cluster-max {
  font-size: 1rem;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
}
.cluster-bar {
  height: 14px;
  background: #e0e7ff;
  border-radius: 7px;
  overflow: hidden;
}
.cluster-fill {
  height: 100%;
  background: var(--grad-purple);
  border-radius: 7px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.cluster-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--purple-deep);
  white-space: nowrap;
}

.permits-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.permit-item {
  background: var(--tint-purple);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.permit-item strong { color: var(--text); }
.permit-item span {
  background: white;
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-soft);
}
.permit-item span.status {
  background: var(--emerald);
  color: white;
}
.permit-item a {
  margin-right: auto;
  font-size: 0.82rem;
  font-weight: 700;
}

/* ============================================================ AREA INFO DISPLAY ============================================================ */
.area-info-display {
  margin-top: 1.2rem;
  padding: 1.8rem 2rem;
  background: linear-gradient(135deg, var(--tint-purple) 0%, var(--tint-pink) 100%);
  border-radius: var(--r-lg);
  border: 2px solid white;
  box-shadow: var(--shadow);
  animation: slideIn 0.4s;
}
.area-character {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--purple-deep);
  margin-bottom: 0.8rem;
}
.area-desc {
  background: white;
  padding: 1rem 1.3rem;
  border-radius: var(--r);
  border-right: 4px solid var(--purple);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow-sm);
}
.area-highlights, .area-scores, .area-amenities {
  margin-bottom: 1.2rem;
  background: white;
  padding: 1rem 1.3rem;
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
}
.area-highlights h4, .area-scores h4, .area-amenities h4 {
  margin: 0 0 0.6rem;
  color: var(--purple-deep);
  font-size: 0.95rem;
  font-weight: 700;
}
.area-highlights ul { margin: 0; padding-right: 1.4rem; }
.area-highlights li { margin-bottom: 0.3rem; line-height: 1.5; }

.score-row {
  display: grid;
  grid-template-columns: 130px 1fr 50px;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.score-label { color: var(--text-soft); font-weight: 600; }
.score-bar {
  height: 10px;
  background: var(--tint-purple);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}
.score-fill {
  height: 100%;
  background: var(--grad-sunset);
  border-radius: 5px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.score-val {
  font-weight: 800;
  color: var(--purple-deep);
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.amenity-chip {
  background: var(--tint-purple);
  color: var(--purple-deep);
  padding: 0.35rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(139,92,246,0.2);
}
.amenity-chip strong { font-weight: 800; }

.area-sources {
  font-size: 0.85rem;
  color: var(--text-soft);
  margin-top: 0.8rem;
}
.area-sources a {
  margin-left: 0.6rem;
  padding: 0.3rem 0.7rem;
  background: white;
  border-radius: 6px;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
}

/* ============================================================ FETCH STATUS ============================================================ */
.fetch-status {
  margin: 1rem 0;
  padding: 1rem 1.3rem;
  border-radius: var(--r);
  font-weight: 600;
  animation: slideIn 0.3s ease;
}
.fetch-loading {
  background: linear-gradient(135deg, var(--tint-purple), var(--tint-indigo));
  color: var(--purple-deep);
  padding: 1rem;
  border-radius: var(--r-sm);
  text-align: center;
}
.fetch-success {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  color: #047857;
  padding: 1rem;
  border-radius: var(--r-sm);
  border: 2px solid var(--emerald);
}
.fetch-warning {
  background: var(--tint-amber);
  color: #92400e;
  padding: 0.8rem 1rem;
  border-radius: var(--r-sm);
  margin-top: 0.5rem;
  font-size: 0.9rem;
}
.fetch-error {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  color: #991b1b;
  padding: 1rem;
  border-radius: var(--r-sm);
  border: 2px solid var(--rose);
}

/* ============================================================ AI INSIGHTS ============================================================ */
.ai-insights {
  margin: 2rem 0;
  padding: 2.2rem;
  background: linear-gradient(135deg, #f5f3ff 0%, #fdf2f8 50%, #fff7ed 100%);
  border-radius: var(--r-lg);
  border: 3px solid white;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.5s;
  position: relative;
  overflow: hidden;
}
.ai-insights::before {
  content: '🤖';
  position: absolute;
  top: -10px; left: 20px;
  font-size: 5rem;
  opacity: 0.1;
  pointer-events: none;
}
.ai-insights h3 {
  margin-top: 0;
  font-size: 1.4rem;
}
.ai-score {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0.5rem 0 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.ai-score .score-num {
  background: var(--grad-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.7rem;
}
.ai-indicators {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.8rem;
  margin: 0.8rem 0;
}
.ai-indicator {
  padding: 1rem 1.2rem;
  border-radius: var(--r);
  border-right: 5px solid;
  background: white;
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}
.ai-indicator strong { font-size: 1rem; }
.ai-indicator.opp-high { background: linear-gradient(135deg,#d1fae5,#a7f3d0); border-color: var(--emerald); color: #065f46; }
.ai-indicator.opp-over { background: linear-gradient(135deg,#fee2e2,#fecaca); border-color: var(--rose); color: #991b1b; }
.ai-indicator.opp-fair { background: linear-gradient(135deg,#dbeafe,#bfdbfe); border-color: var(--indigo); color: #1e40af; }
.ai-indicator.trend-up { background: linear-gradient(135deg,#dcfce7,#bbf7d0); border-color: var(--emerald); color: #14532d; }
.ai-indicator.trend-down { background: linear-gradient(135deg,#fef3c7,#fde68a); border-color: var(--amber); color: #78350f; }
.ai-indicator.trend-stable { background: linear-gradient(135deg,#e0e7ff,#c7d2fe); border-color: var(--indigo); color: #312e81; }

.row-source.ref { background: #fef3c7; color: #92400e; }
.comp-row.is-reference { border-style: dashed; opacity: 0.92; }
.ref-note { background: #fef3c7 !important; color: #92400e !important; font-size: 0.72rem !important; font-weight: 700; }

.ai-opinion {
  background: white;
  padding: 1.3rem 1.5rem;
  border-radius: var(--r);
  border-right: 5px solid var(--purple);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
  font-weight: 500;
}
.ai-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 768px) { .ai-grid { grid-template-columns: 1fr; } }

.ai-card {
  padding: 1.2rem 1.4rem;
  border-radius: var(--r);
  background: white;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: all 0.2s;
}
.ai-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ai-card h4 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-weight: 800;
}
.ai-card ul { margin: 0; padding-right: 1.3rem; font-size: 0.92rem; line-height: 1.7; }
.ai-card li { margin-bottom: 0.4rem; }

.ai-card.strengths {
  background: linear-gradient(135deg, #d1fae5, #ecfdf5);
  border-color: var(--emerald);
}
.ai-card.strengths h4 { color: #047857; }
.ai-card.weaknesses {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: var(--amber);
}
.ai-card.weaknesses h4 { color: #92400e; }
.ai-card.market {
  background: linear-gradient(135deg, #dbeafe, #e0e7ff);
  border-color: var(--indigo);
}
.ai-card.market h4 { color: #1e40af; }
.ai-card.strategy {
  background: linear-gradient(135deg, #fed7aa, #fdba74);
  border-color: var(--orange);
}
.ai-card.strategy h4 { color: #9a3412; }
.ai-card.risks {
  background: linear-gradient(135deg, #fee2e2, #fecaca);
  border-color: var(--rose);
}
.ai-card.risks h4 { color: #991b1b; }

/* ============================================================ LEARNING BOX ============================================================ */
.learning-box {
  margin: 2rem 0;
  padding: 1.8rem 2rem;
  background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 100%);
  border-radius: var(--r-lg);
  color: white;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  animation: slideIn 0.5s;
}
.learning-box::before {
  content: '🧠';
  position: absolute;
  top: -10px; left: -10px;
  font-size: 8rem;
  opacity: 0.08;
  pointer-events: none;
  transform: rotate(-15deg);
}
.learning-box h3 {
  color: white;
  margin-top: 0;
  font-size: 1.3rem;
  position: relative;
  z-index: 1;
}
.learning-box h3::before { background: linear-gradient(135deg, #5b6cff, #818cf8); }
.learning-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.learn-stat {
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  padding: 1rem 1.2rem;
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  border: 1px solid rgba(255,255,255,0.18);
}
.learn-stat strong {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.learn-stat span {
  font-size: 0.82rem;
  opacity: 0.9;
  font-weight: 500;
}
.learning-box .muted { color: rgba(255,255,255,0.85) !important; }

/* utility */
.hidden { display: none !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--tint-purple); }
::-webkit-scrollbar-thumb {
  background: var(--grad-purple);
  border-radius: 6px;
  border: 2px solid var(--tint-purple);
}
::-webkit-scrollbar-thumb:hover { background: var(--grad-pink); }

/* Selection */
::selection { background: var(--purple); color: white; }

/* === Transit GTFS Box === */
.transit-gtfs-box { margin-top: 24px; padding: 24px; border-radius: 16px; background: linear-gradient(135deg,#0f172a,#1e293b); color: #e2e8f0; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.transit-gtfs-box h3 { margin: 0 0 12px; color: #fbbf24; font-size: 1.2rem; }
.tg-summary { font-size: 0.95rem; color: #cbd5e1; margin-bottom: 12px; }
.tg-highlight { background: rgba(251,191,36,0.15); padding: 10px 14px; border-radius: 10px; margin: 10px 0; border-right: 4px solid #fbbf24; }
.tg-stops { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 10px; margin: 14px 0; }
.tg-stop { background: rgba(255,255,255,0.05); padding: 10px 12px; border-radius: 8px; }
.tg-stop-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.tg-stop-meta { display: flex; gap: 8px; font-size: 0.85rem; color: #94a3b8; }
.tg-dist { color: #fbbf24; font-weight: 600; }
.tg-code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px; }
.tg-footer { font-size: 0.8rem; color: #64748b; margin-top: 10px; text-align: center; }

/* === Compare Cities === */
.compare-result { margin-top: 24px; }
.cmp-winners { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 12px; margin-bottom: 18px; }
.cmp-winners > div { padding: 12px 16px; background: linear-gradient(135deg,#fef3c7,#fde68a); border-radius: 10px; font-size: 0.95rem; color: #78350f; }
.cmp-table-wrap { overflow-x: auto; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.cmp-table { width: 100%; border-collapse: collapse; background: white; }
.cmp-table th, .cmp-table td { padding: 12px 14px; text-align: right; border-bottom: 1px solid #e5e7eb; }
.cmp-table th { background: linear-gradient(135deg,#5b6cff,#818cf8); color: white; font-weight: 600; }
.cmp-table tr:hover { background: #f9fafb; }
.cmp-label { font-weight: 600; color: #4b5563; background: #f3f4f6; }
.cmp-winner { color: #f59e0b; font-size: 1.1rem; }
.cmp-footer { margin-top: 12px; font-size: 0.85rem; color: #6b7280; text-align: center; }

/* === Excel import === */
.excel-import-area { margin: 14px 0; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.excel-import-status { margin-top: 12px; padding: 14px; border-radius: 10px; }
.excel-import-status .fetch-success { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #065f46; padding: 12px; border-radius: 8px; line-height: 1.7; }
.excel-import-status .fetch-error { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #991b1b; padding: 12px; border-radius: 8px; }
.kb-status { margin-top: 20px; padding: 16px; background: linear-gradient(135deg, #ede9fe, #ddd6fe); border-radius: 12px; }
.kb-status h4 { margin: 0 0 12px; color: #4a5be5; }
.kb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kb-stat { background: white; padding: 10px 14px; border-radius: 8px; display: flex; flex-direction: column; gap: 4px; }
.kb-stat span { font-size: 0.85rem; color: #6b7280; }
.kb-stat strong { color: #4a5be5; font-size: 1.4rem; }

/* RMI Monitor */
.rmi-monitor-status { background: white; padding: 14px; border-radius: 10px; margin-top: 12px; }
.rmi-row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #f3f4f6; }
.rmi-row:last-child { border-bottom: none; }
.rmi-row span { color: #6b7280; }
.rmi-alerts { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e5e7eb; }
.rmi-alerts h5 { margin: 0 0 8px; color: #4b5563; }
.rmi-alert { background: linear-gradient(135deg, #fef3c7, #fde68a); padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; font-size: 0.9rem; color: #78350f; }
.rmi-alert small { display: block; color: #92400e; opacity: 0.8; margin-top: 4px; }

/* Gov import status */
.gov-import-status { background: white; padding: 14px; border-radius: 10px; margin-top: 12px; }
.gi-summary { padding: 10px 14px; background: linear-gradient(135deg, #d1fae5, #a7f3d0); border-radius: 8px; margin-bottom: 12px; color: #065f46; }
.gi-rows { display: flex; flex-direction: column; gap: 6px; }
.gi-row { display: flex; justify-content: space-between; padding: 8px 12px; background: #f9fafb; border-radius: 6px; font-size: 0.9rem; }
.gi-row strong { color: #4b5563; }
.gi-row span { color: #6b7280; }

/* ============================================================
   DARK MODE — Complete Override (all elements readable)
   ============================================================ */
body.dark-mode {
  background: #0f172a !important;
  color: #f1f5f9 !important;
}

/* Panels & containers */
body.dark-mode .panel,
body.dark-mode .form-section,
body.dark-mode .settings-section,
body.dark-mode .card,
body.dark-mode .info-box,
body.dark-mode .gov-card,
body.dark-mode .archive-card,
body.dark-mode .method-card,
body.dark-mode .area-info-display,
body.dark-mode .results,
body.dark-mode .breakdown,
body.dark-mode .pro-comparison,
body.dark-mode .pro-impact-box,
body.dark-mode .pro-list-col,
body.dark-mode .deep-neighborhood {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

/* Tabs */
body.dark-mode .tabs { background: #1e293b !important; border-bottom: 1px solid #334155; }
body.dark-mode .tab { color: #cbd5e1 !important; }
body.dark-mode .tab.active {
  color: white !important;
  background: linear-gradient(135deg, #5b6cff, #818cf8) !important;
}

/* INPUTS — strong contrast */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid #475569 !important;
  caret-color: #ffffff;
}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: #94a3b8 !important;
}
body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  border-color: #818cf8 !important;
  background: #1e293b !important;
}
body.dark-mode option,
body.dark-mode datalist { background: #1e293b !important; color: #f1f5f9 !important; }

/* Text colors */
body.dark-mode label,
body.dark-mode .field label,
body.dark-mode p, body.dark-mode li,
body.dark-mode .muted,
body.dark-mode strong, body.dark-mode em,
body.dark-mode small {
  color: #f1f5f9 !important;
}
body.dark-mode .muted { color: #cbd5e1 !important; }
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3,
body.dark-mode h4, body.dark-mode h5 {
  color: #ffffff !important;
}

/* Buttons */
body.dark-mode .btn-secondary {
  background: #334155 !important;
  color: #f1f5f9 !important;
  border-color: #475569 !important;
}
body.dark-mode .btn-secondary:hover { background: #475569 !important; }
body.dark-mode .btn-primary {
  background: linear-gradient(135deg, #5b6cff, #818cf8) !important;
  color: white !important;
}

/* Tables */
body.dark-mode table,
body.dark-mode th, body.dark-mode td {
  background: transparent;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}
body.dark-mode thead th {
  background: #1e293b !important;
  color: #ffffff !important;
}
body.dark-mode tbody tr:hover {
  background: #334155 !important;
}

/* Light-colored backgrounds inside dark mode → fix */
body.dark-mode .gi-row,
body.dark-mode .gi-summary,
body.dark-mode .rmi-monitor-status,
body.dark-mode .gov-import-status,
body.dark-mode .ns-stat,
body.dark-mode .dn-stat,
body.dark-mode .pro-comp-row.your,
body.dark-mode .pro-comp-row.area,
body.dark-mode .pro-comp-row.city,
body.dark-mode .pro-impact-card,
body.dark-mode .pro-list-item,
body.dark-mode .dn-metric,
body.dark-mode .dn-rooms-table tbody tr {
  background: #1a2332 !important;
  color: #f1f5f9 !important;
}

/* Specific element fixes */
body.dark-mode .pro-hero {
  background: linear-gradient(135deg, #1e293b 0%, #1a2332 100%) !important;
  border-color: #334155 !important;
}
body.dark-mode .pro-hero-label,
body.dark-mode .pro-hero-range,
body.dark-mode .pro-hero-subtitle { color: #cbd5e1 !important; }
body.dark-mode .pro-hero-ppsm {
  background: #334155 !important;
  color: #a5b4fc !important;
}

/* Tags */
body.dark-mode .pro-comp-tag.base { background: rgba(91,108,255,0.25) !important; color: #a5b4fc !important; }
body.dark-mode .pro-comp-tag.expensive { background: rgba(239,68,68,0.2) !important; color: #fca5a5 !important; }
body.dark-mode .pro-comp-tag.cheap { background: rgba(16,185,129,0.2) !important; color: #6ee7b7 !important; }
body.dark-mode .pro-comp-tag.neutral { background: rgba(148,163,184,0.2) !important; color: #cbd5e1 !important; }

/* Field labels and texts inside cards */
body.dark-mode .field,
body.dark-mode .field input,
body.dark-mode .field label {
  color: #f1f5f9 !important;
}

/* Make sure links are visible */
body.dark-mode a { color: #a5b4fc !important; }
body.dark-mode a:hover { color: #c7cdff !important; }

/* SVG/icons */
body.dark-mode .reliability-ring,
body.dark-mode .ns-trend-svg,
body.dark-mode .dn-trend-svg {
  background: #0f172a !important;
}

/* === HARD OVERRIDE: any white background → dark === */
body.dark-mode [style*="background: white"],
body.dark-mode [style*="background:white"],
body.dark-mode [style*="background-color: white"],
body.dark-mode [style*="background-color:white"],
body.dark-mode [style*="background: #fff"],
body.dark-mode [style*="background:#fff"] {
  background: #1e293b !important;
  color: #f1f5f9 !important;
}

/* All field-related elements in property/report tabs */
body.dark-mode .field,
body.dark-mode .field > *,
body.dark-mode #tab-property *,
body.dark-mode #tab-report *,
body.dark-mode .report-options,
body.dark-mode .report-options *,
body.dark-mode .options,
body.dark-mode .options *,
body.dark-mode label,
body.dark-mode .checkbox,
body.dark-mode .toggle {
  color: #f1f5f9 !important;
}

/* Override any specific white card */
body.dark-mode .card,
body.dark-mode .balcony-row,
body.dark-mode .arch-card,
body.dark-mode .arch-details,
body.dark-mode .building-file,
body.dark-mode .bf-section,
body.dark-mode .ns-stat,
body.dark-mode .ns-comparison,
body.dark-mode .pro-list-col,
body.dark-mode .pro-impact-card,
body.dark-mode .pro-list-item,
body.dark-mode .nb-card,
body.dark-mode .nb-hero,
body.dark-mode .nb-metric,
body.dark-mode .nb-school,
body.dark-mode .nb-demo,
body.dark-mode .nb-planning,
body.dark-mode .nb-dna-item,
body.dark-mode .nb-trend-svg,
body.dark-mode .dn-rooms-table,
body.dark-mode .dn-txn-table,
body.dark-mode .cmp-table,
body.dark-mode .pro-comparison,
body.dark-mode .pro-impact-box,
body.dark-mode .deep-neighborhood {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

/* Report - print preview area */
body.dark-mode #reportPreview,
body.dark-mode #reportPreview *,
body.dark-mode .report-preview,
body.dark-mode .report-preview * {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

/* Report option checkboxes */
body.dark-mode input[type="checkbox"] + label,
body.dark-mode input[type="radio"] + label {
  color: #f1f5f9 !important;
}

/* === FINAL CATCH-ALL: Force dark on ALL white containers === */
body.dark-mode div,
body.dark-mode section,
body.dark-mode label,
body.dark-mode span,
body.dark-mode button {
  /* Don't change all, just kill stale white bg + ensure text contrast */
}

/* Specific overrides for checkbox-style cards used in property/report */
body.dark-mode .feat-checkbox,
body.dark-mode .feature-tag,
body.dark-mode .feature-pill,
body.dark-mode .toggle-card,
body.dark-mode .tag-checkbox,
body.dark-mode .direction-tag,
body.dark-mode label.checkbox-card,
body.dark-mode label.feat,
body.dark-mode .field-row,
body.dark-mode .balcony-row,
body.dark-mode .add-balcony-btn {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #475569 !important;
}
body.dark-mode .feat-checkbox.active,
body.dark-mode .feature-tag.active,
body.dark-mode .feature-pill.active,
body.dark-mode .toggle-card.active,
body.dark-mode .tag-checkbox.checked,
body.dark-mode .direction-tag.active,
body.dark-mode label.feat.checked,
body.dark-mode label:has(input:checked) {
  background: linear-gradient(135deg, #5b6cff, #818cf8) !important;
  color: white !important;
  border-color: transparent !important;
}

/* The report option panels — checkboxes have white labels */
body.dark-mode #tab-report label,
body.dark-mode #tab-report .checkbox-label,
body.dark-mode #tab-report .toggle,
body.dark-mode #tab-report .option {
  color: #f1f5f9 !important;
  background: transparent !important;
}

/* Force all light-colored backgrounds in dark mode */
body.dark-mode *[class*="white"]:not(.dark-toggle),
body.dark-mode label > input[type="checkbox"],
body.dark-mode label > input[type="radio"] {
  background-color: #1e293b !important;
}

/* Force every visible label with white background to be dark */
body.dark-mode label {
  background-color: transparent !important;
  color: #f1f5f9 !important;
}
body.dark-mode label.btn,
body.dark-mode label.tag {
  background-color: #1e293b !important;
}

/* Make ALL text in property tab readable */
body.dark-mode #tab-property,
body.dark-mode #tab-property *:not(input):not(textarea):not(select) {
  color: #f1f5f9 !important;
}
body.dark-mode #tab-property h2,
body.dark-mode #tab-property h3,
body.dark-mode #tab-property h4 {
  color: #ffffff !important;
}

/* All tabs need text contrast */
body.dark-mode #tab-property .field,
body.dark-mode #tab-report .field,
body.dark-mode #tab-comparables .field,
body.dark-mode #tab-valuation .field {
  background: transparent !important;
}

/* Checkboxes themselves */
body.dark-mode input[type="checkbox"],
body.dark-mode input[type="radio"] {
  accent-color: #5b6cff;
  filter: invert(0) brightness(1.1);
}

/* Warning boxes that have yellow background */
body.dark-mode .warning-box,
body.dark-mode .bf-warning,
body.dark-mode div[style*="fef3c7"],
body.dark-mode div[style*="fde68a"] {
  background: linear-gradient(135deg, #422006, #3a1a05) !important;
  color: #fcd34d !important;
  border-color: #ca8a04 !important;
}

/* Dark mode toggle button */
.dark-toggle {
  position: fixed; top: 12px; left: 12px; z-index: 1000;
  background: rgba(255,255,255,0.9); border: none; cursor: pointer;
  border-radius: 50%; width: 44px; height: 44px; font-size: 22px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
body.dark-mode .dark-toggle { background: rgba(30, 41, 59, 0.9); color: #fbbf24; }

/* ============================================================
   MOBILE RESPONSIVENESS
   ============================================================ */
@media (max-width: 768px) {
  .panel { padding: 14px !important; margin: 8px 4px !important; }
  .tabs { overflow-x: auto; flex-wrap: nowrap !important; gap: 4px; }
  .tab { font-size: 0.85rem; padding: 8px 12px; white-space: nowrap; min-width: max-content; }
  .grid-3, .grid-2 { grid-template-columns: 1fr !important; }
  .field input, .field select { font-size: 16px; /* iOS zoom prevention */ }
  h1 { font-size: 1.5rem !important; }
  h2 { font-size: 1.2rem !important; }
  .btn-primary.big, .btn-secondary.big { font-size: 1rem; padding: 12px 20px; }
  .actions { flex-direction: column !important; gap: 8px; }
  .actions button { width: 100%; }
  .cmp-table { font-size: 0.85rem; }
  .tg-stops { grid-template-columns: 1fr; }
  .dark-toggle { width: 38px; height: 38px; font-size: 18px; top: 8px; left: 8px; }
}

/* ============================================================
   Confidence Display
   ============================================================ */
.confidence-box {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-radius: 12px; padding: 16px; margin: 16px 0;
}
body.dark-mode .confidence-box { background: linear-gradient(135deg, #064e3b, #065f46); color: #d1fae5; }
.confidence-bar-container { background: rgba(0,0,0,0.1); height: 10px; border-radius: 5px; overflow: hidden; margin: 8px 0; }
.confidence-bar-fill { height: 100%; background: linear-gradient(90deg, #ef4444, #f59e0b, #10b981); border-radius: 5px; }
.explanation-factors { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.explanation-factors div { padding: 6px 12px; background: rgba(255,255,255,0.5); border-radius: 6px; font-size: 0.9rem; }
body.dark-mode .explanation-factors div { background: rgba(0,0,0,0.3); }

/* === Neighborhood Stats Box === */
.neighborhood-stats-box {
  margin-top: 24px; padding: 24px;
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border-radius: 16px; box-shadow: 0 6px 20px rgba(20,184,166,0.15);
}
body.dark-mode .neighborhood-stats-box { background: linear-gradient(135deg, #134e4a, #0f766e); color: #d1fae5; }
.neighborhood-stats-box h3 { margin: 0 0 12px; color: #0f766e; }
body.dark-mode .neighborhood-stats-box h3 { color: #5eead4; }
.ns-summary { font-size: 0.95rem; color: #134e4a; margin-bottom: 14px; line-height: 1.6; }
body.dark-mode .ns-summary { color: #a7f3d0; }
.ns-comparison { background: white; border-radius: 10px; padding: 12px; margin: 12px 0; }
body.dark-mode .ns-comparison { background: rgba(0,0,0,0.3); }
.ns-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; }
.ns-tag { padding: 4px 10px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; }
.ns-tag.expensive { background: #fee2e2; color: #991b1b; }
.ns-tag.cheap { background: #d1fae5; color: #065f46; }
.ns-tag.avg { background: #e5e7eb; color: #4b5563; }
.ns-section { margin-top: 14px; }
.ns-section h4 { margin: 0 0 8px; font-size: 0.95rem; color: #0f766e; }
body.dark-mode .ns-section h4 { color: #5eead4; }
.ns-yearly { display: flex; gap: 6px; align-items: flex-end; height: 120px; padding: 8px; background: white; border-radius: 10px; }
body.dark-mode .ns-yearly { background: rgba(0,0,0,0.3); }
.ns-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; height: 100%; }
.ns-bar-fill { width: 80%; background: linear-gradient(180deg, #14b8a6, #0d9488); border-radius: 4px 4px 0 0; min-height: 8px; }
.ns-bar-year { font-size: 0.7rem; color: #6b7280; }
.ns-bar-val { font-size: 0.75rem; color: #134e4a; font-weight: 600; }
body.dark-mode .ns-bar-val { color: #5eead4; }
.ns-stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px,1fr)); gap: 10px; margin-top: 12px; }
.ns-stat { background: white; padding: 12px; border-radius: 10px; text-align: center; }
body.dark-mode .ns-stat { background: rgba(0,0,0,0.3); }
.ns-stat-num { font-size: 1.4rem; font-weight: 700; color: #0f766e; }
body.dark-mode .ns-stat-num { color: #5eead4; }
.ns-stat.good .ns-stat-num { color: #059669; }
.ns-stat.fair .ns-stat-num { color: #d97706; }
.ns-stat.down .ns-stat-num { color: #dc2626; }
.ns-stat-label { font-size: 0.8rem; color: #6b7280; margin-top: 4px; }
.ns-footer { font-size: 0.8rem; color: #6b7280; margin-top: 10px; text-align: center; font-style: italic; }
.ns-note { padding: 12px; background: #fef3c7; border-radius: 8px; color: #78350f; }

/* ============================================================
   PROFESSIONAL VALUATION UI (Madlan-inspired but better)
   ============================================================ */
.pro-hero {
  background: linear-gradient(135deg, #ffffff 0%, #faf8f4 100%);
  border: 2px solid rgba(107, 142, 125, 0.15);
  border-radius: 20px;
  padding: 32px 24px;
  text-align: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 28px rgba(30, 58, 95, 0.08);
}
body.dark-mode .pro-hero {
  background: linear-gradient(135deg, #243447 0%, #1a2332 100%);
  border-color: rgba(107, 142, 125, 0.25);
}
.pro-hero-label {
  font-size: 1rem;
  color: #6b7280;
  margin-bottom: 8px;
}
.pro-hero-price {
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, #1e3a5f 0%, #3d7d7a 50%, #6b8e7d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  margin-bottom: 8px;
}
@media (max-width: 768px) { .pro-hero-price { font-size: 2.5rem; } }
.pro-hero-range {
  font-size: 1rem;
  color: #4b5563;
  margin-bottom: 12px;
}
body.dark-mode .pro-hero-range { color: #cbd5e1; }
.pro-hero-ppsm {
  display: inline-block;
  background: linear-gradient(135deg, #eef4f0, #d6e4dc);
  color: #4f6b5e;
  padding: 8px 18px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 14px;
}
body.dark-mode .pro-hero-ppsm { background: rgba(107, 142, 125, 0.25); color: #b8d4c4; }
.pro-hero-subtitle {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.pro-confidence-bar { margin-top: 18px; }
.pro-conf-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #9ca3af;
  margin-bottom: 6px;
}
.pro-conf-track {
  position: relative;
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #10b981 0%, #facc15 50%, #ef4444 100%);
  margin-bottom: 10px;
}
.pro-conf-marker {
  position: absolute;
  top: -4px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid #1f2937;
}
.pro-conf-result {
  font-weight: 700;
  font-size: 1.05rem;
}
.pro-conf-result.high { color: #059669; }
.pro-conf-result.medium { color: #d97706; }
.pro-conf-result.low { color: #dc2626; }

/* ===  Comparison row (your / area / city) === */
.pro-comparison {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
body.dark-mode .pro-comparison { background: #1e293b; }
.pro-comparison h3 { margin: 0 0 16px; color: #4a5be5; }
body.dark-mode .pro-comparison h3 { color: #a5b4fc; }
.pro-comp-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
}
.pro-comp-row.your { background: linear-gradient(135deg, #ede9fe, #fce7f3); }
.pro-comp-row.area { background: #f0fdf4; }
.pro-comp-row.city { background: #f1f5f9; }
body.dark-mode .pro-comp-row.your { background: rgba(139,92,246,0.2); }
body.dark-mode .pro-comp-row.area { background: rgba(34,197,94,0.15); }
body.dark-mode .pro-comp-row.city { background: rgba(100,116,139,0.2); }
.pro-comp-label { font-weight: 600; }
.pro-comp-value { font-weight: 800; font-size: 1.05rem; }
.pro-comp-tag {
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.pro-comp-tag.base { background: rgba(91,33,182,0.15); color: #4a5be5; }
.pro-comp-tag.expensive { background: #fee2e2; color: #991b1b; }
.pro-comp-tag.cheap { background: #d1fae5; color: #065f46; }
.pro-comp-tag.neutral { background: #e5e7eb; color: #4b5563; }
.pro-comp-footnote { font-size: 0.9rem; color: #6b7280; margin-top: 10px; padding-right: 14px; }
.pro-comp-label-bottom {
  font-size: 0.85rem;
  color: #9ca3af;
  text-align: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f3f4f6;
}

/* === Impact factor cards === */
.pro-impact-box {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
body.dark-mode .pro-impact-box { background: #1e293b; }
.pro-impact-box h3 { margin: 0 0 16px; color: #4a5be5; }
body.dark-mode .pro-impact-box h3 { color: #a5b4fc; }
.pro-impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}
.pro-impact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
}
.pro-impact-card.positive { background: #f0fdf4; border-color: #86efac; }
.pro-impact-card.negative { background: #fef2f2; border-color: #fca5a5; }
.pro-impact-card.neutral { background: #fffbeb; border-color: #fde68a; }
body.dark-mode .pro-impact-card.positive { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.3); }
body.dark-mode .pro-impact-card.negative { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); }
body.dark-mode .pro-impact-card.neutral { background: rgba(250,204,21,0.15); border-color: rgba(250,204,21,0.3); }
.pro-impact-icon { font-size: 2rem; }
.pro-impact-body { flex: 1; }
.pro-impact-title { font-weight: 700; }
.pro-impact-desc { font-size: 0.9rem; color: #6b7280; margin-top: 2px; }
body.dark-mode .pro-impact-desc { color: #cbd5e1; }
.pro-impact-tag {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.pro-impact-tag.positive { background: #10b981; color: white; }
.pro-impact-tag.negative { background: #ef4444; color: white; }
.pro-impact-tag.neutral { background: #f59e0b; color: white; }

/* === Split lists: active vs sold === */
.pro-split-lists {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 768px) {
  .pro-split-lists { grid-template-columns: 1fr; }
}
.pro-list-col {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}
body.dark-mode .pro-list-col { background: #1e293b; }
.pro-list-col h3 {
  margin: 0 0 14px;
  font-size: 1rem;
  color: #4a5be5;
  padding-bottom: 10px;
  border-bottom: 2px solid #f3f4f6;
}
body.dark-mode .pro-list-col h3 { color: #a5b4fc; border-bottom-color: #334155; }
.pro-list-item {
  padding: 12px 14px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #f9fafb;
  border-right: 4px solid #8b5cf6;
}
body.dark-mode .pro-list-item { background: #334155; border-right-color: #a78bfa; }
.pro-list-price {
  font-size: 1.2rem;
  font-weight: 800;
  color: #4a5be5;
}
body.dark-mode .pro-list-price { color: #a5b4fc; }
.pro-list-details {
  font-size: 0.9rem;
  color: #4b5563;
  margin-top: 4px;
}
body.dark-mode .pro-list-details { color: #cbd5e1; }
.pro-list-addr {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 4px;
}
.pro-list-date {
  font-size: 0.8rem;
  color: #059669;
  font-weight: 600;
  margin-top: 4px;
}
.pro-list-tag {
  display: inline-block;
  font-size: 0.75rem;
  background: #ddd6fe;
  color: #4a5be5;
  padding: 2px 8px;
  border-radius: 4px;
  margin-top: 4px;
}

/* ============================================================
   DEEP NEIGHBORHOOD PROFILE (Madlan-inspired)
   ============================================================ */
.deep-neighborhood {
  background: white;
  border-radius: 18px;
  padding: 28px;
  margin: 24px 0;
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
}
body.dark-mode .deep-neighborhood { background: #1e293b; }
.dn-header { border-bottom: 2px solid #f3f4f6; padding-bottom: 14px; margin-bottom: 16px; }
.dn-header h2 { margin: 0; color: #0f766e; }
body.dark-mode .dn-header h2 { color: #5eead4; }
.dn-character { color: #6b7280; font-size: 1rem; margin-top: 6px; }
.dn-description { color: #4b5563; line-height: 1.7; margin-bottom: 20px; }
body.dark-mode .dn-description { color: #cbd5e1; }

.dn-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.dn-metric {
  text-align: center;
  padding: 14px;
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border-radius: 12px;
}
body.dark-mode .dn-metric { background: linear-gradient(135deg, #134e4a, #0f766e); }
.dn-metric-icon { font-size: 1.5rem; margin-bottom: 4px; }
.dn-metric-val { font-size: 1.4rem; font-weight: 800; color: #0f766e; }
body.dark-mode .dn-metric-val { color: #5eead4; }
.dn-metric-label { font-size: 0.8rem; color: #6b7280; margin-top: 2px; }

.dn-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid #f3f4f6; }
body.dark-mode .dn-section { border-top-color: #334155; }
.dn-section h4 { margin: 0 0 12px; font-size: 1.05rem; color: #0f766e; }
body.dark-mode .dn-section h4 { color: #5eead4; }

.dn-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.dn-stat {
  text-align: center;
  padding: 10px;
  background: #f9fafb;
  border-radius: 8px;
}
body.dark-mode .dn-stat { background: #334155; }
.dn-stat strong { display: block; font-size: 1.2rem; color: #0f766e; }
body.dark-mode .dn-stat strong { color: #5eead4; }
.dn-stat span { font-size: 0.8rem; color: #6b7280; }

.dn-rooms-table, .dn-txn-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.dn-rooms-table th, .dn-rooms-table td,
.dn-txn-table th, .dn-txn-table td {
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
}
body.dark-mode .dn-rooms-table th, body.dark-mode .dn-rooms-table td,
body.dark-mode .dn-txn-table th, body.dark-mode .dn-txn-table td {
  border-bottom-color: #334155;
}
.dn-rooms-table thead, .dn-txn-table thead {
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: white;
}
.dn-rooms-table thead th, .dn-txn-table thead th {
  font-weight: 600;
  font-size: 0.85rem;
}
.dn-rooms-table tbody tr:hover, .dn-txn-table tbody tr:hover {
  background: #f9fafb;
}
body.dark-mode .dn-rooms-table tbody tr:hover, body.dark-mode .dn-txn-table tbody tr:hover {
  background: #334155;
}

.dn-table-wrap { overflow-x: auto; }

.dn-trend-svg {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  background: #f9fafb;
  padding: 8px;
}
body.dark-mode .dn-trend-svg { background: #334155; }
.dn-trend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 4px;
}
.dn-trend-range {
  text-align: center;
  font-size: 0.85rem;
  color: #0f766e;
  font-weight: 600;
  margin-top: 6px;
}

.dn-suitability { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.dn-tag {
  background: linear-gradient(135deg, #ccfbf1, #99f6e4);
  color: #0f766e;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
}
body.dark-mode .dn-tag { background: rgba(20,184,166,0.2); color: #5eead4; }

.dn-dna-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 8px;
}
.dn-dna-item {
  display: grid;
  grid-template-columns: 1fr 80px 30px;
  gap: 10px;
  align-items: center;
  padding: 8px 12px;
  background: #f9fafb;
  border-radius: 8px;
  font-size: 0.9rem;
}
body.dark-mode .dn-dna-item { background: #334155; }
.dn-dna-bar { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
body.dark-mode .dn-dna-bar { background: #475569; }
.dn-dna-fill { height: 100%; background: linear-gradient(90deg, #14b8a6, #0d9488); border-radius: 3px; }
.dn-dna-item strong { text-align: left; color: #0f766e; }
body.dark-mode .dn-dna-item strong { color: #5eead4; }

.dn-summary-text {
  margin-top: 20px;
  padding: 14px;
  background: linear-gradient(135deg, #f0fdfa, #ccfbf1);
  border-radius: 12px;
  color: #134e4a;
  font-size: 0.9rem;
  line-height: 1.6;
}
body.dark-mode .dn-summary-text {
  background: linear-gradient(135deg, #134e4a, #0f766e);
  color: #d1fae5;
}

/* ============================================================
   NEIGHBORHOOD TAB — Madlan-style rich profile
   ============================================================ */
.nb-hero {
  background: linear-gradient(135deg, #fafafa, #eef0ff);
  border-radius: 16px;
  padding: 32px 24px;
  margin-bottom: 24px;
  border: 1px solid #e5e7eb;
}
body.dark-mode .nb-hero {
  background: linear-gradient(135deg, #1e293b, #1a2332) !important;
  border-color: #334155 !important;
}
.nb-hero h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  color: #5b6cff;
}
body.dark-mode .nb-hero h1 { color: #a5b4fc !important; }
.nb-character {
  font-size: 1.1rem;
  color: #6b7280;
  margin-bottom: 12px;
}
.nb-description {
  color: #4b5563;
  line-height: 1.7;
  margin-bottom: 16px;
}
body.dark-mode .nb-character,
body.dark-mode .nb-description { color: #cbd5e1 !important; }
.nb-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.nb-tag {
  background: white;
  border: 1px solid #c7cdff;
  color: #4a5be5;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
}
body.dark-mode .nb-tag {
  background: rgba(91,108,255,0.2) !important;
  border-color: rgba(91,108,255,0.4) !important;
  color: #a5b4fc !important;
}

.nb-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.nb-metric {
  background: white;
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid #e5e7eb;
}
body.dark-mode .nb-metric {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.nb-metric.m-primary { border-color: #c7cdff; }
.nb-metric.m-success { border-color: #a7f3d0; }
.nb-metric.m-warning { border-color: #fde68a; }
.nb-metric.m-info { border-color: #bae6fd; }
.nb-metric.m-neutral { border-color: #e5e7eb; }
.nb-metric-icon { font-size: 1.5rem; margin-bottom: 6px; }
.nb-metric-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: #111827;
  line-height: 1.2;
}
body.dark-mode .nb-metric-val { color: #ffffff !important; }
.nb-metric.m-primary .nb-metric-val { color: #4a5be5; }
.nb-metric.m-success .nb-metric-val { color: #047857; }
.nb-metric.m-warning .nb-metric-val { color: #b45309; }
.nb-metric.m-info .nb-metric-val { color: #0e7490; }
body.dark-mode .nb-metric.m-primary .nb-metric-val { color: #a5b4fc !important; }
body.dark-mode .nb-metric.m-success .nb-metric-val { color: #6ee7b7 !important; }
body.dark-mode .nb-metric.m-warning .nb-metric-val { color: #fcd34d !important; }
body.dark-mode .nb-metric.m-info .nb-metric-val { color: #67e8f9 !important; }
.nb-metric-label {
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 4px;
}
body.dark-mode .nb-metric-label { color: #cbd5e1 !important; }

.nb-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
body.dark-mode .nb-card {
  background: #1e293b !important;
  border-color: #334155 !important;
}
.nb-card h3 {
  margin: 0 0 16px;
  color: #5b6cff;
  font-size: 1.1rem;
}
body.dark-mode .nb-card h3 { color: #a5b4fc !important; }

.nb-table {
  width: 100%;
  border-collapse: collapse;
}
.nb-table th, .nb-table td {
  padding: 12px;
  text-align: center;
  border-bottom: 1px solid #f3f4f6;
}
.nb-table thead {
  background: linear-gradient(135deg, #5b6cff, #818cf8);
  color: white;
}
.nb-table thead th { color: white; font-weight: 600; }
.nb-table tbody tr:hover { background: #f9fafb; }
body.dark-mode .nb-table th, body.dark-mode .nb-table td {
  border-bottom-color: #334155 !important;
  color: #f1f5f9 !important;
}
body.dark-mode .nb-table tbody tr:hover { background: #334155 !important; }

.nb-trend-svg {
  width: 100%;
  height: 160px;
  background: linear-gradient(180deg, #f9fafb, #ffffff);
  border-radius: 10px;
  padding: 12px;
}
body.dark-mode .nb-trend-svg {
  background: linear-gradient(180deg, #0f172a, #1e293b) !important;
}
.nb-trend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #6b7280;
  margin-top: 8px;
}

.nb-dna-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
}
.nb-dna-item {
  display: grid;
  grid-template-columns: 1fr 90px 30px;
  gap: 12px;
  align-items: center;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 8px;
}
body.dark-mode .nb-dna-item { background: #0f172a !important; }
.nb-dna-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
}
body.dark-mode .nb-dna-bar { background: #475569 !important; }
.nb-dna-fill {
  height: 100%;
  background: linear-gradient(90deg, #5b6cff, #818cf8);
  border-radius: 4px;
}
.nb-dna-item strong {
  text-align: center;
  font-weight: 700;
  color: #5b6cff;
}
body.dark-mode .nb-dna-item strong { color: #a5b4fc !important; }

.nb-schools-list { display: flex; flex-direction: column; gap: 8px; }
.nb-school {
  padding: 12px 14px;
  background: #f9fafb;
  border-radius: 8px;
  border-right: 4px solid #5b6cff;
}
body.dark-mode .nb-school { background: #0f172a !important; }
.nb-school-name { font-weight: 600; }
.nb-school-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 0.88rem;
  color: #6b7280;
}
.nb-school-meta span { padding-left: 8px; padding-right: 8px; border-left: 1px solid #e5e7eb; }
.nb-school-meta span:first-child { border-left: none; padding-right: 0; }

.nb-demo-grid, .nb-planning-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.nb-demo, .nb-planning {
  padding: 14px;
  background: #f9fafb;
  border-radius: 10px;
  text-align: center;
}
body.dark-mode .nb-demo, body.dark-mode .nb-planning { background: #0f172a !important; }
.nb-demo strong, .nb-planning strong {
  display: block;
  font-size: 1.3rem;
  color: #5b6cff;
  margin-bottom: 4px;
}
body.dark-mode .nb-demo strong, body.dark-mode .nb-planning strong { color: #a5b4fc !important; }
.nb-demo span, .nb-planning span {
  font-size: 0.85rem;
  color: #6b7280;
}
body.dark-mode .nb-demo span, body.dark-mode .nb-planning span { color: #cbd5e1 !important; }

.nb-transport { display: flex; flex-wrap: wrap; gap: 8px; }
.nb-tag-transport {
  background: #eef0ff;
  color: #4a5be5;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
}
body.dark-mode .nb-tag-transport {
  background: rgba(91,108,255,0.2) !important;
  color: #a5b4fc !important;
}

.nb-summary {
  margin-top: 20px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #eef0ff, #c7cdff);
  border-radius: 14px;
  color: #4a5be5;
  line-height: 1.7;
  font-size: 0.95rem;
}
body.dark-mode .nb-summary {
  background: linear-gradient(135deg, #1e1b4b, #312e81) !important;
  color: #c7cdff !important;
}

/* ============================================================
   AUTO-ANALYZE PROGRESS
   ============================================================ */
.auto-analyze-progress {
  margin-top: 20px;
  padding: 28px;
  background: linear-gradient(135deg, #eef0ff, #ffffff);
  border-radius: 18px;
  border: 2px solid #c7cdff;
  box-shadow: 0 8px 24px rgba(91,108,255,0.12);
}
body.dark-mode .auto-analyze-progress {
  background: linear-gradient(135deg, #1e293b, #1a2332) !important;
  border-color: #5b6cff !important;
}
.aa-header { text-align: center; margin-bottom: 24px; }
.aa-header h3 { margin: 12px 0 6px; color: #4a5be5; font-size: 1.4rem; }
body.dark-mode .aa-header h3 { color: #a5b4fc !important; }
.aa-header p { color: #6b7280; margin: 0; }
body.dark-mode .aa-header p { color: #cbd5e1 !important; }
.aa-spinner-large {
  width: 60px; height: 60px;
  border: 5px solid #c7cdff;
  border-top-color: #5b6cff;
  border-radius: 50%;
  animation: aa-spin 1s linear infinite;
  margin: 0 auto 12px;
}
@keyframes aa-spin { to { transform: rotate(360deg); } }
.aa-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.aa-step {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  background: white;
  border-radius: 10px;
  font-size: 0.95rem;
  transition: all 0.3s;
}
body.dark-mode .aa-step { background: #0f172a !important; }
.aa-step.done {
  background: #d1fae5 !important;
  color: #065f46;
}
body.dark-mode .aa-step.done {
  background: rgba(16,185,129,0.2) !important;
  color: #6ee7b7 !important;
}
.aa-step.fail {
  background: #fee2e2 !important;
  color: #991b1b;
}
.aa-step.loading {
  background: #fef3c7;
  color: #92400e;
}
body.dark-mode .aa-step.loading {
  background: rgba(245,158,11,0.2) !important;
  color: #fcd34d !important;
}
.aa-icon { font-size: 1.4rem; text-align: center; }
.aa-text { font-weight: 500; }
.aa-status { font-size: 1.2rem; text-align: center; }
.aa-success {
  padding: 18px;
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border-radius: 12px;
  color: #065f46;
  font-weight: 600;
  text-align: center;
  font-size: 1.05rem;
}
body.dark-mode .aa-success {
  background: linear-gradient(135deg, #064e3b, #065f46) !important;
  color: #6ee7b7 !important;
}

/* Quick search overlay (Cmd+K) */
.quick-search-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 9999;
  display: flex; align-items: flex-start; justify-content: center; padding-top: 100px;
}
.quick-search-overlay.hidden { display: none; }
.quick-search-box {
  background: white; border-radius: 14px; padding: 20px;
  width: 90%; max-width: 600px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.quick-search-box input {
  width: 100%; padding: 14px; font-size: 1.1rem;
  border: 2px solid #e5e7eb; border-radius: 10px;
}
.quick-search-results { margin-top: 12px; max-height: 400px; overflow-y: auto; }
.quick-search-result { padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.quick-search-result:hover { background: #f3f4f6; }
body.dark-mode .quick-search-box { background: #1e293b; color: #e2e8f0; }
body.dark-mode .quick-search-result:hover { background: #334155; }

/* === Neighborhood Banner === */
.neighborhood-banner { padding: 14px 18px; border-radius: 12px; margin: 16px 0; font-size: 0.95rem; line-height: 1.5; }
.neighborhood-banner.found { background: linear-gradient(135deg,#d1fae5,#a7f3d0); color: #065f46; border-right: 4px solid #10b981; }
.neighborhood-banner.not-found { background: linear-gradient(135deg,#fef3c7,#fde68a); color: #78350f; border-right: 4px solid #f59e0b; }
.neighborhood-banner .ns-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 0.9rem; font-weight: 600; }
.neighborhood-banner .ns-stats span { background: rgba(255,255,255,0.5); padding: 4px 10px; border-radius: 8px; }


/* === Transit GTFS Box === */
.transit-gtfs-box { margin-top: 24px; padding: 24px; border-radius: 16px; background: linear-gradient(135deg,#0f172a,#1e293b); color: #e2e8f0; box-shadow: 0 10px 30px rgba(0,0,0,0.25); }
.transit-gtfs-box h3 { margin: 0 0 12px; color: #fbbf24; font-size: 1.2rem; }
.tg-summary { font-size: 0.95rem; color: #cbd5e1; margin-bottom: 12px; }
.tg-highlight { background: rgba(251,191,36,0.15); padding: 10px 14px; border-radius: 10px; margin: 10px 0; border-right: 4px solid #fbbf24; }
.tg-stops { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 10px; margin: 14px 0; }
.tg-stop { background: rgba(255,255,255,0.05); padding: 10px 12px; border-radius: 8px; }
.tg-stop-name { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.tg-stop-meta { display: flex; gap: 8px; font-size: 0.85rem; color: #94a3b8; }
.tg-dist { color: #fbbf24; font-weight: 600; }
.tg-code { background: rgba(255,255,255,0.08); padding: 2px 6px; border-radius: 4px; }
.tg-footer { font-size: 0.8rem; color: #64748b; margin-top: 10px; text-align: center; }

/* === Compare Cities === */
.compare-result { margin-top: 24px; }
.cmp-winners { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 12px; margin-bottom: 18px; }
.cmp-winners > div { padding: 12px 16px; background: linear-gradient(135deg,#fef3c7,#fde68a); border-radius: 10px; font-size: 0.95rem; }
.cmp-table-wrap { overflow-x: auto; border-radius: 12px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.cmp-table { width: 100
/* ============================================================ DARK MODE CONTRAST OVERRIDES v3 ============================================================ */
/* Force consistent dark backgrounds for ALL input-like elements on every panel */
body.dark-mode input[type="text"],
body.dark-mode input[type="number"],
body.dark-mode input[type="tel"],
body.dark-mode input[type="email"],
body.dark-mode input[type="url"],
body.dark-mode input[type="search"],
body.dark-mode input[type="date"],
body.dark-mode input:not([type]),
body.dark-mode select,
body.dark-mode textarea {
  background: #0f172a !important;
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  border: 1px solid #334155 !important;
  -webkit-text-fill-color: #f1f5f9 !important;
}
body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder { color: #64748b !important; opacity: 1; }
body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus { border-color: #6366f1 !important; outline: none !important; }

/* Autofill (browser yellow/white) */
body.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill:hover,
body.dark-mode input:-webkit-autofill:focus,
body.dark-mode input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 30px #0f172a inset !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  caret-color: #f1f5f9 !important;
  background-clip: content-box !important;
}

/* Field labels everywhere */
body.dark-mode label,
body.dark-mode .field label,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode .muted { color: #cbd5e1 !important; }

/* Direction grid (כיווני אוויר) – must be visible in dark mode */
body.dark-mode .direction-grid {
  background: #0b1220 !important;
  border: 1px solid #1e293b;
}
body.dark-mode .direction-grid label {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border: 1.5px solid #334155 !important;
}
body.dark-mode .direction-grid label:hover {
  background: #334155 !important;
  border-color: #6366f1 !important;
}
body.dark-mode .direction-grid label:has(input:checked) {
  background: linear-gradient(135deg, #6366f1, #4f46e5) !important;
  color: #ffffff !important;
  border-color: #6366f1 !important;
}

/* Autocomplete suggestion box */
body.dark-mode .autocomplete-suggestions,
body.dark-mode .ac-suggestions {
  background: #1e293b !important;
  border: 1px solid #334155 !important;
  color: #f1f5f9 !important;
}
body.dark-mode .autocomplete-suggestion,
body.dark-mode .ac-item {
  color: #f1f5f9 !important;
  background: transparent !important;
}
body.dark-mode .autocomplete-suggestion:hover,
body.dark-mode .ac-item:hover,
body.dark-mode .ac-item.active {
  background: #334155 !important;
}

/* Report options checkboxes */
body.dark-mode .report-options label,
body.dark-mode .report-options .field {
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}

/* Empty report placeholder area */
body.dark-mode #reportPreview,
body.dark-mode .report-preview {
  background: #0f172a !important;
  color: #f1f5f9 !important;
  border: 1px solid #1e293b !important;
}

/* ============================================================ FORCE FORM FIELD COLORS v4 ============================================================ */
/* Light mode (default) - explicit colors so they're never invisible */
.field input,
.field select,
.field textarea {
  background-color: #ffffff !important;
  color: #1e293b !important;
}
.field input::placeholder,
.field textarea::placeholder { color: #94a3b8 !important; opacity: 1; }
.field label { color: #334155 !important; }

/* Chrome autofill - always force background+text to match field colors */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #ffffff inset !important;
  -webkit-text-fill-color: #1e293b !important;
  caret-color: #1e293b !important;
  background-clip: content-box !important;
  transition: background-color 9999s ease-in-out 0s;
}

/* Dark mode overrides – win because they're later in cascade */
body.dark-mode .field input,
body.dark-mode .field select,
body.dark-mode .field textarea {
  background-color: #0f172a !important;
  color: #f1f5f9 !important;
  border-color: #334155 !important;
}
body.dark-mode .field label { color: #cbd5e1 !important; }
body.dark-mode .field input::placeholder,
body.dark-mode .field textarea::placeholder { color: #64748b !important; }

body.dark-mode input:-webkit-autofill,
body.dark-mode input:-webkit-autofill:hover,
body.dark-mode input:-webkit-autofill:focus,
body.dark-mode input:-webkit-autofill:active,
body.dark-mode textarea:-webkit-autofill,
body.dark-mode select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #0f172a inset !important;
  -webkit-text-fill-color: #f1f5f9 !important;
  caret-color: #f1f5f9 !important;
}

/* ============================================================ REPORT EMPTY STATE ============================================================ */
.report-empty-state {
  padding: 40px;
  text-align: center;
  background: #ffffff;
  border-radius: 14px;
  border: 2px dashed #c7cdff;
  color: #4a5be5;
  margin: 20px 0;
}
.report-empty-state h2 { color: #4a5be5; }
body.dark-mode .report-empty-state {
  background: #1e293b !important;
  border-color: #4f46e5 !important;
  color: #c7d2fe !important;
}
body.dark-mode .report-empty-state h2 { color: #a5b4fc !important; }
body.dark-mode .report-empty-state strong { color: #ffffff !important; }

/* ============================================================ FINAL DARK MODE NUCLEAR FIX v5 ============================================================ */
/* Highest possible specificity + !important to defeat any cascade conflicts */

html body.dark-mode .direction-grid,
body.dark-mode #tab-property .direction-grid,
body.dark-mode .field .direction-grid,
body.dark-mode .panel .direction-grid {
  background-color: #0f172a !important;
  background: #0f172a !important;
  border: 1px solid #334155 !important;
  color: #f1f5f9 !important;
}

html body.dark-mode .direction-grid label,
body.dark-mode #tab-property .direction-grid label,
body.dark-mode .field .direction-grid label {
  background-color: #1e293b !important;
  background: #1e293b !important;
  color: #f1f5f9 !important;
  border: 1.5px solid #475569 !important;
}

html body.dark-mode .direction-grid label:hover,
body.dark-mode #tab-property .direction-grid label:hover {
  background-color: #334155 !important;
  background: #334155 !important;
  color: #ffffff !important;
  border-color: #6366f1 !important;
}

/* Generic textareas - cover everything */
html body.dark-mode textarea,
body.dark-mode .field textarea,
body.dark-mode #tab-property textarea,
body.dark-mode #tab-property .field textarea,
body.dark-mode #areaHighlights,
body.dark-mode #notes,
body.dark-mode #brokerRationale {
  background-color: #0f172a !important;
  background: #0f172a !important;
  color: #f1f5f9 !important;
  border: 1px solid #334155 !important;
}

/* All text inside property tab - one rule to dominate them all */
html body.dark-mode #tab-property,
html body.dark-mode #tab-property *:not(input):not(textarea):not(select):not(button):not(.btn-primary):not(.btn-secondary):not(.btn-link) {
  color: #e2e8f0 !important;
}
html body.dark-mode #tab-property h2,
html body.dark-mode #tab-property h3,
html body.dark-mode #tab-property h4 {
  color: #ffffff !important;
}
html body.dark-mode #tab-property .muted {
  color: #94a3b8 !important;
}

/* Field labels everywhere in dark mode */
html body.dark-mode .field label,
html body.dark-mode label {
  color: #cbd5e1 !important;
}

/* Map preview - sometimes shows as white in dark mode */
html body.dark-mode .map-preview {
  background: #1e293b !important;
  border-color: #334155 !important;
}

/* Tab buttons in dark mode */
html body.dark-mode .tab:not(.active) {
  color: #cbd5e1 !important;
  background: transparent !important;
}

/* Detailed sections (details/summary) */
html body.dark-mode details,
html body.dark-mode summary {
  color: #cbd5e1 !important;
  background: transparent !important;
}

/* Strict banner */
html body.dark-mode .strict-banner {
  background: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #475569 !important;
}
