/* Noverwyn documentation. Colours come from the project's brand kit. */
:root {
	--bg: #0b1122;
	--bar: #111a33;
	--panel: #0f1830;
	--code: #0f172c;
	--line: #23304f;
	--text: #f3f4f8;
	--soft: #a3adc4;
	--accent: #efbf5d;
	--link: #f2c76f;
	--active: #efbf5d;
	--active-text: #0b1122;
	--hover: #1a2643;
	--mark: #efbf5d33;
	--note: #6c9ed9;
	--tip: #64b58b;
	--important: #a98bd0;
	--warning: #efbf5d;
	--caution: #e0707a;
	--h-c: #7f8cab;
	--h-k: #8fb8ea;
	--h-s: #a6cf9b;
	--h-n: #e5a97b;
	--h-f: #efcf8d;
	--top: 64px;
	--sans: "Helvetica Neue", Helvetica, Arial, "Segoe UI", sans-serif;
	--mono: Consolas, "SF Mono", Menlo, "DejaVu Sans Mono", monospace;
	color-scheme: dark;
}
:root[data-theme="light"] {
	--bg: #fff;
	--bar: #f3f5fa;
	--panel: #f8f9fc;
	--code: #f3f5fa;
	--line: #d9dfeb;
	--text: #141c30;
	--soft: #55607a;
	--accent: #9a6a0a;
	--link: #8a5c00;
	--active: #16264b;
	--active-text: #fff;
	--hover: #e9edf6;
	--mark: #efbf5d66;
	--note: #2f6db5;
	--tip: #2d7d55;
	--important: #704f95;
	--warning: #9a6a0a;
	--caution: #b3323f;
	--h-c: #66718b;
	--h-k: #1f58a3;
	--h-s: #2f6f35;
	--h-n: #a34a12;
	--h-f: #7a5200;
	color-scheme: light;
}
@media (prefers-color-scheme: light) {
	:root[data-theme="system"] {
		--bg: #fff;
		--bar: #f3f5fa;
		--panel: #f8f9fc;
		--code: #f3f5fa;
		--line: #d9dfeb;
		--text: #141c30;
		--soft: #55607a;
		--accent: #9a6a0a;
		--link: #8a5c00;
		--active: #16264b;
		--active-text: #fff;
		--hover: #e9edf6;
		--mark: #efbf5d66;
		--note: #2f6db5;
		--tip: #2d7d55;
		--important: #704f95;
		--warning: #9a6a0a;
		--caution: #b3323f;
		--h-c: #66718b;
		--h-k: #1f58a3;
		--h-s: #2f6f35;
		--h-n: #a34a12;
		--h-f: #7a5200;
		color-scheme: light;
	}
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 20px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 var(--sans); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; background: var(--active); color: var(--active-text); padding: 8px 14px; }
.skip:focus { left: 8px; }

/* ------------------------------------------------------------ header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; height: var(--top); padding: 0 24px; background: var(--bar); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 20px; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand img { display: block; }
.brand-sep { width: 1px; height: 26px; background: var(--soft); opacity: .6; }
.tabs { display: flex; align-self: stretch; margin-left: auto; }
.tabs a { display: flex; align-items: center; white-space: nowrap; padding: 3px 18px 0; color: var(--text); border-bottom: 3px solid transparent; }
.tabs a:hover { text-decoration: none; background: var(--hover); }
.tabs a[aria-current] { font-weight: 700; border-color: var(--accent); }
.search { position: relative; display: flex; align-items: center; width: min(360px, 30vw); height: 42px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; }
.search:focus-within { border-color: var(--accent); }
.search > svg { position: absolute; left: 12px; color: var(--soft); width: 18px; pointer-events: none; }
.search input { width: 100%; height: 100%; padding: 0 36px 0 40px; border: 0; background: none; color: inherit; font: inherit; outline: 0; }
.search input::placeholder { color: var(--soft); }
.search > kbd { position: absolute; right: 10px; color: var(--soft); border: 1px solid var(--line); border-radius: 3px; padding: 0 6px; font: 12px/18px var(--mono); pointer-events: none; }
.search:focus-within > kbd { display: none; }
.results { position: absolute; top: calc(100% + 8px); right: 0; width: min(620px, 92vw); max-height: min(70vh, 640px); overflow-y: auto; background: var(--bar); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 16px 40px #0007; padding: 8px; }
.results p { margin: 8px 10px 4px; font-size: 12px; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: .04em; }
.results p.none { text-transform: none; font-weight: 400; font-size: 15px; letter-spacing: 0; }
.results a { display: block; padding: 8px 10px; border-radius: 4px; color: var(--text); }
.results a:hover, .results a[aria-selected="true"] { background: var(--hover); text-decoration: none; }
.results b { font-weight: 600; }
.results b.mono { font-family: var(--mono); font-size: 15px; }
.results small { margin-left: 8px; color: var(--soft); }
.results span { display: block; font-size: 14px; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
mark { background: var(--mark); color: inherit; border-radius: 2px; }
.icon-button { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); color: var(--text); cursor: pointer; flex: none; }
.icon-button:hover { border-color: var(--accent); }
.menu-button { display: none; }
.t-dark, .t-light, .t-system { display: none; }
[data-theme="dark"] .t-dark, [data-theme="light"] .t-light, [data-theme="system"] .t-system { display: block; }

/* ------------------------------------------------------------ pages */
.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start; }
.sidebar { position: sticky; top: var(--top); height: calc(100vh - var(--top)); overflow-y: auto; padding: 18px 10px 40px 24px; border-right: 1px solid var(--line); background: var(--panel); scrollbar-width: thin; }
.mobile-tabs { display: none; }
.menu ul { list-style: none; margin: 0; padding: 0; }
.menu ul ul { padding-left: 12px; display: none; }
.menu li.open > ul, html:not(.js) .menu ul ul { display: block; }
.menu .group { margin: 14px 0 4px; font-size: 14px; font-weight: 700; text-transform: uppercase; }
.menu .item { display: flex; align-items: center; }
.menu .item a { flex: 1; padding: 5px 0; color: var(--soft); font-size: 15px; line-height: 1.35; overflow-wrap: anywhere; }
.menu .item a:hover { color: var(--text); text-decoration: none; }
.menu .item a.active { color: var(--link); font-weight: 600; }
.menu button { display: grid; place-items: center; width: 32px; height: 30px; padding: 0; border: 0; background: none; color: var(--soft); cursor: pointer; }
.menu button svg { width: 15px; transition: transform .12s; }
.menu li.open > .item button svg { transform: rotate(90deg); }
.main { min-width: 0; padding: 28px 40px 40px; }
.shell:has(.toc) { grid-template-columns: 280px minmax(0, 1fr) 250px; }
.main > * { max-width: 940px; margin-inline: auto; }
.shell:has(.toc) .main > * { margin-left: 0; }
.toc { position: sticky; top: var(--top); max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 34px 20px 30px 4px; font-size: 14px; scrollbar-width: thin; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 3px 0 3px 14px; margin-left: -1px; color: var(--soft); border-left: 2px solid transparent; line-height: 1.35; }
.toc .l3 a { padding-left: 28px; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.active { color: var(--link); border-color: var(--accent); }
.crumbs { font-size: 14px; color: var(--soft); margin-bottom: 6px; }
.crumbs a { color: var(--soft); }
.crumbs span { margin: 0 8px; }

.prose { overflow-wrap: break-word; }
.prose h1 { margin: 0 0 18px; font-size: 32px; line-height: 1.2; }
.prose h2 { margin: 38px 0 14px; font-size: 24px; line-height: 1.2; }
.prose h3 { margin: 28px 0 10px; font-size: 19px; line-height: 1.3; }
.prose h4 { margin: 22px 0 8px; font-size: 16px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 30px; }
.prose li { margin: 5px 0; }
.prose li > ul, .prose li > ol { margin: 4px 0; }
.prose img { max-width: 100%; height: auto; border-radius: 6px; display: block; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.prose a[href^="http"]::after { content: "↗"; font-size: .75em; margin-left: 2px; opacity: .7; }
.anchor { margin-left: 8px; opacity: 0; color: var(--soft); font-weight: 400; }
:is(h2, h3, h4):hover .anchor, .anchor:focus { opacity: 1; text-decoration: none; }
code { font-family: var(--mono); font-size: .86em; background: var(--code); border: 1px solid var(--line); border-radius: 3px; padding: 1px 5px; }
.native-link code { color: var(--link); }
.code { position: relative; margin: 0 0 18px; }
.prose pre { margin: 0 0 18px; padding: 16px; overflow-x: auto; background: var(--code); border: 1px solid var(--line); border-radius: 3px; font: 14px/1.55 var(--mono); tab-size: 4; scrollbar-width: thin; }
.code pre { margin: 0; }
.prose pre code { padding: 0; border: 0; background: none; font-size: inherit; }
.copy { position: absolute; top: 8px; right: 8px; padding: 3px 10px; font: 12px/1.5 var(--sans); color: var(--soft); background: var(--bar); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; opacity: 0; }
.code:hover .copy, .copy:focus-visible { opacity: 1; }
.copy:hover { color: var(--text); }
@media (hover: none) { .copy { display: none; } }
.h-c { color: var(--h-c); font-style: italic; }
.h-k { color: var(--h-k); }
.h-s { color: var(--h-s); }
.h-n { color: var(--h-n); }
.h-f { color: var(--h-f); }
.table { overflow-x: auto; margin: 0 0 18px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 8px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--bar); font-weight: 700; }
td img { max-height: 130px; object-fit: contain; }
blockquote { margin: 0 0 18px; padding: 4px 18px; border-left: 3px solid var(--line); color: var(--soft); }
.callout { --c: var(--note); margin: 0 0 18px; padding: 12px 18px 1px; border: 1px solid var(--line); border-left: 4px solid var(--c); background: var(--panel); border-radius: 3px; }
.callout p, .callout ul { margin-bottom: 11px; }
.callout-title { font-weight: 700; color: var(--c); margin-bottom: 4px !important; }
.callout-tip { --c: var(--tip); }
.callout-important { --c: var(--important); }
.callout-warning { --c: var(--warning); }
.callout-caution { --c: var(--caution); }
.prose .cards { list-style: none; padding: 0; margin: 26px 0 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.prose .cards li { margin: 0; }
.cards a { display: block; height: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--text); }
.cards a:hover { border-color: var(--accent); text-decoration: none; }
.cards span { display: block; margin-top: 4px; font-size: 14px; color: var(--soft); }
.prose .found { list-style: none; padding: 0; }
.found li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.found small { margin-left: 10px; color: var(--soft); }
.found p { margin: 4px 0 0; color: var(--soft); font-size: 15px; }
.foot { margin-top: 56px; color: var(--soft); text-align: center; font-size: 14px; }
.foot a { color: var(--soft); }
.foot span { margin: 0 6px; }
.pager { display: flex; justify-content: space-between; gap: 20px; padding-top: 18px; margin-bottom: 26px; border-top: 1px solid var(--line); text-align: left; }
.pager a { color: var(--link); font-size: 15px; }

/* ------------------------------------------------------------ natives */
.page-natives { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.page-natives .menu-button { display: none !important; }
.bar { display: flex; justify-content: center; align-items: stretch; flex: none; min-height: 42px; background: var(--panel); border-bottom: 1px solid var(--line); font-size: 14px; }
.bar-group { display: flex; align-items: center; gap: 4px; padding: 0 20px; border-right: 1px solid var(--line); font-weight: 700; white-space: nowrap; }
.bar-group:last-child { border: 0; }
.bar-group button { height: 100%; padding: 2px 10px 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text); font: 14px var(--mono); cursor: pointer; }
.bar-group button:hover { background: var(--hover); }
.bar-group button[aria-pressed="true"] { border-color: var(--accent); color: var(--link); }
.bar-group select, .bar-group input { height: 30px; padding: 0 8px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 3px; font: 14px var(--sans); }
.bar-group select { margin-left: 6px; }
.bar-filter { flex: 0 1 auto; min-width: 0; }
.bar-filter input { flex: 0 1 220px; width: 220px; min-width: 80px; }
.bar-group select { max-width: 190px; }
.bar-filter span { min-width: 34px; margin-left: 6px; color: var(--soft); font: 13px var(--mono); }
.natives { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(360px, 36%) minmax(0, 1fr); }
.native-panel { display: flex; flex-direction: column; overflow-y: auto; padding: 18px 22px; background: var(--panel); border-right: 1px solid var(--line); outline: 0; scrollbar-width: thin; }
.native-panel .foot { margin-top: auto; padding-top: 34px; }
.native-panel .back { display: none; }
.native-meta { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font: 13px/1.6 var(--mono); color: var(--soft); }
.native-meta b { color: var(--text); }
.native-meta a { margin-left: auto; display: flex; align-items: center; gap: 4px; color: var(--soft); }
.native-meta svg { width: 14px; height: 14px; }
.native-panel h1 { margin: 0 0 14px; font: 700 23px/1.25 var(--mono); overflow-wrap: anywhere; }
.native-panel .aliases { margin: -8px 0 14px; color: var(--soft); font-size: 14px; }
.native-panel .badge { display: inline-block; margin: 0 0 12px; padding: 2px 10px; border: 1px solid var(--caution); color: var(--caution); border-radius: 3px; font-size: 13px; }
.native-panel .prose { font-size: 15px; }
.native-panel .prose h2 { margin: 22px 0 8px; font: 700 15px/1.4 var(--mono); }
.native-panel .prose h2::after { content: ":"; }
.native-panel .prose h2 .anchor { display: none; }
.native-panel .prose ul { padding-left: 22px; }
.native-panel .prose table { font-size: 14px; }
.native-list { position: relative; overflow-y: auto; padding: 6px 0 40px; scrollbar-width: thin; }
.native-list h2 { position: sticky; top: -6px; z-index: 1; margin: 0; padding: 10px 18px 8px; background: var(--bg); font: 700 15px/1.4 var(--mono); border-bottom: 1px solid var(--line); }
.native-list h2 span { font-weight: 400; color: var(--soft); font-size: 13px; }
.native-list ul { list-style: none; margin: 0 0 10px; padding: 0; }
.native-list li { scroll-margin: 60px; }
.native-list li a { display: flex; align-items: center; gap: 8px; padding: 6px 18px; color: var(--text); font: 15px/1.4 var(--mono); white-space: nowrap; overflow: hidden; }
.native-list li a:hover { background: var(--hover); text-decoration: none; }
.n-name { font-weight: 700; }
.n-args { color: var(--soft); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; }
.native-list em { font: 12px var(--sans); color: var(--soft); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; }
.set-icon { width: 16px; height: 16px; color: var(--soft); }
.native-list a[aria-current] { background: var(--active); }
.native-list a[aria-current] :is(span, svg, em) { color: var(--active-text); border-color: currentColor; }
.native-list a[aria-current]:hover { background: var(--active); }
.empty { padding: 4px 0; }
.native-list .empty { padding: 20px; }

/* ------------------------------------------------------------ small screens */
@media (max-width: 1180px) {
	.shell:has(.toc) { grid-template-columns: 280px minmax(0, 1fr); }
	.toc { display: none; }
	.shell:has(.toc) .main > * { margin-left: auto; }
}
@media (max-width: 860px) {
	:root { --top: 58px; }
	.top { padding: 0 12px; gap: 10px; }
	.menu-button { display: grid; }
	.page-docs .tabs, .page-search .tabs, .page-other .tabs { display: none; }
	.brand { font-size: 0; gap: 0; }
	.brand-sep { display: none; }
	.search { flex: 1; width: auto; min-width: 0; margin-left: auto; }
	.search > kbd { display: none; }
	.search input { padding-right: 10px; }
	.results { position: fixed; top: calc(var(--top) + 6px); left: 8px; right: 8px; width: auto; }
	.results span { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
	.shell, .shell:has(.toc) { grid-template-columns: minmax(0, 1fr); }
	.sidebar { position: fixed; z-index: 15; left: 0; width: min(320px, 86vw); transform: translateX(-102%); visibility: hidden; transition: transform .16s, visibility .16s; box-shadow: 10px 0 40px #0007; }
	.menu-open .sidebar { transform: none; visibility: visible; }
	.mobile-tabs { display: flex; gap: 18px; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
	.menu .item a { padding: 8px 0; }
	.menu button { width: 44px; height: 38px; }
	.main { padding: 20px 18px 30px; }
	.prose h1 { font-size: 27px; }
	.page-natives .tabs { margin-left: 0; }
	.page-natives .tabs a { padding-inline: 8px; font-size: 14px; }
	.page-natives .tabs a[aria-current] { display: none; }
	.bar { flex-wrap: wrap; justify-content: flex-start; padding: 2px 0; }
	.bar-group { padding: 4px 12px; border: 0; min-height: 38px; }
	.bar-filter { flex: 1 1 200px; }
	.bar-filter input { flex: 1; width: 100%; min-width: 90px; }
	.natives { display: block; overflow-y: auto; }
	.native-panel { display: none; border: 0; overflow: visible; min-height: 100%; }
	.native-list { overflow: visible; }
	.native-list h2 { top: 0; }
	.has-native .native-panel { display: flex; }
	.has-native .native-list { display: none; }
	.native-panel .back { display: block; margin: 0 0 12px; }
	.page-natives:has(.has-native) .bar { display: none; }
}
@media (max-width: 430px) {
	[data-sets] > span { display: none; }
	.bar-group button { padding-inline: 9px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
	.top, .sidebar, .toc, .foot, .copy { display: none !important; }
	.shell { display: block; }
}
