/* ═══════════════════════════════════════════════════════════════════════
   MoodTracker: painel de humor e atenção. Claro por padrão, escuro quando o sistema pede (prefers-color-scheme) e as duas escolhas manuais
   (html[data-theme]). Os tokens de cada tema ficam nos três blocos marcados com `@theme`; test/moodtracker-page.test.js confere o contraste
   dos pares de texto e que os três declaram as mesmas variáveis. As cores das emoções são os tons categóricos do dataviz validados nos dois
   temas (a ordem é a que passa nas checagens de daltonismo); o neutro é cinza de propósito. Mapa de calor: azul ↔ vermelho com meio cinza.
   Não depende de tokens.css nem de Bootstrap. Movimento: juice.js põe data-motion="reduced" no <html>.
   ═══════════════════════════════════════════════════════════════════════ */

/* @theme light */
:root {
	color-scheme: light;
	--bg: #f9f9f7;
	--surface: #fcfcfb;
	--surface-2: #f1f0ec;
	--ink: #0b0b0b;
	--ink-2: #52514e;
	--ink-3: #6b6a64;
	--line: #e1e0d9;
	--line-2: #c3c2b7;
	--brand: #6250d6;
	--btn: #6250d6;
	--btn-hover: #5240c4;
	--btn-ink: #ffffff;
	--brand-text: #4a3aa7;
	--danger: #b3261e;
	--ok-text: #006300;
	--warn-text: #8a5a00;
	--e-sad: #2a78d6;
	--e-fearful: #eb6834;
	--e-happy: #1baf7a;
	--e-surprised: #eda100;
	--e-disgusted: #008300;
	--e-angry: #e34948;
	--e-neutral: #898781;
	--pole-pos: #2a78d6;
	--pole-neg: #e34948;
	--mid: #f0efec;
	--heat-0: #e6e5df;
	--heat-4: #104281;
	--shadow: 0 1px 2px rgb(11 11 11 / 0.05), 0 8px 24px -12px rgb(11 11 11 / 0.12);
}
@media (prefers-color-scheme: dark) {
	/* @theme dark */
	:root:where(:not([data-theme="light"])) {
		color-scheme: dark;
		--bg: #0d0d0d;
		--surface: #1a1a19;
		--surface-2: #242423;
		--ink: #f0efec;
		--ink-2: #c3c2b7;
		--ink-3: #a3a29a;
		--line: #2c2c2a;
		--line-2: #383835;
		--brand: #9085e9;
		--btn: #9085e9;
		--btn-hover: #a399f0;
		--btn-ink: #0b0b0b;
		--brand-text: #b4abf2;
		--danger: #e66767;
		--ok-text: #0ca30c;
		--warn-text: #fab219;
		--e-sad: #3987e5;
		--e-fearful: #d95926;
		--e-happy: #199e70;
		--e-surprised: #c98500;
		--e-disgusted: #008300;
		--e-angry: #e66767;
		--e-neutral: #898781;
		--pole-pos: #3987e5;
		--pole-neg: #e66767;
		--mid: #383835;
		--heat-0: #2c2c2a;
		--heat-4: #9ec5f4;
		--shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.6);
	}
}
/* @theme dark */
:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0d0d0d;
	--surface: #1a1a19;
	--surface-2: #242423;
	--ink: #f0efec;
	--ink-2: #c3c2b7;
	--ink-3: #a3a29a;
	--line: #2c2c2a;
	--line-2: #383835;
	--brand: #9085e9;
	--btn: #9085e9;
	--btn-hover: #a399f0;
	--btn-ink: #0b0b0b;
	--brand-text: #b4abf2;
	--danger: #e66767;
	--ok-text: #0ca30c;
	--warn-text: #fab219;
	--e-sad: #3987e5;
	--e-fearful: #d95926;
	--e-happy: #199e70;
	--e-surprised: #c98500;
	--e-disgusted: #008300;
	--e-angry: #e66767;
	--e-neutral: #898781;
	--pole-pos: #3987e5;
	--pole-neg: #e66767;
	--mid: #383835;
	--heat-0: #2c2c2a;
	--heat-4: #9ec5f4;
	--shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 8px 24px -12px rgb(0 0 0 / 0.6);
}

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; overflow-x: hidden; }
h1, h2, p, ul, dl, dd { margin: 0; }
ul { padding: 0; list-style: none; }
button, select, input { font: inherit; color: inherit; }
a { color: var(--brand-text); }
.wrap { width: min(100% - 32px, 1180px); margin-inline: auto; }
.i { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -48px; z-index: 50; padding: 8px 14px; background: var(--btn); color: var(--btn-ink); border-radius: 8px; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ── topo ── */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top__in { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 800; letter-spacing: -0.01em; }
.brand__mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--btn); color: var(--btn-ink); }
.top__tools { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tool, .pill { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; cursor: pointer; }
.tool { width: 44px; padding: 0; justify-content: center; }
.tool[aria-pressed="false"] { color: var(--ink-3); }
.tool:hover, .pill:hover { background: var(--surface-2); }
.pill--quiet { border-color: transparent; color: var(--ink-2); }
.i--sun { display: none; }
[aria-pressed="true"] > .i--moon { display: none; }
[aria-pressed="true"] > .i--sun { display: block; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 0.875rem; }
.status i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink-3); }
.status[data-state="running"] { color: var(--ink); }
.status[data-state="running"] i { background: var(--e-happy); box-shadow: 0 0 0 4px color-mix(in srgb, var(--e-happy) 25%, transparent); }
.status[data-state="loading"] i, .status[data-state="starting"] i { background: var(--e-surprised); }
.status[data-state="error"] i { background: var(--danger); }

/* ── estrutura ── */
.main { padding-block: 24px 48px; display: grid; gap: 20px; }
.intro h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); line-height: 1.15; letter-spacing: -0.02em; }
.lead { margin-top: 8px; max-width: 62ch; color: var(--ink-2); font-size: 1.05rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card__head h2 { font-size: 1.05rem; letter-spacing: -0.01em; }
.card__hint { color: var(--ink-3); font-size: 0.8125rem; }
.fine { display: flex; gap: 8px; align-items: flex-start; margin-top: 12px; color: var(--ink-3); font-size: 0.8125rem; line-height: 1.45; }
.fine .i { margin-top: 1px; }
.para { color: var(--ink-2); font-size: 0.9375rem; margin-bottom: 12px; }
.notice { padding: 12px 16px; border-radius: 12px; background: var(--surface-2); }

/* ── câmera e agora ── */
.hero { display: grid; gap: 16px; }
.camera { display: grid; gap: 14px; align-content: start; }
.stage { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); opacity: 0; }
.stage__idle, .stage__loading, .stage__hidden { position: absolute; inset: 0; display: none; place-items: center; align-content: center; gap: 8px; padding: 20px; text-align: center; color: var(--ink-2); }
.stage__idle .i, .stage__hidden .i { width: 2.4rem; height: 2.4rem; color: var(--ink-3); }
.stage__idle b { color: var(--ink); }
.stage[data-state="idle"] .stage__idle, .stage[data-state="error"] .stage__idle { display: grid; }
.stage[data-state="loading"] .stage__loading, .stage[data-state="starting"] .stage__loading { display: grid; }
.stage__loading .sk { width: min(260px, 70%); }
.stage:is([data-state="running"], [data-state="paused"])[data-preview="on"] video { opacity: 1; }
.stage:is([data-state="running"], [data-state="paused"])[data-preview="off"] .stage__hidden { display: grid; }
.stage__badge { position: absolute; left: 10px; bottom: 10px; display: none; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: rgb(11 11 11 / 0.72); color: #fff; font-size: 0.8125rem; }
.stage__badge i { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.stage:is([data-state="running"], [data-state="paused"]) .stage__badge { display: inline-flex; }
.camera__actions, .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.banner { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: color-mix(in srgb, var(--danger) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); }
.banner p { flex: 1 1 220px; }
.banner .i { color: var(--danger); }

.live { display: grid; align-content: start; gap: 14px; }
.live__idle, .live__loading, .live__body { display: none; }
.live[data-state="idle"] .live__idle { display: block; color: var(--ink-2); }
.live__idle-title { font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.steps { display: grid; gap: 14px; counter-reset: step; }
.steps li { position: relative; display: grid; gap: 2px; padding-left: 44px; counter-increment: step; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--brand-text); font-weight: 800; }
.steps li b { color: var(--ink); }
.steps li span { color: var(--ink-2); font-size: 0.9375rem; }
.live[data-state="loading"] .live__loading { display: grid; gap: 10px; }
.live[data-state="running"] .live__body { display: grid; gap: 14px; }
.live[data-state="running"] .live__body > :not(.live__main):not(.alerts) { transition: opacity 0.2s; }
.live[data-face="false"][data-state="running"] .live__body > :not(.live__main) { opacity: 0.5; }
.quality { padding: 4px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); font-size: 0.8125rem; }
.quality[data-tone="good"] { color: var(--ok-text); background: color-mix(in srgb, var(--ok-text) 12%, var(--surface)); }
.quality[data-tone="warn"] { color: var(--warn-text); background: color-mix(in srgb, var(--warn-text) 14%, var(--surface)); }
.live__main { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: end; }
.live__label { display: block; color: var(--ink-3); font-size: 0.8125rem; }
.live__emotion { display: block; font-size: 1.9rem; line-height: 1.1; letter-spacing: -0.02em; }
.live__emotion[data-emotion] { color: var(--ink); }
.live__pct { color: var(--ink-2); font-size: 0.9375rem; }
.live__attn b { color: var(--ink); }
.meter { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.meter i { display: block; height: 100%; width: var(--v, 0%); border-radius: 99px; background: var(--brand); transition: width 0.4s ease; }
.meter[data-level="high"] i { background: var(--e-happy); }
.meter[data-level="mid"] i { background: var(--e-surprised); }
.meter[data-level="low"] i { background: var(--e-angry); }
.mini-list { display: grid; gap: 4px; }
.mini { display: grid; grid-template-columns: 74px 1fr 40px; align-items: center; gap: 8px; font-size: 0.8125rem; color: var(--ink-2); }
.mini__track { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.mini__track i { display: block; height: 100%; width: var(--v); background: var(--c, var(--brand)); border-radius: 99px; transition: width 0.4s ease; }
.mini__pct { text-align: right; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.live__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.live__grid div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.live__grid dt { color: var(--ink-3); font-size: 0.75rem; }
.live__grid dd { font-weight: 700; font-size: 0.9375rem; }
.alerts { display: flex; flex-wrap: wrap; gap: 8px; }
.alerts:empty { display: none; }
.alert-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--warn-text) 14%, var(--surface)); color: var(--warn-text); font-size: 0.8125rem; font-weight: 600; }
.calsteps { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.meter--cal { height: 10px; }
[data-emotion="happy"] { --c: var(--e-happy); } [data-emotion="sad"] { --c: var(--e-sad); } [data-emotion="angry"] { --c: var(--e-angry); }
[data-emotion="surprised"] { --c: var(--e-surprised); } [data-emotion="disgusted"] { --c: var(--e-disgusted); } [data-emotion="fearful"] { --c: var(--e-fearful); } [data-emotion="neutral"] { --c: var(--e-neutral); }

/* ── barra de período ── */
.rangebar { position: sticky; top: 0; z-index: 6; display: flex; gap: 12px 20px; align-items: center; flex-wrap: wrap; padding: 10px 0; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); }
.tabs { display: inline-flex; padding: 4px; gap: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.tab { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: transparent; color: var(--ink-2); cursor: pointer; font-weight: 600; }
.tab[aria-selected="true"] { background: var(--btn); color: var(--btn-ink); }
.tab:not([aria-selected="true"]):hover { background: var(--line); }
.updated { margin-left: auto; color: var(--ink-3); font-size: 0.8125rem; }

/* ── indicadores ── */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { display: grid; align-content: start; gap: 4px; padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); min-width: 0; }
.kpi__label { color: var(--ink-3); font-size: 0.8125rem; font-weight: 600; }
.kpi__value { display: flex; align-items: baseline; gap: 6px; font-size: 1.9rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; }
.kpi__value small { font-size: 0.9rem; font-weight: 600; color: var(--ink-3); }
.kpi__dot { width: 12px; height: 12px; border-radius: 50%; align-self: center; }
.kpi__delta { display: inline-flex; align-items: center; gap: 2px; font-size: 0.8125rem; font-weight: 600; color: var(--ink-2); }
.kpi__delta.is-up { color: var(--ok-text); }
.kpi__delta.is-down { color: var(--danger); }
.kpi__delta .i { width: 1em; height: 1em; stroke-width: 3; }
.kpi__sub { color: var(--ink-3); font-size: 0.8125rem; line-height: 1.35; }

/* ── gráficos ── */
.charts { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.chart { grid-column: span 12; display: grid; align-content: start; }
.chart .card__body { min-height: 120px; }
@media (min-width: 720px) { .chart { grid-column: span 6; } .chart--wide, .chart--full { grid-column: span 12; } }
@media (min-width: 1040px) { .chart--wide { grid-column: span 8; } .chart--wide + .chart:not(.chart--wide) { grid-column: span 4; } .chart--full { grid-column: span 12; } }
.host { position: relative; min-height: 120px; }
.host:focus-visible { outline-offset: 4px; }
.chart[data-empty="true"] .host, .chart[data-empty="true"] .ranks, .chart[data-empty="true"] .stats, .chart[data-empty="true"] .chips { display: none; }
.empty { display: none; padding: 28px 12px; text-align: center; color: var(--ink-2); background: var(--surface-2); border-radius: 12px; }
.chart[data-empty="true"] .empty { display: block; }
.chart-svg { display: block; width: 100%; height: auto; overflow: visible; }
.c-grid { stroke: var(--line); stroke-width: 1; }
.c-axis { stroke: var(--line-2); stroke-width: 1; }
.c-cross { stroke: var(--line-2); stroke-width: 1; }
.c-tick { fill: var(--ink-3); font-size: 11px; }
.c-val { fill: var(--ink); font-size: 12px; font-weight: 700; }
.c-line { fill: none; stroke: var(--c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.c-line.is-muted { stroke-width: 1.5; }
.c-dot { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.c-hover { fill: var(--c); stroke: var(--surface); stroke-width: 2; }
.tip { position: absolute; z-index: 5; pointer-events: none; display: grid; gap: 4px; min-width: 140px; max-width: 260px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); font-size: 0.8125rem; }
.tip__title { font-size: 0.8125rem; color: var(--ink-2); }
.tip__row { display: flex; align-items: center; gap: 8px; }
.tip__row b { font-size: 0.9375rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.tip__name { color: var(--ink-2); }
.tip__key { width: 14px; height: 3px; border-radius: 2px; flex: none; }
.tip__note { color: var(--ink-3); font-size: 0.75rem; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8125rem; color: var(--ink-2); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }
.legend__key { width: 16px; height: 3px; border-radius: 2px; }
.legend--scale { align-items: center; gap: 8px; }
.scale { width: 120px; height: 10px; border-radius: 99px; background: linear-gradient(90deg, var(--pole-neg), var(--mid), var(--pole-pos)); }
.ranks { display: grid; gap: 10px; }
.rank { display: grid; grid-template-columns: 84px 1fr 44px 44px; align-items: center; gap: 8px; font-size: 0.875rem; }
.rank__name { color: var(--ink-2); }
.rank__track { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.rank__track i { display: block; height: 100%; width: var(--v); background: var(--c); border-radius: 0 99px 99px 0; }
.rank__pct { text-align: right; font-variant-numeric: tabular-nums; }
.rank__delta { font-size: 0.75rem; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.rank__delta.is-up { color: var(--ok-text); }
.rank__delta.is-down { color: var(--danger); }
.stats { display: grid; gap: 2px; }
.stat { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.stat:last-child { border-bottom: 0; }
.stat__label { display: grid; font-size: 0.9375rem; }
.stat__label small { color: var(--ink-3); font-size: 0.75rem; }
.stat__value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat[data-tone="warn"] .stat__value { color: var(--warn-text); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 8px; }
.chips--wrap { flex-wrap: wrap; overflow: visible; }
.chip { min-height: 40px; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; font-size: 0.875rem; }
.chip[aria-pressed="true"] { background: var(--surface-2); border-color: var(--ink-2); font-weight: 700; }
.chip__key { width: 14px; height: 4px; border-radius: 2px; }
.chip[aria-pressed="false"] .chip__key { opacity: 0.4; }
.cells__grid { display: grid; grid-template-columns: auto repeat(var(--cols), minmax(0, 1fr)); gap: 2px; align-items: center; }
.cells__col, .cells__row { font-size: 11px; color: var(--ink-3); text-align: center; white-space: nowrap; overflow: visible; }
.cells__row { text-align: right; padding-right: 8px; }
.cells__cell { aspect-ratio: 3 / 2; min-height: 14px; border-radius: 3px; background: var(--heat-0); }
.cells[data-rows="1"] .cells__cell { aspect-ratio: auto; height: 32px; }
.host.cells[data-rows="1"] { min-height: 0; }
.cells__cell.pos { background: color-mix(in oklab, var(--mid), var(--pole-pos) calc(var(--a) * 100%)); }
.cells__cell.neg { background: color-mix(in oklab, var(--mid), var(--pole-neg) calc(var(--a) * 100%)); }
.cells__cell.seq { background: color-mix(in oklab, var(--heat-0), var(--heat-4) calc(var(--a) * 100%)); }
.cells__cell.is-empty { background: transparent; box-shadow: inset 0 0 0 1px var(--line); } /* sem leitura: só o contorno, para não parecer o "neutro" (5), que é preenchido */
.cells__cell.is-hover { outline: 2px solid var(--ink); outline-offset: 1px; }
.table { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.table summary { cursor: pointer; color: var(--brand-text); font-size: 0.875rem; min-height: 32px; }
.table table { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 0.8125rem; display: block; max-height: 260px; overflow: auto; }
.table th, .table td { padding: 6px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }

/* ── recados ── */
.insights { display: grid; gap: 8px; }
.insight { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--line-2); }
.insight p { color: var(--ink-2); }
.insight strong { color: var(--ink); }
.insight--positive { border-left-color: var(--e-happy); }
.insight--positive .i { color: var(--ok-text); }
.insight--warn { border-left-color: var(--e-surprised); }
.insight--warn .i { color: var(--warn-text); }
.insight--info .i { color: var(--brand-text); }
.link { border: 0; background: none; padding: 0; color: var(--brand-text); text-decoration: underline; cursor: pointer; }

/* ── ajustes ── */
.settings { display: grid; gap: 16px; }
@media (min-width: 900px) { .settings { grid-template-columns: repeat(3, minmax(0, 1fr)); } .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.field { display: grid; gap: 6px; margin-bottom: 12px; font-size: 0.875rem; color: var(--ink-2); }
select { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); }
.switch { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__box { flex: none; position: relative; width: 44px; height: 26px; margin-top: 2px; border-radius: 99px; background: var(--line-2); transition: background 0.2s; }
.switch__box::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: 0 1px 3px rgb(0 0 0 / 0.3); }
.switch input:checked + .switch__box { background: var(--btn); }
.switch input:checked + .switch__box::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__box { outline: 3px solid var(--brand); outline-offset: 2px; }
.switch input:disabled + .switch__box { opacity: 0.45; }
.switch__text { display: grid; font-size: 0.9375rem; }
.switch__text small { color: var(--ink-3); font-size: 0.8125rem; line-height: 1.35; }
.switch--inline { padding: 0; }

/* ── botões ── */
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 600; }
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.btn--primary:hover:not(:disabled) { background: var(--btn-hover); }
.btn--big { min-height: 52px; padding: 0 24px; font-size: 1.0625rem; }
.btn--small { min-height: 36px; padding: 0 14px; }
.btn--danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); }

/* ── esqueleto, aviso, diálogo ── */
.sk { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; }
.sk--line { height: 14px; } .sk--short { width: 55%; } .sk--title { height: 28px; width: 40%; } .sk--big { height: 34px; width: 60%; } .sk--chart { height: 180px; width: 100%; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.kpi--sk { gap: 10px; }
.toasts { position: fixed; left: 50%; bottom: 16px; z-index: 40; transform: translateX(-50%); display: grid; gap: 8px; width: min(92vw, 440px); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow); font-size: 0.9375rem; animation: toast 0.25s ease; }
.toast--warn { background: #8a5a00; color: #fff; }
@keyframes toast { from { opacity: 0; transform: translateY(8px); } }
.dialog { border: 1px solid var(--line-2); border-radius: 16px; padding: 0; background: var(--surface); color: var(--ink); max-width: min(92vw, 420px); }
.dialog::backdrop { background: rgb(0 0 0 / 0.55); }
.dialog__in { display: grid; gap: 12px; padding: 22px; }
.dialog__in h2 { font-size: 1.15rem; }

.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot__in { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding-block: 18px; color: var(--ink-3); font-size: 0.8125rem; }

@media (max-width: 560px) {
	.live__main { grid-template-columns: 1fr; }
	.rank { grid-template-columns: 70px 1fr 40px 36px; }
	.updated { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce), (update: slow) {
	.sk { animation: none; } .meter i, .mini__track i, .switch__box, .switch__box::after { transition: none; }
}
html[data-motion="reduced"] .sk, html[data-motion="reduced"] .toast { animation: none; }
html[data-motion="reduced"] .meter i, html[data-motion="reduced"] .mini__track i { transition: none; }
