/* Documentation-specific layout on top of the shared postal design system.
   Colors use the postal palette tokens (--ss-paper, --ss-ink, --ss-line, --ss-red),
   which are theme-aware (winter/sunset) and designed so paper (background) and ink
   (text) always contrast — matching the look of the main StockSharp site. */

:root {
	/* Height of the sticky top navbar (.ss-nav-inner); used to offset sticky columns
	   and scroll anchors so the navbar never overlaps them. */
	--ss-nav-h: 70px;
}

.ss-docs-layout {
	position: relative;
}

/* ===== Sidebar ===== */
.ss-docs-sidebar {
	width: 300px;
	flex-shrink: 0;
	border-right: 1px solid var(--ss-line);
	background-color: var(--ss-paper-2);
}

.ss-docs-nav {
	padding: 16px 12px 48px;
}

@media (min-width: 1024px) {
	/* Desktop: sidebar is a sticky column that scrolls independently below the navbar. */
	.ss-docs-sidebar {
		position: sticky;
		top: var(--ss-nav-h);
		align-self: flex-start;
		height: calc(100vh - var(--ss-nav-h));
		overflow-y: auto;
	}

	.ss-docs-backdrop {
		display: none !important;
	}

	/* The navbar burger collapses/expands the sidebar on desktop. */
	body.docs-sidebar-collapsed .ss-docs-sidebar {
		display: none;
	}

	/* With the sidebar collapsed, use the freed space: reveal the on-page nav (even on
	   narrower screens where it is normally hidden) and let the content breathe. */
	body.docs-sidebar-collapsed .ss-docs-onthispage {
		display: block;
	}

	/* Collapsed: let the content use the freed width (article and the prose column
	   inside it both fill instead of staying at their reading max-width). */
	body.docs-sidebar-collapsed .ss-docs-article {
		margin: 0;
		max-width: none;
	}

	body.docs-sidebar-collapsed .ss-prose {
		max-width: none;
	}
}

@media (max-width: 1023px) {
	/* Mobile/tablet: sidebar slides in as an off-canvas drawer BELOW the navbar, so the
	   header (with the burger) stays visible on top instead of being covered. */
	.ss-docs-sidebar {
		position: fixed;
		top: var(--ss-nav-h);
		left: 0;
		z-index: 70;
		width: 300px;
		max-width: 85vw;
		height: calc(100vh - var(--ss-nav-h));
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform 0.25s ease;
		box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
	}

	.ss-docs-sidebar.open {
		transform: translateX(0);
	}

	.ss-docs-backdrop {
		display: none;
		position: fixed;
		inset: var(--ss-nav-h) 0 0 0;
		z-index: 65;
		background-color: rgba(0, 0, 0, 0.5);
	}

	.ss-docs-backdrop.open {
		display: block;
	}
}

.ss-docs-main {
	padding: 28px 40px 64px;
}

@media (max-width: 640px) {
	.ss-docs-main {
		padding: 20px 18px 48px;
	}
}

.ss-docs-article {
	max-width: 880px;
	margin: 0 auto;
}

/* ===== Table of contents tree ===== */
.ss-toc, .ss-toc ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ss-toc ul {
	margin-left: 0.55rem;
	padding-left: 0.55rem;
	border-left: 1px solid var(--ss-line);
}

.ss-toc li {
	margin: 1px 0;
}

.ss-toc-link,
.ss-toc-group,
.ss-toc-summary {
	display: block;
	padding: 5px 10px;
	border-radius: 6px;
	font-size: 0.875rem;
	line-height: 1.35;
	color: var(--ss-ink-2);
	text-decoration: none;
}

.ss-toc-link {
	cursor: pointer;
}

.ss-toc-link:hover {
	background-color: color-mix(in oklab, var(--ss-ink) 8%, transparent);
	color: var(--ss-ink);
}

.ss-toc-link.active {
	background-color: color-mix(in oklab, var(--ss-red) 14%, transparent);
	color: var(--ss-red);
	font-weight: 600;
}

/* Grouping nodes (folders with no page of their own) — same size as the items they contain. */
.ss-toc-group {
	color: var(--ss-ink-2);
	font-weight: 600;
	font-size: 0.875rem;
}

/* Only the true top-level groups read as small uppercase section headers
   (nested lists use .ss-toc-sub, so this never matches deeper folders). */
.ss-toc > li > .ss-toc-group,
.ss-toc > li > details > summary > .ss-toc-group {
	text-transform: uppercase;
	font-size: 0.6875rem;
	letter-spacing: 0.06em;
	color: var(--ss-ink-3);
	margin-top: 0.5rem;
}

/* details/summary disclosure for nested groups */
.ss-toc details > summary {
	list-style: none;
	position: relative;
	padding-left: 1.35rem;
	cursor: pointer;
	border-radius: 6px;
}

.ss-toc details > summary:hover {
	background-color: color-mix(in oklab, var(--ss-ink) 8%, transparent);
}

.ss-toc details > summary::-webkit-details-marker {
	display: none;
}

.ss-toc details > summary::before {
	content: '';
	position: absolute;
	left: 9px;
	top: 50%;
	width: 0;
	height: 0;
	border-left: 4px solid var(--ss-ink-3);
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	transform: translateY(-50%);
	transition: transform 0.15s ease;
}

.ss-toc details[open] > summary::before {
	transform: translateY(-50%) rotate(90deg);
}

/* When a summary wraps a link, keep it inline (no double padding). */
.ss-toc-summary {
	padding: 5px 10px 5px 0;
}

.ss-toc-summary > .ss-toc-link {
	display: inline-block;
	padding: 0;
	border-radius: 0;
}

.ss-toc-summary > .ss-toc-link:hover {
	background: none;
	color: var(--ss-red);
}

.ss-toc-summary > .ss-toc-group {
	display: inline-block;
	padding: 0;
}

/* ===== Breadcrumbs ===== */
.ss-breadcrumbs {
	color: var(--ss-ink-3);
}

.ss-breadcrumbs a {
	color: var(--ss-ink-2);
	text-decoration: none;
}

.ss-breadcrumbs a:hover {
	color: var(--ss-red);
}

.ss-breadcrumb-sep {
	margin: 0 0.4rem;
	color: var(--ss-ink-4);
}

/* ===== Footer (postal palette, theme-aware) ===== */
.ss-docs-footer {
	margin-top: auto;
	border-top: 1px solid var(--ss-line);
	background-color: var(--ss-paper-2);
	color: var(--ss-ink-3);
}

.ss-docs-footer-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 36px 40px 28px;
	display: flex;
	flex-wrap: wrap;
	gap: 32px 64px;
	align-items: flex-start;
}

@media (max-width: 640px) {
	.ss-docs-footer-inner {
		padding: 28px 20px;
		gap: 24px;
	}
}

.ss-docs-footer-brand {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-width: 280px;
}

.ss-docs-footer-brand-row {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--ss-display, sans-serif);
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--ss-ink);
}

.ss-docs-footer-blurb {
	font-family: var(--ss-text, serif);
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--ss-ink-3);
}

.ss-docs-footer-col h4 {
	font-family: var(--ss-display, sans-serif);
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	font-weight: 700;
	margin-bottom: 10px;
	color: var(--ss-ink-3);
}

.ss-docs-footer-col ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ss-docs-footer-col a {
	font-size: 0.875rem;
	color: var(--ss-ink-2);
	text-decoration: none;
}

.ss-docs-footer-col a:hover {
	color: var(--ss-red);
}

.ss-docs-footer-copyright {
	margin-top: 14px;
	font-size: 0.8125rem;
	color: var(--ss-ink-3);
}

/* ===== API reference ===== */
.ss-api-heading, .ss-api-type-name {
	font-family: var(--ss-serif, serif);
	font-style: italic;
	font-size: 2em;
	color: var(--ss-ink);
}

.ss-api-type-ns {
	font-family: var(--ss-mono, monospace);
	font-size: 0.8rem;
	color: var(--ss-ink-3);
	margin-bottom: 1em;
}

.ss-api-type-summary {
	font-family: var(--ss-text, serif);
	font-size: 1.05rem;
	color: var(--ss-ink-2);
	margin-bottom: 1em;
}

/* Inheritance / implemented interfaces under the type header. */
.ss-api-relations {
	font-size: 0.9rem;
	color: var(--ss-ink-3);
	margin: 0.25em 0;
}

.ss-api-relations:last-of-type {
	margin-bottom: 1.5em;
}

.ss-api-relations-label {
	font-weight: 700;
}

.ss-api-relations a {
	color: var(--ss-red);
	text-decoration: none;
}

.ss-api-relations a:hover {
	text-decoration: underline;
}

.ss-api-ns { margin: 1.75em 0; }

.ss-api-ns-name {
	font-family: var(--ss-mono, monospace);
	font-size: 1rem;
	color: var(--ss-ink);
	padding-bottom: 6px;
	border-bottom: 1px solid var(--ss-line);
	margin-bottom: 10px;
}

.ss-api-type-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 2px 16px;
}

.ss-api-type-list a {
	color: var(--ss-red);
	text-decoration: none;
	font-size: 0.9rem;
}

.ss-api-type-list a:hover { text-decoration: underline; }

.ss-api-section { margin: 2em 0; }

.ss-api-section h2 {
	font-family: var(--ss-serif, serif);
	font-style: italic;
	font-size: 1.4em;
	color: var(--ss-ink);
	margin-bottom: 0.5em;
}

.ss-api-member {
	padding: 14px 0;
	border-bottom: 1px solid var(--ss-line);
	scroll-margin-top: calc(var(--ss-nav-h) + 12px);
}

/* Anchor targets (on-page nav, in-page links) must clear the sticky navbar. */
.ss-prose :is(h1, h2, h3, h4, h5, h6),
.ss-api-section h2[id],
[id].ss-anchor-target {
	scroll-margin-top: calc(var(--ss-nav-h) + 12px);
}

/* Briefly flag the member that the URL anchor points to. */
.ss-api-member:target {
	background: color-mix(in oklab, var(--ss-red) 8%, transparent);
	box-shadow: -10px 0 0 color-mix(in oklab, var(--ss-red) 8%, transparent);
}

.ss-api-member-sig {
	display: block;
	font-family: var(--ss-mono, monospace);
	font-size: 0.85rem;
	color: var(--ss-red);
	background: none;
	padding: 0;
	overflow-wrap: anywhere;
}

/* Links inside a signature (the member permalink and parameter type links). */
.ss-api-member-sig a {
	color: inherit;
	text-decoration: none;
}

.ss-api-member-sig a:hover {
	text-decoration: underline;
}

.ss-api-anchor {
	font-weight: 700;
}

/* "  : Type" suffix on properties/fields and method return types. */
.ss-api-rettype {
	color: var(--ss-ink-4);
}

.ss-api-rettype a {
	color: var(--ss-red);
}

.ss-api-member-summary {
	font-size: 0.9rem;
	color: var(--ss-ink-2);
	margin: 6px 0 0;
}

.ss-api-params {
	margin: 8px 0 0;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 3px 14px;
	font-size: 0.85rem;
}

.ss-api-params dt {
	font-family: var(--ss-mono, monospace);
	color: var(--ss-ink);
	font-weight: 600;
}

.ss-api-params dd {
	margin: 0;
	color: var(--ss-ink-3);
}

.ss-api-returns {
	margin: 8px 0 0;
	font-size: 0.85rem;
	color: var(--ss-ink-2);
}

.ss-api-returns-label {
	font-weight: 700;
	color: var(--ss-ink-3);
}

/* ===== Designer block diagram (reconstructed from the schema JSON) ===== */
.ss-diagram-wrap {
	position: relative;
	margin: 1.5em 0;
	height: 600px;
	overflow: hidden;
	border: 1px solid var(--ss-line);
	border-radius: 8px;
	background: var(--ss-paper-2);
}

/* Host element the diagram engine renders its canvas into; fills the box (600px or fullscreen). */
.ss-diagram-host {
	position: absolute;
	inset: 0;
}

/* Expand button pinned to the top-right of the diagram (does not scroll with it). */
.ss-diagram-expand {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	background: var(--ss-paper);
}

.ss-diagram-img {
	max-width: 100%;
	border: 1px solid var(--ss-line);
	border-radius: 8px;
	margin: 1.5em 0;
}

/* ===== Strategy examples index ===== */
.ss-examples-filter input {
	width: 100%;
	height: 40px;
	padding: 0 14px;
	font-size: 0.95rem;
	color: var(--ss-ink);
	background: var(--ss-stamp);
	border: 1px solid var(--ss-line);
	border-radius: 8px;
	outline: none;
	margin-bottom: 1em;
}

.ss-examples-filter input:focus { border-color: var(--ss-red); }

.ss-examples-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ss-example-item a {
	display: flex;
	align-items: baseline;
	gap: 12px;
	padding: 8px 10px;
	border-bottom: 1px solid var(--ss-line);
	text-decoration: none;
}

.ss-example-item a:hover { background: color-mix(in oklab, var(--ss-ink) 5%, transparent); }

.ss-example-id {
	font-family: var(--ss-mono, monospace);
	font-size: 0.75rem;
	color: var(--ss-ink-3);
	flex: 0 0 auto;
	min-width: 3.5em;
}

.ss-example-title { color: var(--ss-red); font-size: 0.95rem; }

.ss-examples-empty { padding: 1em; color: var(--ss-ink-3); }

/* ===== Code tabs (C# / Python) ===== */
.ss-code-tabs {
	margin: 1.75em 0;
	border: 1px solid var(--ss-line);
	border-radius: 8px;
	overflow: hidden;
}

.ss-code-tablist {
	display: flex;
	background: var(--ss-paper-2);
	border-bottom: 1px solid var(--ss-line);
}

.ss-code-tab {
	padding: 9px 18px;
	font-family: var(--ss-display, sans-serif);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	color: var(--ss-ink-3);
	background: none;
	border: none;
	border-bottom: 2px solid transparent;
	cursor: pointer;
}

.ss-code-tab:hover { color: var(--ss-ink); }

.ss-code-tab.active {
	color: var(--ss-red);
	border-bottom-color: var(--ss-red);
}

/* Scoped to .ss-code-tabs so it overrides the .ss-prose pre box (border/radius/margin)
   when a markdown code block is wrapped in the viewer — otherwise a double border shows. */
.ss-code-tabs .ss-code-panel {
	margin: 0;
	padding: 16px;
	max-height: 620px;
	overflow: auto;
	background: var(--ss-stamp);
	border: 0;
	border-radius: 0;
}

.ss-code-tabs .ss-code-panel code {
	font-family: var(--ss-mono, monospace);
	font-size: 0.82rem;
	line-height: 1.5;
	background: none;
	padding: 0;
	color: var(--ss-ink-2);
}

/* Toolbar on the code tabs: copy + expand, pushed to the right of the tab list. */
.ss-code-tools {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: 5px;
	padding-right: 8px;
}

/* Copy buttons (code tabs and markdown blocks) show a clipboard icon, swapping to a
   check mark on success. */
.ss-code-copy svg,
.ss-copy-btn svg { width: 15px; height: 15px; display: block; }

.ss-code-copy .ss-ico-copied,
.ss-copy-btn .ss-ico-copied { display: none; }

.ss-code-copy.copied .ss-ico-copy,
.ss-copy-btn.copied .ss-ico-copy { display: none; }

.ss-code-copy.copied .ss-ico-copied,
.ss-copy-btn.copied .ss-ico-copied { display: block; color: var(--ss-teal); }

.ss-code-copy.copied,
.ss-copy-btn.copied { border-color: var(--ss-teal); }

/* Square icon button (copy, expand, etc.). */
.ss-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 26px;
	font-size: 0.95rem;
	line-height: 1;
	color: var(--ss-ink-2);
	background: none;
	border: 1px solid var(--ss-line);
	border-radius: 5px;
	cursor: pointer;
}

.ss-icon-btn:hover { color: var(--ss-red); border-color: var(--ss-red); }

/* Single language label in a markdown code block's header (not a switchable tab). */
.ss-code-lang { cursor: default; }

/* Expand button shows the "maximize" icon when collapsed and "minimize" when expanded. */
.ss-expand-btn svg { width: 15px; height: 15px; display: block; }
.ss-expand-btn .ss-ico-collapse { display: none; }
.ss-expandable.is-expanded .ss-expand-btn .ss-ico-expand { display: none; }
.ss-expandable.is-expanded .ss-expand-btn .ss-ico-collapse { display: block; }

/* The code viewer's expand-to-fullscreen is a desktop-only affordance. */
@media (max-width: 1023px) {
	.ss-code-tabs .ss-expand-btn { display: none; }
}

/* GitHub folder link on section detail pages. */
.ss-github-link {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-bottom: 1.25em;
	padding: 6px 12px;
	font-size: 0.85rem;
	color: var(--ss-ink-2);
	border: 1px solid var(--ss-line);
	border-radius: 7px;
	text-decoration: none;
}

.ss-github-link:hover { border-color: var(--ss-red); color: var(--ss-red); }

/* Expand a diagram or code viewer to a near-fullscreen overlay. */
body.ss-modal-open { overflow: hidden; }

.ss-expandable.is-expanded {
	position: fixed;
	inset: 12px;
	z-index: 200;
	margin: 0;
	width: auto;
	height: auto;
	max-width: none;
	max-height: none;
	background: var(--ss-paper);
	border: 1px solid var(--ss-line);
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
	display: flex;
	flex-direction: column;
}

.ss-code-tabs.is-expanded .ss-code-panel {
	max-height: none;
	flex: 1 1 auto;
}


/* ===== Search results page ===== */
.ss-search-heading {
	font-family: var(--ss-serif, serif);
	font-style: italic;
	font-size: 2em;
	color: var(--ss-ink);
	margin-bottom: 0.6em;
}

.ss-search-form input {
	width: 100%;
	height: 44px;
	padding: 0 16px;
	font-size: 1rem;
	color: var(--ss-ink);
	background: var(--ss-stamp);
	border: 1px solid var(--ss-line);
	border-radius: 8px;
	outline: none;
}

.ss-search-form input:focus { border-color: var(--ss-red); }

.ss-search-hint {
	margin-top: 1.5em;
	color: var(--ss-ink-3);
}

.ss-search-results {
	list-style: none;
	margin: 1.5em 0 0;
	padding: 0;
}

.ss-search-result {
	padding: 14px 0;
	border-bottom: 1px solid var(--ss-line);
}

.ss-search-result-title {
	font-family: var(--ss-serif, serif);
	font-size: 1.15rem;
	color: var(--ss-red);
	text-decoration: none;
}

.ss-search-result-title:hover { text-decoration: underline; }

.ss-search-result-url {
	font-family: var(--ss-mono, monospace);
	font-size: 0.75rem;
	color: var(--ss-ink-3);
	margin: 2px 0 4px;
}

.ss-search-result-summary {
	font-size: 0.875rem;
	color: var(--ss-ink-2);
	margin: 0;
}

/* ===== Language fallback notice ===== */
.ss-docs-fallback {
	margin: 0 0 1.25em;
	padding: 0.6em 1em;
	font-size: 0.875rem;
	color: var(--ss-ink-2);
	background: var(--ss-stamp);
	border: 1px solid var(--ss-line);
	border-left: 4px solid var(--ss-postmark);
	border-radius: 0 8px 8px 0;
}

/* ===== Prev/next pager ===== */
.ss-docs-pager {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 48px;
	padding-top: 24px;
	border-top: 1px solid var(--ss-line);
}

.ss-docs-pager-link {
	display: flex;
	flex-direction: column;
	gap: 4px;
	max-width: 46%;
	padding: 12px 16px;
	border: 1px solid var(--ss-line);
	border-radius: 8px;
	text-decoration: none;
	transition: border-color 0.15s ease;
}

.ss-docs-pager-link:hover { border-color: var(--ss-red); }
.ss-docs-pager-link.next { margin-left: auto; text-align: right; }

.ss-docs-pager-dir {
	font-family: var(--ss-display, sans-serif);
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--ss-ink-3);
}

.ss-docs-pager-title {
	font-size: 0.9375rem;
	color: var(--ss-red);
}

@media (max-width: 640px) {
	.ss-docs-pager-link { max-width: 48%; padding: 10px 12px; }
	.ss-docs-pager-title { font-size: 0.85rem; }
}

/* ===== Text selection (keep selected text readable in both themes) ===== */
::selection { background: color-mix(in oklab, var(--ss-red) 30%, transparent); color: var(--ss-ink); }
::-moz-selection { background: color-mix(in oklab, var(--ss-red) 30%, transparent); color: var(--ss-ink); }

/* ===== Sidebar filter ===== */
.ss-docs-filter {
	position: sticky;
	top: 0;
	z-index: 2;
	padding: 12px 12px 8px;
	background: var(--ss-paper-2);
	border-bottom: 1px solid var(--ss-line);
}

.ss-docs-filter input {
	width: 100%;
	height: 32px;
	padding: 0 10px;
	font-size: 0.8125rem;
	color: var(--ss-ink);
	background: var(--ss-stamp);
	border: 1px solid var(--ss-line);
	border-radius: 6px;
	outline: none;
}

.ss-docs-filter input::placeholder { color: var(--ss-ink-3); }
.ss-docs-filter input:focus { border-color: var(--ss-red); }

.ss-docs-filter-empty {
	padding: 8px 16px;
	font-size: 0.8125rem;
	color: var(--ss-ink-3);
}

/* TOC nodes hidden by the filter. */
.ss-toc li.filtered-out,
.ss-toc-sub li.filtered-out { display: none; }

/* Active-path highlight: ancestors of the current page. */
.ss-toc-link.on-path,
.ss-toc-group.on-path { color: var(--ss-red); }
.ss-toc-summary.on-path > .ss-toc-group,
.ss-toc-summary.on-path > .ss-toc-link { color: var(--ss-red); font-weight: 600; }

/* ===== On-page navigation ("In this article", right side) ===== */
.ss-docs-onthispage {
	width: 230px;
	flex-shrink: 0;
	position: sticky;
	top: var(--ss-nav-h);
	align-self: flex-start;
	max-height: calc(100vh - var(--ss-nav-h));
	overflow-y: auto;
}

.ss-docs-onthispage-inner {
	padding: 28px 20px 40px;
}

.ss-docs-onthispage-title {
	font-family: var(--ss-display, sans-serif);
	font-size: 0.6875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--ss-ink-3);
	margin-bottom: 10px;
}

.ss-docs-onthispage ul { list-style: none; margin: 0; padding: 0; }

.ss-docs-onthispage li { margin: 2px 0; }

.ss-docs-onthispage a {
	display: block;
	padding: 3px 10px;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--ss-ink-3);
	text-decoration: none;
	border-left: 2px solid transparent;
	margin-left: -2px;
}

.ss-docs-onthispage a:hover { color: var(--ss-ink); }

.ss-docs-onthispage a.active {
	color: var(--ss-red);
	border-left-color: var(--ss-red);
	font-weight: 600;
}

.ss-docs-onthispage .ss-onpage-l3 a { padding-left: 22px; font-size: 0.78rem; }

/* Hide the on-page nav when there isn't room for a third column (collapse the sidebar to reveal it). */
@media (max-width: 1151px) {
	.ss-docs-onthispage { display: none; }
}

/* ===== Copy-to-clipboard button on code blocks ===== */
.ss-prose pre { position: relative; }

.ss-copy-btn {
	position: absolute;
	top: 8px;
	right: 8px;
	background: var(--ss-paper-2);
	opacity: 0;
	transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ss-prose pre:hover .ss-copy-btn,
.ss-copy-btn:focus-visible { opacity: 1; }

/* On touch screens (no hover), keep the button visible. */
@media (hover: none) {
	.ss-copy-btn { opacity: 1; }
}

/* ===== Navbar tweaks (override the shared postal classes for the docs site only) ===== */
/* Logo mark "S#": the postal display font (Antonio) is condensed and reads as squashed —
   use a normal-width serif and bump size/weight so it looks solid. */
.ss-logo-mark {
	font-family: var(--ss-text, Georgia, serif);
	font-weight: 700;
	font-size: 16px;
	letter-spacing: 0;
}

/* Wordmark "STOCKSHARP Documentation": the postal default is small — enlarge it. */
.ss-logo-text {
	font-size: 18px;
	letter-spacing: 0.12em;
}

.ss-logo-text small {
	font-size: 18px;
	color: var(--ss-ink-2);
	margin-left: 2px;
}

/* Language switcher "EN": larger and bolder so it's clearly legible. */
.ss-lang {
	font-size: 13px;
	font-weight: 800;
}

/* Flag in the language switcher / menu (served as an image from /flag/{id}). */
.ss-lang-flag {
	width: 18px;
	height: 13px;
	border-radius: 2px;
	object-fit: cover;
	flex: 0 0 auto;
}

.ss-lang-menu li > a { display: flex; align-items: center; gap: 8px; }

.ss-lang > span {
	font-weight: 800;
}

/* ===== Code blocks & syntax highlighting (highlight.js, themed with postal tokens) =====
   highlight.js only adds .hljs-* classes; colors live here and reference --ss-* so they
   adapt to winter/sunset automatically (no re-highlight needed on theme switch). */
.ss-prose pre {
	background: var(--ss-stamp);
	border: 1px solid var(--ss-line);
	border-radius: 8px;
	padding: 14px 16px;
	overflow-x: auto;
	margin: 1em 0;
}

.ss-prose pre code {
	display: block;
	font-family: var(--ss-mono, monospace);
	font-size: 0.85rem;
	line-height: 1.5;
	background: none;
	padding: 0;
	color: var(--ss-ink-2);
}

/* Inline code (not inside a pre). */
.ss-prose :not(pre) > code {
	font-family: var(--ss-mono, monospace);
	font-size: 0.85em;
	background: color-mix(in oklab, var(--ss-ink) 9%, transparent);
	color: var(--ss-red);
	padding: 1px 5px;
	border-radius: 4px;
}

/* highlight.js token palette mapped to the postal colors. */
.hljs { color: var(--ss-ink-2); background: transparent; }
.hljs-comment, .hljs-quote { color: var(--ss-ink-4); font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-doctag { color: var(--ss-blue); }
.hljs-tag, .hljs-name, .hljs-meta-keyword { color: var(--ss-blue); }
.hljs-built_in, .hljs-title, .hljs-title.class_, .hljs-title.function_, .hljs-class .hljs-title { color: var(--ss-red); }
.hljs-string, .hljs-meta .hljs-string, .hljs-regexp, .hljs-addition { color: var(--ss-teal); }
.hljs-number, .hljs-symbol, .hljs-bullet, .hljs-link { color: var(--ss-postmark); }
.hljs-type, .hljs-params, .hljs-attr, .hljs-attribute, .hljs-variable, .hljs-template-variable { color: var(--ss-ink-2); }
.hljs-meta, .hljs-comment.hljs-doctag { color: var(--ss-ink-3); }
.hljs-deletion { color: var(--ss-red); }
.hljs-emphasis { font-style: italic; }
.hljs-strong { font-weight: 700; }

/* ===== Embedded video (DocFX [!Video] extension) ===== */
.ss-video {
	position: relative;
	width: 100%;
	max-width: 760px;
	margin: 1.25em 0;
	aspect-ratio: 16 / 9;
	border-radius: 10px;
	overflow: hidden;
	background: #000;
	border: 1px solid var(--ss-line);
}

.ss-video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ===== Alerts (Markdig UseAlertBlocks output: > [!NOTE] etc.) ===== */
.markdown-alert {
	margin: 1em 0;
	padding: 0.6em 1em;
	border-left: 4px solid var(--ss-red);
	border-radius: 0 8px 8px 0;
	background: var(--ss-stamp);
	color: var(--ss-ink-2);
}

.markdown-alert > :first-child { margin-top: 0; }
.markdown-alert > :last-child { margin-bottom: 0; }

.markdown-alert-title {
	display: flex;
	align-items: center;
	font-weight: 700;
	margin-bottom: 0.3em;
	text-transform: capitalize;
	color: var(--ss-ink);
}

/* The octicon ships without a fill, so it defaults to black and is invisible on the
   dark theme. Make it follow the title color (theme-aware and visible in both themes). */
.markdown-alert-title svg {
	fill: currentColor;
	margin-right: 0.4em;
	flex-shrink: 0;
}

.markdown-alert-note { border-left-color: var(--ss-blue); }
.markdown-alert-note .markdown-alert-title { color: var(--ss-blue); }

.markdown-alert-tip { border-left-color: var(--ss-teal); }
.markdown-alert-tip .markdown-alert-title { color: var(--ss-teal); }

.markdown-alert-important { border-left-color: var(--ss-postmark); }
.markdown-alert-important .markdown-alert-title { color: var(--ss-postmark); }

.markdown-alert-warning { border-left-color: var(--ss-highlight); }
.markdown-alert-warning .markdown-alert-title { color: color-mix(in oklab, var(--ss-highlight) 75%, var(--ss-ink)); }

.markdown-alert-caution { border-left-color: var(--ss-red); }
.markdown-alert-caution .markdown-alert-title { color: var(--ss-red); }
