/* p12b: the public API reference. Tokens come from gsh.css; this file is layout, code blocks and the tab states. No external references. */
.apidocs-body { background: var(--surface-0); color: var(--text-primary); font-family: var(--font-ui); margin: 0; }
.apidocs { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 32px; max-width: 78rem; margin: 0 auto; padding: 24px 16px 64px; }
.api-index { position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; font-size: 14px; }
.api-index ul { list-style: none; margin: 0; padding: 0; }
.api-index ul ul { padding-left: 14px; }
.api-index li { margin: 6px 0; }
.api-index a { color: var(--text-secondary); text-decoration: none; }
.api-index a:hover, .api-index a:focus { color: var(--accent); }
.api-index-title { font-weight: 600; margin: 0 0 12px; }
.api-index .count { color: var(--text-tertiary); font-size: 12px; }
.api-main { min-width: 0; }
.api-main h1 { font-size: 28px; margin: 0 0 8px; }
.api-main section { margin-top: 40px; scroll-margin-top: 16px; }
.api-main h2 { font-size: 22px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }
.api-main h3 { font-size: 17px; margin: 24px 0 8px; }
.api-main .sub-h { font-size: 17px; margin: 16px 0 8px; }
.api-main code { font-family: var(--font-mono); font-size: 13px; overflow-wrap: anywhere; }
.api-steps { padding-left: 20px; }
.api-events { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.api-events code, .route h4 code { background: var(--surface-2-shade); padding: 2px 6px; border-radius: var(--radius-sm); }
.tag-group { margin-top: 32px; }
.route { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px; margin: 16px 0; scroll-margin-top: 16px; }
.route h4 { margin: 0 0 8px; font-size: 15px; overflow-wrap: anywhere; }
.route .route-method { color: var(--accent); font-weight: 600; }
.route .anchor { color: var(--text-tertiary); text-decoration: none; margin-left: 4px; }
.route-auth { margin: 0 0 4px; font-size: 13px; color: var(--text-secondary); }
.route-summary { margin: 0 0 12px; }
.route .where { font-size: 11px; color: var(--text-tertiary); }
.api-main .dtable { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 16px; }
.api-main .dtable th, .api-main .dtable td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.lang { margin: 8px 0 4px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-secondary); }
pre { max-width: 100%; overflow-x: auto; box-sizing: border-box; margin: 0 0 12px; padding: 12px 14px; background: #14171f; color: #e6e9f2; border-radius: var(--radius-md); font-size: 13px; line-height: 1.5; tab-size: 2; }
pre code { font-family: var(--font-mono); font-size: 13px; overflow-wrap: normal; white-space: pre; }
pre.plain { background: var(--surface-2-shade); color: var(--text-primary); border: 1px solid var(--border); }
pre:focus-visible, .tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 12px; font: inherit; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
/* With JS one sample shows at a time; without it they stack, each under its language label. */
html.js .samples .sample-wrap { display: none; }
html.js .samples .sample-wrap.on { display: block; }
html.js .samples .sample-wrap .lang { display: none; }
@media (max-width: 860px) {
  .apidocs { display: block; padding: 16px; }
  .api-index { position: static; max-height: none; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
  .api-main .dtable thead { display: none; }
  .api-main .dtable tr { display: block; padding: 6px 0; border-bottom: 1px solid var(--border); }
  .api-main .dtable td { display: block; border: 0; padding: 2px 0; }
  .api-main .dtable td::before { content: attr(data-label) ": "; color: var(--text-tertiary); font-size: 12px; }
  .route { padding: 12px; }
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .apidocs-body { background: #0f1117; color: #e6e9f2; }
}
