/* Painel do dono. Mesmo Design DNA da moldura (CLAUDE.md): instrumento de bancada em preto e branco,
   neutros em croma 0 e um único acento laranja sinal. Familjen Grotesk na interface, Martian Mono nos números. */

@font-face {
  font-family: 'Familjen Grotesk';
  src: url('fonts/familjen-grotesk.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: 'Familjen Grotesk';
  src: url('fonts/familjen-grotesk-ext.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
  unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Martian Mono';
  src: url('fonts/martian-mono.woff2') format('woff2');
  font-weight: 100 800;
  font-stretch: 75% 112.5%;
  font-display: swap;
}

:root {
  --ink-0: oklch(0.13 0 0);
  --ink-1: oklch(0.18 0 0);
  --ink-2: oklch(0.22 0 0);
  --ink-3: oklch(0.27 0 0);
  --ink-4: oklch(0.33 0 0);
  --line: oklch(1 0 0 / 0.1);
  --line-strong: oklch(1 0 0 / 0.18);
  --fg: oklch(0.97 0 0);
  --fg-muted: oklch(0.72 0 0);
  --fg-faint: oklch(0.6 0 0);          /* só rótulos de eixo e marcas secundárias, nunca texto corrido */
  --signal: oklch(0.68 0.21 37);
  --signal-hover: oklch(0.73 0.19 40);
  --on-signal: oklch(0.17 0.03 40);
  --signal-soft: oklch(0.68 0.21 37 / 0.14);
  --signal-wash: oklch(0.68 0.21 37 / 0.1);
  --ok: oklch(0.78 0.16 150);
  --warn: oklch(0.82 0.15 85);
  --danger: oklch(0.64 0.22 25);
  --danger-text: oklch(0.74 0.16 25);
  --bar: oklch(0.6 0 0);               /* barras neutras: o laranja fica para o que importa */
  --bar-hover: oklch(0.72 0 0);

  --font-ui: 'Familjen Grotesk', system-ui, sans-serif;
  --font-mono: 'Martian Mono', ui-monospace, monospace;

  --text-2xs: 0.625rem;
  --text-xs: 0.6875rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-lg: 1.125rem;
  --text-xl: 1.375rem;

  --r-field: 10px;
  --r-panel: 14px;
  --r-tip: 8px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 180ms;

  --z-sticky: 10;
  --z-toast: 30;
  --z-tip: 40;

  --gutter: 24px;
  --maxw: 1280px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--ink-0);
  color: var(--fg);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
code, .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-stretch: 87.5%; }
code { font-size: 0.85em; background: var(--ink-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; overflow-wrap: anywhere; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--fg-muted); }

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }

/* ---------- ponto de sinal ---------- */
.live-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-soft);
  animation: pulse 1.6s var(--ease) infinite;
  flex: none;
}
@keyframes pulse { 50% { opacity: 0.45; } }
.boot { position: fixed; inset: 0; display: grid; place-items: center; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 34px; padding: 0 14px;
  border-radius: var(--r-field);
  border: 1px solid var(--line-strong);
  background: var(--ink-2);
  font-size: var(--text-sm); font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn:hover { background: var(--ink-3); }
.btn:active { background: var(--ink-4); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.small { height: 30px; padding: 0 11px; font-size: var(--text-xs); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-muted); }
.btn.ghost:hover { color: var(--fg); background: var(--ink-2); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.btn.primary:hover { background: var(--signal-hover); border-color: var(--signal-hover); }
.btn.block { width: 100%; height: 40px; font-size: var(--text-base); }
.btn.busy { pointer-events: none; }
.btn.busy .btn-label::after { content: '…'; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- campos ---------- */
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field label, .label { font-size: var(--text-sm); color: var(--fg-muted); font-weight: 500; }
input[type='email'], input[type='password'], input[type='text'], input[type='search'] {
  width: 100%; height: 40px; padding: 0 12px;
  border-radius: var(--r-field);
  border: 1px solid var(--line-strong);
  background: var(--ink-0);
  font-size: var(--text-base);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input::placeholder { color: var(--fg-muted); opacity: 0.75; }
input:hover { border-color: oklch(1 0 0 / 0.26); }
input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
input[aria-invalid='true'] { border-color: var(--danger); }
input.otp { font-family: var(--font-mono); font-stretch: 100%; letter-spacing: 0.32em; font-size: var(--text-lg); text-align: center; }
input.otp::placeholder { letter-spacing: 0.32em; opacity: 0.35; }
.hint { font-size: var(--text-xs); color: var(--fg-muted); }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--danger-text); }
.form-error {
  font-size: var(--text-sm); color: var(--fg);
  background: oklch(0.64 0.22 25 / 0.12);
  border: 1px solid oklch(0.64 0.22 25 / 0.45);
  border-radius: var(--r-field);
  padding: 9px 12px;
  display: flex; gap: 9px; align-items: flex-start;
}
.form-error::before { content: ''; flex: none; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--danger); }

.pw { position: relative; }
.pw input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 4px; top: 4px; width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--fg-muted); cursor: pointer;
}
.pw-toggle:hover { color: var(--fg); background: var(--ink-2); }
.pw-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pw-toggle[aria-pressed='true'] { color: var(--signal); }

/* ---------- marca ---------- */
.wordmark {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-weight: 700; font-size: var(--text-lg); letter-spacing: -0.01em;
  text-decoration: none;
}
.wordmark-sub {
  font-family: var(--font-mono); font-stretch: 87.5%; font-weight: 400;
  font-size: var(--text-2xs); color: var(--fg-muted);
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 5px;
  position: relative; top: -2px;
}

/* ---------- portão (entrar / convite) ---------- */
.gate {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 48px 16px;
  background: radial-gradient(120% 60% at 50% -10%, oklch(0.68 0.21 37 / 0.07), transparent 60%), var(--ink-0);
}
.gate-panel {
  position: relative;
  width: min(100%, 384px);
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 28px 28px 22px;
  animation: rise 220ms var(--ease) both;
}
.gate-panel.wide { width: min(100%, 560px); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
/* marcas de corte de desenho técnico nos cantos */
.crop { position: absolute; width: 12px; height: 12px; border-color: var(--line-strong); border-style: solid; border-width: 0; }
.crop.tl { left: -9px; top: -9px; border-left-width: 1px; border-top-width: 1px; }
.crop.tr { right: -9px; top: -9px; border-right-width: 1px; border-top-width: 1px; }
.crop.bl { left: -9px; bottom: -9px; border-left-width: 1px; border-bottom-width: 1px; }
.crop.br { right: -9px; bottom: -9px; border-right-width: 1px; border-bottom-width: 1px; }
.gate-head { display: grid; gap: 18px; margin-bottom: 22px; }
.gate-head h1 { font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.01em; }
.gate-lede { color: var(--fg-muted); font-size: var(--text-sm); margin-top: -10px; }
.gate-lede strong { color: var(--fg); font-weight: 600; }
.gate-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: var(--text-2xs); color: var(--fg-muted); }
.invite-msg { display: flex; gap: 10px; align-items: center; color: var(--fg-muted); font-size: var(--text-sm); }
#invite-dead { display: grid; gap: 12px; justify-items: start; }
.invite-dead-title { color: var(--fg); font-weight: 600; font-size: var(--text-base); }

.steps { gap: 22px; }
.step { border: 0; margin: 0; padding: 0; display: grid; gap: 12px; min-width: 0; }
.step + .step { padding-top: 20px; border-top: 1px solid var(--line); }
.step legend { padding: 0; margin-bottom: 12px; font-weight: 600; font-size: var(--text-base); display: flex; align-items: center; gap: 10px; }
.step-n {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--line-strong); font-size: var(--text-2xs); color: var(--fg-muted);
}
.step.done .step-n { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.step-lede { font-size: var(--text-sm); margin-top: -4px; }
.meter.ok { color: var(--fg-muted); }
.meter.ok .mono { color: var(--ok); }
.totp { display: grid; grid-template-columns: 176px 1fr; gap: 20px; align-items: center; }
.qr { margin: 0; width: 176px; height: 176px; border-radius: 10px; overflow: hidden; background: #fff; }
.qr svg { display: block; width: 100%; height: 100%; }
.totp-manual { display: grid; gap: 10px; justify-items: start; min-width: 0; }
.secret {
  font-size: var(--text-sm); letter-spacing: 0.06em; word-spacing: 0.3em; line-height: 1.7;
  background: var(--ink-0); border: 1px solid var(--line); border-radius: var(--r-field);
  padding: 8px 10px; width: 100%; user-select: all; overflow-wrap: anywhere;
}
@media (max-width: 520px) {
  .gate-panel { padding: 24px 18px 18px; }
  .totp { grid-template-columns: 1fr; justify-items: center; }
  .totp-manual { justify-items: stretch; width: 100%; }
}

/* ---------- topo do painel ---------- */
.top {
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: oklch(0.13 0 0 / 0.94);
  border-bottom: 1px solid var(--line);
}
@supports (backdrop-filter: blur(8px)) { .top { backdrop-filter: blur(8px); } }
.top-row, .tabs { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.top-row {
  height: 56px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.who { justify-self: end; display: flex; align-items: center; gap: 10px; min-width: 0; }
.me { font-size: var(--text-sm); color: var(--fg-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.range {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--ink-1); border: 1px solid var(--line); border-radius: 999px;
  transition: opacity var(--dur) var(--ease);
}
.range button {
  height: 28px; min-width: 52px; padding: 0 12px; border: 0; border-radius: 999px;
  background: transparent; color: var(--fg-muted);
  font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--text-xs);
  cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.range button:hover { color: var(--fg); background: var(--ink-2); }
.range button[aria-checked='true'] { background: var(--ink-4); color: var(--fg); }
.range.inert { opacity: 0.4; }

.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; flex: none;
  padding: 10px 12px 12px; font-size: var(--text-sm); font-weight: 500;
  color: var(--fg-muted); text-decoration: none;
  transition: color var(--dur) var(--ease);
}
.tabs a:hover { color: var(--fg); }
.tabs a[aria-current='page'] { color: var(--fg); }
.tabs a::after {
  content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px;
  background: var(--signal); transform: scaleX(0); transition: transform 200ms var(--ease);
}
.tabs a[aria-current='page']::after { transform: scaleX(1); }

@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .top-row { grid-template-columns: 1fr auto; grid-template-areas: 'brand who' 'range range'; height: auto; padding-top: 10px; padding-bottom: 8px; row-gap: 10px; }
  .top-row .wordmark { grid-area: brand; }
  .who { grid-area: who; }
  .range { grid-area: range; justify-self: stretch; }
  .range button { flex: 1; min-width: 0; }
  .me { max-width: 150px; }
}

/* ---------- vista ---------- */
.view { max-width: var(--maxw); margin: 0 auto; padding: 28px var(--gutter) 72px; display: grid; gap: 20px; outline: none; }
.view > * { min-width: 0; }
.view-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.view-head h1 { font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.01em; }
.stamp { display: inline-flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--fg-muted); }
.stamp .live-dot { width: 6px; height: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: var(--text-xs); font-weight: 500;
  border: 1px solid var(--line-strong); color: var(--fg-muted);
}
.badge.warn { border-color: oklch(0.82 0.15 85 / 0.5); color: var(--warn); }

.panel {
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 18px 20px 20px;
  min-width: 0;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { font-size: var(--text-base); font-weight: 600; }
.panel-head .sub { font-size: var(--text-xs); color: var(--fg-muted); }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 16px 20px 0; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 20px; }

/* ---------- leituras (KPIs): uma régua de instrumento, não um mural de cartões ---------- */
.readouts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  overflow: hidden;
}
.readouts.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.readout { background: var(--ink-1); padding: 14px 16px 15px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.readout-label { font-size: var(--text-sm); color: var(--fg-muted); display: flex; align-items: center; gap: 6px; }
.readout-value {
  font-family: var(--font-mono); font-stretch: 87.5%; font-variant-numeric: tabular-nums;
  font-size: 1.5rem; font-weight: 500; letter-spacing: -0.02em; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.readout-value .unit { font-size: 0.6em; color: var(--fg-muted); margin-left: 4px; letter-spacing: 0; }
.readout-value.lead { color: var(--fg); }
.readout-sub { font-size: var(--text-xs); color: var(--fg-muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.readout-sub .mono { color: var(--fg); }
.trio { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 2px 18px; }
.trio .readout-value { font-size: 1.5rem; }
.trio small { font-size: var(--text-xs); color: var(--fg-muted); }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); color: var(--fg-muted); }
.delta .mono { color: var(--fg); }
.delta svg { width: 9px; height: 9px; }
.delta.up svg { fill: var(--ok); }
.delta.down svg { fill: var(--danger); }
@media (max-width: 1060px) { .readouts, .readouts.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { .readout-value, .trio .readout-value { font-size: 1.25rem; } }

/* ---------- cota (assinatura de desenho técnico) ---------- */
.dim {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--text-2xs);
  color: var(--fg-muted); white-space: nowrap;
}
.dim::before, .dim::after {
  content: ''; flex: 1; height: 9px; min-width: 12px;
  background: linear-gradient(var(--line-strong), var(--line-strong)) center / 100% 1px no-repeat;
}
.dim::before { border-left: 1px solid var(--fg-faint); }
.dim::after { border-right: 1px solid var(--fg-faint); }

/* ---------- gráficos ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis text { fill: var(--fg-faint); font-family: var(--font-mono); font-stretch: 87.5%; font-size: 10px; }
.chart .baseline { stroke: var(--line-strong); shape-rendering: crispEdges; }
.chart .line { fill: none; stroke: var(--signal); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--signal-wash); }
.chart .col { fill: var(--signal); transition: opacity var(--dur) var(--ease); }
.chart .col.dim-col { fill: var(--bar); }
.chart.hovering .col:not(.on) { opacity: 0.45; }
.chart .cross { stroke: var(--line-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart .dot { fill: var(--signal); stroke: var(--ink-1); stroke-width: 2; }
.chart .end-label { fill: var(--fg); font-family: var(--font-mono); font-stretch: 87.5%; font-size: 11px; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .zero-note { fill: var(--fg-muted); font-size: 12px; font-family: var(--font-ui); }

.multiples { display: grid; gap: 4px; }
.multiple-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 2px; }
.multiple-name { font-size: var(--text-sm); color: var(--fg-muted); }
.multiple-read { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.multiple-read small { color: var(--fg-muted); font-size: var(--text-2xs); margin-left: 6px; }
.multiple + .multiple { margin-top: 14px; }
.series-foot { margin-top: 10px; }
.chart-day { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--text-xs); color: var(--fg-muted); min-height: 1.4em; }

.chart-tip {
  position: absolute; pointer-events: none; z-index: 2;
  background: var(--ink-3); border: 1px solid var(--line-strong); border-radius: var(--r-tip);
  padding: 7px 9px; font-size: var(--text-xs); white-space: nowrap;
  transform: translate(-50%, calc(-100% - 10px));
}
.chart-tip .mono { font-size: var(--text-sm); }
.chart-tip .k { color: var(--fg-muted); }
.chart-tip div { display: flex; justify-content: space-between; gap: 14px; }

/* ---------- funil ---------- */
.funnel { list-style: none; margin: 0; padding: 0; display: grid; }
.funnel li { display: grid; grid-template-columns: minmax(130px, 200px) 1fr 76px; gap: 6px 16px; align-items: center; }
.funnel .f-label { font-size: var(--text-sm); }
.funnel .f-track { height: 22px; position: relative; }
.funnel .f-bar { height: 100%; width: 0; min-width: 2px; background: var(--bar); border-radius: 0 4px 4px 0; transition: width 420ms var(--ease); }
.funnel li:last-child .f-bar { background: var(--signal); }
.funnel .f-null { height: 100%; border: 1px dashed var(--line-strong); border-radius: 4px; display: flex; align-items: center; padding: 0 10px; font-size: var(--text-xs); color: var(--fg-muted); }
.funnel .f-val { font-family: var(--font-mono); font-stretch: 87.5%; font-size: var(--text-sm); text-align: right; font-variant-numeric: tabular-nums; }
.funnel .f-step { grid-column: 2 / 4; display: flex; align-items: center; gap: 8px; height: 26px; font-size: var(--text-xs); color: var(--fg-muted); }
.funnel .f-step .mono { color: var(--fg); }
.funnel .f-step svg { width: 10px; height: 10px; stroke: var(--fg-faint); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.funnel-total { margin-top: 14px; }
@media (max-width: 560px) {
  .funnel li { grid-template-columns: 1fr auto; }
  .funnel .f-label { grid-column: 1; }
  .funnel .f-val { grid-column: 2; grid-row: 1; }
  .funnel .f-track { grid-column: 1 / -1; }
  .funnel .f-step { grid-column: 1 / -1; }
}

/* ---------- listas de barras ---------- */
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(0, 132px) 1fr auto; gap: 12px; align-items: center; font-size: var(--text-sm); }
.bars .b-key { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .b-track { height: 8px; background: var(--ink-2); border-radius: 4px; overflow: hidden; }
.bars .b-fill { height: 100%; width: 0; background: var(--bar); border-radius: 0 4px 4px 0; transition: width 420ms var(--ease); }
.bars li:hover .b-fill { background: var(--bar-hover); }
.bars .b-val { font-family: var(--font-mono); font-stretch: 87.5%; font-variant-numeric: tabular-nums; font-size: var(--text-xs); text-align: right; min-width: 7ch; }
.bars .b-val small { color: var(--fg-muted); margin-left: 6px; }
.bars.wide-key li { grid-template-columns: minmax(0, 220px) 1fr auto; }

/* ---------- tabelas ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th {
  text-align: left; font-weight: 500; font-size: var(--text-xs); color: var(--fg-muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
th[data-tip] { cursor: help; text-decoration: underline dotted var(--fg-faint); text-underline-offset: 3px; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background var(--dur) var(--ease); }
tbody tr:hover { background: oklch(1 0 0 / 0.025); }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
td.num, th.num { text-align: right; }
td.num, td.date { font-family: var(--font-mono); font-stretch: 87.5%; font-variant-numeric: tabular-nums; font-size: var(--text-xs); }
td.date { color: var(--fg-muted); }
td.email { max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.nil { color: var(--fg-faint); }
.neg { color: var(--danger-text); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px 0 8px;
  border-radius: 999px; background: var(--ink-2); border: 1px solid var(--line);
  font-size: var(--text-xs); font-weight: 500; white-space: nowrap;
}
.chip::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--fg-muted); }
.chip.s-ok::before { background: var(--ok); }
.chip.s-live::before { background: var(--signal); }
.chip.s-warn::before { background: var(--warn); }
.chip.s-bad::before { background: var(--danger); }
.chip.s-off::before { background: transparent; box-shadow: inset 0 0 0 1px var(--fg-muted); }
.kind { font-size: var(--text-xs); }

/* ---------- filtros de usuários ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; }
.filter {
  height: 30px; padding: 0 12px; border-radius: 999px; cursor: pointer;
  background: transparent; border: 1px solid var(--line-strong); color: var(--fg-muted);
  font-size: var(--text-xs); font-weight: 500;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.filter:hover { color: var(--fg); background: var(--ink-2); }
.filter[aria-pressed='true'] { background: var(--signal-soft); border-color: oklch(0.68 0.21 37 / 0.6); color: var(--fg); }
.tools { display: flex; gap: 8px; align-items: center; flex: 1 1 260px; justify-content: flex-end; }
.search { position: relative; flex: 1 1 200px; max-width: 300px; }
.search svg { position: absolute; left: 10px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; fill: none; stroke: var(--fg-muted); stroke-width: 1.6; stroke-linecap: round; pointer-events: none; }
.search input { height: 34px; padding-left: 34px; font-size: var(--text-sm); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); font-size: var(--text-xs); color: var(--fg-muted); }
.pager .mono { color: var(--fg); }
.pager-btns { display: flex; gap: 6px; }
@media (max-width: 640px) { .tools { justify-content: stretch; } .search { max-width: none; } }

/* ---------- estados ---------- */
.sk { background: var(--ink-2); border-radius: 6px; animation: sk 1.4s ease-in-out infinite; }
@keyframes sk { 50% { opacity: 0.55; } }
.sk-line { height: 12px; }
.sk-value { height: 26px; width: 60%; }
.sk-chart { height: 220px; border-radius: 10px; }
.sk-row { height: 36px; border-radius: 0; background: transparent; border-bottom: 1px solid var(--line); animation: none; display: flex; align-items: center; padding: 0 20px; }
.sk-row::before { content: ''; height: 10px; width: 100%; border-radius: 4px; background: var(--ink-2); animation: sk 1.4s ease-in-out infinite; }

.empty { display: grid; justify-items: start; gap: 8px; padding: 18px 0 4px; max-width: 60ch; }
.empty-title { font-weight: 600; font-size: var(--text-sm); }
.empty p { font-size: var(--text-sm); color: var(--fg-muted); }
.table-empty { padding: 28px 20px; }

.failed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border: 1px solid oklch(0.64 0.22 25 / 0.4); background: oklch(0.64 0.22 25 / 0.08); border-radius: var(--r-panel); }
.failed p { font-size: var(--text-sm); }
.failed .muted { font-size: var(--text-xs); }

/* fonte desligada (site) */
.setup { display: grid; gap: 12px; padding: 4px 0 2px; }
.setup ol { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; font-size: var(--text-sm); color: var(--fg-muted); max-width: 68ch; }
.setup li::marker { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--fg-faint); }
.setup-head { display: flex; gap: 10px; align-items: center; }
.env { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- dica (tooltip) ---------- */
.tip {
  position: fixed; left: 0; top: 0; z-index: var(--z-tip);
  max-width: 240px; padding: 6px 9px;
  background: var(--ink-3); border: 1px solid var(--line-strong); border-radius: var(--r-tip);
  font-size: var(--text-xs); line-height: 1.35; color: var(--fg);
  pointer-events: none;
  opacity: 0; transform: translateY(2px);
  transition: opacity 140ms var(--ease), transform 140ms var(--ease);
}
.tip.on { opacity: 1; transform: none; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: var(--z-toast);
  translate: -50% 0;
  background: var(--ink-3); border: 1px solid var(--line-strong); border-radius: 999px;
  padding: 8px 16px; font-size: var(--text-sm);
}

/* entrada das vistas: só um fade curto, o conteúdo já está visível */
.view.enter > * { animation: fade 200ms var(--ease) both; }
@keyframes fade { from { opacity: 0.001; transform: translateY(4px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .live-dot, .sk, .sk-row::before { animation: none !important; }
  .tip { transform: none; }
}
@media (forced-colors: active) {
  .funnel .f-bar, .bars .b-fill, .chart .col { forced-color-adjust: none; background: CanvasText; fill: CanvasText; }
}

/* ---------- complementos ---------- */
.readouts.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.site-body { display: grid; gap: 22px; }
.list-title { font-size: var(--text-sm); font-weight: 600; margin-bottom: 12px; color: var(--fg); }
.numbers { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.numbers summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  font-size: var(--text-xs); color: var(--fg-muted); padding: 4px 0;
}
.numbers summary::-webkit-details-marker { display: none; }
.numbers summary::before { content: ''; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform var(--dur) var(--ease); }
.numbers[open] summary::before { transform: rotate(45deg); }
.numbers summary:hover { color: var(--fg); }
.numbers .table-wrap { max-height: 320px; overflow: auto; margin: 8px -20px -20px; border-top: 1px solid var(--line); }
.numbers th { position: sticky; top: 0; background: var(--ink-1); }
.funnel .f-scope { margin-left: 8px; font-size: var(--text-2xs); color: var(--fg-muted); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 4px; }
.site-down { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
td .mono { font-size: var(--text-xs); }
.chart-day { font-family: var(--font-ui); }
.setup ol { padding-left: 1.7em; }
.setup-head .muted, .site-down .muted { font-size: var(--text-sm); }
/* leituras dentro de um painel: sem moldura própria, só a régua entre elas */
.panel .readouts { background: transparent; border: 0; border-radius: 0; gap: 0; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.panel .readout { background: transparent; padding: 0 20px 0 0; }
.panel .readout + .readout { padding-left: 20px; border-left: 1px solid var(--line); }
.step + .step { border-top: 0; box-shadow: 0 -1px 0 var(--line); }
.step legend { margin-bottom: 4px; }
.trio { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.readout-value:has(.trio) { overflow: visible; white-space: normal; }
@media (max-width: 560px) { .trio .readout-value { font-size: 1.25rem; } .readout { padding: 12px 14px 13px; } }
/* legenda como conteúdo comum (não "rendered legend"), para a régua passar acima dela */
.step legend { float: left; width: 100%; }

/* ---------- Agora no site (GA4 em tempo real) ---------- */
.live {
  background: var(--ink-1);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
  padding: 16px 20px 14px;
  min-width: 0;
}
.live-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.live-head h2 { font-size: var(--text-base); font-weight: 600; }
.live-head .muted { font-size: var(--text-xs); margin-left: auto; }
.live-note { font-size: var(--text-sm); }
.live-body { display: grid; grid-template-columns: auto minmax(180px, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 16px 28px; align-items: start; }
.live-nums { display: grid; gap: 10px; }
.live-nums > div { display: grid; }
.live-nums small { font-size: var(--text-xs); color: var(--fg-muted); }
.live-chart { margin: 0; }
.live-bars { display: block; width: 100%; height: 56px; }
.live-bars rect { fill: var(--bar); }
.live-bars rect.zero { fill: var(--ink-3); }
.live-bars rect.now { fill: var(--signal); }
.live-bars rect:hover { fill: var(--bar-hover); }
.live-chart figcaption { margin-top: 6px; }
.live-list h3 { font-size: var(--text-xs); font-weight: 500; color: var(--fg-muted); margin-bottom: 6px; }
.live-list ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.live-list li { display: flex; justify-content: space-between; gap: 10px; font-size: var(--text-sm); }
.live-list .live-key { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.live-list p { font-size: var(--text-sm); }
.live-foot { margin-top: 12px; font-size: var(--text-2xs); }
@media (max-width: 1060px) { .live-body { grid-template-columns: auto minmax(0, 1fr); } }
@media (max-width: 560px) { .live-body { grid-template-columns: minmax(0, 1fr); } .live-head .muted { margin-left: 0; } }
