/* =============================================================================
   Pagyou — base do design system
   Compartilhada pelo developer portal (internal/docs) e pelo painel do master
   (internal/master). É a FONTE ÚNICA dos tokens: cor, tipografia, espaço e forma.
   Cada página concatena este arquivo antes do seu CSS próprio (um request só).

   Três camadas de decisão:
   1) COR — um par de superfícies frias (quase-preto azulado) e um acento
      ciano→violeta usado com parcimônia: só no que é ação ou identidade.
      Nunca colorir texto corrido; contraste AA no mínimo em tudo.
   2) RITMO — escala de espaço em 4px e medida de leitura de ~68ch.
   3) MOVIMENTO — transições curtas (120–220ms) e só em cor/transform/opacity.
      Tudo respeita prefers-reduced-motion.
   ============================================================================= */

/* --- reset enxuto ---------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }

/* --- tokens ---------------------------------------------------------------- */
:root {
  color-scheme: dark;

  /* superfícies: frias, com passos curtos — profundidade vem da luz, não do preto */
  --bg:        #06070c;
  --bg-2:      #090b12;
  --surface:   #0d1018;
  --surface-2: #11151f;
  --surface-3: #161b27;
  --line:      #1e2433;
  --line-2:    #2a3346;

  /* texto */
  --fg:        #e8ecf5;
  --fg-2:      #a9b3c7;
  --fg-3:      #6f7a91;

  /* acento */
  --a1: #22d3ee;   /* ciano */
  --a1-text: #22d3ee; /* a1 como TEXTO: igual no escuro, mais fundo no claro */
  --a2: #a78bfa;   /* violeta */
  --a1-soft: rgba(34, 211, 238, .12);
  --a2-soft: rgba(167, 139, 250, .12);
  --accent-line: linear-gradient(90deg, var(--a1), var(--a2));

  /* semânticos — derivados da família do acento, nunca cor de estoque:
     sucesso teal (vizinho do ciano), info índigo (eco do violeta), perigo
     rosa-frio, alerta âmbar assentado na luminosidade da paleta */
  --ok:   #2dd4bf;
  --warn: #f2b64c;
  --bad:  #fb7299;
  --info: #818cf8;

  /* métodos HTTP */
  --get:   #2dd4bf;
  --post:  #818cf8;
  --put:   #f2b64c;
  --patch: #a78bfa;
  --del:   #fb7299;

  /* tipografia */
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* espaço e forma */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 18px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 32px rgba(0,0,0,.35);
  --shadow-lg: 0 24px 80px -12px rgba(0,0,0,.7);

  /* layout */
  --top-h: 60px;
  --side-w: 268px;
  --rail-w: 460px;
  --gutter: 40px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg:        #fbfcfe;
  --bg-2:      #f4f6fb;
  --surface:   #ffffff;
  --surface-2: #f7f9fc;
  --surface-3: #eef2f8;
  --line:      #e3e8f0;
  --line-2:    #cfd7e4;
  --fg:        #0e1420;
  --fg-2:      #45536b;
  --fg-3:      #75839a;
  /* O ciano vivo é a marca — no claro ele continua nos preenchimentos e
     acentos (owner, 25/08). Escurecer só onde ele vira texto sobre branco. */
  --a1: #22d3ee;
  --a1-text: #0e7490;
  --a2: #7c3aed;
  --a1-soft: rgba(34, 211, 238, .16);
  --a2-soft: rgba(124, 58, 237, .10);
  --ok:   #0f9d8f;
  --warn: #b7791f;
  --bad:  #dc2d6b;
  --info: #4f46e5;
  --get:   #0f9d8f;
  --post:  #4f46e5;
  --put:   #b7791f;
  --patch: #7c3aed;
  --del:   #dc2d6b;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06);
  --shadow-lg: 0 24px 64px -16px rgba(16,24,40,.18);
}

/* --- base ------------------------------------------------------------------ */
body {
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "ss01" 1;
}

a { color: inherit; text-decoration: none; }
p a, li a, dd a, td a {
  color: var(--a1-text);
  text-underline-offset: 3px;
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, var(--a1) 35%, transparent);
  transition: text-decoration-color .15s, color .15s;
}
p a:hover, li a:hover, dd a:hover, td a:hover { text-decoration-color: var(--a1); }

::selection { background: color-mix(in oklab, var(--a1) 28%, transparent); color: var(--fg); }

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

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 100;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--surface-3); color: var(--fg);
  border: 1px solid var(--line-2);
  transform: translateY(-200%);
  transition: transform .18s;
}
.skip:focus { transform: none; }

code {
  font-family: var(--mono);
  font-size: .875em;
  font-feature-settings: "liga" 0;
}
p code, li code, td code, dd code, .callout code {
  padding: .12em .38em;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: color-mix(in oklab, var(--fg) 88%, var(--a1));
  white-space: nowrap;
}
kbd {
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  color: var(--fg-2);
  white-space: nowrap;
}


/* =============================================================================
   Pagyou — developer portal
   Estilos PRÓPRIOS da documentação. Os tokens, o reset e a tipografia vêm de
   internal/ui/base.css, concatenado antes deste arquivo pelo handler — a
   terceira coluna (código) é sticky: a explicação rola, o exemplo fica.
   ============================================================================= */

/* --- fundo ----------------------------------------------------------------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.bg-grid {
  position: absolute; inset: -1px;
  background-image:
    linear-gradient(to right, color-mix(in oklab, var(--line) 55%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in oklab, var(--line) 55%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 100% 60% at 50% 0%, #000 20%, transparent 75%);
  opacity: .5;
}
.bg-glow { position: absolute; border-radius: 50%; filter: blur(120px); opacity: .28; }
.bg-glow-a { width: 780px; height: 520px; top: -280px; left: -120px; background: var(--a1); }
.bg-glow-b { width: 680px; height: 460px; top: -200px; right: -140px; background: var(--a2); opacity: .22; }
:root[data-theme="light"] .bg-glow { opacity: .16; }
:root[data-theme="light"] .bg-grid { opacity: .8; }

/* --- barra de progresso de leitura ---------------------------------------- */
.progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: var(--accent-line);
  z-index: 60;
  transition: width .1s linear;
  box-shadow: 0 0 12px color-mix(in oklab, var(--a1) 60%, transparent);
}

/* --- topo ------------------------------------------------------------------ */
.top {
  position: sticky; top: 0; z-index: 50;
  height: var(--top-h);
  display: flex; align-items: center; gap: 20px;
  padding: 0 var(--gutter);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; flex: none; }
.brand-mark { width: 26px; height: 26px; color: var(--fg); }
.brand-name { font-weight: 640; letter-spacing: -.015em; }
.brand-sep { color: var(--fg-3); }
.brand-sub { color: var(--fg-2); font-weight: 520; }
.chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 560;
  letter-spacing: .01em;
  color: var(--fg-2);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.chip-version { font-family: var(--mono); font-size: 10.5px; margin-left: 4px; }

.search {
  flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 10px;
  height: 34px; padding: 0 10px 0 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--fg-3);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.search:hover { border-color: var(--line-2); color: var(--fg-2); background: var(--surface-2); }
.search svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.search span { flex: 1; text-align: left; font-size: 13.5px; }
.search kbd { font-size: 10.5px; }

.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.top-link {
  padding: 6px 12px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 520; color: var(--fg-2);
  background: transparent; border: 1px solid transparent; cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.top-link:hover { color: var(--fg); background: var(--surface-2); border-color: var(--line); }
.icon-btn {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: var(--r-sm); background: transparent;
  border: 1px solid transparent; color: var(--fg-2); cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.icon-btn:hover { color: var(--fg); background: var(--surface-2); border-color: var(--line); }
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.i-moon { display: none; }
:root[data-theme="light"] .i-sun { display: none; }
:root[data-theme="light"] .i-moon { display: block; }

.status {
  display: flex; align-items: center; gap: 7px;
  padding: 5px 11px 5px 9px; border-radius: 999px;
  font-size: 12px; color: var(--fg-2);
  background: var(--surface); border: 1px solid var(--line);
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--fg-3);
  box-shadow: 0 0 0 0 currentColor;
}
.status.ok .status-dot { background: var(--ok); animation: pulse 2.6s ease-out infinite; color: var(--ok); }
.status.bad .status-dot { background: var(--bad); color: var(--bad); }
.status.ok .status-text { color: var(--fg-2); }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in oklab, currentColor 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- layout ---------------------------------------------------------------- */
.shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--rail-w);
  /* SEM align-items: start. As colunas precisam esticar até a altura da linha,
     senão `position: sticky` não tem curso: a caixa do código pararia de
     acompanhar a leitura poucos pixels abaixo do topo. */
  gap: 0;
  max-width: 1680px;
  margin: 0 auto;
}

/* --- lateral --------------------------------------------------------------- */
.side {
  position: sticky; top: var(--top-h);
  height: calc(100dvh - var(--top-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 12px 48px var(--gutter);
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.side::-webkit-scrollbar { width: 8px; }
.side::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
.side:hover::-webkit-scrollbar-thumb { background: var(--line-2); background-clip: padding-box; }

/* Em telas estreitas o índice vira um disclosure: 30 links antes do conteúdo
   é uma parede. Fechado, o botão mostra a seção em que o leitor está. */
.side-toggle { display: none; }

.side-group { margin-bottom: 22px; }
.side-title {
  font-size: 11px; font-weight: 640; letter-spacing: .075em; text-transform: uppercase;
  color: var(--fg-3); padding: 0 10px; margin-bottom: 7px;
}
.side-nav a {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  padding: 5.5px 10px;
  border-radius: 7px;
  font-size: 13.5px;
  color: var(--fg-2);
  transition: color .13s, background .13s;
}
.side-nav a::before {
  content: ""; position: absolute; left: -10px; top: 50%;
  width: 2px; height: 0; border-radius: 2px;
  background: var(--accent-line);
  transform: translateY(-50%);
  transition: height .18s cubic-bezier(.2,.8,.2,1);
}
.side-nav a:hover { color: var(--fg); background: var(--surface-2); }
.side-nav a.active { color: var(--fg); background: var(--surface-2); font-weight: 540; }
.side-nav a.active::before { height: 18px; }

.m {
  font-family: var(--mono); font-size: 9.5px; font-weight: 700;
  letter-spacing: .04em;
  padding: 2px 5px; border-radius: 4px; flex: none;
  border: 1px solid transparent;
}
.m-get   { color: var(--get);   background: color-mix(in oklab, var(--get) 12%, transparent);   border-color: color-mix(in oklab, var(--get) 26%, transparent); }
.m-post  { color: var(--post);  background: color-mix(in oklab, var(--post) 12%, transparent);  border-color: color-mix(in oklab, var(--post) 26%, transparent); }
.m-put   { color: var(--put);   background: color-mix(in oklab, var(--put) 12%, transparent);   border-color: color-mix(in oklab, var(--put) 26%, transparent); }
.m-patch { color: var(--patch); background: color-mix(in oklab, var(--patch) 12%, transparent); border-color: color-mix(in oklab, var(--patch) 26%, transparent); }
.m-del   { color: var(--del);   background: color-mix(in oklab, var(--del) 12%, transparent);   border-color: color-mix(in oklab, var(--del) 26%, transparent); }

/* --- conteúdo -------------------------------------------------------------- */
.content {
  padding: 40px var(--gutter) 120px;
  min-width: 0;
}
.content section {
  max-width: 68ch;
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--top-h) + 24px);
}
.content section:last-of-type { border-bottom: 0; }

h1 {
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.1;
  letter-spacing: -.032em;
  font-weight: 660;
  margin-bottom: 18px;
}
.grad {
  background: var(--accent-line);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
h2 {
  font-size: 23px; line-height: 1.28; letter-spacing: -.022em; font-weight: 620;
  margin-bottom: 14px;
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
h3 {
  font-size: 15.5px; letter-spacing: -.01em; font-weight: 620;
  margin: 26px 0 10px;
  display: flex; align-items: center; gap: 8px;
}
p { color: var(--fg-2); margin-bottom: 14px; }
p strong, li strong, dd strong { color: var(--fg); font-weight: 600; }
em { color: var(--fg-2); font-style: italic; }

.path { font-size: 14.5px; color: var(--fg) !important; background: var(--surface-2) !important; padding: 3px 9px !important; }
.scope {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  padding: 3px 8px; border-radius: 999px;
  color: var(--a2);
  background: var(--a2-soft);
  border: 1px solid color-mix(in oklab, var(--a2) 26%, transparent);
}

.anchor {
  font-family: var(--mono);
  font-size: .68em;
  font-weight: 500;
  color: var(--fg-3);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .15s, transform .15s, color .15s;
  padding: 0 4px;
}
h1:hover .anchor, h2:hover .anchor, .anchor:focus-visible { opacity: 1; transform: none; }
.anchor:hover { color: var(--a1); }

/* hero */
.hero { border-bottom: 1px solid var(--line); }
.eyebrow {
  font-size: 11.5px; font-weight: 640; letter-spacing: .09em; text-transform: uppercase;
  color: var(--a1); margin-bottom: 14px;
}
.lead { font-size: 17px; line-height: 1.62; color: var(--fg-2); margin-bottom: 26px; }

.hero-cards { display: grid; gap: 10px; margin-bottom: 28px; }
@media (min-width: 900px) { .hero-cards { grid-template-columns: repeat(3, 1fr); } }
.hcard {
  position: relative;
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 16px 15px;
  border-radius: var(--r);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color .18s, transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .18s;
}
.hcard::after {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: var(--accent-line); opacity: 0; transition: opacity .18s;
}
.hcard:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.hcard:hover::after { opacity: 1; }
.hcard-k { font-family: var(--mono); font-size: 10.5px; color: var(--fg-3); letter-spacing: .06em; }
.hcard strong { font-size: 14.5px; font-weight: 600; }
.hcard span:last-child { font-size: 13px; color: var(--fg-2); line-height: 1.5; }
.hcard code { white-space: nowrap; }

.facts { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.facts > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 11px 15px; background: var(--surface); }
.facts dt { font-size: 12.5px; color: var(--fg-3); font-weight: 560; }
.facts dd { font-size: 13.5px; color: var(--fg-2); }

/* listas */
.list { list-style: none; display: grid; gap: 11px; margin-bottom: 16px; }
.list li {
  position: relative; padding-left: 20px; color: var(--fg-2); font-size: 14.5px; line-height: 1.6;
}
.list li::before {
  content: ""; position: absolute; left: 3px; top: .68em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--a1); opacity: .65;
}

/* tabelas */
.tbl {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; margin: 4px 0 18px;
  font-size: 13.5px;
}
.tbl th {
  text-align: left; font-weight: 620; font-size: 11.5px;
  letter-spacing: .05em; text-transform: uppercase; color: var(--fg-3);
  padding: 9px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.tbl td { padding: 10px 14px; color: var(--fg-2); vertical-align: top; border-bottom: 1px solid var(--line); background: var(--surface); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover td { background: var(--surface-2); }
/* A primeira coluna NÃO é nowrap: com três nomes de campo numa célula
   ("paid_at · refunded_at · refund_requested_at") ela empurraria a tabela
   para além da tela e a página inteira passaria a rolar na horizontal. Cada
   `code` continua indivisível; a célula quebra entre eles. */
.tbl.params td:first-child { width: 34%; color: var(--fg); }
.tbl.params td:first-child code { white-space: nowrap; }
.req {
  display: inline-block; margin-left: 7px;
  font-size: 10px; font-weight: 620; letter-spacing: .03em;
  color: var(--warn); vertical-align: middle;
}

/* estados */
.st {
  display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 5px; border: 1px solid transparent; white-space: nowrap;
}
.st-pending  { color: var(--info); background: color-mix(in oklab, var(--info) 12%, transparent); border-color: color-mix(in oklab, var(--info) 26%, transparent); }
.st-paid     { color: var(--ok);   background: color-mix(in oklab, var(--ok) 12%, transparent);   border-color: color-mix(in oklab, var(--ok) 26%, transparent); }
.st-bad      { color: var(--bad);  background: color-mix(in oklab, var(--bad) 12%, transparent);  border-color: color-mix(in oklab, var(--bad) 26%, transparent); }
.st-refunded { color: var(--a2);   background: var(--a2-soft);                                    border-color: color-mix(in oklab, var(--a2) 26%, transparent); }
.st-muted    { color: var(--fg-3); background: var(--surface-2);                                  border-color: var(--line); }

.state-machine {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 16px; margin: 6px 0 16px;
  border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
}
.arrow { color: var(--fg-3); font-size: 13px; }
.branch { flex-basis: 100%; font-size: 12.5px; color: var(--fg-3); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* códigos HTTP inline */
.code-ok, .code-warn, .code-bad {
  font-family: var(--mono); font-size: 12px; font-weight: 620;
  padding: 1px 6px; border-radius: 5px;
}
.code-ok   { color: var(--ok);   background: color-mix(in oklab, var(--ok) 12%, transparent); }
.code-warn { color: var(--warn); background: color-mix(in oklab, var(--warn) 12%, transparent); }
.code-bad  { color: var(--bad);  background: color-mix(in oklab, var(--bad) 12%, transparent); }

/* callout */
.callout {
  position: relative;
  padding: 14px 16px 14px 17px;
  margin: 4px 0 18px;
  border-radius: var(--r);
  background: color-mix(in oklab, var(--a1) 5%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--a1) 22%, var(--line));
  font-size: 13.8px; color: var(--fg-2); line-height: 1.6;
}
.callout::before {
  content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px;
  border-radius: 2px; background: var(--a1);
}
.callout.warn {
  background: color-mix(in oklab, var(--warn) 6%, var(--surface));
  border-color: color-mix(in oklab, var(--warn) 26%, var(--line));
}
.callout.warn::before { background: var(--warn); }

/* changelog */
.log { list-style: none; display: grid; gap: 18px; }
.log li { display: grid; grid-template-columns: 92px 1fr; gap: 16px; font-size: 13.8px; color: var(--fg-2); line-height: 1.6; }
.log time { font-family: var(--mono); font-size: 12px; color: var(--fg-3); padding-top: 2px; }
.log strong { color: var(--fg); }

/* ferramenta (verificador) */
.tool { display: grid; gap: 12px; padding: 18px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.tool label { display: grid; gap: 6px; font-size: 12.5px; color: var(--fg-2); font-weight: 540; }
.tool input, .tool textarea, .field input, .field textarea, .field select {
  width: 100%;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.tool textarea, .field textarea { resize: vertical; }
.tool input:focus, .tool textarea:focus, .field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--a1) 55%, var(--line));
  box-shadow: 0 0 0 3px var(--a1-soft);
  background: var(--surface);
}
.tool-row { display: flex; align-items: center; gap: 14px; }
.tool-row output { font-size: 13px; font-family: var(--mono); }
.tool-row output.ok { color: var(--ok); }
.tool-row output.bad { color: var(--bad); }

.btn {
  padding: 8px 16px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--fg);
  font-size: 13.5px; font-weight: 560;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { background: var(--surface-2); border-color: var(--fg-3); }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(135deg, color-mix(in oklab, var(--a1) 88%, #000), color-mix(in oklab, var(--a2) 88%, #000));
  border-color: transparent;
  color: #06070c;
  font-weight: 640;
  display: inline-flex; align-items: center; gap: 10px;
}
.btn-primary kbd { background: rgba(0,0,0,.18); border-color: rgba(0,0,0,.22); color: #06070c; }
.btn-primary:hover { filter: brightness(1.08); border-color: transparent; }

/* --- coluna de código (sticky) -------------------------------------------- */
.rail { padding: 40px var(--gutter) 40px 20px; }
.rail-sticky { position: sticky; top: calc(var(--top-h) + 24px); }
.code-card {
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: opacity .2s;
}
.code-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px 8px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 2px; flex: 1; }
.tabs button {
  padding: 5px 11px; border-radius: 7px;
  font-size: 12.5px; font-weight: 540; color: var(--fg-3);
  background: transparent; border: 0; cursor: pointer;
  transition: color .13s, background .13s;
}
.tabs button:hover { color: var(--fg-2); background: var(--surface-3); }
.tabs button[aria-selected="true"] { color: var(--fg); background: var(--surface-3); }
.copy {
  width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 7px; background: transparent; border: 1px solid transparent;
  color: var(--fg-3); cursor: pointer;
  transition: color .13s, background .13s, border-color .13s;
}
.copy:hover { color: var(--fg); background: var(--surface-3); border-color: var(--line); }
.copy.done { color: var(--ok); }
.copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.code {
  margin: 0; padding: 14px 16px;
  font-family: var(--mono); font-size: 12.3px; line-height: 1.68;
  color: var(--fg-2);
  /* Quebra em vez de rolar na horizontal: numa coluna estreita, barra de
     rolagem lateral esconde justamente o fim da linha — o valor, a chave, o
     campo. A indentação é preservada e a continuação recua. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 46vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
  tab-size: 2;
}
.code::-webkit-scrollbar { height: 8px; width: 8px; }
.code::-webkit-scrollbar-thumb { background: var(--line); border-radius: 99px; }
.code code { font-size: inherit; }

.code-resp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 14px;
  font-size: 11px; font-weight: 620; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fg-3);
  background: var(--surface-2);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.code-resp-status { font-family: var(--mono); text-transform: none; letter-spacing: 0; }
.code-resp { max-height: 34vh; background: color-mix(in oklab, var(--bg-2) 60%, var(--surface)); }

/* realce de sintaxe (aplicado pelo JS) */
.t-str  { color: #7dd3a7; }
.t-num  { color: #f0b866; }
.t-key  { color: #7cc7f5; }
.t-kw   { color: #c4a2fb; }
.t-cmt  { color: var(--fg-3); font-style: italic; }
.t-fn   { color: #f2d59a; }
.t-punc { color: var(--fg-3); }
:root[data-theme="light"] .t-str { color: #0f7a4d; }
:root[data-theme="light"] .t-num { color: #a15c00; }
:root[data-theme="light"] .t-key { color: #0b6c9e; }
:root[data-theme="light"] .t-kw  { color: #6d28d9; }
:root[data-theme="light"] .t-fn  { color: #92600a; }

/* --- rodapé ---------------------------------------------------------------- */
.foot {
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  padding-top: 28px; margin-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--fg-3);
}

/* --- paleta de busca -------------------------------------------------------- */
.palette {
  position: fixed; inset: 0; z-index: 90;
  background: color-mix(in oklab, #000 55%, transparent);
  backdrop-filter: blur(4px);
  display: grid; place-items: start center;
  padding-top: 12vh;
  animation: fade .14s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.palette-box {
  width: min(620px, 92vw);
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: rise .18s cubic-bezier(.2,.8,.2,1);
}
@keyframes rise { from { transform: translateY(-8px) scale(.99); opacity: 0; } }
#palette-input {
  width: 100%; padding: 16px 18px;
  background: transparent; border: 0; border-bottom: 1px solid var(--line);
  font-size: 15px; color: var(--fg);
}
#palette-input:focus { outline: none; }
#palette-input::placeholder { color: var(--fg-3); }
#palette-list { list-style: none; max-height: 52vh; overflow-y: auto; padding: 6px; }
#palette-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--fg-2); cursor: pointer;
}
#palette-list li[aria-selected="true"] { background: var(--surface-3); color: var(--fg); }
#palette-list .p-sec { margin-left: auto; font-size: 11px; color: var(--fg-3); }
/* Sem padding lateral: o realce é DENTRO de uma palavra, e um respiro aqui a
   partiria visualmente ("Webhook s"). O box-decoration-break mantém o fundo
   contínuo se o termo cair na quebra de linha. */
#palette-list mark {
  background: color-mix(in oklab, var(--a1) 26%, transparent);
  color: inherit; border-radius: 3px; padding: 0;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.palette-hint {
  display: flex; gap: 8px; align-items: center;
  padding: 9px 14px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--fg-3);
  background: var(--surface-2);
}

/* --- console (gaveta) ------------------------------------------------------- */
.drawer {
  position: fixed; inset: 0; z-index: 95;
  background: color-mix(in oklab, #000 55%, transparent);
  backdrop-filter: blur(4px);
  display: flex; justify-content: flex-end;
  animation: fade .14s ease-out;
}
.drawer-box {
  width: min(560px, 100vw);
  height: 100%;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line-2);
  box-shadow: var(--shadow-lg);
  animation: slide .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }
.drawer-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-size: 16px; margin: 0; }
.drawer-origin { font-family: var(--mono); font-size: 11.5px; color: var(--fg-3); margin-left: auto; }
.drawer-body { padding: 18px; overflow-y: auto; display: grid; gap: 14px; align-content: start; }

.field { display: grid; gap: 6px; font-size: 12.5px; color: var(--fg-2); font-weight: 540; }
.field small { color: var(--fg-3); font-weight: 400; font-size: 11.5px; }
.field select { font-family: var(--sans); font-size: 13px; cursor: pointer; }
.c-actions { display: flex; align-items: center; gap: 14px; }
.c-meta { font-size: 12px; color: var(--fg-3); font-family: var(--mono); }

.c-result { border-radius: var(--r); border: 1px solid var(--line); overflow: hidden; }
.c-result-head {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 13px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--fg-3); font-family: var(--mono);
}
.c-status { font-weight: 700; }
.c-status.ok { color: var(--ok); }
.c-status.warn { color: var(--warn); }
.c-status.bad { color: var(--bad); }
.c-headers { display: flex; flex-wrap: wrap; gap: 6px; padding: 9px 13px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.c-headers span {
  font-family: var(--mono); font-size: 10.5px;
  padding: 2px 7px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--fg-3);
}
.c-history { display: grid; gap: 5px; }
.c-history button {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 7px;
  background: transparent; border: 1px solid var(--line);
  font-size: 12px; font-family: var(--mono); color: var(--fg-3);
  cursor: pointer; text-align: left;
  transition: border-color .13s, color .13s, background .13s;
}
.c-history button:hover { color: var(--fg-2); border-color: var(--line-2); background: var(--surface-2); }

/* --- responsivo ------------------------------------------------------------- */
@media (max-width: 1340px) {
  :root { --rail-w: 400px; --gutter: 28px; }
}
@media (max-width: 1180px) {
  .shell { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .rail { grid-column: 1 / -1; padding: 0 var(--gutter) 60px; }
  .rail-sticky { position: static; }
  .code-card { max-width: 68ch; }
  .content section { max-width: 72ch; }
}
@media (max-width: 900px) {
  :root { --gutter: 20px; }
  /* Rede de segurança: se alguma tabela ainda não couber, ela rola DENTRO da
     própria caixa — nunca a página. */
  .tbl { display: block; overflow-x: auto; }
  .tbl.params td:first-child { width: 38%; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: static; height: auto; max-height: none;
    padding: 18px var(--gutter);
    border-bottom: 1px solid var(--line);
  }
  .side-toggle {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; border-radius: var(--r-sm);
    background: var(--surface); border: 1px solid var(--line);
    color: var(--fg-2); font-size: 13.5px; font-weight: 540; cursor: pointer;
    transition: border-color .15s, color .15s;
  }
  .side-toggle:hover { color: var(--fg); border-color: var(--line-2); }
  .side-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .side-toggle-caret { margin-left: auto; transition: transform .18s; }
  .side.open .side-toggle-caret { transform: rotate(180deg); }
  .side-nav {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 18px;
    margin-top: 12px;
  }
  .side.open .side-nav { display: grid; }
  .search { display: none; }
  .top { padding: 0 var(--gutter); gap: 10px; }
  .brand-sub, .chip-version { display: none; }
  .status { display: none; }
  .drawer-box { width: 100vw; }
  h1 { font-size: 30px; }
  .log li { grid-template-columns: 1fr; gap: 4px; }
}

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

@media print {
  .top, .side, .rail, .progress, .bg, .foot, .skip { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; }
  .content section { max-width: none; page-break-inside: avoid; }
  body { color: #000; background: #fff; font-size: 11pt; }
}
