/* Quaintel API docs — brand: colors of the new website */
:root {
    --brand: #1832f4;
    --brand-deep: #1429d6;
    --brand-tint: #eef0fe;
    --signal: #e3262b;
    --ink: #0b0b0c;
    --body: #3f3f46;
    --muted: #6e6e75;
    --line: #e4e4e9;
    --tint: #f6f6f8;
    --paper: #fff;
    --code-bg: #111216;
    --code-line: #23252c;
    --get: #0c8a5b;
    --post: #1832f4;
    --delete: #c41f24;
    --put: #b45309;
    --ok: #10b981;
    --warn: #f59e0b;
    --err: #ef4444;
    --radius: 10px;
    --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --head: "Manrope", "Inter", sans-serif;
    --top: 60px;
    /* navy gradient (top bar + login) */
    --navy: #0f2250;
    --navy-deep: #0c1533;
    --navy-grad: linear-gradient(90deg, #10244f 0%, #0e1a3d 55%, #0c1533 100%);
    --code-soft: #fbfbfc;
    --warn-bg: #fff7ed;
    --err-bg: #fdecec;
    --err-ink: #b4161b;
    --shadow: 0 1px 2px rgba(16,24,40,.04), 0 1px 3px rgba(16,24,40,.06);
    color-scheme: light;
}
/* dark theme (Guesty style) — from the ☾ button in the top bar, or the system setting */
:root[data-theme="dark"] {
    --brand: #5b6cff;
    --brand-deep: #8b97ff;
    --brand-tint: rgba(91,108,255,.14);
    --ink: #f1f2f5;
    --body: #c6c8d0;
    --muted: #8d909b;
    --line: #262932;
    --tint: #16181e;
    --paper: #0f1115;
    --code-bg: #15171c;
    --code-line: #262932;
    --code-soft: #13151a;
    --warn-bg: rgba(245,158,11,.1);
    --err-bg: rgba(239,68,68,.12);
    --err-ink: #fca5a5;
    --get: #34d399;
    --post: #7c8bff;
    --shadow: none;
    color-scheme: dark;
}
:root[data-theme="dark"] .j-key { color: #93c5fd; }
:root[data-theme="dark"] .j-str { color: #86efac; }
:root[data-theme="dark"] .j-num { color: #fcd34d; }
:root[data-theme="dark"] .j-bool { color: #c4b5fd; }
:root[data-theme="dark"] .gate-logo { filter: brightness(0) invert(1); }
:root[data-theme="dark"] .code-box { border: 1px solid var(--line); }
body, .sidebar, .response, .lang, .cred, .param input, .param select, .param textarea { transition: background-color .2s, border-color .2s, color .2s; }
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; font-family: var(--sans); color: var(--body); background: var(--paper); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
code, kbd, pre { font-family: var(--mono); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top); background: var(--navy-grad); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.topbar-inner { height: 100%; max-width: 1600px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 18px; width: auto; filter: brightness(0) invert(1); }
.brand-tag { font-family: var(--head); font-weight: 700; font-size: 12px; letter-spacing: .08em; background: var(--brand); padding: 2px 8px; border-radius: 999px; }
.top-nav { display: flex; gap: 4px; margin-left: 12px; }
.top-nav a { color: rgba(255,255,255,.72); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: 14px; }
.top-nav a:hover { color: #fff; background: rgba(255,255,255,.08); text-decoration: none; }
.top-nav a.active { color: #fff; background: rgba(255,255,255,.12); }
.search-btn { margin-left: auto; display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); color: rgba(255,255,255,.8); border: 1px solid rgba(255,255,255,.14); border-radius: 8px; padding: 7px 10px; font: inherit; font-size: 14px; cursor: pointer; min-width: 200px; }
.search-btn kbd { margin-left: auto; font-size: 11px; color: rgba(255,255,255,.55); }
.icon-btn { display: none; background: transparent; border: 0; color: #fff; padding: 6px; border-radius: 8px; cursor: pointer; }

/* ---------- layout ---------- */
.layout { max-width: 1600px; margin: 0 auto; display: grid; grid-template-columns: 280px minmax(0, 1fr); }
.sidebar { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; border-right: 1px solid var(--line); padding: 18px 14px 40px; background: var(--paper); }
.filter { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; color: var(--muted); margin-bottom: 18px; }
.filter input { border: 0; outline: 0; padding: 9px 0; font: inherit; font-size: 14px; width: 100%; background: transparent; color: var(--ink); }
.nav-group { margin-bottom: 18px; }
.nav-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0 8px 6px; }
.nav-link { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: 8px; color: var(--body); font-size: 14px; line-height: 1.35; }
.nav-link:hover { background: var(--tint); text-decoration: none; color: var(--ink); }
.nav-link.active { background: var(--brand-tint); color: var(--brand-deep); font-weight: 600; }
.nav-empty { color: var(--muted); font-size: 14px; padding: 8px; }

/* method badges */
.m { display: inline-block; font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .02em; padding: 2px 7px; border-radius: 999px; color: #fff; flex-shrink: 0; text-transform: uppercase; }
.m-get { background: var(--get); } .m-post { background: var(--post); } .m-delete { background: var(--delete); } .m-put { background: var(--put); }
.m-lg { font-size: 12px; padding: 3px 10px; }

/* ---------- page ---------- */
.main { min-width: 0; outline: 0; }
.page { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 48px; padding: 36px 40px 80px; }
.page.guide { grid-template-columns: minmax(0, 820px); }
.content h1 { font-family: var(--head); font-size: 32px; line-height: 1.2; color: var(--ink); margin: 0 0 12px; letter-spacing: -.01em; }
.content h2 { font-family: var(--head); font-size: 19px; color: var(--ink); margin: 36px 0 12px; }
.content h3 { font-size: 15px; color: var(--ink); margin: 22px 0 8px; }
.content p { margin: 0 0 12px; }
.content ul, .content ol { padding-left: 20px; }
.content li { margin-bottom: 4px; }
.content code { background: var(--tint); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 13px; color: var(--ink); }
.content pre { background: var(--code-bg); color: #e6e6ea; padding: 14px 16px; border-radius: var(--radius); overflow-x: auto; font-size: 13px; line-height: 1.6; }
.content pre code { background: none; border: 0; padding: 0; color: inherit; }
.content table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 16px; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.content th { background: var(--tint); color: var(--ink); font-weight: 600; }
.hint { background: var(--brand-tint); border-left: 3px solid var(--brand); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 12px 0; color: var(--ink); font-size: 14px; }
.hint.warn { background: var(--warn-bg); border-color: var(--warn); }
.lead { font-size: 16px; color: var(--body); }
.pid { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; margin-bottom: 6px; }

.endpoint-url { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.endpoint-url .url { font-family: var(--mono); font-size: 13.5px; color: var(--body); word-break: break-all; }
.endpoint-url .url b { color: var(--ink); font-weight: 500; }
.lock { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; }

/* cards (params / responses / history) */
.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--paper); }
.card + .card { margin-top: 12px; }
.card-row { padding: 14px 16px; border-top: 1px solid var(--line); }
.card-row:first-child { border-top: 0; }
.param { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 16px; align-items: start; }
.param-name { font-family: var(--mono); font-weight: 600; color: var(--ink); font-size: 14px; }
.param-type { font-size: 12px; color: var(--muted); margin-left: 6px; }
.param-req { font-size: 12px; color: var(--signal); margin-left: 6px; font-weight: 600; }
.param-desc { font-size: 14px; color: var(--body); margin-top: 3px; }
.param-desc .enum { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.param input, .param select, .param textarea { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 7px 9px; font: inherit; font-size: 13.5px; color: var(--ink); background: var(--paper); }
.param input:focus, .param select:focus, .param textarea:focus, .cred input:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 3px rgba(24,50,244,.12); }
.param input[type=file] { padding: 5px; font-size: 12.5px; }

.resp-item { display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 14px 16px; border-top: 1px solid var(--line); background: var(--paper); width: 100%; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; font: inherit; color: inherit; }
.resp-item:first-child { border-top: 0; }
.resp-item:hover { background: var(--tint); }
.resp-item .chev { margin-left: auto; transition: transform .15s; color: var(--muted); }
.resp-item[aria-expanded=true] .chev { transform: rotate(90deg); }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.err { background: var(--err); }
.resp-code { font-weight: 700; color: var(--ink); }
.resp-desc { color: var(--body); font-size: 14px; }
.resp-body { padding: 0 16px 14px; background: var(--tint); }
.resp-body pre { margin: 0; }

.history table { margin: 0; display: table; }
.history td, .history th { border-left: 0; border-right: 0; font-size: 13px; }
.history .empty { text-align: center; color: var(--muted); padding: 18px; }
.history-foot { padding: 10px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); display: flex; justify-content: space-between; }
.link-btn { background: none; border: 0; color: var(--brand); font: inherit; font-size: 13px; cursor: pointer; padding: 0; }

/* ---------- right panel ---------- */
/* right panel: a single scroll (no separate inner scroll for the response), does not scroll the page */
.side { position: sticky; top: calc(var(--top) + 24px); align-self: start; display: flex; flex-direction: column; gap: 18px; max-height: calc(100vh - var(--top) - 40px); overflow-y: auto; padding: 0 6px 8px 0; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c9c9d1 transparent; }
.side > * { flex-shrink: 0; } /* no box gets squeezed — the panel scrolls instead */
body.side-full .side > * { flex-shrink: 1; }
.side::-webkit-scrollbar { width: 8px; }
.side::-webkit-scrollbar-thumb { background: #c9c9d1; border-radius: 8px; }
.side::-webkit-scrollbar-thumb:hover { background: #a1a1aa; }
.side-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; }
.langs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.lang { border: 1px solid var(--line); background: var(--paper); border-radius: 9px; padding: 8px 4px; font: inherit; font-size: 12.5px; color: var(--body); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 500; }
.lang:hover { border-color: var(--muted); }
/* in dark mode, a light ring around the black logos (Next.js, Shell) */
:root[data-theme="dark"] .lang[data-lang="next"] circle, :root[data-theme="dark"] .lang[data-lang="shell"] rect { stroke: #4b4f5c; stroke-width: 1; }
.response, .cred, .resp-list, .params-box { box-shadow: var(--shadow); }
/* Download PDF (top bar) */
.pdf-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; height: 36px; padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 7px; font: 600 13px/1 inherit; font-family: inherit; cursor: pointer; flex: none; }
.pdf-btn:hover { background: rgba(255,255,255,.16); }
.pdf-btn:disabled { cursor: progress; opacity: .85; }
.pdf-btn .spin { display: none; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: pdfspin .7s linear infinite; }
.pdf-btn.busy .spin { display: inline-block; }
.pdf-btn.busy .ico { display: none; }
@keyframes pdfspin { to { transform: rotate(360deg); } }
/* theme toggle (top bar) */
.theme-btn { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; width: 36px; height: 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.theme-btn:hover { background: rgba(255,255,255,.16); }
.theme-btn .moon, :root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: block; }
.lang[aria-pressed=true] { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-tint); }
.lang .lg { display: inline-flex; height: 24px; align-items: center; }
.lang .lg svg { display: block; transition: transform .15s; }
.lang:hover .lg svg { transform: scale(1.08); }
.cred { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cred-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); border-top: 1px solid var(--line); }
.cred-row:first-child { border-top: 0; }
.cred-row label { padding: 9px 12px; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--tint); border-right: 1px solid var(--line); }
.cred-row .cin { display: flex; align-items: center; }
.cred input { border: 0; padding: 9px 10px; font-family: var(--mono); font-size: 12.5px; width: 100%; min-width: 0; color: var(--ink); background: var(--paper); }
.cred .eye { background: none; border: 0; color: var(--muted); padding: 0 10px; cursor: pointer; }
.cred-note { font-size: 12px; color: var(--muted); padding: 8px 12px; background: var(--paper); border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cred-note label { display: flex; gap: 6px; align-items: center; cursor: pointer; white-space: nowrap; }
.cred-note input[type=checkbox] { width: auto; padding: 0; margin: 0; flex: none; }

/* no overflow hidden — otherwise the Try It bar below is not sticky */
.code-box { background: var(--code-bg); border-radius: var(--radius); color: #e6e6ea; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--code-line); font-size: 13px; font-weight: 600; color: #fff; }
.code-head small { color: #9a9aa5; font-weight: 400; }
.code-box pre { margin: 0; padding: 14px; font-size: 12.5px; line-height: 1.65; overflow-x: auto; overflow-y: hidden; white-space: pre; }
/* Copy + Try It bar: always on screen (stays stuck to the bottom while the panel scrolls) */
.code-foot { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-top: 1px solid var(--code-line);
    position: sticky; bottom: 0; z-index: 3; background: var(--code-bg); border-radius: 0 0 var(--radius) var(--radius); box-shadow: 0 -10px 20px -12px rgba(0,0,0,.6); }
.copy-btn { background: transparent; border: 1px solid var(--code-line); color: #c9c9d1; border-radius: 7px; padding: 6px 10px; font: inherit; font-size: 12.5px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.copy-btn:hover { border-color: #3a3d47; color: #fff; }
.try-btn { background: var(--brand); color: #fff; border: 0; border-radius: 8px; padding: 9px 18px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; }
.try-btn:hover { background: var(--brand-deep); }
.try-btn:disabled { opacity: .7; cursor: progress; }
.spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; display: none; }
.try-btn.loading .spin { display: inline-block; }
.try-btn.try-again { padding: 5px 12px; font-size: 12.5px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2s; } }

.response { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.response-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--tint); border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.response-head .title { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); font-family: var(--mono); font-size: 13px; }
.response-head .meta { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.response-body { padding: 14px; font-size: 14px; color: var(--body); }
.response-body pre { margin: 0; background: var(--code-soft); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 12.5px; overflow-x: auto; color: var(--ink); white-space: pre-wrap; word-break: break-word; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--paper); border-radius: 8px; padding: 5px 10px; font-family: var(--mono); font-size: 13px; cursor: pointer; color: var(--ink); }
.chip:hover { border-color: var(--brand); }

/* JSON colors */
.j-key { color: #1d4ed8; } .j-str { color: #047857; } .j-num { color: #b45309; } .j-bool { color: #7c3aed; } .j-null { color: #9ca3af; }
.code-box .j-key { color: #93c5fd; } .code-box .j-str { color: #86efac; } .code-box .j-num { color: #fcd34d; } .code-box .j-bool, .code-box .j-null { color: #c4b5fd; }
.c-cmd { color: #f472b6; } .c-str { color: #86efac; } .c-kw { color: #93c5fd; } .c-com { color: #7c7f8c; } .c-var { color: #fda4af; }

/* code line numbers (Guesty style) — not included when copying */
.code-box pre code { counter-reset: ln; display: block; }
.code-box .ln { counter-increment: ln; display: block; padding-left: 2.6em; position: relative; min-height: 1.65em; }
.code-box .ln::before { content: counter(ln); position: absolute; left: 0; width: 1.8em; text-align: right; color: #50535e; user-select: none; }

/* Library dropdown (code box header) */
.lib-dd { position: relative; }
.lib-btn { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; color: #fff; font: inherit; font-size: 13px; font-weight: 600; padding: 4px 8px; margin-left: -8px; border-radius: 7px; cursor: pointer; }
.lib-btn:hover, .lib-btn[aria-expanded=true] { background: rgba(255,255,255,.08); }
.lib-btn svg { opacity: .7; transition: transform .15s; }
.lib-btn[aria-expanded=true] svg { transform: rotate(180deg); }
.lib-menu { position: absolute; left: -8px; top: calc(100% + 6px); z-index: 20; min-width: 210px; background: #1b1d23; border: 1px solid #2e313a; border-radius: 12px; padding: 6px; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
.lib-label { font-size: 12px; font-weight: 600; color: #8b8e99; padding: 6px 10px 4px; }
.lib-item { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: transparent; border: 0; color: #e6e6ea; font: inherit; font-size: 14px; font-weight: 600; padding: 9px 10px; border-radius: 8px; cursor: pointer; text-align: left; }
.lib-item:hover, .lib-item:focus-visible { background: rgba(255,255,255,.07); outline: 0; }
.lib-item[aria-checked=true] { background: rgba(255,255,255,.06); }
.lib-item svg { color: #a1a4ae; flex: none; }

/* ⤢ full screen: left code (black), right response */
.head-r { display: inline-flex; align-items: center; gap: 10px; }
.exp-btn { background: transparent; border: 1px solid currentColor; color: inherit; opacity: .7; border-radius: 6px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; line-height: 1; cursor: pointer; padding: 0; }
.exp-btn:hover { opacity: 1; }
.code-head .exp-btn { color: #c9c9d1; }
.response-head .exp-btn { color: var(--muted); }
.exp-btn .c, body.side-full .exp-btn .o { display: none; }
body.side-full .exp-btn .c { display: inline; }
body.side-full { overflow: hidden; }
/* language dropdown in full screen (the top language buttons are hidden) */
.code-lang { display: none; background: #1c1e25; color: #fff; border: 1px solid #3a3d47; border-radius: 7px; padding: 4px 28px 4px 10px; font: inherit; font-size: 13px; cursor: pointer;
    appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c9c9d1' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }
.code-lang:hover, .code-lang:focus { border-color: var(--brand); outline: 0; }
body.side-full .code-lang { display: inline-block; }
body.side-full .response-head { min-width: 0; }
body.side-full .side { position: fixed; inset: 0; height: 100vh; height: 100dvh; z-index: 90; max-height: none; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; padding: 0; background: var(--code-bg); }
body.side-full .side > div:not(.code-box):not(.response) { display: none; }
body.side-full .code-box, body.side-full .response { border-radius: 0; border: 0; display: flex; flex-direction: column; min-height: 0; height: 100vh; }
body.side-full .code-box pre { flex: 1; min-height: 0; max-height: none; overflow: auto; font-size: 13.5px; }
body.side-full .code-foot { position: static; box-shadow: none; }
body.side-full .response { background: var(--paper); }
body.side-full .response-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
body.side-full .response-body pre { flex: 1; min-height: 0; max-height: none; overflow: auto; font-size: 13.5px; }
@media (max-width: 860px) {
    /* mobile: code on top, response below */
    body.side-full .side { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
    body.side-full .code-box, body.side-full .response { height: auto; }
}

/* sidebar icons */
.nav-title { display: flex; align-items: center; gap: 7px; }
.nav-ico { color: var(--brand); flex: none; }

/* top bar: user chip + logout */
.user-chip { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 4px 4px 4px 12px; color: rgba(255,255,255,.85); font-size: 13px; max-width: 220px; }
.user-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logout-btn { background: rgba(255,255,255,.1); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.logout-btn:hover { background: var(--signal); }

/* ---------- login (API key) ---------- */
.gate { display: none; }
body.locked .topbar, body.locked .layout { display: none; }
body.locked .gate { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px 16px; background: var(--navy-grad); position: relative; overflow: hidden; }
.gate-glow { position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(600px 400px at 15% 10%, rgba(24,50,244,.35), transparent 70%), radial-gradient(500px 380px at 90% 95%, rgba(227,38,43,.18), transparent 70%);
}
.gate-glow::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px); background-size: 40px 40px; mask-image: radial-gradient(circle at center, #000 30%, transparent 75%); }
.gate-card { position: relative; width: 100%; max-width: 420px; background: var(--paper); border-radius: 18px; padding: 32px 28px 24px; box-shadow: 0 30px 80px rgba(3,8,30,.55); }
.gate-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.gate-logo { height: 20px; width: auto; }
.gate-brand .brand-tag { color: #fff; }
.gate-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--brand-tint); color: var(--brand); display: grid; place-items: center; margin-bottom: 14px; }
.gate h1 { font-family: var(--head); font-size: 24px; line-height: 1.25; color: var(--ink); margin: 0 0 6px; }
.gate-sub { margin: 0 0 20px; font-size: 14px; color: var(--muted); }
.gate-label { display: block; font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.gate-field { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 6px 0 12px; background: var(--paper); transition: border-color .15s, box-shadow .15s; }
.gate-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(24,50,244,.15); }
.gate-field .gi { color: var(--muted); flex: none; }
.gate-field input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 12px 0; font: inherit; font-family: var(--mono); font-size: 14px; color: var(--ink); background: transparent; }
.gate-eye { background: none; border: 0; color: var(--muted); padding: 8px; cursor: pointer; border-radius: 8px; display: inline-flex; }
.gate-eye:hover { color: var(--brand); background: var(--brand-tint); }
.gate-more { margin: 14px 0 0; font-size: 13px; }
.gate-more summary { cursor: pointer; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.gate-more summary::-webkit-details-marker { display: none; }
.gate-more summary:hover { color: var(--brand); }
.gate-more .gate-field { margin-top: 8px; }
.gate-check { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 13.5px; color: var(--body); cursor: pointer; }
.gate-error { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--err-bg); color: var(--err-ink); font-size: 13.5px; }
.gate-btn { margin-top: 18px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--brand); color: #fff; border: 0; border-radius: 10px; padding: 13px 16px; font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; transition: background .15s, transform .1s; }
.gate-btn:hover { background: var(--brand-deep); }
.gate-btn:active { transform: translateY(1px); }
.gate-btn:disabled { opacity: .75; cursor: progress; }
.gate-btn.loading .spin { display: inline-block; }
.gate-btn.loading svg { display: none; }
.gate-help { display: flex; align-items: flex-start; gap: 6px; margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.gate-help svg { flex: none; margin-top: 2px; }
@media (max-width: 420px) {
    .gate-card { padding: 26px 20px 20px; border-radius: 14px; }
    .gate h1 { font-size: 21px; }
}

/* guide cards */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.g-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--body); display: block; }
.g-card:hover { border-color: var(--brand); text-decoration: none; }
.g-card b { color: var(--ink); display: block; font-family: var(--head); margin-bottom: 2px; }
.g-card span { font-size: 13.5px; }
.page-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.updated { margin-top: 28px; font-size: 13px; color: var(--muted); }

/* search dialog */
.dialog-wrap { position: fixed; inset: 0; background: rgba(11,11,12,.45); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; }
.dialog { background: var(--paper); width: 100%; max-width: 600px; border-radius: 12px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog input { width: 100%; border: 0; border-bottom: 1px solid var(--line); padding: 16px 18px; font: inherit; font-size: 16px; outline: 0; }
.dialog ul { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.dialog li a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 8px; color: var(--ink); }
.dialog li a:hover, .dialog li a.sel { background: var(--brand-tint); text-decoration: none; }
.dialog li small { color: var(--muted); margin-left: auto; font-family: var(--mono); font-size: 12px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 9px 16px; border-radius: 8px; font-size: 14px; z-index: 80; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
    .page { grid-template-columns: minmax(0, 1fr) 400px; gap: 32px; padding: 32px 28px 72px; }
}
@media (max-width: 1080px) {
    /* small laptop / tablet: right panel moves below */
    .page { grid-template-columns: minmax(0, 1fr); }
    .side { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 860px) {
    /* tablet / mobile: sidebar slide-in */
    .layout { grid-template-columns: minmax(0, 1fr); }
    .icon-btn { display: inline-flex; }
    .sidebar { position: fixed; left: 0; top: var(--top); width: 290px; max-width: 85vw; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 10px 40px rgba(0,0,0,.15); }
    body.nav-open .sidebar { transform: none; }
    .backdrop { position: fixed; inset: var(--top) 0 0 0; background: rgba(11,11,12,.35); z-index: 45; }
    .top-nav { display: none; }
    .search-btn { min-width: 0; }
    .search-btn span, .search-btn kbd { display: none; }
    .user-chip { max-width: 160px; }
}
@media (max-width: 480px) {
    /* small phone: logout icon only */
    .user-chip { padding: 0; background: none; border: 0; }
    .user-chip > svg, .user-name { display: none; }
    .pdf-btn { width: 36px; padding: 0; justify-content: center; }
    .pdf-btn .pdf-txt { display: none; }
}
@media (max-width: 600px) {
    .topbar-inner { padding: 0 12px; gap: 10px; }
    .page { padding: 22px 16px 60px; }
    .content h1 { font-size: 25px; }
    .param { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    /* mobile: all five languages on one line (smaller buttons) */
    .langs { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
    .lang { padding: 7px 2px; font-size: 11px; gap: 3px; border-radius: 8px; white-space: nowrap; }
    .lang .lg, .lang .lg svg { width: 20px; height: 20px; }
    .cred-row { grid-template-columns: 80px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
