/* Documentacao da API da Assinex (/docs).
   Mesmas cores e fonte do painel; tema escuro por padrao, claro opcional
   (data-theme no <html>, definido por /s/theme.js). Codigo sempre em fundo
   escuro, nos dois temas. */

@font-face { font-family: "Plex"; src: url("../fonts/plex-sans-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/plex-sans-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex"; src: url("../fonts/plex-sans-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  color-scheme: dark;
  --bg: #0d1219;
  --bg-2: #111821;
  --surface: #141b25;
  --raised: #1a2230;
  --line: #232d3b;
  --line-soft: #1b2430;
  --text: #e6ebf2;
  --text-2: #b4becd;
  --muted: #808ca0;
  --accent: #3aa8e8;
  --accent-strong: #62bdf0;
  --accent-ink: #04121c;
  --accent-soft: rgba(58, 168, 232, 0.12);
  --ok: #2fb67f;
  --ok-soft: rgba(47, 182, 127, 0.14);
  --warn: #e3b341;
  --warn-soft: rgba(227, 179, 65, 0.1);
  --danger: #f06a6e;
  --danger-soft: rgba(229, 72, 77, 0.14);
  --info-soft: rgba(58, 168, 232, 0.08);
  --code-bg: #0a0f15;
  --code-bar: #0f151d;
  --code-line: #1e2836;
  --code-text: #d8e0eb;
  --code-muted: #7d8a9d;
  --inline-code: #1a2330;
  --overlay: rgba(4, 7, 12, 0.66);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
  --logo-filter: none;
  --header-bg: rgba(13, 18, 25, 0.82);
  --mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: "Plex", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --top: 60px;
  --side-w: 268px;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-2: #f6f8fb;
  --surface: #ffffff;
  --raised: #f3f6f9;
  --line: #e2e7ee;
  --line-soft: #edf1f5;
  --text: #111722;
  --text-2: #3a4556;
  --muted: #647083;
  --accent: #0a7fc2;
  --accent-strong: #06679e;
  --accent-ink: #ffffff;
  --accent-soft: rgba(10, 127, 194, 0.09);
  --ok: #1a8a58;
  --ok-soft: rgba(26, 138, 88, 0.1);
  --warn: #9a7200;
  --warn-soft: rgba(185, 137, 0, 0.09);
  --danger: #c4303d;
  --danger-soft: rgba(208, 48, 63, 0.08);
  --info-soft: rgba(10, 127, 194, 0.06);
  --code-bg: #0f151d;
  --code-bar: #151c26;
  --code-line: #232d3b;
  --inline-code: #eef2f6;
  --overlay: rgba(17, 23, 34, 0.4);
  --shadow: 0 24px 60px rgba(17, 23, 34, 0.18), 0 2px 8px rgba(17, 23, 34, 0.08);
  --logo-filter: invert(1) hue-rotate(180deg) saturate(1.4) brightness(0.85);
  --header-bg: rgba(255, 255, 255, 0.95);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 20px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15.5px/1.7 var(--sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, kbd, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 18px; height: 18px; flex: none; }
.li { width: 16px; height: 16px; flex: none; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 50; padding: 10px 14px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.skip:focus { top: 12px; text-decoration: none; }
[hidden] { display: none !important; }

/* ---------- Botoes ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 9px; border: 1px solid transparent; background: none; color: var(--text); font: 500 14px/1 var(--sans); cursor: pointer; white-space: nowrap; text-decoration: none; transition: background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s; }
.btn:hover { text-decoration: none; }
.btn .ic { width: 16px; height: 16px; }
.btn-primary, .btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover, .btn.primary:hover { background: var(--accent-strong); }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 9px; background: none; color: var(--text-2); cursor: pointer; transition: background-color 0.15s, color 0.15s; }
.icon-btn:hover { background: var(--raised); color: var(--text); }

/* ---------- Cabecalho ---------- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; height: var(--top); padding: 0 20px; background: var(--header-bg); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; }
.brand img { display: block; width: 96px; height: auto; filter: var(--logo-filter); }
.brand-tag { display: inline-flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14.5px; }
.brand-tag:hover { text-decoration: none; color: var(--accent); }
.brand-tag span { padding: 2px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font: 600 11px/1.5 var(--mono); }
.top-nav { display: flex; gap: 2px; margin-left: 10px; }
.top-nav a { padding: 7px 11px; border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.top-nav a:hover { color: var(--text); background: var(--raised); text-decoration: none; }
.top-nav a[aria-current="true"] { color: var(--text); }
.top-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.search-btn { display: flex; align-items: center; gap: 10px; width: 260px; height: 38px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); color: var(--muted); font: 400 14px/1 var(--sans); cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.search-btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--text-2); }
.search-btn .ic { width: 16px; height: 16px; }
.search-btn-label { flex: 1; text-align: left; }
kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface); color: var(--text-2); font: 500 11.5px/1.5 var(--mono); }
.top-auth { display: flex; align-items: center; gap: 6px; }
.top-auth a:not(.btn) { padding: 8px 10px; border-radius: 8px; color: var(--text); font-size: 14px; font-weight: 500; }
.top-auth a:not(.btn):hover { background: var(--raised); text-decoration: none; }
.top-auth .who { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-auth .btn { min-height: 36px; padding: 0 14px; }
.menu-btn { display: none; margin-left: -6px; }
[data-theme-toggle] .ic-sun { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .ic-sun { display: block; }
:root[data-theme="dark"] [data-theme-toggle] .ic-moon { display: none; }

/* ---------- Estrutura ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: calc(100vh - var(--top)); }
.side { position: sticky; top: var(--top); align-self: start; display: flex; flex-direction: column; height: calc(100vh - var(--top)); border-right: 1px solid var(--line); background: var(--bg); }
.nav { flex: 1; overflow-y: auto; padding: 22px 14px 24px 18px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav-group + .nav-group { margin-top: 22px; }
.nav-title { display: block; margin: 0 0 6px 10px; color: var(--text); font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; }
.nav .nav-title a { display: inline; min-height: 0; padding: 0; color: inherit; font-size: inherit; }
.nav .nav-title a:hover { background: none; color: var(--accent); }
.nav a { position: relative; display: flex; align-items: center; gap: 9px; min-height: 32px; padding: 5px 10px; border-radius: 7px; color: var(--text-2); font-size: 14px; line-height: 1.35; transition: background-color 0.12s, color 0.12s; }
.nav a:hover { background: var(--raised); color: var(--text); text-decoration: none; }
.nav a[aria-current="location"] { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.nav a[aria-current="location"]::before { content: ""; position: absolute; left: -8px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--accent); }
.nav-sub { margin: 8px 0 4px; }
.nav-sub-title { display: block; margin: 0 0 2px 10px; color: var(--muted); font-size: 12px; }
.nav-ep .verb { min-width: 40px; text-align: center; font-size: 10px; padding: 1px 0; }
.side-foot { display: grid; gap: 2px; padding: 12px 14px 16px 18px; border-top: 1px solid var(--line); }
.side-foot a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 7px; color: var(--muted); font-size: 13.5px; }
.side-foot a:hover { color: var(--text); background: var(--raised); text-decoration: none; }
.side-foot .ic { width: 15px; height: 15px; }
.scrim { display: none; }

.doc { min-width: 0; padding: 8px clamp(20px, 4vw, 56px) 80px; }
.doc:focus { outline: none; }
.doc > section, .doc > .ref-head { max-width: 1240px; margin: 0 auto; padding: 56px 0 8px; scroll-margin-top: calc(var(--top) + 8px); }
.doc > section + section, .doc > .ref-head { border-top: 1px solid var(--line-soft); }
.prose > * { max-width: 760px; }
.prose > .table, .prose > .cg, .prose > .pg { max-width: 860px; }

/* ---------- Tipografia ---------- */
h1, h2, h3, h4 { color: var(--text); font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h1 { margin: 6px 0 0; font-size: clamp(32px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.03em; }
h2 { position: relative; margin: 0 0 14px; font-size: 26px; line-height: 1.25; }
.h-xl { font-size: 32px; letter-spacing: -0.025em; }
.h-sub { margin-top: 44px; font-size: 19px; }
h3 { margin: 30px 0 10px; font-size: 16.5px; line-height: 1.35; display: flex; align-items: center; gap: 10px; }
h4 { margin: 0 0 8px; font-size: 15px; }
p { margin: 0 0 14px; color: var(--text-2); }
ul, ol { color: var(--text-2); padding-left: 22px; margin: 0 0 14px; }
li { margin: 6px 0; }
li::marker { color: var(--muted); }
strong { color: var(--text); font-weight: 600; }
em { font-style: normal; color: var(--text); }
:not(pre) > code { padding: 2px 6px; border-radius: 5px; background: var(--inline-code); color: var(--text); font-size: 0.86em; overflow-wrap: anywhere; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font-size: 12.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.lead { margin-top: 16px; font-size: 18px; line-height: 1.65; color: var(--text-2); max-width: 680px; }
.muted-note { color: var(--muted); font-size: 14px; }
.anchor { position: absolute; left: -26px; top: 0; padding-right: 8px; color: var(--muted); font-weight: 400; opacity: 0; transition: opacity 0.15s; }
h2:hover .anchor, .anchor:focus-visible { opacity: 1; text-decoration: none; }

/* ---------- Visao geral ---------- */
.hero { padding-top: 48px !important; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 30px 0 0; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); max-width: 860px !important; }
.fact { display: grid; gap: 4px; padding: 14px 18px; min-width: 0; }
.fact + .fact { border-left: 1px solid var(--line); }
.fact-k { color: var(--muted); font-size: 12.5px; }
.fact-v { color: var(--text); font-size: 13.5px; overflow-wrap: anywhere; }
code.fact-v { padding: 0 !important; background: none !important; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; max-width: 860px !important; }
.card { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px; align-items: start; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text-2); font-size: 14px; line-height: 1.5; transition: border-color 0.15s, transform 0.15s, background-color 0.15s; }
.card .ic { grid-row: span 2; width: 34px; height: 34px; padding: 8px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); }
.card strong { font-size: 15px; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); text-decoration: none; }
@media (prefers-reduced-motion: no-preference) { .card:hover { transform: translateY(-1px); } }
.flow { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; counter-reset: none; max-width: 860px !important; }
.flow li { position: relative; display: flex; gap: 12px; margin: 0; padding: 0 16px 0 0; }
.flow li + li::before { content: ""; position: absolute; left: -12px; top: 15px; width: 8px; height: 8px; border-top: 2px solid var(--line); border-right: 2px solid var(--line); transform: rotate(45deg); }
.flow-n { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); color: var(--accent); font: 600 13px/1 var(--mono); }
.flow strong { display: block; font-size: 14.5px; margin-top: 3px; }
.flow p { margin: 2px 0 0; font-size: 13.5px; line-height: 1.5; }

.steps { list-style: none; padding: 0; counter-reset: step; }
.steps > li { position: relative; margin: 0; padding: 0 0 18px 46px; counter-increment: step; }
.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--raised); border: 1px solid var(--line); color: var(--text); font: 600 13px/1 var(--mono); }
.steps > li::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 6px; width: 1px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps h3 { margin: 3px 0 8px; }
.next { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 8px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.next span { color: var(--muted); font-size: 13px; margin-right: 4px; }
.next a { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; }
.next .ic { width: 15px; height: 15px; }
.checks { list-style: none; padding: 0; }
.checks li { position: relative; padding-left: 28px; }
.checks li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 14px; height: 14px; border-radius: 50%; background: var(--ok-soft); box-shadow: inset 0 0 0 1.5px var(--ok); }
.checks li::after { content: ""; position: absolute; left: 7px; top: 10px; width: 3px; height: 6px; border: solid var(--ok); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }

/* ---------- Avisos ---------- */
.callout { display: flex; gap: 12px; align-items: flex-start; margin: 18px 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); }
.callout p { margin: 0; font-size: 14.5px; }
.callout .ic { margin-top: 3px; }
.callout-info { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--info-soft); }
.callout-info .ic { color: var(--accent); }
.callout-warn { border-color: color-mix(in srgb, var(--warn) 38%, var(--line)); background: var(--warn-soft); }
.callout-warn .ic { color: var(--warn); }

/* ---------- Tabelas e parametros ---------- */
.table { margin: 16px 0 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 10px 16px; text-align: left; white-space: nowrap; color: var(--muted); font-size: 12.5px; font-weight: 600; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.table td { padding: 11px 16px; vertical-align: top; color: var(--text-2); border-top: 1px solid var(--line-soft); line-height: 1.55; }
.table tr:first-child td { border-top: 0; }
.table td:first-child { white-space: nowrap; }
.ep-index td:first-child a { font-weight: 500; }
.params { margin: 0 0 8px; border-top: 1px solid var(--line-soft); }
.param { padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.param dt { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 4px; }
.param dt code { padding: 0 !important; background: none !important; color: var(--text); font-size: 13.5px; font-weight: 600; }
.ptype { color: var(--muted); font-size: 12.5px; }
.preq { color: var(--danger); font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; }
.popt { color: var(--muted); font-size: 11.5px; }
.param dd { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.6; }
.penum { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; color: var(--muted); font-size: 13px; }

/* ---------- Metodos e status ---------- */
.verb { display: inline-block; padding: 2px 7px; border-radius: 5px; font: 700 11px/1.6 var(--mono); letter-spacing: 0.03em; }
.verb-get { background: var(--ok-soft); color: var(--ok); }
.verb-post { background: var(--accent-soft); color: var(--accent); }
.status { display: inline-block; padding: 1px 7px; border-radius: 999px; font: 600 12px/1.6 var(--mono); }
.status-ok { background: var(--ok-soft); color: var(--ok); }
.status-warn { background: var(--warn-soft); color: var(--warn); }
.status-err { background: var(--danger-soft); color: var(--danger); }
.status-info { background: var(--accent-soft); color: var(--accent); }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-ok { background: var(--ok); }
.dot-warn { background: var(--warn); }
.dot-err { background: var(--danger); }

/* ---------- Endpoint ---------- */
.ref-head { padding-bottom: 24px !important; }
.ep { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 56px; align-items: start; }
.ep-text { min-width: 0; }
.ep-code { position: sticky; top: calc(var(--top) + 20px); display: grid; gap: 14px; min-width: 0; max-height: calc(100vh - var(--top) - 40px); }
.ep-code .cg-request pre { max-height: 46vh; }
.ep-code .cg-response pre { max-height: 34vh; }
.route { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; padding: 8px 8px 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-2); }
.route code { flex: 1; min-width: 0; padding: 0 !important; background: none !important; color: var(--text); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.route-base { color: var(--muted); font-weight: 400; }
.ep-param { color: var(--warn); }
.route-copy { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; }
.route-copy:hover { background: var(--raised); color: var(--text); }
.route-copy .ic { width: 15px; height: 15px; }
.ep-summary { color: var(--text); font-size: 16.5px; }
.try { margin-top: 18px; }

/* ---------- Blocos de codigo ---------- */
.cg { container-type: inline-size; position: relative; margin: 16px 0; border: 1px solid var(--code-line); border-radius: 12px; background: var(--code-bg); overflow: hidden; color-scheme: dark; }
.ep-code .cg { margin: 0; }
.cg-bar { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 6px 0 14px; border-bottom: 1px solid var(--code-line); background: var(--code-bar); }
.cg-title { flex: none; color: var(--code-muted); font-size: 12.5px; font-weight: 500; }
.cg-tabs { display: flex; gap: 2px; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; padding: 6px 0; }
.cg-title + .cg-tabs { padding-left: 8px; margin-left: 2px; border-left: 1px solid var(--code-line); }
.cg-tabs::-webkit-scrollbar { display: none; }
.cg-tab { display: inline-flex; align-items: center; gap: 7px; flex: none; min-height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--code-muted); font: 500 13px/1 var(--sans); cursor: pointer; transition: background-color 0.12s, color 0.12s; }
.cg-tab:hover { color: var(--code-text); background: rgba(255, 255, 255, 0.04); }
.cg-tab[aria-selected="true"] { color: #fff; background: rgba(255, 255, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.cg-tab .li { opacity: 0.8; filter: saturate(0.6); transition: opacity 0.12s, filter 0.12s; }
.cg-tab:hover .li, .cg-tab[aria-selected="true"] .li { opacity: 1; filter: none; }
.cg-copy { display: inline-flex; align-items: center; gap: 6px; flex: none; margin-left: auto; height: 30px; padding: 0 10px; border: 0; border-radius: 7px; background: none; color: var(--code-muted); font: 500 12.5px/1 var(--sans); cursor: pointer; transition: background-color 0.12s, color 0.12s; }
.cg-copy:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.cg-copy .ic { width: 15px; height: 15px; }
.cg-copy.copied { color: #5ee0a0; }
.cg-panel { display: none; }
.cg-panel.on { display: block; }
.cg pre { margin: 0; padding: 16px 18px 18px; overflow: auto; color: var(--code-text); font-size: 13px; line-height: 1.65; tab-size: 2; scrollbar-width: thin; scrollbar-color: #2a3546 transparent; }
.cg pre:focus-visible { outline-offset: -3px; }
.cg-wrap pre { white-space: pre-wrap; overflow-wrap: anywhere; }
@container (max-width: 560px) {
  .cg-request .cg-tab .cg-tab-label { display: none; }
  .cg-request .cg-tab[aria-selected="true"] .cg-tab-label { display: inline; }
  .cg-request .cg-tab { padding: 0 8px; }
}
@container (max-width: 380px) {
  .cg-copy span { display: none; }
  .cg-title { display: none; }
  .cg-title + .cg-tabs { border-left: 0; padding-left: 0; margin-left: 0; }
}

/* Destaque de sintaxe (fundo escuro nos dois temas) */
.t-com { color: #6f7d90; font-style: italic; }
.t-str { color: #93d8a5; }
.t-num { color: #f6b878; }
.t-kw { color: #c9a2ff; }
.t-lit { color: #ff9a8f; }
.t-prop { color: #7fc8ff; }
.t-fn { color: #ffd97a; }
.t-var { color: #ffa982; }
.t-flag { color: #a4b6ff; }
.t-con { color: #f6b878; }
.t-type { color: #70d6cf; }

/* ---------- IA ---------- */
.ai-prompt { margin: 20px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; max-width: 860px !important; }
.ai-prompt-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.ai-prompt-head strong { display: block; }
.ai-prompt-head span { color: var(--muted); font-size: 13.5px; }
.ai-preview { margin: 0; max-height: 240px; overflow: auto; padding: 14px 16px; color: var(--text-2); font-size: 12.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.tools { margin-top: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; max-width: 860px !important; }
.tool-tabs { display: flex; gap: 2px; padding: 6px; overflow-x: auto; background: var(--bg-2); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.tool-tabs button { flex: none; min-height: 34px; padding: 0 12px; border: 0; border-radius: 7px; background: none; color: var(--text-2); font: 500 14px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.tool-tabs button:hover { color: var(--text); background: var(--raised); }
.tool-tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.tool-panel { padding: 16px 20px 18px; }
.tool-panel h4 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tool-panel ol { margin: 0; }

/* ---------- Playground ---------- */
.pg-section > .pg { max-width: none !important; }
.pg { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.pg-form { display: grid; gap: 18px; align-content: start; padding: 22px; min-width: 0; }
.pg-field { display: grid; gap: 7px; min-width: 0; }
.pg-field > label, .pg-group legend { color: var(--text); font-size: 13.5px; font-weight: 600; }
.pg select, .pg input[type="text"], .pg input[type="password"], .pg textarea { width: 100%; min-height: 42px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-2); color: var(--text); font: 400 14px/1.4 var(--sans); transition: border-color 0.15s, box-shadow 0.15s; }
.pg select { appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; }
.pg input:focus, .pg select:focus, .pg textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pg textarea { min-height: 150px; font: 13px/1.6 var(--mono); resize: vertical; tab-size: 2; }
.pg textarea.invalid, .pg input.invalid { border-color: var(--danger); }
.pg-field-mono input { font-family: var(--mono); font-size: 13.5px; }
.pg-route { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; background: var(--code-bg); border: 1px solid var(--code-line); }
.pg-route code { min-width: 0; padding: 0 !important; background: none !important; color: var(--code-text) !important; font-size: 13px; overflow-wrap: anywhere; }
.pg-secret { position: relative; display: flex; align-items: center; }
.pg-secret > .ic { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.pg-secret input { padding-left: 38px !important; padding-right: 46px !important; font-family: var(--mono) !important; font-size: 13.5px !important; line-height: 1.7 !important; }
.pg-secret .icon-btn { position: absolute; right: 3px; width: 36px; height: 36px; }
.pg-hint { margin: 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.linkish { display: inline-flex; align-items: center; min-height: 30px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.pg-error { margin: 0; min-height: 0; color: var(--danger); font-size: 13px; }
.pg-error:empty { display: none; }
.pg-group { display: grid; gap: 12px; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.pg-group legend { padding: 0 6px; }
.pg-param { display: grid; gap: 5px; }
.pg-param label { display: flex; align-items: baseline; gap: 8px; color: var(--text-2); font: 600 13px/1.4 var(--mono); }
.pg-param label span { color: var(--muted); font: 400 12px/1.4 var(--sans); }
.pg-headers { border: 1px solid var(--line); border-radius: 10px; }
.pg-headers summary { padding: 10px 14px; color: var(--text-2); font-size: 13.5px; font-weight: 500; cursor: pointer; }
.pg-headers summary:hover { color: var(--text); }
.pg-headers [data-pg-headers] { padding: 0 14px 12px; display: grid; gap: 6px; }
.pg-header { display: flex; flex-wrap: wrap; gap: 4px 10px; font: 12.5px/1.5 var(--mono); }
.pg-header b { color: var(--text); font-weight: 600; }
.pg-header span { color: var(--muted); overflow-wrap: anywhere; }
.pg-confirm { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--warn) 40%, var(--line)); border-radius: 10px; background: var(--warn-soft); color: var(--text-2); font-size: 14px; line-height: 1.5; cursor: pointer; }
.pg-confirm input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.pg-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pg-actions .btn-primary { min-width: 190px; }
.btn.loading .ic { animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pg-result { display: flex; flex-direction: column; min-width: 0; min-height: 420px; border-left: 1px solid var(--code-line); background: var(--code-bg); color-scheme: dark; }
.pg-result-head { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--code-line); background: var(--code-bar); }
.pg-result-title { color: var(--code-muted); font-size: 12.5px; font-weight: 500; }
.pg-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; color: var(--code-muted); font: 12.5px/1.4 var(--mono); }
.pg-meta .status { font-size: 12px; }
.pg-note { margin: 12px 14px 0; padding: 10px 12px; border-radius: 9px; border: 1px solid #2a3546; background: #111924; color: #c3ccd9; font-size: 13.5px; line-height: 1.55; }
.pg-note.warn { border-color: rgba(227, 179, 65, 0.4); background: rgba(227, 179, 65, 0.08); }
.pg-note.err { border-color: rgba(240, 106, 110, 0.4); background: rgba(240, 106, 110, 0.08); }
.pg-note strong { color: #fff; }
.pg-note code { background: rgba(255, 255, 255, 0.08) !important; color: #e6ebf2 !important; }
.pg-note a { color: #62bdf0; }
.pg-note pre { margin: 8px 0 0; padding: 10px 12px; border-radius: 7px; background: #0a0f15; overflow: auto; font-size: 12.5px; line-height: 1.55; }
.pg-output { flex: 1; margin: 0; padding: 16px 18px 20px; overflow: auto; color: var(--code-text); font-size: 13px; line-height: 1.65; max-height: 640px; }
.pg-empty { color: var(--code-muted); font-family: var(--sans); }
.pg-nojs { display: none; }

/* ---------- Busca ---------- */
.search { width: min(640px, calc(100vw - 24px)); max-height: min(560px, calc(100vh - 120px)); margin: 10vh auto auto; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); overflow: hidden; }
.search::backdrop { background: var(--overlay); backdrop-filter: blur(2px); }
.search[open] { display: flex; }
@media (prefers-reduced-motion: no-preference) { .search[open] { animation: pop 0.14s ease-out; } }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(0.99); } }
.search-box { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.search-field > .ic { color: var(--muted); }
.search-field input { flex: 1; min-width: 0; height: 56px; border: 0; background: none; color: var(--text); font: 400 16px/1 var(--sans); outline: none; }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-esc { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg-2); color: var(--muted); font: 500 11.5px/1.4 var(--mono); cursor: pointer; }
.search-results { flex: 1; min-height: 0; margin: 0; padding: 8px; overflow-y: auto; list-style: none; }
.search-results li { margin: 0; }
.search-group { padding: 10px 10px 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.search-item a { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px; padding: 9px 10px; border-radius: 9px; color: var(--text); }
.search-item a:hover { text-decoration: none; }
.search-item[aria-selected="true"] a { background: var(--accent-soft); }
.search-item .si-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-2); color: var(--muted); }
.search-item .si-icon .ic { width: 15px; height: 15px; }
.search-item .si-icon .verb { font-size: 9px; padding: 1px 4px; }
.si-main { min-width: 0; }
.si-title { display: block; font-size: 14.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-sub { display: block; color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.si-go { color: var(--muted); opacity: 0; }
.search-item[aria-selected="true"] .si-go { opacity: 1; color: var(--accent); }
.search-results mark { background: none; color: var(--accent); font-weight: 600; }
.search-empty { padding: 28px 16px; color: var(--muted); text-align: center; font-size: 14px; }
.search-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: 12px; }
.search-foot kbd { margin-right: 3px; }

/* ---------- Rodape ---------- */
.doc-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; max-width: 1240px; margin: 56px auto 0; padding-top: 24px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13.5px; }
.doc-foot img { width: 80px; filter: var(--logo-filter); opacity: 0.8; }

/* Aviso visual ao copiar */
.copied-flash { animation: flash 0.6s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 2px var(--ok); } to { box-shadow: 0 0 0 2px transparent; } }

/* ---------- Responsivo ---------- */
@media (max-width: 1360px) {
  .top-nav { display: none; }
}
@media (max-width: 1240px) {
  .ep { grid-template-columns: minmax(0, 1fr); }
  .ep-text { max-width: 760px; }
  .ep-code { position: static; max-height: none; max-width: 860px; margin-top: 22px; }
  .ep-code .cg-request pre, .ep-code .cg-response pre { max-height: 480px; }
  .pg { grid-template-columns: minmax(0, 1fr); }
  .pg-result { border-left: 0; border-top: 1px solid var(--code-line); min-height: 280px; }
}
@media (max-width: 960px) {
  :root { --top: 56px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: inline-grid; }
  .side { position: fixed; top: var(--top); left: 0; bottom: 0; z-index: 25; align-self: stretch; width: min(320px, 86vw); height: auto; transform: translateX(-102%); transition: transform 0.22s ease, visibility 0s linear 0.22s; visibility: hidden; box-shadow: var(--shadow); }
  .side.open { transform: none; visibility: visible; transition: transform 0.22s ease, visibility 0s; }
  .scrim { display: block; position: fixed; inset: var(--top) 0 0; z-index: 24; background: var(--overlay); }
  .search-btn { width: auto; }
  .search-btn-label, .search-btn kbd { display: none; }
  .search-btn { width: 38px; padding: 0; justify-content: center; border-color: transparent; background: none; }
  .anchor { display: none; }
  .doc > section, .doc > .ref-head { padding-top: 44px; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .top { gap: 10px; padding: 0 12px; }
  .brand img { width: 84px; }
  .brand-tag { padding-left: 10px; }
  .brand-tag span { display: none; }
  .top-auth a:not(.btn) { display: none; }
  .top-auth .btn { min-height: 34px; padding: 0 12px; font-size: 13.5px; }
  .doc { padding: 0 16px 64px; }
  .route-base { display: none; }
  h2 { font-size: 23px; }
  .h-xl { font-size: 27px; }
  .lead { font-size: 16.5px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .fact + .fact { border-left: 0; border-top: 1px solid var(--line); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .flow li + li::before { left: 11px; top: -12px; transform: rotate(135deg); }
  .steps > li { padding-left: 42px; }
  .pg-form { padding: 16px; }
  .pg-actions .btn { flex: 1 1 auto; }
  .ai-prompt-head { flex-direction: column; align-items: stretch; }
  .table th, .table td { padding: 9px 12px; }
  .table td:first-child { white-space: normal; }
  .doc-foot { flex-direction: column; align-items: flex-start; }
  .search { margin-top: 12px; max-height: calc(100vh - 24px); }
  .search-foot { display: none; }
}
@media (max-width: 400px) {
  .brand-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
