/*
 * The API docs page (WP13), laid out like the Scope page's API explorer: a contents rail, one reading
 * column, endpoint cards with Request / Response / Ruby tabs. Colours and fonts come from tokens.css.
 * Everything is scoped under body.docs because the console's layout links every stylesheet.
 */
.docs { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 16px; line-height: 1.6; }
.docs *, .docs *::before, .docs *::after { box-sizing: border-box; }
.docs a { color: var(--accent); }
.docs :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.docs h1, .docs h2, .docs h3 { font-family: var(--f-display); line-height: 1.15; margin: 0; text-wrap: balance; }
.docs h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); font-weight: 800; letter-spacing: -.02em; }
.docs h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 750; letter-spacing: -.01em; }
.docs h3 { font-size: 1.12rem; font-weight: 700; }
.docs p { margin: 0; }
.docs code, .docs pre { font-family: var(--f-mono); font-size: .86em; }
.docs p code, .docs td code, .docs dd code { overflow-wrap: anywhere; background: var(--code); border-radius: 4px; padding: 0 .25rem; }
.docs .eyebrow { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.docs .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.docs .skip { position: absolute; left: -999px; top: .5rem; background: var(--surface); padding: .3rem .6rem; border-radius: 6px; z-index: 20; }
.docs .skip:focus { left: .5rem; }

.docs-top { background: var(--surface); border-bottom: 1px solid var(--rule); }
.docs-top-in { max-width: 76rem; margin: 0 auto; padding: 2.5rem 16px 2rem; display: grid; gap: .9rem; }
.docs-top-in > p:not(.eyebrow):not(.brand-line) { font-size: 1.12rem; max-width: 46rem; }
.docs .docs-mark { font-size: 1.15rem; justify-self: start; margin-bottom: .4rem; }
.docs .brand-line { font-weight: 600; color: var(--muted); }
.docs-facts { display: flex; flex-wrap: wrap; gap: .5rem 2rem; margin: .3rem 0 0; font-size: .9rem; }
.docs-facts dt { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.docs-facts dd { margin: 0; min-width: 0; }

.docs-shell { max-width: 76rem; margin: 0 auto; padding-inline: 16px; display: grid; grid-template-columns: 17rem minmax(0, 1fr); gap: 2.5rem; }
.docs-toc { position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; padding-block: 2rem; font-size: .86rem; }
.docs-toc ol { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; gap: .1rem; }
.docs-toc a { display: flex; gap: .4rem; align-items: baseline; padding: .25rem .5rem; border-radius: 6px; color: var(--muted); text-decoration: none; min-width: 0; }
.docs-toc a:hover { color: var(--ink); background: var(--tint); }
.docs-toc .toc-grp { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: .9rem 0 .2rem; }
.docs-toc .toc-grp a { padding: 0; display: inline; color: inherit; }
.docs-toc .path { font-family: var(--f-mono); font-size: .74rem; overflow-wrap: anywhere; }

.docs-main { padding-block: 2rem 4rem; min-width: 0; display: grid; gap: 3.5rem; }
.docs-group { display: grid; gap: 1rem; min-width: 0; scroll-margin-top: 1rem; }
.docs-group > p { max-width: 46rem; }
.start-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.docs .card { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1rem 1.1rem; display: grid; gap: .5rem; align-content: start; font-size: .93rem; scroll-margin-top: 1rem; }

.endpoint { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 1rem 1.1rem; display: grid; gap: .7rem; min-width: 0; scroll-margin-top: 1rem; }
.endpoint > p { max-width: 50rem; font-size: .95rem; }
.endpoint-head { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; }
.endpoint-path { display: flex; align-items: baseline; gap: .5rem; min-width: 0; }
.endpoint-path .path { font-size: .9rem; overflow-wrap: anywhere; min-width: 0; }
.docs .verb { font-family: var(--f-mono); font-size: .7rem; font-weight: 500; padding: .05rem .4rem; border-radius: 3px; color: #fff; flex: none; }
.docs .verb-get { background: var(--ai); }
.docs .verb-post { background: var(--accent); }
.docs .verb-put, .docs .verb-patch { background: var(--warn); }
.docs .verb-delete { background: var(--bad); }
:root[data-theme="dark"] .docs .verb { color: #10131A; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .docs .verb { color: #10131A; } }
.docs .tag { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; padding: .1rem .45rem; border-radius: 4px; border: 1px solid var(--rule); color: var(--muted); white-space: nowrap; }
.docs .tag.human { color: var(--human); border-color: color-mix(in srgb, var(--human) 45%, transparent); }
.docs .tag.acc { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.docs .note { font-size: .88rem; color: var(--muted); border-left: 3px solid var(--ai); padding-left: .6rem; }

.docs .scroll { overflow-x: auto; }
.docs table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.docs th, .docs td { text-align: left; padding: .4rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.docs th { font-weight: 600; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; }
.docs .req { color: var(--bad); font-size: .75rem; }

.docs .tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--rule); }
.docs .tabs button { font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; padding: .35rem .7rem; cursor: pointer; color: var(--muted); font-size: .88rem; }
.docs .tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.docs .pane { display: grid; gap: .5rem; min-width: 0; }
.docs .pane[hidden] { display: none; }
.docs .response-head { font-size: .88rem; }
.docs .response-head .status { font-family: var(--f-mono); font-weight: 500; }
.docs pre.code { margin: 0; background: var(--code); border-radius: 6px; padding: .8rem .9rem; overflow-x: auto; line-height: 1.5; font-size: .8rem; color: var(--ink); }
.docs pre.code code { font-size: inherit; }
.docs pre.code mark { background: color-mix(in srgb, var(--accent) 18%, transparent); color: inherit; border-radius: 2px; }

.docs-foot { max-width: 76rem; margin: 0 auto; padding: 1rem 16px 2rem; border-top: 1px solid var(--rule); font-size: .82rem; color: var(--muted); }

@media (max-width: 900px) {
  .docs-shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs-toc { position: static; max-height: none; padding-block: 1rem 0; }
  .docs-toc ol { display: flex; flex-wrap: wrap; gap: .35rem; }
  .docs-toc a { border: 1px solid var(--rule); border-radius: 99px; padding: .15rem .6rem; }
  .start-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { .docs * { transition: none !important; } }
