/* ==========================================================================
   RuaGuia.com — Design System
   Full rewrite: mobile-first, semantic color tokens, Outfit + Cormorant
   ========================================================================== */

/* --- Tokens --- */
:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-warm: #faf8f4;
  --ink: #1a2520;
  --ink-soft: #3d4f47;
  --ink-muted: #6b7d74;
  --border: #e0ddd6;
  --border-soft: #ece9e2;
  --accent: #1b6b4a;
  --accent-light: #2d8f64;
  --accent-bg: #e8f4ee;
  --accent-bg-soft: #f2f9f5;
  --price: #b8860b;
  --price-bg: #fdf6e3;
  --danger: #c0392b;
  --danger-bg: #fdf0f0;
  --warn: #d4740e;
  --warn-bg: #fef3e2;
  --demo: #1d5b8c;
  --demo-bg: #e8f0f8;
  --score: #0d9488;
  --score-bg: #f0fdfa;
  --transport: #6c47a0;
  --transport-bg: #f0eaf8;
  --nature: #16a34a;
  --nature-bg: #f0fdf4;
  --radius: 12px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --shadow: 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.08);
  --text-xs: 0.75rem;
  --text-sm: 0.85rem;
  --text-base: 0.95rem;
  --text-lg: 1.1rem;
  --text-xl: clamp(1.25rem, 2vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 3vw, 2rem);
  --text-3xl: clamp(1.75rem, 4vw, 2.5rem);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img, svg { display: block; max-width: 100%; }

/* --- Base --- */
body {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: var(--text-base);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 72px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-light); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--ink); }

/* --- Accessibility --- */
.skip-nav {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--accent); color: #fff;
  padding: 8px 16px; font-size: var(--text-sm);
  text-decoration: none; border-radius: 0 0 6px 0;
}
.skip-nav:focus { left: 0; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.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;
}

/* --- Layout --- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid-5 { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }

/* --- Sticky Header --- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}
.header-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}
.brand {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--text-xl); font-weight: 700;
  color: var(--ink); text-decoration: none;
  white-space: nowrap;
}
.brand-pt { color: var(--accent); }

/* --- Search --- */
.search-box { position: relative; flex: 1; max-width: 360px; }
.search-input {
  width: 100%; padding: 8px 14px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  background: var(--surface); color: var(--ink);
  font-family: inherit; font-size: var(--text-sm);
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.search-input::placeholder { color: var(--ink-muted); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  max-height: 320px; overflow-y: auto; z-index: 110; display: none;
}
.search-results.active { display: block; }
.search-result-item {
  display: block; padding: 10px 14px;
  font-size: var(--text-sm); color: var(--ink);
  text-decoration: none; border-bottom: 1px solid var(--border-soft);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item:focus { background: var(--accent-bg-soft); }
.search-toggle {
  display: none; background: none; border: none;
  font-size: 1.2rem; cursor: pointer; color: var(--ink-soft); padding: 4px;
}

/* --- Cards --- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}
.card-muted {
  background: var(--surface-warm); border-color: var(--border-soft);
}

/* --- Semantic Section Borders --- */
.section--price  { border-left: 3px solid var(--price); padding-left: 16px; }
.section--risk   { border-left: 3px solid var(--danger); padding-left: 16px; }
.section--demo   { border-left: 3px solid var(--demo); padding-left: 16px; }
.section--transport { border-left: 3px solid var(--transport); padding-left: 16px; }
.section--nature { border-left: 3px solid var(--nature); padding-left: 16px; }

/* --- Hero --- */
.hero-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: var(--text-2xl); font-weight: 700;
  margin-bottom: 6px;
}
.hero-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-top: 16px;
}

/* --- Hero Layout --- */
.hero-layout { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.hero-content { flex: 1; min-width: 200px; }
.hero-gauge { text-align: center; flex-shrink: 0; }
.hero-gauge .gauge { width: 80px; height: 80px; }
.hero-gauge .gauge-value { font-size: var(--text-xl); }
.hero-gauge .gauge-circle-fill { stroke: var(--accent); }

/* --- Score Grid --- */
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.score-card { text-align: center; }
.score-card h2 { font-size: var(--text-sm); font-weight: 500; margin-bottom: 8px; color: var(--ink-soft); }
.score-card .gauge { margin: 0 auto; }
.score-card--teal .gauge-circle-fill { stroke: var(--score); }
.score-card--teal .gauge-value { color: var(--score); }
.score-card--green .gauge-circle-fill { stroke: var(--accent); }
.score-card--green .gauge-value { color: var(--accent); }
.score-card--purple .gauge-circle-fill { stroke: var(--transport); }
.score-card--purple .gauge-value { color: var(--transport); }
.score-card--nature .gauge-circle-fill { stroke: var(--nature); }
.score-card--nature .gauge-value { color: var(--nature); }
.score-card--blue .gauge-circle-fill { stroke: var(--demo); }
.score-card--blue .gauge-value { color: var(--demo); }

/* --- Stat Card --- */
.stat-card {
  background: var(--accent-bg); border-radius: var(--radius);
  padding: 14px 12px; text-align: center;
}
.stat-value {
  font-size: var(--text-xl); font-weight: 600; color: var(--accent);
  line-height: 1.2;
}
.stat-label {
  font-size: var(--text-xs); color: var(--ink-muted);
  margin-top: 4px; text-transform: uppercase; letter-spacing: .03em;
}
.stat-card--price  { background: var(--price-bg); }
.stat-card--price .stat-value { color: var(--price); }
.stat-card--risk   { background: var(--danger-bg); }
.stat-card--risk .stat-value { color: var(--danger); }
.stat-card--demo   { background: var(--demo-bg); }
.stat-card--demo .stat-value { color: var(--demo); }
.stat-card--score  { background: var(--score-bg); }
.stat-card--score .stat-value { color: var(--score); }
.stat-card--transport { background: var(--transport-bg); }
.stat-card--transport .stat-value { color: var(--transport); }
.stat-card--gold { background: var(--price-bg); }
.stat-card--gold .stat-value { color: var(--price); }
.stat-card--blue { background: var(--demo-bg); }
.stat-card--blue .stat-value { color: var(--demo); }
.stat-card--green { background: var(--accent-bg); }
.stat-card--green .stat-value { color: var(--accent); }
.stat-card--purple { background: var(--transport-bg); }
.stat-card--purple .stat-value { color: var(--transport); }

/* --- Gauge (SVG circle) --- */
.gauge {
  display: inline-flex; align-items: center; justify-content: center;
  position: relative; width: 72px; height: 72px;
}
.gauge-svg { width: 100%; height: 100%; }
.gauge-circle-bg { stroke: var(--border-soft); fill: none; }
.gauge-circle-fill {
  stroke: currentColor; fill: none;
  transition: stroke-dashoffset .6s ease;
}
.gauge-value {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: var(--text-lg);
}
.gauge--price { color: var(--price); }
.gauge--score { color: var(--score); }
.gauge--danger { color: var(--danger); }
.gauge--demo { color: var(--demo); }
.gauge--transport { color: var(--transport); }
.gauge--services { color: var(--accent); }
.gauge--nature { color: var(--nature); }
.gauge--noise { color: var(--demo); }

/* --- Score Bar (horizontal) --- */
.score-bar {
  background: var(--border-soft); border-radius: var(--radius-sm);
  height: 22px; position: relative; overflow: hidden;
}
.score-fill {
  height: 100%; border-radius: var(--radius-sm);
  background: var(--accent); transition: width .4s ease;
}
.score-label {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-size: var(--text-xs); font-weight: 600; color: var(--ink);
}

/* --- Pills / Badges --- */
.pill {
  display: inline-block; padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 500;
  background: var(--accent-bg); color: var(--accent);
}
.pill-danger { background: var(--danger-bg); color: var(--danger); }
.pill-warn   { background: var(--warn-bg); color: var(--warn); }
.pill-price  { background: var(--price-bg); color: var(--price); }
.pill-score  { background: var(--score-bg); color: var(--score); }

/* --- Breadcrumbs --- */
.breadcrumbs { font-size: var(--text-sm); color: var(--ink-muted); margin-bottom: 16px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0; padding: 0; }
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs li + li::before {
  content: "\203A"; margin: 0 6px; color: var(--ink-muted);
}
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* --- Data Table --- */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.data-table th {
  font-weight: 500; text-align: left; padding: 8px 0;
  border-bottom: 1px solid var(--border); color: var(--ink-soft);
}
.data-table td {
  padding: 8px 0; border-bottom: 1px solid var(--border-soft);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table td:first-child { width: 45%; color: var(--ink-soft); }
.data-table tr:nth-child(even) { background: var(--surface-warm); }

/* --- Lists --- */
.clean { list-style: none; padding: 0; margin: 0; }
ol { padding-left: 24px; }
ol li { padding: 6px 0; border-bottom: 1px solid var(--border-soft); }
ol li:last-child { border-bottom: none; }
.concelho-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px 16px;
}
.row {
  padding: 8px 0; border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: 8px;
}
.row:last-child { border-bottom: none; }
.row a { color: var(--accent); text-decoration: none; flex: 1; }
.row a:hover { color: var(--accent-light); }

/* --- Nearby Streets --- */
.nearby-list {
  display: grid; grid-template-columns: 1fr; gap: 8px;
}
.nearby-item {
  display: block; background: var(--accent-bg-soft);
  padding: 12px 14px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--ink);
  border: 1px solid transparent;
  transition: border-color .2s, box-shadow .2s;
}
.nearby-item:hover {
  border-color: var(--accent); box-shadow: var(--shadow-sm);
}
.nearby-item strong { color: var(--accent); }

/* --- POI Grid --- */
.poi-item { text-align: center; padding: 12px 6px; }
.poi-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin: 0 auto 6px;
  border-radius: 50%; background: var(--accent-bg);
  font-size: 1.25rem;
}

.poi-dist {
  display: block; font-size: 0.75rem; color: var(--text-muted);
  margin-top: 2px;
}
.poi-dist--absent { color: var(--danger-text, #b91c1c); font-weight: 500; }
.text-muted { color: var(--text-muted); }

/* --- FAQ --- */
.faq-item { padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.faq-item:last-child { border-bottom: none; }
.faq-item h3 { font-size: var(--text-base); font-weight: 600; margin-bottom: 4px; }
.faq-item p { font-size: var(--text-sm); color: var(--ink-soft); }

/* --- Ranking Links --- */
.ranking-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ranking-links a {
  display: inline-block; background: var(--accent-bg);
  color: var(--accent); padding: 4px 14px;
  border-radius: var(--radius-pill); font-size: var(--text-xs);
  text-decoration: none; font-weight: 500;
  transition: background .2s, color .2s;
}
.ranking-links a:hover { background: var(--accent); color: #fff; }

/* --- Rank Badges --- */
.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: var(--text-sm); font-weight: 600;
  background: var(--border-soft); color: var(--ink-soft);
}
.rank-gold   { background: #fdf6e3; color: #b8860b; }
.rank-silver { background: #f0f0f0; color: #6b7d74; }
.rank-bronze { background: #fef3e2; color: #b87333; }

/* --- Alert --- */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  margin-bottom: 16px; font-size: var(--text-sm);
}
.alert-warning {
  background: var(--warn-bg); border: 1px solid var(--warn); color: #7a4a0a;
}

/* --- Map --- */
#map { height: 300px; border-radius: var(--radius); overflow: hidden; }

/* --- Footer --- */
.site-footer {
  margin-top: 48px; padding: 32px 0;
  background: var(--ink); color: rgba(255,255,255,.7);
  font-size: var(--text-sm); text-align: center;
}
.footer-inner { max-width: 1100px; margin: 0 auto; padding: 0 16px; }
.site-footer a { color: rgba(255,255,255,.85); }
.site-footer a:hover { color: #fff; }

/* --- Cookie Banner --- */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
  background: var(--ink); color: rgba(255,255,255,.9);
  padding: 14px 16px; font-size: var(--text-sm);
}
.cookie-banner-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.cookie-banner-inner p { flex: 1; min-width: 200px; }
.btn {
  display: inline-block; padding: 8px 18px;
  border-radius: var(--radius-sm); font-family: inherit;
  font-size: var(--text-sm); font-weight: 500;
  cursor: pointer; border: none; text-decoration: none;
  transition: background .2s, color .2s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-light); }
.btn-ghost {
  background: transparent; color: rgba(255,255,255,.8);
  border: 1px solid rgba(255,255,255,.3);
}
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }

/* --- Mobile Bottom Bar --- */
.mobile-bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: center;
  padding: 6px 0 env(safe-area-inset-bottom, 4px);
  box-shadow: 0 -1px 6px rgba(0,0,0,.06);
}
.mobile-bottom-bar a,
.mobile-bottom-bar button {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; text-decoration: none;
  font-size: var(--text-xs); color: var(--ink-soft);
  padding: 4px 8px; background: none; border: none;
  font-family: inherit; cursor: pointer;
}
.mobile-bottom-bar a:hover,
.mobile-bottom-bar button:hover { color: var(--accent); }
.mobile-bottom-icon { font-size: 1.2rem; line-height: 1; }

/* --- Error Page --- */
.error-page {
  text-align: center;
  padding: 80px 16px 60px;
}
.error-page .hero-title {
  font-size: clamp(4rem, 10vw, 7rem);
  color: var(--border);
  margin-bottom: 8px;
}
.error-page p { margin-bottom: 12px; }

/* --- Prose (legal / long-form) --- */
.prose {
  max-width: 65ch;
  line-height: 1.7;
}
.prose h2, .prose h3 { margin-top: 24px; margin-bottom: 8px; }
.prose p { margin-bottom: 12px; }
.prose ul, .prose ol { margin-bottom: 12px; padding-left: 24px; }
.prose a { text-decoration: underline; }

/* --- Seismic Scale --- */
.seismic-scale { margin-top: 4px; }
.seismic-segments { display: flex; gap: 3px; margin-bottom: 6px; }
.seismic-seg {
  flex: 1; height: 24px; border-radius: 3px;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--text-xs); font-weight: 600;
  background: var(--border-soft); color: var(--ink-muted);
}
.seismic-seg--active { background: var(--danger); color: #fff; }

/* --- POI Icon Variants --- */
.poi-icon--commerce { background: var(--price-bg); }
.poi-icon--restaurant { background: var(--warn-bg); }
.poi-icon--education { background: var(--demo-bg); }
.poi-icon--health { background: var(--danger-bg); }
.poi-icon--park { background: var(--nature-bg); }

/* --- Ranking Footer --- */
.ranking-footer { margin-top: 12px; }

/* --- Sources --- */
.sources-text { font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.7; }

/* --- Footer extras --- */
.footer-tagline { font-size: var(--text-sm); margin-top: 4px; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin: 16px 0 8px; }
.footer-copy { font-size: var(--text-xs); margin-top: 8px; }

/* --- Analysis Section (Pontos fortes/fracos + Perfil) --- */
.section--analysis { border-left: 3px solid var(--accent); padding-left: 16px; }
.section--analysis h2 { margin-bottom: 16px; }
.analysis-summary {
  font-size: 1.05rem; line-height: 1.6; color: var(--text-secondary);
  margin-bottom: 20px; padding: 12px 16px;
  background: var(--accent-bg); border-radius: 8px;
}
.analysis-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.analysis-heading { font-size: var(--text-sm); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }
.analysis-heading--forte { color: var(--accent); }
.analysis-heading--fraco { color: var(--warn); }
.analysis-list { list-style: none; padding: 0; margin: 0; }
.analysis-list li {
  padding: 5px 0; font-size: var(--text-sm); color: var(--ink-soft);
  border-bottom: 1px solid var(--border-soft);
}
.analysis-list li:last-child { border-bottom: none; }
.analysis-list li::before { margin-right: 6px; }
.analysis-heading--forte + .analysis-list li::before { content: "+"; color: var(--accent); font-weight: 700; }
.analysis-heading--fraco + .analysis-list li::before { content: "\2013"; color: var(--warn); font-weight: 700; }

.car-dependency {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 0; border-top: 1px solid var(--border-soft);
  margin-top: 8px;
}

.street-profile { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.profile-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* --- Methodology (Como calculamos) --- */
.methodology details { cursor: pointer; }
.methodology summary { padding: 4px 0; font-size: var(--text-sm); }
.methodology p { margin-top: 10px; font-size: var(--text-sm); }
.method-grid { margin-top: 12px; }
.method-item {
  display: grid; grid-template-columns: 40px 1fr;
  align-items: baseline; gap: 4px 8px;
  padding: 6px 0; border-bottom: 1px solid var(--border-soft);
  font-size: var(--text-sm);
}
.method-item:last-child { border-bottom: none; }
.method-pct { font-weight: 700; color: var(--accent); font-size: var(--text-sm); }
.method-item .muted { grid-column: 2; font-size: var(--text-xs); }

/* --- Score comparison label --- */
.score-vs { margin-top: 4px; font-size: var(--text-xs); }

/* --- Service groups --- */
.service-group { margin-bottom: 16px; }
.service-group:last-child { margin-bottom: 0; }
.service-group-title {
  font-size: var(--text-xs); font-weight: 600; text-transform: uppercase;
  letter-spacing: .04em; color: var(--ink-muted);
  margin-bottom: 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--border-soft);
}

/* --- Details/Summary base --- */
details summary { list-style: none; cursor: pointer; }
details summary::-webkit-details-marker { display: none; }
details summary::before { content: "\25B6"; display: inline-block; margin-right: 6px; font-size: .7em; transition: transform .2s; }
details[open] summary::before { transform: rotate(90deg); }

/* --- Utilities --- */
.muted { color: var(--ink-muted); font-size: var(--text-sm); }
.text-center { text-align: center; }

/* ==========================================================================
   Responsive — Mobile First
   ========================================================================== */

/* --- 480px: large phones --- */
@media (min-width: 480px) {
  .hero-stats { grid-template-columns: repeat(4, 1fr); }

  .search-toggle { display: none; }
  .search-box { display: block !important; }

  .card { padding: 20px; }
}

/* --- 768px: tablets --- */
@media (min-width: 768px) {
  body { padding-bottom: 0; }

  .mobile-bottom-bar { display: none; }

  .nearby-list { grid-template-columns: repeat(2, 1fr); }

  .data-table td:first-child { width: 40%; }
}

/* --- 1024px: desktop --- */
@media (min-width: 1024px) {
  .wrap { padding: 0 24px; }

  .nearby-list { grid-template-columns: repeat(3, 1fr); }

  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-5 { grid-template-columns: repeat(5, 1fr); }
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* --- Search toggle mobile behavior (< 480px) --- */
@media (max-width: 479px) {
  .search-toggle { display: block; }
  .search-box { display: none; }
  .search-box.search-open { display: block; position: absolute; top: 100%; left: 16px; right: 16px; z-index: 105; }
  .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
  .analysis-cols { grid-template-columns: 1fr; }
  .street-profile { grid-template-columns: 1fr; }
}
