/* PRenDatos design system. Change tokens here to restyle all three pages.
   No web fonts are required: the system stack is fast and works offline. */
:root {
  color-scheme: light;
  --ink: #163143; --muted: #5b6f7c; --paper: #f5f8f9; --surface: #fff;
  --line: #dde5e8; --teal: #087f78; --teal-soft: #e5f4f1;
  --negative: #ad583e; --recession: #e3e5e7; --neutral: #dce2e5;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px; line-height: 1.55; color: var(--ink); background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: #066b65; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
button, input { font: inherit; }
button, .map-area, .year-hit { cursor: pointer; }
button { border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 8px; padding: 9px 15px; min-height: 44px; }
button:hover { background: var(--teal-soft); }
button[aria-pressed="true"] { background: var(--ink); color: white; border-color: var(--ink); }
:focus-visible { outline: 3px solid #299bba; outline-offset: 4px; }
[hidden] { display: none !important; }
.skip-link { position: absolute; top: -100px; left: 20px; padding: 12px; background: white; z-index: 20; }
.skip-link:focus { top: 12px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner, main, .footer-inner { max-width: 1160px; margin: auto; padding-left: 32px; padding-right: 32px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; min-height: 100px; }
.brand { display: block; flex-shrink: 0; }
.brand img { display: block; width: 249px; height: 54px; }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.site-nav a { padding: 10px 13px; border-radius: 7px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; }
.site-nav a[aria-current="page"] { color: #066b65; background: var(--teal-soft); }
.site-nav a:hover { color: var(--ink); }
main { padding-top: 44px; padding-bottom: 64px; }
.eyebrow { margin: 0 0 8px; color: #066b65; font-weight: 600; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
h1 { font-size: clamp(28px, 4vw, 40px); line-height: 1.15; letter-spacing: -.035em; margin: 0 0 14px; font-weight: 600; }
h2 { font-size: 21px; line-height: 1.35; letter-spacing: -.015em; margin: 0; font-weight: 600; }
h3 { font-size: 16px; margin: 0 0 8px; }
p { margin: 0 0 12px; }
.intro { color: var(--muted); max-width: 760px; margin-bottom: 24px; }
.metadata { display: flex; gap: 10px 30px; flex-wrap: wrap; margin: 0 0 30px; font-size: 13px; }
.metadata div { display: flex; gap: 8px; }
.metadata dt { color: var(--muted); }
.metadata dd { margin: 0; font-weight: 600; }
.chart-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 25px 28px 22px; position: relative; }
.chart-heading { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.chart-heading p { color: var(--muted); font-size: 13px; margin-top: 4px; margin-bottom: 0; }
.headline-value { font-size: 28px; letter-spacing: -.03em; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.headline-value small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; letter-spacing: 0; margin-top: 6px; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 22px; color: var(--muted); font-size: 12px; margin: 12px 0; }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.swatch { width: 19px; height: 3px; display: inline-block; background: var(--teal); }
.swatch.recession { height: 11px; background: var(--recession); }
.swatch.negative { height: 11px; background: var(--negative); }
.swatch.positive { height: 11px; }
.chart { width: 100%; position: relative; }
.chart svg { display: block; max-width: 100%; overflow: visible; }
.chart svg text { font-family: inherit; font-size: 12px; fill: var(--muted); }
.chart svg .axis-title, .chart svg .value-label { fill: var(--ink); }
.chart svg .grid line { stroke: var(--line); }
.chart svg .domain { display: none; }
.chart .focus-year:focus-visible rect { stroke: var(--teal); stroke-width: 2; }
.chart-status { min-height: 22px; margin-top: 10px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.chart-hint, .small-note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.tooltip { position: absolute; z-index: 5; width: 270px; max-width: calc(100% - 12px); background: var(--ink); color: white; padding: 15px 17px; border-radius: 10px; box-shadow: 0 7px 24px #16314320; pointer-events: none; font-size: 13px; }
.tooltip[data-pinned="true"] { pointer-events: auto; }
.tooltip p { margin: 0; }
.tooltip strong { font-weight: 600; }
.tooltip .tip-muted { color: #ccdce5; font-size: 12px; }
.tooltip .tip-title { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.tooltip .tip-value { font-size: 19px; margin: 10px 0; font-variant-numeric: tabular-nums; }
.tooltip dl { margin: 0; }
.tooltip dl div { display: flex; justify-content: space-between; gap: 12px; margin: 5px 0; }
.tooltip dt { color: #ccdce5; }
.tooltip dd { margin: 0; font-variant-numeric: tabular-nums; }
.tooltip button { border: 0; background: transparent; color: white; padding: 0 6px; min-height: 30px; }
.tooltip svg text { fill: white; font-size: 11px; }
.map-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 14px; margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--line); }
/* The area panel stays in normal document flow. Only its contents change on
   hover; its reserved slots keep long names and notes from shifting the map. */
.permits-explorer { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; margin-top: 20px; }
.permits-map-column { min-width: 0; }
.area-details { min-width: 0; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.area-details-heading { min-height: 96px; }
.area-details h3 { font-size: 19px; line-height: 1.3; margin: 0 0 7px; }
.area-details-heading p { font-size: 12px; color: var(--muted); margin: 0; }
.area-details-value { margin: 12px 0 18px; font-variant-numeric: tabular-nums; }
.area-details-value strong { display: block; font-size: 29px; line-height: 1.15; font-weight: 600; }
.area-details-value span { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.area-details dl { margin: 0; font-size: 13px; }
.area-details dl div { display: flex; justify-content: space-between; gap: 10px; margin: 8px 0; }
.area-details dt { color: var(--muted); }
.area-details dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.area-trend { margin-top: 17px; width: 100%; }
.area-trend svg { display: block; width: 100%; }
.area-trend text { font-size: 12px; fill: var(--muted); }
.area-details-note { min-height: 54px; font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.toggle { display: flex; gap: 5px; }
.map-area:focus-visible path { stroke: var(--ink); stroke-width: 2; }
.color-key { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.color-ramp { width: 120px; height: 10px; }
.color-gray { width: 12px; height: 12px; background: var(--neutral); }
.documentation { display: grid; grid-template-columns: 1fr 1fr; gap: 42px; margin-top: 30px; font-size: 14px; }
.documentation p, .documentation li { color: var(--muted); }
.documentation ul { padding-left: 18px; margin: 8px 0 0; }
.source-id { overflow-wrap: anywhere; }
.downloads { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; font-size: 13px; }
.data-disclosure { border-top: 1px solid var(--line); margin-top: 26px; padding-top: 18px; }
summary { cursor: pointer; font-weight: 600; }
.table-scroll { overflow: auto; max-height: 420px; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: 9px 12px; white-space: nowrap; }
th { font-weight: 600; position: sticky; top: 0; background: var(--surface); }
td.num { font-variant-numeric: tabular-nums; text-align: right; }
caption { text-align: left; color: var(--muted); margin-bottom: 8px; }
.site-footer { border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.footer-inner { padding-top: 24px; padding-bottom: 24px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.chart-error { padding: 18px; border-left: 3px solid var(--negative); background: #fcf2ed; }
/* Tablet and mobile: keep readable type, shrink the chart's own geometry. */
@media (max-width: 900px) {
  .permits-explorer { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .area-details-heading { min-height: 74px; }
}
@media (max-width: 760px) {
  .header-inner { flex-direction: column; align-items: flex-start; padding-top: 20px; padding-bottom: 14px; gap: 14px; }
  .header-inner, main, .footer-inner { padding-left: 20px; padding-right: 20px; }
  .site-nav { gap: 2px; }
  .site-nav a { padding: 9px 10px; font-size: 13px; }
  main { padding-top: 30px; }
  .chart-panel { padding: 20px 16px; }
  .metadata { gap: 8px 22px; }
  .documentation { grid-template-columns: 1fr; gap: 20px; }
  .headline-value { font-size: 24px; }
}
@media (max-width: 380px) {
  .header-inner, main, .footer-inner { padding-left: 12px; padding-right: 12px; }
  .chart-panel { padding: 18px 10px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
@media print {
  body { background: white; }
  .site-nav, .downloads, .toggle, .tooltip, .chart-hint, .skip-link { display: none !important; }
  .header-inner { min-height: 75px; }
  main { padding: 20px; }
  .chart-panel { break-inside: avoid; }
}
