/* VoxStudio documentation layout. Builds on the tokens in styles.css (light and dark). */

.docs-page {
  --dh: 60px;
  --side: 272px;
  --toc: 232px;
  --code-bg: #121217;
  --code-bar: #1a1a21;
  --code-text: #e6e6ea;
  --code-line: rgba(255, 255, 255, 0.08);
  --surface: color-mix(in srgb, var(--text-1) 4%, transparent);
  --surface-2: color-mix(in srgb, var(--text-1) 7%, transparent);
}
.docs-page .i { flex: none; }

/* ---------------------------------------------------------------- header */
.dh {
  position: sticky; top: 0; z-index: 40; height: var(--dh);
  display: flex; align-items: center; gap: 20px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(24px) saturate(180%); -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 0.5px solid var(--hairline);
}
.dh-left { display: flex; align-items: center; gap: 8px; width: calc(var(--side) - 20px); flex: none; }
.dh .brand { display: flex; align-items: center; gap: 9px; font-weight: 650; font-size: 16px; color: var(--text-1); letter-spacing: -0.01em; }
.dh .brand:hover { text-decoration: none; }
.dh .chip { font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; color: var(--accent); background: color-mix(in srgb, var(--accent) 13%, transparent); }
.dtabs { display: flex; gap: 4px; height: 100%; }
.dtabs a { position: relative; display: flex; align-items: center; padding: 0 12px; font-size: 14px; font-weight: 550; color: var(--text-2); }
.dtabs a:hover { color: var(--text-1); text-decoration: none; }
.dtabs a.on { color: var(--text-1); }
.dtabs a.on::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -0.5px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.dh-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.dh .search {
  display: flex; align-items: center; gap: 8px; height: 34px; width: 240px; padding: 0 10px; border-radius: 10px; cursor: pointer;
  border: 0.5px solid var(--hairline); background: var(--surface); color: var(--text-3); font: inherit; font-size: 13.5px;
}
.dh .search:hover { background: var(--surface-2); color: var(--text-2); }
.dh .search span { flex: 1; text-align: left; }
.docs-page kbd { font-family: var(--font); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 0.5px solid var(--hairline); background: var(--surface); color: var(--text-3); }
.iconbtn, .dh .menu { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--text-2); border: 0.5px solid var(--hairline); background: var(--surface); cursor: pointer; }
.iconbtn:hover { color: var(--text-1); background: var(--surface-2); }
.dh .menu { display: none; }
.dh .dlbtn { display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: #fff; background: linear-gradient(180deg, #2b95ff, var(--accent)); box-shadow: 0 4px 14px rgba(10, 132, 255, 0.35); }
.dh .dlbtn:hover { text-decoration: none; filter: brightness(1.06); }

/* ---------------------------------------------------------------- shell */
.dshell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--toc); max-width: 1480px; margin: 0 auto; }
.dside, .dtoc { position: sticky; top: var(--dh); align-self: start; height: calc(100vh - var(--dh)); overflow-y: auto; }
.dside { padding: 22px 14px 40px 20px; border-right: 0.5px solid var(--hairline); scrollbar-width: thin; }
.sgroup + .sgroup { margin-top: 18px; }
.sgroup h5 { margin: 0 0 6px; padding: 0 10px; font-size: 12px; font-weight: 650; color: var(--text-1); letter-spacing: 0; }
.dside a { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 9px; font-size: 14px; color: var(--text-2); line-height: 1.3; }
.dside a .i { color: var(--text-3); }
.dside a:hover { background: var(--surface); color: var(--text-1); text-decoration: none; }
.dside a.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 11%, transparent); box-shadow: inset 0 0 0 0.5px color-mix(in srgb, var(--accent) 28%, transparent); font-weight: 600; }
.dside a.on .i { color: var(--accent); }

.dmain { min-width: 0; padding: 44px clamp(20px, 4vw, 64px) 40px; }
.dtoc { padding: 44px 20px 40px 8px; }
.toc h5 { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.toc a { display: block; padding: 4px 0 4px 12px; font-size: 13px; line-height: 1.4; color: var(--text-3); border-left: 1.5px solid var(--hairline); }
.toc a.d3 { padding-left: 24px; }
.toc a:hover { color: var(--text-1); text-decoration: none; }
.toc a.on { color: var(--accent); border-left-color: var(--accent); }

/* ---------------------------------------------------------------- content */
.prose { max-width: 760px; margin: 0 auto; font-size: 15.5px; line-height: 1.7; }
.prose h1 {
  position: relative; margin: 0 0 12px; padding-top: 18px; font-family: var(--display);
  font-size: clamp(34px, 4.2vw, 48px); line-height: 1.08; letter-spacing: -0.035em; text-align: left; max-width: none;
}
.prose h1::before { content: ''; position: absolute; top: 0; left: 0; width: 56px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2), #ff6ec7); }
.prose .lead { font-size: 18.5px; line-height: 1.55; color: var(--text-2); margin: 0 0 32px; }
.prose h2, .prose h3, .prose h4 { position: relative; scroll-margin-top: calc(var(--dh) + 20px); letter-spacing: -0.015em; }
.prose h2 { margin: 48px 0 14px; padding-top: 22px; border-top: 0.5px solid var(--hairline); font-size: 24px; font-family: var(--display); }
.prose h3 { margin: 32px 0 10px; font-size: 18.5px; }
.prose h4 { margin: 24px 0 8px; font-size: 16px; }
.prose .anchor { position: absolute; left: -22px; padding-right: 6px; color: var(--text-3); opacity: 0; font-weight: 500; }
.prose h2 .anchor { top: 22px; }
.prose :is(h2, h3, h4):hover .anchor { opacity: 1; text-decoration: none; }
.prose p, .prose li { color: var(--text-1); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 4px; }
.prose li::marker { color: var(--text-3); }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose hr { border: 0; border-top: 0.5px solid var(--hairline); margin: 32px 0; }
.prose :not(pre) > code, .prose .endpoint code {
  font-family: var(--mono); font-size: 0.86em; padding: 2px 6px; border-radius: 6px;
  background: var(--surface-2); border: 0.5px solid var(--hairline); white-space: nowrap;
}
.prose td :not(pre) > code { white-space: normal; overflow-wrap: anywhere; }
.prose img { max-width: 100%; border-radius: 12px; }

/* endpoints */
.endpoint { display: inline-flex; align-items: center; gap: 6px; vertical-align: 1px; }
.method { font-family: var(--mono); font-size: 0.72em; font-weight: 700; letter-spacing: 0.03em; padding: 3px 7px; border-radius: 6px; line-height: 1.2; }
.m-get { color: #30b0ff; background: rgba(48, 176, 255, 0.14); }
.m-post { color: #2fbf71; background: rgba(47, 191, 113, 0.15); }
.m-put, .m-patch { color: #f5a524; background: rgba(245, 165, 36, 0.15); }
.m-delete { color: #ff5a5f; background: rgba(255, 90, 95, 0.14); }
.m-ws { color: #b278ff; background: rgba(178, 120, 255, 0.15); }
.prose h2 .endpoint, .prose h3 .endpoint { font-size: 0.86em; }
.prose h2 .endpoint code, .prose h3 .endpoint code { font-size: 0.9em; background: none; border: 0; padding: 0; }

/* tables */
.tablewrap { margin: 18px 0; overflow-x: auto; border: 0.5px solid var(--hairline); border-radius: 14px; background: var(--surface); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.5; }
.prose th { text-align: left; font-size: 12px; font-weight: 650; letter-spacing: 0.02em; color: var(--text-2); background: var(--surface); padding: 10px 14px; border-bottom: 0.5px solid var(--hairline); }
.prose td { padding: 10px 14px; border-bottom: 0.5px solid var(--hairline); vertical-align: top; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover td { background: color-mix(in srgb, var(--text-1) 2.5%, transparent); }

/* callouts */
.callout { margin: 20px 0; padding: 12px 16px 12px 16px; border-radius: 14px; border: 0.5px solid; font-size: 14.5px; }
.callout .ctitle { display: flex; align-items: center; gap: 7px; font-weight: 650; margin-bottom: 2px; }
.callout p { margin: 4px 0 0; }
.c-note { --c: var(--accent); }
.c-tip { --c: #2fbf71; }
.c-warning { --c: #f5a524; }
.c-important { --c: #b278ff; }
.callout { border-color: color-mix(in srgb, var(--c) 35%, transparent); background: color-mix(in srgb, var(--c) 8%, transparent); }
.callout .ctitle { color: var(--c); }
.prose blockquote { margin: 18px 0; padding: 10px 16px; border-left: 3px solid var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); border-radius: 0 12px 12px 0; }
.prose blockquote p { margin: 4px 0; }

/* code */
.codeblock { margin: 18px 0; border-radius: 14px; overflow: hidden; background: var(--code-bg); border: 0.5px solid rgba(255, 255, 255, 0.1); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); }
.codebar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 0 8px 0 14px; background: var(--code-bar); border-bottom: 0.5px solid var(--code-line); }
.codetitle { font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.55); letter-spacing: 0.01em; }
.codetabs { display: flex; gap: 2px; margin-left: -6px; }
.codetabs button { font: inherit; font-size: 12.5px; font-weight: 600; padding: 9px 10px 8px; color: rgba(255, 255, 255, 0.5); background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; }
.codetabs button:hover { color: rgba(255, 255, 255, 0.85); }
.codetabs button[aria-selected='true'] { color: #fff; border-bottom-color: var(--accent); }
.copy { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: rgba(255, 255, 255, 0.55); background: none; border: 0; cursor: pointer; }
.copy:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.copy.done { color: #2fbf71; }
.codeblock pre { margin: 0; padding: 16px 18px; overflow-x: auto; background: none; border: 0; border-radius: 0; }
.codeblock code { font-family: var(--mono); font-size: 13px; line-height: 1.65; color: var(--code-text); background: none; border: 0; padding: 0; white-space: pre; }
.hljs-comment, .hljs-quote { color: #7c8193; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-meta .hljs-keyword { color: #c792ea; }
.hljs-string, .hljs-attr + .hljs-string, .hljs-regexp { color: #a5e07a; }
.hljs-number, .hljs-literal, .hljs-symbol { color: #f7a26b; }
.hljs-attr, .hljs-attribute, .hljs-property { color: #7fc8ff; }
.hljs-title, .hljs-title.function_, .hljs-section { color: #82aaff; }
.hljs-variable, .hljs-template-variable, .hljs-params { color: #f2d48a; }
.hljs-meta, .hljs-punctuation { color: #9aa1b3; }

/* pager + footer */
.pager { max-width: 760px; margin: 56px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager a { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border-radius: 14px; border: 0.5px solid var(--hairline); background: var(--surface); }
.pager a:hover { text-decoration: none; border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.pager .next { text-align: right; align-items: flex-end; }
.pager .lbl { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); }
.pager .ttl { font-size: 15px; font-weight: 600; color: var(--text-1); }
.dfoot { max-width: 760px; margin: 28px auto 0; padding-top: 18px; border-top: 0.5px solid var(--hairline); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-3); }
.dfoot a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }

/* ---------------------------------------------------------------- search */
.sdialog { position: fixed; inset: 0; z-index: 80; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(3px); }
.sdialog[hidden] { display: none; }
.sbox { width: min(640px, 100%); border-radius: 18px; overflow: hidden; background: var(--glass-strong); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%); border: 0.5px solid var(--hairline); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); }
.sfield { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 56px; border-bottom: 0.5px solid var(--hairline); color: var(--text-3); }
.sfield input::-webkit-search-cancel-button { display: none; }
.sfield input { flex: 1; min-width: 0; font: inherit; font-size: 17px; color: var(--text-1); background: none; border: 0; outline: 0; }
.sresults { max-height: min(60vh, 520px); overflow-y: auto; padding: 8px; }
.sresults a { display: block; padding: 10px 12px; border-radius: 11px; color: var(--text-1); }
.sresults a:hover, .sresults a.on { text-decoration: none; background: color-mix(in srgb, var(--accent) 14%, transparent); }
.sresults .st { font-weight: 600; font-size: 14.5px; }
.sresults .ss { font-size: 11.5px; color: var(--text-3); margin-bottom: 2px; }
.sresults .sx { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sresults mark { background: color-mix(in srgb, var(--accent) 28%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.sresults .empty { padding: 28px 12px; text-align: center; color: var(--text-3); font-size: 14px; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1240px) { .dshell { grid-template-columns: var(--side) minmax(0, 1fr); } .dtoc { display: none; } }
@media (max-width: 900px) {
  .dshell { grid-template-columns: minmax(0, 1fr); }
  .dh { gap: 10px; padding: 0 12px; }
  .dh-left { width: auto; }
  .dh .menu { display: grid; }
  .dtabs { display: none; }
  .dh .search { width: 34px; padding: 0; justify-content: center; }
  .dh .search span, .dh .search kbd, .dh .dlbtn span { display: none; }
  .dh .dlbtn { padding: 0 10px; }
  .dside { position: fixed; top: var(--dh); left: 0; bottom: 0; z-index: 30; width: min(300px, 86vw); height: calc(100dvh - var(--dh)); background: var(--glass-strong); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); transform: translateX(-102%); transition: transform 0.25s ease; box-shadow: 20px 0 50px rgba(0, 0, 0, 0.3); }
  .docs-page.nav-open .dside { transform: none; }
  .dside .mtabs { display: flex; }
  .dmain { padding-top: 28px; }
  .prose .anchor { display: none; }
  .pager { grid-template-columns: 1fr; }
}
.mtabs { display: none; gap: 6px; margin: 0 0 18px; flex-wrap: wrap; }
.mtabs a { padding: 5px 11px !important; border-radius: 999px !important; border: 0.5px solid var(--hairline); font-size: 13px !important; }
