/* ==========================================================================
   WazApi — Sistema visual "Telemetria Editorial"
   Suíço/Internacional + linguagem de painel (Grafana) + contraste editorial.
   Dark-first, tema claro real, mobile-first.
   ========================================================================== */

/* --------------------------------------------------------------------------
   01. Reset
   -------------------------------------------------------------------------- */

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

* { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
}

img, svg, video { display: block; max-width: 100%; }

button, input, select, textarea { font: inherit; color: inherit; }

button { background: none; border: 0; cursor: pointer; }

fieldset { border: 0; min-width: 0; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; }

/* O atributo hidden precisa vencer os display: flex/grid dos componentes */
[hidden] { display: none !important; }

table { border-collapse: collapse; width: 100%; }

/* --------------------------------------------------------------------------
   02. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Tipografia */
  --font-ui: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Escala tipográfica — passo 1.22 no mobile */
  --t-xs:    0.6875rem;  /* 11px  — labels de painel */
  --t-sm:    0.8125rem;  /* 13px  — meta, tabelas */
  --t-base:  1rem;       /* 16px  — corpo */
  --t-md:    1.125rem;   /* 18px  — lead */
  --t-lg:    1.375rem;   /* 22px  */
  --t-xl:    1.75rem;    /* 28px  */
  --t-2xl:   2.25rem;    /* 36px  */
  --t-3xl:   3rem;       /* 48px  */
  --t-4xl:   3.75rem;    /* 60px  */

  /* Espaço — base 4px */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;
  --sp-8: 4rem;
  --sp-9: 6rem;
  --sp-10: 8rem;

  /* Geometria — painel de console tem raio quase nulo */
  --r-xs: 2px;
  --r-sm: 3px;
  --r-md: 4px;
  --r-pill: 999px;

  --shell: 78rem;        /* 1248px */
  --shell-pad: 1.25rem;
  --head-h: 3.5rem;
  --strip-h: 2rem;

  --ease: cubic-bezier(0.2, 0, 0.1, 1);
  --dur: 180ms;
}

/* ---- Tema escuro (padrão) ------------------------------------------------ */

:root,
:root[data-theme='dark'] {
  color-scheme: dark;

  --bg:        #07080B;
  --bg-1:      #0C0E13;
  --bg-2:      #12151C;
  --bg-3:      #191D26;

  --line:      #1E232C;
  --line-2:    #2A313D;
  --line-3:    #3A4353;

  --tx:        #E7EAF0;
  --tx-2:      #98A2B1;
  --tx-3:      #6A7381;
  --tx-inv:    #07080B;

  --brand:     #6183FF;
  --brand-2:   #A472F5;
  --brand-ink: #FFFFFF;
  --brand-dim: #6183FF1F;
  --brand-line:#6183FF3D;

  --ok:        #2FD37F;
  --ok-dim:    #2FD37F1A;
  --warn:      #F2B22E;
  --warn-dim:  #F2B22E1A;
  --crit:      #F55E52;
  --crit-dim:  #F55E521A;

  /* Séries de dados — linhagem Grafana */
  --s1: #5794F2;
  --s2: #B877D9;
  --s3: #3ED598;
  --s4: #F2CB1D;
  --s5: #FF7A85;
  --s6: #56D3E6;

  --grid-line: #FFFFFF0A;
  --noise-op: 0.035;

  --sh-1: 0 1px 2px #00000066;
  --sh-2: 0 8px 24px -12px #000000B3;
  --sh-3: 0 24px 64px -24px #000000E6;
}

/* ---- Tema claro ---------------------------------------------------------- */

:root[data-theme='light'] {
  color-scheme: light;

  --bg:        #F4F6F9;
  --bg-1:      #FFFFFF;
  --bg-2:      #FFFFFF;
  --bg-3:      #EEF1F5;

  --line:      #DFE3EA;
  --line-2:    #CBD2DC;
  --line-3:    #AEB7C4;

  --tx:        #12161D;
  --tx-2:      #4C5666;
  --tx-3:      #78818F;
  --tx-inv:    #FFFFFF;

  --brand:     #3450DE;
  --brand-2:   #7C3AED;
  --brand-ink: #FFFFFF;
  --brand-dim: #3450DE12;
  --brand-line:#3450DE33;

  --ok:        #0E8F5B;
  --ok-dim:    #0E8F5B14;
  --warn:      #A66A00;
  --warn-dim:  #A66A0014;
  --crit:      #C93A2F;
  --crit-dim:  #C93A2F14;

  --s1: #2E6FD6;
  --s2: #8E44C7;
  --s3: #0E9E68;
  --s4: #C79300;
  --s5: #DC4A57;
  --s6: #0F92A8;

  --grid-line: #0A0F1A08;
  --noise-op: 0.02;

  --sh-1: 0 1px 2px #16233008;
  --sh-2: 0 6px 20px -12px #16233029;
  --sh-3: 0 20px 48px -24px #16233033;
}

/* Preferência do sistema quando o usuário nunca tocou no seletor */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #F4F6F9; --bg-1: #FFFFFF; --bg-2: #FFFFFF; --bg-3: #EEF1F5;
    --line: #DFE3EA; --line-2: #CBD2DC; --line-3: #AEB7C4;
    --tx: #12161D; --tx-2: #4C5666; --tx-3: #78818F; --tx-inv: #FFFFFF;
    --brand: #3450DE; --brand-2: #7C3AED; --brand-dim: #3450DE12; --brand-line: #3450DE33;
    --ok: #0E8F5B; --ok-dim: #0E8F5B14; --warn: #A66A00; --warn-dim: #A66A0014;
    --crit: #C93A2F; --crit-dim: #C93A2F14;
    --s1: #2E6FD6; --s2: #8E44C7; --s3: #0E9E68; --s4: #C79300; --s5: #DC4A57; --s6: #0F92A8;
    --grid-line: #0A0F1A08; --noise-op: 0.02;
    --sh-1: 0 1px 2px #16233008; --sh-2: 0 6px 20px -12px #16233029; --sh-3: 0 20px 48px -24px #16233033;
  }
}

/* --------------------------------------------------------------------------
   03. Base
   -------------------------------------------------------------------------- */

body {
  font-family: var(--font-ui);
  font-size: var(--t-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--tx);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Textura: malha de calibração + grão. Contida, nunca protagonista. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(ellipse 120% 80% at 50% 0%, #000 20%, transparent 78%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: var(--noise-op);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--brand); color: var(--brand-ink); }

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

.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -100%;
  z-index: 200;
  padding: var(--sp-3) var(--sp-4);
  background: var(--brand);
  color: var(--brand-ink);
  font: 600 var(--t-sm)/1 var(--font-mono);
  border-radius: var(--r-sm);
}
.skip-link:focus { top: var(--sp-4); }

/* --------------------------------------------------------------------------
   04. Primitivas tipográficas
   -------------------------------------------------------------------------- */

h1, h2, h3, h4 {
  font-weight: 620;
  line-height: 1.08;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.h-display {
  font-size: var(--t-3xl);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 660;
}

.h-1 { font-size: var(--t-2xl); }
.h-2 { font-size: var(--t-xl); letter-spacing: -0.02em; }
.h-3 { font-size: var(--t-lg); letter-spacing: -0.015em; }
.h-4 { font-size: var(--t-base); letter-spacing: -0.012em; }

.lead {
  font-size: var(--t-md);
  line-height: 1.62;
  color: var(--tx-2);
  max-width: 60ch;
  text-wrap: pretty;
}

.prose-p { color: var(--tx-2); max-width: 66ch; text-wrap: pretty; }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.num { font-variant-numeric: tabular-nums; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font: 500 var(--t-xs)/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tx-3);
}
.eyebrow--brand { color: var(--brand); }

/* Marcador de seção: [03] CORRELAÇÃO */
.sec-mark {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font: 500 var(--t-xs)/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tx-3);
  padding-bottom: var(--sp-4);
}
.sec-mark::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, var(--line-2), transparent);
}
.sec-mark b { color: var(--brand); font-weight: 500; }

.hl { color: var(--brand); }
.hl-2 { color: var(--brand-2); }
.tx-2 { color: var(--tx-2); }
.tx-3 { color: var(--tx-3); }

.grad-text {
  background: linear-gradient(94deg, var(--brand) 0%, var(--brand-2) 62%, var(--s6) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Sublinhado técnico — traço tracejado sob a palavra */
.underscore { position: relative; white-space: nowrap; }
.underscore::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.06em;
  height: 2px;
  background: repeating-linear-gradient(to right, var(--brand) 0 6px, transparent 6px 10px);
}

/* --------------------------------------------------------------------------
   05. Layout
   -------------------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--shell-pad);
}

.section { padding-block: var(--sp-8); position: relative; }
.section--tight { padding-block: var(--sp-7); }
.section--ruled { border-top: 1px solid var(--line); }

/* Régua com ticks — divisor estrutural, não ornamento */
.ruler {
  height: 12px;
  border-bottom: 1px solid var(--line);
  background-image: repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 40px);
  background-position: bottom left;
  background-size: 40px 6px;
  background-repeat: repeat-x;
}

.stack-2 > * + * { margin-top: var(--sp-2); }
.stack-3 > * + * { margin-top: var(--sp-3); }
.stack-4 > * + * { margin-top: var(--sp-4); }
.stack-5 > * + * { margin-top: var(--sp-5); }
.stack-6 > * + * { margin-top: var(--sp-6); }
.stack-7 > * + * { margin-top: var(--sp-7); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
}

/* --------------------------------------------------------------------------
   06. Barra de status + cabeçalho
   -------------------------------------------------------------------------- */

.statusbar {
  border-bottom: 1px solid var(--line);
  background: var(--bg-1);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  letter-spacing: 0.04em;
  color: var(--tx-3);
}

.statusbar__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: var(--strip-h);
  overflow: hidden;
}

.statusbar__left,
.statusbar__right {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  white-space: nowrap;
}

.statusbar__item { display: none; align-items: center; gap: var(--sp-2); }
.statusbar__item--always { display: inline-flex; }
.statusbar__item b { color: var(--tx-2); font-weight: 500; }
.statusbar a:hover { color: var(--tx-2); }

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  flex: none;
  position: relative;
}
.dot--live::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1px solid var(--ok);
  opacity: 0;
  animation: ping 2.4s var(--ease) infinite;
}
.dot--warn { background: var(--warn); }
.dot--crit { background: var(--crit); }
.dot--brand { background: var(--brand); }

@keyframes ping {
  0%   { transform: scale(0.6); opacity: 0.9; }
  70%  { transform: scale(1.9); opacity: 0; }
  100% { transform: scale(1.9); opacity: 0; }
}

.header {
  position: sticky;
  top: 0;
  z-index: 90;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-1) 88%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
}

.header__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: var(--head-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  flex: none;
}
.brand__mark { width: 1.75rem; height: 1.75rem; object-fit: contain; }
.brand__word { font-size: 1.0625rem; font-weight: 680; letter-spacing: -0.03em; }
.brand__tag {
  display: none;
  font: 500 var(--t-xs)/1 var(--font-mono);
  color: var(--tx-3);
  letter-spacing: 0.1em;
  padding-left: var(--sp-3);
  border-left: 1px solid var(--line-2);
}

.nav { display: none; }

.nav__link {
  position: relative;
  padding: var(--sp-2) 0;
  font-size: 0.9375rem;
  font-weight: 480;
  color: var(--tx-2);
  transition: color var(--dur) var(--ease);
}
.nav__link:hover { color: var(--tx); }
.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.05rem;
  height: 2px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}
.nav__link:hover::after,
.nav__link[aria-current='page']::after { transform: scaleX(1); }
.nav__link[aria-current='page'] { color: var(--tx); }

.header__actions { display: flex; align-items: center; gap: var(--sp-2); }

.icon-btn {
  width: 2.5rem;
  height: 2.5rem;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--tx-2);
  background: var(--bg-2);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.icon-btn:hover { color: var(--tx); border-color: var(--line-3); }
.icon-btn svg { width: 16px; height: 16px; }

.theme-toggle .ico-sun { display: none; }
:root[data-theme='light'] .theme-toggle .ico-sun { display: block; }
:root[data-theme='light'] .theme-toggle .ico-moon { display: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) .theme-toggle .ico-sun { display: block; }
  :root:not([data-theme]) .theme-toggle .ico-moon { display: none; }
}

.burger { display: inline-grid; }

/* Drawer mobile */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--bg);
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 280ms var(--ease), visibility 280ms;
}
.drawer[data-open='true'] { transform: translateY(0); visibility: visible; }

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--head-h);
  padding-inline: var(--shell-pad);
  border-bottom: 1px solid var(--line);
}

.drawer__body { padding: var(--sp-5) var(--shell-pad) var(--sp-8); overflow-y: auto; }

.drawer__link {
  display: flex;
  align-items: baseline;
  gap: var(--sp-4);
  padding: var(--sp-4) 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--t-lg);
  font-weight: 560;
  letter-spacing: -0.02em;
}
.drawer__link span { font: 500 var(--t-xs)/1 var(--font-mono); color: var(--tx-3); }

/* --------------------------------------------------------------------------
   07. Botões
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 2.75rem;
  padding: 0 var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: 0.9375rem;
  font-weight: 560;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease),
              color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; flex: none; }

.btn--primary {
  background: var(--brand);
  color: var(--brand-ink);
  box-shadow: inset 0 1px 0 #FFFFFF2E;
}
.btn--primary:hover { background: color-mix(in srgb, var(--brand) 86%, #FFF); }

.btn--ghost {
  border-color: var(--line-2);
  color: var(--tx);
  background: var(--bg-2);
}
.btn--ghost:hover { border-color: var(--line-3); background: var(--bg-3); }

.btn--quiet { color: var(--tx-2); padding-inline: var(--sp-2); }
.btn--quiet:hover { color: var(--tx); }

.btn--lg { min-height: 3rem; padding-inline: var(--sp-5); font-size: 1rem; }
.btn--sm { min-height: 2.25rem; padding-inline: var(--sp-3); font-size: var(--t-sm); }
.btn--block { width: 100%; }

.btn--primary.btn--lg {
  box-shadow: inset 0 1px 0 #FFFFFF2E, 0 0 0 1px var(--brand-line), 0 12px 32px -18px var(--brand);
}

/* Link com seta que desliza */
.tlink {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.9375rem;
  font-weight: 540;
  color: var(--brand);
}
.tlink svg { width: 14px; height: 14px; transition: transform var(--dur) var(--ease); }
.tlink:hover svg { transform: translateX(3px); }

/* --------------------------------------------------------------------------
   08. Pílulas, tags
   -------------------------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.25rem var(--sp-3) 0.25rem var(--sp-2);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--bg-2);
  font: 500 var(--t-xs)/1.6 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--tx-2);
  text-transform: uppercase;
}
.pill--ok   { color: var(--ok);   border-color: color-mix(in srgb, var(--ok) 35%, transparent);   background: var(--ok-dim); }
.pill--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-dim); }
.pill--crit { color: var(--crit); border-color: color-mix(in srgb, var(--crit) 35%, transparent); background: var(--crit-dim); }
.pill--brand{ color: var(--brand);border-color: var(--brand-line); background: var(--brand-dim); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.15rem var(--sp-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xs);
  font: 500 var(--t-xs)/1.7 var(--font-mono);
  color: var(--tx-3);
  background: var(--bg-2);
}

/* --------------------------------------------------------------------------
   09. Painel — unidade estrutural do sistema
   -------------------------------------------------------------------------- */

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-1);
  overflow: hidden;
}
.panel--raised { box-shadow: var(--sh-2); }
.panel--inset { background: var(--bg-2); }
.panel--full { height: 100%; display: flex; flex-direction: column; }

.panel__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 2.25rem;
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}

.panel__title {
  font: 500 var(--t-xs)/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tx-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.panel__meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  font: 400 var(--t-xs)/1.4 var(--font-mono);
  color: var(--tx-3);
  white-space: nowrap;
}

.panel__grip { display: inline-flex; flex-direction: column; gap: 2px; opacity: 0.5; }
.panel__grip i { width: 3px; height: 3px; border-radius: 50%; background: var(--tx-3); display: block; }

.panel__body { padding: var(--sp-4); }
.panel__body--flush { padding: 0; }
.panel__body--tight { padding: var(--sp-3); }
.panel__body--grow { flex: 1; }

.panel__foot {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  font: 400 var(--t-xs)/1.5 var(--font-mono);
  color: var(--tx-3);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

.panel--accent::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  background: linear-gradient(to right, var(--brand), var(--brand-2) 60%, transparent);
  z-index: 1;
}

/* --------------------------------------------------------------------------
   10. Métricas
   -------------------------------------------------------------------------- */

.metric { display: flex; flex-direction: column; gap: var(--sp-2); }

.metric__label {
  font: 500 var(--t-xs)/1.4 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tx-3);
}

.metric__value {
  display: flex;
  align-items: baseline;
  gap: 0.3em;
  font-size: var(--t-xl);
  font-weight: 640;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.metric__value small {
  font-size: var(--t-sm);
  font-weight: 500;
  color: var(--tx-3);
  font-family: var(--font-mono);
  letter-spacing: 0;
}
.metric__value--xl { font-size: var(--t-2xl); }

.metric__delta {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font: 500 var(--t-xs)/1.4 var(--font-mono);
  color: var(--tx-3);
}
.metric__delta--up { color: var(--ok); }
.metric__delta--down { color: var(--crit); }

.metric-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.metric-row > * {
  padding: var(--sp-4);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.metric-row > *:nth-child(-n + 2) { border-top: 0; }
.metric-row > *:nth-child(2n) { border-right: 0; }

/* --------------------------------------------------------------------------
   11. Gráficos
   -------------------------------------------------------------------------- */

.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }

.chart__gridline {
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 2 4;
  vector-effect: non-scaling-stroke;
}
.chart__axis-text {
  font-family: var(--font-mono);
  font-size: 9px;
  fill: var(--tx-3);
  letter-spacing: 0.04em;
}
.chart__line {
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.chart__cursor {
  stroke: var(--line-3);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

.chart__tip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  min-width: 9.5rem;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  box-shadow: var(--sh-2);
  font: 400 var(--t-xs)/1.8 var(--font-mono);
  color: var(--tx-2);
  opacity: 0;
  transform: translate(-50%, -115%);
  transition: opacity 120ms var(--ease);
}
.chart__tip[data-on='true'] { opacity: 1; }
.chart__tip b { color: var(--tx); font-weight: 600; }
.chart__tip .row { display: flex; justify-content: space-between; gap: var(--sp-4); }
.chart__tip .sw { width: 7px; height: 7px; border-radius: 1px; display: inline-block; margin-right: 6px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-4);
  font: 400 var(--t-xs)/1.5 var(--font-mono);
  color: var(--tx-3);
}
.legend__item { display: inline-flex; align-items: center; gap: var(--sp-2); }
.legend__sw { width: 8px; height: 2px; border-radius: 1px; flex: none; }
.legend__val { color: var(--tx-2); }

.spark { display: block; width: 100%; height: 30px; overflow: visible; }
.spark path { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; }

/* Heatmap de volume */
.heatmap-rows { display: grid; gap: 3px; }
.heatmap-row {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  align-items: center;
  gap: var(--sp-3);
}
.heatmap-row > span { font: 400 var(--t-xs)/1 var(--font-mono); color: var(--tx-3); }
.heatmap { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 3px; }
.heatmap__cell {
  aspect-ratio: 1;
  border-radius: 1px;
  background: var(--bg-3);
  transition: transform 120ms var(--ease);
}
.heatmap__cell[data-l='1'] { background: color-mix(in srgb, var(--brand) 24%, var(--bg-3)); }
.heatmap__cell[data-l='2'] { background: color-mix(in srgb, var(--brand) 48%, var(--bg-3)); }
.heatmap__cell[data-l='3'] { background: color-mix(in srgb, var(--brand) 72%, var(--bg-3)); }
.heatmap__cell[data-l='4'] { background: var(--brand); }
.heatmap__cell:hover { transform: scale(1.4); }

/* Barras horizontais */
.bars { display: grid; gap: var(--sp-4); }
.bar__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-3);
  font-size: var(--t-sm);
  margin-bottom: var(--sp-2);
}
.bar__top b { font-weight: 540; }
.bar__top span {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--tx-3);
  font-variant-numeric: tabular-nums;
}
.bar__track { height: 6px; border-radius: 1px; background: var(--bg-3); overflow: hidden; }
.bar__fill {
  height: 100%;
  border-radius: 1px;
  background: var(--s1);
  width: 0;
  transition: width 900ms var(--ease);
}

/* --------------------------------------------------------------------------
   12. Tabelas densas
   -------------------------------------------------------------------------- */

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table {
  width: max-content;
  min-width: 100%;
}
.table { font-size: var(--t-sm); }
.table th {
  padding: var(--sp-2) var(--sp-3);
  text-align: left;
  font: 500 var(--t-xs)/1.5 var(--font-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tx-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--bg-2);
}
.table td {
  padding: var(--sp-3);
  border-bottom: 1px solid var(--line);
  color: var(--tx-2);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--dur) var(--ease); }
.table tbody tr:hover { background: var(--bg-2); }
.table .cell-strong { color: var(--tx); font-weight: 520; }
.table .cell-num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; }

/* Tabela de comparação */
.cmp th, .cmp td { text-align: center; }
.cmp th:first-child, .cmp td:first-child { text-align: left; min-width: 13rem; }
.cmp thead th { vertical-align: bottom; padding-block: var(--sp-4) var(--sp-3); }
.cmp .col-us { background: var(--brand-dim); color: var(--tx); }
.cmp__label { display: block; font-weight: 600; font-size: var(--t-base); color: var(--tx); letter-spacing: -0.02em; text-transform: none; font-family: var(--font-ui); }
.cmp__sub { display: block; font: 400 var(--t-xs)/1.5 var(--font-mono); color: var(--tx-3); margin-top: 3px; text-transform: none; letter-spacing: 0.02em; }

.mk {
  display: inline-grid;
  place-items: center;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
}
.mk svg { width: 12px; height: 12px; }
.mk--yes { color: var(--ok); background: var(--ok-dim); }
.mk--part { color: var(--warn); background: var(--warn-dim); }
.mk--no { color: var(--crit); background: var(--crit-dim); }

/* --------------------------------------------------------------------------
   13. Blocos de conteúdo
   -------------------------------------------------------------------------- */

/* Recurso — numerado, régua superior, sem card flutuante */
.feat { padding-top: var(--sp-4); border-top: 1px solid var(--line); position: relative; }
.feat__idx {
  font: 500 var(--t-xs)/1 var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--tx-3);
  display: block;
  margin-bottom: var(--sp-4);
}
.feat__icon {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  color: var(--brand);
  margin-bottom: var(--sp-3);
  background: var(--bg-2);
}
.feat__icon svg { width: 16px; height: 16px; }
.feat h3 { font-size: var(--t-base); font-weight: 600; letter-spacing: -0.015em; margin-bottom: var(--sp-2); }
.feat p { font-size: 0.9375rem; color: var(--tx-2); line-height: 1.6; }
.feat--hot { border-top-color: var(--brand); }

/* Nó de canal */
.node {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-1);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.node:hover { border-color: var(--line-3); background: var(--bg-2); }
.node__ico {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  flex: none;
  color: #FFF;
}
.node__ico svg { width: 16px; height: 16px; }
.node__name { font-size: 0.9375rem; font-weight: 540; letter-spacing: -0.01em; }
.node__meta { font: 400 var(--t-xs)/1.4 var(--font-mono); color: var(--tx-3); }
.node__state { margin-left: auto; flex: none; }

.ch-whatsapp { background: #1FA855; }
.ch-instagram { background: linear-gradient(135deg, #F9CE34, #EE2A7B 55%, #6228D7); }
.ch-messenger { background: linear-gradient(135deg, #0695FF, #A334FA); }
.ch-telegram { background: #229ED9; }
.ch-mail { background: #55606F; }
.ch-web { background: var(--brand); }
.ch-api {
  background: var(--bg-3);
  color: var(--tx-2);
  box-shadow: inset 0 0 0 1px var(--line-2);
}

/* Citação editorial */
.quote { border-left: 2px solid var(--brand); padding-left: var(--sp-5); }
.quote blockquote {
  font-size: var(--t-lg);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.42;
  text-wrap: pretty;
}
.quote figcaption { margin-top: var(--sp-4); font: 400 var(--t-xs)/1.8 var(--font-mono); color: var(--tx-3); }
.quote figcaption b { color: var(--tx-2); font-weight: 500; }

/* Passos com linha de conexão */
.steps { counter-reset: step; }
.step { position: relative; padding-left: var(--sp-7); padding-bottom: var(--sp-6); }
.step:last-child { padding-bottom: 0; }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--bg-1);
  font: 500 var(--t-xs)/1 var(--font-mono);
  color: var(--brand);
  z-index: 1;
}
.step::after {
  content: '';
  position: absolute;
  left: calc(1rem - 0.5px);
  top: 2rem;
  bottom: 0;
  width: 1px;
  background: repeating-linear-gradient(to bottom, var(--line-2) 0 3px, transparent 3px 7px);
}
.step:last-child::after { display: none; }
.step h3 { font-size: var(--t-base); margin-bottom: var(--sp-2); }
.step p { font-size: 0.9375rem; color: var(--tx-2); }

/* Acordeão */
.acc { border-top: 1px solid var(--line); }
.acc__item { border-bottom: 1px solid var(--line); }
.acc__btn {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-4);
  width: 100%;
  padding: var(--sp-4) 0;
  text-align: left;
  font-size: 1rem;
  font-weight: 540;
  letter-spacing: -0.015em;
  color: var(--tx);
}
.acc__sign {
  flex: none;
  width: 1.25rem;
  height: 1.25rem;
  position: relative;
  margin-top: 0.28rem;
  color: var(--tx-3);
}
.acc__sign::before,
.acc__sign::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: currentColor;
  transition: transform var(--dur) var(--ease);
}
.acc__sign::after { transform: rotate(90deg); }
.acc__btn[aria-expanded='true'] .acc__sign { color: var(--brand); }
.acc__btn[aria-expanded='true'] .acc__sign::after { transform: rotate(0deg); }
.acc__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 260ms var(--ease); }
.acc__panel[data-open='true'] { grid-template-rows: 1fr; }
.acc__panel > div { overflow: hidden; }
.acc__panel p { padding-bottom: var(--sp-5); color: var(--tx-2); max-width: 68ch; font-size: 0.9375rem; }

/* Abas */
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  padding: var(--sp-3);
  white-space: nowrap;
  font: 500 var(--t-xs)/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tx-3);
  transition: color var(--dur) var(--ease);
}
.tab:hover { color: var(--tx-2); }
.tab[aria-selected='true'] { color: var(--tx); }
.tab[aria-selected='true']::after {
  content: '';
  position: absolute;
  left: var(--sp-2);
  right: var(--sp-2);
  bottom: -1px;
  height: 2px;
  background: var(--brand);
}
.tabpanel[hidden] { display: none; }

/* --------------------------------------------------------------------------
   14. Preços
   -------------------------------------------------------------------------- */

.plan { display: flex; flex-direction: column; height: 100%; }
.plan__head { padding: var(--sp-5) var(--sp-4) var(--sp-4); border-bottom: 1px solid var(--line); }
.plan__name {
  font: 500 var(--t-xs)/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tx-3);
}
.plan__price {
  display: flex;
  align-items: baseline;
  gap: 0.2em;
  margin-top: var(--sp-4);
  font-size: var(--t-2xl);
  font-weight: 650;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.plan__price sup { font-size: var(--t-md); font-weight: 500; top: -0.55em; color: var(--tx-2); }
.plan__price small {
  font: 400 var(--t-sm)/1 var(--font-mono);
  color: var(--tx-3);
  letter-spacing: 0;
  white-space: nowrap;
}
/* Altura fixa mantém preço e CTA alinhados entre colunas de planos */
.plan__price { min-height: var(--t-2xl); }
.plan__note { margin-top: var(--sp-3); font-size: var(--t-sm); color: var(--tx-2); min-height: 3.1em; }
.plan__cta { padding: var(--sp-4); border-bottom: 1px solid var(--line); }
.plan__specs { padding: var(--sp-4); display: grid; gap: var(--sp-3); flex: 1; align-content: start; }
.plan__spec {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  align-items: baseline;
  font-size: var(--t-sm);
  color: var(--tx-2);
  padding-bottom: var(--sp-3);
  border-bottom: 1px dashed var(--line);
}
.plan__spec:last-child { border-bottom: 0; padding-bottom: 0; }
.plan__spec b {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: var(--t-xs);
  color: var(--tx);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.plan--hot { border-color: var(--brand-line); }

.toggle-group {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-2);
}
.toggle-group button {
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-xs);
  font: 500 var(--t-xs)/1.4 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tx-3);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.toggle-group button[aria-pressed='true'] { background: var(--bg-3); color: var(--tx); box-shadow: var(--sh-1); }

/* --------------------------------------------------------------------------
   15. Formulários
   -------------------------------------------------------------------------- */

.field { display: grid; gap: var(--sp-2); }

.label {
  font: 500 var(--t-xs)/1.4 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tx-2);
}
.label span { color: var(--crit); }

.input,
.select,
.textarea {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem var(--sp-3);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  color: var(--tx);
  font-size: 1rem;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--tx-3); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-3); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-dim);
}
.textarea { min-height: 7rem; resize: vertical; line-height: 1.55; }

.select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: var(--sp-7);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236A7381' stroke-width='1.4' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--sp-3) center;
  background-size: 12px;
}

.field--err .input,
.field--err .select,
.field--err .textarea { border-color: var(--crit); }

.field__err { font: 400 var(--t-xs)/1.5 var(--font-mono); color: var(--crit); display: none; }
.field--err .field__err { display: block; }

.phone-group { display: grid; grid-template-columns: 6.75rem 1fr; gap: var(--sp-2); }

.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-3);
  align-items: start;
  font-size: var(--t-sm);
  color: var(--tx-2);
  cursor: pointer;
  line-height: 1.55;
  position: relative;
}
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check__box {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.15rem;
  border: 1px solid var(--line-3);
  border-radius: var(--r-xs);
  background: var(--bg-2);
  display: grid;
  place-items: center;
  flex: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.check__box::after {
  content: '';
  width: 9px;
  height: 5px;
  border-left: 1.6px solid var(--brand-ink);
  border-bottom: 1.6px solid var(--brand-ink);
  transform: rotate(-45deg) scale(0);
  transition: transform 140ms var(--ease);
  margin-top: -3px;
}
.check input:checked + .check__box { background: var(--brand); border-color: var(--brand); }
.check input:checked + .check__box::after { transform: rotate(-45deg) scale(1); }
.check input:focus-visible + .check__box { outline: 2px solid var(--brand); outline-offset: 2px; }
.check a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

.form-note { font: 400 var(--t-xs)/1.7 var(--font-mono); color: var(--tx-3); }

/* Toast */
.toasts {
  position: fixed;
  right: var(--sp-4);
  bottom: var(--sp-4);
  z-index: 200;
  display: grid;
  gap: var(--sp-2);
  width: min(22rem, calc(100vw - 2rem));
}
.toast {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  align-items: start;
  padding: var(--sp-3);
  border: 1px solid var(--line-2);
  border-left: 2px solid var(--brand);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  box-shadow: var(--sh-3);
  font-size: var(--t-sm);
  color: var(--tx-2);
  animation: toast-in 240ms var(--ease);
}
.toast--ok { border-left-color: var(--ok); }
.toast--err { border-left-color: var(--crit); }
.toast b { display: block; color: var(--tx); font-weight: 560; margin-bottom: 2px; }
.toast__x { color: var(--tx-3); line-height: 1; font-size: 1.125rem; align-self: start; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   16. Rodapé
   -------------------------------------------------------------------------- */

.footer { border-top: 1px solid var(--line); background: var(--bg-1); margin-top: var(--sp-8); }

.footer__grid { display: grid; gap: var(--sp-6); padding-block: var(--sp-7); }

.footer__col h4 {
  font: 500 var(--t-xs)/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tx-3);
  margin-bottom: var(--sp-4);
}
.footer__col a {
  display: block;
  padding: var(--sp-2) 0;
  font-size: 0.9375rem;
  color: var(--tx-2);
  transition: color var(--dur) var(--ease);
}
.footer__col a:hover { color: var(--tx); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-block: var(--sp-4);
  border-top: 1px solid var(--line);
  font: 400 var(--t-xs)/1.7 var(--font-mono);
  color: var(--tx-3);
}
.footer__bottom nav { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.footer__bottom a:hover { color: var(--tx-2); }

.social { display: flex; gap: var(--sp-2); }
.social a {
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--tx-3);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.social a:hover { color: var(--tx); border-color: var(--line-3); }
.social svg { width: 15px; height: 15px; }

/* --------------------------------------------------------------------------
   17. Peças de página
   -------------------------------------------------------------------------- */

/* Hero */
.hero { padding-block: var(--sp-7) var(--sp-8); position: relative; }

.hero__glow {
  position: absolute;
  z-index: -1;
  top: -25%;
  left: 50%;
  width: min(62rem, 130%);
  aspect-ratio: 2 / 1;
  transform: translateX(-50%);
  pointer-events: none;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--brand) 20%, transparent), transparent 62%);
  opacity: 0.6;
  filter: blur(24px);
}

.hero__title {
  font-size: clamp(2.4rem, 10.2vw, 3.4rem);
  line-height: 0.99;
  letter-spacing: -0.042em;
  font-weight: 660;
}

.hero__kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.hero__kpis > div { padding: var(--sp-4) var(--sp-4) var(--sp-4) 0; }
.hero__kpis > div:nth-child(n + 3) { border-top: 1px solid var(--line); }

/* Console — peça de assinatura do hero */
.console__tabs {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0 var(--sp-2);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.console__tabs::-webkit-scrollbar { display: none; }
.console__tab {
  position: relative;
  padding: var(--sp-3);
  font: 500 var(--t-xs)/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tx-3);
  white-space: nowrap;
}
.console__tab:hover { color: var(--tx-2); }
.console__tab[aria-selected='true'] { color: var(--tx); }
.console__tab[aria-selected='true']::after {
  content: '';
  position: absolute;
  inset: auto var(--sp-2) -1px var(--sp-2);
  height: 2px;
  background: var(--brand);
}
.console__clock {
  margin-left: auto;
  padding-right: var(--sp-2);
  font: 400 var(--t-xs)/1 var(--font-mono);
  color: var(--tx-3);
  white-space: nowrap;
}

/* Feed de eventos */
.feed__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3);
  border-bottom: 1px solid var(--line);
  font-size: var(--t-sm);
}
.feed__row:last-child { border-bottom: 0; }
.feed__time { font: 400 var(--t-xs)/1 var(--font-mono); color: var(--tx-3); }
.feed__txt { color: var(--tx-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed__txt b { color: var(--tx); font-weight: 540; }
.feed__row--new { animation: feed-in 500ms var(--ease); }
@keyframes feed-in {
  from { opacity: 0; background: var(--brand-dim); }
  to { opacity: 1; background: transparent; }
}

/* Mapa de serviço */
.svcmap { width: 100%; height: auto; }
.svcmap .edge {
  stroke: var(--line-2);
  stroke-width: 1;
  fill: none;
  stroke-dasharray: 3 4;
  animation: flow 3s linear infinite;
}
.svcmap .edge--hot { stroke: var(--brand); opacity: 0.9; }
.svcmap .nd { fill: var(--bg-2); stroke: var(--line-2); }
.svcmap .nd--core { fill: var(--brand-dim); stroke: var(--brand-line); }
.svcmap .lbl { font-family: var(--font-mono); font-size: 8.5px; fill: var(--tx-2); letter-spacing: 0.04em; }
@keyframes flow { to { stroke-dashoffset: -28; } }

/* Faixa em movimento */
.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding-block: var(--sp-4);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track { display: flex; gap: var(--sp-7); width: max-content; animation: slide 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  font: 500 var(--t-sm)/1 var(--font-mono);
  letter-spacing: 0.06em;
  color: var(--tx-3);
  white-space: nowrap;
}
.marquee__item svg { width: 17px; height: 17px; flex: none; }
@keyframes slide { to { transform: translateX(-50%); } }

/* Autenticação */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.auth__main {
  display: grid;
  place-items: center;
  padding: var(--sp-6) var(--shell-pad) var(--sp-8);
  width: 100%;
}
.auth__card { width: min(26rem, 100%); }
.auth__aside { display: none; }

/* 404 */
.err-code {
  font-family: var(--font-mono);
  font-size: clamp(4.5rem, 24vw, 10rem);
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1px var(--line-3);
}

/* Documento legal */
.doc { display: grid; gap: var(--sp-6); }
.doc__toc ol { display: grid; gap: 1px; }
.doc__toc a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  border-left: 1px solid var(--line);
  font-size: var(--t-sm);
  color: var(--tx-2);
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.doc__toc a:hover { color: var(--tx); border-left-color: var(--brand); }
.doc__toc a.is-active { color: var(--tx); border-left-color: var(--brand); background: var(--bg-2); }

.doc__body h2 {
  font-size: var(--t-lg);
  margin-top: var(--sp-7);
  margin-bottom: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  scroll-margin-top: 7rem;
}
.doc__body > h2:first-child { margin-top: 0; border-top: 0; padding-top: 0; }
.doc__body h3 { font-size: var(--t-base); margin-top: var(--sp-5); margin-bottom: var(--sp-3); }
.doc__body p { color: var(--tx-2); margin-bottom: var(--sp-4); max-width: 72ch; }
.doc__body ul { display: grid; gap: var(--sp-2); margin-bottom: var(--sp-4); max-width: 72ch; }
.doc__body li { position: relative; padding-left: var(--sp-5); color: var(--tx-2); }
.doc__body li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 8px;
  height: 1px;
  background: var(--line-3);
}
.doc__body strong { color: var(--tx); font-weight: 560; }
.doc__body a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

/* Estruturas internas herdadas dos documentos jurídicos */
.doc__num {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 0.78em;
  color: var(--brand);
  margin-right: 0.5em;
}

.doc__note {
  border: 1px solid var(--line);
  border-left: 2px solid var(--brand);
  border-radius: var(--r-sm);
  background: var(--bg-2);
  padding: var(--sp-4);
  margin-bottom: var(--sp-5);
}
.doc__note p:last-child { margin-bottom: 0; }

.doc__grid { display: grid; gap: var(--sp-4); margin-bottom: var(--sp-5); }

.doc__card {
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--bg-1);
  padding: var(--sp-4);
}
.doc__card h3, .doc__card h4 {
  margin-top: 0;
  margin-bottom: var(--sp-2);
  font-size: var(--t-base);
}
.doc__card p:last-child { margin-bottom: 0; }

@media (min-width: 40em) {
  .doc__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Faixa de CTA */
.cta-band {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-1);
  padding: var(--sp-6) var(--sp-5);
  position: relative;
  overflow: hidden;
}
.cta-band::before {
  content: '';
  position: absolute;
  inset: -70% -10% auto auto;
  width: 30rem;
  aspect-ratio: 1;
  background: radial-gradient(circle, color-mix(in srgb, var(--brand) 24%, transparent), transparent 65%);
  pointer-events: none;
}
.cta-band > * { position: relative; }

/* --------------------------------------------------------------------------
   18. Entrada
   -------------------------------------------------------------------------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 520ms var(--ease), transform 520ms var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }

/* --------------------------------------------------------------------------
   19. Grades responsivas
   -------------------------------------------------------------------------- */

.cols-2, .cols-3, .cols-4 { display: grid; gap: var(--sp-5); }
.cols-tight { gap: var(--sp-4); }

.split { display: grid; gap: var(--sp-6); }

.hide-sm { display: none; }

/* --------------------------------------------------------------------------
   20. Breakpoints
   -------------------------------------------------------------------------- */

@media (min-width: 40em) {          /* 640px */
  :root { --shell-pad: 2rem; }

  .statusbar__item { display: inline-flex; }

  .metric-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric-row > *:nth-child(-n + 4) { border-top: 0; }
  .metric-row > *:nth-child(2n) { border-right: 1px solid var(--line); }
  .metric-row > *:nth-child(4n) { border-right: 0; }

  .hero__kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero__kpis > div:nth-child(n + 3) { border-top: 0; }

  .cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cta-band { padding: var(--sp-7); }
  .auth__main { padding-block: var(--sp-8); }
  .hide-sm { display: revert; }
}

@media (min-width: 60em) {          /* 960px */
  :root {
    --t-2xl: 2.75rem;
    --t-3xl: 3.5rem;
    --t-4xl: 4.5rem;
    --head-h: 4rem;
  }

  .section { padding-block: var(--sp-9); }
  .section--tight { padding-block: var(--sp-8); }

  .nav { display: flex; align-items: center; gap: var(--sp-6); }
  .burger { display: none; }
  .brand__tag { display: inline-block; }

  .hero { padding-block: var(--sp-8) var(--sp-9); }
  .hero__title { font-size: clamp(3.2rem, 5.2vw, 4.25rem); }

  .cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

  /* Split assimétrico 7/5 — quebra a simetria previsível */
  .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--sp-8); align-items: center; }
  .split--5-7 { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
  .split--half { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split--top { align-items: start; }
  .split--rev > *:first-child { order: 2; }

  .footer__grid { grid-template-columns: 1.7fr repeat(3, minmax(0, 1fr)); gap: var(--sp-7); }

  .doc { grid-template-columns: 15rem minmax(0, 1fr); gap: var(--sp-8); align-items: start; }
  .doc__toc { position: sticky; top: 7rem; }

  .auth__main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: var(--sp-8);
    max-width: var(--shell);
    margin-inline: auto;
  }
  .auth__card { justify-self: end; width: min(27rem, 100%); }
  .auth__aside { display: block; }
}

@media (min-width: 75em) {          /* 1200px */
  .hero__title { font-size: 4.5rem; }
}

/* --------------------------------------------------------------------------
   21. Movimento reduzido e impressão
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .marquee__track { animation: none; }
}

@media print {
  .header, .statusbar, .footer, .drawer, .toasts, .cta-band { display: none !important; }
  body { background: #FFF; color: #000; }
  body::before, body::after { display: none; }
  .panel { break-inside: avoid; }
}