/* Documentación pública de la API (apidoc.<dominio>). Colores de la web (apps/web/src/app.css). */
:root {
  --background: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e2e5ea;
  --foreground: #14171c;
  --muted: #5a6371;
  --accent: #2f4fd8;
  --accent-soft: #eaeefd;
  --ok: #1f8a55;
  --warn: #c2770e;
  --danger: #b42318;
  --code-bg: #151a21;
  --code-fg: #e7eaee;
  --code-muted: #9aa3af;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0e1116;
    --surface: #151a21;
    --surface-2: #1b212a;
    --border: #2a313b;
    --foreground: #e7eaee;
    --muted: #9aa3af;
    --accent: #8fa8ff;
    --accent-soft: #1e2740;
    --ok: #3fb27f;
    --warn: #e0a23b;
    --danger: #f97066;
    --code-bg: #0a0d11;
    color-scheme: dark;
  }
}

/* Idioma: solo se ve el bloque del idioma elegido (docs.js pone data-lang en <html>). */
[data-l] { display: none; }
html[data-lang="es"] [data-l="es"],
html[data-lang="en"] [data-l="en"],
html[data-lang="zh"] [data-l="zh"] { display: revert; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font: 15px/1.6 "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
code, pre { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
a { color: var(--accent); }

header.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  height: 56px; padding: 0 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; text-decoration: none; color: var(--foreground); }
.brand .mark { width: 26px; height: 26px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; color: #fff; font-size: 14px; font-weight: 700; }
.brand small { color: var(--muted); font-weight: 400; }
.langs { margin-left: auto; display: flex; gap: 4px; }
.langs button {
  border: 1px solid var(--border); background: var(--surface); color: var(--foreground);
  padding: 4px 10px; border-radius: 6px; font: inherit; font-size: 13px; cursor: pointer;
}
.langs .short { display: none; }
.langs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
nav.side {
  position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto;
  padding: 20px 12px; border-right: 1px solid var(--border); background: var(--surface);
}
nav.side h4 { margin: 18px 8px 6px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
nav.side a {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 6px; color: var(--foreground); text-decoration: none; font-size: 14px;
}
nav.side a:hover, nav.side a.active { background: var(--accent-soft); }

.verb { display: inline-block; min-width: 42px; font: 600 11px/1.6 "IBM Plex Mono", ui-monospace, monospace; text-align: center; border-radius: 4px; padding: 0 4px; color: #fff; }
.verb.post { background: #c2770e; }
.verb.get { background: #1f8a55; }

main { min-width: 0; }
section.ep {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
}
section.ep > .doc { padding: 32px 36px; min-width: 0; }
section.ep > .code { padding: 32px 24px; background: var(--code-bg); color: var(--code-fg); min-width: 0; }
section.ep.wide { grid-template-columns: minmax(0, 1fr); }
section.ep.wide > .doc { max-width: 920px; }

h1 { font-size: 30px; line-height: 1.2; margin: 0 0 12px; }
h2 { font-size: 22px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 24px 0 8px; }
.lead { font-size: 17px; color: var(--muted); }
.url {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 8px 0 16px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  font: 13px "IBM Plex Mono", ui-monospace, monospace; word-break: break-all;
}
p code, li code, td code { background: var(--surface-2); border: 1px solid var(--border); padding: 0 4px; border-radius: 4px; font-size: 13px; }

table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 7px 8px; border-bottom: 1px solid var(--border); }
td code { word-break: break-all; }
td:first-child code { word-break: normal; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
td.req { color: var(--danger); font-size: 12px; white-space: nowrap; }
td.opt { color: var(--muted); font-size: 12px; white-space: nowrap; }

.note { border-left: 3px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 16px 0; }
.note.warn { border-left-color: var(--warn); }

.code h5 { margin: 0 0 6px; font-size: 12px; font-weight: 600; color: var(--code-muted); text-transform: uppercase; letter-spacing: .05em; }
.code h5 .st { float: right; font-family: "IBM Plex Mono", monospace; }
.code h5 .st.ok { color: #3fb27f; }
.code h5 .st.ko { color: #f97066; }
.block { position: relative; margin: 0 0 20px; }
.block pre {
  margin: 0; padding: 14px; border-radius: 8px; background: #1b212a; border: 1px solid #2a313b;
  overflow-x: auto; font-size: 12.5px; line-height: 1.55; color: var(--code-fg); white-space: pre;
}
.copy {
  position: absolute; top: 6px; right: 6px;
  border: 1px solid #2a313b; background: #232a34; color: var(--code-fg);
  font: 12px "IBM Plex Sans", system-ui, sans-serif; padding: 2px 8px; border-radius: 5px; cursor: pointer;
}
.copy:hover { background: #2a313b; }

footer { padding: 28px 36px; color: var(--muted); font-size: 13px; }

@media (max-width: 1100px) {
  section.ep { grid-template-columns: minmax(0, 1fr); }
  section.ep > .code { padding: 20px 16px; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  nav.side { display: none; }
  section.ep > .doc { padding: 24px 16px; }
  .brand small { display: none; }
  .langs .long { display: none; }
  .langs .short { display: inline; }
  footer { padding: 24px 16px; }
}
