/* =============================================================
   VAI CONVERTER — DESIGN SYSTEM v2 "SAAS"
   App shell premium dark-first. Identidade da marca viva:
   preto profundo + OURO #F0B429 (logo) como accent primário,
   verde #34cf7d = sucesso/conversão, vermelho #ef4d54 = perigo.
   Escala térmica de score mantida (frio → ouro da marca).
   DM Sans = voz de UI · JetBrains Mono = voz de dado.
   2026-08-07 · Projeto Motores, Fase 3-prep, iteração v2
   ============================================================= */

/* ---------- 1. TOKENS (default = DARK, tema da marca) -------- */

:root {
  /* Superfícies — carvão da marca (#0a0a0b / #141416) */
  --bg:        oklch(14.8% 0.004 270);
  --panel:     oklch(18.6% 0.005 270);
  --panel-2:   oklch(22% 0.006 270);
  --panel-3:   oklch(25.5% 0.007 270);
  --line:      oklch(100% 0 0 / 0.09);
  --line-2:    oklch(100% 0 0 / 0.16);

  /* Tinta — marfim quente da marca (#f6f4ee) */
  --ink:    oklch(96% 0.007 90);
  --ink-2:  oklch(78% 0.010 90);
  --ink-3:  oklch(66% 0.010 90);

  /* OURO Vai Converter (#F0B429, logo) — accent primário */
  --brand:        oklch(80% 0.147 84);
  --brand-hover:  oklch(85% 0.150 88);
  --brand-down:   oklch(72% 0.140 80);
  --brand-soft:   oklch(80% 0.147 84 / 0.12);
  --brand-line:   oklch(80% 0.147 84 / 0.35);
  --on-brand:     oklch(17% 0.02 84);

  /* Semânticos da marca viva */
  --success:      oklch(76% 0.155 156);  /* #34cf7d */
  --success-soft: oklch(76% 0.155 156 / 0.12);
  --danger:       oklch(64% 0.170 21);   /* #ef4d54 */
  --danger-soft:  oklch(64% 0.170 21 / 0.12);
  --warn:         oklch(75% 0.120 70);   /* #efb13f */
  --warn-soft:    oklch(75% 0.120 70 / 0.12);
  --ok-text:      var(--success);
  --warn-text:    var(--warn);
  --danger-text:  oklch(70% 0.155 21);

  /* ESCALA TÉRMICA DE SCORE (mantida): frio → ouro da marca */
  --temp-cold:  oklch(63% 0.085 252);
  --temp-mild:  oklch(68% 0.085 66);
  --temp-warm:  oklch(74% 0.118 76);
  --temp-hot:   var(--brand);
  --temp-cold-text: var(--temp-cold);
  --temp-mild-text: var(--temp-mild);
  --temp-warm-text: var(--temp-warm);
  --temp-hot-text:  var(--brand);

  /* Tipografia — DM Sans (UI) + JetBrains Mono (dado) */
  --font-ui:   'DM Sans', system-ui, -apple-system, sans-serif;
  --font-data: 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;

  --text-xs:   0.72rem;
  --text-sm:   0.845rem;
  --text-base: 0.94rem;
  --text-lg:   1.08rem;
  --text-h3:   1.18rem;
  --text-h2:   clamp(1.35rem, 1.2rem + 0.7vw, 1.7rem);
  --text-h1:   clamp(1.6rem, 1.4rem + 1vw, 2.1rem);
  --text-big:  clamp(2.2rem, 1.8rem + 1.8vw, 3.4rem);

  /* Espaço */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.875rem;
  --sp-4: 1.25rem;
  --sp-5: 2rem;
  --sp-6: 3rem;
  --sp-7: 4.5rem;

  /* Forma e profundidade */
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --shadow-1: 0 1px 2px oklch(0% 0 0 / 0.35), 0 8px 24px oklch(0% 0 0 / 0.28);
  --shadow-2: 0 2px 6px oklch(0% 0 0 / 0.4), 0 20px 48px oklch(0% 0 0 / 0.38);
  --glow-brand: 0 0 0 1px var(--brand-line), 0 4px 20px oklch(80% 0.147 84 / 0.18);

  /* Métricas do shell */
  --sidebar-w: 236px;
  --appbar-h: 60px;

  /* Motion */
  --dur-fast: 140ms;
  --dur-base: 220ms;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);

  color-scheme: dark;
}

/* Tema claro — SaaS light impecável, ouro continua mandando */
[data-theme="light"] {
  --bg:        oklch(97.3% 0.003 90);
  --panel:     oklch(99.4% 0.002 90);
  --panel-2:   oklch(95.5% 0.004 90);
  --panel-3:   oklch(93% 0.005 90);
  --line:      oklch(0% 0 0 / 0.09);
  --line-2:    oklch(0% 0 0 / 0.16);

  --ink:    oklch(21% 0.008 270);
  --ink-2:  oklch(40% 0.008 270);
  --ink-3:  oklch(50% 0.008 270);

  --brand:        oklch(74% 0.145 80);
  --brand-hover:  oklch(68% 0.140 78);
  --brand-down:   oklch(62% 0.135 76);
  --brand-soft:   oklch(74% 0.145 80 / 0.16);
  --brand-line:   oklch(74% 0.145 80 / 0.45);
  --on-brand:     oklch(20% 0.03 84);

  --success:      oklch(64% 0.150 155);
  --success-soft: oklch(64% 0.150 155 / 0.13);
  --danger:       oklch(56% 0.180 23);
  --danger-soft:  oklch(56% 0.180 23 / 0.11);
  --warn:         oklch(66% 0.125 72);
  --warn-soft:    oklch(66% 0.125 72 / 0.14);
  --ok-text:      oklch(50% 0.135 152);
  --warn-text:    oklch(52% 0.115 70);
  --danger-text:  oklch(50% 0.170 24);

  --temp-cold:  oklch(50% 0.085 252);
  --temp-mild:  oklch(52% 0.090 66);
  --temp-warm:  oklch(56% 0.115 72);
  --temp-hot:   oklch(60% 0.130 80);
  --temp-cold-text: var(--temp-cold);
  --temp-mild-text: var(--temp-mild);
  --temp-warm-text: var(--temp-warm);
  --temp-hot-text:  var(--temp-hot);

  --shadow-1: 0 1px 2px oklch(20% 0.01 270 / 0.07), 0 6px 20px oklch(20% 0.01 270 / 0.07);
  --shadow-2: 0 2px 6px oklch(20% 0.01 270 / 0.09), 0 18px 44px oklch(20% 0.01 270 / 0.11);
  --glow-brand: 0 0 0 1px var(--brand-line), 0 4px 18px oklch(74% 0.145 80 / 0.2);

  color-scheme: light;
}

/* Fallback sem JS: sistema claro ganha tema claro */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg:        oklch(97.3% 0.003 90);
    --panel:     oklch(99.4% 0.002 90);
    --panel-2:   oklch(95.5% 0.004 90);
    --panel-3:   oklch(93% 0.005 90);
    --line:      oklch(0% 0 0 / 0.09);
    --line-2:    oklch(0% 0 0 / 0.16);
    --ink:    oklch(21% 0.008 270);
    --ink-2:  oklch(40% 0.008 270);
    --ink-3:  oklch(50% 0.008 270);
    --brand:        oklch(74% 0.145 80);
    --brand-hover:  oklch(68% 0.140 78);
    --brand-down:   oklch(62% 0.135 76);
    --brand-soft:   oklch(74% 0.145 80 / 0.16);
    --brand-line:   oklch(74% 0.145 80 / 0.45);
    --on-brand:     oklch(20% 0.03 84);
    --success:      oklch(64% 0.150 155);
    --success-soft: oklch(64% 0.150 155 / 0.13);
    --danger:       oklch(56% 0.180 23);
    --danger-soft:  oklch(56% 0.180 23 / 0.11);
    --warn:         oklch(66% 0.125 72);
    --warn-soft:    oklch(66% 0.125 72 / 0.14);
    --ok-text:      oklch(50% 0.135 152);
    --warn-text:    oklch(52% 0.115 70);
    --danger-text:  oklch(50% 0.170 24);
    --temp-cold:  oklch(50% 0.085 252);
    --temp-mild:  oklch(52% 0.090 66);
    --temp-warm:  oklch(56% 0.115 72);
    --temp-hot:   oklch(60% 0.130 80);
    --temp-cold-text: var(--temp-cold);
    --temp-mild-text: var(--temp-mild);
    --temp-warm-text: var(--temp-warm);
    --temp-hot-text:  var(--temp-hot);
    --shadow-1: 0 1px 2px oklch(20% 0.01 270 / 0.07), 0 6px 20px oklch(20% 0.01 270 / 0.07);
    --shadow-2: 0 2px 6px oklch(20% 0.01 270 / 0.09), 0 18px 44px oklch(20% 0.01 270 / 0.11);
    --glow-brand: 0 0 0 1px var(--brand-line), 0 4px 18px oklch(74% 0.145 80 / 0.2);
    color-scheme: light;
  }
}

/* ---------- 2. BASE ------------------------------------------ */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}

h1, h2, h3, h4 {
  font-family: var(--font-ui);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 var(--sp-3);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-base); font-weight: 600; }

p  { margin: 0 0 var(--sp-3); }
ul, ol { margin: 0 0 var(--sp-3); padding-left: 1.2rem; }
li { margin-bottom: var(--sp-1); }

a {
  color: var(--brand);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease);
}
a:hover { color: var(--brand-hover); }

img, svg { max-width: 100%; height: auto; }

::selection { background: var(--brand-soft); }

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

/* Voz de dado: números, IDs, URLs, timestamps */
.num, .data {
  font-family: var(--font-data);
  font-feature-settings: 'tnum' 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.kicker {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--sp-2);
}

.meta { font-size: var(--text-sm); color: var(--ink-3); }
.lede { font-size: var(--text-base); color: var(--ink-2); max-width: 68ch; }

/* ---------- 3. APP SHELL ------------------------------------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
@media (max-width: 1023px) {
  .app { grid-template-columns: minmax(0, 1fr); }
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-3);
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
@media (max-width: 1023px) { .sidebar { display: none; } }

.side-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: var(--sp-1) var(--sp-2);
  color: var(--ink);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
}
.side-brand:hover { color: var(--ink); }
.side-brand img { width: 30px; height: 30px; border-radius: 8px; flex: none; }
.side-brand .accent { color: var(--brand); }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav .group {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: var(--sp-3) var(--sp-2) var(--sp-1);
}
.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem var(--sp-2);
  border-radius: var(--radius-s);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.side-nav a:hover { background: var(--panel-2); color: var(--ink); }
.side-nav a.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}
.side-nav a svg { flex: none; opacity: 0.85; }
.side-nav a .count {
  margin-left: auto;
  font-size: var(--text-xs);
  color: var(--ink-3);
}

.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-3); }

.credit-card {
  background: linear-gradient(160deg, var(--brand-soft), transparent 70%), var(--panel-2);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-m);
  padding: var(--sp-3);
}
.credit-card .n {
  font-family: var(--font-data);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1;
}
.credit-card .lbl { font-size: var(--text-xs); color: var(--ink-2); margin-top: 4px; }
.credit-card .btn { width: 100%; justify-content: center; margin-top: var(--sp-3); }

/* Appbar */
.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--appbar-h);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 clamp(1rem, 3vw, 2rem);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.appbar .spacer { flex: 1; }
.appbar .page-title { font-size: var(--text-base); font-weight: 600; margin: 0; }

.appbar-brand { display: none; align-items: center; gap: 0.5rem; color: var(--ink); font-weight: 700; }
.appbar-brand img { width: 26px; height: 26px; border-radius: 7px; }
@media (max-width: 1023px) { .appbar-brand { display: inline-flex; } }

.crumbs { display: flex; align-items: center; gap: 0.5rem; font-size: var(--text-sm); min-width: 0; }
.crumbs a { color: var(--ink-3); }
.crumbs a:hover { color: var(--ink); }
.crumbs .sep { color: var(--ink-3); opacity: 0.6; }
.crumbs .here { color: var(--ink); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 34px;
  padding: 0 0.75rem;
  min-width: 200px;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--panel);
  color: var(--ink-3);
  font-size: var(--text-sm);
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.search:hover { border-color: var(--line-2); }
.search input {
  border: 0; background: transparent; outline: 0;
  color: var(--ink); font: inherit; width: 100%;
}
.search input::placeholder { color: var(--ink-3); }
.search kbd {
  font-family: var(--font-data);
  font-size: 0.68rem;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--ink-3);
}
@media (max-width: 700px) { .search { display: none; } }

/* Conteúdo */
.content {
  padding: var(--sp-5) clamp(1rem, 3vw, 2rem) var(--sp-7);
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

/* Nav mobile (sidebar escondida) */
.mobile-nav {
  display: none;
  gap: var(--sp-2);
  overflow-x: auto;
  padding: var(--sp-2) clamp(1rem, 3vw, 2rem);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
@media (max-width: 1023px) { .mobile-nav { display: flex; } }
.mobile-nav a {
  flex: none;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: var(--text-sm);
  font-weight: 500;
  background: var(--panel);
}
.mobile-nav a.active { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand); }

/* ---------- 4. BOTÕES ---------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: 600 var(--text-sm)/1 var(--font-ui);
  letter-spacing: 0.01em;
  height: 36px;
  padding: 0 1.1rem;
  border-radius: var(--radius-m);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              transform var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-brand { background: var(--brand); color: var(--on-brand); }
.btn-brand:hover { background: var(--brand-hover); color: var(--on-brand); box-shadow: var(--glow-brand); }

.btn-ghost { background: transparent; color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover { color: var(--ink); border-color: var(--ink-3); background: var(--panel-2); }

.btn-quiet { background: var(--panel-2); color: var(--ink-2); }
.btn-quiet:hover { background: var(--panel-3); color: var(--ink); }

.btn-sm { height: 30px; padding: 0 0.8rem; font-size: var(--text-xs); }

.theme-toggle {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink-2);
  width: 34px; height: 34px;
  border-radius: var(--radius-m);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-2); background: var(--panel-2); }
.theme-toggle .sun, .theme-toggle .moon { display: none; }
:root:not([data-theme="light"]) .theme-toggle .sun { display: block; }
[data-theme="light"] .theme-toggle .moon { display: block; }

/* ---------- 5. PAINÉIS --------------------------------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-1);
}
.panel-h {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
}
.panel-h h2, .panel-h h3 { margin: 0; font-size: var(--text-lg); }
.panel-h .meta { margin-left: auto; }
@media (min-width: 701px) { .panel-h .meta { white-space: nowrap; } }
.panel-b { padding: var(--sp-4); }
.panel-b > :last-child { margin-bottom: 0; }

.inset {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--sp-3) var(--sp-4);
}

/* ---------- 6. TEMPERATURA / SCORE --------------------------- */

.t-cold { --t: var(--temp-cold); --t-text: var(--temp-cold-text); }
.t-mild { --t: var(--temp-mild); --t-text: var(--temp-mild-text); }
.t-warm { --t: var(--temp-warm); --t-text: var(--temp-warm-text); }
.t-hot  { --t: var(--temp-hot);  --t-text: var(--temp-hot-text); }

.score-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45em;
}
.score-chip .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--t, var(--ink-3));
  align-self: center;
  flex: none;
}
.score-chip .value {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 1.2em;
  color: var(--t-text, var(--ink));
  line-height: 1;
}
.score-chip .of { font-size: var(--text-xs); color: var(--ink-3); }

.meter {
  position: relative;
  height: 6px;
  border-radius: 3px;
  background: var(--panel-3);
  overflow: hidden;
}
.meter > i {
  position: absolute; inset: 0 auto 0 0;
  width: var(--w, 0%);
  background: var(--t, var(--brand));
  border-radius: 3px;
}

.lens-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(120px,320px) 3.4rem;
  gap: var(--sp-4);
  align-items: center;
  padding: 0.72rem var(--sp-4);
  border-bottom: 1px solid var(--line);
  transition: background-color var(--dur-fast) var(--ease);
}
.lens-row:hover { background: var(--panel-2); }
.lens-row:last-child { border-bottom: 0; }
.lens-row .name { font-weight: 500; font-size: var(--text-sm); }
.lens-row .value {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--t-text);
  text-align: right;
}
@media (max-width: 560px) {
  .lens-row { grid-template-columns: minmax(0,1fr) 3rem; row-gap: var(--sp-2); }
  .lens-row .meter { grid-column: 1 / -1; }
}

/* Gauge SVG */
.dial { position: relative; display: inline-grid; place-items: center; }
.dial svg { display: block; }
.dial .track { stroke: var(--panel-3); }
.dial .fill  { stroke: var(--t, var(--brand)); }
.dial .center { position: absolute; display: grid; place-items: center; text-align: center; }
.dial .center .n {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: clamp(2.2rem, 1.8rem + 1.6vw, 3rem);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.04em;
}
.dial .center .lbl {
  font-size: var(--text-xs);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--t-text);
  font-weight: 700;
  margin-top: 4px;
}

/* ---------- 7. STATUS / TAGS --------------------------------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
}
.status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status-ok   { color: var(--ok-text); background: var(--success-soft); }
.status-warn { color: var(--warn-text); background: var(--warn-soft); }
.status-bad  { color: var(--danger-text); background: var(--danger-soft); }
.status-off  { color: var(--ink-3); background: var(--panel-2); }

.tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  background: var(--panel);
  white-space: nowrap;
}
.tag-brand { border-color: var(--brand-line); color: var(--brand); background: var(--brand-soft); }
.tag-dim { border-color: var(--line); color: var(--ink-3); }

/* ---------- 8. TABELAS --------------------------------------- */

.table-wrap { overflow-x: auto; max-width: 100%; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.table th {
  text-align: left;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0.55rem 1rem 0.55rem 0;
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}
.table td {
  padding: 0.75rem 1rem 0.75rem 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  color: var(--ink-2);
}
.table td:first-child { color: var(--ink); font-weight: 500; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; }

/* ---------- 9. STATS ----------------------------------------- */

.stat { min-width: 0; }
.stat .n, .stat .lbl, .stat .sub { display: block; }
.stat .n {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: clamp(1.4rem, 1.2rem + 0.9vw, 2rem);
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
}
.stat .n.brand { color: var(--brand); }
.stat .lbl {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 700;
  margin-top: 4px;
}
.stat .sub { font-size: var(--text-sm); color: var(--ink-2); margin-top: var(--sp-1); }

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-4) var(--sp-5);
}

/* ---------- 10. TIMELINE / LISTAS ---------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: '';
  position: absolute;
  left: 5px; top: 8px; bottom: 8px;
  width: 2px;
  border-radius: 1px;
  background: var(--line-2);
}
.timeline > li { position: relative; padding: 0 0 var(--sp-5) var(--sp-5); margin: 0; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
  content: '';
  position: absolute;
  left: 0; top: 7px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--panel);
  border: 3px solid var(--t, var(--brand));
}

.ed-list { list-style: none; margin: 0; padding: 0; counter-reset: ed; }
.ed-list > li {
  counter-increment: ed;
  position: relative;
  padding: var(--sp-3) 0 var(--sp-3) 2.9rem;
  border-bottom: 1px solid var(--line);
  margin: 0;
  max-width: 80ch;
}
.ed-list > li:last-child { border-bottom: 0; }
.ed-list > li::before {
  content: counter(ed, decimal-leading-zero);
  position: absolute;
  left: 0; top: calc(var(--sp-3) + 2px);
  font-family: var(--font-data);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--brand);
}

/* Split: rótulo + conteúdo */
.split {
  display: grid;
  grid-template-columns: minmax(0,1fr);
  gap: var(--sp-2) var(--sp-5);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--line);
}
@media (min-width: 760px) { .split { grid-template-columns: 200px minmax(0,1fr); } }
.split:first-of-type { border-top: 0; }
.split > .label { font-size: var(--text-sm); font-weight: 600; color: var(--ink); }
.split > .label .sub { display: block; font-weight: 400; color: var(--ink-3); font-size: var(--text-xs); margin-top: 2px; }

.prose { max-width: 74ch; color: var(--ink-2); }
.prose strong { color: var(--ink); }

/* ---------- 11. LISTAS DE LINHA (dashboard) ------------------ */

.row-list { list-style: none; margin: 0; padding: 0; }
.row-list > li { margin: 0; }
.row-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  transition: background-color var(--dur-fast) var(--ease);
}
.row-list > li:last-child .row-item { border-bottom: 0; }
a.row-item:hover { background: var(--panel-2); }

.thumb {
  width: 40px; height: 40px;
  flex: none;
  border-radius: var(--radius-m);
  border: 1px solid var(--line);
  background: var(--panel-2);
  display: grid;
  place-items: center;
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink-2);
}

.row-main { min-width: 0; flex: 1; }
.row-main .t {
  display: block;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-main .s {
  display: block;
  font-size: var(--text-xs);
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* ---------- 12. PACKS DE CRÉDITO ----------------------------- */

.packs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--sp-4);
  align-items: stretch;
}
.pack {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  padding: var(--sp-4);
  border-radius: var(--radius-l);
  border: 1px solid var(--line);
  background: var(--panel);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.pack:hover { border-color: var(--brand-line); box-shadow: var(--glow-brand); transform: translateY(-2px); }
.pack .qty {
  font-family: var(--font-data);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  color: var(--ink);
}
.pack .per { font-size: var(--text-sm); color: var(--ink-3); }
.pack .price { font-family: var(--font-data); font-weight: 700; color: var(--brand); font-size: var(--text-lg); }
.pack .btn { margin-top: auto; }
.pack.featured {
  border-color: var(--brand-line);
  background: linear-gradient(165deg, var(--brand-soft), transparent 60%), var(--panel);
}
.pack .flag {
  position: absolute;
  top: -0.68rem; right: var(--sp-3);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--brand);
  color: var(--on-brand);
  padding: 0.14rem 0.6rem;
  border-radius: 999px;
}

/* ---------- 13. A11Y / MOTION -------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--sp-3); top: -100px;
  z-index: 100;
  background: var(--brand);
  color: var(--on-brand);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-m);
  font-weight: 600;
  transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: var(--sp-3); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Fase 3 — estados do app vivo (loading, locked, banners) ===== */
.state-center { display: grid; place-items: center; text-align: center; padding: var(--sp-6) var(--sp-4); gap: var(--sp-2); }
.state-center .state-t { font-weight: 600; color: var(--ink); margin: 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--panel-3); border-top-color: var(--brand); animation: vc-spin 0.9s linear infinite; }
@keyframes vc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.5s; } }

/* Seção premium trancada (relatório free): skeleton sem dado real + overlay com cadeado */
.locked-b { position: relative; padding: var(--sp-5) var(--sp-4); overflow: hidden; min-height: 240px; }
.locked-skel { display: flex; flex-direction: column; gap: 0.75rem; filter: blur(1.5px); opacity: 0.55; user-select: none; }
.locked-skel i { display: block; height: 0.85rem; border-radius: 999px; background: var(--panel-3); width: var(--w, 80%); }
.locked-skel i.tall { height: 3.6rem; border-radius: var(--radius-m); }
.locked-over { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-4); background: color-mix(in oklab, var(--panel) 45%, transparent); }
.locked-over svg { color: var(--brand); }
.locked-over .locked-t { color: var(--ink); font-weight: 500; max-width: 52ch; margin: 0; text-shadow: 0 0 14px var(--panel); }
.locked-over .btn { margin-top: var(--sp-2); }

/* Mapa de calor: print completo da página, colapsável (expandido = TUDO, sem crop) */
.heat-clamp { position: relative; max-height: 560px; overflow: hidden; border-radius: var(--radius-m); }
.heat-clamp img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--radius-m); }
.heat-clamp:not(.open)::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 150px; background: linear-gradient(to bottom, transparent, var(--panel)); pointer-events: none; }
.heat-clamp.open { max-height: none; }
.heat-toggle { margin: var(--sp-3) 0 0; }

/* Comparador Página | Mapa de calor (premium): a mesma captura, os dois olhares.
   Mobile/tablet = toggle segmentado; desktop (>=1000px) = lado a lado. */
.heat-switch { display: inline-flex; gap: 2px; padding: 3px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-s); margin-bottom: var(--sp-3); }
.hs-btn { border: 0; background: none; color: var(--ink-2); font: inherit; font-size: var(--text-sm); font-weight: 600; padding: 0.35rem 0.9rem; border-radius: calc(var(--radius-s) - 2px); cursor: pointer; transition: background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.hs-btn:hover { color: var(--ink); }
.hs-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.hs-btn.active { background: var(--brand); color: var(--on-brand); }
.hc-col { position: relative; min-width: 0; }
.hc-tag { position: absolute; top: 10px; left: 10px; z-index: 1; font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); background: color-mix(in oklab, var(--panel) 82%, transparent); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; backdrop-filter: blur(4px); }
.heat-compare[data-view="heat"] .hc-page,
.heat-compare[data-view="page"] .hc-heat { display: none; }
@media (min-width: 1000px) {
  .heat-switch { display: none; }
  .heat-compare { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); align-items: start; }
  /* [data-view] no seletor: especificidade (0,3,0) empata com a regra de esconder
     e vence por ordem — no desktop os DOIS aparecem, qualquer que seja a view. */
  .heat-compare[data-view] .hc-page, .heat-compare[data-view] .hc-heat { display: block; }
}

/* CTA de fechamento do relatório premium → execução R$2.997 */
.exec-cta { border-color: var(--brand-line); background: linear-gradient(135deg, var(--brand-soft), var(--panel) 62%); }
.exec-cta .panel-b { display: grid; gap: var(--sp-2); justify-items: start; padding: var(--sp-6) var(--sp-5); }
.exec-cta .kicker { color: var(--brand); }
.exec-cta h2 { margin: 0; font-size: var(--text-h2); max-width: 26ch; }
.exec-cta p { margin: 0; max-width: 64ch; color: var(--ink-2); }
.exec-cta .btn { margin-top: var(--sp-3); }

.banner { border-radius: var(--radius-m); padding: var(--sp-3) var(--sp-4); margin-bottom: var(--sp-4); font-size: var(--text-sm); border: 1px solid var(--line); }
.banner strong { color: var(--ink); }
.banner-bad { border-color: var(--danger-text); background: var(--danger-soft); color: var(--ink-2); }
.banner-brand { border-color: var(--brand-line); background: var(--brand-soft); color: var(--ink-2); }
.banner .btn { margin-top: var(--sp-2); }

a.btn.is-disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.form-grid { display: grid; gap: var(--sp-3); max-width: 460px; }
.field label { display: block; font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-s);
  color: var(--ink); font: inherit; padding: 0.55rem 0.75rem;
}
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.form-msg { font-size: var(--text-sm); margin: var(--sp-2) 0 0; display: none; }
.form-msg.ok { display: block; color: var(--ok-text); }
.form-msg.err { display: block; color: var(--danger-text); }
.analyze-bar { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.analyze-bar input { flex: 1 1 260px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: var(--radius-s); color: var(--ink); font: inherit; padding: 0.6rem 0.85rem; }
.analyze-bar input:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.side-user { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--panel-2); }
.side-user .avatar { flex: none; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-family: var(--font-data); font-weight: 700; }
.side-user .who { min-width: 0; flex: 1; }
.side-user .who .n { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .who .e { display: block; font-size: var(--text-xs); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .out { flex: none; background: none; border: 0; color: var(--ink-3); cursor: pointer; padding: 4px; border-radius: 6px; }
.side-user .out:hover { color: var(--danger-text); background: var(--panel-3); }
.alert-badge { display: inline-flex; align-items: center; font-family: var(--font-data); font-size: var(--text-xs); font-weight: 700; color: var(--danger-text); background: var(--danger-soft); border-radius: 999px; padding: 2px 8px; }
.heat-elems td:first-child { white-space: nowrap; }

/* ---------- Fase 4b: DOSSIÊ VIVO (Evolução da página) --------
   Delta térmico: subiu = ouro da marca (quente), caiu = frio.  */
.evo-stats { margin-bottom: var(--sp-4); }
.evo-delta { font-weight: 600; white-space: nowrap; }
.evo-delta.up   { color: var(--brand); }
.evo-delta.down { color: var(--temp-cold-text); }
.evo-delta.zero { color: var(--ink-3); }
.evo-table td:first-child { font-weight: 500; }
.evo-list { list-style: none; margin: 0 0 var(--sp-3); padding: 0; display: grid; gap: var(--sp-2); }
.evo-list li { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-2) var(--sp-3); background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius-s); font-size: var(--text-sm); line-height: 1.55; }
.evo-list li .status { flex: none; margin-top: 2px; }

/* Painel (nav do app) em caixa cinza propria, separada das ancoras de conteudo
   — pedido Marcio 2026-08-07 (v2: discreto nao bastou, agora com caixa). */
.side-nav .nav-box {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: var(--sp-2);
  margin-bottom: var(--sp-2);
}
.side-nav .nav-box .group { padding-top: var(--sp-1); }
.side-nav .nav-box a { color: var(--ink-3); font-size: 0.92em; }
.side-nav .nav-box a svg { opacity: 0.55; }
.side-nav .nav-box a:hover { color: var(--ink-2); background: var(--panel-3); }
.side-nav .nav-box a.active { color: var(--brand); background: var(--brand-soft); }
#secnav-side a { color: var(--ink-2); }

/* ---------- Popup free → 1 crédito (Motores, 2026-08-11) ------
   Interceptação de scroll no relatório FREE: modal centrado no
   desktop, bottom sheet no mobile. Fechar é óbvio (X, ESC, clique
   fora, "continuar no grátis"); o CTA ouro domina. Sem dado
   premium: só a promessa do que destrava. */
.vc-popup {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: var(--sp-4);
  background: oklch(0% 0 0 / 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: vcp-fade var(--dur-base) var(--ease);
}
.vc-popup-card {
  position: relative;
  width: 100%; max-width: 500px;
  max-height: calc(100vh - 2 * var(--sp-4));
  max-height: calc(100dvh - 2 * var(--sp-4));
  overflow-y: auto;
  background: linear-gradient(155deg, var(--brand-soft), transparent 55%), var(--panel);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-2);
  padding: var(--sp-5);
  animation: vcp-rise var(--dur-base) var(--ease);
}
.vc-popup-card h2 { font-size: var(--text-h2); margin-bottom: var(--sp-2); max-width: 22ch; padding-right: var(--sp-4); }
.vc-popup-lede { color: var(--ink-2); margin-bottom: var(--sp-3); max-width: 46ch; }
.vc-popup-x {
  position: absolute; top: var(--sp-3); right: var(--sp-3);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  color: var(--ink-3); cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.vc-popup-x:hover { color: var(--ink); border-color: var(--line-2); background: var(--panel-2); }
.vc-popup-list { list-style: none; margin: 0 0 var(--sp-4); padding: 0; display: grid; gap: var(--sp-2); }
.vc-popup-list li { position: relative; padding-left: 1.6rem; font-size: var(--text-sm); color: var(--ink-2); margin: 0; }
.vc-popup-list li::before {
  content: '✓';
  position: absolute; left: 0; top: 0;
  font-family: var(--font-data); font-weight: 700; color: var(--brand);
}
.vc-popup-actions { display: grid; gap: var(--sp-2); justify-items: center; }
.vc-popup-cta { width: 100%; height: 44px; font-size: var(--text-base); white-space: normal; text-align: center; }
.vc-popup-later {
  background: none; border: 0; cursor: pointer;
  font: 500 var(--text-sm)/1.4 var(--font-ui);
  color: var(--ink-3);
  text-decoration: underline; text-underline-offset: 3px;
  padding: 0.4rem 0.6rem; border-radius: var(--radius-s);
}
.vc-popup-later:hover { color: var(--ink); }
.vc-noscroll, .vc-noscroll body { overflow: hidden; }
@keyframes vcp-fade { from { opacity: 0; } }
@keyframes vcp-rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes vcp-sheet { from { transform: translateY(100%); } }
@media (max-width: 640px) {
  .vc-popup { place-items: end stretch; padding: 0; }
  .vc-popup-card {
    max-width: none;
    max-height: calc(100vh - var(--sp-6));
    max-height: calc(100dvh - var(--sp-6));
    border-radius: var(--radius-l) var(--radius-l) 0 0;
    border-bottom: 0;
    padding: var(--sp-5) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom));
    animation-name: vcp-sheet;
  }
}
@media print { .vc-popup { display: none !important; } }

/* banner execucao dentro do popup free — pedido Marcio 2026-08-11 */
.vc-popup-exec { display: block; text-align: center; margin-top: 12px; padding: 12px 16px; border: 1px solid rgba(240,180,41,.35); border-radius: 10px; color: var(--brand); text-decoration: none; font-weight: 600; font-size: 0.95em; }
.vc-popup-exec:hover { background: var(--brand-soft); }
