/* Documentacao Koku. Tokens do painel (docs/design-painel.md): verde #00DFA2 so como destaque,
   superficies brancas, cromo #F7F7F8, bordas #E8E8EB, texto #111113 / #55555E / #71717A. */

:root,
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --bg-elev: #ffffff;
  --line: #e8e8eb;
  --line-soft: #f2f2f4;
  --ink: #111113;
  --ink-2: #55555e;
  --ink-3: #6b6b74;
  --accent: #00dfa2;
  --accent-soft: #d5faee;
  --accent-ink: #065f46;
  --link: #047857;
  --hero-end: #047857;
  --focus: #00a879;
  --code-bg: #0f1012;
  --code-head: #17181b;
  --code-line: #26272c;
  --code-ink: #e6e6ea;
  --overlay: rgba(10, 10, 11, 0.45);
  --warn-soft: #fff4d6;
  --warn-ink: #7a4e00;
  --danger-soft: #fde9e7;
  --danger-ink: #9c1c12;
  --info-soft: #eef4ff;
  --info-ink: #1e40af;
  --get-bg: #d5faee;
  --get-ink: #065f46;
  --post-bg: #e0ecff;
  --post-ink: #1d4ed8;
  --delete-bg: #fde9e7;
  --delete-ink: #b42318;
  --shadow: 0 24px 60px rgba(17, 17, 19, 0.18);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0b0b0d;
  --bg-soft: #121215;
  --bg-elev: #151518;
  --line: #26262b;
  --line-soft: #1c1c20;
  --ink: #f4f4f5;
  --ink-2: #b9b9c2;
  --ink-3: #9a9aa4;
  --accent: #00dfa2;
  --accent-soft: rgba(0, 223, 162, 0.13);
  --accent-ink: #5cf2c8;
  --link: #5cf2c8;
  --hero-end: #00dfa2;
  --focus: #5cf2c8;
  --code-bg: #101114;
  --code-head: #16171b;
  --code-line: #26272c;
  --code-ink: #e6e6ea;
  --overlay: rgba(0, 0, 0, 0.6);
  --warn-soft: rgba(251, 191, 36, 0.12);
  --warn-ink: #fcd34d;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --danger-ink: #fca5a5;
  --info-soft: rgba(96, 165, 250, 0.12);
  --info-ink: #93c5fd;
  --get-bg: rgba(0, 223, 162, 0.14);
  --get-ink: #5cf2c8;
  --post-bg: rgba(96, 165, 250, 0.16);
  --post-ink: #93c5fd;
  --delete-bg: rgba(248, 113, 113, 0.16);
  --delete-ink: #fca5a5;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  letter-spacing: -0.006em;
}

body.search-open,
body.menu-open {
  overflow: hidden;
}

img {
  max-width: 100%;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-color: currentColor;
}

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

code,
kbd,
pre {
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 12px;
}

.icon {
  flex: none;
}

/* ---------------------------------------------------------------- topo */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: 64px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}

.brand-logo {
  height: 24px;
  width: auto;
}

.brand-logo--dark {
  display: none;
}

:root[data-theme='dark'] .brand-logo--light {
  display: none;
}

:root[data-theme='dark'] .brand-logo--dark {
  display: block;
}

.brand-tag {
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
}

.top-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  height: 100%;
  margin-left: 12px;
}

.top-tab {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 2px solid transparent;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.top-tab:hover {
  color: var(--ink);
}

.top-tab.is-active {
  border-bottom-color: var(--accent);
  color: var(--ink);
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 260px;
  height: 38px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--ink-3);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.search-btn:hover {
  border-color: color-mix(in srgb, var(--ink-3) 45%, var(--line));
  color: var(--ink-2);
}

.search-kbd,
kbd {
  margin-left: auto;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink-2);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--ink);
  background: var(--bg-soft);
}

.icon-moon {
  display: none;
}

:root[data-theme='dark'] .icon-sun {
  display: none;
}

:root[data-theme='dark'] .icon-moon {
  display: block;
}

.menu-btn {
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #0a0a0b;
  border: 1px solid var(--accent);
}

.btn-primary:hover {
  background: #00c890;
  border-color: #00c890;
}

/* ---------------------------------------------------------------- moldura */
.shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  max-width: 1600px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  border-right: 1px solid var(--line);
  overscroll-behavior: contain;
}

.sidebar-inner {
  padding: 24px 16px 40px;
}

.sidebar-tabs,
.sidebar-panel-btn {
  display: none;
}

.nav-group + .nav-group {
  margin-top: 22px;
}

.nav-title {
  margin: 0 0 6px;
  padding: 0 12px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.nav-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 1px 0;
  padding: 7px 12px;
  border-radius: 10px;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.35;
  text-decoration: none;
}

.nav-link:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.nav-link.is-active {
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 600;
}

.main {
  min-width: 0;
  outline: none;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 760px) 232px;
  justify-content: center;
  gap: 56px;
  padding: 40px 40px 64px;
}

.main--reference .main-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  justify-content: stretch;
  gap: 48px;
}

.doc {
  min-width: 0;
}

/* ---------------------------------------------------------------- conteudo */
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 600;
}

h1,
h2,
h3,
.card-title,
.hero-title {
  font-family: 'Plus Jakarta Sans', 'Inter', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
}

.lead {
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: 17px;
}

.doc-header {
  margin-bottom: 28px;
}

.prose {
  font-size: 15.5px;
}

.prose > * + * {
  margin-top: 16px;
}

.prose h2 {
  margin: 44px 0 0;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 700;
}

.prose h3 {
  margin: 32px 0 0;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 700;
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 12px;
}

.prose h2,
.prose h3 {
  position: relative;
}

.anchor {
  position: absolute;
  left: -20px;
  color: var(--ink-3);
  text-decoration: none;
  opacity: 0;
}

h2:hover .anchor,
h3:hover .anchor {
  opacity: 1;
}


:where(.prose) :where(p, ul, ol) {
  /* Especificidade zero de proposito: o ritmo (.prose > * + *, h2 + *) sempre vence. */
  margin: 0;
}

.prose ul,
.prose ol {
  padding-left: 22px;
}

.prose li + li {
  margin-top: 6px;
}

.prose li::marker {
  color: var(--ink-3);
}

.prose :not(pre) > code {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 0.86em;
  /* break-word (e nao anywhere): o identificador so quebra se nao couber na linha; em tabela, a
     coluna fica com a largura do maior codigo e a .table-wrap rola na horizontal. */
  overflow-wrap: break-word;
}

.prose td.cell-code code {
  white-space: nowrap;
}

.prose blockquote {
  margin: 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--accent);
  color: var(--ink-2);
}

.muted {
  color: var(--ink-3);
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--bg-soft);
  color: var(--ink-2);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------------------------------------------------------------- inicio */
.hero {
  padding: 8px 0 8px;
}

.hero-title {
  margin: 0;
  font-size: 40px;
  line-height: 1.12;
  font-weight: 800;
}

.hero-title span {
  /* Claro: termina em #047857 (5,5:1 sobre branco); escuro: vai ate o verde da marca. */
  background: linear-gradient(90deg, var(--accent-ink), var(--hero-end));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero p {
  max-width: 620px;
  margin-top: 14px;
  color: var(--ink-2);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.btn-ghost {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
}

.btn-ghost:hover {
  background: var(--bg-soft);
}

/* ---------------------------------------------------------------- cartoes */
.cards {
  display: grid;
  gap: 16px;
}

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

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

.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 120ms ease, transform 120ms ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 6px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
}

.card-text {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- avisos */
.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14.5px;
}

.callout-body > * + * {
  margin-top: 8px;
}

:where(.callout-body) :where(p) {
  margin: 0;
}

.callout-title {
  font-weight: 600;
}

.callout-icon {
  padding-top: 2px;
}

.callout--note {
  background: var(--info-soft);
  border-color: color-mix(in srgb, var(--info-ink) 20%, transparent);
}

.callout--note .callout-icon {
  color: var(--info-ink);
}

.callout--tip {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent-ink) 22%, transparent);
}

.callout--tip .callout-icon {
  color: var(--accent-ink);
}

.callout--warning {
  background: var(--warn-soft);
  border-color: color-mix(in srgb, var(--warn-ink) 22%, transparent);
}

.callout--warning .callout-icon {
  color: var(--warn-ink);
}

.callout--danger {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger-ink) 22%, transparent);
}

.callout--danger .callout-icon {
  color: var(--danger-ink);
}

/* ---------------------------------------------------------------- passos e fluxo */
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0 !important;
}

.steps > li {
  position: relative;
  padding: 0 0 18px 44px;
  counter-increment: step;
}

.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-weight: 700;
}

.steps > li::after {
  content: '';
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}

.steps > li:last-child::after {
  display: none;
}

.flow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  list-style: none;
  padding: 0 !important;
  counter-reset: flow;
}

.flow-step {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 !important;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
  counter-increment: flow;
}

.flow-step::after {
  content: counter(flow);
  position: absolute;
  top: 14px;
  right: 14px;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 600;
}

.flow-icon {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.flow-title {
  font-weight: 600;
  font-size: 14.5px;
}

.flow-text {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.5;
}

/* ---------------------------------------------------------------- codigo */
.code-block {
  overflow: hidden;
  border: 1px solid var(--code-line);
  border-radius: 14px;
  background: var(--code-bg);
  color: var(--code-ink);
}

.code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--code-line);
  background: var(--code-head);
  font-size: 13px;
  color: #b8b8c2;
}

.code-head--bare {
  justify-content: flex-end;
  min-height: 38px;
}

.code-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-title code {
  color: #e6e6ea;
}

.code-title-text {
  color: #d4d4da;
  font-weight: 500;
}

.code-path {
  color: #e6e6ea;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.code-tabs {
  display: flex;
  gap: 2px;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
}

.code-title + .code-tabs {
  margin-left: auto;
}

.code-group--responses .code-tabs {
  flex: 1 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
  padding: 4px 0;
  overflow: visible;
}

.code-caption {
  margin: 0;
  padding: 10px 18px 0;
  color: #b8b8c2;
  font-size: 12.5px;
}

.code-caption + .code {
  padding-top: 8px;
}

.code-tab {
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a1a1ab;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
}

.code-tab:hover {
  color: #f4f4f5;
}

.code-tab[aria-selected='true'] {
  background: #26272c;
  color: #ffffff;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding: 6px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #a1a1ab;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  flex: none;
}

.copy-btn:hover {
  background: #26272c;
  color: #ffffff;
}

.copy-btn.is-copied {
  color: var(--accent);
}

.code-head > .copy-btn {
  margin-left: auto;
}

.code-head > .code-tabs + .copy-btn {
  margin-left: 4px;
}

.code {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  tab-size: 2;
}

.code code {
  font-size: inherit;
  white-space: pre;
}

.tk-key {
  color: #7dd3fc;
}

.tk-string {
  color: #86efc5;
}

.tk-number {
  color: #fcd34d;
}

.tk-keyword,
.tk-tag {
  color: #f0abfc;
}

.tk-comment {
  color: #8e8e99;
  font-style: italic;
}

.tk-function {
  color: #93c5fd;
}

.tk-variable {
  color: #fda4af;
}

.tk-flag {
  color: #c4b5fd;
}

.example > * + * {
  margin-top: 12px;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

.status--ok {
  background: rgba(0, 223, 162, 0.16);
  color: #5cf2c8;
}

.status--warn {
  background: rgba(251, 191, 36, 0.16);
  color: #fcd34d;
}

.status--error {
  background: rgba(248, 113, 113, 0.16);
  color: #fca5a5;
}

.prose .status--ok,
.prose td .status--ok {
  background: var(--get-bg);
  color: var(--get-ink);
}

.prose td .status--warn {
  background: var(--warn-soft);
  color: var(--warn-ink);
}

.prose td .status--error {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.resp-header code {
  padding: 1px 6px;
  border-radius: 6px;
  background: #26272c;
  color: #e6e6ea;
  font-size: 11.5px;
}

/* ---------------------------------------------------------------- referencia */
.method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 2px 8px;
  border-radius: 999px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.method--get {
  background: var(--get-bg);
  color: var(--get-ink);
}

.method--post {
  background: var(--post-bg);
  color: var(--post-ink);
}

.method--delete {
  background: var(--delete-bg);
  color: var(--delete-ink);
}

.code-head .method--get {
  background: rgba(0, 223, 162, 0.16);
  color: #5cf2c8;
}

.code-head .method--post {
  background: rgba(96, 165, 250, 0.18);
  color: #93c5fd;
}

.code-head .method--delete {
  background: rgba(248, 113, 113, 0.18);
  color: #fca5a5;
}

.method--sm {
  min-width: 40px;
  padding: 0 6px;
  font-size: 10px;
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  overflow-x: auto;
}

.endpoint-path {
  min-width: 0;
  font-size: 14px;
  white-space: nowrap;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
}

.endpoint-base {
  color: var(--ink-3);
}

.auth-box {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.auth-box p {
  margin: 0;
}

.auth-box p + p {
  margin-top: 6px;
  color: var(--ink-2);
  font-size: 14px;
}

.fields {
  border-top: 1px solid var(--line);
}

.field {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.field--d1 {
  padding-left: 18px;
}

.field--d2 {
  padding-left: 36px;
}

.field--d3 {
  padding-left: 54px;
}

.field-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.field-name {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--ink) !important;
  font-size: 14px !important;
  font-weight: 600;
}

.field-type {
  color: var(--ink-3);
  font-size: 13px;
}

.badge {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge--required {
  background: var(--danger-soft);
  color: var(--danger-ink);
}

.field-desc {
  margin-top: 4px;
  color: var(--ink-2);
  font-size: 14px;
}

.field-desc p + p {
  margin-top: 4px;
}

.field-values {
  color: var(--ink-3);
  font-size: 13px;
}

.ref-aside {
  min-width: 0;
}

.ref-examples {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 112px);
  overflow-y: auto;
  padding-bottom: 8px;
}

.ref-examples .code {
  max-height: 460px;
}

/* ---------------------------------------------------------------- indice e rodape */
.toc {
  position: relative;
}

.toc-inner {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.toc-title {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--line);
}

.toc li a {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 14px;
  border-left: 2px solid transparent;
  color: var(--ink-3);
  font-size: 13px;
  line-height: 1.4;
  text-decoration: none;
}

.toc li.toc-l3 a {
  padding-left: 26px;
}

.toc li a:hover {
  color: var(--ink);
}

.toc li a.is-active {
  border-left-color: var(--accent);
  color: var(--ink);
  font-weight: 500;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
}

.pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
}

.pager-link:hover {
  border-color: var(--accent);
}

.pager-link--next {
  align-items: flex-end;
  text-align: right;
}

.pager-hint {
  color: var(--ink-3);
  font-size: 12.5px;
}

.pager-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.doc-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: 13px;
}

.doc-footer a {
  color: var(--ink-2);
}

/* ---------------------------------------------------------------- busca */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10vh 16px 16px;
  background: var(--overlay);
}

.search-overlay[hidden] {
  display: none;
}

.search-panel {
  width: 100%;
  max-width: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-elev);
  box-shadow: var(--shadow);
}

.search-field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-3);
}

.search-field input {
  flex: 1;
  min-width: 0;
  height: 56px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
}

.search-field input::-webkit-search-cancel-button {
  display: none;
}

.search-close {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.search-results {
  list-style: none;
  margin: 0;
  padding: 8px;
  max-height: 55vh;
  overflow-y: auto;
}

.search-results:empty {
  display: none;
}

.search-results a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
  text-decoration: none;
}

.search-results [aria-selected='true'] a,
.search-results a:hover {
  background: var(--accent-soft);
}

.search-result-group {
  color: var(--ink-3);
  font-size: 12px;
}

.search-result-title {
  font-weight: 600;
  font-size: 14.5px;
}

.search-empty,
.search-hint {
  margin: 0;
  padding: 14px 18px;
  color: var(--ink-3);
  font-size: 13px;
}

.search-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.search-hint kbd {
  margin-left: 0;
}

.search-result-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.search-result-head .method {
  flex: none;
}

.search-result-snippet {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.search-results mark {
  padding: 0 1px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 30%, transparent);
  color: inherit;
}

/* ---------------------------------------------------------------- responsivo */
@media (max-width: 1280px) {
  .main-grid {
    grid-template-columns: minmax(0, 780px);
  }

  .toc {
    display: none;
  }

  .main--reference .main-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    gap: 32px;
  }
}

/* Exemplos da referencia: uma copia na coluna da direita (desktop) e outra logo depois da
   descricao do endpoint (coluna unica). So uma aparece por vez. */
.ref-inline {
  display: none;
}

@media (max-width: 1180px) {
  .main--reference .main-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .ref-inline {
    display: block;
  }

  .main--reference .ref-aside {
    display: none;
  }

  .ref-examples {
    position: static;
    max-height: none;
  }

  .search-btn {
    width: 200px;
  }
}

/* 1024px ainda e desktop (barra lateral fixa): lateral mais estreita e menos respiro. */
@media (min-width: 1024px) and (max-width: 1180px) {
  .shell {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .main-grid {
    padding: 32px 32px 56px;
  }

  .top-tabs {
    margin-left: 4px;
  }
}

@media (max-width: 1023.98px) {
  .menu-btn {
    display: inline-grid;
  }

  .top-tabs {
    display: none;
  }

  .shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: fixed;
    top: 64px;
    left: 0;
    bottom: 0;
    z-index: 60;
    width: min(320px, 86vw);
    height: auto;
    background: var(--bg);
    transform: translateX(-102%);
    transition: transform 180ms ease;
    visibility: hidden;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
    visibility: visible;
    box-shadow: var(--shadow);
  }

  .sidebar-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 18px;
  }

  .sidebar-tabs .top-tab {
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  .sidebar-tabs .top-tab.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
  }

  .sidebar-panel-btn {
    display: flex;
    margin-top: 24px;
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 64px 0 0 0;
    z-index: 50;
    background: var(--overlay);
  }

  .sidebar-backdrop[hidden] {
    display: none;
  }

  .main-grid {
    padding: 28px 24px 56px;
  }
}

@media (max-width: 720px) {
  .topbar-inner {
    gap: 10px;
    padding: 0 16px;
  }

  .search-btn {
    width: 38px;
    padding: 0;
    justify-content: center;
  }

  .search-btn-text,
  .search-kbd,
  .panel-btn,
  .brand-tag {
    display: none;
  }

  .main-grid {
    padding: 24px 16px 48px;
  }

  h1 {
    font-size: 26px;
  }

  .hero-title {
    font-size: 30px;
  }

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

  .pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .anchor {
    display: none;
  }

  .code {
    font-size: 12.5px;
  }

  /* Barra do endpoint: so o caminho (o host esta na Visao geral), quebrando entre segmentos. */
  .endpoint {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .endpoint-base {
    display: none;
  }

  .endpoint-path {
    white-space: normal;
  }
}

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

/* ---------------------------------------------------------------- checklist */
.prose .checklist {
  list-style: none;
  padding-left: 0;
}

.checklist li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.check {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  border: 1.5px solid var(--accent-ink);
  border-radius: 5px;
  background: var(--accent-soft);
}

/* ---------------------------------------------------------------- codigo em coluna estreita */
.code-group {
  container-type: inline-size;
}

@container (max-width: 620px) {
  .code-group .code-head {
    flex-wrap: wrap;
    row-gap: 0;
    padding-top: 4px;
  }

  .code-group .code-title {
    flex: 1 1 100%;
    min-height: 36px;
  }

  .code-group .code-tabs {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: -6px;
    padding-bottom: 6px;
  }

  .code-group .copy-btn {
    margin-bottom: 6px;
  }
}

@container (max-width: 620px) {
  .code-group .code-head {
    position: relative;
  }

  .code-group .code-title {
    padding-right: 92px;
  }

  .code-group .code-head > .copy-btn {
    position: absolute;
    top: 4px;
    right: 8px;
    margin: 0;
  }
}
