:root {
  --bg: #eef1f4; --surface: #ffffff; --ink: #14212e; --muted: #5b6875; --line: #d3dae1;
  --accent: #0b5cad; --accent-soft: #dce9f7; --gain: #12805c; --loss: #c0392b; --warn: #9a6400; --warn-soft: #fbf0d6;
  --gain-soft: #d9f0e7; --loss-soft: #f8dcd8;
  --display: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  --body: "Inter", "Segoe UI", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0f161d; --surface: #18222c; --ink: #e6ecf2; --muted: #96a3b0; --line: #2c3945;
  --accent: #6fb1f5; --accent-soft: #1c3350; --gain: #4cc79a; --loss: #f0796b; --warn: #e6b450; --warn-soft: #3a2f14;
  --gain-soft: #173a2e; --loss-soft: #45211d; color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0f161d; --surface: #18222c; --ink: #e6ecf2; --muted: #96a3b0; --line: #2c3945;
  --accent: #6fb1f5; --accent-soft: #1c3350; --gain: #4cc79a; --loss: #f0796b; --warn: #e6b450; --warn-soft: #3a2f14;
  --gain-soft: #173a2e; --loss-soft: #45211d; color-scheme: dark }

body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.55; }
.wrap { max-width: 820px; margin: 0 auto; padding-block: 28px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 24px; }
.wrap.estreito { max-width: 680px; }
h1 { font-family: var(--display); font-size: 1.9rem; line-height: 1.1; margin: 0; letter-spacing: -0.01em; }
h2 { font-family: var(--display); font-size: 1.25rem; line-height: 1.2; margin: 0; text-wrap: balance; }
h3 { font-family: var(--display); font-size: 1.05rem; margin: 0; text-wrap: balance; }
p { margin: 0; }
.lead { color: var(--muted); margin-top: 8px; max-width: 60ch; }
.sub { color: var(--muted); font-size: 0.9rem; max-width: 68ch; }
.rotulo { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pos { color: var(--gain); } .neg { color: var(--loss); }
.bloco { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.linha { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.btn { font: 600 0.95rem var(--body); color: var(--surface); background: var(--accent); border: 0; border-radius: 6px; padding: 10px 16px; cursor: pointer; }
.btn.sec { color: var(--ink); background: var(--surface); border: 1px solid var(--line); }
.btn.perigo { background: var(--loss); }
.btn:disabled { opacity: 0.45; cursor: default; }
.lnk { font: 500 0.9rem var(--body); color: var(--accent); background: none; border: 0; padding: 6px 0; cursor: pointer; text-decoration: underline; }
button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 6px; padding: 10px 14px; font-size: 0.9rem; font-weight: 500; }
.destaque { background: var(--accent-soft); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 8px; }
.destaque h2 { color: var(--accent); font-size: 1.5rem; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }
.tile { background: var(--surface); padding: 14px 16px; min-width: 0; }
.tile small { display: block; color: var(--muted); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; }
.tile b { font-family: var(--display); font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.tile span { display: block; color: var(--muted); font-size: 0.82rem; }
.tw { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.achados { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.achados li { background: var(--surface); border-left: 4px solid var(--accent); padding: 12px 16px; }
.achados li.alerta { border-left-color: var(--loss); }
.achados li.ok { border-left-color: var(--gain); }
.achados b { display: block; font-family: var(--display); }
svg text { fill: var(--muted); font: 11px var(--body); font-variant-numeric: tabular-nums; }
footer { color: var(--muted); font-size: 0.85rem; border-top: 1px solid var(--line); padding-top: 16px; max-width: 68ch; }
