:root {
	--sabp-docs-bg: #f8fafc;
	--sabp-docs-surface: #ffffff;
	--sabp-docs-surface-alt: #f1f5f9;
	--sabp-docs-text: #0f172a;
	--sabp-docs-muted: #475569;
	--sabp-docs-border: #dbe4ee;
	--sabp-docs-brand: #7c3aed;
	--sabp-docs-brand-hover: #6d28d9;
	--sabp-docs-code-bg: #e2e8f0;
	--sabp-docs-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
	--sabp-docs-highlight: #facc15;
}

body.sabp-docs-theme-dark {
	color-scheme: dark;
	--sabp-docs-bg: #0f172a;
	--sabp-docs-surface: #111827;
	--sabp-docs-surface-alt: #1f2937;
	--sabp-docs-text: #e5e7eb;
	--sabp-docs-muted: #94a3b8;
	--sabp-docs-border: #334155;
	--sabp-docs-brand: #a78bfa;
	--sabp-docs-brand-hover: #c4b5fd;
	--sabp-docs-code-bg: #1e293b;
	--sabp-docs-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
	--sabp-docs-highlight: #b18e25;
	background: var( --sabp-docs-bg );
}

body,
#app {
	background: var( --sabp-docs-bg );
	color: var( --sabp-docs-text );
}

.sidebar,
.content,
.app-nav,
.markdown-section,
.search input,
.sidebar-toggle,
.github-corner svg {
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar {
	background: var( --sabp-docs-surface );
	border-right: 1px solid var( --sabp-docs-border );
	color: var( --sabp-docs-text );
}

.sidebar a,
.sidebar p,
.sidebar strong,
.sidebar span {
	color: inherit;
}

.sidebar ul li a {
	color: var( --sabp-docs-muted );
}

.sidebar ul li.active > a,
.sidebar ul li a:hover {
	color: var( --sabp-docs-brand );
}

.content {
	background: linear-gradient(180deg, rgba(124, 58, 237, 0.05), transparent 220px), var( --sabp-docs-bg );
	color: var( --sabp-docs-text );
}

.markdown-section {
	background: transparent;
	color: var( --sabp-docs-text );
	max-width: 920px;
}

.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4,
.markdown-section h5,
.markdown-section h6,
.markdown-section strong {
	color: var( --sabp-docs-text );
}

.markdown-section p,
.markdown-section li,
.markdown-section table,
.markdown-section blockquote,
.markdown-section tr,
.markdown-section td,
.markdown-section th {
	color: var( --sabp-docs-text );
}

.markdown-section a {
	color: var( --sabp-docs-brand );
}

.markdown-section a:hover {
	color: var( --sabp-docs-brand-hover );
}

.markdown-section code,
.markdown-section pre,
.markdown-section pre code {
	background: var( --sabp-docs-code-bg );
	border-color: var( --sabp-docs-border );
	color: var( --sabp-docs-text );
}

.markdown-section blockquote {
	background: var( --sabp-docs-highlight );
	border-left: 4px solid var( --sabp-docs-brand );
	box-shadow: var( --sabp-docs-shadow );
}

.markdown-section table {
	/*
	 * Docsify's base theme sets display:block on <table> so wide tables can
	 * scroll horizontally on narrow screens. That strips the table's own
	 * formatting context, so the browser builds an invisible inner table box
	 * to lay out the rows/cells — and that inner box only shrink-wraps its
	 * content instead of filling the 100% width the outer box has. The card
	 * styling below (background, border, radius) renders on the full-width
	 * outer box, while the actual cell borders stop short of it, leaving a
	 * blank strip on the right. Restoring display:table makes the table
	 * itself fill the width with no inner/outer mismatch.
	 */
	display: table;
	border-collapse: separate;
	border-spacing: 0;
	border-color: var( --sabp-docs-border );
	background: var( --sabp-docs-surface );
	box-shadow: var( --sabp-docs-shadow );
	border: 1px solid var( --sabp-docs-border );
	border-radius: 14px;
	overflow: hidden;
}

.markdown-section thead th,
.markdown-section tbody td,
.markdown-section tfoot td {
	border-color: var( --sabp-docs-border );
}

.markdown-section thead th {
	background: var( --sabp-docs-surface-alt );
	color: var( --sabp-docs-text );
	font-weight: 700;
	letter-spacing: 0.01em;
	text-transform: none;
}

.markdown-section tbody tr:nth-child( 2n ) {
	background: rgba( 148, 163, 184, 0.08 );
}

.markdown-section tbody tr:hover {
	background: rgba( 167, 139, 250, 0.12 );
}

.markdown-section td,
.markdown-section th {
	padding: 0.85rem 1rem;
	vertical-align: top;
}

body.sabp-docs-theme-dark .markdown-section table {
	background: var( --sabp-docs-surface );
	border-color: var( --sabp-docs-border );
	box-shadow: var( --sabp-docs-shadow );
}

body.sabp-docs-theme-dark .markdown-section table tr > * {
	background: var( --sabp-docs-surface ) !important;
	color: #e5e7eb !important;
	border-color: #334155 !important;
}

body.sabp-docs-theme-dark .markdown-section thead th {
	background: #1f2937;
	color: #f8fafc;
}

body.sabp-docs-theme-dark .markdown-section tbody tr:nth-child( 2n ) {
	background: rgba( 148, 163, 184, 0.08 ) !important;
}

body.sabp-docs-theme-dark .markdown-section tbody tr:nth-child( 2n + 1 ) {
	background: transparent !important;
}

body.sabp-docs-theme-dark .markdown-section tbody tr:hover {
	background: rgba( 167, 139, 250, 0.16 ) !important;
}

body.sabp-docs-theme-dark .markdown-section td,
body.sabp-docs-theme-dark .markdown-section th,
body.sabp-docs-theme-dark .markdown-section thead th,
body.sabp-docs-theme-dark .markdown-section tbody td,
body.sabp-docs-theme-dark .markdown-section tfoot td {
	border-color: #334155;
	color: #e5e7eb !important;
}

body.sabp-docs-theme-dark .markdown-section table tbody td,
body.sabp-docs-theme-dark .markdown-section table tbody th {
	background: #111827 !important;
}

body.sabp-docs-theme-dark .markdown-section table tbody tr:nth-child( 2n ) > * {
	background: #1f2937 !important;
}

body.sabp-docs-theme-dark .markdown-section table tbody tr:hover > * {
	background: #2e1f4d !important;
}

body.sabp-docs-theme-dark .markdown-section table strong,
body.sabp-docs-theme-dark .markdown-section table code {
	color: #f8fafc !important;
}

body.sabp-docs-theme-dark .markdown-section table a {
	color: #c4b5fd;
}

body.sabp-docs-theme-dark .markdown-section table a:hover {
	color: #ddd6fe;
}

/* Blockquotes sit on --sabp-docs-highlight, a muted gold in dark mode
   (#b18e25) — the default link color (--sabp-docs-brand, #a78bfa) has low
   contrast against it and reads as nearly invisible. Match the
   blockquote's own (already-readable) text color instead, with an
   underline so the link is still visually distinct from plain text. */
body.sabp-docs-theme-dark .markdown-section blockquote a {
	color: var( --sabp-docs-text );
	text-decoration: underline;
}

body.sabp-docs-theme-dark .markdown-section blockquote a:hover {
	color: #ffffff;
}

/* Same problem, different element: docsify's base theme colors <em> a flat
   #7f8c8d gray regardless of surrounding context — fine on the gold
   highlight in light mode, but low-contrast to the point of being hard to
   read in dark mode (e.g. INSTALLATION-GUIDE.md's italicized error-message
   quote inside a blockquote). Match the blockquote's own readable text
   color instead. */
body.sabp-docs-theme-dark .markdown-section blockquote em {
	color: var( --sabp-docs-text );
}

.app-nav {
	background: rgba( 255, 255, 255, 0.72 );
	backdrop-filter: blur( 12px );
	border-bottom: 1px solid rgba( 148, 163, 184, 0.2 );
	color: var( --sabp-docs-text );
}

body.sabp-docs-theme-dark .app-nav {
	background: rgba( 15, 23, 42, 0.76 );
	border-bottom-color: rgba( 148, 163, 184, 0.18 );
}

.app-nav a {
	color: var( --sabp-docs-text );
}

.search input {
	background: var( --sabp-docs-surface );
	border-color: var( --sabp-docs-border );
	color: var( --sabp-docs-text );
}

.search input::placeholder {
	color: var( --sabp-docs-muted );
}

.sidebar-toggle {
	background: var( --sabp-docs-surface );
	border: 1px solid var( --sabp-docs-border );
	box-shadow: var( --sabp-docs-shadow );
	color: var( --sabp-docs-text );
}

/* Two-icon segmented control — fixed bottom-right slot, backed by
   localStorage + prefers-color-scheme. Uses only --sabp-docs-* custom
   properties, which are already redefined wholesale under
   body.sabp-docs-theme-dark above, so no separate dark-mode override
   block is needed here. */
.sabp-docs-theme-toggle-group {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 1000;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: var( --sabp-docs-surface );
	border: 1px solid var( --sabp-docs-border );
	border-radius: 9999px;
	box-shadow: var( --sabp-docs-shadow );
	padding: 4px;
}

.sabp-docs-theme-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: transparent;
	border: 1px solid transparent;
	border-radius: 9999px;
	cursor: pointer;
	font: inherit;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.sabp-docs-theme-btn:hover,
.sabp-docs-theme-btn:focus {
	background: var( --sabp-docs-surface-alt );
	outline: none;
}

.sabp-docs-theme-btn.is-active {
	background: var( --sabp-docs-surface-alt );
	border-color: var( --sabp-docs-border );
}

/* Sun/moon glyphs as inline-SVG-mask icons. currentColor via mask
   (background-color) so the active-state color change below is a single
   property, no new SVG. */
.sabp-docs-theme-icon {
	display: block;
	width: 16px;
	height: 16px;
	background-color: var( --sabp-docs-muted );
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
}

.sabp-docs-theme-btn.is-active .sabp-docs-theme-icon {
	background-color: var( --sabp-docs-brand );
}

.sabp-docs-theme-icon--sun {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E");
}

.sabp-docs-theme-icon--moon {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z'/%3E%3C/svg%3E");
}

/* Plugin icon: sidebar logo and the docs home page. */
.app-name-link img {
	width: 64px;
	height: 64px;
	border-radius: 14px;
}

.markdown-section img.docs-icon {
	width: 72px;
	height: 72px;
	border-radius: 16px;
	cursor: default;
}
