/* --------------------------------------------------------------------------
 * Documentation surface
 *
 * Styles for /docs/* pages served by content_management. All colour values
 * resolve to design-system tokens (--fg-*, --border-*, --surface-*); tone
 * variants (--brand / --info / --warning / --danger / --success / --muted)
 * map onto the matching semantic pair so a tenant theme override propagates
 * to the docs automatically. See platformkit-business-modules/content_management
 * /features/articles/render_docs_design.go for the Go side — the `pk-docs-*`
 * classes emitted there are styled here.
 * --------------------------------------------------------------------------
 */

/* ---------- Docs page shell ---------- */
.pk-docs-layout {
	display: grid;
	grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr) minmax(11rem, 15rem);
	gap: clamp(1.5rem, 3vw, 2.5rem);
	max-width: 88rem;
	margin: 0 auto;
	padding: 2rem clamp(1rem, 3vw, 2rem) 6rem;
	align-items: start;
}
@media (max-width: 1200px) {
	.pk-docs-layout { grid-template-columns: minmax(13rem, 16rem) minmax(0, 1fr); }
	.pk-docs-toc { display: none; }
}
@media (max-width: 960px) {
	.pk-docs-layout { grid-template-columns: minmax(0, 1fr); padding: 1.5rem 1.25rem 4rem; gap: 1.5rem; }
	.pk-docs-sidebar {
		position: static;
		top: auto;
		max-height: none;
		overflow: visible;
		padding: 0 0 1rem;
		border-right: 0;
		border-bottom: 1px solid rgb(var(--border-primary));
	}
}

/* ---------- Sidebar ---------- */
.pk-docs-sidebar {
	position: sticky;
	top: 5rem;
	max-height: calc(100vh - 6rem);
	max-height: calc(100svh - 6rem);
	overflow-y: auto;
	padding: 1rem 0.75rem 1rem 0;
	border-right: 1px solid rgb(var(--border-primary));
}
.pk-docs-sidebar-chrome {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
.pk-docs-sidebar-root {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.45rem 0.25rem;
	color: rgb(var(--fg-secondary));
	text-decoration: none;
	font-size: 0.88rem;
	font-weight: 600;
	overflow-wrap: anywhere;
}
.pk-docs-sidebar-root:hover,
.pk-docs-sidebar-root:focus-visible {
	color: rgb(var(--fg-primary));
}
.pk-docs-sidebar-root-mark {
	color: rgb(var(--fg-brand));
	font-size: 0.95rem;
}
.pk-docs-sidebar-home {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.65rem 0.75rem;
	margin-bottom: 1rem;
	border-radius: 0.65rem;
	color: rgb(var(--fg-primary));
	text-decoration: none;
	font-weight: 600;
	font-size: 0.95rem;
	background: linear-gradient(135deg,
		color-mix(in srgb, rgb(var(--fg-brand)) 8%, transparent),
		color-mix(in srgb, rgb(var(--fg-brand)) 2%, transparent));
	border: 1px solid color-mix(in srgb, rgb(var(--border-brand)) 40%, transparent);
}
.pk-docs-sidebar-home-mark { color: rgb(var(--fg-brand)); font-size: 1.1rem; }
.pk-docs-sidebar [data-sidebar-section] { scroll-margin-top: 5rem; }
.pk-docs-sidebar [data-sidebar-section-glyph] { font-size: 0.9rem; }
.pk-docs-sidebar [data-sidebar-tone="brand"] [data-sidebar-section-glyph] { color: rgb(var(--fg-brand)); }
.pk-docs-sidebar [data-sidebar-tone="info"] [data-sidebar-section-glyph] { color: rgb(var(--fg-info)); }
.pk-docs-sidebar [data-sidebar-tone="warning"] [data-sidebar-section-glyph] { color: rgb(var(--fg-warning)); }
.pk-docs-sidebar [data-sidebar-tone="danger"] [data-sidebar-section-glyph] { color: rgb(var(--fg-danger)); }
.pk-docs-sidebar [data-sidebar-tone="success"] [data-sidebar-section-glyph] { color: rgb(var(--fg-success)); }
.pk-docs-sidebar [data-sidebar-tone="muted"] [data-sidebar-section-glyph] { color: rgb(var(--fg-muted)); }
.pk-docs-sidebar [data-sidebar-item] { min-width: 0; }
.pk-docs-sidebar [data-sidebar-item-prefix] {
	font-family: ui-monospace, 'IBM Plex Mono', 'SFMono-Regular', Menlo, monospace;
	font-size: 0.78rem;
	color: rgb(var(--fg-tertiary));
	min-width: 2.35rem;
	flex: 0 0 auto;
	font-variant-numeric: tabular-nums;
}
.pk-docs-sidebar [data-sidebar-item].active [data-sidebar-item-prefix] {
	color: rgb(var(--fg-brand));
}
.pk-docs-sidebar [data-sidebar-item-label] { min-width: 0; flex: 1 1 auto; overflow-wrap: anywhere; line-height: 1.35; }

/* ---------- Main column ---------- */
.pk-docs-main { min-width: 0; max-width: 52rem; margin: 0 auto; width: 100%; }
.pk-docs-breadcrumb {
	margin-bottom: 1.5rem;
}

/* ---------- Article hero (per ADR) ---------- */
.pk-docs-article-hero {
	padding: 0 0 2rem 0;
	margin-bottom: 2.5rem;
	border-bottom: 1px solid rgb(var(--border-primary));
	position: relative;
}
.pk-docs-article-hero::after {
	content: "";
	position: absolute;
	left: 0; bottom: -1px;
	width: 5rem; height: 3px;
	background: linear-gradient(90deg,
		rgb(var(--fg-brand)),
		color-mix(in srgb, rgb(var(--fg-brand)) 40%, transparent));
	border-radius: 2px;
}
.pk-docs-article-hero-meta {
	display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center;
	margin-top: 1.15rem;
}
.pk-docs-article-title {
	font-size: 2.5rem;
	line-height: 1.1;
	font-weight: 800;
	letter-spacing: 0;
	color: rgb(var(--fg-primary));
	margin: 0 0 0.75rem;
}
.pk-docs-article-lede {
	font-size: 1.15rem;
	line-height: 1.55;
	color: rgb(var(--fg-secondary));
	margin: 0;
	max-width: 42rem;
}

/* ---------- Badges / tags / status ---------- */
.pk-docs-badge,
.pk-docs-status {
	white-space: nowrap;
}

.pk-docs-topic-link {
	display: inline-flex;
	text-decoration: none;
	transition: transform 180ms;
}
.pk-docs-topic-link:hover { transform: translateY(-1px); }
.pk-docs-topic-tag { white-space: nowrap; }

.pk-docs-status--deprecated,
.pk-docs-status--superseded { text-decoration: line-through; }

.pk-docs-date-tag {
	display: inline-flex;
}
.pk-docs-article-hero-meta .pk-docs-date-tag,
.pk-docs-card-head .pk-docs-date-tag {
	margin-left: auto;
}
.pk-docs-date-badge {
	font-variant-numeric: tabular-nums;
}

/* ---------- TOC (right rail) ---------- */
.pk-docs-toc {
	position: sticky;
	top: 5rem;
	padding: 1rem 0 1rem 1rem;
	border-left: 1px solid rgb(var(--border-primary));
	max-height: calc(100vh - 6rem);
	max-height: calc(100svh - 6rem);
	overflow-y: auto;
}
.pk-docs-toc-label {
	font-size: 0.72rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 700;
	color: rgb(var(--fg-tertiary));
	margin: 0 0 0.75rem;
}
.pk-docs-toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.pk-docs-toc-list a {
	color: rgb(var(--fg-secondary));
	text-decoration: none;
	font-size: 0.88rem;
	line-height: 1.4;
	display: block;
	padding: 0.2rem 0;
	border-left: 2px solid transparent;
	padding-left: 0.6rem;
	margin-left: -0.6rem;
}
.pk-docs-toc-list a:hover { color: rgb(var(--fg-brand)); border-left-color: rgb(var(--fg-brand)); }

/* ---------- Prev/next ---------- */
.pk-docs-prevnext { border-top: 1px solid rgb(var(--border-primary)); margin-top: 4rem; padding-top: 2rem; }
.pk-docs-prevnext-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pk-docs-prevnext-link {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border-radius: 0.75rem;
	border: 1px solid rgb(var(--border-primary));
	background: rgb(var(--surface-primary));
	text-decoration: none;
	color: rgb(var(--fg-primary));
	transition: border-color 180ms, transform 180ms, background 180ms;
	min-height: 4rem;
}
.pk-docs-prevnext-link:hover { border-color: rgb(var(--fg-brand)); transform: translateY(-2px); background: color-mix(in srgb, rgb(var(--fg-brand)) 3%, rgb(var(--surface-primary))); }
.pk-docs-prevnext-link--next { justify-content: flex-end; text-align: right; }
.pk-docs-prevnext-arrow { font-size: 1.4rem; color: rgb(var(--fg-brand)); }
.pk-docs-prevnext-meta { min-width: 0; flex: 1 1 auto; }
.pk-docs-prevnext-label {
	display: block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: rgb(var(--fg-tertiary));
	font-weight: 600;
}
.pk-docs-prevnext-title { display: block; font-weight: 600; font-size: 0.95rem; margin-top: 0.2rem; overflow-wrap: anywhere; }
.pk-docs-prevnext-spacer { display: block; }

/* ---------- Index page ---------- */
.pk-docs-index { max-width: 80rem; margin: 0 auto; padding: 3rem 2rem 6rem; }
.pk-docs-hero {
	padding: 3rem 0 3.5rem;
	margin-bottom: 2rem;
	position: relative;
	overflow: hidden;
}
.pk-docs-hero-inner { max-width: 50rem; position: relative; z-index: 1; }
.pk-docs-kicker {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	font-weight: 700;
	color: rgb(var(--fg-brand));
	margin: 0 0 1rem;
	font-family: ui-monospace, 'IBM Plex Mono', 'SFMono-Regular', Menlo, monospace;
}
.pk-docs-hero-title {
	font-size: clamp(2.25rem, 4vw, 3.5rem);
	line-height: 1.05;
	font-weight: 800;
	letter-spacing: -0.035em;
	color: rgb(var(--fg-primary));
	margin: 0 0 1.25rem;
}
.pk-docs-hero-lede {
	font-size: 1.15rem;
	line-height: 1.6;
	color: rgb(var(--fg-secondary));
	margin: 0;
}
.pk-docs-hero-lede strong { color: rgb(var(--fg-brand)); font-weight: 700; }
.pk-docs-hero-accent {
	position: absolute;
	inset: auto -12rem -8rem auto;
	width: 28rem; height: 28rem;
	border-radius: 50%;
	background: radial-gradient(circle,
		color-mix(in srgb, rgb(var(--fg-brand)) 14%, transparent),
		transparent 70%);
	pointer-events: none;
	z-index: 0;
}

/* ---------- Search ---------- */
.pk-docs-search {
	margin: -0.5rem 0 1.75rem;
}
.pk-docs-search-shell {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(18rem, 28rem);
	align-items: center;
	gap: 1rem;
	padding: 0.9rem 1rem;
	border: 1px solid color-mix(in srgb, rgb(var(--border-brand)) 30%, rgb(var(--border-primary)));
	border-radius: var(--radius-lg, 0.5rem);
	background:
		linear-gradient(135deg,
			color-mix(in srgb, rgb(var(--surface-brand-soft)) 66%, rgb(var(--surface-primary))),
			rgb(var(--surface-primary)));
	box-shadow: 0 16px 36px -30px color-mix(in srgb, rgb(var(--fg-brand)) 42%, transparent);
}
.pk-docs-search-copy {
	min-width: 0;
	display: flex;
	align-items: baseline;
	gap: 0.7rem;
	flex-wrap: wrap;
}
.pk-docs-search-label {
	font-size: 0.92rem;
	font-weight: 700;
	color: rgb(var(--fg-primary));
}
.pk-docs-search-count {
	font-size: 0.78rem;
	color: rgb(var(--fg-tertiary));
	font-variant-numeric: tabular-nums;
}
.pk-docs-search-bar {
	width: 100%;
	max-width: none;
}
.pk-docs-search-bar [data-searchbar-input] {
	min-width: 0;
}
.pk-docs-search-empty {
	margin: 0.75rem 0 0;
	padding: 0.75rem 0.9rem;
	border: 1px solid rgb(var(--border-warning));
	border-radius: var(--radius-lg, 0.5rem);
	background: color-mix(in srgb, rgb(var(--surface-warning-soft)) 72%, rgb(var(--surface-primary)));
	color: rgb(var(--fg-warning));
	font-size: 0.9rem;
}
.pk-docs-search--sidebar {
	margin: 0 0 1rem;
}
.pk-docs-search--sidebar .pk-docs-search-shell {
	grid-template-columns: minmax(0, 1fr);
	gap: 0.55rem;
	padding: 0.7rem;
	border-radius: var(--radius-md, 0.375rem);
	box-shadow: none;
}
.pk-docs-search--sidebar .pk-docs-search-copy {
	justify-content: space-between;
	gap: 0.5rem;
}
.pk-docs-search--sidebar .pk-docs-search-label {
	font-size: 0.8rem;
}
.pk-docs-search--sidebar .pk-docs-search-count {
	font-size: 0.72rem;
}

.pk-docs-topic-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	padding: 1rem 0 2.5rem;
	border-bottom: 1px solid rgb(var(--border-primary));
	margin-bottom: 3rem;
}

.pk-docs-topic { margin-bottom: 4rem; scroll-margin-top: 5rem; }
.pk-docs-topic--supporting .pk-docs-topic-header {
	border-bottom-color: color-mix(in srgb, rgb(var(--border-brand)) 38%, rgb(var(--border-primary)));
}
.pk-docs-topic-header {
	display: flex;
	align-items: flex-start;
	gap: 1rem;
	margin-bottom: 1.75rem;
	padding-bottom: 0.75rem;
	border-bottom: 1px solid rgb(var(--border-primary));
}
.pk-docs-topic-glyph {
	font-size: 1.75rem;
	line-height: 1;
	padding: 0.5rem;
	border-radius: 0.65rem;
}
.pk-docs-topic--brand    .pk-docs-topic-glyph { color: rgb(var(--fg-brand));   background: color-mix(in srgb, rgb(var(--fg-brand))   12%, transparent); }
.pk-docs-topic--info     .pk-docs-topic-glyph { color: rgb(var(--fg-info));    background: color-mix(in srgb, rgb(var(--fg-info))    12%, transparent); }
.pk-docs-topic--warning  .pk-docs-topic-glyph { color: rgb(var(--fg-warning)); background: color-mix(in srgb, rgb(var(--fg-warning)) 12%, transparent); }
.pk-docs-topic--danger   .pk-docs-topic-glyph { color: rgb(var(--fg-danger));  background: color-mix(in srgb, rgb(var(--fg-danger))  12%, transparent); }
.pk-docs-topic--success  .pk-docs-topic-glyph { color: rgb(var(--fg-success)); background: color-mix(in srgb, rgb(var(--fg-success)) 12%, transparent); }
.pk-docs-topic--muted    .pk-docs-topic-glyph { color: rgb(var(--fg-muted));   background: rgb(var(--surface-secondary)); }
.pk-docs-topic-heading { flex: 1; min-width: 0; }
.pk-docs-topic-title {
	font-size: 1.75rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: rgb(var(--fg-primary));
	margin: 0 0 0.25rem;
}
.pk-docs-topic-tagline { color: rgb(var(--fg-secondary)); font-size: 1rem; margin: 0; line-height: 1.5; }
.pk-docs-topic-count {
	font-family: ui-monospace, 'IBM Plex Mono', 'SFMono-Regular', Menlo, monospace;
	font-size: 0.8rem;
	color: rgb(var(--fg-tertiary));
	white-space: nowrap;
	margin-top: 0.6rem;
}

.pk-docs-support-intro {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 0.55rem;
	padding: 1.1rem 1.2rem;
	margin: 0 0 1.35rem;
	border-radius: 1rem;
	border: 1px solid color-mix(in srgb, rgb(var(--border-brand)) 34%, rgb(var(--border-primary)));
	background:
		linear-gradient(135deg,
			color-mix(in srgb, rgb(var(--surface-brand-soft)) 74%, rgb(var(--surface-primary))),
			color-mix(in srgb, rgb(var(--surface-primary)) 90%, rgb(var(--fg-on-brand)) 10%));
	box-shadow: 0 20px 40px -36px color-mix(in srgb, rgb(var(--fg-brand)) 45%, transparent);
}
.pk-docs-support-kicker {
	margin: 0;
	font-size: 0.74rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgb(var(--fg-brand));
	font-family: ui-monospace, 'IBM Plex Mono', 'SFMono-Regular', Menlo, monospace;
}
.pk-docs-support-copy {
	margin: 0;
	max-width: 48rem;
	font-size: 0.98rem;
	line-height: 1.65;
	color: rgb(var(--fg-secondary));
}

.pk-docs-card-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
	gap: 1rem;
}
.pk-docs-card-link {
	display: block;
	color: inherit;
	text-decoration: none;
	min-width: 0;
}
.pk-docs-card {
	color: rgb(var(--fg-primary));
	position: relative;
	transition: border-color 180ms, transform 180ms, box-shadow 180ms;
}
.pk-docs-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-height: 100%;
}
.pk-docs-card::before {
	content: "";
	position: absolute;
	top: 0; left: 0; right: 0;
	height: 3px;
	background: linear-gradient(90deg, transparent, currentColor 20%, currentColor 80%, transparent);
	opacity: 0;
	transition: opacity 220ms;
}
.pk-docs-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px -12px color-mix(in srgb, rgb(var(--fg-brand)) 25%, transparent); border-color: rgb(var(--fg-brand)); }
.pk-docs-card:hover::before { opacity: 0.6; }
.pk-docs-card--support {
	border-color: color-mix(in srgb, rgb(var(--border-brand)) 26%, rgb(var(--border-primary)));
	background:
		linear-gradient(180deg,
			color-mix(in srgb, rgb(var(--surface-brand-soft)) 72%, rgb(var(--surface-primary))) 0%,
			rgb(var(--surface-primary)) 100%);
}
.pk-docs-card--support::before { opacity: 0.55; }
.pk-docs-card--support:hover {
	box-shadow: 0 18px 36px -18px color-mix(in srgb, rgb(var(--fg-brand)) 36%, transparent);
	background:
		linear-gradient(180deg,
			color-mix(in srgb, rgb(var(--surface-brand-soft)) 82%, rgb(var(--surface-primary))) 0%,
			rgb(var(--surface-primary)) 100%);
}
.pk-docs-topic--brand    .pk-docs-card { color: rgb(var(--fg-brand)); }
.pk-docs-topic--info     .pk-docs-card { color: rgb(var(--fg-info)); }
.pk-docs-topic--warning  .pk-docs-card { color: rgb(var(--fg-warning)); }
.pk-docs-topic--danger   .pk-docs-card { color: rgb(var(--fg-danger)); }
.pk-docs-topic--success  .pk-docs-card { color: rgb(var(--fg-success)); }
.pk-docs-topic--muted    .pk-docs-card { color: rgb(var(--fg-muted)); }
.pk-docs-card-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.pk-docs-card-title {
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.3;
	color: rgb(var(--fg-primary));
	margin: 0.25rem 0 0;
	letter-spacing: -0.01em;
}
.pk-docs-card-excerpt { color: rgb(var(--fg-secondary)); font-size: 0.92rem; line-height: 1.5; margin: 0.25rem 0 0; }
.pk-docs-card--plain:hover { box-shadow: none; }

.pk-docs-module-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
	gap: 0.85rem;
}
.pk-docs-module-card {
	min-width: 0;
	border-color: color-mix(in srgb, rgb(var(--border-info)) 28%, rgb(var(--border-primary)));
}
.pk-docs-module-card-body {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}
.pk-docs-module-card .pk-docs-card-title { margin-top: 0; }
.pk-docs-module-title-link {
	color: rgb(var(--fg-primary));
	text-decoration: none;
	overflow-wrap: anywhere;
}
.pk-docs-module-title-link:hover { color: rgb(var(--fg-info)); }
.pk-docs-module-count {
	margin-left: auto;
	font-size: 0.78rem;
	color: rgb(var(--fg-tertiary));
	white-space: nowrap;
}
.pk-docs-module-topic-list {
	list-style: none;
	padding: 0.45rem 0 0;
	margin: 0.2rem 0 0;
	border-top: 1px solid rgb(var(--border-primary));
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}
.pk-docs-module-topic-list a {
	color: rgb(var(--fg-secondary));
	text-decoration: none;
	font-size: 0.88rem;
	line-height: 1.4;
	overflow-wrap: anywhere;
}
.pk-docs-module-topic-list a:hover { color: rgb(var(--fg-info)); }

.pk-docs-empty-msg { color: rgb(var(--fg-tertiary)); padding: 2rem 0; font-size: 1rem; }

@media (max-width: 800px) {
	.pk-docs-index { padding: 2rem 1.25rem 4rem; }
	.pk-docs-search-shell { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
	.pk-docs-search-copy { justify-content: space-between; }
	.pk-docs-support-intro { padding: 1rem; }
}

@media (max-width: 760px) {
	.pk-docs-topic-header { flex-wrap: wrap; }
	.pk-docs-topic-count {
		width: 100%;
		margin-top: 0;
		padding-left: calc(1.75rem + 1rem);
		white-space: normal;
	}
	.pk-docs-prevnext-row { grid-template-columns: 1fr; }
	.pk-docs-prevnext-spacer { display: none; }
}

/* ---------- ADR semantic signals ---------- */
.pk-article-body .pk-docs-signal {
	list-style: none;
	position: relative;
	margin: 0.85rem 0;
	padding: 0.85rem 1rem;
	border: 1px solid rgb(var(--border-primary));
	border-left-width: 4px;
	border-radius: var(--radius-lg, 0.5rem);
	background: rgb(var(--surface-secondary));
	color: rgb(var(--fg-secondary));
}
.pk-article-body .pk-docs-signal > :first-child { margin-top: 0; }
.pk-article-body .pk-docs-signal > :last-child { margin-bottom: 0; }
.pk-article-body .pk-docs-signal > strong:first-child,
.pk-article-body .pk-docs-signal > p:first-child > strong:first-child {
	color: rgb(var(--fg-primary));
}
.pk-article-body .pk-docs-signal--positive {
	border-color: rgb(var(--border-success));
	background: color-mix(in srgb, rgb(var(--surface-success-soft)) 72%, rgb(var(--surface-primary)));
}
.pk-article-body .pk-docs-signal--positive > strong:first-child,
.pk-article-body .pk-docs-signal--positive > p:first-child > strong:first-child {
	color: rgb(var(--fg-success));
}
.pk-article-body .pk-docs-signal--negative {
	border-color: rgb(var(--border-danger));
	background: color-mix(in srgb, rgb(var(--surface-danger-soft)) 72%, rgb(var(--surface-primary)));
}
.pk-article-body .pk-docs-signal--negative > strong:first-child,
.pk-article-body .pk-docs-signal--negative > p:first-child > strong:first-child {
	color: rgb(var(--fg-danger));
}
.pk-article-body .pk-docs-signal--gap {
	border-color: rgb(var(--border-warning));
	background: color-mix(in srgb, rgb(var(--surface-warning-soft)) 72%, rgb(var(--surface-primary)));
}
.pk-article-body .pk-docs-signal--gap > strong:first-child,
.pk-article-body .pk-docs-signal--gap > p:first-child > strong:first-child {
	color: rgb(var(--fg-warning));
}
.pk-article-body .pk-docs-signal--neutral,
.pk-article-body .pk-docs-signal--guard {
	border-color: rgb(var(--border-secondary));
	background: color-mix(in srgb, rgb(var(--surface-tertiary)) 45%, rgb(var(--surface-primary)));
}
.pk-article-body .pk-docs-signal--neutral > strong:first-child,
.pk-article-body .pk-docs-signal--neutral > p:first-child > strong:first-child,
.pk-article-body .pk-docs-signal--guard > strong:first-child,
.pk-article-body .pk-docs-signal--guard > p:first-child > strong:first-child {
	color: rgb(var(--fg-tertiary));
}

/* ---------- Documentation media ---------- */
.pk-docs-media {
	margin: 2rem 0;
	border: 1px solid rgb(var(--border-primary));
	border-radius: var(--radius-lg, 0.5rem);
	background: rgb(var(--surface-primary));
	overflow: hidden;
	box-shadow: var(--shadow-sm, 0 1px 2px 0 rgb(var(--surface-overlay) / 0.05));
}
.pk-docs-media video {
	display: block;
	width: 100%;
	max-height: min(70vh, 42rem);
	background: rgb(var(--surface-inverse, 15 23 42));
}
.pk-docs-media figcaption {
	padding: 0.75rem 1rem;
	border-top: 1px solid rgb(var(--border-primary));
	color: rgb(var(--fg-secondary));
	font-size: 0.9rem;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

/* ---------- Mermaid diagrams ---------- */
.pk-mermaid {
	margin: 2rem 0;
	padding: clamp(1rem, 2vw, 1.35rem);
	border: 1px solid rgb(var(--border-primary));
	border-radius: var(--radius-xl, 0.75rem);
	background:
		linear-gradient(180deg,
			color-mix(in srgb, rgb(var(--surface-secondary)) 68%, rgb(var(--surface-primary))),
			rgb(var(--surface-primary)));
	box-shadow: var(--shadow-sm, 0 1px 2px 0 rgb(var(--surface-overlay) / 0.05));
	overflow-x: hidden;
	overflow-y: hidden;
}
.pk-mermaid__canvas {
	width: 100%;
	min-width: 0;
	display: flex;
	justify-content: center;
}
.pk-mermaid svg {
	max-width: 100% !important;
	width: 100% !important;
	height: auto;
	display: block;
	font-family: Inter, "Avenir Next", "Segoe UI", system-ui, sans-serif;
	text-rendering: geometricPrecision;
}
.pk-mermaid svg .node rect,
.pk-mermaid svg .node polygon,
.pk-mermaid svg .node circle,
.pk-mermaid svg .node ellipse,
.pk-mermaid svg .node path {
	fill: rgb(var(--surface-brand-soft)) !important;
	stroke: rgb(var(--border-brand)) !important;
	stroke-width: 1.2px !important;
}
.pk-mermaid svg :is(text, .label, .labelText, .nodeLabel, .edgeLabel, .edgeLabel span) {
	fill: rgb(var(--fg-primary)) !important;
	color: rgb(var(--fg-primary)) !important;
	font-size: 0.86rem;
	font-weight: 600;
	line-height: 1.25;
}
.pk-mermaid svg foreignObject {
	overflow: visible;
}
.pk-mermaid svg foreignObject div {
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	line-height: 1.25 !important;
}
.pk-mermaid svg :is(.nodeLabel, .nodeLabel p, .edgeLabel p) {
	margin: 0 !important;
	padding: 0 !important;
	color: rgb(var(--fg-primary)) !important;
	font-size: 0.86rem !important;
	font-weight: 600;
	line-height: 1.25 !important;
	white-space: nowrap;
}
.pk-mermaid svg .flowchart-link,
.pk-mermaid svg path.flowchart-link,
.pk-mermaid svg .edgePath path,
.pk-mermaid svg .edgePath path.path,
.pk-mermaid svg path.relation {
	fill: none !important;
	stroke: rgb(var(--border-secondary)) !important;
	stroke-width: 1.5px !important;
	stroke-linecap: round !important;
	stroke-linejoin: round !important;
}
.pk-mermaid svg marker path,
.pk-mermaid svg .arrowheadPath {
	fill: rgb(var(--border-secondary)) !important;
	stroke: none !important;
}
.pk-mermaid svg .edgeLabel,
.pk-mermaid svg .edgeLabel p,
.pk-mermaid svg .edgeLabel span {
	background: rgb(var(--surface-primary));
	color: rgb(var(--fg-secondary)) !important;
}
.pk-mermaid svg .edgeLabel rect,
.pk-mermaid svg .labelBkg {
	fill: rgb(var(--surface-primary)) !important;
	opacity: 0.96 !important;
}
.pk-mermaid svg .cluster rect {
	fill: rgb(var(--surface-secondary)) !important;
	stroke: rgb(var(--border-primary)) !important;
}
.pk-mermaid__error {
	margin: 0.75rem 0 0;
	color: rgb(var(--fg-warning));
	font-size: 0.92rem;
}
.pk-mermaid--error {
	border-color: color-mix(in srgb, rgb(var(--border-warning)) 50%, rgb(var(--border-primary)));
	background: color-mix(in srgb, rgb(var(--surface-warning-soft)) 55%, rgb(var(--surface-secondary)));
}


/* ---------- Docs-only prose adjustments ---------- */
/*
 * Shared .pk-article-body prose (typography, lists, code, tables,
 * blockquotes, etc.) lives in article-prose.css and is loaded on every
 * content surface. The rule below is docs-specific ONLY — it hides the
 * markdown title H1 because docsArticleHero already renders one above
 * .pk-article-body. Blog posts emit their own <h1> as the first child
 * of the article body, so they must NOT hide it — that is why the rule
 * stays here and NOT in article-prose.css.
 */
.pk-article-body > h1:first-child { display: none; }
