/* ==========================================================================
   RuaGuia.com — Design System v2
   Nordic-editorial rewrite: Inter, semantic tokens, bento layout
   ========================================================================== */

/* --- Google Fonts: Inter --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap');

/* ==========================================================================
   1. DESIGN TOKENS
   ========================================================================== */
:root {
  /* Brand */
  --primary:           #1b6b4a;
  --primary-light:     #2d8f64;
  --primary-bg:        #e8f4ee;
  --primary-bg-soft:   #f2f9f5;

  /* Surfaces */
  --surface:           #f7f9fb;
  --surface-low:       #f0f4f7;
  --surface-container: #e8eff3;
  --surface-high:      #e1e9ee;
  --surface-highest:   #d9e4ea;
  --surface-white:     #ffffff;

  /* Ink */
  --ink:               #1a2520;
  --ink-soft:          #3d4f47;
  --ink-muted:         #6b7d74;

  /* Outlines */
  --outline:           #717c82;
  --outline-variant:   #a9b4b9;
  --border:            #e0ddd6;
  --border-soft:       #ece9e2;

  /* Semantic colors */
  --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;

  /* Aliases kept for backward compat */
  --accent:            var(--primary);
  --accent-light:      var(--primary-light);
  --accent-bg:         var(--primary-bg);
  --accent-bg-soft:    var(--primary-bg-soft);
  --bg:                var(--surface);
  --surface-warm:      var(--surface-low);

  /* Radii */
  --radius:            12px;
  --radius-sm:         6px;
  --radius-lg:         16px;
  --radius-xl:         20px;
  --radius-pill:       999px;

  /* Shadows */
  --shadow-sm:         0 1px 3px rgba(0,0,0,.06);
  --shadow:            0 4px 12px rgba(0,0,0,.07);
  --shadow-lg:         0 8px 24px rgba(0,0,0,.10);

  /* Typography scale */
  --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 */

  /* Letter spacing */
  --tracking-tight:    -0.025em;
  --tracking-widest:   0.1em;

  /* Spacing */
  --section-gap:       3rem;
}

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

/* ==========================================================================
   3. BASE
   ========================================================================== */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 400;
  font-size: var(--text-base);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 72px;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  color: var(--ink);
  letter-spacing: var(--tracking-tight);
}

/* ==========================================================================
   4. ACCESSIBILITY
   ========================================================================== */
.skip-nav {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--primary); 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(--primary); 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;
}

/* ==========================================================================
   5. LAYOUT
   ========================================================================== */

/* Main container */
.wrap {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Legacy wrap width for pages not yet on bento */
.wrap-narrow { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* Bento two-column layout */
.bento-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.bento-sidebar {
  width: 100%;
  flex-shrink: 0;
}

.bento-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

/* Bento responsive grid */
.bento-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

/* Grid column helpers */
.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)); }

/* Explicit ratio grids */
.grid-1-2   { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.grid-1-3   { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.grid-2-3   { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.grid-3-2   { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.grid-1-1-1-1 { display: grid; gap: 1rem; grid-template-columns: repeat(2, 1fr); }

/* Concelho/city grids */
.concelho-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 4px 16px;
}

/* ==========================================================================
   6. STICKY HEADER
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(247, 249, 251, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.header-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}

.brand {
  font-family: 'Inter', sans-serif;
  font-size: var(--text-2xl);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand-pt { color: var(--primary); }

/* ==========================================================================
   7. 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-white); 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(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }

.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface-white); 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(--primary-bg-soft); }

.search-toggle {
  display: none; background: none; border: none;
  font-size: 1.2rem; cursor: pointer; color: var(--ink-soft); padding: 4px;
}

/* ==========================================================================
   8. CARDS
   ========================================================================== */
.card {
  background: var(--surface-white);
  border: 1px solid rgba(169, 180, 185, 0.20);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 0;
  box-shadow: var(--shadow-sm);
}

/* Legacy margin for pages using old layout */
.card + .card { margin-top: 1rem; }

.card--muted {
  background: var(--surface-low);
  border-color: var(--surface-container);
}

.card--primary {
  background: var(--primary);
  color: #fff;
  border-color: transparent;
}

.card--glass {
  background: rgba(255,255,255,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.5);
}

/* Legacy alias */
.card-muted { background: var(--surface-low); border-color: var(--border-soft); }

/* ==========================================================================
   9. HERO — street page
   ========================================================================== */
.hero-banner {
  position: relative;
  height: 400px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--surface-container);
}

.hero-banner::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(26,37,32,.75) 0%, transparent 60%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
}

.hero-title {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  font-weight: 900;
  letter-spacing: var(--tracking-tight);
  margin-bottom: 6px;
  line-height: 1.1;
}

.hero-subtitle {
  font-size: var(--text-lg);
  color: var(--ink-muted);
  font-weight: 400;
}

/* Hero layout (inline in card, not full-bleed banner) */
.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(--primary); }

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

/* ==========================================================================
   10. STAT CARDS
   ========================================================================== */
.stat-card {
  background: var(--primary-bg);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}

.stat-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
}

.stat-label {
  font-size: 10px;
  color: var(--ink-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  font-weight: 700;
}

/* Stat card color variants */
.stat-card--gold,
.stat-card--price   { background: var(--price-bg); }
.stat-card--gold .stat-value,
.stat-card--price .stat-value  { color: var(--price); }

.stat-card--blue,
.stat-card--demo    { background: var(--demo-bg); }
.stat-card--blue .stat-value,
.stat-card--demo .stat-value   { color: var(--demo); }

.stat-card--green   { background: var(--primary-bg); }
.stat-card--green .stat-value  { color: var(--primary); }

.stat-card--purple,
.stat-card--transport { background: var(--transport-bg); }
.stat-card--purple .stat-value,
.stat-card--transport .stat-value { color: var(--transport); }

.stat-card--score   { background: var(--score-bg); }
.stat-card--score .stat-value  { color: var(--score); }

.stat-card--risk    { background: var(--danger-bg); }
.stat-card--risk .stat-value   { color: var(--danger); }

/* ==========================================================================
   11. DATA DISPLAY
   ========================================================================== */
.data-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--tracking-widest);
  color: var(--outline);
  display: block;
  margin-bottom: 4px;
}

.data-value {
  font-size: var(--text-2xl);
  font-weight: 900;
  letter-spacing: var(--tracking-tight);
  line-height: 1;
  color: var(--ink);
}

.data-unit {
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-muted);
}

/* ==========================================================================
   12. SCORE COMPONENTS
   ========================================================================== */

/* Score box sidebar */
.score-box {
  background: var(--primary);
  border-radius: var(--radius);
  color: #fff;
  padding: 1.5rem;
  text-align: center;
}
.score-box .data-label { color: rgba(255,255,255,0.7); }
.score-box .data-value { color: #fff; font-size: var(--text-4xl); }

/* 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(--primary); }
.score-card--green  .gauge-value       { color: var(--primary); }
.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); }

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

/* ==========================================================================
   13. 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: 700; 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(--primary); }
.gauge--nature    { color: var(--nature); }
.gauge--noise     { color: var(--demo); }

/* ==========================================================================
   14. PROGRESS BARS
   ========================================================================== */
.progress-bar {
  height: 6px;
  border-radius: var(--radius-pill);
  background: rgba(169, 180, 185, 0.20);
  overflow: hidden;
  position: relative;
}
.progress-bar__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--primary);
  transition: width .4s ease;
}
.progress-bar--thick { height: 1.5rem; }

/* Score bar (legacy name, horizontal bar) */
.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(--primary); 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);
}

/* ==========================================================================
   15. PILLS / BADGES
   ========================================================================== */
.pill {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: var(--primary-bg);
  color: var(--primary);
  white-space: nowrap;
}

/* New variant names */
.pill--primary   { background: var(--primary); color: #fff; }
.pill--score     { background: var(--score-bg); color: var(--score); }
.pill--warn      { background: var(--warn-bg); color: var(--warn); }
.pill--danger    { background: var(--danger-bg); color: var(--danger); }
.pill--rank      { background: var(--surface-highest); color: var(--ink-soft); }

/* Legacy variant names */
.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); }

/* 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: 700;
  background: var(--surface-highest); color: var(--ink-soft);
}
.rank-gold   { background: #fdf6e3; color: #b8860b; }
.rank-silver { background: #f0f0f0; color: #6b7d74; }
.rank-bronze { background: #fef3e2; color: #b87333; }

/* ==========================================================================
   16. NAV SIDEBAR
   ========================================================================== */
.nav-sidebar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow-sm);
}

.nav-sidebar a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.nav-sidebar a:hover {
  background: var(--surface-low);
  color: var(--ink);
}
.nav-sidebar a.active,
.nav-sidebar a[aria-current="page"] {
  background: var(--surface-highest);
  color: var(--primary);
  font-weight: 700;
}

/* ==========================================================================
   17. SECTION BORDERS (semantic left accent)
   ========================================================================== */
.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; }
.section--analysis  { border-left: 3px solid var(--primary);   padding-left: 16px; }

/* ==========================================================================
   18. ANALYSIS SECTION
   ========================================================================== */
.analysis-summary {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 20px;
  padding: 14px 18px;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.analysis-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.analysis-heading {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.analysis-heading--forte { color: var(--primary); }
.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(--primary); font-weight: 700; }
.analysis-heading--fraco + .analysis-list li::before { content: "\2013"; color: var(--warn); font-weight: 700; }

/* ==========================================================================
   19. PROFILE TAGS & STREET PROFILE
   ========================================================================== */
.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.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;
}

/* ==========================================================================
   20. POI GRID
   ========================================================================== */
.poi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.poi-item {
  text-align: center;
  padding: 14px 8px;
  background: var(--surface-low);
  border-radius: var(--radius-sm);
}

.poi-icon {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin: 0 auto 6px;
  border-radius: 50%; background: var(--primary-bg);
  font-size: 1.25rem;
}
.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); }

.poi-dist {
  display: block;
  font-size: var(--text-xs);
  color: var(--ink-muted);
  margin-top: 3px;
}
.poi-dist--absent { color: var(--danger); font-weight: 600; }

/* ==========================================================================
   21. 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; }

/* ==========================================================================
   22. BREADCRUMBS
   ========================================================================== */
.breadcrumbs { font-size: var(--text-sm); color: var(--ink-muted); margin-bottom: 16px; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; 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(--primary); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

/* ==========================================================================
   23. DATA TABLE
   ========================================================================== */
.data-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.data-table th {
  font-weight: 600; 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-low); }

/* ==========================================================================
   24. LISTS & ROWS
   ========================================================================== */
.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; }

.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(--primary); text-decoration: none; flex: 1; }
.row a:hover { color: var(--primary-light); }

/* ==========================================================================
   25. NEARBY STREETS
   ========================================================================== */
.nearby-list { display: grid; grid-template-columns: 1fr; gap: 8px; }

.nearby-item {
  display: block; background: var(--primary-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(--primary); box-shadow: var(--shadow-sm); }
.nearby-item strong { color: var(--primary); }

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

/* ==========================================================================
   27. 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;
  cursor: pointer;
}
.faq-item p { font-size: var(--text-sm); color: var(--ink-soft); }

/* ==========================================================================
   28. METHODOLOGY
   ========================================================================== */
.methodology details { cursor: pointer; }
.methodology summary { padding: 4px 0; font-size: var(--text-sm); font-weight: 600; }
.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(--primary); font-size: var(--text-sm);
}
.method-item .muted { grid-column: 2; font-size: var(--text-xs); color: var(--ink-muted); }

/* 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); }

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

/* ==========================================================================
   30. 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;
}

/* ==========================================================================
   31. MAP
   ========================================================================== */
#map { height: 300px; border-radius: var(--radius); overflow: hidden; }

/* ==========================================================================
   32. BUTTONS
   ========================================================================== */
.btn {
  display: inline-block; padding: 8px 18px;
  border-radius: var(--radius-sm); font-family: inherit;
  font-size: var(--text-sm); font-weight: 600;
  cursor: pointer; border: none; text-decoration: none;
  transition: background .2s, color .2s;
}
.btn-primary           { background: var(--primary); color: #fff; }
.btn-primary:hover     { background: var(--primary-light); color: #fff; }
.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; }

/* ==========================================================================
   33. FOOTER
   ========================================================================== */
.site-footer {
  margin-top: 48px; padding: 32px 0;
  background: var(--surface-low);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  text-align: center;
}
.footer-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--primary); }

.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; }

/* ==========================================================================
   34. 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: 1440px; margin: 0 auto;
  display: flex; align-items: center;
  gap: 12px; flex-wrap: wrap;
}
.cookie-banner-inner p { flex: 1; min-width: 200px; }

/* ==========================================================================
   35. MOBILE BOTTOM BAR
   ========================================================================== */
.mobile-bottom-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: var(--surface-white); 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(--primary); }
.mobile-bottom-icon { font-size: 1.2rem; line-height: 1; }

/* ==========================================================================
   36. 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; }

/* ==========================================================================
   37. PROSE (legal / long-form)
   ========================================================================== */
.prose {
  max-width: 65ch;
  line-height: 1.75;
  font-size: var(--text-base);
}
.prose h2, .prose h3 { margin-top: 28px; margin-bottom: 10px; }
.prose p             { margin-bottom: 14px; color: var(--ink-soft); }
.prose ul, .prose ol { margin-bottom: 14px; padding-left: 24px; }
.prose a             { text-decoration: underline; color: var(--primary); }

/* ==========================================================================
   38. SOURCES / MISC
   ========================================================================== */
.sources-text { font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.7; }
.muted        { color: var(--ink-muted); font-size: var(--text-sm); }
.text-muted   { color: var(--ink-muted); }
.text-center  { text-align: center; }

/* ==========================================================================
   39. UTILITIES
   ========================================================================== */
.gap-1  { gap: 0.25rem; }
.gap-2  { gap: 0.5rem; }
.gap-4  { gap: 1rem; }
.gap-8  { gap: 2rem; }
.mt-4   { margin-top: 1rem; }
.mt-8   { margin-top: 2rem; }
.mb-4   { margin-bottom: 1rem; }
.mb-8   { margin-bottom: 2rem; }
.p-4    { padding: 1rem; }
.p-6    { padding: 1.5rem; }
.flex   { display: flex; }
.flex-wrap  { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 900; }
.text-sm     { font-size: var(--text-sm); }
.text-xs     { font-size: var(--text-xs); }
.uppercase   { text-transform: uppercase; }
.tracking-widest { letter-spacing: var(--tracking-widest); }
.tracking-tight  { letter-spacing: var(--tracking-tight); }

/* ==========================================================================
   40. 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; }
  .poi-grid { grid-template-columns: repeat(4, 1fr); }
  .card { padding: 1.5rem; }
}

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

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

  .nearby-list { grid-template-columns: repeat(2, 1fr); }
  .data-table td:first-child { width: 40%; }

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

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

  .bento-layout {
    flex-direction: row;
    gap: 3rem;
    align-items: flex-start;
  }
  .bento-sidebar {
    width: 280px;
    position: sticky;
    top: 6rem;
  }
  .bento-grid { grid-template-columns: repeat(3, 1fr); }

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

  .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); }
}

/* ==========================================================================
   NEW TEMPLATE CLASSES — hero, sidebar, sections, cards
   ========================================================================== */

/* Map hero (full-width at top, CallejearDK style) */
.map-hero {
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 0;
}
.map-hero #map {
  height: 240px;
  width: 100%;
}

/* Street header strip */
.street-header {
  padding: .75rem 0 .5rem;
}
.street-header__info {
  margin-bottom: .5rem;
}
.street-header .hero-badge { margin-bottom: .5rem; }
.street-header .hero-title { margin-bottom: 4px; }
.street-header .hero-subtitle { color: var(--ink-muted); }
.street-header__pills {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.data-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 500; color: var(--ink-muted);
  background: var(--surface-low); border: 1px solid var(--border-soft);
  white-space: nowrap;
}

/* Dashboard strip: score + analysis + key stats */
.dashboard-strip {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1.25rem 0 1.5rem;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 1.5rem;
}

/* Score gauge */
.dash-score {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 1rem;
  background: var(--primary); color: #fff;
  border-radius: var(--radius-xl);
}
.dash-score__gauge {
  position: relative; width: 100px; height: 100px;
  display: flex; align-items: center; justify-content: center;
}
.dash-score__ring {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.dash-score__ring circle:first-child { stroke: rgba(255,255,255,.2); }
.dash-score__ring circle:last-child { stroke: #fff; }
.dash-score__number {
  font-size: var(--text-3xl); font-weight: 900; line-height: 1;
  z-index: 1;
}
.dash-score__label {
  font-size: var(--text-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--tracking-widest); margin-top: .75rem;
  opacity: .8;
}
.dash-score__desc {
  font-size: var(--text-sm); font-weight: 600; margin-top: 2px;
}
.dash-score__compare {
  font-size: var(--text-xs); opacity: .7; margin-top: 4px;
}

/* Analysis summary (dashboard) */
.dash-analysis {
  padding: 1.25rem; background: var(--surface-low);
  border-radius: var(--radius-xl); border-left: 4px solid var(--primary);
}
.dash-analysis__title {
  font-size: var(--text-sm); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--tracking-widest); color: var(--primary); margin-bottom: .75rem;
}
.dash-analysis__text {
  font-size: var(--text-sm); line-height: 1.7; color: var(--ink-muted);
  font-style: italic;
}

/* Key stat cards (dashboard) */
.dash-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem;
}
.dash-stat {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 1rem; background: var(--surface-container);
  border-radius: var(--radius-xl);
}
.dash-stat__value {
  font-size: var(--text-xl); font-weight: 900; color: var(--ink);
}
.dash-stat__label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  color: var(--outline); letter-spacing: var(--tracking-widest); margin-top: 4px;
}

/* Sidebar Navigation */
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar-nav__item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--radius-lg);
  font-size: var(--text-sm); font-weight: 500; color: var(--ink-muted);
  text-decoration: none; transition: background .15s, color .15s;
}
.sidebar-nav__item:hover { background: var(--surface-low); color: var(--ink); }
.sidebar-nav__item.active {
  background: var(--surface-highest); color: var(--primary); font-weight: 700;
}

/* Score box (sidebar) */
.score-box {
  background: var(--primary); color: #fff; border-radius: var(--radius-xl);
  padding: 1.5rem; margin-top: 1.5rem;
}
.score-box .data-label { color: rgba(255,255,255,.7); }
.score-box__value { font-size: var(--text-4xl); font-weight: 900; margin: .5rem 0; }
.score-box__desc { font-size: var(--text-xs); opacity: .85; line-height: 1.5; margin-top: .75rem; }
.score-box__compare { font-size: var(--text-xs); opacity: .7; margin-top: .25rem; }
.score-box .progress-bar { background: rgba(255,255,255,.2); }
.score-box .progress-bar__fill { background: #fff; }

/* Section titles */
.section-title {
  font-size: var(--text-sm); font-weight: 700; text-transform: uppercase;
  letter-spacing: var(--tracking-widest); color: var(--primary); margin-bottom: 1.5rem;
}
.section-subtitle {
  font-size: var(--text-lg); color: var(--ink-muted); max-width: 40rem; line-height: 1.6;
}
.bento-section { /* generic wrapper for named sections */ }

/* Identification section */
.id-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.id-left { }
.id-right { display: flex; flex-direction: column; justify-content: center; }
.data-pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.data-pairs dt { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--outline); }
.data-pairs dd { font-size: var(--text-lg); font-weight: 700; margin: 2px 0 0; }
.analysis-summary-card {
  background: var(--surface-low); border-radius: var(--radius-xl); padding: 1.5rem;
  display: flex; flex-direction: column; justify-content: center;
}
.id-quick-stats { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }

/* Quick stats (hero-adjacent) */
.quick-stat {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 600; background: var(--surface-low);
}
.quick-stat__value { font-weight: 700; }
.quick-stat__label { color: var(--ink-muted); }
.quick-stat--gold { background: #fdf6e3; color: var(--price); }
.quick-stat--blue { background: #e8f0fa; color: var(--demo); }
.quick-stat--green { background: var(--primary-bg); color: var(--primary); }
.quick-stat--purple { background: #f0eaf8; color: var(--transport); }

/* Price section */
.price-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.price-card {
  background: var(--surface-white); border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl); padding: 1.5rem;
}
.price-card--main { border-left: 3px solid var(--price); }
.price-value { font-size: var(--text-2xl); font-weight: 900; color: var(--price); }
.price-value--trend { color: var(--ink); }
.price-comparisons { margin-top: .5rem; }
.price-compare { font-size: var(--text-xs); color: var(--ink-muted); }
.price-badge {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 600; margin-top: .25rem;
}
.price-badge--above { background: #fce4e4; color: var(--danger); }
.price-badge--below { background: #e3f5e8; color: var(--nature); }

/* Analysis section */
.analysis-col { }
.profile-col { }

/* Scores grid */
.scores-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
.score-card--teal .score-bar .score-bar-fill { background: var(--score); }
.score-card--green .score-bar .score-bar-fill { background: var(--nature); }
.score-card--purple .score-bar .score-bar-fill { background: var(--transport); }
.score-card--nature .score-bar .score-bar-fill { background: var(--nature); }
.score-card--blue .score-bar .score-bar-fill { background: var(--demo); }

/* Methodology details */
.methodology-details summary { cursor: pointer; font-weight: 700; }

/* Services + Transport combined layout */
.servicos-layout { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.servicos-facilities { }
.servicos-transport {
  background: var(--primary); color: #fff; border-radius: var(--radius-xl); padding: 1.5rem;
}
.servicos-transport .section-title { color: rgba(255,255,255,.7); }
.servicos-transport .data-label { color: rgba(255,255,255,.7); }
.transport-stat { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0; }
.transport-value { font-weight: 700; }
.transport-score-wrap {
  padding-top: 1rem; margin-top: .5rem; border-top: 1px solid rgba(255,255,255,.15);
}

/* Risk cards */
.risk-cards { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.risk-card {
  background: var(--surface-white); border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl); padding: 1.5rem;
}
.risk-card--fire { border-left: 3px solid var(--danger); }
.risk-card--seismic { border-left: 3px solid var(--warn); }
.risk-card--air { border-left: 3px solid var(--score); }
.risk-card__title { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; color: var(--outline); margin-bottom: .75rem; }
.risk-card__desc { font-size: var(--text-xs); color: var(--ink-muted); margin-top: .75rem; }
.risk-value { font-size: var(--text-2xl); font-weight: 900; }

/* Demographics section */
.demo-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.demo-stat-card {
  background: var(--surface-white); border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl); padding: 1.25rem; text-align: center;
}
.demo-value { font-size: var(--text-2xl); font-weight: 900; }
.demo-bars { margin-top: 1.5rem; }
.demo-bar-item { margin-bottom: 1rem; }
.demo-bar-value { display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; margin-bottom: 4px; }

/* Technical details */
.tech-details summary { cursor: pointer; font-weight: 700; }

/* Nearby streets pills */
.nearby-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.nearby-pill {
  display: inline-block; padding: 8px 16px; border-radius: var(--radius-pill);
  background: var(--surface-white); border: 1px solid var(--border-soft);
  font-size: var(--text-xs); font-weight: 700; color: var(--ink-muted);
  text-decoration: none; transition: color .15s, border-color .15s;
}
.nearby-pill:hover { color: var(--primary); border-color: var(--primary); }
.nearby-pill__score { font-size: var(--text-xs); color: var(--ink-muted); margin-left: 4px; }

/* Section modifiers (ID anchors) */
.section--id, .section--precos, .section--analise, .section--scores,
.section--map, .section--servicos, .section--riscos, .section--demo,
.section--tech, .section--seo, .section--faq, .section--rankings,
.section--nearby, .section--sources, .section--methodology { /* anchor targets */ }

/* ───── HOME PAGE ───── */
.hero { position: relative; padding: 4rem 0; text-align: center; }
.hero--interior { padding: 2rem 0 3rem; text-align: left; }
.hero-inner { max-width: 56rem; margin: 0 auto; }
.hero em { color: var(--primary); font-style: italic; }
.hero-search {
  max-width: 48rem; margin: 0 auto;
  background: var(--surface-white); border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl); padding: .5rem;
  display: flex; align-items: stretch; gap: .5rem;
  box-shadow: 0 12px 32px rgba(42,52,57,.06);
}
.hero-search .search-input--hero {
  flex: 1; border: none; background: transparent; font-size: var(--text-lg);
  padding: 1rem; outline: none;
}
.hero-search .btn-primary { white-space: nowrap; }
.hero-stat { text-align: left; }
.hero-stat__value { font-size: var(--text-3xl); font-weight: 900; color: var(--primary); display: block; }
.hero-stat__label {
  font-size: var(--text-sm); font-weight: 500; color: var(--ink-muted);
  text-transform: uppercase; letter-spacing: var(--tracking-wide);
}

/* Value proposition */
.section-value { padding: 4rem 0; background: var(--surface-low); }
.section-value__inner { max-width: 1440px; margin: 0 auto; padding: 0 2rem; display: flex; flex-wrap: wrap; gap: 3rem; align-items: center; }
.section-value__lead { flex: 1; min-width: 280px; }
.section-value__desc { font-size: var(--text-lg); color: var(--ink-muted); line-height: 1.6; }
.source-pills { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.source-pills .pill { background: var(--surface-highest); color: var(--primary); }

/* Regions grid */
.section-regions { padding: 4rem 0; }
.section-regions__header { margin-bottom: 3rem; }
.regions-grid {
  display: grid; grid-template-columns: 1fr; gap: 1.5rem;
}
.region-card {
  background: var(--surface-white); border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl); padding: 1.5rem; transition: box-shadow .2s;
}
.region-card:hover { box-shadow: 0 12px 32px rgba(42,52,57,.06); }
.region-card__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.region-card__name { font-size: var(--text-xl); font-weight: 900; }
.region-card__concelhos { display: grid; grid-template-columns: repeat(2, 1fr); gap: .25rem .75rem; }
.region-card__concelhos a { font-size: var(--text-sm); color: var(--ink-muted); text-decoration: none; padding: 2px 0; }
.region-card__concelhos a:hover { color: var(--primary); }

/* ───── CONCELHO PAGE ───── */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 2rem;
}
.filter-bar__inner { flex: 1; max-width: 36rem; }
.filter-bar__sort { font-size: var(--text-sm); font-weight: 700; color: var(--ink-muted); }
.search-input--filter {
  width: 100%; padding: .75rem 1rem; border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); background: var(--surface-white);
  font-size: var(--text-base);
}
.streets-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.street-card {
  background: var(--surface-white); border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg); padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  transition: box-shadow .15s;
}
.street-card:hover { box-shadow: 0 4px 12px rgba(42,52,57,.06); }
.street-card__name { font-weight: 700; }
.street-card__name a { color: var(--ink); text-decoration: none; }
.street-card__name a:hover { color: var(--primary); }
.street-card__stats { display: flex; align-items: center; gap: .75rem; }
.section-rankings, .section-streets { margin-bottom: 2rem; }
.ranking-link {
  display: inline-block; padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--surface-low); color: var(--ink-muted);
  text-decoration: none; font-size: var(--text-sm); font-weight: 600;
  transition: color .15s, background .15s;
}
.ranking-link:hover { background: var(--primary-bg); color: var(--primary); }

/* ───── HEADER LAYOUT ───── */
.header-left { display: flex; align-items: center; gap: 1rem; }
.header-nav { display: none; align-items: center; gap: 2rem; }
.header-nav a { color: var(--ink-muted); text-decoration: none; font-weight: 500; font-size: var(--text-sm); }
.header-nav a:hover { color: var(--primary); }
.header-right { display: flex; align-items: center; gap: .75rem; }

/* ───── FOOTER BRAND ───── */
.footer-brand { }
.footer-brand .brand { color: var(--primary-light); }
.footer-brand .brand .brand-pt { color: var(--ink-soft); }

/* ───── MOBILE BOTTOM BAR ITEMS ───── */
.mobile-bottom-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4px 16px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .05em; font-weight: 500; color: var(--ink-muted);
  text-decoration: none;
}
.mobile-bottom-item.active { color: var(--primary); font-weight: 700; }

/* ───── DESKTOP RESPONSIVE ADDITIONS ───── */
@media (min-width: 768px) {
  .header-nav { display: flex; }
  .id-grid { grid-template-columns: 2fr 1fr; }
  .price-grid { grid-template-columns: repeat(3, 1fr); }
  .risk-cards { grid-template-columns: repeat(3, 1fr); }
  .demo-stats { grid-template-columns: repeat(4, 1fr); }
  .scores-grid { grid-template-columns: repeat(3, 1fr); }
  .servicos-layout { grid-template-columns: 3fr 2fr; }
  .streets-grid { grid-template-columns: repeat(2, 1fr); }
  .regions-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-strip { grid-template-columns: auto 1fr auto; }
  .dash-stats { grid-template-columns: repeat(2, 1fr); }
  .map-hero #map { height: 280px; }
}

@media (min-width: 1024px) {
  .scores-grid { grid-template-columns: repeat(5, 1fr); }
  .streets-grid { grid-template-columns: repeat(3, 1fr); }
  .regions-grid { grid-template-columns: repeat(3, 1fr); }
  .region-card__concelhos { grid-template-columns: repeat(3, 1fr); }
  .map-hero #map { height: 320px; }
  .dash-stats { grid-template-columns: repeat(4, 1fr); }
}

/* --- 1280px: large desktop --- */
@media (min-width: 1280px) {
  .bento-sidebar { width: 300px; }
}

/* ==========================================================================
   41. SMALL SCREEN OVERRIDES (max-width)
   ========================================================================== */
@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; }
  .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 767px) {
  .grid-1-2, .grid-1-3, .grid-2-3, .grid-3-2 { grid-template-columns: 1fr; }
}

/* ==========================================================================
   42. REDUCED MOTION
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ==========================================================================
   43. PRINT
   ========================================================================== */
@media print {
  .site-header,
  .mobile-bottom-bar,
  .cookie-banner,
  .nav-sidebar,
  .search-box { display: none !important; }

  body { background: #fff; color: #000; padding-bottom: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; }
  a { color: #000; }
  .wrap { max-width: 100%; padding: 0; }
}
