:root {
    --ink: #182230;
    --muted: #687386;
    --line: #e4e9f0;
    --paper: #ffffff;
    --soft: #f6f8fb;
    --navy: #182230;
    --accent: #e9786c;
    --green: #218a66;
    --red: #b5474b;
    --sidebar: 286px;
    --example: 360px;
    --example-min: 280px;
    --example-max: 640px;
    --header-h: 80px;

    /* Escala tipográfica: toda la interfaz (excepto el widget de Swagger) usa uno de estos tamaños. */
    --fs-micro: 10px;      /* píldora de método, badge de acceso, ruta monoespaciada en el listado */
    --fs-label: 11px;      /* eyebrow, cabeceras de sección, pestañas de idioma, botón "Copiar" */
    --fs-caption: 12px;    /* subtítulo de marca, resumen de operación en el listado, nota de ejecución */
    --fs-body-sm: 13px;    /* texto secundario: enlaces de guía, estado del token, permisos, vacíos */
    --fs-body: 14px;       /* controles de formulario: input de token, botones, ruta bajo el H1 */
    --fs-code: 13px;       /* bloques de código monoespaciado (guía y panel de ejemplo) */
    --fs-body-lg: 15px;    /* párrafos y listas de la guía, título del panel de ejemplo */
    --fs-heading-sm: 17px; /* nombre de marca */
    --fs-heading-md: 23px; /* h2 dentro de las guías */
    --fs-display: clamp(20px, 2vw, 20px); /* H1 de guías, operaciones y errores */
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow: hidden; }
body { color: var(--ink); background: var(--paper); font-family: 'Poppins', "Poppins Fallback: BlinkMacSystemFont", "Poppins Fallback: Segoe UI", "Poppins Fallback: Helvetica Neue", "Poppins Fallback: Arial", "Poppins Fallback: Noto Sans", sans-serif; font-size: var(--fs-body); }
button, input { font: inherit; }
button { cursor: pointer; }

.api-docs-header {
    min-height: var(--header-h); padding: 14px 24px; display: flex; align-items: center; gap: 32px;
    border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); position: sticky; top: 0; z-index: 30;
}
.api-docs-brand { min-width: calc(var(--sidebar) - 24px); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; color: var(--ink); text-decoration: none; }
.api-docs-brand-logo { display: block; }
.api-docs-brand strong, .api-docs-brand small { display: block; }
.api-docs-brand strong { font-size: var(--fs-heading-sm); letter-spacing: -.02em; }
.api-docs-brand small { margin-top: 2px; color: var(--muted); font-size: var(--fs-caption); }

.api-token-form { flex: 1; display: grid; grid-template-columns: minmax(360px, 620px) minmax(260px, 1fr); align-items: center; gap: 6px 18px; }
.api-token-form > label { grid-column: 1; color: var(--muted); font-size: var(--fs-label); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.api-token-input-row { grid-column: 1; display: flex; gap: 8px; }
.api-token-input-row input, .api-docs-search input { width: 100%; min-width: 0; border: 1px solid #cfd7e3; border-radius: 8px; padding: 10px 12px; color: var(--ink); background: #fff; outline: 0; font-size: var(--fs-body); }
.api-token-input-row input:focus, .api-docs-search input:focus { border-color: #7f91aa; box-shadow: 0 0 0 3px rgba(89,112,144,.12); }
.api-token-input-row button { border: 0; border-radius: 8px; padding: 10px 15px; color: #fff; background: var(--navy); font-size: var(--fs-body); font-weight: 700; white-space: nowrap; }
.api-token-input-row button:disabled { opacity: .55; cursor: wait; }
.api-token-input-row .button-secondary { color: var(--ink); background: var(--soft); border: 1px solid var(--line); }

.api-docs-layout { height: calc(100vh - var(--header-h)); display: grid; grid-template-columns: var(--sidebar) 6px minmax(480px, 1fr) 6px var(--example); }
.api-docs-navigation { background: #fbfcfe; height: calc(100vh - var(--header-h)); position: sticky; top: var(--header-h); overflow-y: auto; padding: 20px 14px 40px; }
.api-docs-resizer { position: relative; height: calc(100vh - var(--header-h)); position: sticky; top: var(--header-h); cursor: col-resize; }
.api-docs-resizer::after { content: ''; position: absolute; top: 0; bottom: 0; left: 2px; width: 1px; background: var(--line); }
#example-resizer::after { background: #111a27; }
.api-docs-resizer:hover::after,
body.is-resizing-sidebar .api-docs-resizer::after,
body.is-resizing-example .api-docs-resizer::after { left: 1px; width: 3px; border-radius: 2px; background: var(--accent); }
#example-resizer:hover::after,
body.is-resizing-example .api-docs-resizer#example-resizer::after { background: var(--accent); }
body.is-resizing-sidebar, body.is-resizing-example { cursor: col-resize; user-select: none; }
.api-docs-search { margin: 0 4px 22px; }
.api-docs-search label { display: block; margin: 0 0 7px; color: var(--muted); font-size: var(--fs-label); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.api-nav-section { margin-bottom: 23px; }
.api-nav-section-toggle { width: 100%; border: 0; border-radius: 8px; background: transparent; padding: 8px 10px; color: #8b96a8; text-transform: uppercase; letter-spacing: .08em; font-size: var(--fs-label); font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.api-nav-section-toggle:hover,
.api-nav-section-toggle.is-expanded,
.api-nav-section-toggle:focus-visible { background: #edf1f6; outline: 0; }
.api-nav-section-chevron { transition: transform .2s ease; }
.api-nav-section-toggle[aria-expanded="true"] .api-nav-section-chevron { transform: rotate(90deg); }
.api-nav-section-body { margin-top: 3px; }
.api-nav-section-body[hidden] { display: none; }
.api-nav-section h2 { margin: 0; color: #8b96a8; font-size: var(--fs-label); font-weight: 700; }
.api-guide-link, .api-operation-link { width: 100%; border: 0; border-radius: 8px; background: transparent; color: var(--ink); text-align: left; }
.api-guide-link { padding: 7px 10px; font-size: var(--fs-body-sm); }
.api-guide-external-link { display: block; text-decoration: none; }
.api-guide-link:hover, .api-guide-link.is-selected, .api-operation-link:hover, .api-operation-link.is-selected { background: #edf1f6; }
.api-operation-link { min-height: 52px; margin: 2px 0; padding: 7px 8px; display: grid; grid-template-columns: 43px minmax(0, 1fr); gap: 8px; align-items: center; position: relative; }
.api-operation-copy { min-width: 0; }
.api-operation-copy strong, .api-operation-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.api-operation-copy strong { font-size: var(--fs-body-sm); font-weight: 600; }
.api-operation-copy small { margin-top: 4px; color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--fs-micro); }
.api-method { display: inline-grid; min-width: 44px; height: 22px; padding: 0 5px; place-items: center; border-radius: 5px; color: #256ba5; background: rgba(97,175,254,.2); font-size: var(--fs-micro); font-weight: 800; letter-spacing: .04em; }
.api-method--post { color: #19764d; background: rgba(73,204,144,.2); }
.api-method--put { color: #87530d; background: rgba(252,161,48,.22); }
.api-method--patch { color: #187b68; background: rgba(80,227,194,.22); }
.api-method--delete { color: #aa2727; background: rgba(249,62,62,.16); }
.api-method--head { color: #6f0ac4; background: rgba(144,18,254,.15); }
.api-method--options { color: #0d5aa7; background: rgba(13,90,167,.15); }
.api-access-badge { grid-column: 2; color: var(--red); font-size: var(--fs-micro); font-weight: 800; }
.api-operation--denied { opacity: .47; filter: grayscale(1); }
.api-operation--denied:hover, .api-operation--denied.is-selected { opacity: .7; }
.api-empty-state { padding: 15px; color: var(--muted); font-size: var(--fs-body-sm); }

.api-docs-content { min-width: 0; padding: 42px clamp(28px, 4vw, 70px) 80px; height: 100%; overflow-y: auto; overflow-x: hidden; }
.api-docs-loading, .api-docs-error { padding: 50px 0; color: var(--muted); font-size: var(--fs-body-lg); }
.eyebrow { display: block; margin-bottom: 9px; color: var(--accent); font-size: var(--fs-label); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.api-guide { max-width: 780px; }
.api-guide h1, .api-operation-header h1, .api-docs-error h1 { margin: 0 0 22px; letter-spacing: -.035em; font-size: var(--fs-display); line-height: 1.08; }
.api-guide h2 { margin-top: 36px; font-size: var(--fs-heading-md); }
.api-guide p, .api-guide li { color: #475467; font-size: var(--fs-body-lg); line-height: 1.75; }
.api-guide img { display: block; max-width: 100%; height: auto; }
.api-guide a[href^="#api-operation="] { display: inline-flex; align-items: center; margin-top: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); background: var(--soft); font-weight: 700; text-decoration: none; }
.api-guide a[href^="#api-operation="]:hover { border-color: var(--accent); background: #edf1f6; }
.api-guide pre { overflow-x: auto; padding: 20px; border-radius: 10px; background: #111a27; color: #e7edf6; font-size: var(--fs-code); line-height: 1.6; }
.api-guide code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.api-guide p code, .api-guide li code { padding: .15em .4em; border-radius: 5px; background: var(--soft); color: #3a4a63; font-size: .9em; }
.api-operation-title { display: flex; align-items: center; gap: 12px; }
.api-operation-title h1 { margin-bottom: 12px; }
.api-operation-header > code { display: block; margin-bottom: 22px; color: #455468; font-size: var(--fs-body); }
.api-permission-callout { margin: 0 0 24px; padding: 13px 15px; display: flex; flex-wrap: wrap; gap: 5px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--soft); font-size: var(--fs-body-sm); }
.api-permission-callout.is-denied { border-color: #efc7ca; background: #fff5f5; color: var(--red); }
.api-permission-callout.is-allowed { border-color: #b8dfd0; background: #f0faf6; color: var(--green); }

.api-docs-example { min-width: 0; padding: 28px 20px; color: #d8e0eb; background: #111a27; height: 100%; position: sticky; top: var(--header-h); overflow-y: auto; overflow-x: hidden; }
.api-docs-example code { color: #d8e0eb; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--fs-code); line-height: 1.7; }
.api-schema-docs-heading .eyebrow { color: #8fa2bb; }
.api-schema-docs-heading h2 { margin: 3px 0 0; color: #fff; font-size: var(--fs-body-lg); }
.api-schema-search { display: block; margin-top: 18px; }
.api-schema-search span { display: block; margin-bottom: 7px; color: #8fa2bb; font-size: var(--fs-label); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.api-schema-search input { width: 100%; padding: 9px 11px; border: 1px solid #35445a; border-radius: 7px; outline: 0; color: #fff; background: #182436; font-size: var(--fs-body-sm); }
.api-schema-search input::placeholder { color: #7f90a7; }
.api-schema-search input:focus { border-color: #7890af; box-shadow: 0 0 0 3px rgba(120,144,175,.16); }
.api-schema-search-status { min-height: 17px; margin: 7px 0 0; color: #8fa2bb; font-size: var(--fs-caption); }
.api-schema-docs-empty { margin: 18px 0 0; color: #8fa2bb; font-size: var(--fs-caption); line-height: 1.55; }
.api-schema-section { margin-top: 18px; padding-top: 18px; border-top: 1px solid #2b394c; }
.api-schema-section:first-child { margin-top: 8px; }
.api-schema-section > header { margin-bottom: 14px; }
.api-schema-section > header h3 { margin: 0; color: #fff; font-size: var(--fs-body); }
.api-schema-section > header code { display: block; margin-top: 3px; color: #8fa2bb; font-size: var(--fs-micro); }
.api-schema-node { min-width: 0; padding: 10px 0; }
.api-schema-node + .api-schema-node { border-top: 1px solid rgba(143,162,187,.14); }
.api-schema-root { padding-top: 0; }
.api-schema-node-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px 8px; }
.api-schema-name { color: #f3f6fa !important; font-weight: 700; overflow-wrap: anywhere; }
.api-schema-type { color: #72a7ff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--fs-code); }
.api-schema-required { padding: 2px 5px; border-radius: 4px; color: #ffb5bc; background: rgba(249,62,62,.15); font-size: var(--fs-micro); font-weight: 700; }
.api-schema-metadata { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; color: #a9b8cb; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--fs-micro); line-height: 1.45; }
.api-schema-description { margin: 7px 0 0; color: #d8e0eb; font-size: var(--fs-caption); line-height: 1.5; white-space: pre-line; }
.api-schema-children { margin: 9px 0 0 5px; padding-left: 12px; border-left: 1px solid #40516a; }
.api-schema-composition { margin-top: 8px; padding: 9px 10px; border: 1px solid #35445a; border-radius: 7px; }
.api-schema-composition-label { color: #8fa2bb; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: var(--fs-micro); }
.api-schema-docs mark { padding: 1px 2px; border-radius: 3px; color: #111a27; background: #f6c864; }
.api-callbacks-section { margin-top: 24px; padding-top: 20px; border-top: 2px solid #40516a; }
.api-callbacks-section > header h3 { margin: 3px 0 0; color: #fff; font-size: var(--fs-body); }
.api-callbacks-section > header p { margin: 7px 0 0; color: #a9b8cb; font-size: var(--fs-caption); line-height: 1.5; }
.api-callback { margin-top: 16px; padding: 14px; border: 1px solid #35445a; border-radius: 8px; background: #162132; }
.api-callback-heading { display: flex; align-items: center; gap: 8px; color: #fff; }
.api-callback-url { display: block; margin-top: 9px; padding: 8px; border-radius: 6px; color: #bcd0e8 !important; background: #0e1724; overflow-wrap: anywhere; }
.api-callback h4 { margin: 11px 0 0; color: #f3f6fa; font-size: var(--fs-body-sm); }
.api-callback > p { margin: 7px 0 0; color: #c5d0de; font-size: var(--fs-caption); line-height: 1.5; }
.api-callback-subsection { margin-top: 14px; padding-top: 12px; border-top: 1px solid #2b394c; }
.api-callback-subsection h5 { margin: 0 0 5px; color: #8fa2bb; font-size: var(--fs-label); letter-spacing: .04em; text-transform: uppercase; }
.api-callback-no-body { color: #8fa2bb !important; font-style: italic; }
.api-callback-responses { display: flex; flex-direction: column; gap: 4px; margin-top: 13px; color: #b8c6d8; font-size: var(--fs-caption); }
.api-callback-responses strong { color: #f3f6fa; }

/* Swagger stays responsible for schemas, parameters and request forms. */
#swagger-operation .swagger-ui .information-container,
#swagger-operation .swagger-ui .scheme-container,
#swagger-operation .swagger-ui .opblock-tag,
#swagger-operation .swagger-ui .curl-command { display: none !important; }
#swagger-operation .swagger-ui { color: var(--ink); font-family: inherit; }
#swagger-operation .swagger-ui .wrapper { max-width: none; padding: 0; }
#swagger-operation .swagger-ui .opblock { margin: 0; border-radius: 9px; box-shadow: none; }
#swagger-operation .swagger-ui .opblock .opblock-summary { display: none; }
#swagger-operation .swagger-ui .opblock-body { padding-top: 10px; }
#swagger-operation .swagger-ui .btn.execute { background: var(--green); border-color: var(--green); }

@media (max-width: 1180px) {
    html, body { overflow: auto; }
    :root { --sidebar: 260px; }
    .api-docs-layout { grid-template-columns: var(--sidebar) 6px minmax(0, 1fr); }
    .api-docs-example { grid-column: 1 / -1; position: static; height: auto; min-height: 380px; }
    .api-docs-content { height: auto; overflow: visible; }
    .api-docs-resizer { display: none; }
}

@media (max-width: 820px) {
    .api-docs-header { position: static; align-items: flex-start; flex-direction: column; gap: 14px; padding: 16px; }
    .api-docs-brand { min-width: 0; }
    .api-token-form { width: 100%; display: block; }
    .api-token-form > label { display: block; margin-bottom: 6px; }
    .api-docs-layout { display: block; }
    .api-docs-navigation { position: static; width: 100%; height: auto; max-height: 52vh; border-bottom: 1px solid var(--line); }
    .api-docs-resizer { display: none; }
    .api-docs-content { padding: 32px 20px 55px; }
    .api-docs-example { min-height: 0; padding: 26px 20px; }
}

@media (max-width: 520px) {
    .api-token-input-row { flex-wrap: wrap; }
    .api-token-input-row input { flex-basis: 100%; }
    .api-token-input-row button { flex: 1; }
    .api-operation-title { align-items: flex-start; flex-direction: column; }
}
