
  *, *::before, *::after { box-sizing: border-box; }
  body { margin: 0; }

  :root {
    color-scheme: light;
    --surface-1: #fcfcfb;
    --plane: #f9f9f7;
    --text-primary: #0b0b0b;
    --text-secondary: #52514e;
    --text-muted: #898781;
    --grid: #e1e0d9;
    --baseline: #c3c2b7;
    --border: rgba(11,11,11,0.10);

    --series-1: #2a78d6;
    --series-2: #eb6834;
    --series-3: #1baf7a;

    --ord-1: #1c5cab;
    --ord-2: #3987e5;
    --ord-3: #86b6ef;

    --neutral-mark: #c3c2b7;

    --good: #0ca30c;
    --warning: #fab219;
    --critical: #d03b3b;
    --good-text: #006300;
  }

  @media (prefers-color-scheme: dark) {
    :root:where(:not([data-theme="light"])) {
      color-scheme: dark;
      --surface-1: #1a1a19;
      --plane: #0d0d0d;
      --text-primary: #ffffff;
      --text-secondary: #c3c2b7;
      --text-muted: #898781;
      --grid: #2c2c2a;
      --baseline: #383835;
      --border: rgba(255,255,255,0.10);

      --series-1: #3987e5;
      --series-2: #d95926;
      --series-3: #199e70;

      --ord-1: #9ec5f4;
      --ord-2: #5598e7;
      --ord-3: #2a78d6;

      --neutral-mark: #4d4d49;
      --good-text: #0ca30c;
    }
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --plane: #0d0d0d;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --text-muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255,255,255,0.10);

    --series-1: #3987e5;
    --series-2: #d95926;
    --series-3: #199e70;

    --ord-1: #9ec5f4;
    --ord-2: #5598e7;
    --ord-3: #2a78d6;

    --neutral-mark: #4d4d49;
    --good-text: #0ca30c;
  }

  body {
    background: var(--plane);
    color: var(--text-primary);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
  }

  .wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px 96px; }

  /* ---------- header ---------- */
  header.top {
    border-bottom: 1px solid var(--border);
    background: var(--surface-1);
    margin-bottom: 40px;
  }
  .top-inner {
    max-width: 1080px; margin: 0 auto; padding: 22px 20px;
    display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
  }
  .top h1 { font-size: 1.15rem; font-weight: 650; margin: 0; letter-spacing: -0.01em; }
  .top p { margin: 3px 0 0; color: var(--text-secondary); font-size: 0.9rem; }
  .theme-btn {
    font: inherit; font-size: 0.82rem; color: var(--text-secondary);
    background: transparent; border: 1px solid var(--border);
    border-radius: 999px; padding: 6px 14px; cursor: pointer;
  }
  .theme-btn:hover { color: var(--text-primary); border-color: var(--baseline); }

  /* ---------- generic ---------- */
  section { margin-bottom: 52px; }
  h2 {
    font-size: 0.78rem; font-weight: 650; text-transform: uppercase;
    letter-spacing: 0.09em; color: var(--text-muted);
    margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid var(--grid);
  }
  h3 { font-size: 1rem; font-weight: 620; margin: 0 0 8px; letter-spacing: -0.005em; }
  p { margin: 0 0 12px; }
  .lede { color: var(--text-secondary); max-width: 62ch; }
  .card {
    background: var(--surface-1); border: 1px solid var(--border);
    border-radius: 12px; padding: 22px;
  }
  .grid { display: grid; gap: 14px; }
  .g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
  .g3 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
  .g4 { grid-template-columns: repeat(auto-fit, minmax(184px, 1fr)); }

  /* ---------- notice ---------- */
  .notice {
    display: flex; gap: 13px; align-items: flex-start;
    background: var(--surface-1); border: 1px solid var(--border);
    border-left: 3px solid var(--warning);
    border-radius: 10px; padding: 15px 18px; margin-bottom: 40px;
  }
  .notice svg { flex: none; margin-top: 2px; }
  .notice p { margin: 0; font-size: 0.9rem; color: var(--text-secondary); }
  .notice strong { color: var(--text-primary); font-weight: 620; }

  /* ---------- hero ---------- */
  .hero { display: grid; grid-template-columns: minmax(260px, 340px) 1fr; gap: 30px; align-items: center; }
  @media (max-width: 720px) { .hero { grid-template-columns: 1fr; gap: 18px; } }
  .hero-fig { font-size: 4rem; font-weight: 660; line-height: 1; letter-spacing: -0.035em; }
  .hero-unit { font-size: 1.4rem; font-weight: 560; color: var(--text-secondary); margin-left: 4px; letter-spacing: -0.01em; }
  .hero-lab { color: var(--text-secondary); font-size: 0.92rem; margin-top: 12px; max-width: 34ch; }

  /* ---------- stat tiles ---------- */
  .tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 17px 18px; }
  .tile .lab { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 7px; line-height: 1.35; min-height: 2.7em; }
  .tile .val { font-size: 1.65rem; font-weight: 640; letter-spacing: -0.02em; line-height: 1.1; }
  .tile .val small { font-size: 0.92rem; font-weight: 560; color: var(--text-secondary); letter-spacing: 0; }
  .tile .sub { font-size: 0.76rem; color: var(--text-muted); margin-top: 6px; }

  /* ---------- tags ---------- */
  .tag {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 0.68rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase;
    padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border);
    color: var(--text-secondary); white-space: nowrap;
  }
  .tag .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
  .tag.ok .dot { background: var(--good); }
  .tag.est .dot { background: var(--warning); }
  .tag.gap .dot { background: var(--critical); }

  /* ---------- charts ---------- */
  .chart { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 24px; }
  .chart-title { font-size: 0.95rem; font-weight: 620; margin-bottom: 3px; }
  .chart-sub { font-size: 0.83rem; color: var(--text-muted); margin-bottom: 20px; }

  .stack { display: flex; width: 100%; height: 46px; gap: 2px; }
  .stack > div { border-radius: 2px; position: relative; cursor: default; }
  .stack > div:first-child { border-radius: 4px 2px 2px 4px; }
  .stack > div:last-child { border-radius: 2px 4px 4px 2px; }

  .legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 18px; }
  .legend-item { display: flex; align-items: baseline; gap: 8px; font-size: 0.85rem; }
  .legend-key { width: 10px; height: 10px; border-radius: 3px; flex: none; transform: translateY(1px); }
  .legend-name { color: var(--text-primary); }
  .legend-val { color: var(--text-muted); font-variant-numeric: tabular-nums; }

  .bars { display: flex; flex-direction: column; gap: 20px; }
  .bar-row { display: grid; grid-template-columns: 116px 1fr; gap: 16px; align-items: center; }
  @media (max-width: 560px) { .bar-row { grid-template-columns: 1fr; gap: 6px; } }
  .bar-name { font-size: 0.88rem; font-weight: 600; }
  .bar-name span { display: block; font-size: 0.74rem; font-weight: 400; color: var(--text-muted); }
  .bar-track { display: flex; align-items: center; gap: 12px; }
  .bar-fill { height: 22px; border-radius: 2px 4px 4px 2px; min-width: 3px; cursor: default; }
  .bar-val { font-size: 0.9rem; font-weight: 620; white-space: nowrap; letter-spacing: -0.01em; }

  /* ---------- tables ---------- */
  .tbl-scroll { overflow-x: auto; }
  table { width: 100%; border-collapse: collapse; font-size: 0.89rem; min-width: 380px; }
  th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--grid); }
  th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 600; }
  td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
  tr:last-child td { border-bottom: none; }
  tr.total td { font-weight: 640; border-top: 1px solid var(--baseline); border-bottom: none; }

  /* ---------- lists ---------- */
  ul.clean { list-style: none; padding: 0; margin: 0; }
  ul.clean li {
    padding: 9px 0 9px 20px; border-bottom: 1px solid var(--grid);
    font-size: 0.9rem; color: var(--text-secondary); position: relative;
  }
  ul.clean li:last-child { border-bottom: none; }
  ul.clean li::before {
    content: ""; position: absolute; left: 4px; top: 17px;
    width: 5px; height: 5px; border-radius: 50%; background: var(--baseline);
  }
  ul.clean li strong { color: var(--text-primary); font-weight: 600; }

  .kv { font-size: 0.86rem; color: var(--text-secondary); margin-top: 14px; }
  .kv b { color: var(--text-primary); font-weight: 600; }

  .src { font-size: 0.76rem; color: var(--text-muted); margin-top: 16px; }
  .src a { color: var(--text-muted); }
  a { color: var(--series-1); }

  /* ---------- proveniência ---------- */
  .tag.calc .dot { background: var(--series-1); }

  sup.ref { font-size: 0.6em; font-weight: 650; line-height: 0; vertical-align: super; margin-left: 1px; }
  sup.ref a { color: var(--series-1); text-decoration: none; padding: 0 1px; }
  sup.ref a:hover { text-decoration: underline; }

  .prov { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-bottom: 40px; padding: 16px 18px;
          background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; }
  .prov-item { display: flex; align-items: flex-start; gap: 9px; font-size: 0.81rem;
               color: var(--text-secondary); flex: 1 1 210px; line-height: 1.45; }
  .prov-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 5px; }
  .prov-item b { color: var(--text-primary); font-weight: 620; display: block; }

  .deriv { margin-top: 16px; border-top: 1px solid var(--grid); padding-top: 12px; }
  .deriv summary { cursor: pointer; font-size: 0.79rem; color: var(--text-secondary);
                   font-weight: 600; list-style: none; display: flex; align-items: center; gap: 7px; }
  .deriv summary::-webkit-details-marker { display: none; }
  .deriv summary::before {
    content: ""; width: 0; height: 0; flex: none;
    border-left: 5px solid var(--text-muted);
    border-top: 4px solid transparent; border-bottom: 4px solid transparent;
    transition: transform .15s ease;
  }
  .deriv[open] summary::before { transform: rotate(90deg); }
  .deriv summary:hover { color: var(--text-primary); }
  .deriv-body { margin-top: 12px; font-size: 0.84rem; }
  .deriv-row { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0;
               border-bottom: 1px solid var(--grid); color: var(--text-secondary); }
  .deriv-row:last-child { border-bottom: none; }
  .deriv-row > span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
  .deriv-row.res { border-top: 1px solid var(--baseline); border-bottom: none;
                   margin-top: 3px; padding-top: 9px; color: var(--text-primary); font-weight: 640; }
  .deriv-note { margin-top: 11px; font-size: 0.79rem; color: var(--text-muted); line-height: 1.5; }

  ol.sources { padding-left: 24px; margin: 0; font-size: 0.84rem; color: var(--text-secondary); }
  ol.sources li { padding: 8px 0; border-bottom: 1px solid var(--grid); }
  ol.sources li:last-child { border-bottom: none; }
  ol.sources a { word-break: break-word; }
  ol.sources .who { color: var(--text-primary); font-weight: 600; }
  ol.sources .note { color: var(--text-muted); }

  /* ---------- tooltip ---------- */
  #tip {
    position: fixed; z-index: 50; pointer-events: none; opacity: 0;
    transition: opacity .12s ease;
    background: var(--surface-1); color: var(--text-primary);
    border: 1px solid var(--baseline); border-radius: 8px;
    padding: 8px 11px; font-size: 0.82rem; line-height: 1.4;
    box-shadow: 0 4px 16px rgba(0,0,0,.16); max-width: 260px;
  }
  #tip b { font-weight: 620; }
  #tip i { font-style: normal; color: var(--text-muted); }

  footer { border-top: 1px solid var(--grid); padding-top: 22px; color: var(--text-muted); font-size: 0.83rem; }

  /* ================= navegação multi-página ================= */
  .site-head {
    border-bottom: 1px solid var(--border); background: var(--surface-1);
  }
  .site-head-inner {
    max-width: 1080px; margin: 0 auto; padding: 20px 20px 0;
    display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap;
  }
  .wordmark { font-size: 1.05rem; font-weight: 660; letter-spacing: -0.015em; color: var(--text-primary); text-decoration: none; }
  .wordmark span { display: block; font-size: 0.82rem; font-weight: 400; color: var(--text-muted); letter-spacing: 0; margin-top: 2px; }
  .head-actions { display: flex; gap: 9px; align-items: center; }

  nav.pages {
    max-width: 1080px; margin: 0 auto; padding: 14px 20px 0;
    display: flex; gap: 4px; flex-wrap: wrap;
  }
  nav.pages a {
    font-size: 0.83rem; color: var(--text-secondary); text-decoration: none;
    padding: 7px 11px; border-radius: 7px; white-space: nowrap;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
  }
  nav.pages a:hover { color: var(--text-primary); background: var(--hover, rgba(128,128,128,.09)); }
  nav.pages a.active { color: var(--text-primary); font-weight: 620; border-bottom-color: var(--series-1); border-radius: 7px 7px 0 0; }

  .eyebrow { font-size: 0.73rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.1em;
             color: var(--text-muted); margin: 0 0 10px; }
  h1.page { font-size: 2rem; font-weight: 660; letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 14px; max-width: 22ch; }
  h1.page em { font-style: normal; color: var(--text-secondary); }
  .lead { font-size: 1.05rem; color: var(--text-secondary); max-width: 64ch; margin-bottom: 30px; }

  /* cartões de navegação */
  .cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
  a.card-link {
    background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
    padding: 20px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 7px;
    transition: border-color .13s ease, transform .13s ease;
  }
  a.card-link:hover { border-color: var(--baseline); transform: translateY(-1px); }
  a.card-link .t { font-size: 0.98rem; font-weight: 640; letter-spacing: -0.005em; }
  a.card-link .d { font-size: 0.86rem; color: var(--text-secondary); flex: 1; }
  a.card-link .arrow { font-size: 0.8rem; font-weight: 600; color: var(--series-1); margin-top: 4px; }

  /* paginação inferior */
  .pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 52px;
           padding-top: 22px; border-top: 1px solid var(--grid); font-size: 0.88rem; }
  .pager a { text-decoration: none; font-weight: 600; }
  .pager a:hover { text-decoration: underline; }
