/*
 * Elysium scripting guide - the one stylesheet for the guide pages.
 * (The editor adds css/editor.css on top.)
 *
 * Contents
 *   1. Colours and sizes   - change the look here; dark is the default, light overrides it
 *   2. Base
 *   3. Header
 *   4. Page frame: sidebar, content, "on this page"
 *   5. Text
 *   6. Code blocks
 *   7. API entries
 *   8. Tables, notes, badges and the small pieces the pages use
 *   9. Home page
 *  10. API index, pager, footer
 *  11. Search
 *  12. Small screens, print
 */

/* ------------------------------------------------- 1. colours and sizes */

:root {
	/* the colours of the forum (elysiumcheats.net): black, lavender text, violet accent */
	--bg: #000000;
	--bg-raised: #060508;
	--bg-sunken: #09080b;
	--surface: #0e0c11;
	--surface-2: #1b1820;
	--line: rgba(135, 100, 180, 0.26);
	--line-soft: rgba(135, 100, 180, 0.14);
	--text: #ffffff;
	--text-dim: #cec9d4;
	--text-faint: #a79eb3;
	--accent: #9b7bc4;
	--accent-strong: #8764b4;
	--accent-soft: rgba(135, 100, 180, 0.18);
	--accent-line: rgba(135, 100, 180, 0.55);
	--brand: #e6def2;
	--brand-glow: 0 0 18px rgba(135, 100, 180, 0.65), 0 0 4px rgba(135, 100, 180, 0.4);
	--good: #52e056;
	--warn: #fdca47;
	--bad: #ff5a5f;
	--info: #7fb7f5;
	--tok-comment: #7d7488;
	--tok-string: #9be0a0;
	--tok-number: #f0a8c8;
	--tok-keyword: #b49fd1;
	--tok-builtin: #8fc4f0;
	--tok-func: #f3dc9a;
	--shadow: 0 18px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(135, 100, 180, 0.12);
	--header-h: 60px;
	--sidebar-w: 268px;
	--toc-w: 240px;
	--page-w: 1600px;   /* the widest the page gets; header and content share it */
	--radius: 4px;
	--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
	--mono: Monaco, Menlo, Consolas, "Roboto Mono", "Cascadia Mono", "Ubuntu Mono", ui-monospace, monospace;
	color-scheme: dark;
}

/* the forum has no light style; this one keeps its violet on a light page */
:root[data-theme="light"] {
	--bg: #faf9fc;
	--bg-raised: #ffffff;
	--bg-sunken: #f3f0f7;
	--surface: #ffffff;
	--surface-2: #efebf5;
	--line: rgba(90, 60, 130, 0.22);
	--line-soft: rgba(90, 60, 130, 0.12);
	--text: #17131c;
	--text-dim: #4d4558;
	--text-faint: #766c84;
	--accent: #7a53ac;
	--accent-strong: #8764b4;
	--accent-soft: rgba(135, 100, 180, 0.12);
	--accent-line: rgba(122, 83, 172, 0.5);
	--brand: #2a2233;
	--brand-glow: 0 0 14px rgba(135, 100, 180, 0.35);
	--good: #15803d;
	--warn: #a16207;
	--bad: #be123c;
	--info: #0369a1;
	--tok-comment: #766c84;
	--tok-string: #15803d;
	--tok-number: #be185d;
	--tok-keyword: #7a53ac;
	--tok-builtin: #0369a1;
	--tok-func: #a16207;
	--shadow: 0 18px 50px rgba(23, 19, 28, 0.16);
	color-scheme: light;
}

/* ---------------------------------------------------------------- 2. base */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 15.5px/1.7 var(--sans);
	-webkit-font-smoothing: antialiased;
}

a {
	color: var(--accent);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

button,
input {
	font: inherit;
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

[hidden] {
	display: none !important;
}

kbd {
	padding: 1px 6px;
	border: 1px solid var(--line);
	border-bottom-width: 2px;
	border-radius: var(--radius);
	background: var(--surface-2);
	color: var(--text-dim);
	font: 600 11px var(--mono);
}

.icon-button {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text-dim);
	cursor: pointer;
}

.icon-button:hover {
	border-color: var(--accent-line);
	color: var(--text);
}

/* -------------------------------------------------------------- 3. header */

.site-header {
	position: sticky;
	top: 0;
	z-index: 40;
	height: var(--header-h);
	border-bottom: 1px solid var(--line);
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}

/* The header uses the same three columns as the page below it: the wordmark
   stands over the sidebar, the tabs over the text, the tools over the outline. */
.header-inner {
	display: grid;
	grid-template-columns: var(--sidebar-w) minmax(0, 1fr) auto;
	align-items: center;
	height: 100%;
	max-width: var(--page-w);
	margin: 0 auto;
}

.header-brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-left: 30px;
}

.header-tools {
	display: flex;
	align-items: center;
	gap: 10px;
	padding-right: 20px;
}

/* the soft violet light at the top of the forum's header */
.site-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: radial-gradient(ellipse 60% 100% at 50% 0%, rgba(135, 100, 180, 0.22), transparent 70%);
	pointer-events: none;
}

.brand {
	color: var(--brand);
	font-size: 23px;
	font-weight: 800;
	letter-spacing: 0.06em;
	line-height: 1;
	text-shadow: var(--brand-glow);
	white-space: nowrap;
}

.brand:hover {
	text-decoration: none;
}

/* "scripting" next to the wordmark */
.brand span {
	margin-left: 8px;
	color: var(--text-faint);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.02em;
	text-shadow: none;
}

/* the tabs: one per section of the guide; the sidebar lists the pages of the open one */
.top-nav {
	display: flex;
	align-self: stretch;
	gap: 4px;
	margin-left: calc(clamp(20px, 4vw, 56px) - 14px);
}

.top-nav a {
	display: flex;
	align-items: center;
	padding: 0 14px;
	border-bottom: 2px solid transparent;
	color: var(--text-dim);
	font-size: 14.5px;
	font-weight: 600;
	white-space: nowrap;
}

.top-nav a:hover {
	color: var(--text);
	text-decoration: none;
}

.top-nav a.active {
	border-bottom-color: var(--accent-strong);
	color: var(--text);
}

.search-button {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 250px;
	height: 36px;
	padding: 0 10px 0 12px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text-faint);
	font-size: 14px;
	cursor: pointer;
}

.search-button:hover {
	border-color: var(--accent-line);
	color: var(--text-dim);
}

.search-button span {
	flex: 1;
	text-align: left;
}

.nav-toggle {
	display: none;
}

/* ---------------------------------------------------------- 4. page frame */

.layout {
	display: grid;
	grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
	max-width: var(--page-w);
	margin: 0 auto;
}

.sidebar {
	position: sticky;
	top: var(--header-h);
	align-self: start;
	height: calc(100vh - var(--header-h));
	padding: 28px 12px 40px 20px;
	overflow-y: auto;
	border-right: 1px solid var(--line-soft);
	scrollbar-width: thin;
}

/* the name of the open section, above its pages */
.nav-section-title {
	margin: 0 0 10px;
	padding: 0 10px;
	color: var(--text);
	font-size: 17px;
	font-weight: 700;
}

.nav-plain {
	margin-bottom: 14px;
}

.nav-group {
	margin-bottom: 8px;
}

.nav-group summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 10px;
	border-radius: var(--radius);
	color: var(--text-faint);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	cursor: pointer;
	list-style: none;
	user-select: none;
}

.nav-group summary::-webkit-details-marker {
	display: none;
}

.nav-group summary::after {
	content: "";
	width: 6px;
	height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(-45deg);
	transition: transform 0.15s;
}

.nav-group[open] summary::after {
	transform: rotate(45deg);
}

.nav-group summary:hover {
	color: var(--text-dim);
}

.sidebar a {
	display: block;
	margin: 1px 0;
	padding: 5px 10px;
	border-radius: var(--radius);
	color: var(--text-dim);
	font-size: 14.5px;
}

.sidebar a:hover {
	background: var(--surface);
	color: var(--text);
	text-decoration: none;
}

.sidebar a.active {
	background: var(--accent-soft);
	color: var(--accent);
	font-weight: 600;
}

.content {
	min-width: 0;
	padding: 40px clamp(20px, 4vw, 56px) 80px;
}

.toc {
	position: sticky;
	top: var(--header-h);
	align-self: start;
	max-height: calc(100vh - var(--header-h));
	padding: 40px 20px 40px 0;
	overflow-y: auto;
	font-size: 13.5px;
	scrollbar-width: thin;
}

.toc-title {
	margin-bottom: 8px;
	color: var(--text-faint);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.toc a {
	display: block;
	padding: 3px 0 3px 12px;
	border-left: 2px solid var(--line);
	color: var(--text-dim);
	line-height: 1.45;
}

.toc a.sub {
	padding-left: 24px;
	font-size: 13px;
}

.toc a:hover {
	color: var(--text);
	text-decoration: none;
}

.toc a.active {
	border-left-color: var(--accent);
	color: var(--accent);
}

.scrim {
	position: fixed;
	inset: 0;
	z-index: 45;
	background: rgba(0, 0, 0, 0.55);
}

/* ---------------------------------------------------------------- 5. text */

.content > * {
	max-width: 900px;
}

.page-head {
	margin-bottom: 28px;
}

.crumb {
	color: var(--accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

h1 {
	margin: 6px 0 10px;
	font-size: clamp(30px, 4vw, 40px);
	line-height: 1.15;
	letter-spacing: -0.025em;
}

.lead {
	margin: 0;
	color: var(--text-dim);
	font-size: 18px;
	line-height: 1.6;
}

h2 {
	margin: 52px 0 14px;
	padding-top: 22px;
	border-top: 1px solid var(--line-soft);
	font-size: 24px;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

h3 {
	margin: 34px 0 10px;
	font-size: 18px;
	line-height: 1.3;
}

h2,
h3,
.api {
	position: relative;
}

/* the # that appears next to a heading; a click copies the link */
.anchor {
	margin-left: 8px;
	color: var(--text-faint);
	font-weight: 400;
	opacity: 0;
	transition: opacity 0.12s;
}

h2:hover .anchor,
h3:hover .anchor,
.api:hover .anchor,
.anchor:focus-visible {
	opacity: 1;
}

.anchor:hover {
	color: var(--accent);
	text-decoration: none;
}

p,
ul,
ol {
	margin: 12px 0;
}

li {
	margin: 5px 0;
}

code {
	padding: 1px 5px;
	border-radius: 5px;
	background: var(--accent-soft);
	color: var(--text);
	font: 0.88em var(--mono);
	overflow-wrap: anywhere;
}

a code {
	color: var(--accent);
}

strong {
	font-weight: 650;
}

/* ---------------------------------------------------------- 6. code blocks */

.code {
	margin: 16px 0 20px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg-sunken);
	overflow: hidden;
}

.code-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 36px;
	padding: 0 6px 0 14px;
	border-bottom: 1px solid var(--line-soft);
	background: var(--bg-raised);
	color: var(--text-faint);
	font: 12px var(--mono);
}

.code-caption {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.code-bar button,
.code-bar a {
	padding: 3px 9px;
	border: 1px solid transparent;
	border-radius: var(--radius);
	background: none;
	color: var(--text-dim);
	font: 600 11.5px var(--sans);
	white-space: nowrap;
	cursor: pointer;
}

.code-bar button:hover,
.code-bar a:hover {
	border-color: var(--line);
	background: var(--surface-2);
	color: var(--text);
	text-decoration: none;
}

.code pre {
	margin: 0;
	padding: 14px 16px;
	overflow: auto;
	font: 13.3px/1.65 var(--mono);
	tab-size: 4;
	-moz-tab-size: 4;
	scrollbar-width: thin;
}

.code pre code {
	padding: 0;
	background: none;
	font: inherit;
	white-space: pre;
	overflow-wrap: normal;
}

.tok-c { color: var(--tok-comment); font-style: italic; }
.tok-s { color: var(--tok-string); }
.tok-n { color: var(--tok-number); }
.tok-k { color: var(--tok-keyword); }
.tok-b { color: var(--tok-builtin); }
.tok-f { color: var(--tok-func); }

/* ---------------------------------------------------------- 7. api entries */

.api {
	margin: 18px 0;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg-raised);
}

/* the entry a link pointed at; js/docs.js sets is-target because the page is drawn after loading */
.api:target,
.api.is-target {
	border-color: var(--accent-line);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.api-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	padding: 12px 16px;
	border-bottom: 1px solid var(--line-soft);
}

.api-head h3 {
	margin: 0;
	font-size: 14.5px;
	font-weight: 500;
}

.sig {
	padding: 0;
	background: none;
	font: 600 14.5px/1.5 var(--mono);
}

.sig .sig-name { color: var(--accent); }
.sig .sig-args { color: var(--text-dim); font-weight: 400; }

.api-returns {
	color: var(--text-faint);
	font: 13px var(--mono);
}

.api-returns b {
	color: var(--tok-builtin);
	font-weight: 500;
}

.api-body {
	padding: 4px 16px 10px;
}

.api-body > :last-child {
	margin-bottom: 8px;
}

.api-label {
	margin: 16px 0 6px;
	color: var(--text-faint);
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* the parameter table is narrow and tight: one short line per parameter */
.table-wrap:has(> .params) {
	display: inline-block;
	max-width: 100%;
	margin: 0 0 6px;
	vertical-align: top;
}

.params {
	width: auto;
	font-size: 13.5px;
}

.params td {
	padding: 4px 18px 4px 12px;
	white-space: nowrap;
}

.params td:last-child:not(.opt) {
	white-space: normal;
}

.params td:first-child code {
	background: none;
	padding: 0;
	color: var(--text);
	font-weight: 600;
}

.params .type {
	color: var(--tok-builtin);
	font: 13px var(--mono);
}

.params .opt {
	color: var(--text-faint);
	font-size: 12.5px;
}

.returns-list {
	margin: 6px 0;
	padding: 0;
	list-style: none;
	font: 13.5px var(--mono);
	color: var(--tok-builtin);
}

.returns-list li::before {
	content: "→ ";
	color: var(--text-faint);
}

/* ------------------------------------------- 8. tables, notes, small pieces */

.table-wrap {
	margin: 16px 0 20px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: auto;
}

table {
	width: 100%;
	border-collapse: collapse;
	font-size: 14.5px;
}

th,
td {
	padding: 8px 14px;
	border-bottom: 1px solid var(--line-soft);
	text-align: left;
	vertical-align: top;
}

th {
	background: var(--surface);
	color: var(--text-dim);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	white-space: nowrap;
}

tr:last-child td {
	border-bottom: 0;
}

.callout {
	margin: 18px 0;
	padding: 12px 16px;
	border: 1px solid var(--line);
	border-left: 3px solid var(--info);
	border-radius: var(--radius);
	background: var(--surface);
}

.callout.tip { border-left-color: var(--good); }
.callout.warn { border-left-color: var(--warn); }

.callout-title {
	color: var(--info);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.callout.tip .callout-title { color: var(--good); }
.callout.warn .callout-title { color: var(--warn); }

.callout p {
	margin: 6px 0 2px;
}

.badge {
	display: inline-block;
	padding: 1px 8px;
	border: 1px solid;
	border-radius: 999px;
	font: 700 10.5px var(--sans);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	vertical-align: middle;
	white-space: nowrap;
}

.badge.trusted { color: var(--warn); }
.badge.game { color: var(--info); }
.badge.render { color: var(--good); }
.badge.event { color: var(--accent); }

.quick,
.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.quick {
	margin: 14px 0 6px;
}

.quick a,
.chips span {
	padding: 2px 10px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--text-dim);
	font: 12.5px var(--mono);
}

.quick a:hover {
	border-color: var(--accent-line);
	color: var(--text);
	text-decoration: none;
}

.lanes {
	display: grid;
	gap: 10px;
	margin: 18px 0 22px;
}

.lane {
	display: grid;
	grid-template-columns: 160px minmax(0, 1fr);
	align-items: center;
	gap: 14px;
	padding: 12px 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
}

.lane-name {
	color: var(--accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.steps > ol {
	padding: 0;
	list-style: none;
	counter-reset: step;
}

.steps > ol > li {
	position: relative;
	margin: 18px 0;
	padding: 2px 0 2px 46px;
}

.steps > ol > li::before {
	counter-increment: step;
	content: counter(step);
	position: absolute;
	top: 1px;
	left: 0;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border: 1px solid var(--accent-line);
	border-radius: 50%;
	background: var(--accent-soft);
	color: var(--accent);
	font: 700 13px var(--sans);
}

/* ------------------------------------------------------------ 9. home page */

.hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: center;
	gap: 40px;
	max-width: 1080px !important;
	padding: 24px 0 36px;
}

.hero h1 {
	font-size: clamp(36px, 5vw, 54px);
}

.hero p {
	color: var(--text-dim);
	font-size: 17.5px;
}

.hero .code {
	margin: 0;
	box-shadow: var(--shadow);
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 22px;
}

.btn {
	display: inline-flex;
	align-items: center;
	padding: 9px 18px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	color: var(--text);
	font-weight: 600;
	font-size: 14.5px;
}

/* the same look for a <button> */
button.btn {
	font-family: inherit;
	cursor: pointer;
}

.btn:hover {
	border-color: var(--accent-line);
	text-decoration: none;
}

.btn.primary {
	border-color: transparent;
	background: var(--accent-strong);
	color: #fff;
}

.btn.primary:hover {
	filter: brightness(1.1);
}

.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 12px;
	max-width: 1080px !important;
	margin: 16px 0;
}

.card {
	display: block;
	padding: 16px 18px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg-raised);
	color: var(--text-dim);
	font-size: 14px;
	line-height: 1.55;
	transition: border-color 0.12s, transform 0.12s;
}

.card:hover {
	border-color: var(--accent-line);
	text-decoration: none;
	transform: translateY(-2px);
}

.card strong {
	display: block;
	margin-bottom: 4px;
	color: var(--text);
	font-size: 15.5px;
}

/* ------------------------------------------ 10. api index, pager, footer */

.index-tools {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 20px 0;
}

.index-tools input {
	flex: 1;
	max-width: 420px;
	height: 40px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
}

.index-tools input:focus {
	outline: none;
	border-color: var(--accent);
	box-shadow: 0 0 0 3px var(--accent-soft);
}

.index-tools span {
	color: var(--text-faint);
	font-size: 13px;
}

.index-list {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
}

.index-list li {
	display: grid;
	grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
	gap: 16px;
	margin: 0;
	padding: 6px 0;
	border-bottom: 1px solid var(--line-soft);
	font-size: 14px;
}

.index-list a {
	font: 13.5px var(--mono);
	overflow-wrap: anywhere;
}

.index-list span {
	color: var(--text-dim);
}

.pager {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 60px;
}

.pager a {
	padding: 14px 18px;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--text);
}

.pager a:hover {
	border-color: var(--accent-line);
	text-decoration: none;
}

.pager a.next {
	grid-column: 2;
	text-align: right;
}

.pager span {
	display: block;
	color: var(--text-faint);
	font-size: 12px;
}

.pager strong {
	color: var(--accent);
}

.foot {
	margin-top: 40px;
	padding-top: 18px;
	border-top: 1px solid var(--line-soft);
	color: var(--text-faint);
	font-size: 13px;
}

/* -------------------------------------------------------------- 11. search */

.search-layer {
	position: fixed;
	inset: 0;
	z-index: 60;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 10vh 16px 16px;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(3px);
}

.search-box {
	display: flex;
	flex-direction: column;
	width: min(680px, 100%);
	max-height: 76vh;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--bg-raised);
	box-shadow: var(--shadow);
	overflow: hidden;
}

.search-box input {
	width: 100%;
	height: 54px;
	padding: 0 18px;
	border: 0;
	border-bottom: 1px solid var(--line);
	background: none;
	font-size: 16.5px;
	outline: none;
}

.search-results {
	padding: 6px;
	overflow-y: auto;
	scrollbar-width: thin;
}

.search-result {
	display: grid;
	grid-template-columns: 62px minmax(0, 1fr);
	gap: 2px 12px;
	padding: 8px 10px;
	border-radius: var(--radius);
	color: var(--text);
}

.search-result:hover {
	text-decoration: none;
}

.search-result.active {
	background: var(--accent-soft);
}

.search-kind {
	grid-row: span 2;
	align-self: start;
	margin-top: 3px;
	padding: 1px 0;
	border-radius: var(--radius);
	background: var(--surface-2);
	color: var(--text-faint);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-align: center;
	text-transform: uppercase;
}

.search-title {
	font: 600 13.5px var(--mono);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.search-title.plain {
	font: 600 14.5px var(--sans);
}

.search-text {
	color: var(--text-dim);
	font-size: 13px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.search-result mark {
	background: none;
	color: var(--accent);
	font-weight: 700;
}

.search-empty,
.search-hint {
	padding: 14px 16px;
	color: var(--text-faint);
	font-size: 13.5px;
}

.search-foot {
	display: flex;
	gap: 16px;
	padding: 8px 16px;
	border-top: 1px solid var(--line);
	color: var(--text-faint);
	font-size: 12px;
}

/* ---------------------------------------------- 12. small screens, print */

@media (max-width: 1200px) {
	.layout {
		grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
	}

	.toc {
		display: none;
	}
}

@media (max-width: 900px) {
	/* two rows: wordmark and tools, then the tabs */
	:root {
		--header-h: 100px;
	}

	.layout {
		grid-template-columns: minmax(0, 1fr);
	}

	.header-inner {
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-rows: 54px 46px;
	}

	.header-brand {
		padding-left: 12px;
	}

	.header-tools {
		padding-right: 12px;
	}

	.top-nav {
		grid-column: 1 / -1;
		grid-row: 2;
		margin-left: 0;
		padding: 0 4px;
		border-top: 1px solid var(--line-soft);
		overflow-x: auto;
		scrollbar-width: none;
	}

	.nav-toggle {
		display: inline-grid;
	}

	.sidebar {
		position: fixed;
		z-index: 50;
		top: var(--header-h);
		bottom: 0;
		left: 0;
		width: min(300px, 86vw);
		height: auto;
		align-self: stretch;   /* "start" from the wide layout would let it slide up over the tabs */
		background: var(--bg);
		border-right: 1px solid var(--line);
		transform: translateX(-102%);
		transition: transform 0.18s ease;
	}

	body.nav-open .sidebar {
		transform: none;
	}

	.search-button {
		width: auto;
	}

	.search-button span,
	.search-button kbd {
		display: none;
	}

	.hero {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
		padding-top: 4px;
	}

	.content {
		padding-top: 26px;
	}

	.lane,
	.index-list li {
		grid-template-columns: minmax(0, 1fr);
		gap: 4px;
	}
}

@media (max-width: 520px) {
	.brand {
		font-size: 19px;
	}

	.brand span {
		display: none;
	}

	body {
		font-size: 15px;
	}

	.pager {
		grid-template-columns: 1fr;
	}

	.pager a.next {
		grid-column: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
	}
}

@media print {
	.site-header,
	.sidebar,
	.toc,
	.pager,
	.code-bar,
	.anchor {
		display: none !important;
	}

	.layout {
		display: block;
	}
}

/* ---------------------------------------------------------------- icons */
/* Font Awesome Free, in vendor/fontawesome. An icon is <i class="fa-solid fa-bolt">. */

.top-nav a i,
.btn i,
.card strong i {
	margin-right: 8px;
}

.top-nav a i {
	font-size: 13px;
	opacity: 0.75;
}

.sidebar a i {
	margin-right: 10px;
	color: var(--text-faint);
	font-size: 13px;
}

.sidebar a.active i,
.card strong i {
	color: var(--accent);
}

.code-bar button i {
	margin-right: 6px;
}

.pager span i {
	margin: 0 6px;
	font-size: 11px;
}

/* notes get their sign in front of the title */
.callout-title::before {
	content: "\f05a";
	margin-right: 7px;
	font: 900 12px "Font Awesome 6 Free";
}

.callout.tip .callout-title::before { content: "\f0eb"; }
.callout.warn .callout-title::before { content: "\f071"; }
