/* Docs + 404 pages. Extends app.css. */
.docs { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 56px 32px 40px; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); margin-bottom: 22px; }
.crumbs a { text-decoration: none; } .crumbs a:hover { color: var(--ink); }
.crumbs .i { width: 15px; height: 15px; }
.docs-head { max-width: 760px; margin-bottom: 56px; }
.docs h1 { font-size: clamp(38px, 5vw, 60px); letter-spacing: -.045em; }
.docs-head > p { margin-top: 18px; color: var(--muted); font-size: 18px; max-width: 52ch; }
.base { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 28px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); width: fit-content; max-width: 100%; }
.base-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.base code { padding: 0; background: none; font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }

.doc-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 56px; align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 24px); display: grid; gap: 2px; }
.toc a { padding: 8px 14px; border-left: 2px solid var(--line); font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; transition: color .18s, border-color .18s; }
.toc a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.doc-body { max-width: 780px; min-width: 0; }
.doc-section { padding-bottom: 56px; margin-bottom: 56px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 20px); }
.doc-section:last-child { border-bottom: 0; margin-bottom: 0; }
.doc-section h2 { font-size: 28px; margin-bottom: 14px; }
.doc-section p, .doc-section li { color: var(--muted); font-size: 16px; line-height: 1.75; }
.doc-section p + * , .doc-section .code-tabs { margin-top: 16px; }
.doc-section ul { padding-left: 20px; display: grid; gap: 6px; margin-top: 12px; }
.doc-section a { color: var(--accent); text-underline-offset: 3px; }
.doc-section code { color: var(--ink-2); }

.endpoint { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; }
.endpoint code { background: none; padding: 0; color: var(--ink); font-size: 14px; }
.endpoints .endpoint { margin: 8px 0; }
.method { padding: 3px 8px; border-radius: 6px; font: 700 11.5px var(--f-body); letter-spacing: .02em; background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.method.post { background: var(--accent-soft); color: var(--accent); }
.method.delete { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }

.code-tabs { border-radius: 16px; background: #0b0d14; color: #dfe3f0; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); overflow: hidden; }
.ct-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 8px 8px 8px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.ct-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.ct-tabs button { height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: none; color: #8d93a8; font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: color .18s, background .18s; }
.ct-tabs button:hover { color: #fff; }
.ct-tabs button[aria-selected="true"] { color: #fff; background: rgba(255, 255, 255, .09); }
.ct-label { padding-left: 10px; font-size: 13px; font-weight: 600; color: #8d93a8; }
.ct-copy { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 9px; background: none; color: #c3c8d8; font-size: 13px; font-weight: 600; cursor: pointer; flex: none; transition: background .18s, color .18s; }
.ct-copy:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.ct-copy .i { width: 15px; height: 15px; }
.ct-copy.done { color: #3ddc97; border-color: rgba(61, 220, 151, .4); }
.code-tabs pre { padding: 18px 20px; overflow: auto; font: 13.5px/1.8 var(--f-mono); white-space: pre; tab-size: 2; }
.code-tabs code { background: none; padding: 0; color: inherit; font: inherit; }
.base .ct-copy { border-color: var(--line-2); color: var(--ink-2); }
.base .ct-copy:hover { background: var(--surface-2); color: var(--ink); }
.base .ct-copy.done { color: var(--ok); border-color: var(--ok); }

.callout { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--accent-soft); font-size: 15px !important; color: var(--ink-2) !important; margin-top: 16px; }
.callout .i { color: var(--accent); margin-top: 3px; width: 18px; height: 18px; }
.table-wrap { overflow-x: auto; margin-top: 16px; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 16px; vertical-align: top; }
th { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--surface); }
td { color: var(--muted); border-top: 1px solid var(--line); }
td:first-child { white-space: nowrap; }

.notfound { flex: 1; display: grid; align-content: center; justify-items: center; text-align: center; gap: 14px; padding: 72px 24px; max-width: 560px; margin: 0 auto; }
.nf-mark { width: 72px; height: 72px; filter: drop-shadow(0 14px 28px rgba(90, 86, 240, .4)); }
.nf-code { font: 700 15px var(--f-display); color: var(--accent); letter-spacing: .04em; }
.notfound h1 { font-size: clamp(34px, 6vw, 52px); }
.nf-actions { margin-top: 12px; flex-wrap: wrap; justify-content: center; gap: 12px; }
.foot { margin-top: 96px; }

@media (max-width: 960px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .toc { position: sticky; top: var(--header-h); z-index: 6; display: flex; overflow-x: auto; gap: 6px; margin: 0 -32px; padding: 10px 32px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); scrollbar-width: none; }
  .toc::-webkit-scrollbar { display: none; }
  .toc a { flex: none; border: 0; border-radius: 999px; padding: 8px 14px; background: var(--surface-2); }
  .toc a.on { background: var(--accent-soft); color: var(--accent); }
}
@media (max-width: 719px) {
  .docs { padding: 24px 16px 24px; }
  .docs-head { margin-bottom: 28px; }
  .docs-head > p { font-size: 16px; }
  .toc { margin: 0 -16px; padding: 10px 16px; }
  .doc-section { padding-bottom: 36px; margin-bottom: 36px; }
  .doc-section h2 { font-size: 24px; }
  .code-tabs pre { font-size: 12px; padding: 14px 16px; }
  .base { width: 100%; }
  .base code { flex: 1; min-width: 0; white-space: nowrap; }
  .foot { margin-top: 56px; }
}

.docs, .doc-layout, .doc-body { min-width: 0; }
