@import './theme.css';
@import './site-navigation.css';
* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root { scroll-padding-top: calc(var(--site-header-height) + 24px); }
body { margin: 0; background: var(--background); color: var(--text); font: 16px/1.75 -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.muted { color: var(--muted); }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button, select { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 5px 10px; min-height: 34px; font-size: 12px; cursor: pointer; }
button:hover, select:hover { background: var(--surface-soft); }
button:disabled { opacity: .5; cursor: default; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.primary { background: var(--accent); color: var(--button-text); border-color: var(--accent); font-weight: 600; }
.primary:hover { background: var(--accent); filter: brightness(.95); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
html:not(.js) .js-only { display: none; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 30; background: var(--surface); padding: 12px; }
.skip-link:focus { top: 8px; }
.docs-layout { display: grid; grid-template-columns: 230px minmax(0, 800px) 190px; gap: 48px; max-width: 1410px; margin: 0 auto; padding: 0 30px; }
.sidebar { position: sticky; top: 72px; align-self: start; height: calc(100dvh - 72px); border-right: 1px solid var(--border); padding-right: 24px; overflow: auto; }
.sidebar-inner { padding: 32px 0; }
.chapter-menu summary { display: none; }
.eyebrow { font-size: 10px; line-height: 1.4; letter-spacing: .13em; font-weight: 650; color: var(--accent); margin: 0 0 18px; }
.search-trigger { width: 100%; text-align: left; display: flex; justify-content: space-between; align-items: center; color: var(--muted); margin-bottom: 34px; padding: 8px 10px; }
kbd { font: inherit; font-size: 10px; line-height: 1.4; color: inherit; opacity: .65; }
.sidebar nav { display: flex; flex-direction: column; gap: 5px; }
.sidebar nav a { display: flex; gap: 12px; align-items: baseline; font-size: 13px; line-height: 1.5; padding: 9px 10px; margin-left: -10px; text-decoration: none; border-radius: 6px; color: var(--muted); }
.sidebar nav a span { font-size: 10px; opacity: .65; font-variant-numeric: tabular-nums; }
.sidebar nav a[aria-current] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.sidebar nav a:hover { background: var(--surface-soft); }
.sidebar-footer { display: flex; flex-direction: column; gap: 10px; margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 11px; color: var(--muted); }
.sidebar-footer a { color: var(--muted); text-decoration: none; }
main { min-width: 0; padding: 42px 0 36px; }
.chapter-meta { display: flex; justify-content: space-between; align-items: baseline; color: var(--muted); font-size: 11px; }
h1 { font-size: 40px; line-height: 1.2; letter-spacing: -1.4px; font-weight: 550; margin: 0 0 28px; }
h2 { font-size: 25px; line-height: 1.3; letter-spacing: -.5px; font-weight: 550; margin: 48px 0 18px; }
h3 { font-size: 19px; line-height: 1.4; font-weight: 600; margin: 32px 0 12px; }
h4 { font-size: 15px; margin: 24px 0 10px; }
.heading-anchor { color: inherit; text-decoration: none; }
.heading-anchor:hover { color: var(--accent); text-decoration: none; }
p { margin: 0 0 20px; }
article > p:first-of-type { color: var(--muted); font-size: 17px; }
article li { padding-left: 3px; margin: 5px 0; }
article ul, article ol { padding-left: 24px; }
code, pre { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; }
:not(pre) > code { background: var(--surface-soft); border-radius: 4px; padding: 2px 4px; font-size: .85em; overflow-wrap: anywhere; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 18px 20px; font-size: 12px; line-height: 1.8; overflow: auto; tab-size: 4; }
pre code { font-size: inherit; }
article table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 13px; margin: 22px 0; }
th { text-align: left; font-weight: 600; background: var(--surface-soft); }
th, td { border: 1px solid var(--border); padding: 10px 13px; min-width: 90px; }
blockquote, .warning { border-left: 3px solid var(--accent); background: var(--accent-soft); margin: 24px 0; padding: 16px 20px; font-size: 14px; }
blockquote p:last-child, .warning p:last-child { margin: 0; }
.page-toc { position: sticky; top: 72px; align-self: start; padding-top: 45px; max-height: calc(100dvh - 72px); overflow: auto; }
.page-toc nav { display: flex; flex-direction: column; border-left: 1px solid var(--border); }
.page-toc a { font-size: 11px; line-height: 1.5; color: var(--muted); text-decoration: none; padding: 6px 0 6px 16px; }
.page-toc a[aria-current], .page-toc a:hover { color: var(--accent); }
.page-toc .toc-level-3 { padding-left: 26px; font-size: 10px; }
.page-toc .back-top { display: inline-block; padding: 24px 0; }
.code-example { margin: 24px 0 30px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); overflow: hidden; scroll-margin-top: 96px; }
.example-header { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 9px 14px; border-bottom: 1px solid var(--border); min-height: 48px; }
.example-title { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 11px; text-decoration: none; }
.example-number { color: var(--muted); font-size: 10px; }
.file-dot { display: inline-block; width: 6px; height: 6px; background: var(--accent); border-radius: 100%; flex-shrink: 0; }
.example-actions { display: flex; gap: 6px; }
.example-actions button { background: transparent; border-color: transparent; font-size: 10px; padding: 3px 5px; min-height: 28px; color: var(--muted); }
.example-actions button:first-child { color: var(--accent); }
.code-example .example-static { border: 0; border-radius: 0; margin: 0; padding: 18px 20px; }
.example-note, .editing-note, .example-status, .stage-hint { font-size: 11px; color: var(--muted); padding: 10px 15px; margin: 0; border-top: 1px solid var(--border); }
.example-status[data-state="success"] { color: var(--accent); }
.example-status[data-state="error"] { color: var(--error); background: var(--error-bg); }
.editing-note { background: var(--background); border-top: 0; }
.editing-note button { border: 0; background: transparent; color: var(--accent); padding: 0 3px; font-size: inherit; min-height: auto; }
.original-source, .output-comparison { padding: 12px 15px; font-size: 12px; border-top: 1px solid var(--border); }
.original-source p, .output-comparison p { margin-bottom: 8px; }
.example-toolbar, .example-bottom { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--border); }
.example-toolbar { font-size: 11px; }
.example-toolbar select { font-size: 11px; max-width: 150px; }
.example-toolbar kbd { display: none; }
.example-bottom button { border-color: transparent; background: transparent; color: var(--muted); font-size: 10px; }
.example-bottom button:last-child { margin-left: auto; }
input[type="checkbox"] { accent-color: var(--accent); }
.example-tabs { display: none; }
.source-editor { min-width: 0; }
.output-pane { min-width: 0; border-top: 1px solid var(--border); }
.output-label { display: flex; justify-content: space-between; gap: 10px; font-size: 10px; padding: 8px 14px; color: var(--muted); background: var(--background); }
.output-editor { height: 240px; }
.split .example-panes { display: grid; grid-template-columns: 1fr 1fr; }
.split .output-pane { border-top: 0; border-left: 1px solid var(--border); }
.diagnostic { color: var(--error); background: var(--error-bg); border: 0; border-radius: 0; font-size: 11px; white-space: pre-wrap; overflow-wrap: anywhere; }
.token-keyword { color: #83537e; }
.token-type, .token-number { color: #287060; }
.token-function { color: #906122; }
.token-comment { color: #788179; font-style: italic; }
.token-string { color: #a0523a; }
[data-theme="dark"] .token-keyword { color: #d4a2d0; }
[data-theme="dark"] .token-type, [data-theme="dark"] .token-number { color: #91c9b7; }
[data-theme="dark"] .token-function { color: #dfc386; }
[data-theme="dark"] .token-comment { color: #8d9e91; }
[data-theme="dark"] .token-string { color: #e3ac96; }
.related-lessons { margin: 48px 0 34px; padding: 24px; background: var(--accent-soft); border-radius: 9px; }
.related-lessons .eyebrow { margin-bottom: 10px; }
.related-lessons h2 { margin: 0 0 18px; font-size: 20px; }
.related-lessons a { display: flex; justify-content: space-between; padding: 7px 0; font-size: 13px; text-decoration: none; }
.page-navigation { display: flex; justify-content: space-between; gap: 24px; border-top: 1px solid var(--border); padding: 26px 0; }
.page-navigation a { text-decoration: none; font-size: 14px; }
.page-navigation a:last-child { text-align: right; }
.page-navigation small { display: block; color: var(--muted); font-size: 10px; margin-bottom: 5px; }
.article-footer { border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 20px; color: var(--muted); font-size: 10px; }
.article-footer a { color: var(--muted); }
dialog { color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 12px; width: min(640px, calc(100% - 32px)); max-height: 80dvh; padding: 24px; }
dialog::backdrop { background: #10201880; }
dialog h2 { margin: 0 0 16px; font-size: 22px; }
dialog p { font-size: 13px; color: var(--muted); }
dialog form { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
dialog input { width: 100%; min-width: 0; color: var(--text); background: var(--background); border: 1px solid var(--border); border-radius: 6px; padding: 12px; font-size: 14px; }
.search-header { display: flex; gap: 12px; align-items: center; }
#search-status { font-size: 11px; margin: 16px 0 8px; }
#search-results { display: flex; flex-direction: column; gap: 4px; }
#search-results a { display: flex; flex-direction: column; gap: 5px; padding: 13px; border-radius: 6px; text-decoration: none; }
#search-results a:hover, #search-results a:focus { background: var(--surface-soft); }
#search-results strong { font-size: 13px; font-weight: 550; }
#search-results span { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
@media (min-width: 1500px) { .docs-layout { gap: 60px; } }
@media (max-width: 1180px) { .docs-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 36px; } .page-toc { display: none; } }
@media (max-width: 820px) {
    .docs-layout { display: block; padding: 0 24px; }
    .sidebar { position: static; height: auto; border: 0; padding: 0; }
    .chapter-menu summary { display: block; cursor: pointer; border-bottom: 1px solid var(--border); padding: 15px 0; font-size: 12px; color: var(--muted); }
    .chapter-menu summary::after { content: '⌄'; float: right; }
    .sidebar-inner { padding: 20px 0; } .sidebar nav { display: grid; grid-template-columns: 1fr 1fr; }
    .search-trigger { max-width: 320px; margin-bottom: 20px; }
    .sidebar-footer { display: none; } main { padding-top: 28px; }
    h1 { font-size: 34px; } h2 { font-size: 24px; } article > p:first-of-type { font-size: 16px; }
}
@media (max-width: 540px) {
    .docs-layout { padding: 0 18px; } .sidebar nav { display: flex; }
    body { font-size: 15px; } h1 { font-size: 31px; }
    .example-header { flex-wrap: wrap; gap: 5px; padding: 9px 11px; } .example-actions { margin-left: auto; }
    .example-number { display: none; } .code-example .example-static { padding: 16px 12px; font-size: 11px; }
    .example-tabs { display: flex; padding: 6px 12px; gap: 6px; border-top: 1px solid var(--border); }
    .example-tabs button { flex: 1; border: 0; }
    .example-tabs button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
    .example-panes[data-view="source"] .output-pane, .example-panes[data-view="output"] .source-editor { display: none; }
    .split .example-panes { display: block; } .split .output-pane { border-left: 0; border-top: 1px solid var(--border); }
    [data-control="layout"] { display: none; } .example-toolbar { gap: 6px; } .example-toolbar select { max-width: 130px; }
    .related-lessons { padding: 20px; }
}
@media (pointer: coarse) { button, select { min-height: 40px; } .example-actions button { min-height: 36px; } }
@media print {
    :root { color-scheme: light; --background: white; --surface: white; --text: black; --muted: #444; --border: #ccc; --accent: #174c31; }
    .site-header, .sidebar, .page-toc, .example-actions, .example-interactive, .example-status, .page-navigation, .article-footer, .skip-link { display: none !important; }
    .docs-layout { display: block; max-width: none; padding: 0; } main { padding: 0; }
    .example-static[hidden] { display: block !important; } pre { white-space: pre-wrap; overflow-wrap: anywhere; }
    .code-example [class^="token-"] { color: #222; }
    .code-example, h2, h3 { break-inside: avoid; } a { color: inherit; } h2, h3 { break-after: avoid; }
}
