/*
  help-app4 — GitBook-like theme for the static Click4Survey help snapshot.

  Tweak these custom properties first: they drive colours, spacing and type.
  Original GitBook primary is rgb(22, 132, 187) = #1684bb.
*/

:root {
	--color-primary: #1684bb;
	--color-primary-hover: #1274a6;
	/* Primary used as text on a tinted surface; dark mode needs a lighter tint for AA. */
	--color-primary-text: #12719f;
	--color-primary-soft: #e7f4fe;
	--color-primary-muted: #d3e9f8;
	--color-text: #1d1d1d;
	--color-text-muted: #696f73;
	--color-text-faint: #8b9297;
	--color-bg: #ffffff;
	--color-bg-sidebar: #f7f9fb;
	/* Sidebar rows are neutral; the current page carries a blue tint with dark text. */
	--color-nav-hover: #ebeff3;
	--color-nav-active-bg: #d3e9f8;
	--color-bg-header: linear-gradient(180deg, #e7f4fe 0%, #ffffff 72%);
	--color-border: #e2e6e9;
	--color-border-strong: #c8cdd1;
	--color-link: var(--color-primary);
	--color-code-bg: #f4f6f8;
	--color-hint-info: #1684bb;
	--color-hint-info-bg: #eef7fc;
	--color-hint-success: #2f9e44;
	--color-hint-success-bg: #eefbf1;
	--color-hint-warning: #f08c00;
	--color-hint-warning-bg: #fff8e8;
	--color-hint-danger: #e03131;
	--color-hint-danger-bg: #fff0f0;
	--font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	--header-height: 64px;
	--sidebar-width: 280px;
	--toc-width: 232px;
	--content-width: 44rem;
	--radius: 12px;
	--radius-sm: 8px;
	--shadow-card: 0 1px 2px rgba(15, 23, 32, 0.04), 0 2px 8px rgba(15, 23, 32, 0.04);
	--shadow-card-hover: 0 2px 4px rgba(15, 23, 32, 0.06), 0 10px 24px rgba(15, 23, 32, 0.1);
	--shadow-img: 0 1px 3px rgba(15, 23, 32, 0.06), 0 6px 20px rgba(15, 23, 32, 0.07);
	--shadow-search: 0 16px 48px rgba(15, 23, 32, 0.16);
	--nav-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6 3.25 10.75 8 6 12.75' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	--icon-search: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='4.6'/%3E%3Cpath d='m10.4 10.4 3.1 3.1'/%3E%3C/g%3E%3C/svg%3E");
	--icon-hint-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.6'%3E%3Ccircle cx='10' cy='10' r='7.2'/%3E%3Cpath d='M10 9.2v4' stroke-linecap='round'/%3E%3C/g%3E%3Ccircle cx='10' cy='6.4' r='1' fill='%23000'/%3E%3C/svg%3E");
	--icon-hint-success: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.6'%3E%3Ccircle cx='10' cy='10' r='7.2'/%3E%3Cpath d='m6.7 10.3 2.2 2.2 4.4-4.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E");
	--icon-hint-warning: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.6'%3E%3Cpath d='M10 3.2 2.6 16h14.8Z' stroke-linejoin='round'/%3E%3Cpath d='M10 8.2v3.4' stroke-linecap='round'/%3E%3C/g%3E%3Ccircle cx='10' cy='13.7' r='0.9' fill='%23000'/%3E%3C/svg%3E");
	--icon-hint-danger: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.6'%3E%3Ccircle cx='10' cy='10' r='7.2'/%3E%3Cpath d='M10 6.2v4.4' stroke-linecap='round'/%3E%3C/g%3E%3Ccircle cx='10' cy='13.6' r='1' fill='%23000'/%3E%3C/svg%3E");
	--focus-ring: 0 0 0 3px color-mix(in srgb, var(--color-primary) 28%, transparent);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--color-text: #f5f7f8;
		--color-text-muted: #bdc1c3;
		--color-text-faint: #8e9498;
		--color-bg: #1d1d1d;
		--color-bg-sidebar: #222323;
		--color-nav-hover: #2c2d2e;
		--color-nav-active-bg: #314754;
		--color-bg-header: linear-gradient(180deg, #202325 0%, #1d1d1d 72%);
		--color-border: #3b3c3d;
		--color-border-strong: #4c4e50;
		--color-code-bg: #2b2d2e;
		--color-primary-soft: #273741;
		--color-primary-muted: #314754;
		--color-primary-text: #6cc2ee;
		/* --color-link resolves --color-primary on :root, which dark mode leaves alone. */
		--color-link: #6cc2ee;
		--color-primary-hover: #9ad4f4;
		--color-hint-info: #58b4e6;
		--color-hint-success: #63c777;
		--color-hint-warning: #f5aa42;
		--color-hint-danger: #f07575;
		--color-hint-info-bg: #1e2c34;
		--color-hint-success-bg: #1c2a20;
		--color-hint-warning-bg: #2e2616;
		--color-hint-danger-bg: #2e1c1c;
		--shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
		--shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.3), 0 10px 24px rgba(0, 0, 0, 0.35);
		--shadow-img: 0 1px 3px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.3);
		--shadow-search: 0 16px 48px rgba(0, 0, 0, 0.45);
	}
}

[data-theme="dark"] {
	--color-text: #f5f7f8;
	--color-text-muted: #bdc1c3;
	--color-text-faint: #8e9498;
	--color-bg: #1d1d1d;
	--color-bg-sidebar: #222323;
	--color-nav-hover: #2c2d2e;
	--color-nav-active-bg: #314754;
	--color-bg-header: linear-gradient(180deg, #202325 0%, #1d1d1d 72%);
	--color-border: #3b3c3d;
	--color-border-strong: #4c4e50;
	--color-code-bg: #2b2d2e;
	--color-primary-soft: #273741;
	--color-primary-muted: #314754;
	--color-primary-text: #6cc2ee;
	--color-link: #6cc2ee;
	--color-primary-hover: #9ad4f4;
	--color-hint-info: #58b4e6;
	--color-hint-success: #63c777;
	--color-hint-warning: #f5aa42;
	--color-hint-danger: #f07575;
	--color-hint-info-bg: #1e2c34;
	--color-hint-success-bg: #1c2a20;
	--color-hint-warning-bg: #2e2616;
	--color-hint-danger-bg: #2e1c1c;
	--shadow-card: 0 1px 2px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.2);
	--shadow-card-hover: 0 2px 4px rgba(0, 0, 0, 0.3), 0 10px 24px rgba(0, 0, 0, 0.35);
	--shadow-img: 0 1px 3px rgba(0, 0, 0, 0.3), 0 6px 20px rgba(0, 0, 0, 0.3);
	--shadow-search: 0 16px 48px rgba(0, 0, 0, 0.45);
}

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

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-height) + 12px);
}

body {
	margin: 0;
	font-family: var(--font-sans);
	color: var(--color-text);
	background: var(--color-bg);
	line-height: 1.6;
	min-height: 100vh;
}

a {
	color: var(--color-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

a:hover {
	color: var(--color-primary-hover);
}

img {
	max-width: 100%;
	height: auto;
}

:focus-visible {
	outline: none;
	box-shadow: var(--focus-ring);
}

/* ---------- Header (GitBook top bar) ---------- */

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

.site-header-inner {
	display: flex;
	align-items: center;
	gap: 16px;
	height: 100%;
	padding: 0 20px;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: inherit;
	text-decoration: none;
	font-weight: 600;
	min-width: 0;
}

.brand:hover {
	color: inherit;
}

.brand img {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	object-fit: cover;
}

.brand-title {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.header-links {
	display: none;
	align-items: center;
	gap: 18px;
	margin-left: 12px;
	font-size: 14px;
}

.header-links a {
	color: var(--color-text);
	text-decoration: none;
}

.header-links a:hover {
	color: var(--color-primary);
}

.header-actions {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.search-open,
.theme-toggle,
.menu-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 36px;
	padding: 0 12px;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	background: var(--color-bg);
	color: var(--color-text-muted);
	cursor: pointer;
	font: inherit;
	font-size: 13px;
	transition:
		border-color 0.15s ease,
		color 0.15s ease,
		box-shadow 0.15s ease;
}

.search-open:hover,
.theme-toggle:hover,
.menu-toggle:hover {
	border-color: var(--color-primary);
	color: var(--color-text);
}

/* The label and the ⌘K hint both hide below 980px, so the icon carries the button. */
.search-open::before {
	content: "";
	width: 15px;
	height: 15px;
	flex: 0 0 15px;
	background-color: currentColor;
	mask: var(--icon-search) center / contain no-repeat;
	-webkit-mask: var(--icon-search) center / contain no-repeat;
}

.search-open kbd {
	font-family: var(--font-sans);
	font-size: 11px;
	border: 1px solid var(--color-border);
	border-radius: 4px;
	padding: 0 5px;
	background: var(--color-bg-sidebar);
}

.menu-toggle {
	display: inline-flex;
}

.theme-toggle {
	width: 36px;
	padding: 0;
	justify-content: center;
	border-radius: var(--radius-sm);
}

@media (min-width: 980px) {
	.header-links {
		display: flex;
	}

	.menu-toggle {
		display: none;
	}
}

/* ---------- Layout ---------- */

.layout {
	display: grid;
	grid-template-columns: 1fr;
	min-height: calc(100vh - var(--header-height));
}

@media (min-width: 980px) {
	.layout {
		grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--toc-width);
	}
}

.sidebar {
	display: none;
	background: var(--color-bg-sidebar);
	border-right: 1px solid var(--color-border);
	padding: 20px 12px 40px;
	/* Own scroll container: a fully expanded tree is taller than the viewport,
	   and a sticky inner block would leave its tail unreachable. */
	position: sticky;
	top: var(--header-height);
	height: calc(100vh - var(--header-height));
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--color-border-strong) transparent;
}

.sidebar::-webkit-scrollbar {
	width: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
	background-clip: content-box;
	border: 3px solid transparent;
	border-radius: 999px;
	background-color: transparent;
}

.sidebar:hover::-webkit-scrollbar-thumb {
	background-color: var(--color-border-strong);
}

.toc-col {
	display: none;
	padding: 28px 16px 32px 8px;
	border-left: 1px solid var(--color-border);
}

@media (min-width: 980px) {
	.sidebar,
	.toc-col {
		display: block;
	}
}

.layout.nav-open .sidebar {
	display: block;
	position: fixed;
	inset: var(--header-height) 0 0 0;
	z-index: 30;
	width: min(92vw, var(--sidebar-width));
	box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12);
}

.nav-backdrop {
	display: none;
}

.layout.nav-open .nav-backdrop {
	display: block;
	position: fixed;
	inset: var(--header-height) 0 0 0;
	background: rgba(15, 23, 32, 0.35);
	z-index: 25;
	border: 0;
	padding: 0;
	cursor: pointer;
}

.content {
	min-width: 0;
	padding: 28px 24px 64px;
}

.content-inner {
	max-width: var(--content-width);
	margin: 0 auto;
}

/* ---------- Sidebar tree ---------- */

.nav-tree {
	font-size: 14px;
	/* Caret column shared by every row type so labels line up at one x. */
	--nav-caret-w: 20px;
	--nav-pad-x: 8px;
	--nav-pad-y: 8px;
}

.nav-tree > * + * {
	margin-top: 2px;
}

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

/* Divide the standalone top-level pages from the expandable sections.
   :first-of-type would look at the tag name, and every row here is a div. */
.nav-tree > .nav-group {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--color-border);
}

.nav-tree > .nav-group + .nav-group {
	margin-top: 4px;
	padding-top: 0;
	border-top: 0;
}

.nav-group-toggle,
.nav-link {
	display: flex;
	align-items: center;
	gap: 0;
	width: 100%;
	text-align: left;
	padding: var(--nav-pad-y) var(--nav-pad-x);
	border: 0;
	border-radius: var(--radius-sm);
	background: transparent;
	color: var(--color-text);
	text-decoration: none;
	font: inherit;
	font-size: 14px;
	line-height: 1.45;
	cursor: pointer;
	transition:
		background-color 0.12s ease,
		color 0.12s ease;
}

.nav-group-toggle {
	font-weight: 600;
	color: var(--color-text);
}

/* Leaves carry no caret, so pad them by the caret column instead. */
.nav-link {
	color: var(--color-text);
	padding-left: calc(var(--nav-pad-x) + var(--nav-caret-w));
}

/* Any category (a page with children) reads like a group header: bold, full text colour. */
.nav-item.has-children > .nav-row > .nav-link {
	color: var(--color-text);
	font-weight: 600;
}

/* Plain root entries stay unemphasised — bold is reserved for the expandable
   ones. State classes are excluded because this selector outweighs .is-active /
   .is-trail and would otherwise strip their emphasis. */
.nav-tree > .nav-link:not(.is-active):not(.is-trail) {
	font-weight: 400;
}

.nav-group-toggle:hover,
.nav-link:hover {
	background: var(--color-nav-hover);
	color: var(--color-text);
}

/* Current page: a blue-tinted pill with regular dark text — no rule, no shadow. */
.nav-link.is-active {
	background: var(--color-nav-active-bg);
	color: var(--color-text);
	font-weight: 600;
}

/* .nav-link.is-active outweighs the global :focus-visible rule, so restate it here. */
.nav-link:focus-visible,
.nav-group-toggle:focus-visible {
	box-shadow: var(--focus-ring);
}

/* Ancestors of the current page: readable without competing with the accent. */
.nav-link.is-trail,
.nav-group-toggle.is-trail {
	color: var(--color-text);
	font-weight: 600;
}

.nav-row {
	display: flex;
	align-items: center;
	gap: 0;
	border-radius: var(--radius-sm);
}

.nav-row .nav-link {
	flex: 1;
	min-width: 0;
	padding-left: 0;
}

.nav-row .nav-group-toggle {
	flex: 0 0 calc(var(--nav-pad-x) + var(--nav-caret-w));
	width: calc(var(--nav-pad-x) + var(--nav-caret-w));
	padding: var(--nav-pad-y) 0 var(--nav-pad-y) var(--nav-pad-x);
}

/* Hover and active belong to the whole row, not to the caret half of it. */
.nav-row:hover {
	background: var(--color-nav-hover);
}

.nav-row:hover .nav-link,
.nav-row:hover .nav-group-toggle,
.nav-row .nav-group-toggle:hover {
	background: transparent;
	color: var(--color-text);
}

.nav-row:has(> .nav-link.is-active) {
	background: var(--color-nav-active-bg);
}

.nav-row > .nav-link.is-active {
	background: transparent;
}

.nav-caret {
	width: var(--nav-caret-w);
	height: var(--nav-caret-w);
	flex: 0 0 var(--nav-caret-w);
	/* Thin chevron instead of the ▸ glyph: crisp at any size, follows currentColor. */
	font-size: 0;
	color: var(--color-text-faint);
	background-color: currentColor;
	mask: var(--nav-chevron) center / 14px 14px no-repeat;
	-webkit-mask: var(--nav-chevron) center / 14px 14px no-repeat;
	transition: transform 0.15s ease;
}

.nav-group.is-open > .nav-group-toggle .nav-caret,
.nav-item.has-children.is-open > .nav-row .nav-caret {
	transform: rotate(90deg);
}

.nav-children {
	display: none;
	/* Guide line sits under the centre of the parent's caret column. */
	margin-left: calc(var(--nav-pad-x) + var(--nav-caret-w) / 2);
	padding-left: calc(var(--nav-caret-w) / 2 - 4px);
	border-left: 1px solid var(--color-border);
}

.nav-group.is-open > .nav-children,
.nav-item.has-children.is-open > .nav-children {
	display: block;
}

/* The branch leading to the current page keeps its guide line visible. */
.nav-group.is-trail > .nav-children,
.nav-item.is-trail > .nav-children {
	border-left-color: var(--color-border-strong);
}

/* ---------- Breadcrumbs, article chrome ---------- */

.breadcrumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	font-size: 13px;
	color: var(--color-text-faint);
	margin: 0 0 12px;
}

.breadcrumbs a {
	color: var(--color-text-muted);
	text-decoration: none;
}

.breadcrumbs a:hover {
	color: var(--color-primary);
}

.article-title {
	margin: 0 0 10px;
	font-size: 2.25rem;
	line-height: 1.15;
	letter-spacing: -0.025em;
	font-weight: 700;
}

.article-desc {
	margin: 0 0 32px;
	padding-bottom: 24px;
	border-bottom: 1px solid var(--color-border);
	color: var(--color-text-muted);
	font-size: 1.05rem;
}

.pager {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--color-border);
}

.pager a {
	display: flex;
	flex-direction: column;
	gap: 2px;
	max-width: 46%;
	text-decoration: none;
	color: var(--color-text);
	padding: 12px 16px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	box-shadow: var(--shadow-card);
	transition:
		border-color 0.15s ease,
		box-shadow 0.15s ease,
		transform 0.15s ease;
}

.pager a:hover {
	border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
	color: var(--color-primary);
	box-shadow: var(--shadow-card-hover);
	transform: translateY(-2px);
}

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

.pager .next {
	margin-left: auto;
	text-align: right;
}

/* ---------- Article prose ---------- */

.prose h2,
.prose h3,
.prose h4 {
	scroll-margin-top: calc(var(--header-height) + 12px);
}

.prose h2 {
	margin: 2rem 0 0.75rem;
	font-size: 1.45rem;
	letter-spacing: -0.015em;
}

.prose h3 {
	margin: 1.6rem 0 0.55rem;
	font-size: 1.15rem;
}

.prose h4 {
	margin: 1.3rem 0 0.4rem;
	font-size: 1.02rem;
}

.prose p,
.prose ul,
.prose ol {
	margin: 0 0 1rem;
}

.prose li + li {
	margin-top: 0.25rem;
}

.prose figure {
	margin: 1.25rem 0;
}

/* :only-child ignores text nodes, so an inline screenshot in a sentence
   would match and drop to its own line. Exclude GitBook line-size icons. */
.prose figure img,
.prose p > img:only-child:not(.inline-icon),
.prose > img:not(.inline-icon) {
	display: block;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	background: var(--color-bg-sidebar);
	box-shadow: var(--shadow-img);
}

.prose figcaption,
.prose img + em {
	display: block;
	margin-top: 0.4rem;
	font-size: 13px;
	color: var(--color-text-faint);
	text-align: center;
}

/* GitBook data-size="line": UI chrome (search field, buttons, pencil) sits in the
   sentence. Keep aspect ratio — forcing a square hid screenshots like search-func.png. */
.prose img.inline-icon {
	display: inline-block;
	width: auto;
	height: 1.45em;
	max-width: min(100%, 16rem);
	vertical-align: middle;
	margin: 0 0.35em;
	border: 0;
	border-radius: 4px;
	background: none;
	box-shadow: none;
}

.prose code {
	font-family: var(--font-mono);
	font-size: 0.9em;
	background: var(--color-code-bg);
	padding: 0.1em 0.35em;
	border-radius: 4px;
}

.prose pre {
	background: var(--color-code-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	padding: 14px 16px;
	overflow: auto;
}

.prose pre code {
	background: none;
	padding: 0;
}

.prose table {
	width: 100%;
	border-collapse: collapse;
	margin: 1rem 0;
	font-size: 14px;
}

.prose th,
.prose td {
	border: 1px solid var(--color-border);
	padding: 8px 10px;
	text-align: left;
}

.prose th {
	background: var(--color-bg-sidebar);
}

.prose blockquote {
	margin: 1rem 0;
	padding: 0.2rem 0 0.2rem 1rem;
	border-left: 3px solid var(--color-primary);
	color: var(--color-text-muted);
}

.prose hr {
	border: 0;
	border-top: 1px solid var(--color-border);
	margin: 2rem 0;
}

/* Homepage section cards (GitBook content-ref) */

.content-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 12px;
	margin: 1.25rem 0 2rem;
}

.content-card {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 18px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	text-decoration: none;
	color: inherit;
	background: var(--color-bg);
	box-shadow: var(--shadow-card);
	font-weight: 500;
	transition:
		border-color 0.15s ease,
		box-shadow 0.15s ease,
		transform 0.15s ease;
}

.content-card:hover {
	border-color: color-mix(in srgb, var(--color-primary) 45%, var(--color-border));
	color: inherit;
	box-shadow: var(--shadow-card-hover);
	transform: translateY(-2px);
}

.content-card-arrow {
	margin-left: auto;
	color: var(--color-text-faint);
	transition:
		transform 0.15s ease,
		color 0.15s ease;
}

.content-card:hover .content-card-arrow {
	transform: translateX(3px);
	color: var(--color-primary);
}

/* GitBook {% hint %} boxes — type is signalled by an icon, not a side stripe. */

.hint {
	--hint-accent: var(--color-hint-info);
	--hint-icon: var(--icon-hint-info);
	position: relative;
	margin: 1.25rem 0;
	padding: 14px 16px 14px 46px;
	border-radius: var(--radius);
	border: 1px solid color-mix(in srgb, var(--hint-accent) 22%, transparent);
	background: var(--color-hint-info-bg);
	font-size: 0.95em;
}

.hint::before {
	content: "";
	position: absolute;
	top: 15px;
	left: 16px;
	width: 19px;
	height: 19px;
	background-color: var(--hint-accent);
	mask: var(--hint-icon) center / contain no-repeat;
	-webkit-mask: var(--hint-icon) center / contain no-repeat;
}

.hint > :first-child {
	margin-top: 0;
}

.hint > :last-child {
	margin-bottom: 0;
}

.hint-success {
	--hint-accent: var(--color-hint-success);
	--hint-icon: var(--icon-hint-success);
	background: var(--color-hint-success-bg);
}

.hint-warning {
	--hint-accent: var(--color-hint-warning);
	--hint-icon: var(--icon-hint-warning);
	background: var(--color-hint-warning-bg);
}

.hint-danger {
	--hint-accent: var(--color-hint-danger);
	--hint-icon: var(--icon-hint-danger);
	background: var(--color-hint-danger-bg);
}

/* ---------- Right-hand TOC ---------- */

/* Pinned while the article scrolls; only the active-heading mark moves.
   Sticky sits on .toc, not on .toc-col — the column must stay stretched so its
   left divider still runs the full height of the page. */
.toc {
	position: sticky;
	top: calc(var(--header-height) + 28px);
	max-height: calc(100vh - var(--header-height) - 56px);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: transparent transparent;
}

.toc:hover {
	scrollbar-color: var(--color-border-strong) transparent;
}

.toc h2 {
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-transform: none;
	color: var(--color-text-muted);
}

.toc ol {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
}

.toc a {
	display: block;
	padding: 4px 0 4px 10px;
	border-left: 2px solid transparent;
	color: var(--color-text-muted);
	text-decoration: none;
	transition:
		color 0.12s ease,
		border-color 0.12s ease;
}

.toc a:hover {
	color: var(--color-text);
	border-left-color: var(--color-border-strong);
}

.toc a.is-active {
	color: var(--color-primary-text);
	border-left-color: var(--color-primary);
	font-weight: 500;
}

.toc .depth-3 {
	padding-left: 20px;
	font-size: 12px;
}

/* ---------- Search modal ---------- */

.search-modal[hidden] {
	display: none;
}

.search-modal {
	position: fixed;
	inset: 0;
	z-index: 80;
	background: rgba(15, 23, 32, 0.4);
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 12vh 16px 16px;
}

.search-dialog {
	width: min(640px, 100%);
	background: var(--color-bg);
	border-radius: var(--radius);
	box-shadow: var(--shadow-search);
	overflow: hidden;
	border: 1px solid var(--color-border);
}

.search-dialog input {
	width: 100%;
	border: 0;
	border-bottom: 1px solid var(--color-border);
	padding: 16px 18px;
	font: inherit;
	font-size: 16px;
	background: transparent;
	color: inherit;
}

.search-dialog input:focus {
	outline: none;
}

.search-results {
	max-height: 50vh;
	overflow: auto;
}

.search-count {
	margin: 0;
	padding: 8px 18px;
	font-size: 12px;
	color: var(--color-text-faint);
	border-bottom: 1px solid var(--color-border);
}

.search-results a {
	display: block;
	padding: 12px 18px;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid var(--color-border);
}

.search-results .snippet {
	display: block;
	margin: 3px 0 2px;
	font-size: 13px;
	line-height: 1.5;
	color: var(--color-text-muted);
}

.search-results mark {
	background: var(--color-primary-muted);
	color: inherit;
	border-radius: 3px;
	padding: 0 1px;
}

/* Hits highlighted in the article after arriving from a search result. */
.prose .search-hit {
	background: var(--color-primary-muted);
	color: inherit;
	border-radius: 3px;
	padding: 0 2px;
}

.prose .search-hit-first {
	background: var(--color-hint-warning-bg);
	box-shadow: 0 0 0 2px var(--color-hint-warning);
}

.search-results a:hover,
.search-results a.is-active {
	background: var(--color-primary-soft);
}

.search-results .path {
	display: block;
	font-size: 12px;
	color: var(--color-text-faint);
}

.search-empty {
	padding: 20px 18px;
	color: var(--color-text-muted);
}

@media (max-width: 979px) {
	.content {
		padding: 20px 16px 48px;
	}

	.article-title {
		font-size: 1.65rem;
	}

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

	/* Icon-only: match the square theme toggle instead of a stretched pill. */
	.search-open {
		width: 36px;
		padding: 0;
		justify-content: center;
	}
}
