:root {
  --ink: #17263a;
  --ink-2: #4a5768;
  --ink-3: #8a94a3;
  --paper: #ffffff;
  --paper-2: #f3f5f8;
  --line: #dde3ea;
  --l0: #c9e4e0;  /* baixo */
  --l1: #f1d271;  /* moderado */
  --l2: #e8843a;  /* alto */
  --l3: #b3261e;  /* muito alto */
  --l0-ink: #1d5b55;
  --l1-ink: #6b4f00;
  --l2-ink: #7a3a0c;
  --l3-ink: #7a1610;
  --est: #2f6fdb;
  --ig: #9b59b6;
  --font-body: "Atkinson Hyperlegible", system-ui, sans-serif;
  --font-display: "Fraunces", Georgia, serif;
  --max: 1180px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: 17px; line-height: 1.5;
}
a { color: inherit; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 500; letter-spacing: -0.01em; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* header */
.top {
  max-width: var(--max); margin: 0 auto; padding: 18px 16px 6px;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand-name {
  font-family: var(--font-display); font-size: 30px; font-weight: 700; text-decoration: none; display: block; line-height: 1.1;
}
.brand-sub { color: var(--ink-2); font-size: 15px; }
.stamp {
  border: 1.5px solid var(--ink); background: var(--paper); border-radius: 999px; padding: 6px 14px;
  display: inline-flex; align-items: baseline; gap: 8px; cursor: pointer; white-space: nowrap;
}
.stamp:hover, .stamp:focus-visible { background: var(--paper-2); }
.stamp-k { font-size: 13px; color: var(--ink-2); }
.stamp-v { font-family: var(--font-display); font-size: 18px; font-weight: 700; }

/* virus chips */
.viruses { max-width: var(--max); margin: 8px auto 0; padding: 0 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; font-size: 15px;
}
.chip[aria-selected="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.chip[aria-selected="true"] .dot { outline: 2px solid #fff; }

/* layout */
.layout { max-width: var(--max); margin: 0 auto; padding: 0 16px 40px; display: grid; gap: 24px; grid-template-columns: 1fr; }
@media (min-width: 900px) {
  .layout { grid-template-columns: minmax(380px, 1fr) minmax(0, 1.15fr); gap: 40px; align-items: start; }
  .map-col { position: sticky; top: 12px; }
}
.map-wrap { position: relative; border-radius: 18px; overflow: hidden; background: var(--paper-2); }
#map { width: 100%; aspect-ratio: 1 / 1.02; min-height: 340px; }
@media (min-width: 900px) { #map { aspect-ratio: 1 / 1.08; } }
.maplibregl-ctrl-attrib { display: none; }
.map-tools { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; pointer-events: none; }
.map-tools > * { pointer-events: auto; }
.legend { display: flex; gap: 4px; background: rgba(255,255,255,.92); padding: 6px 8px; border-radius: 10px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; padding: 0 4px; white-space: nowrap; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.legend .none i { background: repeating-linear-gradient(45deg, #fff, #fff 3px, #cfd6df 3px, #cfd6df 5px); }
.ghost { border: 1.5px solid var(--ink); background: rgba(255,255,255,.95); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 14px; }
.ghost:hover { background: var(--paper-2); }
.map-note { color: var(--ink-2); font-size: 14px; margin: 10px 4px 0; }
.maplibregl-popup-content { font-family: var(--font-body); font-size: 14px; padding: 8px 12px; border-radius: 10px; box-shadow: 0 6px 20px rgba(23,38,58,.18); }
.maplibregl-popup-content b { font-family: var(--font-display); font-size: 16px; }

/* panel */
.crumb { margin: 4px 0 2px; color: var(--ink-2); font-size: 15px; }
.crumb button { border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.headline { font-size: clamp(30px, 5.2vw, 46px); line-height: 1.08; margin: 0 0 8px; text-wrap: balance; }
.headline em { font-style: italic; font-weight: 500; }
.lede { margin: 0 0 18px; color: var(--ink-2); font-size: 17px; max-width: 60ch; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 26px; }
.card { border-radius: 14px; padding: 12px 14px; background: var(--paper-2); }
.card.level { color: #fff; }
.card .k { font-size: 13px; color: inherit; opacity: .8; display: block; }
.card .v { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.1; display: block; }
.card .s { font-size: 13px; opacity: .85; display: block; margin-top: 2px; }
.card.l0 { background: var(--l0); color: var(--l0-ink); }
.card.l1 { background: var(--l1); color: var(--l1-ink); }
.card.l2 { background: var(--l2); color: #fff; }
.card.l3 { background: var(--l3); color: #fff; }

.block { margin: 0 0 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.block h2 { font-size: 22px; margin-bottom: 2px; }
.block-sub { margin: 0 0 12px; color: var(--ink-2); font-size: 15px; max-width: 64ch; }

.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis text { font-size: 11px; fill: var(--ink-3); font-family: var(--font-body); }
.chart .axis line { stroke: var(--line); }
.chart .rep { fill: none; stroke: var(--ink); stroke-width: 2; }
.chart .est { fill: none; stroke: var(--est); stroke-width: 2; stroke-dasharray: 4 3; }
.chart .ig { fill: none; stroke: var(--ig); stroke-width: 1.5; stroke-dasharray: 2 3; }
.chart .thr { stroke-width: 1; stroke-dasharray: 2 4; }
.chart .season { fill: none; stroke: var(--ink-3); stroke-width: 1; opacity: .45; }
.chart .partial { fill: var(--paper-2); }
.chart .tip { font-size: 12px; fill: var(--ink-2); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); margin-top: 6px; }
.sw { width: 18px; height: 0; border-top: 2px solid var(--ink); display: inline-block; vertical-align: middle; margin-right: 6px; }
.sw-est { border-top-style: dashed; border-color: var(--est); }
.sw-ig { border-top-style: dotted; border-color: var(--ig); }
.sw-thr { border-top-style: dotted; border-color: var(--l2); }

.bars { display: grid; gap: 7px; }
.bar { display: grid; grid-template-columns: 130px 1fr 96px; align-items: center; gap: 10px; font-size: 15px; }
.bar .lab { color: var(--ink); }
.bar .track { display: block; height: 14px; background: var(--paper-2); border-radius: 7px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: var(--ink); border-radius: 7px; }
.bar .num { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar.selected .lab { font-weight: 700; }
@media (max-width: 420px) { .bar { grid-template-columns: 100px 1fr 84px; font-size: 14px; } }

.two { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .two { grid-template-columns: 1fr 1fr; } }
.two h3 { font-size: 17px; margin-bottom: 6px; font-family: var(--font-body); font-weight: 700; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 15px; }
.list li span:last-child { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.list .lv { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 8px; }

.sources-inline ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.sources-inline li { font-size: 15px; }
.sources-inline .when { font-family: var(--font-display); font-weight: 700; }
.sources-inline button.link { border: 0; background: none; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-size: inherit; }

.disclaimer { font-size: 14px; color: var(--ink-2); border-left: 3px solid var(--l1); padding-left: 12px; }

.foot { max-width: var(--max); margin: 0 auto; padding: 18px 16px 40px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14px; }

/* sources sheet */
.sheet { border: 0; border-radius: 18px; padding: 22px 22px 26px; width: min(720px, calc(100vw - 24px)); max-height: 88vh; box-shadow: 0 20px 60px rgba(23,38,58,.3); color: var(--ink); }
.sheet::backdrop { background: rgba(23,38,58,.45); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sheet-head h2 { font-size: 24px; }
.sheet-sub { color: var(--ink-2); font-size: 15px; margin: 6px 0 14px; }
.source-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.source { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; scroll-margin-top: 10px; }
.source.hit { border-color: var(--ink); background: var(--paper-2); }
.source h3 { font-size: 17px; font-family: var(--font-body); font-weight: 700; margin-bottom: 2px; }
.source .org { color: var(--ink-2); font-size: 14px; }
.source .role { margin: 6px 0; font-size: 15px; }
.source dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; font-size: 14px; margin: 6px 0 0; }
.source dt { color: var(--ink-3); }
.source dd { margin: 0; overflow-wrap: anywhere; }
.source .status { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--l0-ink); }
.source .status.err { background: var(--l3); }

:focus-visible { outline: 3px solid var(--est); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .chip, .stamp, .ghost { transition: background .15s, border-color .15s; }
}
