/* API docs and legal pages. Builds on site.css tokens. */
.doc-shell { max-width: 1200px; margin: 0 auto; padding: 112px 36px 80px; display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; }
.doc-nav { position: sticky; top: 96px; align-self: start; max-height: calc(100vh - 120px); overflow-y: auto; font-size: 14px; }
.doc-nav .grp { font-size: 12px; font-weight: 600; color: var(--faint); margin: 22px 0 8px; }
.doc-nav .grp:first-child { margin-top: 0; }
.doc-nav a { display: block; padding: 5px 10px; margin-left: -10px; border-radius: 8px; color: var(--muted); }
.doc-nav a:hover { color: var(--text); background: var(--surface); }
.doc-nav a.on { color: var(--text); font-weight: 600; background: var(--surface); }
.doc-nav .verb { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; font-weight: 600; letter-spacing: 0; margin-right: 6px; color: var(--faint); }

.doc { min-width: 0; }
.doc h1 { font-size: 52px; line-height: 1.05; letter-spacing: -0.06em; font-weight: 600; margin-bottom: 14px; }
.doc h1 .serif { font-style: italic; letter-spacing: -0.05em; }
.doc .lede { font-size: 18px; color: var(--muted); max-width: 640px; line-height: 1.5; margin-bottom: 40px; }
.doc section { padding: 40px 0; border-top: 1px solid var(--border-soft); scroll-margin-top: 80px; }
.doc h2 { font-size: 28px; letter-spacing: -0.045em; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.doc h3 { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; margin: 24px 0 10px; }
.doc p, .doc li { font-size: 15px; line-height: 1.65; color: #2a2a2a; }
.doc p + p { margin-top: 10px; }
.doc ul, .doc ol { padding-left: 20px; display: grid; gap: 4px; }
.doc a { text-decoration: underline; text-underline-offset: 2px; }
.doc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; letter-spacing: 0; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 6px; padding: 1px 6px; }

.endpoint {
    display: inline-flex; align-items: center; gap: 10px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px; letter-spacing: 0; background: var(--surface); border: 1px solid var(--border-soft);
    border-radius: 999px; padding: 6px 14px 6px 6px; margin: 4px 0 18px;
}
.endpoint b { background: var(--text); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: 11px; }
.endpoint b.get { background: var(--green); color: #052e14; }

.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.params { border: 1px solid var(--border-soft); border-radius: 14px; overflow: hidden; }
.param { padding: 14px 18px; border-bottom: 1px solid var(--border-soft); }
.param:last-child { border-bottom: 0; }
.param .n { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; font-weight: 600; letter-spacing: 0; }
.param .t { font-size: 12px; color: var(--faint); margin-left: 8px; }
.param .req { font-size: 11px; font-weight: 600; color: var(--amber, #b45309); margin-left: 8px; }
.param p { font-size: 14px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

.codebox { background: var(--text); border-radius: 14px; overflow: hidden; position: sticky; top: 90px; }
.codebox + .codebox { margin-top: 14px; position: static; }
.codebox .bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 0 16px; }
.codebox .bar span { font-size: 12px; color: #a1a1aa; }
.codebox pre { padding: 14px 18px 18px; font-size: 12.5px; }
.codebox .copy { background: rgba(255,255,255,0.08); color: #d4d4d8; border: 0; border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 12px; cursor: pointer; }
.codebox .copy:hover { color: #fff; background: rgba(255,255,255,0.14); }

.lang-switch {
    position: sticky; top: 72px; z-index: 5; display: flex; justify-content: flex-end; margin-bottom: -40px; pointer-events: none;
}
.lang-switch .bundle-toggle { margin: 0; pointer-events: auto; box-shadow: 0 4px 16px rgba(0,0,0,0.06); }

.callout { border: 1px solid var(--border-soft); background: var(--surface); border-radius: 14px; padding: 16px 18px; font-size: 14px; color: #2a2a2a; margin: 16px 0; }
.callout b { color: var(--text); }
.tbl-doc { width: 100%; border-collapse: collapse; font-size: 14px; border: 1px solid var(--border-soft); border-radius: 14px; overflow: hidden; display: table; }
.tbl-doc th { text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); background: var(--surface); padding: 10px 16px; border-bottom: 1px solid var(--border-soft); }
.tbl-doc td { padding: 11px 16px; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.tbl-doc tr:last-child td { border-bottom: 0; }

.input-select {
    height: 46px; padding: 0 36px 0 18px; border-radius: 999px; border: 1px solid var(--border-soft); background: #fff;
    font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
}

/* Legal pages */
.legal { max-width: 760px; margin: 0 auto; padding: 120px 24px 80px; }
.legal h1 { font-size: 52px; line-height: 1.05; letter-spacing: -0.06em; font-weight: 600; margin-bottom: 10px; }
.legal h1 .serif { font-style: italic; }
.legal .meta { color: var(--muted); font-size: 14px; margin-bottom: 36px; }
.legal .summary { border: 1px solid var(--border-soft); background: var(--surface); border-radius: 16px; padding: 20px 22px; margin-bottom: 36px; }
.legal .summary h2 { font-size: 15px; margin: 0 0 8px; }
.legal .summary ul { padding-left: 18px; display: grid; gap: 4px; font-size: 15px; color: #2a2a2a; line-height: 1.55; }
.legal h2 { font-size: 22px; letter-spacing: -0.04em; font-weight: 600; margin: 40px 0 10px; scroll-margin-top: 90px; }
.legal h3 { font-size: 16px; font-weight: 600; margin: 22px 0 6px; }
.legal p, .legal li { font-size: 15px; line-height: 1.7; color: #2a2a2a; }
.legal p + p { margin-top: 10px; }
.legal ul { padding-left: 20px; display: grid; gap: 4px; margin: 8px 0; }
.legal a { text-decoration: underline; text-underline-offset: 2px; }
.legal .toc { columns: 2; gap: 24px; font-size: 14px; margin-bottom: 8px; padding-left: 18px; }

/* Shared simple top bar for docs and legal pages */
.nav.solid { background: rgba(255,255,255,0.85); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); box-shadow: 0 1px 0 var(--border-soft); padding-top: 12px; padding-bottom: 12px; }
.nav .links { display: flex; align-items: center; gap: 4px; }
.nav .links a { font-size: 14px; font-weight: 500; padding: 8px 12px; border-radius: 999px; color: var(--muted); }
.nav .links a:hover, .nav .links a.on { color: var(--text); background: var(--surface); }

@media (max-width: 1000px) {
    .two { grid-template-columns: 1fr; }
    .codebox { position: static; }
}
@media (max-width: 860px) {
    .doc-shell { grid-template-columns: 1fr; padding: 96px 20px 64px; gap: 0; }
    .doc-nav { display: none; }
    .doc h1, .legal h1 { font-size: 38px; }
    .nav .links a:not(.keep) { display: none; }
    .legal .toc { columns: 1; }
    .lang-switch { margin-bottom: 0; justify-content: flex-start; }
}
