/* Onzepay Docs */
:root {
  --brand: #2155ff;
  --brand-hi: #7c9cff;
  --brand-deep: #2155ff;
  --ink: #11162a;
  --bg: #f7f8fa;
  --bg-elev: #ffffff;
  --bg-soft: #f0f1f6;
  --line: #dfe2eb;
  --line-soft: #eceef4;
  --text: #11162a;
  --text-2: #373f59;
  --muted: #6d758c;
  --link: #2155ff;
  --code-bg: #101421;
  --code-line: #1f263e;
  --code-text: #e2e5ee;
  --inline-code: #eceef4;
  --shadow: 0 1px 2px rgba(17, 22, 42, 0.05), 0 8px 24px rgba(17, 22, 42, 0.06);
  --radius: 14px;
  --top: 64px;
  --font: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}
[data-theme='dark'] {
  --bg: #101421;
  --bg-elev: #14192a;
  --bg-soft: #192034;
  --line: #292f43;
  --line-soft: #1d243c;
  --text: #f0f1f6;
  --text-2: #c0c5d8;
  --muted: #8792b5;
  --link: #7c9cff;
  --code-bg: #0d1019;
  --code-line: #1d243c;
  --inline-code: #1d243c;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 32px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}
*,
*::before,
*::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.brand svg { stroke: none; }
button { font: inherit; color: inherit; }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; color: var(--muted); background: var(--bg-elev); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

/* Topo */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--top);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand svg.brand-logo { width: auto; height: 23px; color: var(--text); }
.brand-tag { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; padding: 2px 8px; border-radius: 999px; background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); margin-left: 4px; }
.search-btn {
  margin-left: 24px; flex: 0 1 340px; display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px 0 12px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg-elev); color: var(--muted); cursor: pointer; font-size: 14px; text-align: left;
}
.search-btn span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.search-btn:hover { border-color: var(--brand); }
.top-links { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.top-links a { color: var(--text-2); font-weight: 600; font-size: 14px; padding: 6px 12px; border-radius: 8px; }
.top-links a:hover, .top-links a.active { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.top-links .btn-cta { background: var(--brand); color: #fff; }
.top-links .btn-cta:hover { background: #1546e8; color: #fff; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-elev); cursor: pointer; color: var(--text-2); }
.icon-btn:hover { color: var(--text); border-color: var(--brand); }
.menu-btn { display: none; }
[data-theme='dark'] .i-sun, [data-theme='light'] .i-moon { display: none; }

/* Estrutura */
.shell { display: grid; grid-template-columns: 272px minmax(0, 1fr) 232px; max-width: 1480px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 28px 16px 40px 24px; border-right: 1px solid var(--line-soft); }
.nav-group { margin-bottom: 22px; }
.nav-title { margin: 0 0 6px 10px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--text-2); font-size: 14.5px; font-weight: 500; line-height: 1.45; }
.sidebar a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.sidebar a.active { background: color-mix(in srgb, var(--brand) 14%, transparent); color: var(--text); font-weight: 700; box-shadow: inset 2px 0 0 var(--brand); }
.content { min-width: 0; padding: 28px 48px 64px; max-width: 860px; }
.content.wide { max-width: none; }
.shell:has(.content.wide) { grid-template-columns: 272px minmax(0, 1fr) 232px; }
.toc { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 32px 20px 40px 8px; font-size: 13.5px; }
.toc-title { margin: 0 0 10px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: flex; align-items: center; gap: 6px; padding: 4px 0 4px 12px; margin-left: -1px; color: var(--muted); line-height: 1.4; border-left: 2px solid transparent; }
.toc li.l3 a { padding-left: 24px; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--text); border-left-color: var(--brand); font-weight: 600; }

/* Ações da página */
.page-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.crumb { font-size: 13px; font-weight: 700; color: var(--brand-deep); text-transform: uppercase; letter-spacing: 0.06em; }
[data-theme='dark'] .crumb { color: var(--brand-hi); }
.actions { display: flex; gap: 8px; }
.ghost-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-elev); color: var(--text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
.ghost-btn svg { width: 15px; height: 15px; }
.ghost-btn:hover { color: var(--text); border-color: var(--brand); text-decoration: none; }
.ghost-btn.done { border-color: var(--brand); color: var(--text); }
.prose .lede { font-size: 17.5px; line-height: 1.6; color: var(--text-2); margin: -4px 0 18px; }
.ai-menu { position: relative; display: inline-flex; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-elev); box-shadow: 0 1px 2px rgba(17, 22, 42, 0.04); }
.ai-menu:hover, .ai-menu.open { border-color: color-mix(in srgb, var(--brand) 60%, var(--line)); }
.ai-main, .ai-toggle { display: inline-flex; align-items: center; gap: 7px; height: 32px; border: 0; background: none; color: var(--text-2); font: 600 13px var(--font); cursor: pointer; }
.ai-main { padding: 0 12px; border-radius: 8px 0 0 8px; }
.ai-toggle { padding: 0 8px; border-left: 1px solid var(--line); border-radius: 0 8px 8px 0; }
.ai-main:hover, .ai-toggle:hover, .ai-menu.open .ai-toggle { color: var(--text); background: var(--bg-soft); }
.ai-main svg { width: 15px; height: 15px; color: var(--brand-deep); }
[data-theme='dark'] .ai-main svg { color: var(--brand-hi); }
.ai-toggle svg { width: 14px; height: 14px; transition: transform 0.15s ease; }
.ai-menu.open .ai-toggle svg { transform: rotate(180deg); }
.ai-main.done { color: var(--text); }
.ai-menu svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ai-dropdown { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; width: 292px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev); box-shadow: var(--shadow), 0 16px 40px rgba(17, 22, 42, 0.12); }
.ai-dropdown[hidden] { display: none; }
.ai-head { margin: 4px 10px 6px; font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ai-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.ai-item:hover, .ai-item:focus-visible { background: var(--bg-soft); text-decoration: none; outline: none; }
.ai-item > svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px; color: var(--muted); }
.ai-item:hover > svg { color: var(--brand-deep); }
[data-theme='dark'] .ai-item:hover > svg { color: var(--brand-hi); }
.ai-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ai-text strong { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 700; color: var(--text); }
.ai-text small { font-size: 12.5px; color: var(--muted); }
.ai-text .ext { width: 12px; height: 12px; color: var(--muted); }
.ai-sep { height: 1px; margin: 6px 4px; background: var(--line-soft); }

/* Texto */
.prose h1 { font-size: 38px; line-height: 1.15; letter-spacing: -0.03em; font-weight: 800; margin: 4px 0 18px; }
.prose h2 { font-size: 24px; line-height: 1.3; letter-spacing: -0.02em; font-weight: 800; margin: 48px 0 12px; padding-top: 8px; }
.prose h3 { font-size: 18px; font-weight: 700; margin: 32px 0 8px; }
.prose h4 { font-size: 15px; font-weight: 700; margin: 24px 0 8px; }
.prose h1 + p, .lead p { font-size: 17.5px; color: var(--text-2); }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); font-weight: 700; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--brand); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.anchor { float: left; margin-left: -22px; width: 22px; color: var(--muted); opacity: 0; font-weight: 500; }
h1:hover .anchor, h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; text-decoration: none; }
.prose :not(pre) > code { font-family: var(--mono); font-size: 0.86em; padding: 0.12em 0.4em; border-radius: 6px; background: var(--inline-code); color: var(--text); border: 1px solid var(--line-soft); word-break: break-word; }
.prose a code { color: var(--link); }
.muted { color: var(--muted); }

/* Tabelas */
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-weight: 700; color: var(--text); background: var(--bg-soft); }
th, td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
thead th:empty { display: none; }
td code { white-space: nowrap; }

/* Avisos */
.callout { margin: 22px 0; padding: 14px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--bg-elev); border-left: 4px solid var(--c, var(--brand)); }
.callout p { margin: 4px 0; }
.callout-title { font-weight: 800; color: var(--text) !important; }
.callout-info { --c: #3b82f6; }
.callout-tip { --c: var(--brand); }
.callout-warning { --c: #f59e0b; }
.callout-danger { --c: #d63a2f; background: color-mix(in srgb, #d63a2f 5%, var(--bg-elev)); }

/* Código */
figure.code { margin: 18px 0; border-radius: var(--radius); overflow: hidden; background: var(--code-bg); border: 1px solid var(--code-line); box-shadow: var(--shadow); }
figure.code figcaption { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--code-line); color: #8792b5; font-size: 12.5px; font-weight: 600; }
.tablist { display: flex; gap: 2px; margin-left: -10px; overflow-x: auto; }
.tab { border: 0; background: none; color: #8792b5; padding: 11px 10px 9px; font-size: 13px; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: #f0f1f6; }
.tab.active { color: #f0f1f6; border-bottom-color: var(--brand-hi); }
.copy { border: 1px solid #27402f; background: transparent; color: #b8cbbd; border-radius: 7px; padding: 3px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.copy:hover, .copy.done { color: #101421; background: var(--brand-hi); border-color: var(--brand-hi); }
pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-family: var(--mono); font-size: 13px; line-height: 1.65; color: var(--code-text); tab-size: 2; }
pre code { font-family: inherit; }
.t-c { color: #6b8574; font-style: italic; }
.t-s { color: #a8f0b4; }
.t-v { color: #f9d77e; }
.t-a { color: #8fd3ff; }
.t-k { color: #c9a7ff; }
.t-u { color: #8fd3ff; }
.t-p { color: #8fd3ff; }
.t-n { color: #ffb38a; }
.t-f { color: #2155ff; }

/* Referência */
.lead { margin-bottom: 8px; }
.endpoint { padding: 36px 0 12px; border-top: 1px solid var(--line); margin-top: 28px; }
.endpoint h2 { margin: 0 0 10px; padding: 0; font-size: 22px; }
.ep-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-elev); }
.ep-path { font-family: var(--mono); font-size: 13.5px; color: var(--muted); flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ep-path strong { color: var(--text); font-weight: 600; }
.ep-line .copy { border-color: var(--line); color: var(--muted); }
.method, .mini { font-family: var(--mono); font-weight: 700; letter-spacing: 0.02em; border-radius: 6px; text-transform: uppercase; }
.method { font-size: 12px; padding: 3px 8px; }
.mini { font-size: 9.5px; padding: 1px 5px; min-width: 38px; text-align: center; }
.m-get { background: color-mix(in srgb, #3b82f6 16%, transparent); color: #3b82f6; }
.m-post { background: color-mix(in srgb, var(--brand) 18%, transparent); color: var(--brand-deep); }
[data-theme='dark'] .m-post { color: var(--brand-hi); }
.m-patch { background: color-mix(in srgb, #f59e0b 18%, transparent); color: #c27c05; }
.m-delete { background: color-mix(in srgb, #d63a2f 16%, transparent); color: #e04848; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.badge { font-family: var(--mono); font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--bg-elev); }
.badge-accent { border-color: color-mix(in srgb, var(--brand) 45%, transparent); color: var(--text); }
.ep-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; margin-top: 14px; align-items: start; }
.ep-code { position: sticky; top: calc(var(--top) + 16px); }
.ep-code figure.code:first-child { margin-top: 4px; }
.ep-sub { font-size: 12px !important; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 22px 0 6px !important; }
.fields { margin: 0; border-top: 1px solid var(--line-soft); }
.field { padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.field dt { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.field dt code { font-family: var(--mono); font-size: 13.5px; font-weight: 600; color: var(--text); background: none !important; border: 0 !important; padding: 0 !important; }
.ftype { font-size: 12.5px; color: var(--muted); }
.freq { font-size: 11px; font-weight: 700; color: #e04848; text-transform: uppercase; letter-spacing: 0.04em; }
.field dd { margin: 2px 0 0; color: var(--text-2); font-size: 14.5px; }
.enum { margin-top: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.errors { list-style: none; padding: 0 !important; margin: 0; }
.errors li { display: grid; grid-template-columns: auto auto 1fr; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.status { font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 6px; }
.s4 { color: #c27c05; background: color-mix(in srgb, #f59e0b 14%, transparent); }
.s5 { color: #e04848; background: color-mix(in srgb, #d63a2f 14%, transparent); }

/* Paginação e rodapé */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elev); color: var(--text); }
.pager a:hover { border-color: var(--brand); text-decoration: none; }
.pager span { font-size: 12.5px; color: var(--muted); }
.pager strong { display: flex; align-items: center; gap: 4px; font-weight: 700; }
.pager-next { text-align: right; align-items: flex-end; grid-column: 2; }
.foot { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot a { color: var(--muted); }

/* Busca */
.search-dialog { position: fixed; inset: 0; z-index: 80; background: rgba(10, 10, 12, 0.55); backdrop-filter: blur(3px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.search-dialog[hidden] { display: none; }
.search-panel { width: min(640px, 100%); background: var(--bg-elev); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35); overflow: hidden; }
.search-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-input input { flex: 1; height: 56px; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--text); }
.search-input input::-webkit-search-cancel-button { display: none; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: 56vh; overflow-y: auto; }
.search-results a { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--text); }
.search-results a .r-title { grid-column: 2; font-weight: 600; }
.search-results a .r-sec { grid-column: 2; font-size: 12.5px; color: var(--muted); }
.search-results a .mini { grid-row: span 2; }
.search-results a.active, .search-results a:hover { background: color-mix(in srgb, var(--brand) 13%, transparent); text-decoration: none; }
.search-results .empty { padding: 24px; text-align: center; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #f0f1f6; padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; transition: 0.2s; z-index: 90; box-shadow: var(--shadow); }
[data-theme='dark'] .toast { background: var(--brand-hi); color: var(--ink); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Responsivo */
@media (max-width: 1280px) {
  .shell, .shell:has(.content.wide) { grid-template-columns: 256px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 1100px) {
  .ep-grid { grid-template-columns: minmax(0, 1fr); }
  .ep-code { position: static; }
}
@media (max-width: 860px) {
  .shell, .shell:has(.content.wide) { grid-template-columns: minmax(0, 1fr); }
  .menu-btn { display: grid; }
  .sidebar { position: fixed; inset: var(--top) 0 0 0; z-index: 30; width: min(320px, 86vw); background: var(--bg); transform: translateX(-102%); transition: transform 0.2s ease; box-shadow: var(--shadow); }
  body.menu-open .sidebar { transform: none; }
  body.menu-open::after { content: ''; position: fixed; inset: var(--top) 0 0 0; background: rgba(10, 10, 12, 0.4); z-index: 20; }
  .content { padding: 20px 18px 48px; }
  .search-btn { margin-left: auto; flex: 0 0 auto; }
  .search-btn span, .search-btn kbd, .top-links, .brand-tag { display: none; }
  .prose h1 { font-size: 30px; }
  .ai-dropdown { width: min(292px, calc(100vw - 36px)); }
  .anchor { display: none; }
  .ep-base { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
@media print { .topbar, .sidebar, .toc, .page-actions, .pager { display: none; } .shell { display: block; } }
