/* === 1. CSS VARIABLES === */
:root {
  --primary-color: #8b5cf6; 
  --primary-hover-color: #7c3aed;
  --accent-color: #1A202C; 
  --nav-bg: #1A202C; 
  --page-bg: #F7FAFC;
  --white-bg: #ffffff;
  --border-color: #E2E8F0;
  --success-color: #38A169;
  --warning-color: #D69E2E;
  --danger-color: #E53E3E;
  --orange-color: #EA580C;
  --lens-purple: #8b5cf6;
  --lens-orange: #EA580C;
  --lens-blue: #3182CE;
  --text-primary: #2D3748;
  --text-secondary: #4A5568;
  --text-muted: #718096;
  --text-light: #A0AEC0;
  --text-lighter: #CBD5E0;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-heading: 'Inter', sans-serif;
  --std-radius: 8px;
  --card-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --hover-shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
}

body.theme-orange { --primary-color: var(--lens-orange); --primary-hover-color: #C05621; }
body.theme-blue { --primary-color: var(--lens-blue); --primary-hover-color: #2B6CB0; }

/* === 2. BASE STYLES === */
html, body { height: 100vh; width: 100vw; margin: 0; overflow: hidden; }

body { 
  background: radial-gradient(var(--text-lighter) 1px, transparent 1px) 0 0 / 24px 24px,
              radial-gradient(circle at top left, rgba(168,85,247,0.02), transparent 40%),
              var(--page-bg);
  background-attachment: fixed;
  color: var(--accent-color); 
  font-family: var(--font-sans); 
  display: flex; 
  flex-direction: column;
}

button, input { font-family: var(--font-sans); }

button {
  border: none;
  border-radius: var(--std-radius);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* === 3. NAVIGATION === */
.main-navbar { 
  background: var(--nav-bg); 
  height: 60px; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  padding: 0 24px; 
  color: white; 
  flex-shrink: 0; 
  z-index: 2000; 
  box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
}

.nav-brand {
  font-family: var(--font-heading);
  font-size: 1.4rem; 
  font-weight: 600; 
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.5px; 
}

.mirari-logo-icon {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid #8b5cf6;
  box-shadow: 0 0 12px rgba(255,255,255,0.5); 
  position: relative;
  overflow: hidden;
}

.mirari-logo-icon::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 140%; height: 140%;
  border: 1px solid #8b5cf6;
  opacity: 0.6;
  border-radius: 40%;
  transform: translate(-50%,-50%) rotate(45deg);
}

.mirari-logo-icon::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 6px;
  background: #8b5cf6;
  border-radius: 50%;
  transform: translate(-50%,-50%);
  box-shadow: 0 0 5px #8b5cf6;
}

.nav-links { display: flex; gap: 24px; align-items: center; }

.nav-item { 
  color: var(--text-lighter); 
  text-decoration: none; 
  font-weight: 500; 
  font-size: 0.9rem; 
  transition: color 0.2s; 
  cursor: pointer; 
}

.nav-item:hover { color: white; }
.nav-item.active { color: white; border-bottom: 2px solid var(--primary-color); } 

.account-link { 
  display: flex; 
  align-items: center; 
  gap: 8px; 
  background: rgba(255,255,255,0.1); 
  padding: 6px 14px; 
  border-radius: 20px; 
  cursor: pointer;
  position: relative;
}

.account-link:hover { background: rgba(255,255,255,0.2); }

/* === 4. CONTROL BAR (FIXED FLEXBOX) === */
.control-bar { 
  background: var(--white-bg); 
  border-bottom: 1px solid var(--border-color); 
  padding: 12px 24px; 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  box-shadow: 0 1px 2px rgba(0,0,0,0.05); 
  flex-shrink: 0; 
  z-index: 1000;
}

.search-container { position: relative; flex-grow: 1; max-width: 450px; }
.input-wrapper { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 12px; color: var(--text-light); z-index: 10; pointer-events: none; }

#addressInput { 
  width: 100%; 
  padding: 10px 10px 10px 36px; 
  border: 1px solid var(--text-lighter); 
  border-radius: var(--std-radius); 
  font-size: 0.95rem; 
  transition: all 0.2s; 
  box-sizing: border-box; 
}

#addressInput:focus { 
  border-color: var(--primary-color); 
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15); 
  outline: none; 
}

#autocomplete-list { 
  display: none; 
  position: absolute; 
  top: calc(100% + 4px); 
  left: 0; right: 0; 
  background: white; 
  border: 1px solid var(--border-color); 
  border-radius: var(--std-radius); 
  box-shadow: var(--hover-shadow); 
  z-index: 3000; 
  overflow: hidden; 
}

#autocomplete-list div { padding: 10px 15px; cursor: pointer; border-bottom: 1px solid #edf2f7; font-size: 0.9em; }
#autocomplete-list div:hover { background: #f7fafc; color: var(--primary-color); }

/* Control Actions Group (Right Side) */
.control-actions { 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  margin-left: auto; 
  flex-shrink: 0; 
}
.divider-vertical { width: 1px; height: 24px; background: var(--border-color); margin: 0 4px; }

/* === 5. BUTTONS === */
#searchButton { 
  background: var(--primary-color); 
  color: white; 
  padding: 10px 20px; 
  white-space: nowrap; 
}

#searchButton:hover { 
  background: var(--primary-hover-color); 
  transform: translateY(-1px); 
}

#searchButton .btn-label { display: inline; font-weight: 500; }
#searchButton i { margin-right: 0; }

.icon-btn { 
  background: transparent; 
  color: var(--text-secondary); 
  padding: 10px; 
  font-size: 1.2em; 
  width: 40px; height: 40px; 
  border-radius: 50%; 
  border: 1px solid transparent; 
  flex-shrink: 0;
}

.icon-btn:hover { 
  background: #EDF2F7; 
  color: var(--primary-color); 
  border-color: var(--border-color); 
}

.ai-btn { 
  background: #E2E8F0; 
  color: var(--text-muted); 
  padding: 0 16px; 
  height: 40px; 
  border-radius: 20px; 
  font-size: 0.95em; 
  min-width: 110px; 
  position: relative; 
  overflow: visible;
  flex-shrink: 0;
}

.ai-btn:hover { background: var(--text-lighter); }

.ai-btn.active-ai { 
  background: linear-gradient(135deg, #8b5cf6, #ec4899); 
  color: white; 
  box-shadow: 0 2px 5px rgba(168,85,247,0.2); 
}

.ai-btn.active-ai:hover { opacity: 0.95; transform: translateY(-1px); }

/* === 6. LENS GROUP === */
.lens-group-container {
  position: relative;
  display: flex;
  gap: 18px; 
  margin-left: 24px;
  min-height: 42px; 
  padding: 6px 18px 4px; 
  border: 1px solid var(--border-color);
  border-radius: 12px;
  align-items: center;
  background: white; 
  flex-shrink: 0;
}

.lens-group-label {
  position: absolute;
  top: -8px; left: 12px;
  background: white;
  padding: 0 4px;
  font-size: 0.6rem;
  font-weight: 800;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  line-height: 1;
  z-index: 5;
}

.lens-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 2px; 
}

.lens-item.active { opacity: 1; }
.lens-item:not(.active):not(.locked-feature) { opacity: 0.5; }
.lens-item:not(.active):not(.locked-feature):hover { opacity: 0.8; }
.lens-item.locked-feature { opacity: 1; filter: grayscale(1); cursor: not-allowed; }
.lens-item.locked-feature .lens-icon-circle { border-color: var(--border-color); }

.lens-icon-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  margin-bottom: 2px;
  position: relative;
  border: 2px solid var(--target-color);
  background: transparent;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  box-sizing: border-box;
}

.lens-icon-circle::before {
  content: ''; 
  position: absolute;
  top: 50%; left: 50%; 
  transform: translate(-50%,-50%);
  width: 6px; height: 6px;
  background: var(--target-color);
  border-radius: 50%;
  box-shadow: 0 0 4px var(--target-color);
}

.lens-icon-circle::after {
  content: ''; 
  position: absolute;
  top: 50%; left: 50%;
  width: 130%; height: 130%;
  border: 1px solid var(--target-color);
  border-radius: 40%; 
  opacity: 0.4;
  transform: translate(-50%,-50%) rotate(45deg);
}

.lens-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.5px;
  margin-top: 3px;
}

.lens-item.active .lens-label { color: var(--text-primary); }

.purple-lens { --target-color: var(--lens-purple); }
.orange-lens { --target-color: var(--lens-orange); }
.blue-lens { --target-color: var(--lens-blue); }

.lens-lock-overlay {
  position: absolute;
  width: 24px; height: 24px;
  top: 2px; left: 50%;
  transform: translateX(-50%); 
  background: rgba(255,255,255,0.85);
  display: none; 
  align-items: center;
  justify-content: center;
  z-index: 10;
  color: var(--text-light);
  font-size: 0.8rem;
  border-radius: 50%;
}

.lens-item.locked-feature .lens-lock-overlay { display: flex; }

/* === 7. COMPARISON DOCK === */
.comparison-dock { 
  position: fixed; 
  bottom: 20px; left: 50%; 
  transform: translateX(-50%) translateY(150%); 
  background: rgba(255,255,255,0.95); 
  backdrop-filter: blur(10px); 
  border: 1px solid var(--border-color); 
  padding: 12px 16px; 
  border-radius: 12px; 
  box-shadow: 0 -5px 20px rgba(0,0,0,0.1); 
  display: flex; 
  gap: 16px; 
  align-items: center; 
  z-index: 1500; 
  transition: transform 0.3s cubic-bezier(0.175,0.885,0.32,1.275); 
  max-width: 90vw; 
  overflow-x: auto; 
}

.comparison-dock.visible { transform: translateX(-50%) translateY(0); }

.dock-label { 
  font-size: 0.75rem; 
  font-weight: 700; 
  color: var(--text-light); 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
  writing-mode: vertical-rl; 
  transform: rotate(180deg); 
  border-left: 1px solid #EDF2F7; 
  padding-left: 8px; 
  margin-left: 8px; 
}

.comparison-card { 
  min-width: 140px; 
  background: white; 
  border: 1px solid var(--border-color); 
  border-radius: 8px; 
  padding: 10px; 
  cursor: pointer; 
  transition: all 0.2s; 
  position: relative; 
  display: flex; 
  flex-direction: column; 
  gap: 4px; 
}

.comparison-card:hover { 
  border-color: var(--primary-color); 
  transform: translateY(-2px); 
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); 
}

.comparison-card.active-view { 
  border-color: var(--primary-color); 
  background: #FAF5FF; 
}

.comp-score { font-size: 1.2rem; font-weight: 800; color: var(--text-primary); }
.comp-name { 
  font-size: 0.8rem; 
  color: var(--text-secondary); 
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis; 
  max-width: 120px; 
}

.comp-close { 
  position: absolute; 
  top: -6px; right: -6px; 
  background: var(--danger-color); 
  color: white; 
  width: 18px; height: 18px; 
  border-radius: 50%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  font-size: 0.7rem; 
  opacity: 0; 
  transition: 0.2s; 
}

.comparison-card:hover .comp-close { opacity: 1; }

/* === 8. MAP & SIDEBAR === */
#contentArea { 
  display: flex; 
  flex-grow: 1; 
  height: 100%; 
  min-height: 0; 
  position: relative; 
  overflow: hidden; 
}

#map { flex-grow: 1; height: 100%; z-index: 1; }
.leaflet-tile-pane { filter: grayscale(0.5) contrast(0.9) brightness(1.05); }

#amenitySidebar { 
  width: 340px; 
  background: white; 
  z-index: 2; 
  overflow-y: auto; 
  padding: 24px; 
  border-left: 1px solid var(--border-color); 
  box-shadow: -2px 0 10px rgba(0,0,0,0.03); 
}

.sidebar-intro {
  text-align: center;
  padding-top: 40px;
  color: var(--text-secondary);
}

.intro-icon { font-size: 3rem; color: var(--text-lighter); margin-bottom: 20px; }
.sidebar-intro h3 { color: var(--text-primary); margin-bottom: 10px; }
.sidebar-intro p { font-size: 0.9rem; line-height: 1.5; margin-bottom: 30px; color: var(--text-muted); }

.intro-steps {
  list-style: none;
  padding: 20px;
  text-align: left;
  background: var(--page-bg);
  border-radius: 8px;
}

.intro-steps li {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.intro-steps i {
  color: var(--primary-color);
  background: white;
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  font-size: 0.8rem;
}

.compare-btn-sidebar { 
  width: 100%; 
  margin-top: 15px; 
  border: 1px dashed var(--text-lighter); 
  color: var(--text-secondary); 
  background: var(--page-bg); 
  padding: 8px; 
  border-radius: 6px; 
  cursor: pointer; 
  transition: 0.2s; 
}

.compare-btn-sidebar:hover { 
  border-color: var(--primary-color); 
  color: var(--primary-color); 
}

/* === 9. SCORE DISPLAY === */
#overall-score-section { 
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 20px; 
  text-align: left;
}

.score-label-wrapper { display: flex; align-items: center; gap: 8px; }

.overall-score-label { 
  font-size: 0.9em; 
  color: var(--text-muted); 
  font-weight: 600; 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
  margin: 0; 
}

.info-tooltip-container { position: relative; display: flex; align-items: center; }
.info-tooltip-container i { color: var(--text-lighter); font-size: 0.9rem; cursor: help; transition: color 0.2s; }
.info-tooltip-container i:hover { color: var(--primary-color); }

.info-tooltip-content {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 140%;  
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  background: white;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  padding: 12px;
  border-radius: 8px;
  z-index: 1000;
  text-align: left;
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--text-secondary);
  font-weight: 400; 
  text-transform: none; 
  transition: all 0.2s ease;
  pointer-events: none;
}

.info-tooltip-container:hover .info-tooltip-content {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(5px); 
}

.info-tooltip-content strong { display: block; color: var(--text-primary); margin-bottom: 4px; }
.info-tooltip-content p { margin: 0 0 10px; }
.info-tooltip-content p:last-child { margin-bottom: 0; }

#average-distance-section .info-tooltip-content { left: auto; right: -15px; transform: none; }
#average-distance-section .info-tooltip-container:hover .info-tooltip-content { transform: translateY(5px); }

.overall-score-value {
  font-size: 3.5rem; 
  font-weight: 800; 
  line-height: 1; 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 120px; height: 120px;
  border-radius: 50%;
  border: 3px solid currentColor; 
  margin: 0;
  background: white;
}

.overall-score-value.exceptional { color: var(--success-color); }
.overall-score-value.average { color: var(--warning-color); }
.overall-score-value.challenging { color: var(--orange-color); }
.overall-score-value.very-weak { color: var(--danger-color); }
.overall-score-value.commercial-mode { font-size: 2.2rem; letter-spacing: -1px; }

/* === 10. METER & STATS === */
.urban-meter-container {
    margin-bottom: 24px;
}

.meter-full-gradient-track { 
  height: 8px; 
  background: #eee; 
  border-radius: 4px; 
  overflow: hidden; 
  position: relative; 
  margin-bottom: 8px; 
}

#meterGradientFill { 
  width: 100%; 
  height: 100%; 
  position: absolute; 
  background: linear-gradient(to right, var(--success-color), var(--warning-color), var(--danger-color)); 
}

.meter-mask { 
  height: 100%; 
  background: var(--border-color); 
  position: absolute; 
  right: 0; 
  transition: width 0.8s ease; 
}

.meter-labels { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); }

.section-title, 
#average-distance-section h3 {
  font-size: 0.85rem; 
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  text-align: center; 
  border: none;
}

.avg-stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }

.avg-stat-item { 
  background: var(--page-bg); 
  padding: 12px; 
  border-radius: 8px; 
  text-align: center; 
  font-size: 0.9em; 
  font-weight: 600; 
  color: var(--text-primary); 
  border: 1px solid #EDF2F7; 
}

.stat-sub { display: block; font-size: 0.8em; color: var(--text-muted); font-weight: 400; margin-top: 2px; }

/* === 11. AI INSIGHT & LISTS === */
#aiInsight:empty { display: none !important; padding: 0 !important; border: none !important; }
#aiInsight { 
  margin-top: 20px; 
  background: #FAF5FF; 
  border-left: 3px solid #8b5cf6;
  padding: 12px; 
  font-size: 0.9rem; 
  color: var(--text-secondary); 
  border-radius: 4px; 
  line-height: 1.5; 
}

.amenity-list h3 { 
  font-size: 0.95rem; 
  color: var(--text-primary); 
  margin: 24px 0 12px; 
  font-weight: 700; 
  border-bottom: 1px solid #EDF2F7; 
  padding-bottom: 8px; 
  text-transform: uppercase; 
  letter-spacing: 0.5px; 
}

.score-item { 
  display: flex; 
  justify-content: space-between; 
  padding: 8px 0; 
  border-bottom: 1px dashed var(--border-color); 
  font-size: 0.9em; 
}

.score-item .score-label { color: var(--text-primary); font-weight: 600; }
.score-item .score-value { color: #8b5cf6; font-weight: 700; }

.amenity-list ul { list-style: none; padding: 0; margin: 0; }

.amenity-list li { 
  padding: 8px 0; 
  border-bottom: 1px solid #f7fafc; 
  font-size: 0.9rem; 
  display: flex; 
  align-items: center; 
  gap: 8px; 
}

.amenity-list li[data-osm-id] { cursor: pointer; transition: background 0.2s; }
.amenity-list li[data-osm-id]:hover { background: #F0F9FF; }
.amenity-list li.priority-found { color: var(--success-color); font-weight: 500; }
.amenity-list li.missing { color: var(--danger-color); opacity: 0.8; }

/* === 12. COLLAPSIBLE SECTIONS === */
.collapsible-header {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.toggle-icon { font-size: 0.8rem; color: var(--text-light); transition: transform 0.3s ease; }
.collapsible-header.collapsed .toggle-icon { transform: rotate(-90deg); }
.collapsible-content.hidden { display: none; }

/* === 13. FILTER INPUT & PRO CARD === */
.search-filter-container { margin: 15px 0; position: relative; }

.input-wrapper.small-search input { 
  width: 100%; 
  padding: 8px 10px 8px 32px; 
  background: var(--page-bg); 
  border: 1px solid var(--border-color); 
  border-radius: 6px; 
  font-size: 0.85rem; 
}

.locked-search { opacity: 0.6; filter: grayscale(1); }
.locked-search input { cursor: not-allowed; pointer-events: none; }
.lock-overlay { 
  position: absolute; 
  right: 10px; 
  top: 50%; 
  transform: translateY(-50%); 
  color: var(--text-light); 
  display: none; 
}

.locked-search .lock-overlay { display: block; }

.filter-results-dropdown { 
  position: absolute; 
  top: 100%; 
  width: 100%; 
  background: white; 
  border: 1px solid var(--border-color); 
  z-index: 100; 
  box-shadow: var(--hover-shadow); 
  display: none; 
  max-height: 300px;
  overflow-y: auto;
}

.filter-result-item { 
  padding: 8px; 
  cursor: pointer; 
  display: flex; 
  justify-content: space-between; 
}

.filter-result-item:hover { background: #EBF8FF; color: var(--primary-color); }

.pro-upgrade-card { 
  background: linear-gradient(135deg, #1A202C, #2D3748); 
  border-radius: 8px; 
  padding: 16px; 
  color: white; 
  text-align: center; 
  margin-top: 12px; 
}

.lock-icon-circle { 
  background: rgba(255,255,255,0.1); 
  width: 32px; height: 32px; 
  border-radius: 50%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  margin: 0 auto 10px; 
  color: #8b5cf6; 
}

.lock-text strong { display: block; font-size: 0.95rem; margin-bottom: 4px; }
.lock-text p { font-size: 0.8rem; color: var(--text-lighter); margin-bottom: 12px; }

.upgrade-btn { 
  width: 100%; 
  background: var(--primary-color); 
  color: white; 
  padding: 8px; 
  border-radius: 4px; 
  font-size: 0.9rem; 
  font-weight: 600; 
}

.upgrade-btn:hover { background: var(--primary-hover-color); }

/* === 14. MAP MARKERS === */
.custom-div-icon { background: transparent; border: none; }

.marker-pin { 
  width: 28px; height: 28px; 
  background: white; 
  border: 2px solid var(--primary-color); 
  border-radius: 50% 50% 50% 0; 
  display: flex; 
  justify-content: center; 
  align-items: center; 
  transform: rotate(-45deg); 
  box-shadow: 0 3px 6px rgba(0,0,0,0.2); 
}

.marker-pin i { transform: rotate(45deg); color: var(--primary-color); font-size: 13px; }

.leaflet-marker-icon.highlighted .marker-pin { 
  background: var(--primary-color); 
  border-color: white; 
  transform: scale(1.2) rotate(-45deg) translateY(-5px); 
}

.leaflet-marker-icon.highlighted .marker-pin i { color: white; }
.dimmed-marker { opacity: 0.3; filter: grayscale(1); }

.popup-stats div { 
  color: var(--text-secondary); 
  display: flex; 
  align-items: center; 
  gap: 6px; 
  margin-top: 4px; 
  font-size: 0.9rem; 
  font-weight: 600; 
}

/* === 15. TOOLTIPS === */
.ui-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  background: #1A202C;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 3000;
  pointer-events: none;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-align: center;
}

.account-link { position: relative; }
.account-tooltip { top: 140%; right: 0; transform: translateY(-5px); }
.account-link:hover .account-tooltip { visibility: visible; opacity: 1; transform: translateY(0); }

.lens-tooltip {
  top: 130%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  width: max-content;
  max-width: 150px;
  white-space: normal;
}

.lens-item:hover .lens-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.livvi-tooltip {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 120%;
  right: 0; 
  width: 200px;
  background: #1A202C;
  color: white;
  text-align: left;
  padding: 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  z-index: 2000;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.68,-0.55,0.27,1.55);
  transform: translateY(-10px) scale(0.9);
}

.livvi-tooltip strong { display: block; color: #A78BFA; margin-bottom: 4px; font-size: 0.85rem; }
.ai-btn:hover .livvi-tooltip { visibility: visible; opacity: 1; transform: translateY(0) scale(1); }

/* === 16. BANNER === */
#bannerContainer { 
  position: absolute; 
  top: 150px;
  left: 50%; 
  transform: translateX(-50%); 
  background: rgba(255,255,255,0.9); 
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.4);
  padding: 10px 24px; 
  border-radius: 30px; 
  box-shadow: 0 4px 15px rgba(0,0,0,0.08); 
  display: flex; 
  align-items: center; 
  z-index: 900; 
  transition: all 0.3s ease;
  width: max-content;
  max-width: 90vw;
}

#bannerContainer.hidden { opacity: 0; pointer-events: none; transform: translate(-50%, -10px); }

#bannerContainer:hover {
  background: white;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transform: translateX(-50%) translateY(-2px);
}

.banner-content { display: flex; align-items: center; }

.banner-text { 
  margin: 0; 
  font-size: 0.95rem;
  font-weight: 600; 
  color: var(--text-secondary); 
  display: flex;
  align-items: center;
  gap: 8px;
}

.banner-text i {
  color: var(--primary-color);
  font-size: 1.1rem;
  animation: pulse-globe 3s infinite ease-in-out;
}

.close-banner-button { 
  font-size: 1.2rem; 
  color: var(--text-lighter); 
  background: transparent; 
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 12px;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.close-banner-button:hover { color: var(--danger-color); }

.error-banner { 
  background: #FFF5F5; 
  border: 1px solid #FC8181; 
  color: #C53030; 
}

/* === 17. SETTINGS DROPDOWN === */
.dropdown-container { position: relative; }

.dropdown-content { 
  display: none; 
  position: absolute; 
  right: 0; 
  top: 125%; 
  background: white; 
  width: 300px; 
  padding: 0; 
  border-radius: 12px; 
  box-shadow: 0 10px 30px -5px rgba(0,0,0,0.15); 
  border: 1px solid var(--border-color); 
  z-index: 2000; 
  overflow: hidden; 
}

.dropdown-content.show { display: block; animation: fadeIn 0.15s ease-out; }
.dropdown-section { padding: 16px; }

.dropdown-header { 
  font-size: 0.75em; 
  text-transform: uppercase; 
  letter-spacing: 1px; 
  color: var(--text-muted); 
  margin-bottom: 12px; 
  font-weight: 700; 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
}

.dropdown-divider { border: 0; border-top: 1px solid #EDF2F7; margin: 0; }

.mode-switch-container { 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  background: var(--page-bg); 
  padding: 8px 12px; 
  border-radius: 8px; 
  border: 1px solid #EDF2F7; 
}

.mode-label { font-size: 0.9em; font-weight: 600; color: var(--text-secondary); }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }

.slider { 
  position: absolute; 
  cursor: pointer; 
  top: 0; left: 0; right: 0; bottom: 0; 
  background: var(--text-lighter); 
  transition: .4s; 
  border-radius: 34px; 
}

.slider:before { 
  position: absolute; 
  content: ""; 
  height: 18px; width: 18px; 
  left: 3px; bottom: 3px; 
  background: white; 
  transition: .4s; 
  border-radius: 50%; 
}

input:checked + .slider { background: var(--primary-color); }
input:checked + .slider:before { transform: translateX(20px); }

.checkbox-row { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
  margin-bottom: 8px; 
  font-size: 0.95em; 
  color: var(--text-primary); 
}

.checkbox-row input { accent-color: var(--primary-color); width: 16px; height: 16px; }

.unit-switch-compact { display: flex; align-items: center; margin-bottom: 12px; font-size: 0.85em; }
.unit-switch-compact input { display: none; }

.unit-switch-compact label { 
  background: #EDF2F7; 
  padding: 4px; 
  border-radius: 6px; 
  display: flex; 
  cursor: pointer; 
}

.unit-switch-compact span { 
  padding: 4px 12px; 
  border-radius: 4px; 
  color: var(--text-muted); 
  transition: 0.2s; 
}

.unit-switch-compact input:not(:checked) ~ label span:first-child,
.unit-switch-compact input:checked ~ label span:last-child { 
  background: white; 
  color: var(--primary-color); 
  font-weight: 600; 
  box-shadow: 0 1px 2px rgba(0,0,0,0.1); 
}

.slider-group { margin-bottom: 12px; }
.slider-label-row { display: flex; justify-content: space-between; font-size: 0.9em; margin-bottom: 6px; }
.slider-value { font-weight: 700; color: var(--primary-color); }

.slider-group input[type=range] { 
  width: 100%; 
  accent-color: var(--primary-color); 
  height: 4px; 
  background: var(--border-color); 
  border-radius: 2px; 
}

.locked-feature { 
  cursor: not-allowed;
  opacity: 0.6;
  filter: grayscale(100%);
  position: relative;
}

.locked-feature input, 
.locked-feature .switch { pointer-events: none; }
.lock-indicator { color: var(--text-light); margin-left: 6px; font-size: 0.8em; }

.text-link-btn {
  background: none;
  color: var(--text-muted);
  font-size: 0.85em;
  text-decoration: underline;
  padding: 0;
  width: auto;
  margin-top: 10px;
}

.text-link-btn:hover { color: var(--primary-color); }

/* === 18. PROGRESS OVERLAY === */
#progressOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(4px);
  background-image: 
    linear-gradient(rgba(139,92,246,0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139,92,246,0.1) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  animation: pan-grid 60s linear infinite;
}

.progress-box {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
  text-align: center;
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #fff;
}

.circular-loader { position: relative; width: 80px; height: 80px; margin-bottom: 20px; }
.circular-loader svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.loader-bg { fill: none; stroke: #EDF2F7; stroke-width: 4; }

.loader-path {
  fill: none;
  stroke: var(--primary-color);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 126;
  stroke-dashoffset: 126;
  transition: stroke-dashoffset 0.3s ease;
  animation: pulse-ring 2s infinite ease-in-out;
}

.loader-percentage {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  font-size: 0.9em;
  font-weight: 700;
  color: var(--primary-color);
}

#progressText { font-size: 1.1em; font-weight: 600; color: var(--text-primary); margin-bottom: 5px; }
#progressSubText { font-size: 0.85em; color: var(--text-light); font-weight: 400; }

/* === 19. MODAL === */
.mirari-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.7);
  backdrop-filter: blur(5px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.mirari-modal-content {
  background: white;
  width: 90%;
  max-width: 500px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.mirari-header {
  background: #1A202C;
  padding: 20px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mirari-logo-text { 
  color: white; 
  font-family: var(--font-heading); 
  font-size: 1.4rem; 
  font-weight: 700; 
}

.badge-atlas {
  background: linear-gradient(135deg, #FFD700, #F6AD55);
  color: #1A202C;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 4px;
  margin-left: 8px;
  letter-spacing: 1px;
}

.close-modal-btn { color: var(--text-light); font-size: 1.5rem; }
.mirari-body { padding: 30px; text-align: center; }
.mirari-body h2 { color: var(--text-primary); margin-top: 0; }
.mirari-body p { color: var(--text-muted); line-height: 1.5; margin-bottom: 24px; }

.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }

.feature-box {
  background: var(--page-bg);
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #EDF2F7;
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.feature-box i { color: var(--primary-color); font-size: 1.2rem; }

.concierge-note {
  font-size: 0.8rem;
  background: #EBF8FF;
  color: #2B6CB0;
  padding: 10px;
  border-radius: 6px;
  display: inline-block;
}

.mirari-cta-btn {
  display: block;
  width: 100%;
  background: #1A202C;
  color: white;
  text-decoration: none;
  padding: 14px;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.2s;
}

.mirari-cta-btn:hover { background: black; transform: translateY(-1px); }

/* === 20. SIDEBAR ACTION BUTTONS === */
.sidebar-action-group {
  display: none;
  flex-direction: column; 
  gap: 8px;
  margin-top: 20px;
  width: 100%;
}

.action-col { width: 100%; position: relative; }

.action-col .compare-btn-sidebar {
  width: 100%;
  margin-top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  font-size: 0.9rem;
}

.btn-ghost {
  background: var(--page-bg);
  border: 1px solid var(--border-color);
  color: var(--text-light);
  opacity: 0.8;
  cursor: not-allowed;
}

.action-col .ui-tooltip {
  top: -45px;
  left: 50%; 
  transform: translateX(-50%);
  width: 160px;
  text-align: center;
  white-space: normal;
  background: #2D3748;
  font-size: 0.75rem;
  padding: 6px 10px;
}

.action-col:hover .ui-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateX(-50%) translateY(-5px);
}

/* === 21. STATIC PAGES === */
.pricing-page-wrapper, 
.about-page-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
  flex-grow: 1;
}

.pricing-header, 
.about-hero {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 60px;
}

.pricing-header h1, 
.about-hero h1 {
  font-size: 2.5rem;
  color: #1A202C;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.pricing-header p, 
.about-hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* --- PRICING & PLANS (Updated) --- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    max-width: 1250px;
    margin: 0 auto;
    align-items: stretch; 
    padding: 0 20px;
}

.pricing-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 30px; /* Reduced from 40px */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    min-height: 420px; /* REDUCED from 520px to remove empty space */
    position: relative;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.1);
    border-color: #cbd5e0;
}

.pricing-card.featured {
    border: 2px solid #8b5cf6;
    box-shadow: 0 25px 50px -12px rgba(139, 92, 246, 0.25);
    z-index: 10;
    transform: scale(1.05);
}

.pricing-card.featured:hover {
    transform: scale(1.05) translateY(-5px);
}

.card-header h3 {
    font-size: 1.5rem; 
    font-weight: 800;
    margin: 0 0 5px 0;
    color: #1a202c;
    letter-spacing: -0.5px;
}

.card-header .subtitle {
    font-size: 0.95rem;
    color: #718096;
    margin-bottom: 25px;
}

.price-block {
    display: flex;
    align-items: baseline;
    margin-bottom: 20px;
}

.price-block .currency {
    font-size: 1.6rem;
    font-weight: 500;
    color: #2d3748;
    margin-right: 2px;
}

.price-block .amount {
    font-size: 3.8rem;
    font-weight: 800;
    color: #1a202c;
    line-height: 1;
}

.price-block .period {
    color: #718096;
    margin-left: 6px;
    font-size: 1.1rem;
}

.price-desc {
    font-size: 0.9rem;
    font-weight: 600;
    color: #38A169;
    margin-top: -15px;
    margin-bottom: 10px; /* REDUCED from 30px */
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0; /* REDUCED from 25px */
    text-align: left;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 0.95rem;
    color: #4a5568;
    line-height: 1.5;
}

.feature-list li i {
    color: #8b5cf6;
    margin-top: 4px;
    flex-shrink: 0;
}

.badge-ribbon {
    position: absolute;
    top: -12px; left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    border: 2px solid white;
}

.cta-btn { 
  display: flex;                 /* Enforces flexbox layout */
  justify-content: center;       /* Centers text horizontally */
  align-items: center;           /* Centers text vertically */
  width: 100%;                   /* Forces full width */
  box-sizing: border-box;        /* Prevents padding from breaking width */
  padding: 12px; 
  border-radius: 8px; 
  font-weight: 600; 
  text-decoration: none; 
  margin-top: 20px; 
  transition: all 0.2s ease;
}

.btn-outline { border: 1px solid var(--text-lighter); background: transparent; color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--text-primary); color: #1A202C; }
.btn-primary { background: var(--primary-color); color: white; }
.btn-primary:hover { background: var(--primary-hover-color); box-shadow: 0 4px 12px rgba(168,85,247,0.3); }
.btn-dark { background: #1A202C; color: white; }
.btn-dark:hover { background: black; }

.beta-notice {
  background: #EBF8FF; 
  border: 1px solid #BEE3F8; 
  color: #2B6CB0;
  padding: 12px; 
  border-radius: 8px; 
  text-align: center; 
  margin-bottom: 40px;
}

.matrix-link { text-align: center; margin-top: 40px; }
.matrix-link a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.matrix-link a:hover { color: var(--primary-color); text-decoration: underline; }

.about-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; margin-bottom: 60px; }

.about-card {
  background: white; 
  padding: 30px; 
  border-radius: 12px;
  border: 1px solid var(--border-color); 
  text-align: center;
}

.icon-header {
  font-size: 2rem; 
  color: var(--primary-color); 
  margin-bottom: 20px;
  background: #FAF5FF; 
  width: 64px; 
  height: 64px; 
  line-height: 64px;
  border-radius: 50%; 
  margin: 0 auto 20px;
}

.divider-line { border: 0; border-top: 1px solid var(--border-color); margin: 60px 0; }

.methodology-section { max-width: 800px; margin: 0 auto; }
.methodology-section h2 { font-size: 2rem; color: #1A202C; margin-bottom: 20px; text-align: center; }
.section-intro { text-align: center; font-size: 1.1rem; color: var(--text-secondary); margin-bottom: 40px; }

.pillars-list { display: flex; flex-direction: column; gap: 24px; }
.pillar-item { display: flex; gap: 20px; align-items: flex-start; }

.pillar-score {
  background: #1A202C; 
  color: white; 
  font-weight: 700; 
  width: 40px; 
  height: 40px;
  display: flex; 
  align-items: center; 
  justify-content: center; 
  border-radius: 50%; 
  flex-shrink: 0;
}

.pillar-content h4 { margin: 0 0 8px; font-size: 1.1rem; color: var(--text-primary); }
.pillar-content p { margin: 0; color: var(--text-muted); line-height: 1.5; }

.about-cta { 
  text-align: center; 
  background: #FAF5FF; 
  padding: 40px; 
  border-radius: 16px; 
  margin: 60px 0; 
}

.about-cta h3 { margin-top: 0; margin-bottom: 20px; color: var(--text-primary); }
.cta-buttons { display: flex; justify-content: center; gap: 16px; }
.cta-buttons .cta-btn { width: auto; min-width: 160px; }

.about-footer {
  text-align: center; 
  font-size: 0.85rem; 
  color: var(--text-light); 
  border-top: 1px solid #EDF2F7; 
  padding-top: 40px;
}

.sub-credit { margin-top: 8px; font-size: 0.75rem; }

.founder-section { max-width: 800px; margin: 60px auto; padding: 0 24px; }

.founder-card {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  background: white;
  padding: 30px;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.founder-img {
  width: 120px; height: 120px;
  border-radius: 12px;
  background-color: var(--border-color); 
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  filter: grayscale(100%); 
  transition: filter 0.3s;
}

.founder-card:hover .founder-img { filter: grayscale(0%); }
.founder-text { flex-grow: 1; }
.founder-sig { font-size: 0.9rem; line-height: 1.4; }

.value-prop-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-top: 20px;
  background: var(--page-bg);
  padding: 15px;
  border-radius: 8px;
}

.prop-item { display: flex; gap: 12px; align-items: flex-start; }

.prop-item i {
  color: var(--primary-color);
  background: white;
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  flex-shrink: 0;
  margin-top: 2px;
}

.prop-item strong { display: block; font-size: 0.9rem; color: var(--text-primary); margin-bottom: 2px; }
.prop-item span { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; display: block; }
.founder-text h4 { margin: 0 0 15px; color: var(--text-primary); font-size: 1.2rem; font-style: italic; }

/* === 22. ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse-globe {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

@keyframes pulse-ring {
  0%, 100% { stroke: var(--primary-color); }
  50% { stroke: #c4b5fd; }
}

@keyframes pan-grid {
  0% { background-position: 0 0; }
  100% { background-position: 100% 100%; }
}

/* === 23. RESPONSIVE === */
@media (max-width: 900px) {
    .pricing-grid, .widget-grid {
        grid-template-columns: 1fr !important;
        max-width: 450px !important;
    }
    .pricing-card.featured {
        transform: none; /* Disable scale on mobile */
    }
    .pricing-card {
        min-height: auto;
    }
}

@media (max-width: 768px) {
  #contentArea { flex-direction: column; }
  #amenitySidebar { width: 100%; height: auto; border-top: 1px solid var(--border-color); }
  #map { height: 50vh; }
  .control-bar { flex-wrap: wrap; }
  .control-actions { margin-left: 0; margin-top: 10px; width: 100%; justify-content: space-between; }
  .search-container { order: 1; width: 100%; max-width: 100%; }
  #searchButton { order: 2; flex-grow: 1; }
  .control-actions { order: 2; }
  .nav-links { display: none; }
  .about-grid { grid-template-columns: 1fr; }
  .pillar-item { flex-direction: column; gap: 10px; }
  .about-hero h1 { font-size: 2rem; }
}

@media (max-width: 600px) {
  .founder-card { flex-direction: column; text-align: center; align-items: center; }
}

/* ==========================================================================
   MASTER MOBILE OVERRIDES
   ========================================================================== */

/* 1. HAMBURGER BUTTON (Hidden on Desktop) */
.mobile-nav-toggle {
  display: none; 
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  font-size: 1.2rem;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

/* 2. MOBILE LAYOUT (Phones only) */
@media (max-width: 600px) { /* <--- CHANGED FROM 768px */

  /* --- A. TOP NAVIGATION --- */
  .mobile-nav-toggle {
    display: block; /* Show hamburger */
  }

  .nav-links {
    display: none; /* Hide links by default */
    flex-direction: column;
    position: fixed; /* Lock to screen */
    top: 60px; /* Height of navbar */
    left: 0;
    width: 100%;
    background: var(--nav-bg);
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    z-index: 1900;
    
    /* FIX FOR "TOO LONG" MENU: */
    max-height: calc(100vh - 60px); 
    overflow-y: auto; /* Scroll inside the menu if needed */
    box-sizing: border-box;
  }

  .nav-links.mobile-active {
    display: flex; /* Show when active */
    animation: slideDown 0.2s ease-out;
  }

  .nav-item {
    width: 100%;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1rem;
  }

  .account-link {
    width: fit-content;
    margin-top: 15px;
  }

  /* --- B. CONTROL BAR --- */
  .control-bar { 
    flex-wrap: wrap; 
  }
  
  .search-container { 
    order: 1; 
    width: 100%; 
    max-width: 100%; 
  }
  
  #searchButton { 
    order: 2; 
    flex-grow: 1; 
  }
  
  .control-actions { 
    order: 3;
    margin-left: 0; 
    margin-top: 10px; 
    width: 100%; 
    justify-content: space-between; 
  }

  /* --- C. MAP & CONTENT LAYOUT --- */
  #contentArea {
    flex-direction: column;
    height: calc(100vh - 60px); /* Fill remaining space */
    position: relative;
    overflow: hidden;
  }

  #map {
    width: 100%;
    height: 100% !important; /* Force map to fill screen */
    position: absolute;
    top: 0; left: 0;
    z-index: 1;
  }

  /* --- D. BOTTOM SHEET (Slide-Up Drawer) --- */
  #amenitySidebar {
    position: fixed; /* FIXED ensures it never scrolls off screen */
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    background: white;
    
    /* Visuals */
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.2);
    border-left: none;

    /* Layout */
    display: flex;
    flex-direction: column;
    padding: 0;

    /* ANIMATION LOGIC (Height-based) */
    height: 60px; /* CLOSED STATE: Only handle is visible */
    transition: height 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    overflow: hidden;
  }

  #amenitySidebar.is-open {
    height: 85%; /* OPEN STATE */
  }

  /* Handle (The Tab) */
  .mobile-handle-container {
    width: 100%;
    height: 60px; /* Match closed height */
    min-height: 60px;
    background: white;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
    border-bottom: 1px solid #f0f0f0;
  }

  .mobile-handle-bar {
    width: 50px;
    height: 5px;
    background-color: #CBD5E0;
    border-radius: 10px;
  }

  /* Scrollable Content Inside Sheet */
  #amenitySidebar > div:not(.mobile-handle-container) {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
  }
  
  /* --- E. SETTINGS DROPDOWN (Mobile Fix) --- */
  .dropdown-content {
    width: 85vw !important;
    max-width: 300px !important;
    right: -10px !important;
    left: auto !important;
    max-height: 65vh !important; 
    overflow-y: auto !important;
    padding-bottom: 100px !important; 
    z-index: 9999 !important; 
  }
}

@media (min-width: 601px) { /* <--- Changed to match */
  .mobile-handle-container { display: none; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   MOBILE & SCROLL FIXES (About/Plans)
   ========================================= */

/* 1. FORCE SCROLLING: Only applies if body has class="scroll-enabled" */
html:has(.scroll-enabled), 
body.scroll-enabled {
    overflow-y: auto !important;    /* Force vertical scroll */
    overflow-x: hidden !important; /* Prevent horizontal side-scroll */
    height: auto !important;       /* Allow page to grow tall */
    position: static !important;   /* Unlocks the page flow */
}

/* 2. MOBILE LAYOUT: Stacks content nicely on phones */
@media screen and (max-width: 768px) {

  /* Fix wrapper width */
  .about-page-wrapper, 
  .pricing-page-wrapper {
    width: 100% !important;
    max-width: 100vw !important;
    padding: 80px 20px 40px !important; /* Add breathing room */
    box-sizing: border-box;
    display: block !important; /* Ensures it's not a flexbox trying to squeeze */
  }

  /* Fix the hero text size */
  .about-hero h1 { font-size: 2rem; }
  .about-hero p { padding: 0; }

  /* Stack the "Founder" card vertically */
  .founder-card {
    flex-direction: column !important;
    text-align: center !important;
    padding: 20px !important;
    gap: 15px !important;
  }
  
  .founder-img { margin: 0 auto; }

  /* Stack the "Methodology" pillars */
  .pillar-item {
    flex-direction: column;
    text-align: center;
  }
  
  /* Stack value props */
  .value-prop-grid {
    grid-template-columns: 1fr !important;
  }
}

/* =========================================
   MOBILE SETTINGS MENU (FINAL FIX)
   ========================================= */

@media screen and (max-width: 768px) {
  .dropdown-content {
    /* 1. Size & Position */
    width: 85vw !important;
    max-width: 300px !important;
    right: -10px !important;
    left: auto !important;
    
    /* 2. Scroll Handling */
    max-height: 65vh !important; /* Slightly shorter to avoid bottom controls */
    overflow-y: auto !important;
    
    /* 3. THE FIX: Huge bottom padding pushes the last button into view */
    padding-bottom: 100px !important; 
    
    /* 4. Ensure it sits on top of everything */
    z-index: 9999 !important; 
  }
}

/* =========================================
   MOBILE ACCOUNT BUTTON FIX
   ========================================= */

@media screen and (max-width: 768px) {
  .account-link {
    /* 1. Add extra padding on the sides */
    padding-left: 30px !important; 
    padding-right: 30px !important;
    
    /* 2. Force it to be slightly wider overall */
    min-width: 140px !important; 
    
    /* 3. Ensure the text stays on one line */
    white-space: nowrap !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
   24. WARNING MODAL (GLOBAL - OUTSIDE THE MEDIA QUERY)
   ========================================================================== */
.warning-modal-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.2s ease-out;
}

.warning-modal-box {
  background: var(--white-bg);
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  max-width: 380px;
  width: 90%;
  text-align: center;
  border: 1px solid var(--border-color);
}

.warning-modal-box h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--text-primary);
  font-size: 1.2rem;
}

.warning-modal-box p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

.warning-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.warning-actions .btn-cancel {
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-secondary);
  border-radius: var(--std-radius);
  cursor: pointer;
}

.warning-actions .btn-cancel:hover {
  background: var(--page-bg);
  color: var(--text-primary);
}

.warning-actions .btn-confirm {
  padding: 10px 20px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--std-radius);
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(139, 92, 246, 0.3);
}

.warning-actions .btn-confirm:hover {
  background: var(--primary-hover-color);
  transform: translateY(-1px);
}

/* VIBE MODAL STYLES */
.vibe-modal-box { max-width: 450px; }
.vibe-body { text-align: left; padding: 24px; }

.vibe-question-group { margin-bottom: 20px; }
.vibe-question-group label { 
    display: block; font-size: 0.85rem; font-weight: 700; 
    color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px; 
}

.vibe-toggle-row { display: flex; gap: 10px; }
.vibe-option { 
    flex: 1; padding: 12px; background: var(--page-bg); 
    border: 2px solid transparent; color: var(--text-secondary); 
    border-radius: 8px; font-size: 0.9rem; justify-content: center; 
}
.vibe-option.selected { 
    border-color: var(--primary-color); background: #F3E8FF; 
    color: var(--primary-color); font-weight: 600; 
}

.must-have-grid { display: flex; gap: 12px; justify-content: center; }
.must-have-item {
    width: 45px; height: 45px; border-radius: 50%;
    background: var(--page-bg); color: var(--text-light);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem; cursor: pointer; transition: all 0.2s;
    border: 2px solid transparent;
}
.must-have-item:hover { background: #E2E8F0; }
.must-have-item.selected { 
    background: var(--primary-color); color: white; 
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.4); 
    transform: translateY(-2px);
}

/* Match Score Display (In Sidebar) */
.match-score-container {
    background: #1A202C; color: white;
    padding: 16px; border-radius: 12px;
    margin-bottom: 20px; text-align: center;
    position: relative; overflow: hidden;
    margin-top: 24px;
}
.match-score-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; }
.match-score-val { font-size: 2.5rem; font-weight: 800; line-height: 1; margin: 5px 0; color: #4ADE80; }
.match-score-code { 
    background: rgba(255,255,255,0.15); padding: 4px 10px; 
    border-radius: 20px; font-size: 0.8rem; display: inline-block; 
}

/* === LANDING FOOTER === */
.landing-footer {
  width: 100%;
  padding: 20px 0;
  margin-top: 40px; /* Space from content */
  border-top: 1px solid rgba(0,0,0,0.05);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  background: transparent;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.footer-links a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.separator {
  color: var(--border-color);
  font-size: 0.7rem;
}

/* Mobile Tweak */
@media (max-width: 600px) {
  .landing-footer {
    padding-bottom: 80px; /* Extra space on mobile so bottom bar doesn't cover it */
  }
}

/* Account Button Tooltip Logic */
#accountButton:hover .ui-tooltip {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* Hide empty AI box */
#aiInsight:empty { display: none !important; padding: 0 !important; border: none !important; }

/* WIDGET GRID */
.widget-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    max-width: 950px;
    margin: 40px auto 0;
    align-items: stretch;
}