/* API documentation (resources/views/docs, components/docs-page): top bar, index beside the text, code samples, field tables. */
.plain-wrap:has(> .docs) { display: block; padding: 0; }
.docs { width: min(1240px, 100%); margin: 0 auto; padding: 0 28px 40px; }

.docs-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 14px 0; background: var(--bg); border-bottom: 1px solid var(--line); }
.docs-brand { line-height: 0; }
.docs-brand:hover { text-decoration: none; }
.docs-section { padding-left: 12px; border-left: 1px solid var(--line); font-weight: 650; color: var(--dim); }
.docs-langs { display: flex; gap: 2px; margin-left: auto; }
.docs-langs a { padding: 6px 8px; border-radius: 8px; font-size: 13px; font-weight: 650; color: var(--dim); }
.docs-langs a:hover { color: var(--ink); text-decoration: none; background: var(--panel); }
.docs-langs a[aria-current] { color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); }

.docs-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 56px; padding-top: 36px; }
.docs-toc { position: sticky; top: 92px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; }
.docs-toc summary { list-style: none; pointer-events: none; margin: 0 0 8px 10px; font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.docs-toc summary::-webkit-details-marker { display: none; }
.docs-toc ol { display: grid; gap: 1px; margin: 0; padding: 0; list-style: none; }
.docs-toc a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; line-height: 1.4; }
.docs-toc a:hover { color: var(--ink); text-decoration: none; background: var(--panel); }
.docs-toc .is-sub a { padding-left: 22px; font: 12.5px/1.5 var(--mono); color: var(--dim); }

.docs-body { display: grid; gap: 16px; align-content: start; max-width: 820px; min-width: 0; line-height: 1.7; color: var(--ink-2); }
.docs-body h1 { color: var(--ink); }
.docs-body h2 { margin-top: 24px; padding-top: 28px; border-top: 1px solid var(--line); font-size: 23px; color: var(--ink); scroll-margin-top: 80px; }
.docs-body h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; font: 650 17px/1.3 var(--mono); letter-spacing: 0; color: var(--ink); scroll-margin-top: 80px; }
.docs-body h4 { margin: 4px 0 -6px; font-size: 14px; font-weight: 650; color: var(--ink); }
.docs-body strong { color: var(--ink); }
.docs-body ul, .docs-body ol { display: grid; gap: 6px; margin: 0; padding-left: 22px; }
.docs-body li::marker { color: var(--accent); }
.docs-body code { font-size: 12.5px; overflow-wrap: anywhere; }
.docs-lead { font-size: 17px; }
.docs-url { padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); font: 13px/1.5 var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.docs-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--ink); font-size: 14px; line-height: 1.6; }
.docs-note .icon { margin-top: 3px; color: var(--accent-strong); }
.docs-note.is-warn { background: var(--warn-soft); }
.docs-note.is-warn .icon { color: var(--warn); }

.docs-method { display: inline-block; min-width: 58px; padding: 1px 8px; border-radius: 6px; font: 700 12px/1.7 var(--mono); text-align: center; letter-spacing: .03em; }
.docs-method.is-get { background: var(--panel); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.docs-method.is-post { background: var(--accent-soft); color: var(--accent-strong); }
.docs-method.is-put { background: var(--warn-soft); color: var(--warn); }
.docs-method.is-delete { background: var(--bad-soft); color: var(--bad); }

.docs-code { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); overflow: hidden; }
.docs-code-label { padding: 7px 52px 7px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); font-size: 12px; font-weight: 650; color: var(--dim); }
.docs-code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.6 var(--mono); color: var(--ink); tab-size: 4; }
.docs-code pre code { padding: 0; border: 0; background: none; font: inherit; overflow-wrap: normal; }
.docs-code .icon-btn { position: absolute; top: 3px; right: 6px; width: 30px; height: 30px; border-color: transparent; background: transparent; color: var(--dim); }
.docs-code .icon-btn:hover { color: var(--ink); border-color: var(--line); background: var(--panel); }

.docs-table { min-width: 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
.docs-table table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.55; }
.docs-table th { padding: 9px 14px; border-bottom: 1px solid var(--line); background: var(--panel-2); text-align: left; font-size: 12.5px; font-weight: 600; color: var(--dim); white-space: nowrap; }
.docs-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.docs-table tr:last-child td { border-bottom: 0; }
.docs-table td:not(:last-child) { white-space: nowrap; } /* names and codes on one line, the description wraps */
.docs-table td:not(:last-child) code { overflow-wrap: normal; }
.docs-req { display: block; margin-top: 2px; font-size: 12px; font-weight: 650; color: var(--warn); }
.docs-type { color: var(--dim); white-space: nowrap; }

.docs-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--dim); }
.docs-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.docs-foot a { color: var(--dim); }

@media (max-width: 1000px) {
    .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 24px; }
    .docs-toc { position: static; max-height: none; padding: 4px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
    .docs-toc summary { pointer-events: auto; margin: 0; padding: 8px 6px; cursor: pointer; font-size: 13px; letter-spacing: .04em; color: var(--ink); }
    .docs-toc summary::after { content: "+"; float: right; font-size: 16px; line-height: 1; color: var(--dim); }
    .docs-toc[open] summary::after { content: "−"; }
    .docs-toc nav { padding-bottom: 6px; }
}
@media (max-width: 640px) {
    .docs { padding: 0 16px 32px; }
    .docs-top { position: static; flex-wrap: wrap; row-gap: 8px; }
    .docs-section { display: none; }
    .docs-langs { order: 3; width: 100%; margin-left: -8px; }
    .docs-top .theme-toggle { margin-left: auto; }
    .docs-body h2 { font-size: 20px; }
    .docs-table thead { display: none; }
    .docs-table tr { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
    .docs-table tr:last-child { border-bottom: 0; }
    .docs-table td { padding: 0; border: 0; }
    .docs-table td:nth-child(n+3) { grid-column: 1 / -1; }
}
@media print {
    .docs-top, .docs-toc, .docs-code .icon-btn, .docs-foot { display: none; }
    .docs-layout { display: block; }
}
