/* ==================================================================
   Guia das UCs Estaduais do Pará — atlas editorial
   Irmão do Visualizador: Rawline, verde NGEO, tema claro por padrão.
   Conteúdo em listas editoriais; bordas só em controles.
   ================================================================== */
@font-face {
  font-family: "Rawline";
  src: url("../fonts/rawline/rawline-400.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Rawline";
  src: url("../fonts/rawline/rawline-600.woff2") format("woff2");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Rawline";
  src: url("../fonts/rawline/rawline-700.woff2") format("woff2");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --paper: #f7f4ee;
  --paper-2: #fbf9f4;
  --surface: #fffdf9;
  --ink: #1c2a2e;
  --ink-2: #48575b;
  --muted: #6f7c80;
  --line: #d9d3c7;
  --line-strong: #bdb6a9;
  --green: #15803d;
  --green-dark: #0b5d3b;
  --green-soft: #e9f3ec;
  --amber: #b45309;
  --amber-soft: #fbf0e3;
  --blue: #1351b4;
  --blue-soft: #eaf1fb;
  --map-bg: #e9eee9;
  --max: 1240px;
  --header-h: 66px;
  color-scheme: light;
}

[data-theme="dark"] {
  --paper: #0d1b15;
  --paper-2: #10221a;
  --surface: #12261c;
  --ink: #e9f0e9;
  --ink-2: #c2d0c6;
  --muted: #95a89c;
  --line: #274334;
  --line-strong: #3a5b47;
  --green: #4ade80;
  --green-dark: #86efac;
  --green-soft: #133021;
  --amber: #fbbf24;
  --amber-soft: #2a2314;
  --blue: #7fb0ff;
  --blue-soft: #12243d;
  --map-bg: #0a1511;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Rawline", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { display: block; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.wrap { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace; }
.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;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--surface); color: var(--ink); padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: 3px; font-weight: 700;
}
.skip-link:focus { top: 12px; }

/* ------------------------------------------------------------------ */
/* Header                                                             */
/* ------------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 26px;
  min-height: var(--header-h);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none; flex: none;
}
.brand:hover { text-decoration: none; }
.brand img { width: 32px; height: 32px; border-radius: 9px; }
.brand-text strong { display: block; font-size: 13.5px; line-height: 1.1; font-weight: 700; }
.brand-text span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--muted); line-height: 1.1; }
.nav { display: flex; gap: 22px; font-size: 13px; font-weight: 600; }
.nav a {
  color: var(--ink-2); padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--green-dark); text-decoration: none; }
.nav a.active { color: var(--green-dark); border-bottom-color: var(--green); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.header-search {
  display: flex; align-items: center; gap: 7px;
  border-bottom: 1px solid var(--line-strong); padding: 5px 2px;
  color: var(--muted);
}
.header-search svg { width: 14px; height: 14px; flex: none; }
.header-search input {
  width: 190px; border: 0; background: transparent; padding: 0;
  font-size: 12px; color: var(--ink); outline: none;
}
.header-search input::placeholder { color: var(--muted); }
.theme-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border: 0; background: transparent;
  color: var(--ink-2); border-radius: 3px;
}
.theme-btn:hover { background: var(--paper-2); color: var(--ink); }
.theme-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: none; }

/* ------------------------------------------------------------------ */
/* Home — hero e números                                              */
/* ------------------------------------------------------------------ */
.hero { padding: 48px 0 26px; }
.eyebrow {
  display: inline-block; font-family: ui-monospace, Consolas, monospace;
  font-size: 9.5px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--green-dark);
}
.hero h1 {
  margin: 10px 0 10px; max-width: 920px;
  font-size: clamp(32px, 4.4vw, 46px); line-height: 1.06;
  letter-spacing: -.03em; font-weight: 700;
}
.hero .lead {
  margin: 0; max-width: 760px; color: var(--ink-2);
  font-size: 16px; line-height: 1.6;
}
.stats {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-top: 28px; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.stat { padding: 14px 18px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat strong {
  display: block; font-family: ui-monospace, Consolas, monospace;
  font-size: 21px; letter-spacing: -.03em; color: var(--green-dark);
  line-height: 1.2; font-weight: 700;
}
.stat span {
  display: block; margin-top: 3px; font-size: 9px; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
}
.stat-line {
  margin-top: 9px; font-family: ui-monospace, Consolas, monospace;
  font-size: 10px; color: var(--muted); letter-spacing: .02em;
}

/* ------------------------------------------------------------------ */
/* Filtros                                                            */
/* ------------------------------------------------------------------ */
.filters { padding: 22px 0 16px; border-bottom: 1px solid var(--line); }
.filters-grid {
  display: grid; grid-template-columns: 1.7fr repeat(4, minmax(0, .82fr)) auto;
  gap: 20px; align-items: end;
}
.filter { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.filter label {
  font-size: 9px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.filter input, .filter select {
  width: 100%; border: 0; border-bottom: 1px solid var(--line-strong);
  border-radius: 0; background: transparent; padding: 7px 0;
  font-size: 13px; color: var(--ink); outline: none;
}
.filter input::placeholder { color: var(--muted); }
.filter input:focus, .filter select:focus { border-bottom-color: var(--green); }
.filter-actions { display: flex; align-items: flex-end; padding-bottom: 2px; }
.clear-btn {
  border: 0; background: transparent; padding: 4px 0;
  color: var(--green-dark); font-size: 11.5px; font-weight: 700;
  text-decoration: underline; text-underline-offset: 2px;
}
.clear-btn:disabled { color: var(--muted); text-decoration: none; cursor: default; }

/* ------------------------------------------------------------------ */
/* Resultados + mapa                                                  */
/* ------------------------------------------------------------------ */
.results-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0 10px; flex-wrap: wrap;
}
.results-count { font-size: 11.5px; color: var(--muted); }
.results-count strong { color: var(--ink); font-family: ui-monospace, Consolas, monospace; }
.results-tools { display: flex; align-items: center; gap: 14px; font-size: 11px; color: var(--muted); }
.sort { display: inline-flex; align-items: center; gap: 5px; }
.sort select {
  border: 0; border-bottom: 1px solid var(--line-strong);
  background: transparent; padding: 3px 0; font-size: 11.5px;
  color: var(--ink); outline: none;
}
.home-grid {
  display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: 40px; align-items: start; padding-bottom: 44px;
}
.results { min-width: 0; }
.uc-row {
  position: relative; display: block; padding: 18px 0 17px;
  border-bottom: 1px solid var(--line); color: var(--ink);
  text-decoration: none;
}
.uc-row:hover, .uc-row:focus-visible, .uc-row.is-active {
  text-decoration: none;
  box-shadow: inset 2px 0 0 var(--green);
}
.uc-row.is-active .uc-row-title { color: var(--green-dark); }
.uc-row-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  font-family: ui-monospace, Consolas, monospace; font-size: 9px;
  font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--muted);
}
.uc-row-meta .sep { color: var(--line-strong); font-weight: 400; }
.uc-row-meta .cat { color: var(--green-dark); }
.uc-row-meta .us { color: var(--amber); }
.uc-row-title {
  margin: 5px 0 4px; font-size: 16.5px; line-height: 1.25;
  letter-spacing: -.015em; font-weight: 700;
}
.uc-row:hover .uc-row-title { color: var(--green-dark); }
.uc-row-facts {
  font-family: ui-monospace, Consolas, monospace; font-size: 10.5px;
  color: var(--muted);
}
.uc-row-summary {
  margin: 7px 0 6px; max-width: 590px; color: var(--ink-2);
  font-size: 13px; line-height: 1.55;
}
.uc-row-cta { font-size: 10.5px; font-weight: 700; color: var(--green-dark); }
.empty {
  padding: 38px 0; color: var(--muted); font-size: 14px;
  border-bottom: 1px solid var(--line);
}

/* mapa */
.map-figure {
  position: sticky; top: calc(var(--header-h) + 22px);
  margin: 0; min-width: 0;
}
.map-toggle { display: none; }
.map-frame {
  position: relative; height: min(62vh, 620px); min-height: 430px;
  background: var(--map-bg);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden;
}
#map { position: absolute; inset: 0; z-index: 1; }
.map-loading {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  background: var(--map-bg); color: var(--muted);
  font-size: 11px; font-family: ui-monospace, Consolas, monospace;
  transition: opacity .2s ease;
}
.map-loading.is-done { opacity: 0; pointer-events: none; }
.side-map-loading.is-done { opacity: 0; pointer-events: none; }
.map-legend {
  position: absolute; left: 12px; bottom: 12px; z-index: 4;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 2px; padding: 8px 10px; font-size: 10px;
  color: var(--ink-2); line-height: 1.7;
}
.map-legend b {
  display: block; font-family: ui-monospace, Consolas, monospace;
  font-size: 8px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 2px;
}
.map-legend .dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  margin-right: 5px; vertical-align: middle;
}
.map-caption {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; padding-top: 9px; font-size: 10.5px; color: var(--muted);
}
.map-caption a { color: var(--green-dark); font-weight: 700; }
.map-caption a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* Temas na home                                                      */
/* ------------------------------------------------------------------ */
.themes {
  padding: 16px 0 46px; border-top: 1px solid var(--line);
}
.themes-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px; margin-top: 14px;
}
.theme {
  border-top: 2px solid var(--green); padding-top: 12px;
  color: var(--ink); text-decoration: none;
}
.theme:hover { text-decoration: none; }
.theme:hover h2 { color: var(--green-dark); }
.theme-kicker {
  font-family: ui-monospace, Consolas, monospace; font-size: 8.5px;
  font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--green-dark);
}
.theme h2 {
  margin: 5px 0 5px; font-size: 16px; line-height: 1.25;
  letter-spacing: -.01em;
}
.theme p { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }
.source-note {
  padding: 14px 0 20px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11.5px;
}
.source-note b { color: var(--ink-2); }
.source-note a { color: var(--green-dark); }

/* ------------------------------------------------------------------ */
/* Footer                                                             */
/* ------------------------------------------------------------------ */
.site-footer {
  border-top: 1px solid var(--line); padding: 26px 0 40px;
  color: var(--muted); font-size: 11px;
}
.footer-inner {
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.footer-inner strong { color: var(--ink-2); }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--ink-2); }

/* ------------------------------------------------------------------ */
/* Perfil                                                             */
/* ------------------------------------------------------------------ */
.crumbs {
  padding: 16px 0; border-bottom: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}
.crumbs a { color: var(--muted); }
.crumbs span { color: var(--ink-2); }
.profile-head { padding: 28px 0 24px; border-bottom: 1px solid var(--line); }
.profile-badges {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  font-family: ui-monospace, Consolas, monospace; font-size: 9px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted);
}
.profile-badges .cat { color: var(--green-dark); }
.profile-badges .us { color: var(--amber); }
.profile-badges .sep { color: var(--line-strong); font-weight: 400; }
.profile-head h1 {
  margin: 9px 0 10px; max-width: 920px;
  font-size: clamp(28px, 3.6vw, 40px); line-height: 1.08;
  letter-spacing: -.03em;
}
.profile-lead {
  margin: 0; max-width: 780px; color: var(--ink-2);
  font-size: 16px; line-height: 1.6;
}
.profile-actions {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 20px; margin-top: 18px;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; padding: 5px 0;
  color: var(--green-dark); font-size: 12px; font-weight: 700;
  text-decoration: none; line-height: 1.3;
}
.btn:hover { text-decoration: underline; text-underline-offset: 2px; }
.btn.primary {
  background: var(--blue); color: #fff; padding: 9px 14px;
  border-radius: 3px; text-decoration: none;
}
.btn.primary:hover { background: var(--blue); text-decoration: none; filter: brightness(1.08); }
.btn.muted { color: var(--muted); }
.profile-grid {
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, .9fr);
  gap: 52px; padding: 28px 0 48px; align-items: start;
}
.reading { min-width: 0; }
.reading-section {
  border-top: 1px solid var(--line);
  padding-top: 18px; margin-top: 24px;
}
.reading-section:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.reading h2 {
  margin: 0 0 9px; font-family: ui-monospace, Consolas, monospace;
  font-size: 9.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--green-dark);
}
.reading p {
  margin: 0 0 12px; color: var(--ink-2);
  font-size: 15.5px; line-height: 1.75;
}
.reading p:last-child { margin-bottom: 0; }
.reading .reading-note { font-size: 11px; color: var(--muted); line-height: 1.55; }
.reading ul { margin: 0 0 12px; padding-left: 18px; color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.reading li { margin-bottom: 4px; }
.reading a { color: var(--green-dark); font-weight: 600; }
.details { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 18px; }
.details summary {
  cursor: pointer; font-size: 12.5px; font-weight: 700;
  color: var(--green-dark); list-style: none;
}
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: " +"; color: var(--muted); }
.details[open] summary::after { content: " −"; }
.raw-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 12px; }
.raw-table th, .raw-table td {
  text-align: left; vertical-align: top; padding: 6px 10px 6px 0;
  border-bottom: 1px solid var(--line);
}
.raw-table th { width: 40%; color: var(--muted); font-weight: 400; }
.raw-table td { color: var(--ink-2); }

.sidebar { position: sticky; top: calc(var(--header-h) + 22px); display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.side-section { border-top: 1px solid var(--line); padding-top: 14px; }
.side-section:first-child { border-top: 0; padding-top: 0; }
.side-section h3 {
  margin: 0 0 8px; font-family: ui-monospace, Consolas, monospace;
  font-size: 9px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.facts { width: 100%; border-collapse: collapse; font-size: 12px; }
.facts td { padding: 6px 0; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.45; }
.facts td:first-child { width: 42%; color: var(--muted); }
.facts td:last-child { font-weight: 600; color: var(--ink-2); }
.facts tr:last-child td { border-bottom: 0; }
.facts-note { margin-top: 7px; font-size: 10px; color: var(--muted); line-height: 1.5; }
.side-map {
  position: relative; height: 190px; background: var(--map-bg);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.side-map #profileMap { position: absolute; inset: 0; z-index: 1; }
.side-map-loading {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  background: var(--map-bg); color: var(--muted); font-size: 10px;
}
.side-link { display: inline-block; margin-top: 8px; font-size: 11px; font-weight: 700; color: var(--green-dark); }
.official-band {
  background: var(--blue-soft); border-left: 3px solid var(--blue);
  padding: 12px 14px;
}
.official-band h3 { color: var(--blue); }
.official-band p { margin: 0 0 9px; font-size: 11px; line-height: 1.5; color: var(--ink-2); }
.official-band .btn { width: 100%; justify-content: center; background: var(--blue); color: #fff; padding: 8px 10px; border-radius: 3px; text-decoration: none; }
.official-band .btn:hover { text-decoration: none; filter: brightness(1.08); }
.visualizer-band {
  background: var(--green-soft); border-left: 3px solid var(--green);
  padding: 12px 14px;
}
.visualizer-band h3 { color: var(--green-dark); }
.visualizer-band p { margin: 0 0 9px; font-size: 11px; line-height: 1.5; color: var(--ink-2); }
.visualizer-band .btn { color: var(--green-dark); padding: 3px 0; }
.related-list { display: flex; flex-direction: column; }
.related-list a {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 0; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
}
.related-list a:last-child { border-bottom: 0; }
.related-list a:hover { color: var(--green-dark); }
.related-list small { color: var(--muted); font-size: 10px; }
.mobile-actions { display: none; }

/* ------------------------------------------------------------------ */
/* Páginas de temas e fontes                                          */
/* ------------------------------------------------------------------ */
.page-head { padding: 44px 0 24px; border-bottom: 1px solid var(--line); }
.page-head h1 {
  margin: 8px 0 8px; font-size: clamp(30px, 4vw, 42px);
  line-height: 1.08; letter-spacing: -.03em;
}
.page-head p { margin: 0; max-width: 760px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.theme-page { padding-bottom: 48px; }
.theme-section { padding: 30px 0 26px; border-bottom: 1px solid var(--line); }
.theme-section:last-child { border-bottom: 0; }
.theme-section h2 {
  margin: 0 0 7px; font-size: 24px; letter-spacing: -.02em;
  line-height: 1.15;
}
.theme-section .lead { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.category-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 44px;
}
.category-row {
  padding: 13px 0; border-bottom: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
}
.category-row:hover { text-decoration: none; }
.category-row:hover h3 { color: var(--green-dark); }
.category-row h3 { margin: 0 0 3px; font-size: 15px; letter-spacing: -.01em; }
.category-meta {
  font-family: ui-monospace, Consolas, monospace; font-size: 9px;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 5px;
}
.category-meta .pi { color: var(--green-dark); }
.category-meta .us { color: var(--amber); }
.category-row p { margin: 0; color: var(--ink-2); font-size: 12.5px; line-height: 1.55; }
.decade-chart { margin-top: 10px; }
.decade-row {
  display: grid; grid-template-columns: 86px minmax(0, 1fr) 44px 110px;
  gap: 12px; align-items: center; padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.decade-row:last-child { border-bottom: 0; }
.decade-label { font-weight: 700; color: var(--ink-2); }
.decade-bar { height: 7px; background: var(--green-soft); position: relative; }
.decade-bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); }
.decade-count { font-family: ui-monospace, Consolas, monospace; color: var(--green-dark); font-weight: 700; text-align: right; }
.decade-area { font-family: ui-monospace, Consolas, monospace; color: var(--muted); font-size: 10.5px; text-align: right; }
.prose { max-width: 760px; }
.prose p { color: var(--ink-2); font-size: 15px; line-height: 1.75; }
.prose h3 { margin: 20px 0 5px; font-size: 15px; }
.sources { max-width: 800px; }
.source-block { padding: 16px 0; border-bottom: 1px solid var(--line); }
.source-block h2 {
  margin: 0 0 6px; font-family: ui-monospace, Consolas, monospace;
  font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--green-dark);
}
.source-block p { margin: 0 0 7px; color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.source-block a { color: var(--green-dark); font-weight: 600; }
.source-list { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; line-height: 1.7; }
.source-list li { margin-bottom: 4px; }

/* ------------------------------------------------------------------ */
/* Estados / toast                                                    */
/* ------------------------------------------------------------------ */
.loading { padding: 80px 0; text-align: center; color: var(--muted); font-size: 12px; }
.error { padding: 60px 0; max-width: 640px; }
.error h1 { font-size: 24px; }
.error a { color: var(--green-dark); font-weight: 700; }
.noscript { width: min(var(--max), calc(100% - 48px)); margin: 40px auto; }
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: 100; max-width: min(440px, calc(100vw - 28px));
  padding: 9px 13px; background: var(--surface);
  border: 1px solid var(--line-strong); border-left: 3px solid var(--green);
  border-radius: 2px; color: var(--ink); font-size: 12px; font-weight: 600;
}
.toast[hidden] { display: none; }

/* ------------------------------------------------------------------ */
/* Leaflet                                                            */
/* ------------------------------------------------------------------ */
.leaflet-container {
  font-family: "Rawline", system-ui, sans-serif;
  background: var(--map-bg) !important;
}
.leaflet-control-zoom {
  border: 1px solid var(--line) !important;
  border-radius: 2px !important; box-shadow: none !important; overflow: hidden;
}
.leaflet-control-zoom a {
  background: var(--paper) !important; color: var(--ink) !important;
  border-bottom-color: var(--line) !important;
}
.leaflet-control-zoom a:hover { background: var(--paper-2) !important; }
.leaflet-control-attribution {
  background: var(--paper) !important; color: var(--muted) !important;
  font-size: 9px !important; padding: 2px 5px !important;
}
.leaflet-control-attribution a { color: var(--ink-2) !important; }
.leaflet-tooltip.uc-tooltip {
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 2px;
  box-shadow: none; padding: 4px 7px; font-size: 11px; font-weight: 600;
}
.leaflet-tooltip-top.uc-tooltip::before { border-top-color: var(--line-strong); }

/* Mapa base vetorial (OpenFreeMap via MapLibre GL Leaflet) */
.leaflet-container .maplibregl-map {
  position: absolute;
  inset: 0;
}
.leaflet-container .maplibregl-canvas {
  pointer-events: none;
  outline: none;
}
.leaflet-container .maplibregl-control-container { display: none; }

/* ------------------------------------------------------------------ */
/* Responsivo                                                         */
/* ------------------------------------------------------------------ */
@media (max-width: 1080px) {
  .home-grid { grid-template-columns: 1fr; gap: 0; }
  .map-figure { position: static; order: -1; margin-bottom: 10px; width: 100%; }
  .map-frame { display: none; height: 360px; min-height: 0; }
  .map-figure.is-open .map-frame { display: block; }
  .map-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    border: 0; background: transparent; padding: 6px 0;
    color: var(--green-dark); font-size: 11.5px; font-weight: 700;
    text-decoration: underline; text-underline-offset: 2px;
  }
  .map-caption { padding-top: 8px; }
  .profile-grid { grid-template-columns: 1fr; gap: 34px; }
  .sidebar { position: static; }
  .themes-grid { grid-template-columns: 1fr; gap: 24px; }
  .filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filter.search { grid-column: 1 / -1; }
  .filter-actions { grid-column: 1 / -1; padding-top: 2px; }
  .category-list { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .wrap { width: calc(100% - 32px); }
  .header-inner { flex-wrap: wrap; gap: 0 14px; padding: 10px 0 0; }
  .brand { padding-bottom: 9px; }
  .header-tools { margin-left: auto; padding-bottom: 9px; }
  .header-search { display: none; }
  .nav {
    order: 3; width: 100%; gap: 20px; padding: 8px 0 7px;
    border-top: 1px solid var(--line); font-size: 12px;
  }
  .nav a { padding: 2px 0 5px; }
  .hero { padding: 32px 0 20px; }
  .hero h1 { font-size: 30px; }
  .hero .lead { font-size: 15px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 22px; border-bottom: 0; }
  .stat { border-left: 0; border-top: 1px solid var(--line); padding: 11px 0; }
  .stat:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--line); }
  .stat:first-child { border-top: 0; }
  .stat:nth-child(2) { border-top: 0; }
  .stat:last-child { grid-column: 1 / -1; border-left: 0; padding-left: 0; }
  .filters-grid { grid-template-columns: 1fr 1fr; gap: 14px 18px; }
  .filter.search { grid-column: 1 / -1; }
  .filter-actions { grid-column: 1 / -1; }
  .results-bar { padding-top: 12px; }
  .results-tools { gap: 10px; }
  .uc-row { padding: 15px 0; }
  .uc-row-title { font-size: 15.5px; }
  .uc-row-summary { font-size: 12.5px; }
  .map-frame { height: 320px; }
  .profile-head { padding: 22px 0 20px; }
  .profile-head h1 { font-size: 26px; }
  .profile-lead { font-size: 15px; }
  .profile-grid { padding-top: 22px; }
  .reading p { font-size: 15px; }
  .mobile-actions {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    gap: 8px; padding: 9px 12px; background: var(--paper);
    border-top: 1px solid var(--line);
  }
  .mobile-actions .btn {
    flex: 1; justify-content: center; padding: 9px 8px;
    border: 1px solid var(--line-strong); border-radius: 3px;
    font-size: 11px; text-align: center;
  }
  .mobile-actions .btn.primary { border-color: var(--blue); }
  body.has-mobile-actions { padding-bottom: 64px; }
  .site-footer { padding-bottom: 74px; }
  .decade-row { grid-template-columns: 74px minmax(0, 1fr) 38px; }
  .decade-area { display: none; }
  .page-head { padding: 32px 0 20px; }
}

@media (max-width: 520px) {
  .wrap { width: calc(100% - 26px); }
  .hero h1 { font-size: 27px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stat strong { font-size: 18px; }
  .filters-grid { grid-template-columns: 1fr; }
  .filter.search, .filter-actions { grid-column: auto; }
  .results-tools { width: 100%; justify-content: space-between; }
  .map-frame { height: 290px; }
  .map-caption { flex-direction: column; gap: 4px; }
  .profile-head h1 { font-size: 23px; }
  .profile-actions { gap: 14px; }
  .profile-actions .btn.primary { width: 100%; justify-content: center; }
  .reading p { font-size: 14.5px; }
  .reading h2 { font-size: 9px; }
  .page-head h1 { font-size: 27px; }
  .category-list { gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  html { scroll-behavior: auto; }
}
