/* Modern UI Design System for HCAD Property Tax App */

/* CSS Custom Properties (Design Tokens) */
:root {
  /* Color Palette - PURPLE THEME (CompUp Style) */
  --primary-50: #faf5ff;
  --primary-100: #f3e8ff;
  --primary-200: #e9d5ff;
  --primary-300: #d8b4fe;
  --primary-400: #c084fc;
  --primary-500: #a855f7;
  --primary-600: #9333ea;
  --primary-700: #7c3aed;
  --primary-800: #6b21a8;
  --primary-900: #581c87;
  
  --secondary-50: #f0f9ff;
  --secondary-100: #e0f2fe;
  --secondary-200: #bae6fd;
  --secondary-300: #7dd3fc;
  --secondary-400: #38bdf8;
  --secondary-500: #0ea5e9;
  --secondary-600: #0284c7;
  --secondary-700: #0369a1;
  --secondary-800: #075985;
  --secondary-900: #0c4a6e;
  
  --success-50: #f0fdf4;
  --success-100: #dcfce7;
  --success-200: #bbf7d0;
  --success-300: #86efac;
  --success-400: #4ade80;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;
  --success-800: #166534;
  --success-900: #14532d;
  
  --warning-50: #fffbeb;
  --warning-100: #fef3c7;
  --warning-200: #fde68a;
  --warning-300: #fcd34d;
  --warning-400: #fbbf24;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;
  --warning-800: #92400e;
  --warning-900: #78350f;
  
  --error-50: #fef2f2;
  --error-100: #fee2e2;
  --error-200: #fecaca;
  --error-300: #fca5a5;
  --error-400: #f87171;
  --error-500: #ef4444;
  --error-600: #dc2626;
  --error-700: #b91c1c;
  --error-800: #991b1b;
  --error-900: #7f1d1d;
  
  /* Neutral Colors */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Typography */
  --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-family-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  
  /* Font Sizes */
  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */
  --text-5xl: 3rem;       /* 48px */
  --text-6xl: 3.75rem;    /* 60px */
  
  /* Spacing */
  --space-0: 0;
  --space-1: 0.25rem;     /* 4px */
  --space-2: 0.5rem;      /* 8px */
  --space-3: 0.75rem;     /* 12px */
  --space-4: 1rem;        /* 16px */
  --space-5: 1.25rem;     /* 20px */
  --space-6: 1.5rem;      /* 24px */
  --space-8: 2rem;        /* 32px */
  --space-10: 2.5rem;     /* 40px */
  --space-12: 3rem;       /* 48px */
  --space-16: 4rem;       /* 64px */
  --space-20: 5rem;       /* 80px */
  --space-24: 6rem;       /* 96px */
  
  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 0.125rem;
  --radius-base: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-base: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-inner: inset 0 2px 4px 0 rgb(0 0 0 / 0.05);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Z-Index Scale */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;
  --z-toast: 1080;
}

/* CSS Reset & Base Styles */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-tab-size: 4;
  tab-size: 4;
}

body {
  font-family: var(--font-family-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--gray-900);
  background-color: var(--gray-50);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Utility Classes */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.invisible {
  visibility: hidden;
}

.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* Layout Components */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--secondary-50) 100%);
}

/* Modern Header */
.modern-header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  transition: all var(--transition-base);
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--primary-600);
  text-decoration: none;
}

.logo-icon {
  width: 2rem;
  height: 2rem;
  background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-lg);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav-link {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  color: var(--gray-600);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
  position: relative;
}

.nav-link:hover {
  color: var(--primary-600);
  background-color: var(--primary-50);
}

.nav-link.active {
  color: var(--primary-600);
  background-color: var(--primary-100);
}

.cta-button {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.cta-button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  padding: var(--space-2);
  color: var(--gray-600);
  font-size: var(--text-xl);
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.mobile-menu-btn:hover {
  background-color: var(--gray-100);
  color: var(--gray-900);
}

/* Hero Section */
.hero-section {
  position: relative;
  min-height: calc(100vh - 4rem);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8) var(--space-6);
  background: linear-gradient(135deg, 
    var(--primary-600) 0%, 
    var(--secondary-600) 50%, 
    var(--primary-800) 100%);
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grain)"/></svg>');
  opacity: 0.3;
}

/* Neighborhood illustration along the bottom horizon of the hero.
   Sits behind the content (z-index 0) but in front of the gradient. The
   line-art purple/blue glows against the dark gradient via screen blend. */
.hero-section::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  background-image: url('/static/img/hero-bg-neighborhood.png');
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  mix-blend-mode: screen;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  /* Fade the top edge of the illustration into the gradient so it doesn't
     look like a hard sticker at the seam. */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 100%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 100%);
}

/* On smaller screens the illustration was getting cropped at the sides;
   contain rather than cover so the full street stays visible. */
@media (max-width: 640px) {
  .hero-section::after {
    height: 32%;
    background-size: contain;
    opacity: 0.5;
  }
}

.hero-content {
  position: relative;
  text-align: center;
  max-width: 800px;
  z-index: 1;
}

.hero-title {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-6xl));
  font-weight: 800;
  color: white;
  margin-bottom: var(--space-6);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-subtitle {
  font-size: var(--text-xl);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: var(--space-12);
  line-height: 1.6;
  font-weight: 400;
}

/* Hero trust bar */
.hero-trust-bar {
  display: flex;
  justify-content: center;
  gap: var(--space-6);
  flex-wrap: wrap;
  margin-bottom: var(--space-8);
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.75);
  font-weight: 500;
}
.hero-trust-bar span {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}
.hero-trust-bar i {
  color: #fbbf24;
  font-size: 0.85rem;
}

/* Modern Search Container */
.search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

.search-wrapper {
  position: relative;
  background: white;
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-2xl);
  overflow: hidden;
  transition: all var(--transition-base);
}

.search-wrapper:focus-within {
  transform: translateY(-2px);
  box-shadow: 0 32px 64px -12px rgba(0, 0, 0, 0.25);
}

.search-input {
  width: 100%;
  padding: var(--space-5) var(--space-6);
  border: none;
  outline: none;
  font-size: var(--text-lg);
  font-weight: 500;
  color: var(--gray-900);
  background: transparent;
}

.search-input::placeholder {
  color: var(--gray-400);
  font-weight: 400;
}

.search-button {
  position: absolute;
  right: var(--space-2);
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-lg);
}

.search-button:hover {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  transform: translateY(-50%) scale(1.05);
}

/* Search Loading States */
.search-wrapper.search-loading {
  pointer-events: none;
  transition: all var(--transition-base);
}

.search-wrapper.search-typing {
  box-shadow: 0 16px 32px -8px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.search-wrapper.search-typing .search-input {
  border-left: 3px solid var(--primary-200);
}

.search-wrapper.search-loading .search-input {
  background: linear-gradient(90deg, #f8fafc 25%, #e2e8f0 50%, #f8fafc 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  color: var(--gray-500);
}

.search-wrapper.search-loading .search-input:disabled {
  cursor: not-allowed;
}

.search-button.loading {
  background: var(--primary-400) !important;
  cursor: not-allowed;
  transform: translateY(-50%) !important;
}

.search-button.loading:hover {
  background: var(--primary-400) !important;
  transform: translateY(-50%) !important;
}

.search-button.loading .fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Modal Loading Overlay */
.modal-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity var(--transition-base);
  pointer-events: none; /* Never intercept clicks — purely visual */
}

.modal-loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  display: none;
}

.modal-loading-content {
  text-align: center;
  padding: var(--space-8);
}

.loading-spinner {
  font-size: 2rem;
  color: var(--primary-500);
  margin-bottom: var(--space-4);
}

.loading-spinner .fa-spinner {
  animation: spin 1s linear infinite;
}

.loading-message {
  font-size: var(--text-lg);
  color: var(--gray-600);
  font-weight: 500;
}

/* ============================================================
   Savings Estimate Tab
   ============================================================ */

.savings-loading-state,
.savings-error-state {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-8) var(--space-6);
  color: var(--gray-500);
  font-size: var(--text-base);
}

.savings-loading-state i { color: var(--primary-500); font-size: 1.4rem; }
.savings-error-state i   { color: var(--red-500, #ef4444); font-size: 1.4rem; }

.savings-content {
  padding: var(--space-4) var(--space-2);
}

.savings-hero {
  background: linear-gradient(135deg, #0f4c35 0%, #1a6b4a 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-6) var(--space-8);
  color: #fff;
  text-align: center;
  margin-bottom: var(--space-5);
}

.savings-hero-label {
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
  margin-bottom: var(--space-2);
}

.savings-hero-amount {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-2);
}

.savings-hero-sub {
  font-size: var(--text-sm);
  opacity: 0.75;
}

.savings-confidence {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: var(--text-xs);
  border-radius: 999px;
  padding: 2px 10px;
  margin-top: var(--space-3);
  font-weight: 600;
}

.savings-confidence.high   { background: rgba(255,255,255,.2); color: #ffffff; }
.savings-confidence.medium { background: rgba(255,255,255,.15); color: #ffffff; }
.savings-confidence.low    { background: rgba(255,255,255,.1); color: #ffffff; }
.savings-confidence.none   { background: rgba(255,255,255,.1); color: #ffffff; }

.savings-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

.savings-stat-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  text-align: center;
}

.savings-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: var(--space-1);
}

.savings-stat-label {
  font-size: var(--text-xs);
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.savings-comps-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-3);
}

.savings-comp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--gray-50);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  font-size: var(--text-sm);
}

.savings-comp-addr {
  color: var(--gray-700);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.savings-comp-val {
  font-weight: 600;
  color: var(--green-700, #15803d);
  margin-left: var(--space-3);
  flex-shrink: 0;
}

/* ── Commercial notice ──────────────────────────────────────────────────── */
.commercial-notice {
  text-align: center;
  padding: var(--space-8) var(--space-6);
  color: var(--gray-700);
}
.commercial-notice-icon {
  font-size: 2.5rem;
  color: var(--gray-400);
  margin-bottom: var(--space-4);
}
.commercial-notice h3 {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--gray-800);
  margin-bottom: var(--space-3);
}
.commercial-notice p {
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--space-3);
}
.commercial-notice-tip {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: #92400e;
  text-align: left;
  margin-top: var(--space-4);
}
.commercial-notice-tip i { color: #f59e0b; margin-top: 2px; flex-shrink: 0; }

/* ── HCAD status block ───────────────────────────────────────────────────── */
.hcad-status-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--space-4) 0;
}
.hcad-status-header {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.hcad-status-badges { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-1); }
.hcad-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.hcad-badge--filed  { background: #dcfce7; color: #15803d; }
.hcad-badge--none   { background: #f1f5f9; color: #64748b; }
.hcad-badge--status { background: #eff6ff; color: #1d4ed8; }
.hcad-status-line {
  font-size: var(--text-xs);
  color: var(--gray-500);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

/* ── Condition analysis block ────────────────────────────────────────────── */
.condition-analysis-block {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-md);
  padding: var(--space-4);
  margin: var(--space-4) 0;
}
.condition-analysis-header {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.cond-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-3);
}
.cond-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cond-value {
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--gray-900);
}
.cond-label {
  font-size: 0.7rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.savings-cta {
  margin-top: var(--space-5);
  text-align: center;
}

.savings-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--primary-600);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-base);
}

.savings-cta-btn:hover { background: var(--primary-700); }

/* ============================================================
   Preview Report Tab
   ============================================================ */

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: var(--space-10) var(--space-6);
  color: var(--gray-400);
  text-align: center;
}

.preview-placeholder i { font-size: 2.5rem; }
.preview-placeholder p { font-size: var(--text-base); }

.preview-report-inner {
  padding: var(--space-2) 0;
}

/* The actual report preview card */
.report-preview-card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
  font-size: var(--text-sm);
}

.report-preview-header {
  background: var(--gray-900);
  color: #fff;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.report-preview-header h3 {
  font-size: var(--text-base);
  font-weight: 700;
  margin: 0;
  flex: 1;
}

.report-preview-badge {
  background: var(--primary-500);
  color: #fff;
  font-size: var(--text-xs);
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.report-section {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--gray-100);
}

.report-section:last-child { border-bottom: none; }

.report-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gray-500);
  margin-bottom: var(--space-2);
}

.report-section-body {
  color: var(--gray-700);
  line-height: 1.6;
}

/* Locked / blurred sections */
.report-section.locked {
  position: relative;
}

.report-section.locked .report-section-body {
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

.report-lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.6);
  backdrop-filter: blur(1px);
}

.report-lock-overlay i {
  font-size: 1.5rem;
  color: var(--gray-400);
}

.report-lock-overlay span {
  font-size: var(--text-xs);
  color: var(--gray-500);
  font-weight: 600;
}

.report-unlock-cta {
  padding: var(--space-5) var(--space-6);
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--gray-50));
  text-align: center;
  border-top: 1px solid var(--gray-200);
}

.report-unlock-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-6);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.15);
  transition: transform 0.15s, box-shadow 0.15s;
}

.report-unlock-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}

.report-unlock-subtext {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--gray-500);
}

/* Property Condition Form (inside protest flow) */
.condition-form {
  padding: var(--space-4) 0;
}

.condition-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.repair-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.repair-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  font-size: var(--text-sm);
}

.repair-item:hover { border-color: var(--primary-400); background: var(--primary-50, #eff6ff); }
.repair-item.selected { border-color: var(--primary-500); background: var(--primary-50, #eff6ff); }

.repair-item input[type="checkbox"] { accent-color: var(--primary-500); }
.repair-item i { color: var(--gray-400); font-size: 0.9rem; }
.repair-item.selected i { color: var(--primary-500); }

.condition-total-bar {
  background: var(--gray-900);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-4);
  font-size: var(--text-sm);
}

.condition-total-label { opacity: 0.7; }
.condition-total-amount { font-size: 1.2rem; font-weight: 800; }

/* ============================================================
   Property Condition Intake Modal
   ============================================================ */

.condition-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 100000;  /* must sit above property modal (99999) */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  opacity: 0;
  animation: overlayFadeIn 0.2s ease forwards;
}

@keyframes overlayFadeIn {
  to { opacity: 1; }
}

.condition-modal-overlay.hidden { display: none; }

.condition-modal {
  background: #fff;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.98);
  animation: modalSlideIn 0.22s ease forwards;
}

@keyframes modalSlideIn {
  to { transform: translateY(0) scale(1); }
}

.condition-modal-body {
  padding: var(--space-6);
  flex: 1;
}

.condition-intro {
  color: var(--gray-600);
  font-size: var(--text-sm);
  margin-bottom: var(--space-5);
  line-height: 1.6;
}

.condition-hint {
  color: var(--gray-500);
  font-size: var(--text-xs);
  margin-bottom: var(--space-3);
}

.form-row-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: var(--space-1);
}

.form-input {
  width: 100%;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--gray-800);
  background: var(--gray-50);
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-400);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.form-input:hover:not(:focus) {
  border-color: var(--gray-400);
}

textarea.form-input { resize: vertical; }

.condition-modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--gray-300);
  color: var(--gray-600);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.btn-outline:hover { border-color: var(--gray-500); color: var(--gray-800); }

/* =====================================================
   COMPARABLE PROPERTIES CUSTOMIZATION
   ===================================================== */

.comps-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-6);
  padding: var(--space-4);
  background: var(--gray-50);
  border-radius: var(--radius-lg);
}

.comps-controls {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.comps-count {
  font-size: var(--text-sm);
  font-weight: 500;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  background: var(--gray-100);
  color: var(--gray-700);
}

.comps-count.warning {
  background: var(--warning-50);
  color: var(--warning-700);
  border: 1px solid var(--warning-200);
}

.comps-count.good {
  background: var(--success-50);
  color: var(--success-700);
  border: 1px solid var(--success-200);
}

.comps-customization-panel {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  transition: all var(--transition-base);
}

.customization-header h4 {
  color: var(--gray-900);
  margin-bottom: var(--space-2);
}

.customization-header p {
  color: var(--gray-600);
  margin-bottom: var(--space-6);
}

.customization-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.search-replacement {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.comp-search-input {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
}

.comp-search-input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.customization-buttons {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}

/* Comparable Property Cards */
.comp-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
  transition: all var(--transition-base);
  position: relative;
}

.comp-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.comp-card.selected {
  border-color: var(--success-400);
  background: var(--success-50);
}

.comp-card.available {
  opacity: 0.7;
}

.comp-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-3);
}

.comp-card-header h4 {
  margin: 0;
  color: var(--gray-900);
  font-size: var(--text-lg);
  font-weight: 600;
}

.comp-card-actions {
  display: flex;
  gap: var(--space-2);
}

.comp-action-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.comp-action-btn.remove-btn {
  background: var(--danger-100);
  color: var(--danger-600);
}

.comp-action-btn.remove-btn:hover {
  background: var(--danger-200);
  transform: scale(1.1);
}

.comp-action-btn.add-btn {
  background: var(--success-100);
  color: var(--success-600);
}

.comp-action-btn.add-btn:hover {
  background: var(--success-200);
  transform: scale(1.1);
}

.comp-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.comp-details p {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--gray-700);
}

.comp-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.selected-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--success-600);
  font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
  .comps-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }
  
  .search-replacement {
    flex-direction: column;
  }
  
  .comp-search-input {
    width: 100%;
  }
  
  .customization-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .comp-details {
    grid-template-columns: 1fr;
  }
  
  .comp-card-footer {
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-start;
  }
}

/* Action Buttons */
.action-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin: var(--space-8) 0;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}

.action-divider::before,
.action-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.explore-button {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  font-size: var(--text-lg);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  transition: all var(--transition-base);
  cursor: pointer;
}

.explore-button:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Demoted "explore the map" link — no longer competes with the search CTA */
.explore-button-link {
  display: inline-block;
  margin-top: var(--space-6);
  background: transparent;
  border: none;
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-underline-offset: 3px;
  transition: text-decoration-color var(--transition-fast), background var(--transition-fast);
}
.explore-button-link:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration-color: #fff;
}
.explore-button-link .link-arrow {
  display: inline-block;
  margin-left: 0.25rem;
  transition: transform var(--transition-fast);
}
.explore-button-link:hover .link-arrow {
  transform: translateX(3px);
}

/* Label inside the primary search button so the CTA is unambiguous */
.search-button-label {
  font-weight: 600;
  font-size: var(--text-sm);
  white-space: nowrap;
}
@media (max-width: 640px) {
  .search-button-label { display: none; }
  .search-button { padding: var(--space-3); }
}

/* How-it-works strip */
.how-it-works-section {
  background: var(--gray-50, #f9fafb);
  padding: var(--space-12) var(--space-4);
}
.how-it-works-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  max-width: 1100px;
  margin: 0 auto;
}
@media (min-width: 768px) {
  .how-it-works-grid { grid-template-columns: repeat(3, 1fr); }
}
.how-step {
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-xl, 1rem);
  padding: var(--space-6);
  text-align: left;
}
.how-step-number {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-500, #3b82f6), var(--primary-700, #1d4ed8));
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
  font-size: 1rem;
}
.how-step h3 {
  font-size: 1.125rem;
  margin: 0 0 0.5rem;
  color: var(--gray-900, #111827);
}
.how-step p {
  margin: 0;
  color: var(--gray-600, #4b5563);
  line-height: 1.55;
  font-size: 0.95rem;
}

/* Feature cards ("Why this works") */
.features-section {
  padding: var(--space-16, 4rem) 1.5rem;
}
.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6, 1.5rem);
  max-width: 1100px;
  margin: 0 auto;
}
@media (min-width: 640px)  { .features-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .features-grid { grid-template-columns: repeat(4, 1fr); } }
.feature-card {
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius-xl, 1rem);
  padding: var(--space-6, 1.5rem);
  text-align: left;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(147, 51, 234, 0.12);
  border-color: #e9d5ff;
}
.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #faf5ff, #f3e8ff);
  color: #7c3aed;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}
.feature-card h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  color: var(--gray-900, #111827);
}
.feature-card p {
  margin: 0;
  color: var(--gray-600, #4b5563);
  line-height: 1.55;
  font-size: 0.9rem;
}

/* ── Site footer ─────────────────────────────────────────────────────────── */
.site-footer {
  background: #1a1622;
  color: rgba(255, 255, 255, 0.72);
  padding: 3rem 1.5rem 1.75rem;
  font-size: 0.875rem;
}
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.5fr 1fr 1fr;
}
@media (max-width: 720px) { .footer-inner { grid-template-columns: 1fr; gap: 1.75rem; } }
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: #fff;
  font-size: 1.05rem;
  margin-bottom: 0.75rem;
}
.footer-brand i { color: #c4b5fd; }
.footer-tagline { line-height: 1.6; max-width: 34ch; margin: 0; }
.footer-col h4 {
  color: #fff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 0.85rem;
}
.footer-col a {
  display: block;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  padding: 0.28rem 0;
  transition: color 0.15s;
}
.footer-col a:hover { color: #fff; }
.footer-legal {
  max-width: 1100px;
  margin: 2.25rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.55);
}
.footer-legal p { margin: 0 0 0.7rem; }
.footer-legal strong { color: rgba(255, 255, 255, 0.8); }
.footer-bottom {
  max-width: 1100px;
  margin: 1.25rem auto 0;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
}

/* ── Legal pages (Terms / Privacy) ───────────────────────────────────────── */
.legal-page {
  max-width: 780px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  color: var(--gray-700, #374151);
  line-height: 1.7;
}
.legal-page h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  color: var(--gray-900, #111827);
  margin: 0 0 0.4rem;
}
.legal-page .legal-updated {
  color: var(--gray-500, #6b7280);
  font-size: 0.85rem;
  margin-bottom: 2rem;
}
.legal-page h2 {
  font-size: 1.2rem;
  color: var(--gray-900, #111827);
  margin: 2rem 0 0.6rem;
}
.legal-page p, .legal-page li { font-size: 0.95rem; }
.legal-page ul { padding-left: 1.25rem; margin: 0.5rem 0; }
.legal-page li { margin-bottom: 0.4rem; }
.legal-note {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: 0.9rem;
  color: #6b21a8;
  margin: 1.5rem 0;
}

/* Map Section */
.map-section {
  position: relative;
  height: calc(100vh - 4rem);
  min-height: 600px;
  background: var(--gray-50);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.map-container {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 500px;
  flex: 1;
  background: transparent;
  display: flex;
  flex-direction: column;
}

#map {
  width: 100%;
  height: 100%;
  flex: 1;
  border-radius: 0;
  min-height: 500px;
  max-height: calc(100vh - 200px);
  background: var(--gray-50);
}

/* Enhanced Map Controls */
.map-controls {
  position: absolute;
  top: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-dropdown);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.control-group {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-xl);
  padding: var(--space-3);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.toggle-buttons {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: var(--space-1);
  gap: var(--space-1);
}

.toggle-btn {
  padding: var(--space-2) var(--space-4);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--gray-600);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.toggle-btn.active {
  background: white;
  color: var(--primary-600);
  box-shadow: var(--shadow-sm);
}

.back-button {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  color: var(--gray-700);
  border: none;
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.back-button:hover {
  background: white;
  transform: translateY(-1px);
  box-shadow: var(--shadow-xl);
}

/* Modern Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-4);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: white;
  border-radius: var(--radius-2xl);
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-2xl);
  transform: scale(0.95) translateY(20px);
  transition: all var(--transition-base);
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--gray-50), white);
}

.modal-header h2 {
  margin: 0;
  color: var(--gray-900);
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
}

.close-modal-btn {
  background: var(--gray-100);
  border: none;
  border-radius: var(--radius-full);
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--gray-500);
  font-size: var(--text-lg);
  transition: all var(--transition-fast);
}

.close-modal-btn:hover {
  background: var(--gray-200);
  color: var(--gray-700);
}

/* Modern Tabs */
.tabs {
  display: flex;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}

.tab-btn {
  flex: 1;
  padding: var(--space-4) var(--space-6);
  border: none;
  background: transparent;
  color: var(--gray-600);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.tab-btn:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}

.tab-btn.active {
  color: var(--primary-600);
  background: white;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary-500);
  border-radius: var(--radius-full);
}

.tab-content {
  padding: var(--space-6);
  max-height: 60vh;
  overflow-y: auto;
}

/* Property modal single-panel scroll wrapper (replaces tab-content) */
.modal-body-scroll {
  padding: var(--space-6);
  max-height: 65vh;
  overflow-y: auto;
}

/* Savings section divider inside modal */
.modal-savings-section {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--gray-200, #e5e7eb);
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
  animation: fadeInUp 0.3s ease-out;
}

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

/* Protest Evidence Tab Styles */
.evidence-container {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.evidence-container:hover {
  box-shadow: var(--shadow-md);
}

.evidence-header {
  background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
  padding: var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.evidence-header h3 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--gray-900);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.evidence-header h3::before {
  content: '📋';
  font-size: var(--text-lg);
}

.evidence-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.evidence-content {
  padding: var(--space-6);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.evidence-placeholder {
  text-align: center;
  color: var(--gray-500);
  background: var(--gray-50);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-xl);
  padding: var(--space-12) var(--space-8);
  width: 100%;
  max-width: 500px;
  transition: all var(--transition-fast);
}

.evidence-placeholder:hover {
  border-color: var(--primary-300);
  background: var(--primary-50);
  color: var(--primary-600);
}

.evidence-placeholder h4 {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: var(--space-3);
  color: inherit;
}

.evidence-placeholder p {
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: var(--space-4);
  color: inherit;
  opacity: 0.8;
}

.evidence-placeholder ul {
  text-align: left;
  font-size: var(--text-sm);
  color: inherit;
  opacity: 0.7;
  margin: 0;
  padding-left: var(--space-5);
}

.evidence-placeholder li {
  margin-bottom: var(--space-1);
}

/* Professional Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.btn-primary {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  border-color: var(--primary-500);
  box-shadow: var(--shadow-sm);
}

.btn.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  border-color: var(--primary-600);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn.btn-primary:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn.btn-secondary {
  background: white;
  color: var(--gray-700);
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.btn.btn-secondary:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-400);
  color: var(--gray-900);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn.btn-secondary:active {
  transform: translateY(0);
  background: var(--gray-100);
  box-shadow: var(--shadow-sm);
}

/* Button Sizes */
.btn.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  font-weight: 500;
}

.btn.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--text-base);
}

/* Button with Icons */
.btn .icon {
  font-size: 1em;
  line-height: 1;
}

.btn .icon:first-child {
  margin-right: var(--space-1);
  margin-left: calc(var(--space-1) * -1);
}

.btn .icon:last-child {
  margin-left: var(--space-1);
  margin-right: calc(var(--space-1) * -1);
}

/* Professional Report Styling */
.report-container {
  background: white;
  border-radius: var(--radius-xl);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin: var(--space-6) 0;
}

.report-header {
  background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
  color: white;
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
}

.report-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23dots)"/></svg>');
  opacity: 0.3;
}

.report-header-content {
  position: relative;
  z-index: 1;
}

.report-title {
  font-size: var(--text-2xl);
  font-weight: 800;
  margin: 0 0 var(--space-2) 0;
  letter-spacing: -0.02em;
}

.report-subtitle {
  font-size: var(--text-sm);
  opacity: 0.9;
  font-weight: 500;
  margin: 0;
}

.report-meta {
  background: var(--gray-50);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--gray-200);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
}

.report-meta-item {
  display: flex;
  flex-direction: column;
}

.report-meta-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-1);
}

.report-meta-value {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--gray-900);
}

.report-body {
  padding: var(--space-6);
  line-height: 1.7;
  font-size: var(--text-base);
  color: var(--gray-800);
}

.report-body h1,
.report-body h2,
.report-body h3,
.report-body h4,
.report-body h5,
.report-body h6 {
  color: var(--gray-900);
  font-weight: 700;
  margin: var(--space-6) 0 var(--space-3) 0;
  line-height: 1.3;
}

.report-body h1 { font-size: var(--text-2xl); }
.report-body h2 { font-size: var(--text-xl); }
.report-body h3 { font-size: var(--text-lg); }
.report-body h4 { font-size: var(--text-base); }

.report-body p {
  margin: 0 0 var(--space-4) 0;
}

.report-body ul,
.report-body ol {
  margin: 0 0 var(--space-4) 0;
  padding-left: var(--space-6);
}

.report-body li {
  margin-bottom: var(--space-2);
}

.report-body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
  font-size: var(--text-sm);
}

.report-body th,
.report-body td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--gray-200);
}

.report-body th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--gray-900);
}

.report-body tr:hover {
  background: var(--gray-50);
}

.report-footer {
  background: var(--gray-50);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--gray-200);
  font-size: var(--text-xs);
  color: var(--gray-600);
  text-align: center;
}

/* Evidence File Display */
.evidence-file {
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: var(--space-3) 0;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  transition: all var(--transition-fast);
}

.evidence-file:hover {
  border-color: var(--primary-300);
  background: var(--primary-50);
}

.evidence-file-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: var(--primary-100);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  font-size: var(--text-lg);
  flex-shrink: 0;
}

.evidence-file-info {
  flex: 1;
  min-width: 0;
}

.evidence-file-name {
  font-weight: 600;
  color: var(--gray-900);
  font-size: var(--text-sm);
  margin: 0 0 var(--space-1) 0;
  word-break: break-word;
}

.evidence-file-details {
  font-size: var(--text-xs);
  color: var(--gray-500);
  margin: 0;
}

.evidence-file-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* Enhanced Property Display */
.property-summary {
  background: linear-gradient(135deg, var(--gray-50), white);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  border: 1px solid var(--gray-200);
}

.value-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0;
}

.value-card {
  background: white;
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  text-align: center;
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.value-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.value-card.highlight {
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  color: white;
  border-color: var(--primary-400);
}

.value-card h4 {
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-2);
  opacity: 0.8;
}

.value-amount {
  font-size: var(--text-2xl);
  font-weight: 800;
  margin: 0;
}

/* Property Details — clean bordered list (label left, value right) */
.property-details-grid {
  display: flex;
  flex-direction: column;
  margin-top: var(--space-6);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow: hidden;
}

.detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  background: #fff;
  padding: 0.85rem 1.1rem;
  border: none;
  border-bottom: 1px solid var(--gray-100);
  border-radius: 0;
  transition: background var(--transition-fast);
}
.detail-item:nth-child(even) { background: var(--gray-50); }
.detail-item:last-child { border-bottom: none; }
.detail-item:hover { background: #faf5ff; box-shadow: none; }
.detail-item.enhanced-detail {
  background: #faf5ff;
  box-shadow: inset 3px 0 0 #9333ea;
}

.detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 0;
  flex-shrink: 0;
}

.detail-value {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--gray-900);
  text-align: right;
  word-break: break-word;
}

/* Loading States */
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12);
  color: var(--gray-500);
}

.spinner {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--gray-200);
  border-top-color: var(--primary-500);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: var(--space-4);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Enhanced Autocomplete */
.ui-autocomplete {
  background: #fff;
  border: 1px solid var(--gray-200, #e5e7eb);
  border-radius: 14px;
  box-shadow: 0 18px 46px rgba(17, 24, 39, 0.16);
  margin-top: 8px;
  padding: 6px;
  max-height: 340px;
  overflow-y: auto;
  z-index: var(--z-dropdown);
  list-style: none;
}

.ui-menu-item {
  padding: 0;
  border: none;
  cursor: pointer;
  list-style: none;
}

/* Each row is rendered as <div class="ac-row"> by app.js */
.ui-menu-item .ac-row,
.ui-menu-item > div {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.62rem 0.7rem;
  border-radius: 10px;
  font-size: 0.92rem;
  color: var(--gray-800, #1f2937);
  transition: background 0.12s, color 0.12s;
}
.ui-menu-item .ac-pin {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: #9333ea;
}
.ui-menu-item .ac-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}

.ui-menu-item:hover .ac-row,
.ui-menu-item:hover > div,
.ui-menu-item .ui-state-focus,
.ui-state-focus.ac-row {
  background: #faf5ff;
  color: #6b21a8;
}
.ui-menu-item:hover .ac-pin { color: #7c3aed; }

/* Responsive Design */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .hero-title {
    font-size: var(--text-3xl);
  }
  
  .hero-subtitle {
    font-size: var(--text-lg);
  }
  
  .search-wrapper {
    margin: 0 var(--space-4);
  }
  
  .map-controls {
    top: var(--space-4);
    right: var(--space-4);
  }
  
  .modal-content {
    margin: var(--space-4);
    max-height: calc(100vh - 2rem);
  }
  
  .value-comparison {
    grid-template-columns: 1fr;
  }
  
  .property-details-grid {
    grid-template-columns: 1fr;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus styles for accessibility */
*:focus {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

.nav-link:focus,
.cta-button:focus,
.search-button:focus,
.toggle-btn:focus,
.back-button:focus,
.close-modal-btn:focus,
.tab-btn:focus {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  :root {
    --primary-500: #1e40af;
    --gray-600: #000000;
    --gray-400: #404040;
  }
}

/* Property Actions Styling */
.property-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.create-protest-btn {
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.create-protest-btn:hover {
  background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.create-protest-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.create-protest-btn i {
  font-size: 1rem;
}

.mark-mine-btn {
  background: white;
  color: #374151;
  border: 2px solid #e5e7eb;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mark-mine-btn:hover {
  border-color: #16a34a;
  color: #16a34a;
}

/* ════════════════════════════════════════════════════════════════════════════
   PROPERTY MODAL — "clean data dashboard" restyle
   Scoped to #property-modal so it overrides the older colourful styling without
   affecting other modals. Crisp white, hairline dividers, numbers-first, one
   accent per purpose (purple = action, green = savings).
   ════════════════════════════════════════════════════════════════════════════ */
#property-modal .modal-content { max-width: 720px; border-radius: 18px; }
#property-modal .modal-header { padding: 1.2rem 1.5rem; border-bottom: 1px solid #eef0f3; }
#property-modal .modal-title { font-size: 1.05rem; font-weight: 700; color: #111827; letter-spacing: -0.01em; }
#property-modal .modal-body-scroll { padding: 1.5rem; }

/* Summary header — no more purple card */
#property-modal .property-summary { background: none; border: none; border-radius: 0; padding: 0; margin: 0 0 1.5rem; }
#property-modal .property-header { background: none; padding: 0; }
#property-modal .property-header h3 {
  font-size: 1.5rem; font-weight: 800; color: #111827;
  letter-spacing: -0.02em; margin: 0 0 0.4rem;
}
#property-modal .account-badge {
  display: inline-block; padding: 0; background: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem; color: #6b7280;
}
#property-modal .property-actions { margin-top: 1.1rem; gap: 0.6rem; }
#property-modal .create-protest-btn {
  background: #7c3aed; color: #fff; border: none; border-radius: 10px;
  padding: 0.7rem 1.25rem; font-weight: 600; font-size: 0.9rem; box-shadow: none;
}
#property-modal .create-protest-btn:hover { background: #6d28d9; transform: none; box-shadow: none; }
#property-modal .mark-mine-btn {
  background: #fff; color: #374151; border: 1px solid #d1d5db; border-radius: 10px;
  padding: 0.7rem 1.1rem; font-weight: 600; font-size: 0.9rem;
}
#property-modal .mark-mine-btn:hover { border-color: #7c3aed; color: #7c3aed; }

/* Value comparison — flat stat strip with hairline dividers */
#property-modal .value-comparison {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0 0 1.5rem;
  border: 1px solid #eef0f3; border-radius: 14px; overflow: hidden;
}
#property-modal .value-card {
  background: #fff; border: none; border-right: 1px solid #eef0f3; border-radius: 0;
  box-shadow: none; text-align: left; padding: 1rem 1.15rem;
}
#property-modal .value-card:last-child { border-right: none; }
#property-modal .value-card:hover { transform: none; box-shadow: none; background: #fafafa; }
#property-modal .value-card.highlight { background: #fff; color: inherit; border-color: #eef0f3; }
#property-modal .value-card h4 {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #6b7280; opacity: 1; margin: 0 0 0.35rem;
}
#property-modal .value-amount { font-size: 1.4rem; font-weight: 800; color: #111827; letter-spacing: -0.02em; }
/* Change (YoY) coloured by direction — increase is the unfavourable case */
#property-modal .value-amount.chg-up   { color: #dc2626; }
#property-modal .value-amount.chg-down { color: #059669; }
#property-modal .value-amount.chg-flat { color: #6b7280; }

/* Section labels group the panel into Assessment / Property details */
#property-modal .modal-section-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: #9ca3af; margin: 1.5rem 0 0.65rem;
}
#property-modal .property-summary { margin: 0 0 0.5rem; }

/* Force the three assessment cards to share the row evenly (no empty 4th slot) */
#property-modal .value-comparison { display: flex !important; }
#property-modal .value-card { flex: 1 1 0 !important; min-width: 0; }

/* Detail list — flat, no zebra */
#property-modal .property-details-grid { border-color: #eef0f3; border-radius: 14px; }
#property-modal .detail-item,
#property-modal .detail-item:nth-child(even) { background: #fff; border-bottom: 1px solid #f1f2f4; }
#property-modal .detail-item:hover { background: #fafafa; }
#property-modal .detail-label { color: #6b7280; }
#property-modal .detail-value { color: #111827; }

/* Savings — flat panel, green only on the number */
#property-modal .savings-hero {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 14px;
  padding: 1.25rem 1.4rem; text-align: left; color: inherit;
}
#property-modal .savings-hero-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: #15803d; margin-bottom: 0.25rem;
}
#property-modal .savings-hero-amount { font-size: 2.1rem; font-weight: 900; color: #059669; letter-spacing: -0.03em; line-height: 1; }
#property-modal .savings-hero-sub { font-size: 0.85rem; color: #4b5563; margin-top: 0.35rem; }
#property-modal .savings-confidence {
  display: inline-block; margin-top: 0.7rem; font-size: 0.72rem; font-weight: 600;
  padding: 0.2rem 0.6rem; border-radius: 100px; background: #fff; border: 1px solid #bbf7d0; color: #15803d;
}
#property-modal .savings-stats {
  grid-template-columns: repeat(3, 1fr); gap: 0; margin: 1.25rem 0;
  border: 1px solid #eef0f3; border-radius: 14px; overflow: hidden;
}
#property-modal .savings-stat-card {
  background: #fff; border: none; border-right: 1px solid #eef0f3; border-radius: 0;
  text-align: left; padding: 1rem 1.15rem;
}
#property-modal .savings-stat-card:last-child { border-right: none; }
#property-modal .savings-stat-value { font-size: 1.3rem; font-weight: 800; color: #111827; }
#property-modal .savings-stat-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b7280; }
#property-modal .savings-cta-btn {
  width: 100%; background: #7c3aed; color: #fff; border: none; border-radius: 10px;
  padding: 0.85rem 1.25rem; font-weight: 600; font-size: 0.92rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
}
#property-modal .savings-cta-btn:hover { background: #6d28d9; }

/* Savings now leads the modal (right under the header) — no mid-modal divider */
#property-modal .modal-savings-section {
  margin-top: 1rem;
  padding-top: 0;
  border-top: none;
}

/* Condition / HCAD status / comps — flat */
#property-modal .condition-analysis-block,
#property-modal .hcad-status-block {
  border: 1px solid #eef0f3; border-radius: 14px; padding: 1rem 1.15rem; margin-top: 1.25rem;
}
#property-modal .condition-analysis-header,
#property-modal .hcad-status-header {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #6b7280; margin-bottom: 0.75rem;
}
#property-modal .cond-metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 0.75rem; }
#property-modal .cond-metric { display: flex; flex-direction: column; }
#property-modal .cond-value { font-size: 1.1rem; font-weight: 800; color: #111827; }
#property-modal .cond-label { font-size: 0.72rem; color: #6b7280; }
#property-modal .savings-comps-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: #6b7280; margin: 1.25rem 0 0.5rem;
}
#property-modal .savings-comp-row {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: 0.55rem 0; border-bottom: 1px solid #f1f2f4; font-size: 0.88rem;
}
#property-modal .savings-comp-addr { color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#property-modal .savings-comp-val { color: #111827; font-weight: 700; flex-shrink: 0; }

@media (max-width: 560px) {
  #property-modal .value-comparison,
  #property-modal .savings-stats { grid-template-columns: 1fr; }
  #property-modal .value-card,
  #property-modal .savings-stat-card { border-right: none; border-bottom: 1px solid #eef0f3; }
  #property-modal .value-card:last-child,
  #property-modal .savings-stat-card:last-child { border-bottom: none; }
}

/* ════════════════════════════════════════════════════════════════════════════
   PROPERTY MODAL — SaaS redesign (hero savings, photo-first, fewer borders)
   ════════════════════════════════════════════════════════════════════════════ */

#property-modal .modal-body-scroll { padding: 0 0 1.5rem; }

/* ── Photo at the top — humans read pictures faster than tables ────────────── */
/* The gallery (.pg-gallery) sizes itself; we only round the top to match the
   modal and hide the slot when there's no image. Don't constrain its internals
   or the thumbnail strip gets clipped. */
#property-modal .modal-photo-top { width: 100%; margin: 0 0 1.25rem; }
#property-modal .modal-photo-top:empty { display: none; }
#property-modal .property-image-modal-container { width: 100%; }
/* Full-bleed photo sits flush below the header — square top reads cleaner */
#property-modal .property-image-modal-container .pg-main { border-radius: 0; }
/* Fallback single street-view image (no gallery script) */
#property-modal .property-image-modal-container > .property-modal-image,
#property-modal .property-image-modal-container > img.property-modal-image {
  width: 100%; height: 230px; object-fit: cover; display: block;
}

/* The body content (everything except the photo) gets the side padding */
#property-modal .property-summary,
#property-modal .modal-savings-section,
#property-modal .modal-section-label,
#property-modal .value-movement,
#property-modal .property-details-grid { margin-left: 1.5rem; margin-right: 1.5rem; }

/* ── Header ────────────────────────────────────────────────────────────────── */
#property-modal .property-pin { color: #7c3aed; font-size: 1.05rem; margin-right: 0.2rem; }
#property-modal .property-subline {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  font-size: 0.85rem; color: #6b7280; margin-top: 0.15rem;
}
#property-modal .property-subline-sep { color: #d1d5db; }
#property-modal .property-facts { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.8rem; }
#property-modal .property-fact {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: #f5f3ff; color: #5b21b6; border: 1px solid #ede9fe;
  font-size: 0.78rem; font-weight: 600; padding: 0.32rem 0.7rem; border-radius: 100px;
}
#property-modal .property-fact i { font-size: 0.72rem; opacity: 0.85; }

/* ── Savings hero — the single most dominant element ──────────────────────── */
#property-modal .savings-hero {
  background: linear-gradient(160deg, #ecfdf5 0%, #f0fdf4 100%);
  border: 1px solid #bbf7d0; border-radius: 18px;
  padding: 1.6rem 1.5rem; text-align: left; color: inherit;
}
#property-modal .savings-hero-label {
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: #15803d; margin-bottom: 0.35rem;
}
#property-modal .savings-hero-amount {
  font-size: 3.1rem; font-weight: 900; color: #059669;
  letter-spacing: -0.035em; line-height: 1;
}
#property-modal .savings-hero-per { font-size: 1.1rem; font-weight: 700; color: #10b981; letter-spacing: 0; margin-left: 0.15rem; }
#property-modal .savings-hero-sub { font-size: 0.9rem; color: #4b5563; margin-top: 0.5rem; max-width: 46ch; }

#property-modal .savings-confidence-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem 0.75rem; margin-top: 0.9rem;
}
#property-modal .savings-confidence {
  display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.74rem; font-weight: 700;
  padding: 0.28rem 0.7rem; border-radius: 100px; background: #fff; border: 1px solid #bbf7d0; color: #15803d;
}
#property-modal .savings-confidence .conf-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
#property-modal .savings-confidence.medium { color: #b45309; border-color: #fde68a; }
#property-modal .savings-confidence.low    { color: #6b7280; border-color: #e5e7eb; }
#property-modal .savings-confidence-why { font-size: 0.8rem; color: #4b5563; flex: 1 1 16ch; min-width: 16ch; }

/* ── Protest readiness score ──────────────────────────────────────────────── */
#property-modal .readiness-block {
  border: 1px solid #eef0f3; border-radius: 14px; padding: 1.1rem 1.25rem; margin-top: 1.25rem;
}
#property-modal .readiness-top { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
#property-modal .readiness-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: #6b7280;
}
#property-modal .readiness-tier {
  font-size: 0.74rem; font-weight: 700; padding: 0.22rem 0.65rem; border-radius: 100px;
}
#property-modal .readiness-tier--strong   { background: #dcfce7; color: #15803d; }
#property-modal .readiness-tier--solid    { background: #d1fae5; color: #047857; }
#property-modal .readiness-tier--moderate { background: #fef3c7; color: #b45309; }
#property-modal .readiness-tier--limited  { background: #f1f5f9; color: #64748b; }
#property-modal .readiness-scoreline { margin: 0.5rem 0 0.6rem; }
#property-modal .readiness-score { font-size: 2rem; font-weight: 900; color: #111827; letter-spacing: -0.03em; }
#property-modal .readiness-outof { font-size: 0.9rem; font-weight: 600; color: #9ca3af; margin-left: 0.25rem; }
#property-modal .readiness-bar { height: 8px; border-radius: 100px; background: #eef0f3; overflow: hidden; }
#property-modal .readiness-bar-fill { height: 100%; border-radius: 100px; transition: width 0.6s ease; }
#property-modal .readiness-bar-fill--strong   { background: #16a34a; }
#property-modal .readiness-bar-fill--solid    { background: #10b981; }
#property-modal .readiness-bar-fill--moderate { background: #f59e0b; }
#property-modal .readiness-bar-fill--limited  { background: #cbd5e1; }

/* ── Mini insight ─────────────────────────────────────────────────────────── */
#property-modal .savings-insight {
  display: flex; align-items: flex-start; gap: 0.6rem; margin-top: 1.25rem;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px;
  padding: 0.8rem 1rem; font-size: 0.85rem; color: #78350f; line-height: 1.45;
}
#property-modal .savings-insight i { color: #f59e0b; margin-top: 0.15rem; }
#property-modal .savings-insight strong { color: #92400e; }

/* ── Comp cards — Zillow-style proof ──────────────────────────────────────── */
#property-modal .comp-card-list { display: flex; flex-direction: column; gap: 0.6rem; }
#property-modal .comp-card {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border: 1px solid #eef0f3; border-radius: 12px; padding: 0.8rem 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
#property-modal .comp-card:hover { border-color: #d8b4fe; box-shadow: 0 2px 10px rgba(124,58,237,0.07); }
#property-modal .comp-card-info { min-width: 0; display: flex; flex-direction: column; gap: 0.15rem; }
#property-modal .comp-card-addr {
  font-size: 0.88rem; font-weight: 600; color: #111827;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#property-modal .comp-card-dist { font-size: 0.74rem; color: #9ca3af; }
#property-modal .comp-card-figs { text-align: right; flex-shrink: 0; display: flex; flex-direction: column; gap: 0.15rem; }
#property-modal .comp-card-val { font-size: 0.95rem; font-weight: 800; color: #111827; }
#property-modal .comp-card-lower { font-size: 0.74rem; font-weight: 700; color: #059669; }

/* ── Progress toward action ───────────────────────────────────────────────── */
#property-modal .readiness-steps {
  display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; margin: 1.4rem 0 1rem;
  padding-top: 1.1rem; border-top: 1px solid #f1f2f4;
}
#property-modal .readiness-step { font-size: 0.83rem; color: #9ca3af; display: inline-flex; align-items: center; gap: 0.45rem; }
#property-modal .readiness-step i { font-size: 0.85rem; }
#property-modal .readiness-step.is-done { color: #374151; }
#property-modal .readiness-step.is-done i { color: #16a34a; }

/* ── Value movement (assessment history) ──────────────────────────────────── */
#property-modal .value-movement {
  border: 1px solid #eef0f3; border-radius: 14px; padding: 1.25rem 1.4rem;
}
#property-modal .vm-track { display: flex; align-items: center; gap: 1rem; }
#property-modal .vm-point { display: flex; flex-direction: column; gap: 0.2rem; }
#property-modal .vm-point--current { margin-left: auto; text-align: right; align-items: flex-end; }
#property-modal .vm-year { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #9ca3af; }
#property-modal .vm-amount { font-size: 1.45rem; font-weight: 800; color: #111827; letter-spacing: -0.02em; }
#property-modal .vm-point--current .vm-amount { color: #111827; }
#property-modal .vm-arrow {
  flex: 1 1 auto; display: flex; align-items: center; justify-content: center;
  color: #cbd5e1; border-top: 2px dashed #e5e7eb; position: relative; height: 2px; min-width: 30px;
}
#property-modal .vm-arrow i { background: #fff; padding: 0 0.4rem; font-size: 0.95rem; position: relative; top: -0.5px; }
#property-modal .vm-arrow--up i   { color: #dc2626; }
#property-modal .vm-arrow--down i { color: #059669; }
#property-modal .vm-arrow--flat i { color: #9ca3af; }
#property-modal .vm-change {
  margin-top: 0.9rem; padding-top: 0.85rem; border-top: 1px solid #f1f2f4;
  font-size: 0.95rem; font-weight: 700;
}
#property-modal .vm-change.chg-up   { color: #dc2626; }
#property-modal .vm-change.chg-down { color: #059669; }
#property-modal .vm-change.chg-flat { color: #6b7280; }

/* ── Property details — two grouped tables ────────────────────────────────── */
#property-modal .property-details-grid { display: flex; flex-direction: column; gap: 1rem; border: none; border-radius: 0; overflow: visible; }
#property-modal .detail-group { border: 1px solid #eef0f3; border-radius: 14px; overflow: hidden; }
#property-modal .detail-group-title {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  color: #6b7280; background: #fafafa; padding: 0.6rem 1.1rem; border-bottom: 1px solid #f1f2f4;
}
#property-modal .detail-group .detail-item,
#property-modal .detail-group .detail-item:nth-child(even) { background: #fff; border-bottom: 1px solid #f6f7f8; padding: 0.7rem 1.1rem; }
#property-modal .detail-group .detail-item:last-child { border-bottom: none; }
#property-modal .detail-group .detail-item:hover { background: #fafafa; }
#property-modal .detail-label { color: #6b7280; font-size: 0.88rem; }
#property-modal .detail-value { color: #111827; font-size: 0.88rem; font-weight: 600; }

@media (max-width: 560px) {
  #property-modal .property-image-modal-container .pg-main { height: 190px; }
  #property-modal .property-image-modal-container > .property-modal-image { height: 190px; }
  #property-modal .savings-hero-amount { font-size: 2.5rem; }
  #property-modal .vm-amount { font-size: 1.2rem; }
}

/* Modal Overlay Base Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
}

.modal-container {
  background: white;
  border-radius: 1rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-container {
  transform: translateY(0);
}

.modal-body {
  padding: 2rem;
}

/* Service Selection Modal */
.service-selection-modal {
  max-width: 800px;
  width: 90%;
}

.service-options {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.service-option {
  flex: 1;
  min-width: 300px;
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: 1rem;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.service-option:hover {
  border-color: var(--primary-500);
  background: var(--primary-50);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.15);
}

.service-icon {
  background: var(--primary-500);
  color: white;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.service-content h3 {
  color: var(--gray-900);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.service-content p {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.service-price {
  background: var(--primary-600);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.service-features ul {
  list-style: none;
  padding: 0;
  text-align: left;
}

.service-features li {
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
}

.service-features li:before {
  content: "✓";
  color: var(--success-500);
  font-weight: bold;
  margin-right: 0.5rem;
}

/* Protest Type Selection Modal */
.protest-type-modal {
  max-width: 700px;
  width: 90%;
}

.protest-types {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.protest-type-option {
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: 1rem;
  padding: 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.protest-type-option:hover {
  border-color: var(--primary-500);
  background: var(--primary-50);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.1);
}

.type-icon {
  background: var(--primary-500);
  color: white;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.type-content h3 {
  color: var(--gray-900);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.type-content p {
  color: var(--gray-600);
  line-height: 1.5;
  margin: 0;
}

/* Account Creation Modal */
.account-creation-modal {
  max-width: 500px;
  width: 90%;
}

.modal-subtitle {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin: 0.5rem 0 0 0;
  font-weight: normal;
}

.account-form-container {
  width: 100%;
}

.form-tabs {
  display: flex;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 2rem;
}

/* Scoped to account-creation modal only — do NOT use .tab-content globally */
#accountCreationModal .tab-content {
  display: none;
}

#accountCreationModal .tab-content.active {
  display: block;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1.5rem;
  flex: 1;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
  font-weight: 600;
  font-size: 0.9rem;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--gray-200);
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: border-color 0.3s ease;
  background: white;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group input:invalid {
  border-color: var(--error-400);
}

.password-requirements {
  margin-top: 0.5rem;
}

.password-requirements small {
  color: var(--gray-500);
  font-size: 0.8rem;
}

.full-width {
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: 600;
  margin-top: 1rem;
}

.form-footer {
  margin-top: 2rem;
  text-align: center;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-200);
}

.security-note {
  color: var(--gray-600);
  font-size: 0.9rem;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.security-note i {
  color: var(--success-500);
}

/* Form validation states */
.form-group input:valid {
  border-color: var(--success-400);
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: var(--error-400);
}

/* Loading states */
.fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Info text styling */
.info-text {
  color: var(--gray-600);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 1rem;
  background: var(--gray-50);
  border-radius: 0.5rem;
  border: 1px solid var(--gray-200);
}

.info-text i {
  color: var(--primary-500);
}

/* Responsive Design */
@media (max-width: 768px) {
  .service-options {
    flex-direction: column;
  }
  
  .service-option {
    min-width: auto;
  }
  
  .protest-type-option {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .type-content {
    text-align: center;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .account-creation-modal {
    width: 95%;
    max-width: none;
  }
}

/* Enhanced Analysis Styles */
.enhanced-analysis-header {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.analysis-title h3 {
  color: #1e293b;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.analysis-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.geographic-context-panel {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid #e2e8f0;
}

.geographic-context-panel h4 {
  color: #374151;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.context-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
}

.context-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.context-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.context-value {
  font-size: 0.875rem;
  font-weight: 500;
  color: #1f2937;
}

.context-detail {
  font-size: 0.75rem;
  color: #059669;
  font-weight: 500;
}

.analysis-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.summary-stat {
  background: white;
  border-radius: 8px;
  padding: 1rem;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.stat-number {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e40af;
}

.stat-label {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  margin-top: 0.25rem;
}

.analysis-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

/* Enhanced Comparable Cards */
.enhanced-comp {
  border: 2px solid #e2e8f0;
  transition: all 0.3s ease;
}

.enhanced-comp:hover {
  border-color: #3b82f6;
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.15);
  transform: translateY(-2px);
}

.comp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border-radius: 8px;
}

.comp-ranking {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.quality-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.quality-score {
  background: white;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  text-align: center;
  border: 2px solid;
  min-width: 80px;
}

.quality-score.excellent { border-color: #059669; background: #ecfdf5; }
.quality-score.high { border-color: #0891b2; background: #ecfeff; }
.quality-score.medium { border-color: #ca8a04; background: #fffbeb; }
.quality-score.low { border-color: #dc2626; background: #fef2f2; }

.score-value {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: inherit;
}

.score-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.confidence-badge {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
}

.confidence-badge.excellent { background: #dcfce7; color: #166534; }
.confidence-badge.high { background: #cffafe; color: #0f766e; }
.confidence-badge.medium { background: #fef3c7; color: #92400e; }
.confidence-badge.low { background: #fee2e2; color: #991b1b; }

.distance-tier {
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
}

.distance-tier.very-close { background: #dcfce7; color: #166534; }
.distance-tier.close { background: #cffafe; color: #0f766e; }
.distance-tier.moderate { background: #fef3c7; color: #92400e; }
.distance-tier.far { background: #fee2e2; color: #991b1b; }

.supports-reduction {
  background: #dcfce7;
  color: #166534;
  padding: 0.125rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-left: 0.5rem;
}

.driving-distance {
  color: #6b7280;
  font-size: 0.75rem;
  margin-left: 0.5rem;
}

.quality-breakdown {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e2e8f0;
}

.score-bar {
  background: #f3f4f6;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.score-fill {
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

.score-details {
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
}

.comp-btn.enhanced {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.comp-btn.enhanced:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
}

/* ============================================================
   Mobile Responsive Improvements
   ============================================================ */

/* Header actions: always flex so items align correctly */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

#auth-controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Mobile nav dropdown — shown via JS toggle of .hidden class */
.mobile-nav {
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: var(--space-1) 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mobile-nav nav {
  display: flex;
  flex-direction: column;
}

.mobile-nav .nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-6);
  min-height: 48px;
  border-radius: 0;
  font-size: var(--text-base);
  color: var(--gray-700);
  border-bottom: 1px solid var(--gray-100);
}

.mobile-nav .nav-link:last-child {
  border-bottom: none;
}

.mobile-nav .nav-link:hover,
.mobile-nav .nav-link.active {
  background: var(--primary-50);
  color: var(--primary-600);
}

/* ── Tablet / mobile ≤ 768px ─────────────────────────────── */
@media (max-width: 768px) {
  /* Hero: less vertical padding */
  .hero-section {
    padding: var(--space-6) var(--space-4);
  }

  .hero-subtitle {
    font-size: var(--text-base);
    margin-bottom: var(--space-8);
  }

  .hero-trust-bar {
    gap: var(--space-3);
    font-size: var(--text-xs);
  }

  /* Action divider: tighten spacing */
  .action-divider {
    margin: var(--space-4) 0;
  }

  /* Explore button: slightly compact */
  .explore-button {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
  }

  /* Search input: reduce padding to avoid overflow on narrow screens */
  .search-input {
    padding: var(--space-4) var(--space-5);
    padding-right: 3.5rem; /* clear the search button */
    font-size: var(--text-base);
  }

  /* Search button: guaranteed 44px tap target */
  .search-button {
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile menu button: proper tap target */
  .mobile-menu-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }

  /* Map: shrink min-height so it doesn't force scroll on phones */
  .map-section {
    height: calc(100vh - 4rem);
    min-height: 350px;
  }

  .map-container {
    min-height: 350px;
  }

  #map {
    min-height: 350px;
    max-height: calc(100vh - 6rem);
  }

  /* Savings stats: 2 cols on tablet */
  .savings-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Login button: icon only on mobile — saves header space */
  .header-actions .cta-button span {
    display: none;
  }

  .header-actions .cta-button {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
  }

  /* Register: compact on tablet */
  .header-actions .btn-outline {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
  }

  /* Property modal body: tighter padding + more vertical space on mobile */
  .modal-body-scroll {
    padding: var(--space-4);
    max-height: 75vh;
    -webkit-overflow-scrolling: touch;
  }

  /* Modal header: tighter */
  .modal-header {
    padding: var(--space-4);
  }

  /* Modal title: smaller on mobile */
  .modal-title,
  .modal-header h2 {
    font-size: var(--text-lg);
  }

  /* Property summary: less padding so content fits */
  .property-summary {
    padding: var(--space-4);
    margin-bottom: var(--space-4);
  }

  /* Value cards: reduce padding */
  .value-card {
    padding: var(--space-3);
  }

  .value-amount {
    font-size: var(--text-xl);
  }

  /* Savings hero: tighter padding */
  .savings-hero {
    padding: var(--space-4) var(--space-5);
  }

  /* Savings CTA: full-width tap target */
  .savings-cta-btn {
    width: 100%;
    justify-content: center;
  }

  /* Service / protest-type modal body padding */
  .modal-body {
    padding: 1.25rem;
  }

  /* Protest type option: less padding */
  .protest-type-option {
    padding: 1.5rem;
    gap: 1.5rem;
  }

  /* Condition modal body */
  .condition-modal-body {
    padding: var(--space-4);
  }

  /* Close button: proper 44px tap target */
  .close-modal-btn {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
  }

  /* Property spec pills: wrap nicely */
  .property-specs {
    gap: var(--space-2);
  }
}

/* ── Small phones ≤ 480px ─────────────────────────────────── */
@media (max-width: 480px) {
  .header-container {
    padding: 0 var(--space-4);
    height: 3.5rem;
  }

  /* Hero: tighter on small phones */
  .hero-section {
    padding: var(--space-5) var(--space-3);
    min-height: calc(100vh - 3.5rem);
  }

  .hero-title {
    font-size: var(--text-2xl);
    margin-bottom: var(--space-4);
  }

  .hero-subtitle {
    font-size: var(--text-sm);
    margin-bottom: var(--space-5);
  }

  /* Trust bar: wrap to 2 lines naturally */
  .hero-trust-bar {
    gap: var(--space-2);
    margin-bottom: var(--space-4);
  }

  /* Hide Register entirely — hamburger menu handles all navigation */
  #register-btn {
    display: none;
  }

  /* Map: adjusted for smaller header */
  .map-section {
    height: calc(100vh - 3.5rem);
    min-height: 300px;
  }

  #map {
    min-height: 300px;
  }

  /* Savings stats: 1 column */
  .savings-stats {
    grid-template-columns: 1fr;
  }

  /* Savings comp rows: stack address over value */
  .savings-comp-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
  }

  .savings-comp-addr {
    white-space: normal;
    overflow: visible;
  }

  .savings-comp-val {
    margin-left: 0;
  }

  /* Condition modal body */
  .condition-modal-body {
    padding: var(--space-3);
  }

  /* Condition modal form: single column */
  .form-row-grid {
    grid-template-columns: 1fr;
  }

  /* Repair checkboxes: single column */
  .repair-grid {
    grid-template-columns: 1fr;
  }

  /* Service selection: stack cards */
  .service-option {
    min-width: 0;
    padding: 1.25rem;
  }

  .service-options {
    gap: 1rem;
  }

  .service-icon {
    width: 3rem;
    height: 3rem;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
  }

  .service-content h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  /* Protest type: compact on small phones */
  .protest-type-option {
    padding: 1rem;
    gap: 1rem;
  }

  .type-icon {
    width: 2.75rem;
    height: 2.75rem;
    font-size: 1.1rem;
  }

  .type-content h3 {
    font-size: 1rem;
  }

  /* Modal body: tight */
  .modal-body {
    padding: 1rem;
  }

  /* Dashboard protest tabs: compact */
  .tab-btn {
    padding: 0.75rem 0.5rem;
    font-size: 0.75rem;
  }

  /* Map legend: compact */
  .map-legend {
    font-size: var(--text-xs);
    padding: var(--space-2) var(--space-3);
  }

  /* Modal: almost full-width with minimal margin */
  .auth-modal .modal-content {
    margin: var(--space-3);
  }

  /* Autocomplete dropdown: constrain width on small phones */
  .ui-autocomplete {
    max-width: calc(100vw - 2rem);
    left: 0.5rem !important;
    right: 0.5rem;
  }

  /* Shorter placeholder on small phones so it doesn't get cut */
  .search-input::placeholder {
    font-size: 0.8rem;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}