/* Paleta da comunicação (out/2026): preto, verde-escuro, verde, amarelo e oliva.
   Faixa do topo e destaques ficam iguais nos dois temas; o fundo muda entre claro e escuro. */
:root, [data-theme="light"] {
  --bg: #F4F6F1;
  --surface: #FFFFFF;
  --surface-2: #E6EEE4;
  --line: #CFDCCD;
  --text: #0B0B0B;
  --muted: #4E5D52;
  --red: #13843A;
  --red-ink: #0B6B32;
  --gold: #F9D21C;
  --gold-ink: #7A6400;
  --bf: #0D4F31;
  --bpc: #E2B70B;
  --inss: #6E7A3A;
  --map-0: #E6EFE2;
  --map-1: #0D4F31;
  --shadow: 0 1px 2px rgba(13,79,49,.06), 0 8px 24px rgba(13,79,49,.08);
  --brand-black: #0B0B0B;
  --brand-green: #0D4F31;
  --brand-green-2: #13843A;
  --brand-yellow: #F9D21C;
  --brand-olive: #4A5226;
  --brand-box: #3B4A27;
}
[data-theme="dark"] {
  --bg: #061F14;
  --surface: #0B3322;
  --surface-2: #11422D;
  --line: #1E5A3F;
  --text: #F2F6F0;
  --muted: #A9C4B3;
  --red: #13843A;
  --red-ink: #F9D21C;
  --gold: #F9D21C;
  --gold-ink: #F9D21C;
  --bf: #3FBF6F;
  --bpc: #F9D21C;
  --inss: #B7C46A;
  --map-0: #0E3A27;
  --map-1: #F9D21C;
  --shadow: 0 1px 2px rgba(0,0,0,.35), 0 8px 24px rgba(0,0,0,.3);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: 'Montserrat', system-ui, sans-serif; font-size: 1rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: 'Montserrat', system-ui, sans-serif; line-height: 1.08; margin: 0; letter-spacing: -0.01em; }
a { color: var(--red-ink); }
.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.evidence-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: .75rem; margin: 1.25rem 0 1.75rem; }
.evidence-guide span { border-left: 3px solid var(--line); padding: .5rem .75rem; font-size: .85rem; color: var(--muted); }
.evidence-guide strong { display: block; color: var(--text); }
.evidence-tag { display: inline-block; font-size: .75rem; font-weight: 700; color: var(--red-ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: .2rem .5rem; margin-bottom: .55rem; }
.data-note { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--gold-ink); padding: .65rem .9rem; max-width: 90ch; line-height: 1.55; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; font-weight: 700; color: var(--red-ink); margin: 0 0 .6rem; }

.top { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 1.5rem; height: 64px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--text); }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand strong { font-family: 'Montserrat'; font-size: 1.1rem; }
.brand small { color: var(--muted); font-size: .75rem; }
.nav { margin-left: auto; display: flex; gap: 1.2rem; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 500; font-size: .92rem; }
.nav a:hover { color: var(--text); }
.theme { background: none; border: 1px solid var(--line); color: var(--text); border-radius: 999px; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }

.hero { padding: clamp(3rem, 7vw, 6rem) 0 2.5rem; }
.hero h1 { font-size: clamp(2.2rem, 5.2vw, 4.2rem); font-weight: 800; max-width: 17ch; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.25rem); color: var(--muted); max-width: 62ch; margin: 1.4rem 0 2rem; }
.search label { display: block; font-weight: 700; margin-bottom: .5rem; }
.search-box { position: relative; max-width: 560px; }
.search-row { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: flex-end; }
.search-row .uf-select { flex: 0 0 auto; min-width: 12rem; }
.search-row .search-city { flex: 1 1 18rem; min-width: 0; }
.state-ref { max-width: 75ch; margin-top: .4rem; }
#q { width: 100%; font: inherit; font-size: 1.1rem; padding: 1rem 1.2rem; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
#q:focus { outline: none; border-color: var(--red); }
#sugestoes { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; list-style: none; margin: 0; padding: .3rem; box-shadow: var(--shadow); z-index: 4; max-height: 320px; overflow: auto; }
#sugestoes li { padding: .6rem .8rem; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; gap: 1rem; }
#sugestoes li small { color: var(--muted); }
#sugestoes li[aria-selected="true"], #sugestoes li:hover { background: var(--surface-2); }
.state-total { margin-top: 1.2rem; color: var(--muted); max-width: 70ch; }
.state-total strong { color: var(--text); }

.block { padding: clamp(2.5rem, 5vw, 4.5rem) 0; border-top: 1px solid var(--line); }
.block-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 2rem; flex-wrap: wrap; }
.block-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.8rem); font-weight: 800; }
.block-head .muted { max-width: 62ch; margin: .7rem 0 0; }

.btn { font: inherit; font-weight: 700; display: inline-flex; align-items: center; gap: .5rem; border-radius: 999px; padding: .75rem 1.2rem; border: none; cursor: pointer; }
.btn-share { background: var(--red); color: #fff; }
.btn-share:hover { filter: brightness(1.08); }
.head-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn-card { background: var(--brand-yellow); color: var(--brand-black); }
.btn-card:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--text); border: 1.5px solid var(--line); text-decoration: none; }
.card-dlg { border: 1px solid var(--line); border-radius: 18px; padding: 1.4rem; background: var(--surface); color: var(--text); width: min(720px, 94vw); max-height: 94vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.card-dlg::backdrop { background: rgba(20,12,8,.6); }
.card-dlg-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.25rem; gap: 1rem; }
.card-dlg-head h2 { font-size: 1.3rem; }
.card-kicker { color: var(--muted); font-size: .75rem; font-weight: 700; letter-spacing: .07em; margin: 0 0 .3rem; }
.card-city { font-size: .875rem; color: var(--muted); margin: .3rem 0 0; }
.dlg-x { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; width: 44px; height: 44px; flex-shrink: 0; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--text); }
.card-fmt { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; margin-bottom: .75rem; font-size: .875rem; }
.card-fmt label { cursor: pointer; display: flex; align-items: flex-start; gap: .5rem; padding: .7rem; min-height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.card-fmt label:has(input:checked) { border-color: var(--red-ink); background: var(--surface); }
.card-fmt label:focus-within { outline: 2px solid var(--red-ink); outline-offset: 2px; }
.card-fmt strong { display: block; line-height: 1.3; }
.card-fmt small { display: block; font-size: .75rem; color: var(--muted); margin-top: .25rem; line-height: 1.35; }
.card-fmt input { accent-color: var(--red-ink); margin-top: .1rem; flex-shrink: 0; }
.card-fmt + .card-fmt { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-prev { background: var(--surface-2); border-radius: 12px; padding: 1rem; display: flex; justify-content: center; border: 1px solid var(--line); }
.card-prev img { max-width: 100%; max-height: 58vh; border-radius: 6px; display: block; }
.card-act { display: flex; gap: .6rem; flex-wrap: wrap; margin: .9rem 0 .4rem; }
.card-act [aria-disabled="true"], .card-act :disabled { opacity: .55; cursor: wait; }
@media (max-width: 520px) {
  .card-dlg { padding: 1rem; }
  .card-fmt { grid-template-columns: 1fr; }
  .card-fmt label { padding: .6rem .7rem; }
  .card-fmt label span { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; }
  .card-fmt small { margin-top: 0; }
  .card-fmt + .card-fmt label span { display: block; }
  .card-prev { padding: .5rem; }
}

.big { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(1.4rem, 3vw, 2.4rem); box-shadow: var(--shadow); }
.big-label { margin: 0; font-weight: 700; color: var(--muted); }
.big-num { font-family: 'Montserrat'; font-weight: 800; font-size: clamp(2.6rem, 7vw, 5rem); line-height: 1; margin: .4rem 0; color: var(--red-ink); font-variant-numeric: tabular-nums; }
.big-sub { margin: 0 0 1.4rem; color: var(--muted); }
.bar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.bar span { display: block; height: 100%; transition: width .5s ease; }
.b-bf { background: var(--bf); } .b-bpc { background: var(--bpc); } .b-inss { background: var(--inss); }
.legend { list-style: none; padding: 0; margin: .9rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; font-size: .92rem; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .4rem; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1rem; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; }
.kpi h3 { font-family: 'Montserrat'; font-size: .85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.kpi .v { font-family: 'Montserrat'; font-weight: 800; font-size: 1.7rem; margin: .4rem 0 .2rem; font-variant-numeric: tabular-nums; }
.kpi .s { margin: 0; color: var(--muted); font-size: .9rem; }

.cross { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 2rem; }
.cross-card { border-top: 3px solid var(--red); padding-top: 1rem; }
.cross-card p { margin: 0; color: var(--muted); }
.cross-card p strong { color: var(--text); }
.select { min-width: 0; max-width: 100%; }
.select select { min-width: 0; max-width: 100%; width: 100%; }
.cross-num { font-family: 'Montserrat'; font-weight: 800; font-size: clamp(1.8rem, 3.4vw, 2.5rem); color: var(--text) !important; margin: 0 0 .3rem !important; font-variant-numeric: tabular-nums; }

.piso { margin-top: 2.5rem; display: grid; grid-template-columns: 1.4fr 1fr; gap: 2rem; background: var(--surface-2); border-radius: 20px; padding: clamp(1.4rem, 3vw, 2.4rem); align-items: center; }
.piso h3 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 800; }
.piso .muted { margin: .8rem 0 0; }
.piso-num { border-left: 3px solid var(--gold); padding-left: 1.4rem; }
.piso-num p { margin: 0; color: var(--muted); }

.select { display: flex; flex-direction: column; gap: .3rem; font-weight: 700; font-size: .85rem; color: var(--muted); }
.select select { font: inherit; font-size: 1rem; padding: .6rem .8rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.map-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 2rem; }
.map-box { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 1rem; }
#map { width: 100%; height: auto; display: block; }
#map path { stroke: var(--surface); stroke-width: .3; cursor: pointer; transition: opacity .15s; }
#map path:hover { stroke: var(--text); stroke-width: 1; }
#map path.sel { stroke: var(--gold); stroke-width: 2.2; }
.map-tip { position: absolute; pointer-events: none; background: var(--text); color: var(--bg); padding: .45rem .7rem; border-radius: 8px; font-size: .85rem; white-space: nowrap; transform: translate(-50%, -120%); }
.map-scale { display: flex; align-items: center; gap: .6rem; font-size: .8rem; color: var(--muted); margin: .4rem 0; }
.map-scale .grad { flex: 1; height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--map-0), var(--map-1)); max-width: 260px; }
.rank h3 { font-size: 1.3rem; margin-bottom: 1rem; }
.rank ol { margin: 0; padding: 0; list-style: none; counter-reset: r; }
.rank li { counter-increment: r; display: grid; grid-template-columns: 2rem 1fr auto; gap: .5rem; align-items: center; padding: .65rem 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.rank li::before { content: counter(r); font-family: 'Montserrat'; font-weight: 800; color: var(--muted); }
.rank li:hover span:first-child { color: var(--red-ink); }
.rank li span:last-child { font-variant-numeric: tabular-nums; font-weight: 700; }

.sim { display: grid; grid-template-columns: 1fr 1.6fr; gap: 2rem; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: clamp(1.4rem, 3vw, 2.4rem); }
.sim-label { font-family: 'Montserrat'; font-size: 1.5rem; font-weight: 800; display: block; margin-bottom: .8rem; }
.sim-label output { color: var(--red-ink); }
#pct { width: 100%; accent-color: var(--red); }
fieldset { border: 1px solid var(--line); border-radius: 12px; margin: 1.2rem 0; padding: .8rem 1rem; display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }
legend { font-weight: 700; font-size: .85rem; color: var(--muted); padding: 0 .3rem; }
fieldset label { display: flex; gap: .4rem; align-items: center; cursor: pointer; }
fieldset input { accent-color: var(--red); width: 18px; height: 18px; }
.sim-out { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.sim-out article { border-top: 3px solid var(--red); padding-top: .8rem; }
.sim-out p { margin: 0; color: var(--muted); }

.mei { margin-top: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--line, rgba(0,0,0,.12)); }
.mei-head { max-width: 62ch; margin-bottom: 1.25rem; }
.mei-head h3 { font-size: clamp(1.15rem, 1rem + .8vw, 1.5rem); line-height: 1.25; margin: .4rem 0 .6rem; }
.mei-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1rem; }
.tag { display: inline-block; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .25rem .55rem; border-radius: 12px; background: var(--red); color: var(--bg); margin-bottom: .6rem; }
.tag-alt { background: transparent; color: inherit; border: 1px solid currentColor; }
.claim .impact { margin-top: .75rem; padding-top: .75rem; border-top: 1px dashed rgba(127,127,127,.4); }
.note { margin-top: 1.25rem; max-width: 75ch; }
.debate { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.claim { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 1.3rem 1.4rem; }
.claim h3 { font-size: 1.2rem; margin-bottom: .6rem; }
.claim p { margin: 0 0 .8rem; color: var(--muted); }
.claim .impact { color: var(--text); }
.claim a { font-weight: 700; }

.method dl { display: grid; grid-template-columns: 200px 1fr; gap: .9rem 1.5rem; margin: 0; }
.method dt { font-weight: 700; }
.method dd { margin: 0; color: var(--muted); }

.foot { border-top: 1px solid var(--line); padding: 2rem 0 3rem; background: var(--surface-2); }
.foot p { margin: .3rem 0; max-width: 80ch; }

@media (max-width: 900px) {
  .nav { display: none; }
  .theme { margin-left: auto; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .cross, .piso, .map-grid, .sim, .debate { grid-template-columns: 1fr; }
  .mei-grid { grid-template-columns: 1fr 1fr; }
  .piso-num { border-left: none; border-top: 3px solid var(--gold); padding: 1rem 0 0; }
  .method dl { grid-template-columns: 1fr; gap: .2rem; }
  .method dd { margin-bottom: .8rem; }
}
@media (max-width: 480px) {
  .sim-out { grid-template-columns: 1fr; }
  .kpi .v { font-size: 1.2rem; }
  .kpi { padding: 1rem; }
  .btn-share, .btn-card { width: 100%; justify-content: center; }
  .head-actions { width: 100%; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
section[id] { scroll-margin-top: 76px; }

/* Identidade da comunicação: topo preto com listra tricolor, faixa verde na abertura e
   número principal da cidade em amarelo sobre verde, como no card. */
.top { background: var(--brand-black); border-bottom: 0; backdrop-filter: none; --text: #FFFFFF; --muted: #C9D3CC; --line: rgba(255,255,255,.25); color: var(--text); }
.top::after { content: ""; display: block; height: 6px; background: linear-gradient(90deg, var(--brand-green-2) 0 33.34%, var(--brand-yellow) 33.34% 66.67%, var(--brand-olive) 66.67% 100%); }
.top .brand strong { font-weight: 800; letter-spacing: .01em; }
.hero-band { background: var(--brand-green); color: #FFFFFF;
  --text: #FFFFFF; --muted: #CFE3D6; --line: rgba(255,255,255,.28); --surface: #0F5A38; --surface-2: #146B44;
  --red: var(--brand-yellow); --red-ink: var(--brand-yellow); --gold-ink: var(--brand-yellow); }
.hero-band .eyebrow { color: var(--brand-yellow); }
.hero-band h1 { font-weight: 900; text-transform: uppercase; letter-spacing: -.01em; max-width: 20ch; }
.hero-band .lead { color: #E4EFE7; }
.hero-band .lead strong { color: var(--brand-yellow); }
.hero-band .state-total strong { color: var(--brand-yellow); }
.hero-band .data-note { border-left-color: var(--brand-yellow); background: var(--brand-box); color: #E4EFE7; }
.hero-band .evidence-guide span { border-left-color: var(--brand-yellow); color: #CFE3D6; }
.hero-band .pilot-shortcut { background: var(--brand-yellow); color: var(--brand-black); border-color: var(--brand-yellow); }
.hero-band #q::placeholder { color: #A9C9B6; }
.hero-band #sugestoes li[aria-selected="true"], .hero-band #sugestoes li:hover { background: #146B44; }
.big { background: var(--brand-green); border: 0; color: #FFFFFF;
  --text: #FFFFFF; --muted: #CFE3D6; --line: rgba(255,255,255,.25); --surface-2: rgba(255,255,255,.14); --red-ink: var(--brand-yellow); --gold-ink: var(--brand-yellow);
  --bf: #3FBF6F; --bpc: var(--brand-yellow); --inss: #B7C46A; }
.big .big-num { color: var(--brand-yellow); font-weight: 900; }
.big .big-label { color: #FFFFFF; text-transform: uppercase; letter-spacing: .04em; font-weight: 800; }
.big .evidence-tag { background: var(--brand-box); border-color: transparent; color: var(--brand-yellow); }
.big .data-note { background: var(--brand-box); color: #E4EFE7; border-left-color: var(--brand-yellow); }
.btn-share { background: var(--brand-green-2); color: #FFFFFF; }
.block-head h2 { font-weight: 900; }

[hidden] { display: none !important; }
.pilot-shortcut { margin: 1.2rem 0 0; padding: .7rem 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--red-ink); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; text-align: left; }
.pilot-shortcut:hover { border-color: var(--red); }
.history-census { display: grid; grid-template-columns: 1fr 1.25fr; gap: 2rem; padding: 1.8rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; }
.history-census h3 { font-size: 1.5rem; }
.history-census-values { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.history-census-values article { border-top: 2px solid var(--line); padding-top: .6rem; }
.history-census-values span { font-size: .85rem; color: var(--muted); display: block; }
.history-census-values strong { font-family: 'Montserrat', sans-serif; font-size: clamp(1.5rem, 2.6vw, 2.1rem); display: block; font-variant-numeric: tabular-nums; }
.history-plot-panel { margin-top: 1.5rem; border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 1.5rem; }
.history-tabs { display: flex; flex-wrap: wrap; gap: .5rem; padding-bottom: 1.2rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.history-tabs button { border: 1px solid var(--line); padding: .65rem 1rem; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-weight: 700; cursor: pointer; }
.history-tabs [aria-selected="true"] { color: var(--red-ink); background: var(--surface-2); border-color: var(--red); }
.history-chart-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .6rem; }
.history-chart-head h3 { font-size: 1.3rem; }
.history-base { font-size: .8rem; color: var(--muted); }
.history-legend { display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; font-size: .8rem; color: var(--muted); margin: .9rem 0; }
.history-legend span { display: flex; gap: .4rem; align-items: center; }
.history-legend i { width: 18px; height: 3px; display: inline-block; }
.history-nominal { background: var(--inss); }
.history-real { background: var(--red); }
.history-average { background: var(--gold-ink); }
#historyChartBox { width: 100%; min-width: 0; }
#historyChart { width: 100%; height: 310px; display: block; color: var(--muted); touch-action: pan-y; }
#historyChart .tick text { fill: var(--muted); font-family: 'Montserrat', sans-serif; font-size: 12px; }
#historyChart .domain { stroke: var(--line); }
#historyChart .tick line { stroke: var(--line); }
.history-readout { font-size: .85rem; min-height: 3.6rem; display: flex; flex-wrap: wrap; gap: .3rem 1rem; padding: .7rem 0; color: var(--muted); border-top: 1px solid var(--line); }
.history-readout strong { color: var(--text); }
.history-changes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: .7rem; }
.history-changes article { padding: .8rem 0; border-top: 3px solid var(--line); }
.history-changes strong { display: block; font-family: 'Montserrat', sans-serif; font-size: 2rem; }
.history-changes span { font-size: .85rem; color: var(--muted); }
.history-table-details { padding-top: 1rem; border-top: 1px solid var(--line); }
.history-table-details summary { cursor: pointer; font-weight: 700; }
.history-table-wrap { overflow-x: auto; max-width: 100%; margin-top: 1rem; }
.history-table { width: 100%; border-collapse: collapse; font-size: .85rem; font-variant-numeric: tabular-nums; }
.history-table caption { text-align: left; color: var(--muted); padding-bottom: .7rem; }
.history-table th, .history-table td { text-align: right; padding: .65rem .7rem; border-bottom: 1px solid var(--line); }
.history-table th { color: var(--muted); }
.history-table td { white-space: nowrap; }
.history-table th:first-child, .history-table td:first-child { text-align: left; }
.history-notes { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1.5rem 0; }
.history-notes h3 { font-size: 1.2rem; }
.history-notes p { color: var(--muted); font-size: .9rem; }
.history-audit-note { padding: 1rem 1.2rem; background: var(--surface-2); border-left: 3px solid var(--gold); font-size: .85rem; color: var(--muted); }
.history-downloads { display: flex; flex-wrap: wrap; gap: .7rem 1.3rem; font-size: .85rem; }
.history-downloads a { font-weight: 700; }
@media (max-width: 700px) {
  .history-census { grid-template-columns: 1fr; padding: 1.2rem; gap: .8rem; }
  .history-plot-panel { padding: 1rem; }
  .history-changes { grid-template-columns: 1fr; gap: 0; }
  .history-changes article { display: flex; gap: 1rem; align-items: center; }
  .history-changes strong { min-width: 5.5rem; font-size: 1.65rem; }
  .history-notes { grid-template-columns: 1fr; gap: .5rem; }
  .history-tabs button { font-size: .85rem; padding: .6rem .7rem; }
}
