/* GTRADE docs theme. Self-hosted, no external fonts or CDNs. */
:root {
  --brand: #0A6FE0; --brand-dark: #0A5BC0; --brand-tint: #EAF3FE;
  --bg: #ffffff; --bg-soft: #f6f8fb; --bg-code: #0f1b2d; --fg: #142033; --fg-soft: #4a5a70; --fg-faint: #6b7a90;
  --line: #e3e8ef; --code-fg: #e6edf6; --inline-code-bg: #eef2f7; --inline-code-fg: #0b3f7a;
  --link: #0A5BC0; --note: #0A6FE0; --tip: #0f9d58; --warn: #c27c00; --imp: #c62828;
  --tk-c: #7f93ad; --tk-s: #9ee493; --tk-k: #8cc8ff; --tk-n: #ffcc80; --tk-w: #f59bd2; --tk-v: #ffd479;
  --shadow: 0 8px 30px rgba(15, 30, 60, .12);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --top: 60px; --side: 264px; --toc: 220px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --bg-soft: #111a2b; --bg-code: #0a1424; --fg: #e5ecf5; --fg-soft: #a9b6c8; --fg-faint: #8494aa;
    --line: #1f2b40; --inline-code-bg: #16233a; --inline-code-fg: #9fcbff; --link: #6fb1ff; --brand-tint: #0f2340;
    --shadow: 0 8px 30px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --bg-soft: #111a2b; --bg-code: #0a1424; --fg: #e5ecf5; --fg-soft: #a9b6c8; --fg-faint: #8494aa;
  --line: #1f2b40; --inline-code-bg: #16233a; --inline-code-fg: #9fcbff; --link: #6fb1ff; --brand-tint: #0f2340;
  --shadow: 0 8px 30px rgba(0, 0, 0, .5); color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 12px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 var(--font); overflow-x: hidden; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* top bar */
.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) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 700; letter-spacing: .02em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brandname { font-size: 18px; }
.brandtag { font-weight: 600; font-size: 13px; color: var(--brand); background: var(--brand-tint); padding: 2px 8px; border-radius: 999px; }
.menu { display: none; width: 40px; height: 40px; border: 0; background: none; padding: 9px 8px; cursor: pointer; flex-direction: column; justify-content: space-between; color: var(--fg); }
.menu span { display: block; height: 2px; background: currentColor; border-radius: 2px; }
.search { position: relative; flex: 1; max-width: 460px; margin-left: 24px; }
.search input { width: 100%; height: 38px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--fg); border-radius: 10px; padding: 0 36px 0 12px; font: inherit; font-size: 15px; }
.search input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.kbd { position: absolute; right: 10px; top: 9px; font: 12px var(--mono); color: var(--fg-faint); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; pointer-events: none; }
.results { position: absolute; top: 44px; left: 0; right: 0; max-height: min(70vh, 520px); overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; }
.results a { display: block; padding: 8px 10px; border-radius: 8px; color: var(--fg); }
.results a:hover, .results a[aria-selected="true"] { background: var(--brand-tint); text-decoration: none; }
.results .rt { font-weight: 600; font-size: 14px; }
.results .rh { color: var(--brand); }
.results .rx { font-size: 13px; color: var(--fg-soft); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.results mark { background: color-mix(in srgb, var(--brand) 22%, transparent); color: inherit; border-radius: 2px; }
.results .none { padding: 10px; color: var(--fg-soft); font-size: 14px; }
.toplinks { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.toplinks > a { font-weight: 600; font-size: 14px; color: #fff; background: var(--brand); padding: 7px 14px; border-radius: 8px; }
.toplinks > a:hover { background: var(--brand-dark); text-decoration: none; }
.theme { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--fg); cursor: pointer; display: grid; place-items: center; }
.theme .moon { display: none; }
:root[data-theme="dark"] .theme .sun { display: none; }
:root[data-theme="dark"] .theme .moon { display: inline; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .theme .sun { display: none; } :root:not([data-theme]) .theme .moon { display: inline; } }

/* layout */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--toc); max-width: 1440px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 20px 12px 40px 20px; border-right: 1px solid var(--line); }
.navgroup { margin-bottom: 18px; }
.navtitle { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-faint); margin: 0 0 6px 10px; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--fg-soft); font-size: 15px; }
.sidebar a:hover { background: var(--bg-soft); color: var(--fg); text-decoration: none; }
.sidebar a[aria-current="page"] { background: var(--brand-tint); color: var(--brand); font-weight: 600; }
:root[data-theme="dark"] .sidebar a[aria-current="page"] { color: #8cc4ff; }
.content { min-width: 0; padding: 32px 48px 0; }
.doc { max-width: 820px; min-width: 0; }
.tocwrap { padding: 32px 16px 0 0; }
.toc { position: sticky; top: calc(var(--top) + 24px); font-size: 13px; max-height: calc(100vh - var(--top) - 48px); overflow: auto; }
.toctitle { font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--fg-faint); margin-bottom: 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 3px 0 3px 12px; color: var(--fg-soft); margin-left: -1px; border-left: 2px solid transparent; }
.toc li.l3 a { padding-left: 24px; }
.toc li a.active { color: var(--brand); border-left-color: var(--brand); }
.scrim { display: none; }

/* typography */
.crumb { font-size: 13px; font-weight: 600; color: var(--brand); text-transform: uppercase; letter-spacing: .06em; }
h1 { font-size: 36px; line-height: 1.2; margin: 6px 0 10px; letter-spacing: -.01em; }
.lede { font-size: 18px; color: var(--fg-soft); margin: 0 0 28px; }
h2 { font-size: 24px; margin: 44px 0 12px; padding-top: 4px; letter-spacing: -.005em; }
h3 { font-size: 19px; margin: 30px 0 8px; }
h4 { font-size: 16px; margin: 24px 0 6px; }
h2, h3, h4 { position: relative; }
.anchor { position: absolute; left: -22px; color: var(--fg-faint); opacity: 0; font-weight: 400; padding-right: 6px; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus { opacity: 1; text-decoration: none; }
p, ul, ol { margin: 0 0 16px; }
li { margin: 4px 0; }
li > ul, li > ol { margin: 4px 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
code { font: .88em var(--mono); background: var(--inline-code-bg); color: var(--inline-code-fg); padding: .12em .38em; border-radius: 5px; overflow-wrap: anywhere; }
strong { font-weight: 650; }
kbd { font: 12px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; }

/* tables */
.table { overflow-x: auto; margin: 0 0 20px; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-soft); font-weight: 650; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; }

/* code blocks */
.codeblock { background: var(--bg-code); border-radius: 12px; margin: 0 0 20px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--bg-code) 70%, var(--line)); }
.codebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px 0 14px; min-height: 40px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.codelang { font: 12px var(--mono); color: #8da2bd; text-transform: lowercase; }
.tablist { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin-left: -6px; }
.tablist::-webkit-scrollbar { display: none; }
.tab { background: none; border: 0; color: #9fb2cb; font: 600 13px var(--font); padding: 11px 10px 9px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: #fff; }
.tab[aria-selected="true"] { color: #fff; border-bottom-color: var(--brand); }
.copy { flex: none; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: #d7e3f3; font: 600 12px var(--font); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.copy:hover { background: rgba(255, 255, 255, .16); }
.copy.done { background: var(--brand); border-color: var(--brand); color: #fff; }
pre.code { margin: 0; padding: 14px 16px; overflow-x: auto; color: var(--code-fg); font: 13.5px/1.6 var(--mono); tab-size: 2; }
pre.code code { background: none; color: inherit; padding: 0; font: inherit; overflow-wrap: normal; white-space: pre; }
.tk-c { color: var(--tk-c); font-style: italic; } .tk-s { color: var(--tk-s); } .tk-k { color: var(--tk-k); } .tk-n { color: var(--tk-n); } .tk-w { color: var(--tk-w); } .tk-v { color: var(--tk-v); }

/* callouts */
.callout { border: 1px solid var(--line); border-left: 4px solid var(--note); background: var(--bg-soft); padding: 12px 16px; border-radius: 10px; margin: 0 0 20px; }
.callout > :last-child { margin-bottom: 0; }
.callout.tip { border-left-color: var(--tip); }
.callout.warning { border-left-color: var(--warn); }
.callout.important { border-left-color: var(--imp); }

/* cards, steps, badges */
.hero { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; border-radius: 16px; padding: 28px; margin: 0 0 28px; display: grid; gap: 16px; }
.hero h2 { margin: 0; font-size: 26px; color: #fff; }
.hero p { margin: 0; color: #dbe9fb; font-size: 16px; }
.hero .heroactions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn { display: inline-block; font-weight: 650; padding: 9px 16px; border-radius: 9px; background: #fff; color: var(--brand-dark); }
.btn:hover { text-decoration: none; background: #eaf3fe; }
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .55); }
.btn.ghost:hover { background: rgba(255, 255, 255, .12); }
.logo-card { display: inline-block; background: #fff; border-radius: 12px; padding: 8px 14px; line-height: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin: 0 0 24px; }
.card { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 16px; color: var(--fg); background: var(--bg); transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: var(--brand); box-shadow: var(--shadow); text-decoration: none; }
.card strong { display: block; margin-bottom: 4px; color: var(--fg); }
.card span { color: var(--fg-soft); font-size: 14.5px; }
.badge { display: inline-block; font: 600 12px var(--font); padding: 2px 8px; border-radius: 999px; background: var(--brand-tint); color: var(--brand); vertical-align: middle; }
.badge.get { background: #e6f6ec; color: #11743f; } .badge.post { background: #eaf3fe; color: #0A5BC0; } .badge.del { background: #fdecec; color: #b42318; }
:root[data-theme="dark"] .badge.get { background: #10301f; color: #7fe0a7; }
:root[data-theme="dark"] .badge.post { background: #0f2340; color: #8cc4ff; }
:root[data-theme="dark"] .badge.del { background: #3a1414; color: #ff9b94; }
.endpoint { font: 600 14.5px var(--mono); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; overflow-wrap: anywhere; }
details { border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; margin: 0 0 12px; background: var(--bg); }
details[open] { padding-bottom: 8px; }
summary { cursor: pointer; font-weight: 650; padding: 12px 0; list-style: none; position: relative; padding-right: 24px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 0; top: 10px; font-size: 20px; color: var(--fg-faint); }
details[open] summary::after { content: "\2212"; }

/* pager & footer */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 48px 0 0; }
.pager a { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; font-weight: 650; color: var(--fg); }
.pager a:hover { border-color: var(--brand); text-decoration: none; }
.pager a span { display: block; font-size: 12px; font-weight: 600; color: var(--fg-faint); text-transform: uppercase; letter-spacing: .05em; }
.pager .next { text-align: right; }
.foot { max-width: 820px; border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 0 40px; color: var(--fg-faint); font-size: 14px; }
.foot p { margin: 8px 0 0; }
.footlogo { background: #fff; border-radius: 8px; padding: 4px 8px; box-sizing: content-box; }

/* responsive */
@media (max-width: 1200px) { .shell { grid-template-columns: var(--side) minmax(0, 1fr); } .tocwrap { display: none; } }
@media (max-width: 900px) {
  :root { --top: 56px; }
  .menu { display: flex; }
  .shell { display: block; }
  .sidebar { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; height: 100vh; width: min(300px, 86vw); background: var(--bg); transform: translateX(-100%); transition: transform .2s ease; padding-top: 20px; box-shadow: none; visibility: hidden; }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow); visibility: visible; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(5, 12, 24, .45); z-index: 45; }
  .content { padding: 24px 16px 0; }
  .topbar { padding: 0 10px; gap: 8px; }
  .search { margin-left: 4px; min-width: 0; }
  .kbd, .brandtag, .toplinks > a { display: none; }
  .brandname { display: none; }
  h1 { font-size: 28px; }
  .lede { font-size: 16.5px; }
  .anchor { display: none; }
  .pager { grid-template-columns: 1fr; }
  .results { position: fixed; top: calc(var(--top) - 4px); left: 8px; right: 8px; }
}
@media print { .topbar, .sidebar, .tocwrap, .pager, .copy { display: none !important; } .shell { display: block; } }
ul.checklist { list-style: none; padding-left: 0; }
ul.checklist li { margin: 6px 0; }
ul.checklist label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
ul.checklist input { margin-top: 6px; flex: none; width: 16px; height: 16px; accent-color: var(--brand); }
@media (max-width: 640px) {
  th, td { padding: 8px 10px; }
  td:last-child, th:last-child { min-width: 210px; }
  td code { white-space: normal; }
}
:root[data-theme="dark"] .brand img { background: #fff; border-radius: 7px; padding: 2px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .brand img { background: #fff; border-radius: 7px; padding: 2px; } :root:not([data-theme="light"]) .sidebar a[aria-current="page"] { color: #8cc4ff; } }
td:first-child code { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 640px) { table { width: auto; min-width: 100%; } td:last-child { min-width: 220px; } }
