:root {
--bg: #edf1ee;
--panel: #fbfcfa;
--ink: #12262b;
--ink-soft: #f2f7f5;
--muted: #486065;
--line: #c6d1ce;
--accent: #0b6e6d;
--danger: #a3221b;
--warning-bg: #fff3cd;
--warning-fg: #5c4400;
--table-head: #e4ebe8;
--table-first: #f0f5f3;
--radius: 6px;
--font:
"Instrument Sans",
system-ui,
-apple-system,
"Segoe UI",
Roboto,
sans-serif;
}

/* Tema escuro */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121a1c;
  --panel: #1c282b;
  --ink: #edf5f3;
  --ink-soft: #f2f7f5;
  --muted: #b4c5c3;
  --line: #405356;
  --accent: #66d1c7;
  --danger: #ff8a80;
  --warning-bg: #493b1d;
  --warning-fg: #ffe3a0;
  --table-head: #293a3d;
  --table-first: #223235;
}

*,
*::before,
*::after {
box-sizing: border-box;
}
html {
-webkit-text-size-adjust: 100%;
}
body {
margin: 0;
background: var(--bg);
color: var(--ink);
font: 400 1rem/1.5 var(--font);
font-variant-numeric: tabular-nums;
}
h1,
h2,
p {
margin: 0;
}
button,
input {
font: inherit;
}
button {
cursor: pointer;
}
.muted {
color: var(--muted);
}
:focus-visible {
outline: 3px solid var(--accent);
outline-offset: 3px;
}
/* ====================================================== */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
border: 0;
}
.skip {
position: absolute;
left: 1rem;
top: -4rem;
z-index: 10;
padding: 0.6rem 1rem;
background: var(--ink);
color: white;
border-radius: var(--radius);
}
.skip:focus {
top: 1rem;
}
/* ====================================================== */
.topbar {
display: grid;
grid-template-columns:
auto
1fr
auto;
align-items: center;
gap: 1rem 2rem;
padding:
0.9rem
clamp(1rem, 3vw, 2.5rem);
background: var(--panel);
border-bottom: 2px solid var(--ink);
}
.brand {
display: flex;
align-items: center;
  flex-wrap: wrap;
gap: 0.6rem;
}
.brand-mark {
width: 30px;
height: 30px;
color: var(--accent);
flex: none;
}
.brand-name {
font-weight: 700;
letter-spacing: -0.01em;
}

.theme-toggle {
  flex: none;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  font-weight: 600;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.experiment h1 {
font-size: 1.05rem;
font-weight: 600;
}
.experiment p {
color: var(--muted);
font-size: 0.875rem;
}
.status {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.875rem;
color: var(--muted);
white-space: nowrap;
}
.dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: var(--accent);
animation:
pulse 2s ease-out infinite;
}
@keyframes pulse {
0% {
box-shadow:
0 0 0 0
rgba(11, 110, 109, 0.5);
}
100% {
box-shadow:
0 0 0 9px
rgba(11, 110, 109, 0);
}
}
/* ====================================================== */
main {
max-width: 1240px;
margin: 0 auto;
padding:
1.75rem
clamp(1rem, 3vw, 2.5rem)
3rem;
display: grid;
gap: 1.5rem;
}
.section-title,
.panel h2 {
font-size: 1.15rem;
font-weight: 700;
letter-spacing: -0.01em;
}
.section-title {
margin-bottom: 0.9rem;
}
.section-title small {
display: block;
margin-top: 0.1rem;
font-size: 0.875rem;
font-weight: 400;
color: var(--muted);
}
/* ====================================================== */
.status-area {
display: flex;
justify-content: space-between;
align-items: center;
}
.warning {
display: inline-block;
margin-top: 0.5rem;
padding:
0.5rem
0.75rem;
background: var(--warning-bg);
color: var(--warning-fg);
border:
2px solid
var(--warning-fg);
border-radius: var(--radius);
font-weight: 600;
}
.last-update {
margin-top: 0.5rem;
color: var(--muted);
font-size: 0.9rem;
}
/* ====================================================== */
.cards {
display: grid;
grid-template-columns:
repeat(4, 1fr);
gap: 1rem;
}
.card {
position: relative;
display: flex;
flex-direction: column;
gap: 0.35rem;
text-align: left;
padding:
1.1rem
1.1rem
1.25rem;
min-height: 150px;
color: var(--ink);
background: var(--panel);
border:
1.5px solid
var(--line);
border-radius: var(--radius);
transition:
border-color 0.15s,
background-color 0.15s,
color 0.15s;
}
.card:hover {
border-color: var(--ink);
}
.card-head {
display: flex;
align-items: center;
gap: 0.5rem;
color: var(--muted);
font-weight: 600;
font-size: 0.95rem;
}
.card-head svg {
width: 22px;
height: 22px;
flex: none;
}
.card-value {
font-size: 2.4rem;
font-weight: 700;
letter-spacing: -0.03em;
line-height: 1.1;
margin-top: 0.4rem;
}
.unit {
font-size: 1rem;
font-weight: 500;
letter-spacing: 0;
color: var(--muted);
}
.card-trend {
font-size: 0.875rem;
color: var(--muted);
}
.card-flag {
display: none;
position: absolute;
top: 0.9rem;
right: 0.9rem;
font-size: 0.75rem;
font-weight: 600;
}
/* Card selecionado */
.card[aria-pressed="true"] {
background: var(--ink);
color: var(--ink-soft);
border-color: var(--ink);
box-shadow:
inset 0 -5px 0
var(--accent);
}
.card[aria-pressed="true"] .card-head,
.card[aria-pressed="true"] .unit,
.card[aria-pressed="true"] .card-trend {
color: #c9dad6;
}
.card[aria-pressed="true"] .card-flag {
display: block;
}
.card[aria-pressed="true"]:focus-visible {
outline-color: var(--accent);
outline-offset: 4px;
}
/* ====================================================== */
.panel {
background: var(--panel);
border:
1.5px solid
var(--line);
border-radius: var(--radius);
padding:
1.25rem
clamp(1rem, 2vw, 1.5rem);
}
.panel-head {
display: flex;
justify-content: space-between;
align-items: baseline;
flex-wrap: wrap;
gap: 0.25rem 1rem;
margin-bottom: 1rem;
}
/* ====================================================== */
.chart-wrap {
position: relative;
height:
clamp(
260px,
42vh,
420px
);
}
.alt-table {
margin-top: 1rem;
border-top:
1px solid
var(--line);
padding-top: 0.8rem;
}
.alt-table summary {
cursor: pointer;
font-weight: 600;
color: var(--accent);
padding: 0.25rem 0;
}
.alt-table .table-scroll {
max-height: 260px;
margin-top: 0.6rem;
}
/* ====================================================== */
.resumo-texto {
margin:
0.5rem 0 1rem;
color: var(--muted);
max-width: 70ch;
}
.stats {
display: grid;
grid-template-columns:
repeat(5, 1fr);
gap: 0;
margin: 0;
border:
1.5px solid
var(--line);
border-radius: var(--radius);
overflow: hidden;
}
.stats > div {
padding:
0.8rem 1rem;
border-left:
1.5px solid
var(--line);
}
.stats > div:first-child {
border-left: 0;
}
.stats dt {
font-size: 0.875rem;
color: var(--muted);
}
.stats dd {
margin: 0;
font-size: 1.25rem;
font-weight: 700;
}
.stats > div:last-child dd {
font-size: 1rem;
font-weight: 600;
}
/* ====================================================== */
.table-scroll {
overflow: auto;
margin-top: 0.75rem;
border:
1px solid
var(--line);
border-radius: var(--radius);
}
table {
width: 100%;
border-collapse: collapse;
font-size: 0.95rem;
}
th,
td {
padding:
0.65rem
1rem;
text-align: right;
border-bottom:
1px solid
var(--line);
white-space: nowrap;
}
th:first-child,
td:first-child {
text-align: left;
}
thead th {
background: var(--table-head);
font-weight: 600;
position: sticky;
top: 0;
}
tbody tr:last-child > * {
border-bottom: 0;
}
tbody th {
font-weight: 600;
}
tbody tr:first-child {
background: var(--table-first);
}
/* ====================================================== */
@media (max-width: 1000px) {
.topbar {
grid-template-columns:
1fr
auto;
}
.experiment {
grid-column: 1 / -1;
order: 3;
}
.cards {
grid-template-columns:
repeat(2, 1fr);
}
.stats {
grid-template-columns:
repeat(2, 1fr);
}
.stats > div {
border-left: 0;
border-top:
1.5px solid
var(--line);
}
.stats > div:nth-child(-n + 2) {
border-top: 0;
}
.stats > div:nth-child(even) {
border-left:
1.5px solid
var(--line);
}
.stats > div:last-child {
grid-column: 1 / -1;
border-left: 0;
}
}
@media (max-width: 560px) {
.topbar {
grid-template-columns: 1fr;
}
.status {
white-space: normal;
}
.card {
min-height: 130px;
padding: 0.9rem;
}
.card-value {
font-size: 1.9rem;
}
.card-flag {
position: static;
margin-top: 0.2rem;
}
}
@media (max-width: 380px) {
.cards {
grid-template-columns: 1fr;
}
}
/* ====================================================== */
@media (prefers-reduced-motion: reduce) {
.dot {
animation: none;
}
.card {
transition: none;
}

}

html[data-theme="dark"] .card[aria-pressed="true"] {
  background: var(--table-head);
  color: var(--ink);
  border-color: var(--accent);
  box-shadow: inset 0 -5px 0 var(--accent);
}

html[data-theme="dark"] .card[aria-pressed="true"] .card-head,
html[data-theme="dark"] .card[aria-pressed="true"] .unit,
html[data-theme="dark"] .card[aria-pressed="true"] .card-trend {
  color: var(--muted);
}

/* Interruptor do tema */
.theme-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 68px;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--table-head);
  color: var(--ink);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.theme-toggle .theme-icon {
  position: relative;
  z-index: 1;
  font-size: 17px;
  line-height: 1;
}

.theme-toggle .theme-icon-sun {
  color: #b7791f;
}

.theme-toggle .theme-icon-moon {
  color: #8b9de8;
}

.theme-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel);
  box-shadow: 0 1px 4px rgb(0 0 0 / 20%);
  transition: transform 0.25s ease, background 0.25s ease;
}

.theme-toggle[aria-pressed="true"] .theme-toggle-knob {
  transform: translateX(32px);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}