/* Documentação da API Payze — tema "Midnight Signal" (mesma paleta do painel). */

:root {
  --font-sans: 'Geist', 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --radius: 6px;
  --radius-sm: 4px;
  --topbar-h: 56px;
  --sidebar-w: 268px;
  --toc-w: 208px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  /* Marca */
  --primary: #2E7CF6;
  --primary-hover: #1E66DB;
  --accent: #5B9BFF;

  /* Tema claro */
  --bg: #FFFFFF;
  --bg-elev: #F8FAFC;
  --surface: #F8FAFC;
  --surface-2: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #0B1220;
  --text-2: #334155;
  --text-3: #64748B;
  --link: #1D64D8;
  --primary-soft: rgba(46, 124, 246, .10);
  --primary-text: #1D64D8;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 1px rgba(15, 23, 42, .04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .18);
  --scrim: rgba(15, 23, 42, .45);

  --success: #059669;
  --success-soft: rgba(16, 185, 129, .10);
  --warning: #B45309;
  --warning-soft: rgba(245, 158, 11, .12);
  --danger: #DC2626;
  --danger-soft: rgba(239, 68, 68, .09);
  --info: #0369A1;
  --info-soft: rgba(56, 189, 248, .12);
  --info-line: #38BDF8;
  --warning-line: #F59E0B;
  --danger-line: #EF4444;
  --success-line: #10B981;

  /* Blocos de código: escuros nos dois temas */
  --code-bg: #0B1220;
  --code-head: #0F1729;
  --code-border: #1B2433;
  --code-text: #D7DEEA;
  --code-muted: #7F8DA3;
  --inline-code-bg: #F1F5F9;
  --inline-code-border: #E2E8F0;

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0D14;
    --bg-elev: #0C1018;
    --surface: #111827;
    --surface-2: #161F31;
    --border: #1E2736;
    --border-strong: #2A3649;
    --text: #F1F5F9;
    --text-2: #A7B3C5;
    --text-3: #6B7A90;
    --link: #5B9BFF;
    --primary-soft: rgba(46, 124, 246, .14);
    --primary-text: #7AAEFF;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
    --scrim: rgba(0, 0, 0, .6);
    --success: #34D399;
    --success-soft: rgba(16, 185, 129, .12);
    --warning: #FBBF24;
    --warning-soft: rgba(245, 158, 11, .12);
    --danger: #F87171;
    --danger-soft: rgba(239, 68, 68, .12);
    --info: #7DD3FC;
    --info-soft: rgba(56, 189, 248, .10);
    --code-bg: #080B12;
    --code-head: #0D121C;
    --code-border: #1E2736;
    --inline-code-bg: #151D2C;
    --inline-code-border: #222D40;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0A0D14;
  --bg-elev: #0C1018;
  --surface: #111827;
  --surface-2: #161F31;
  --border: #1E2736;
  --border-strong: #2A3649;
  --text: #F1F5F9;
  --text-2: #A7B3C5;
  --text-3: #6B7A90;
  --link: #5B9BFF;
  --primary-soft: rgba(46, 124, 246, .14);
  --primary-text: #7AAEFF;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, .55);
  --scrim: rgba(0, 0, 0, .6);
  --success: #34D399;
  --success-soft: rgba(16, 185, 129, .12);
  --warning: #FBBF24;
  --warning-soft: rgba(245, 158, 11, .12);
  --danger: #F87171;
  --danger-soft: rgba(239, 68, 68, .12);
  --info: #7DD3FC;
  --info-soft: rgba(56, 189, 248, .10);
  --code-bg: #080B12;
  --code-head: #0D121C;
  --code-border: #1E2736;
  --inline-code-bg: #151D2C;
  --inline-code-border: #222D40;
  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: var(--radius-sm); }
button { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--border); margin: 32px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--topbar-h); z-index: 40;
  display: flex; align-items: center; gap: 12px; padding: 0 16px 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); min-width: 0; }
.brand:hover { text-decoration: none; }
.brand img { height: 24px; width: auto; display: block; }
.brand-divider { width: 1px; height: 18px; background: var(--border-strong); }
.brand-label { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; letter-spacing: -.005em; }
.logo-on-light { display: block; }
.logo-on-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-on-light { display: none !important; }
  :root:not([data-theme="light"]) .logo-on-dark { display: block !important; }
}
:root[data-theme="dark"] .logo-on-light { display: none !important; }
:root[data-theme="dark"] .logo-on-dark { display: block !important; }

.topbar-spacer { flex: 1; }
.api-host {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-3);
  border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius);
  border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-btn { display: none; }
.theme-btn .i-sun { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }

/* ── Sidebar ──────────────────────────────────────────── */
.sidebar {
  position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); z-index: 30;
  overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 12px 32px;
  background: var(--bg);
  border-right: 1px solid var(--border);
}
.search { position: relative; margin: 0 4px 14px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.search input {
  width: 100%; height: 34px; padding: 0 34px 0 32px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13.5px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.search input:not(:placeholder-shown) + kbd { display: none; }
.search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.search kbd {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  font-family: var(--font-mono); font-size: 11px; color: var(--text-3);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 0 5px; line-height: 18px; background: var(--bg);
}
.nav-group { margin-bottom: 14px; }
.nav-group-title {
  margin: 0 0 4px; padding: 0 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3);
}
.nav-link {
  position: relative; display: flex; align-items: center; gap: 8px;
  min-height: 32px; padding: 5px 10px; border-radius: var(--radius);
  color: var(--text-2); font-size: 14px; line-height: 1.3;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.nav-link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav-link[aria-current="page"] { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.nav-link[aria-current="page"]::before {
  content: ''; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--primary);
}
.nav-link .verb { margin-left: auto; }
.nav-link[hidden], .nav-group[hidden] { display: none; }
.nav-empty { display: none; padding: 8px 10px; color: var(--text-3); font-size: 13.5px; }
.nav-empty.show { display: block; }
.scrim { display: none; }

/* ── Layout principal ────────────────────────────────── */
.main { margin-left: var(--sidebar-w); padding-top: var(--topbar-h); min-width: 0; }
.wrap { display: flex; gap: 48px; max-width: calc(780px + var(--toc-w) + 48px + 96px); padding: 40px 48px 72px; }
.content { flex: 1; min-width: 0; max-width: 780px; }
.toc { width: var(--toc-w); flex-shrink: 0; position: sticky; top: calc(var(--topbar-h) + 32px); align-self: flex-start; max-height: calc(100vh - var(--topbar-h) - 64px); overflow-y: auto; }
.toc-title { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); margin: 0 0 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--text-3); font-size: 13px; line-height: 1.35; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--text); border-left-color: var(--primary); }

/* ── Páginas ──────────────────────────────────────────── */
.page[hidden] { display: none; }
.eyebrow { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
h1, h2, h3, h4 { color: var(--text); letter-spacing: -.015em; }
h1 { font-size: 32px; line-height: 1.15; font-weight: 800; margin: 0 0 12px; letter-spacing: -.025em; }
h2 { font-size: 21px; line-height: 1.3; font-weight: 700; margin: 44px 0 12px; padding-top: 4px; }
h3 { font-size: 16.5px; line-height: 1.35; font-weight: 700; margin: 28px 0 10px; }
h2 .anchor, h3 .anchor { margin-left: 8px; color: var(--text-3); opacity: 0; font-weight: 500; transition: opacity .15s var(--ease); }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; text-decoration: none; }
p { margin: 0 0 14px; color: var(--text-2); }
.lede { font-size: 17px; line-height: 1.55; color: var(--text-2); margin: 0 0 20px; }
strong { color: var(--text); font-weight: 650; }
ul.list, ol.list { margin: 0 0 16px; padding-left: 22px; color: var(--text-2); }
ul.list li, ol.list li { margin: 6px 0; padding-left: 2px; }
ul.list li::marker { color: var(--text-3); }
ol.list li::marker { color: var(--text-3); font-weight: 600; }
p, li, td { overflow-wrap: break-word; }

code {
  font-family: var(--font-mono); font-size: .86em;
  background: var(--inline-code-bg); border: 1px solid var(--inline-code-border);
  border-radius: var(--radius-sm); padding: .08em .38em; color: var(--text);
  overflow-wrap: anywhere;
}
a code { color: inherit; }
pre code { background: none; border: 0; padding: 0; font-size: inherit; color: inherit; overflow-wrap: normal; }

/* Endpoint */
.endpoint {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px;
  margin: 4px 0 22px; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.endpoint .path { font-family: var(--font-mono); font-size: 14px; color: var(--text); word-break: break-all; }
.endpoint .auth { margin-left: auto; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.verb {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 6px; border-radius: var(--radius-sm); line-height: 1.4;
}
.verb.post { color: var(--primary-text); background: var(--primary-soft); }
.verb.get { color: var(--success); background: var(--success-soft); }

/* Chips de método */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 22px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-2); padding: 3px 10px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.chip b { font-family: var(--font-mono); font-weight: 600; color: var(--text); font-size: 12px; }

/* Botões */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: var(--radius); font-size: 14px; font-weight: 600; cursor: pointer;
  border: 1px solid var(--border-strong); color: var(--text); background: transparent;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn svg { width: 16px; height: 16px; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 8px 0 22px; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card {
  display: block; padding: 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  color: var(--text-2); transition: border-color .15s var(--ease), transform .15s var(--ease);
}
a.card:hover { text-decoration: none; border-color: var(--border-strong); transform: translateY(-1px); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.card .country { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .06em; }
.card .cur { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: 999px; padding: 1px 8px; }
.card h4 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.card p { margin: 0; font-size: 13.5px; line-height: 1.5; }

/* Fluxo (passos horizontais) */
.flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 8px 0 24px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.flow > div { padding: 14px 16px; background: var(--surface); }
.flow > div + div { border-left: 1px solid var(--border); }
.flow .n { font-family: var(--font-mono); font-size: 12px; color: var(--primary-text); font-weight: 700; }
.flow b { display: block; color: var(--text); font-size: 14px; margin: 2px 0 4px; }
.flow span { font-size: 13px; color: var(--text-2); line-height: 1.45; display: block; }

/* Passos numerados */
.steps { list-style: none; margin: 8px 0 24px; padding: 0; counter-reset: step; }
.steps > li { position: relative; padding: 0 0 22px 44px; counter-increment: step; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--primary-text);
  background: var(--primary-soft); border: 1px solid color-mix(in srgb, var(--primary) 35%, transparent);
}
.steps > li::after { content: ''; position: absolute; left: 13.5px; top: 32px; bottom: 4px; width: 1px; background: var(--border); }
.steps > li:last-child::after { display: none; }
.steps > li > h3 { margin: 2px 0 6px; font-size: 16px; }

/* Avisos */
.callout {
  display: flex; gap: 12px; margin: 18px 0; padding: 12px 14px;
  border-radius: var(--radius); border: 1px solid var(--border); border-left: 3px solid var(--info-line);
  background: var(--info-soft);
}
.callout svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: var(--info); }
.callout .c-body { min-width: 0; }
.callout .c-title { display: block; font-weight: 700; color: var(--text); font-size: 14px; margin-bottom: 2px; }
.callout p, .callout li { font-size: 14px; margin: 0; color: var(--text-2); }
.callout p + p { margin-top: 6px; }
.callout ul { margin: 4px 0 0; padding-left: 18px; }
.callout.warn { border-left-color: var(--warning-line); background: var(--warning-soft); }
.callout.warn svg { color: var(--warning); }
.callout.danger { border-left-color: var(--danger-line); background: var(--danger-soft); }
.callout.danger svg { color: var(--danger); }
.callout.ok { border-left-color: var(--success-line); background: var(--success-soft); }
.callout.ok svg { color: var(--success); }

/* Tabelas */
.table-wrap { margin: 10px 0 22px; border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--border); }
th { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); background: var(--surface); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td { color: var(--text-2); line-height: 1.5; }
td:first-child { color: var(--text); }
td.nowrap, th.nowrap { white-space: nowrap; }
td code { font-size: 12.5px; }
td.field code { color: var(--text); font-weight: 600; background: transparent; border: 0; padding: 0; font-size: 13px; overflow-wrap: normal; white-space: nowrap; }
td.field .sub { display: block; font-size: 12px; color: var(--text-3); font-family: var(--font-mono); margin-top: 2px; }
.type { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-3); white-space: nowrap; }
.req, .opt, .cond {
  display: inline-block; font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
}
.req { color: var(--danger); background: var(--danger-soft); }
.cond { color: var(--warning); background: var(--warning-soft); }
.opt { color: var(--text-3); border: 1px solid var(--border); font-weight: 600; }
.yes { color: var(--success); font-weight: 600; }
.no { color: var(--text-3); }
.status-pill { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; color: var(--text); white-space: nowrap; }

/* Blocos de código */
.code-block {
  margin: 12px 0 22px; border-radius: var(--radius); overflow: hidden;
  background: var(--code-bg); border: 1px solid var(--code-border);
}
.code-head {
  display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 6px 0 4px;
  background: var(--code-head); border-bottom: 1px solid var(--code-border);
}
.code-title { padding: 0 8px; font-size: 12.5px; font-weight: 600; color: var(--code-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.code-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.code-tabs::-webkit-scrollbar { display: none; }
.code-tab {
  height: 40px; padding: 0 10px; border: 0; background: transparent; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--code-muted); white-space: nowrap;
  border-bottom: 2px solid transparent; transition: color .15s var(--ease), border-color .15s var(--ease);
}
.code-tab:hover { color: #E6ECF5; }
.code-tab[aria-selected="true"] { color: #F1F5F9; border-bottom-color: var(--primary); }
.copy-btn {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--code-muted); white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.copy-btn:hover { background: rgba(255, 255, 255, .06); color: #E6ECF5; }
.copy-btn.copied { color: #34D399; }
.copy-btn svg { width: 14px; height: 14px; }
pre {
  margin: 0; padding: 14px 16px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  font-family: var(--font-mono); font-size: 13px; line-height: 1.65; color: var(--code-text);
  tab-size: 2;
}
pre[hidden] { display: none; }
.t-com { color: #6E7D93; font-style: italic; }
.t-str { color: #A6E3C7; }
.t-key { color: #8AB4FF; }
.t-num { color: #F9C97C; }
.t-kw { color: #C4A7FF; }
.t-fn { color: #7DD3FC; }
.t-var { color: #F5A9B8; }
.t-tag { color: #8AB4FF; }
.t-attr { color: #C4A7FF; }
.t-prop { color: #8AB4FF; }
.t-const { color: #F9C97C; }
.t-punct { color: #8A97AB; }

/* Checklist */
.checklist { list-style: none; margin: 8px 0 22px; padding: 0; }
.checklist li { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); color: var(--text-2); font-size: 14.5px; }
.checklist li:last-child { border-bottom: 0; }
.checklist svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 2px; color: var(--success); }

/* Ciclo de vida */
.lifecycle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 22px; padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.lifecycle .st { font-family: var(--font-mono); font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.lifecycle .st.ok { color: var(--success); border-color: color-mix(in srgb, var(--success) 35%, transparent); background: var(--success-soft); }
.lifecycle .st.bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); background: var(--danger-soft); }
.lifecycle .arw { color: var(--text-3); font-size: 13px; }
.lifecycle .sep { flex-basis: 100%; height: 0; }

/* Anterior / Próximo */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.pager a:hover { text-decoration: none; border-color: var(--border-strong); background: var(--surface); }
.pager .dir { font-size: 12px; color: var(--text-3); }
.pager .ttl { font-weight: 650; font-size: 14.5px; }
.pager .next { grid-column: 2; text-align: right; }
.footer { margin-top: 40px; font-size: 12.5px; color: var(--text-3); }

/* ── Responsivo ───────────────────────────────────────── */
@media (max-width: 1279px) {
  .toc { display: none; }
  .wrap { max-width: calc(780px + 96px); }
}
@media (max-width: 960px) {
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 10px; }
  .api-host { display: none; }
  .sidebar {
    top: 0; width: min(300px, 86vw); padding-top: 16px; z-index: 60;
    transform: translateX(-100%); visibility: hidden;
    transition: transform .2s var(--ease), visibility 0s linear .2s;
  }
  body.nav-open .sidebar {
    transform: none; visibility: visible; box-shadow: var(--shadow-lg);
    transition: transform .2s var(--ease), visibility 0s;
  }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: var(--scrim); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }
  .main { margin-left: 0; }
  .wrap { padding: 28px 16px 56px; }
  .sidebar-brand { display: flex !important; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  h1 { font-size: 26px; }
  h2 { font-size: 19px; margin-top: 36px; }
  .lede { font-size: 16px; }
  .brand-divider, .brand-label { display: none; }
  .cards, .cards.two, .flow { grid-template-columns: minmax(0, 1fr); }
  .flow > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager .next { grid-column: 1; }
  .endpoint .auth { margin-left: 0; }
  pre { font-size: 12.5px; padding: 12px 14px; }

  /* Tabelas empilhadas: uma linha vira um bloco, cada coluna com o rótulo do cabeçalho */
  .table-wrap { overflow-x: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { padding: 10px 12px; border-bottom: 1px solid var(--border); }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { border: 0; padding: 0; }
  .table-wrap td:first-child { padding-bottom: 4px; }
  .table-wrap td + td { margin-top: 4px; }
  .table-wrap td:not(:first-child)[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 1px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3);
  }
  .table-wrap td.type,
  .table-wrap td:has(> .req:only-child), .table-wrap td:has(> .opt:only-child), .table-wrap td:has(> .cond:only-child) {
    display: inline-block; width: auto; margin: 0 8px 0 0; vertical-align: middle;
  }
  .table-wrap td.type:not(:first-child)[data-label]::before,
  .table-wrap td:not(:first-child)[data-label]:has(> .req:only-child)::before,
  .table-wrap td:not(:first-child)[data-label]:has(> .opt:only-child)::before,
  .table-wrap td:not(:first-child)[data-label]:has(> .cond:only-child)::before { display: none; }
  td.field code { white-space: normal; overflow-wrap: anywhere; }
}
.sidebar-brand { display: none; align-items: center; justify-content: space-between; margin: 0 4px 14px; }
.sidebar-brand img { height: 22px; width: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
