/* The Workscope API docs. Workscope's own look (apps/web/src/styles.css): a
   white, cool-grey frame, one blue accent, Geist for text and Geist Mono for
   code. Light and dark, following the device unless chosen. */
@font-face { font-family: 'Geist'; font-weight: 400; font-display: swap; src: url('/fonts/geist-sans-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 500; font-display: swap; src: url('/fonts/geist-sans-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Geist'; font-weight: 600 700; font-display: swap; src: url('/fonts/geist-sans-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-weight: 400; font-display: swap; src: url('/fonts/geist-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-weight: 500 700; font-display: swap; src: url('/fonts/geist-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  --bg: #ffffff; --panel: #fafbfc; --line: #e7e9ee; --line-strong: #d5d9e1;
  --fg: #17191f; --muted: #5d6472; --faint: #8a91a0;
  --accent: #2563eb; --accent-soft: #e8effd; --accent-fg: #ffffff;
  --hover: #f1f3f6; --chip: #f2f4f7;
  --code-bg: #f6f7f9; --code-fg: #1f2430;
  --get: #16794a; --get-bg: #e3f6ec; --post: #1d4ed8; --post-bg: #e6efff;
  --put: #a15c00; --put-bg: #fff4e0; --patch: #6d3fd8; --patch-bg: #f1ecff;
  --delete: #b42323; --delete-bg: #fde8e8;
  --shadow: 0 8px 30px rgba(20, 24, 35, 0.12);
  --font: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --top: 60px;
  --side: 264px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #111318; --panel: #15181e; --line: #262a33; --line-strong: #343946;
    --fg: #e8eaef; --muted: #a2a9b8; --faint: #7c8495;
    --accent: #5b8cff; --accent-soft: #1c2740; --accent-fg: #0b1020;
    --hover: #1c2028; --chip: #1f232c; --code-bg: #171a21; --code-fg: #dfe3ea;
    --get: #6fd3a0; --get-bg: #132a1f; --post: #8fb0ff; --post-bg: #17233d;
    --put: #f3bd5c; --put-bg: #2e2412; --patch: #b9a0ff; --patch-bg: #241b3d;
    --delete: #f19494; --delete-bg: #311819;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #111318; --panel: #15181e; --line: #262a33; --line-strong: #343946;
  --fg: #e8eaef; --muted: #a2a9b8; --faint: #7c8495;
  --accent: #5b8cff; --accent-soft: #1c2740; --accent-fg: #0b1020;
  --hover: #1c2028; --chip: #1f232c; --code-bg: #171a21; --code-fg: #dfe3ea;
  --get: #6fd3a0; --get-bg: #132a1f; --post: #8fb0ff; --post-bg: #17233d;
  --put: #f3bd5c; --put-bg: #2e2412; --patch: #b9a0ff; --patch-bg: #241b3d;
  --delete: #f19494; --delete-bg: #311819;
  --shadow: 0 8px 30px rgba(0, 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) + 16px); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; overflow-x: clip; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { letter-spacing: -0.015em; line-height: 1.25; font-weight: 600; }
h1 { font-size: 30px; margin: 0 0 12px; }
h2 { font-size: 21px; margin: 36px 0 10px; }
h3 { font-size: 15px; margin: 22px 0 8px; }
p { margin: 0 0 12px; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: 0.9em; background: var(--chip); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { font-size: 17px; color: var(--muted); max-width: 680px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 50; background: var(--bg); padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- Top bar ---------- */
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--fg); font-weight: 600; font-size: 16px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-sub { color: var(--muted); font-weight: 500; border-left: 1px solid var(--line-strong); padding-left: 8px; }
.search { position: relative; flex: 1; min-width: 0; max-width: 460px; margin-left: 16px; display: flex; align-items: center; height: 38px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--panel); transition: border-color .12s, box-shadow .12s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search-icon { display: grid; place-items: center; width: 34px; color: var(--faint); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--fg); font: inherit; outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search-key { margin-right: 8px; padding: 1px 6px; font-size: 12px; color: var(--faint); border: 1px solid var(--line-strong); border-radius: 5px; }
.search-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: min(70vh, 520px); overflow: auto; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; }
.search-hit { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--fg); }
.search-hit:hover, .search-hit.on { background: var(--hover); text-decoration: none; }
.hit-text { display: flex; flex-direction: column; min-width: 0; }
.hit-text b { font-weight: 500; }
.hit-text small { color: var(--muted); font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }
.search-none { margin: 0; padding: 10px; color: var(--muted); }
.top-link { margin-left: auto; color: var(--muted); font-size: 14px; white-space: nowrap; }
.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: var(--hover); color: var(--fg); }
.menu-btn { display: none; }

/* ---------- Frame ---------- */
.frame { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; border-right: 1px solid var(--line); padding: 16px 12px 40px; background: var(--panel); }
.side-nav { display: flex; flex-direction: column; gap: 1px; }
.side-head { margin: 18px 10px 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }
.side-head:first-child { margin-top: 4px; }
.side-nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--fg); font-size: 14px; }
.side-nav a:hover { background: var(--hover); text-decoration: none; }
.side-nav a[aria-current='page'] { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.count { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.main { min-width: 0; padding: 40px clamp(16px, 4vw, 56px) 80px; }
.main > * { max-width: 1180px; }

/* ---------- Home ---------- */
.hero { padding: 16px 0 8px; }
.hero h1 { font-size: 38px; }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 16px; border-radius: 10px; font: 500 15px/1 var(--font); border: 1px solid transparent; cursor: pointer; }
.btn:hover { text-decoration: none; }
.btn.solid { background: var(--accent); color: var(--accent-fg); }
.btn.solid:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--chip); color: var(--fg); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--line-strong); }
.section-head { margin-top: 44px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.cards.areas { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--fg); background: var(--bg); transition: border-color .12s, transform .12s; }
.card:hover { border-color: var(--line-strong); text-decoration: none; transform: translateY(-1px); }
.card b { font-weight: 600; }
.card span { color: var(--muted); font-size: 14px; }

/* ---------- Guides ---------- */
.prose { max-width: 760px; }
.prose ul { padding-left: 20px; margin: 0 0 12px; }
.prose li { margin: 4px 0; }
table { width: 100%; border-collapse: collapse; margin: 8px 0 16px; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; font-size: 13px; color: var(--muted); }
.change { border-left: 3px solid var(--accent); padding-left: 16px; }
.change h2 { margin-top: 24px; font-size: 17px; }

/* ---------- Code ---------- */
.code-wrap { position: relative; }
.code { margin: 0 0 12px; padding: 14px 16px; background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; font-size: 13px; line-height: 1.55; }
.code code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.copy { position: absolute; top: 8px; right: 8px; padding: 3px 8px; font: 500 12px/1.4 var(--font); color: var(--muted); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; opacity: 0; transition: opacity .12s; }
.code-wrap:hover .copy, .copy:focus-visible { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }
.code-label { margin: 4px 0 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }

/* ---------- Reference ---------- */
.eyebrow { margin: 0 0 4px; font-size: 13px; font-weight: 500; color: var(--accent); }
.ref-head { margin-bottom: 8px; }
.toc-wrap { margin: 16px 0 8px; border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; }
.toc-wrap > summary { cursor: pointer; padding: 8px 0; font-weight: 500; color: var(--muted); }
.toc { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2px 16px; padding-bottom: 10px; }
.toc .side-head { display: none; }
.toc a { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; color: var(--fg); font-size: 14px; min-width: 0; }
.toc a span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.method { display: inline-block; flex: none; min-width: 52px; text-align: center; padding: 1px 6px; border-radius: 6px; font: 600 11px/1.6 var(--mono); letter-spacing: .02em; }
.m-get { color: var(--get); background: var(--get-bg); }
.m-post { color: var(--post); background: var(--post-bg); }
.m-put { color: var(--put); background: var(--put-bg); }
.m-patch { color: var(--patch); background: var(--patch-bg); }
.m-delete { color: var(--delete); background: var(--delete-bg); }
.m-guide { color: var(--muted); background: var(--chip); font-family: var(--font); }
.op { padding: 32px 0 8px; border-top: 1px solid var(--line); margin-top: 28px; }
.op-title { margin: 0 0 8px; font-size: 20px; }
.op-title a { color: var(--fg); }
.endpoint { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.endpoint code { background: none; padding: 0; font-size: 14px; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0 0 8px; font-size: 13px; }
.facts div { display: flex; gap: 6px; align-items: baseline; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.op-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.op-code { position: sticky; top: calc(var(--top) + 16px); min-width: 0; }
.op-code > .code-wrap:first-child .code { max-height: 280px; }
.op-code .code { max-height: 420px; }
.params { font-size: 13px; }
.params td:first-child { white-space: nowrap; }

.fields { list-style: none; margin: 0 0 8px; padding: 0; border-top: 1px solid var(--line); }
.fields.nested { margin: 8px 0 4px 6px; padding-left: 12px; border-top: 0; border-left: 2px solid var(--line); }
.field { padding: 9px 0; border-bottom: 1px solid var(--line); }
.fields.nested .field:last-child { border-bottom: 0; }
.field > details > summary { cursor: pointer; list-style: none; }
.field > details > summary::-webkit-details-marker { display: none; }
.field > details > summary .f-head::after { content: '+ fields'; margin-left: auto; font-size: 12px; color: var(--accent); }
.field > details[open] > summary .f-head::after { content: '− fields'; }
.f-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.f-name { background: none; padding: 0; font-weight: 500; color: var(--fg); font-size: 13.5px; }
.kind { font: 12px var(--mono); color: var(--muted); }
.req, .opt, .nul { font-size: 11px; font-weight: 500; padding: 0 6px; border-radius: 999px; line-height: 18px; }
.req { color: var(--delete); background: var(--delete-bg); }
.opt { color: var(--faint); background: var(--chip); }
.nul { color: var(--muted); background: var(--chip); }
.f-notes { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.alts { display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.alt { border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px 12px; }
.alt-head { margin: 0 0 4px; font-size: 13px; font-weight: 500; }
.response { margin-top: 18px; }
.response > summary { cursor: pointer; list-style: none; }
.response > summary::-webkit-details-marker { display: none; }
.response > summary h3 { display: inline-flex; gap: 8px; align-items: baseline; margin: 0 0 8px; }
.response > summary h3::after { content: 'Show fields'; font: 400 12px var(--font); color: var(--accent); }
.response[open] > summary h3::after { content: 'Hide fields'; }

/* ---------- Try it ---------- */
.try-btn { height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--fg); font: 500 14px var(--font); cursor: pointer; }
.try-btn:hover { background: var(--hover); }
.try { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.try-form { display: flex; flex-direction: column; gap: 10px; }
.try-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.try-field span { color: var(--muted); font-family: var(--mono); }
.try-field em { font-style: normal; font-family: var(--font); color: var(--faint); }
.try-field input, .try-field textarea { width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--bg); color: var(--fg); font: 13px var(--mono); }
.try-field textarea { resize: vertical; }
.try-warn { margin: 0; font-size: 13px; color: var(--put); }
.try-form .btn { align-self: flex-start; }
.try-out { margin-top: 12px; }
.try-status { margin: 0 0 6px; font: 500 13px var(--mono); }
.try-status.ok { color: var(--get); }
.try-status.bad { color: var(--delete); }

/* ---------- Narrower screens ---------- */
@media (max-width: 1100px) {
  .op-grid { grid-template-columns: minmax(0, 1fr); }
  .op-code { position: static; }
}
@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .frame { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; top: var(--top); left: 0; bottom: 0; width: min(300px, 86vw); height: auto; z-index: 25; transform: translateX(-100%); visibility: hidden; transition: transform .2s ease, visibility .2s; }
  .menu-open .side { transform: none; visibility: visible; box-shadow: var(--shadow); }
  .top-link { display: none; }
  .top { gap: 6px; }
  .search { margin-left: 4px; }
  th, td { padding: 8px 6px; }
  .search-key { display: none; }
  .brand-sub { display: none; }
  .main { padding: 28px 16px 64px; }
  h1, .hero h1 { font-size: 26px; }
}
@media (max-width: 520px) {
  .brand span:not(.brand-sub) { display: none; }
  .toc { grid-template-columns: minmax(0, 1fr); }
}
