/* ============ PPG Wiki — KBDoc documentation theme ============ */
:root {
	--wk-gold: #d4af37;
	--wk-gold-dark: #b8901f;
	--wk-gold-soft: #fbf3d9;
	--wk-primary: #c9a227;
	--wk-primary-dark: #a8801a;
	--wk-primary-soft: #fbf3d9;
	--wk-navy: #1d2746;
	--wk-body: #6b707f;
	--wk-text: #333333;
	--wk-editor-text: #333333;
	--wk-muted: #6b707f;
	--wk-faint: #878b99;
	--wk-bg: #fffdf4;
	--wk-surface: #ffffff;
	--wk-surface-2: #faf4e3;
	--wk-border: #ece3c8;
	--wk-divider: #f0e8d0;
	--wk-header: #ffffff;
	--wk-footer: #1d2746;
	--wk-radius: 4px;
	--wk-shadow: 0 10px 30px -18px rgba(29, 39, 70, .35);
	--wk-header-h: 52px;
	--wk-crumb-h: 50px;
	--wk-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
:root[data-wk-theme="dark"] {
	--wk-primary: #e6c757;
	--wk-primary-dark: #d4af37;
	--wk-primary-soft: #332b12;
	--wk-navy: #eef2f7;
	--wk-body: #aeb6c7;
	--wk-text: #cdd4de;
	--wk-editor-text: #d6dbe4;
	--wk-muted: #9aa3b6;
	--wk-faint: #7b8497;
	--wk-bg: #0f1626;
	--wk-surface: #141d30;
	--wk-surface-2: #1b2740;
	--wk-border: #26324d;
	--wk-divider: #26324d;
	--wk-header: #141d30;
	--wk-footer: #0b1120;
	--wk-shadow: 0 10px 30px -18px rgba(0, 0, 0, .6);
}

body:has(.wk) { background: var(--wk-bg) !important; }

.wk {
	background: var(--wk-bg);
	color: var(--wk-body);
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	font-size: 16px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	overflow-x: clip;
}
.wk *, .wk *::before, .wk *::after { box-sizing: border-box; }
.wk a { text-decoration: none; color: inherit; }
.wk h1, .wk h2, .wk h3, .wk h4, .wk h5 { color: var(--wk-navy); font-weight: 500; }

/* ---------- Wiki header (transparent, wiki only) ---------- */
/* The site-wide PPG navbar / login FAB are hidden on wiki pages; the wiki
   renders its own copy below so changes here never affect the rest of the site. */
body:has(.wk) .ppg-nav,
body:has(.wk) .ppg-login-fab { display: none !important; }

.wk-header {
	position: sticky; top: 0; z-index: 100;
	background: var(--wk-bg);
	background: color-mix(in srgb, var(--wk-bg) 86%, transparent);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	box-shadow: 0 10px 24px -16px rgba(4, 12, 24, .55);
}
.wk-header__inner { max-width: 1680px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 8px 30px; min-height: var(--wk-header-h); }
.wk-header__brand { display: flex; align-items: center; text-decoration: none; }
.wk-header__brand img { height: 34px; width: auto; }
.wk-header__brand-text { color: var(--wk-navy); font-size: 16px; font-weight: 400; }
.wk-header__brand-text b { color: var(--wk-primary); font-weight: 800; }
.wk-header__nav { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.wk-header__link {
	color: var(--wk-navy); text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 12px;
	border-radius: 999px; transition: .2s; white-space: nowrap; background: none; border: 0;
	cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
}
.wk-header__link:hover { color: var(--wk-primary); background: var(--wk-surface-2); }
.wk-header__caret { font-size: 10px; line-height: 1; transition: transform .2s; display: inline-block; margin-top: 1px; }
/* dropdown menus */
.wk-header__drop { position: relative; }
.wk-header__menu {
	display: none; position: absolute; top: 100%; left: 0; min-width: 220px; overflow: visible;
	background: var(--wk-surface); border: 1px solid var(--wk-border); border-top: 3px solid var(--wk-primary);
	border-radius: 10px; padding: 8px; box-shadow: 0 22px 46px -18px rgba(4, 12, 24, .4); z-index: 60;
}
.wk-header__drop:hover > .wk-header__menu,
.wk-header__drop:focus-within > .wk-header__menu,
.wk-header__drop.open > .wk-header__menu { display: block; }
.wk-header__drop:hover > .wk-header__drop-btn .wk-header__caret,
.wk-header__drop.open > .wk-header__drop-btn .wk-header__caret { transform: rotate(180deg); }
.wk-header__menu--right { left: auto; right: 0; }
/* Nested chapter sub-menus: floating flyout to the right on hover */
.wk-header__subdrop { position: relative; }
.wk-header__subdrop > .wk-header__menu-link { justify-content: space-between; }
.wk-header__subdrop > .wk-header__menu-link .wk-header__caret { margin-left: auto; transition: transform .2s; }
.wk-header__subdrop:hover > .wk-header__menu-link .wk-header__caret,
.wk-header__subdrop:focus-within > .wk-header__menu-link .wk-header__caret { transform: rotate(-90deg); }
.wk-header__submenu {
	display: none; position: absolute; top: -4px; left: 100%; min-width: 210px;
	background: var(--wk-surface); border: 1px solid var(--wk-border); border-top: 3px solid var(--wk-primary);
	border-radius: 10px; padding: 8px; box-shadow: 0 22px 46px -18px rgba(4, 12, 24, .4); z-index: 80;
}
.wk-header__subdrop:hover > .wk-header__submenu,
.wk-header__subdrop:focus-within > .wk-header__submenu { display: block; }
.wk-header__menu-link { display: flex; align-items: center; gap: .5rem; color: var(--wk-navy); text-decoration: none; font-size: 13.5px; font-weight: 600; padding: 9px 12px; border-radius: 8px; white-space: nowrap; }
.wk-header__menu-link:hover, .wk-header__menu-link.is-active { color: var(--wk-primary); background: var(--wk-primary-soft); text-decoration: none; }
.wk-header__menu-icon { width: 18px; text-align: center; }
/* header search */
.wk-header__search {
	display: flex; align-items: center; gap: .45rem; margin-left: auto;
	flex: 0 1 380px; min-width: 0;
	background: transparent; border: 1px solid var(--wk-border);
	border-radius: 999px; padding: .28rem .5rem .28rem .8rem; color: var(--wk-faint);
	transition: background .2s, border-color .2s, color .2s, flex-basis .25s ease;
}
.wk-header__search:focus-within { background: var(--wk-surface); border-color: var(--wk-primary); color: var(--wk-primary); box-shadow: 0 0 0 3px var(--wk-primary-soft); flex-basis: 480px; }
.wk-header__search input { border: 0; outline: 0; background: transparent; color: var(--wk-navy); font-family: inherit; font-size: 13.5px; width: 100%; min-width: 0; }
.wk-header__search input::placeholder { color: var(--wk-faint); }
/* theme toggle */
.wk-header__icon-btn {
	background: transparent; border: 1px solid var(--wk-border); color: var(--wk-body);
	width: 34px; height: 34px; border-radius: 999px; font-size: 1rem; line-height: 1; cursor: pointer;
	display: grid; place-items: center; transition: .2s; flex: 0 0 auto;
}
.wk-header__icon-btn:hover { background: var(--wk-primary-soft); border-color: var(--wk-primary); color: var(--wk-primary); }
/* user / login */
.wk-header__user { margin-left: .2rem; }
.wk-header__avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: block; border: 1px solid var(--wk-border); }
.wk-header__avatar--fallback { display: grid; place-items: center; background: var(--wk-primary); color: #2b2205; font-size: 12px; font-weight: 800; }
.wk-header__username { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-header__login { color: #2b2205; background: var(--wk-primary); text-decoration: none; font-size: 14px; font-weight: 700; padding: 7px 18px; border-radius: 999px; transition: .2s; white-space: nowrap; }
.wk-header__login:hover { background: var(--wk-primary-dark); color: #2b2205; }
.wk-header__toggle { display: none; background: none; border: 0; color: var(--wk-navy); font-size: 22px; cursor: pointer; margin-left: auto; }

@media (max-width: 860px) {
	.wk-header__toggle { display: block; }
	.wk-header__nav {
		display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
		align-items: stretch; gap: 2px; background: var(--wk-surface); padding: 8px 14px;
		border-top: 1px solid var(--wk-border); border-bottom: 1px solid var(--wk-border);
		box-shadow: 0 18px 34px -18px rgba(4, 12, 24, .35); z-index: 50;
	}
	.wk-header__nav.open { display: flex; }
	.wk-header__search { margin-left: 0; width: 100%; flex: none; }
	.wk-header__search input { width: 100%; }
	.wk-header__drop { position: static; }
	.wk-header__menu { position: static; display: none; border: 0; border-radius: 0; padding: 2px 0 6px 14px; box-shadow: none; background: transparent; max-height: none; }
	.wk-header__submenu { position: static; display: block; border: 0; border-radius: 0; padding: 0 0 0 14px; margin: 0; box-shadow: none; background: transparent; min-width: 0; }
	.wk-header__drop:hover > .wk-header__menu { display: none; }
	.wk-header__drop.open > .wk-header__menu { display: block; }
}

/* ---------- Page breadcrumb bar ---------- */
.wk-crumbbar { background: var(--wk-surface-2); border-bottom: 1px solid var(--wk-border); position: sticky; top: var(--wk-header-h); z-index: 95; }
.wk-crumbbar__inner { max-width: 1680px; margin: 0 auto; padding: .9rem 30px; display: flex; align-items: center; gap: 1rem; justify-content: space-between; }
.wk-crumbbar__lead { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.wk-back {
	display: inline-flex; align-items: center; gap: .35rem; flex: 0 0 auto;
	border: 1px solid var(--wk-border); background: var(--wk-surface); color: var(--wk-body);
	font-family: inherit; font-size: .82rem; font-weight: 600; padding: .35rem .7rem .35rem .55rem;
	border-radius: 999px; cursor: pointer; transition: .2s; white-space: nowrap;
}
.wk-back:hover { color: var(--wk-primary); border-color: var(--wk-primary); }
.wk-back svg { width: 14px; height: 14px; }
.wk-crumb { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; font-size: .875rem; color: var(--wk-faint); min-width: 0; }
.wk-crumb a { color: var(--wk-body); }
.wk-crumb a:hover { color: var(--wk-primary); }
.wk-crumb__sep { color: var(--wk-faint); }
.wk-crumb__current { color: var(--wk-navy); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.wk-crumbbar__date { display: inline-flex; align-items: center; gap: .35rem; color: var(--wk-faint); font-size: .85rem; white-space: nowrap; }
.wk-crumbbar__date .wk-ico { font-size: .9rem; }

/* ---------- Animated background (wiki home only) ---------- */
.wk-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
.wk-bg__blob {
	position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
	will-change: transform; transform: translate3d(0, 0, 0);
}
.wk-bg__blob--1 {
	width: 48vw; height: 48vw; top: -14vw; left: -10vw;
	background: radial-gradient(circle at 35% 35%, #f2d464, transparent 70%);
	animation: wkBlob1 24s ease-in-out infinite alternate;
}
.wk-bg__blob--2 {
	width: 42vw; height: 42vw; top: 16vh; right: -14vw;
	background: radial-gradient(circle at 55% 45%, #d4af37, transparent 70%);
	animation: wkBlob2 30s ease-in-out infinite alternate;
}
.wk-bg__blob--3 {
	width: 36vw; height: 36vw; bottom: -16vw; left: 24vw;
	background: radial-gradient(circle at 50% 50%, #f7b733, transparent 70%);
	opacity: .32; animation: wkBlob3 36s ease-in-out infinite alternate;
}
.wk-bg__grid {
	position: absolute; inset: 0;
	background-image:
		linear-gradient(rgba(29, 39, 70, .045) 1px, transparent 1px),
		linear-gradient(90deg, rgba(29, 39, 70, .045) 1px, transparent 1px);
	background-size: 46px 46px;
	-webkit-mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 0%, transparent 78%);
	mask-image: radial-gradient(ellipse 85% 65% at 50% 0%, #000 0%, transparent 78%);
}
:root[data-wk-theme="dark"] .wk-bg__blob { opacity: .42; }
:root[data-wk-theme="dark"] .wk-bg__grid {
	background-image:
		linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
}
@keyframes wkBlob1 {
	from { transform: translate3d(0, 0, 0) scale(1); }
	to { transform: translate3d(7vw, 8vh, 0) scale(1.18); }
}
@keyframes wkBlob2 {
	from { transform: translate3d(0, 0, 0) scale(1.1); }
	to { transform: translate3d(-9vw, 10vh, 0) scale(.92); }
}
@keyframes wkBlob3 {
	from { transform: translate3d(0, 0, 0) scale(.95); }
	to { transform: translate3d(6vw, -8vh, 0) scale(1.2); }
}
@media (prefers-reduced-motion: reduce) {
	.wk-bg__blob { animation: none !important; }
}

/* ---------- Print ---------- */
@media print {
	@page { size: A4; margin: 16mm 14mm; }

	/* Hide all site chrome and interactive controls */
	.wk-bg, .wk-header, .wk-crumbbar, .wk-side, .wk-rail,
	.wk-footer, .wk-feedback, .wk-comments, .wk-article__actions,
	.wk-themefab, .wk-lightbox, .wk-viewbar, .wk-pagehead__actions,
	.wk-comment-form, .wk-back, .wk-rail__tools, .wk-card--add,
	.wk-copy, .wk-pager, .wk-toast, .wk-toast-container { display: none !important; }
	/* Never print Frappe dialogs / confirm messages or their backdrop */
	.modal, .modal-backdrop, .modal-dialog, .msgprint, .freeze, #freeze,
	.frappe-confirm, .alert { display: none !important; }

	html, body, .wk, body:has(.wk) { background: #fff !important; color: #000 !important; }
	.wk-shell {
		display: block !important; grid-template-columns: none !important;
		padding: 0 !important; margin: 0 !important; gap: 0 !important; max-width: none !important;
	}
	.wk-main { padding: 0 !important; margin: 0 !important; max-width: none !important; animation: none !important; opacity: 1 !important; }

	/* Title block: hidden by default, opted in via the Print button */
	.wk-article__head { display: none !important; }
	html.wk-print-title .wk-article__head {
		display: block !important; border: 0 !important; background: none !important;
		box-shadow: none !important; border-radius: 0 !important;
		padding: 0 0 .5rem !important; margin: 0 0 1rem !important;
		border-bottom: 2px solid #000 !important;
	}
	html.wk-print-title .wk-article__head h1 { margin: 0 !important; font-size: 21pt !important; }
	html.wk-print-title .wk-article__meta { display: none !important; }
	.wk-pagehead {
		border: 0 !important; background: none !important; box-shadow: none !important;
		border-radius: 0 !important; padding: 0 0 .5rem !important; margin: 0 0 1rem !important;
	}

	/* Content typography */
	.wk-content {
		max-width: none !important; padding: 0 !important; margin: 0 !important;
		color: #000 !important; font-size: 11.5pt !important; line-height: 1.55 !important;
	}
	.wk-content h1, .wk-content h2, .wk-content h3, .wk-content h4,
	.wk-article__head h1, .wk-pagehead h1 { color: #000 !important; break-after: avoid-page; }
	.wk-content h1 { font-size: 19pt !important; }
	.wk-content h2 { font-size: 15pt !important; }
	.wk-content h3 { font-size: 13pt !important; }
	.wk-content p, .wk-content li { orphans: 3; widows: 3; }
	.wk-content a { color: #000 !important; text-decoration: underline !important; }
	.wk-content a[href^="http"]::after {
		content: " (" attr(href) ")"; font-size: .82em; color: #555 !important;
		text-decoration: none !important; word-break: break-all;
	}
	.wk-content blockquote {
		border-left: 3px solid #999 !important; background: none !important;
		color: #222 !important; padding-left: .9rem !important;
	}

	/* Keep blocks and rows from splitting across pages */
	.wk-content img, .wk-content table, .wk-content tr, .wk-content blockquote,
	.wk-content pre, .wk-content .wk-embed, .wk-content .wk-pdf,
	.wk-toc-line, .wk-card { break-inside: avoid; }
	.wk-content h1, .wk-content h2, .wk-content h3, .wk-content h4 { break-inside: avoid; }

	/* Tables */
	.wk-content table { width: 100% !important; table-layout: fixed !important; border-collapse: collapse !important; }
	.wk-content th, .wk-content td { border: 1px solid #888 !important; padding: 5px 7px !important; }
	.wk-content thead { display: table-header-group; }
	.wk-content tfoot { display: table-footer-group; }
	.wk-content th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
	.wk-content table tr:first-child > td,
	.wk-content table tr:first-child > th { background: #eee !important; font-weight: 600 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

	/* Dot leaders stand out on paper */
	.wk-content .wk-toc-dots { opacity: 1 !important; border-bottom: 1px dotted #555 !important; }

	/* Space / course listing */
	.wk-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
	.wk-card { box-shadow: none !important; border: 1px solid #ccc !important; }
	.wk-about { background: none !important; box-shadow: none !important; border: 1px solid #ccc !important; }
	/* Show full text instead of clamped/ellipsised previews */
	.wk-card__desc, .wk-space-card__desc, .wk-card__title, .wk-space-card__title,
	.wk-ptree__link, .wk-subspaces__title {
		white-space: normal !important; overflow: visible !important; display: block !important;
		-webkit-line-clamp: unset !important;
	}
	.wk-article__meta { color: #333 !important; }

	/* Page-friendly images and embeds */
	.wk-content img { max-width: 100% !important; cursor: default !important; }
	.wk-content video, .wk-content iframe { max-width: 100% !important; }
}

/* ---------- Shell ---------- */
.wk-shell {
	max-width: 1680px; margin: 0 auto; padding: 0 30px;
	display: grid; grid-template-columns: 310px minmax(0, 1fr) 310px; gap: 40px;
	align-items: start;
	flex: 1 0 auto;
	width: 100%;
	position: relative; z-index: 1;
}
.wk-side { padding: 2.6rem 0 3.5rem; align-self: stretch; }
.wk-side__scroll {
	position: sticky; top: calc(var(--wk-header-h) + var(--wk-crumb-h) + 1rem);
	max-height: calc(100vh - var(--wk-header-h) - var(--wk-crumb-h) - 2rem);
	overflow: auto; padding-right: .3rem;
	scrollbar-width: thin; scrollbar-color: #c8ccd3 transparent;
}
.wk-side__scroll::-webkit-scrollbar { width: 6px; height: 6px; }
.wk-side__scroll::-webkit-scrollbar-track { background: transparent; }
.wk-side__scroll::-webkit-scrollbar-thumb { background: #c8ccd3; border-radius: 999px; }
.wk-side__scroll::-webkit-scrollbar-thumb:hover { background: #aeb4bd; }
.wk-side__label { font-size: .67rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wk-navy); margin: 0 0 .65rem; }
.wk-side__label--pages { margin-top: .75rem; }
/* Shadow divider separating the Spaces list from the Pages tree */
.wk-side__divider {
	height: 1px; margin: 1.5rem 0 .1rem;
	background: linear-gradient(90deg, transparent, var(--wk-border) 12%, var(--wk-border) 88%, transparent);
	box-shadow: 0 9px 14px -9px rgba(4, 12, 24, .5);
}

.wk-spaces { list-style: none; margin: 0; padding: 0; }
.wk-space { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: var(--wk-radius); font-size: .92rem; font-weight: 500; color: var(--wk-body); border-left: 3px solid transparent; }
.wk-space:hover { background: var(--wk-surface-2); color: var(--wk-primary); }
.wk-space.is-active { background: var(--wk-surface-2); color: var(--wk-navy); border-left-color: var(--wk-primary); font-weight: 500; }
.wk-space__icon { font-size: 1rem; width: 20px; text-align: center; }
.wk-space__title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-space__count { font-size: .75rem; font-weight: 600; color: var(--wk-faint); }
/* Top-level course name in the sidebar */
.wk-side__scroll > .wk-spaces > .wk-spaces__item > .wk-spaces__row > .wk-space,
.wk-side__scroll > .wk-spaces > .wk-spaces__item > .wk-spaces__group > summary > .wk-space { font-size: .95rem; font-weight: 600; }
/* Nested sub-spaces in the sidebar (shown via a dropdown per main space) */
.wk-spaces .wk-spaces { margin: .05rem 0 .05rem .7rem; padding-left: .35rem; border-left: 1px solid var(--wk-border); }
.wk-spaces__row { list-style: none; cursor: pointer; display: flex; align-items: center; }
.wk-spaces__row::-webkit-details-marker { display: none; }
.wk-spaces__row--leaf { cursor: default; }
.wk-spaces__caret {
	width: 18px; flex: 0 0 18px; display: inline-flex; align-items: center; justify-content: center;
	color: var(--wk-body); font-size: 1rem; font-weight: 700; line-height: 1; transition: transform .15s;
}
.wk-spaces__caret::before { content: "\25B8"; }
.wk-spaces__caret--leaf { visibility: hidden; }
.wk-spaces__group[open] > .wk-spaces__row .wk-spaces__caret { transform: rotate(90deg); }
.wk-spaces__row .wk-space { flex: 1; min-width: 0; }

.wk-tree { list-style: none; margin: 0; padding: 0; }
.wk-tree .wk-tree { margin-left: .85rem; border-left: 1px solid var(--wk-border); padding-left: .4rem; }
.wk-tree__link { display: flex; align-items: center; gap: .5rem; padding: .48rem .7rem; border-radius: var(--wk-radius); font-size: .9rem; color: var(--wk-body); }
.wk-tree__link:hover { background: var(--wk-surface-2); color: var(--wk-primary); }
.wk-tree__item.is-active > .wk-tree__link,
.wk-tree__item.is-active .wk-tree__group > summary .wk-tree__link { color: var(--wk-primary); background: var(--wk-surface-2); font-weight: 500; }
.wk-tree__group > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .1rem; }
.wk-tree__group > summary::-webkit-details-marker { display: none; }
.wk-tree__caret { width: 14px; color: var(--wk-faint); font-size: .68rem; transition: transform .15s; }
.wk-tree__caret::before { content: "\25B8"; }
.wk-tree__group[open] > summary .wk-tree__caret { transform: rotate(90deg); }
.wk-tree__doc { width: 15px; height: 15px; flex: 0 0 15px; border: 1.5px solid var(--wk-faint); border-radius: 3px; opacity: .65; }
.wk-tree__icon { width: 18px; flex: 0 0 18px; text-align: center; font-size: .95rem; line-height: 1; }

/* New page button below the sidebar page tree */
.wk-side__new {
	display: flex; align-items: center; justify-content: center; gap: .4rem;
	width: 100%; margin-top: 1rem; padding: .55rem .8rem;
	border: 1px dashed var(--wk-border); background: transparent; color: var(--wk-primary);
	font-family: inherit; font-size: .9rem; font-weight: 600; border-radius: var(--wk-radius);
	cursor: pointer; transition: .2s;
}
.wk-side__new:hover { background: var(--wk-primary-soft); border-color: var(--wk-primary); border-style: solid; }
.wk-side__new-icon { font-size: 1rem; line-height: 1; }

/* ---------- Main / rail ---------- */
/* Fade the content in on every page visit.
   Opacity-only so it never turns .wk-main into a containing block for the
   fixed animated background while the animation runs. */
.wk-main { padding: 2.6rem 0 4.5rem; min-width: 0; animation: wkFadeIn .42s ease both; }
@keyframes wkFadeIn {
	from { opacity: 0; }
	to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.wk-main { animation: none; }
}
.wk-rail { position: sticky; top: calc(var(--wk-header-h) + var(--wk-crumb-h) + 1rem); align-self: start; margin-top: 2.6rem; max-height: calc(100vh - var(--wk-header-h) - var(--wk-crumb-h) - 2rem); overflow: auto; border-left: 1px solid var(--wk-border); padding-left: 1.4rem; }
.wk-rail__tools { display: flex; gap: .4rem; margin-bottom: 1.1rem; }
.wk-rail__tool { border: 1px solid var(--wk-border); background: var(--wk-surface); color: var(--wk-body); font-family: inherit; font-size: .78rem; font-weight: 500; padding: .35rem .6rem; border-radius: var(--wk-radius); cursor: pointer; }
.wk-rail__tool:hover { color: var(--wk-primary); border-color: var(--wk-primary); }
.wk-rail__label { font-size: .95rem; font-weight: 700; color: var(--wk-navy); margin: 0 0 .7rem; }
.wk-rail__list { list-style: none; margin: 0; padding: 0; }
.wk-rail__item a { display: block; padding: .28rem 0 .28rem .8rem; margin-left: -1px; border-left: 2px solid transparent; font-size: .875rem; color: var(--wk-body); line-height: 1.5; }
.wk-rail__item a:hover { color: var(--wk-primary); }
.wk-rail__item a.is-active { color: var(--wk-primary); font-weight: 500; border-left-color: var(--wk-primary); }
.wk-rail__item--h3 a { padding-left: 1.5rem; font-size: .84rem; }

/* ---------- Hero / home ---------- */
.wk-hero { padding: 1rem 0 1.4rem; }
.wk-hero--banner {
	position: relative; overflow: hidden; isolation: isolate;
	width: 100vw; max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	margin-top: -2.6rem;
	margin-bottom: 2.6rem;
	min-height: 480px;
	display: flex; align-items: center; justify-content: center;
	padding: 4rem 3rem;
	color: #fff;
	background: #0b1120 url("/files/3F-8637(Truck07).jpg") center/cover no-repeat;
}
.wk-hero__slides { position: absolute; inset: 0; z-index: 0; }
.wk-hero__slide {
	position: absolute; inset: 0;
	background-size: cover; background-position: center;
	opacity: 0; transform: scale(1.05);
	animation: wkHeroFade 18s ease-in-out infinite;
}
.wk-hero__slide:nth-child(2) { animation-delay: 9s; }
@keyframes wkHeroFade {
	0% { opacity: 0; transform: scale(1.05); }
	6% { opacity: 1; }
	50% { opacity: 1; transform: scale(1.12); }
	56% { opacity: 0; }
	100% { opacity: 0; transform: scale(1.05); }
}
.wk-hero__overlay {
	position: absolute; inset: 0; z-index: 1;
	background:
		radial-gradient(120% 120% at 88% 15%, rgba(212, 175, 55, .38), transparent 55%),
		linear-gradient(100deg, rgba(11, 17, 32, .95) 0%, rgba(11, 17, 32, .78) 42%, rgba(11, 17, 32, .5) 100%);
}
.wk-hero__content { position: relative; z-index: 2; width: 100%; max-width: 900px; margin: 0 auto; text-align: center; }
.wk-hero h1 { font-size: clamp(2rem, 3.6vw, 2.9rem); font-weight: 600; letter-spacing: -.015em; margin: 0 0 .7rem; color: var(--wk-navy); }
.wk-hero--banner h1 { color: #fff; text-shadow: 0 2px 20px rgba(0, 0, 0, .4); }
.wk-hero p { color: var(--wk-body); font-size: 1.05rem; margin: 0 auto 1.7rem; max-width: 680px; }
.wk-hero--banner p { color: rgba(255, 255, 255, .88); }
.wk-hero__chips { list-style: none; margin: 1.5rem 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; }
.wk-hero__chips li {
	display: inline-flex; align-items: center; gap: .35rem;
	padding: .4rem .85rem; border-radius: 999px;
	background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .22);
	color: rgba(255, 255, 255, .92); font-size: .82rem; font-weight: 500;
	backdrop-filter: blur(4px);
}
.wk-hero__search {
	display: flex; align-items: center; gap: .6rem; max-width: 560px; position: relative; z-index: 1;
	background: var(--wk-surface); border: 1px solid var(--wk-border); border-radius: var(--wk-radius); padding: .45rem .45rem .45rem .9rem; color: var(--wk-faint);
}
.wk-hero__search:focus-within { border-color: var(--wk-primary); box-shadow: 0 0 0 3px var(--wk-primary-soft); }
.wk-hero__search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--wk-navy); font-family: inherit; font-size: .98rem; min-width: 0; }
.wk-hero__search button { border: 0; border-radius: var(--wk-radius); background: #1d2746; color: #fff; font-family: inherit; font-weight: 500; font-size: .92rem; padding: .6rem 1.5rem; cursor: pointer; }
.wk-hero__search button:hover { background: var(--wk-primary-dark); }
.wk-hero__search--inline { margin-top: 1.1rem; }
@media (prefers-reduced-motion: reduce) {
	.wk-hero__slide { animation: none; }
	.wk-hero__slide:first-child { opacity: 1; }
}

/* Home: centered content column with a centered hero */
.wk-home { max-width: 1200px; margin: 0 auto; }
.wk-home .wk-hero { text-align: center; }
.wk-home .wk-hero p { margin-left: auto; margin-right: auto; }
.wk-home .wk-hero__search { margin-left: auto; margin-right: auto; }
.wk-home .wk-hero__chips { justify-content: center; }
.wk-home .wk-hero__content { max-width: 820px; margin: 0 auto; }

/* About Phnom Penh Gas Center (below the hero) */
.wk-about-ppg {
	position: relative;
	width: 100vw; max-width: 100vw;
	margin: 3rem calc(50% - 50vw) 0;
	padding: 0 1.5rem 2.6rem;
	text-align: center;
	background: transparent;
	border: 0; border-radius: 0; box-shadow: none;
}
.wk-about-ppg::after {
	content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
	background: linear-gradient(90deg, transparent, var(--wk-border) 15%, var(--wk-border) 85%, transparent);
	box-shadow: 0 14px 22px -12px rgba(4, 12, 24, .4);
}
.wk-about-ppg__eyebrow {
	display: inline-flex; align-items: center; gap: .4rem;
	padding: .38rem .95rem; margin-bottom: .95rem;
	border-radius: 999px;
	background: var(--wk-primary-soft); color: var(--wk-primary-dark, #8a6d16);
	font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.wk-about-ppg h2 {
	max-width: 920px; margin: 0 auto 1rem;
	font-size: clamp(1.4rem, 2.4vw, 1.9rem); font-weight: 700; color: var(--wk-navy);
	letter-spacing: -.01em;
}
.wk-about-ppg p { max-width: 920px; margin: 0 auto; color: var(--wk-body); font-size: 1.02rem; line-height: 1.95; }
.wk-about-ppg strong { color: var(--wk-navy); font-weight: 700; }

.wk-block { margin-top: 2.8rem; }
.wk-h2 { font-size: 1.4rem; font-weight: 500; letter-spacing: -.01em; margin: 0 0 1.3rem; color: var(--wk-navy); position: relative; padding-bottom: .6rem; border-bottom: 1px solid var(--wk-divider); }
/* Heading + view toggle on the same line */
.wk-section-head {
	display: flex; align-items: center; justify-content: space-between; gap: 1rem;
	margin: 0 0 1.3rem; padding-bottom: .6rem; border-bottom: 1px solid var(--wk-divider);
}
.wk-section-head .wk-h2 { margin: 0; padding-bottom: 0; border-bottom: 0; }
.wk-section-head .wk-viewbar { margin: 0; }
.wk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
/* Home space grid: 4 cards per row on desktop, wrapping down on smaller screens */
.wk-cards--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1280px) { .wk-cards--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .wk-cards--4 { grid-template-columns: 1fr; } }

/* List / card view toggle for space pages */
.wk-viewbar { display: flex; justify-content: flex-end; gap: .35rem; margin: 0 0 1rem; }
.wk-viewbar__btn {
	display: inline-flex; align-items: center; gap: .35rem;
	border: 1px solid var(--wk-border); background: var(--wk-surface); color: var(--wk-body);
	font-family: inherit; font-size: .8rem; font-weight: 600; padding: .35rem .75rem;
	border-radius: var(--wk-radius); cursor: pointer; transition: .2s;
}
.wk-viewbar__btn:hover { color: var(--wk-primary); border-color: var(--wk-primary); }
.wk-viewbar__btn.is-active { background: var(--wk-primary); border-color: var(--wk-primary); color: #2b2205; }
.wk-cards--list { grid-template-columns: 1fr; gap: .55rem; }
.wk-cards--list .wk-card { flex-direction: row; align-items: center; gap: .9rem; padding: .7rem 1rem; border-radius: 10px; }
.wk-cards--list .wk-card::after { display: none; }
.wk-cards--list .wk-card:hover { transform: none; }
.wk-cards--list .wk-card__icon { width: 36px; height: 36px; font-size: 1.05rem; margin: 0; border-radius: 9px; flex: 0 0 auto; }
.wk-cards--list .wk-card__title { padding-right: 0; flex: 0 0 auto; }
.wk-cards--list .wk-card__desc { flex: 1 1 auto; min-width: 0; margin-left: 1rem; text-align: left; color: var(--wk-faint); font-size: .85rem; -webkit-line-clamp: 1; }
.wk-cards--list .wk-card--add { flex-direction: row; align-items: center; justify-content: flex-start; text-align: left; }
.wk-cards--list .wk-card--add .wk-card__desc { flex: 1 1 auto; }
/* List view for the home page course cards: one compact row each, page trees hidden */
.wk-cards--list .wk-space-card { flex-direction: row; align-items: center; gap: .5rem; padding-right: 1rem; box-shadow: 0 1px 2px rgba(29, 39, 70, .04); }
.wk-cards--list .wk-space-card:hover { transform: none; }
.wk-cards--list .wk-space-card::before { opacity: 0; }
.wk-cards--list .wk-space-card__head { flex: 1 1 auto; min-width: 0; padding: .7rem 1rem; }
.wk-cards--list .wk-space-card__icon { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 10px; }
.wk-cards--list .wk-space-card__body { flex: 0 0 auto; padding: 0; border-top: 0; overflow: visible; }
.wk-cards--list .wk-space-card__body > *:not(.wk-space-card__open) { display: none; }
.wk-cards--list .wk-space-card__open { margin: 0; white-space: nowrap; }
.wk-cards--list .wk-card { box-shadow: none; }
.wk-cards--list .wk-card:hover { transform: none; }
/* ============ Cards — modern 2026 ============ */
.wk-card {
	position: relative; display: flex; flex-direction: column; gap: .55rem;
	padding: 1.6rem 1.6rem 1.45rem;
	background: linear-gradient(180deg, color-mix(in srgb, var(--wk-primary) 3%, var(--wk-surface)), var(--wk-surface));
	border: 1px solid color-mix(in srgb, var(--wk-border) 88%, transparent);
	border-radius: 20px;
	overflow: hidden; isolation: isolate;
	box-shadow: 0 1px 2px rgba(29, 39, 70, .04), 0 14px 34px -26px rgba(29, 39, 70, .5);
	transition: transform .4s cubic-bezier(.2, .7, .3, 1), box-shadow .4s, border-color .4s;
}
/* Gold sheen along the top edge on hover */
.wk-card::before {
	content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 100%;
	background: linear-gradient(90deg, var(--wk-primary), var(--wk-primary-dark) 55%, transparent);
	transform: scaleX(0); transform-origin: left; transition: transform .4s cubic-bezier(.2, .7, .3, 1);
	z-index: 1;
}
/* Soft radial glow that blooms in behind the content */
.wk-card::after {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background: radial-gradient(130% 90% at 100% 0%, color-mix(in srgb, var(--wk-primary) 16%, transparent), transparent 58%);
	opacity: 0; transition: opacity .4s;
}
.wk-card:hover {
	transform: translateY(-6px) scale(1.008);
	border-color: color-mix(in srgb, var(--wk-primary) 55%, var(--wk-border));
	box-shadow: 0 2px 4px rgba(29, 39, 70, .05), 0 34px 60px -30px color-mix(in srgb, var(--wk-primary) 60%, transparent);
}
.wk-card:hover::before { transform: scaleX(1); }
.wk-card:hover::after { opacity: 1; }
.wk-card:focus-visible { outline: 3px solid var(--wk-primary-soft); outline-offset: 3px; }
:root[data-wk-theme="dark"] .wk-card { box-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -26px rgba(0, 0, 0, .8); }
:root[data-wk-theme="dark"] .wk-card:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, .4), 0 34px 60px -30px rgba(0, 0, 0, .9); }
.wk-card__icon {
	width: 56px; height: 56px; border-radius: 17px; display: grid; place-items: center;
	background: linear-gradient(145deg, color-mix(in srgb, var(--wk-primary) 88%, #ffffff), var(--wk-primary-dark));
	color: #2b2205; font-size: 1.65rem; margin-bottom: .75rem;
	box-shadow: 0 14px 26px -14px color-mix(in srgb, var(--wk-primary) 90%, transparent), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.wk-card__title { font-size: 1.12rem; font-weight: 700; letter-spacing: -.01em; color: var(--wk-navy); padding-right: .5rem; }
.wk-card__desc { font-size: .9rem; color: var(--wk-body); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wk-card__count {
	display: inline-flex; align-items: center; align-self: flex-start;
	font-size: .74rem; font-weight: 700; letter-spacing: .02em;
	color: var(--wk-primary-dark); background: color-mix(in srgb, var(--wk-primary) 14%, transparent);
	border: 1px solid color-mix(in srgb, var(--wk-primary) 30%, transparent);
	border-radius: 999px; padding: .22rem .7rem; margin-top: .8rem;
}
/* "New course" add tile */
.wk-card--add {
	align-items: center; justify-content: center; text-align: center;
	border-style: dashed;
	border-color: color-mix(in srgb, var(--wk-primary) 45%, var(--wk-border));
	background: color-mix(in srgb, var(--wk-primary) 5%, var(--wk-surface));
	color: var(--wk-navy); font-family: inherit; cursor: pointer; min-height: 100%;
}
.wk-card--add:hover { border-style: solid; }
.wk-card--add .wk-card__icon {
	background: var(--wk-primary-soft); color: var(--wk-primary-dark); box-shadow: none;
	border: 1px solid color-mix(in srgb, var(--wk-primary) 30%, transparent);
}
.wk-card--add .wk-card__title { padding-right: 0; }
.wk-card--add .wk-card__count { display: none; }

/* Space cards with nested, collapsible page trees (home) */
.wk-space-card {
	position: relative; align-self: stretch; display: flex; flex-direction: column; height: auto;
	background: linear-gradient(180deg, color-mix(in srgb, var(--wk-primary) 3%, var(--wk-surface)), var(--wk-surface));
	border: 1px solid color-mix(in srgb, var(--wk-border) 88%, transparent);
	border-radius: 22px; overflow: hidden; isolation: isolate;
	box-shadow: 0 1px 2px rgba(29, 39, 70, .04), 0 14px 34px -26px rgba(29, 39, 70, .5);
	transition: transform .4s cubic-bezier(.2, .7, .3, 1), box-shadow .4s, border-color .4s;
}
.wk-space-card::before {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background: radial-gradient(130% 90% at 100% 0%, color-mix(in srgb, var(--wk-primary) 16%, transparent), transparent 58%);
	opacity: 0; transition: opacity .4s;
}
.wk-space-card:hover {
	transform: translateY(-6px) scale(1.006);
	border-color: color-mix(in srgb, var(--wk-primary) 55%, var(--wk-border));
	box-shadow: 0 2px 4px rgba(29, 39, 70, .05), 0 34px 60px -30px color-mix(in srgb, var(--wk-primary) 60%, transparent);
}
.wk-space-card:hover::before { opacity: 1; }
:root[data-wk-theme="dark"] .wk-space-card { box-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px -26px rgba(0, 0, 0, .8); }
:root[data-wk-theme="dark"] .wk-space-card:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, .4), 0 34px 60px -30px rgba(0, 0, 0, .9); }
.wk-space-card__head {
	display: flex; align-items: center; gap: 1rem; flex: 0 0 auto;
	padding: 1.3rem 1.25rem 1.05rem;
}
.wk-space-card__head:hover { background: transparent; }
.wk-space-card__icon {
	width: 52px; height: 52px; flex: 0 0 auto; border-radius: 16px; display: grid; place-items: center;
	background: linear-gradient(145deg, color-mix(in srgb, var(--wk-primary) 88%, #ffffff), var(--wk-primary-dark));
	color: #2b2205; font-size: 1.5rem;
	box-shadow: 0 14px 26px -14px color-mix(in srgb, var(--wk-primary) 90%, transparent), inset 0 1px 0 rgba(255, 255, 255, .5);
}
.wk-space-card__meta { display: flex; flex-direction: column; gap: .2rem; min-width: 0; flex: 1; }
.wk-space-card__title { font-size: 1.06rem; font-weight: 700; letter-spacing: -.01em; color: var(--wk-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-space-card__desc { font-size: .84rem; color: var(--wk-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-space-card__count {
	flex: 0 0 auto; font-size: .7rem; font-weight: 700; letter-spacing: .02em;
	color: var(--wk-primary-dark); background: color-mix(in srgb, var(--wk-primary) 14%, transparent);
	border: 1px solid color-mix(in srgb, var(--wk-primary) 30%, transparent);
	border-radius: 999px; padding: .24rem .66rem;
}
.wk-space-card__body {
	flex: 1 1 auto; min-height: 0; overflow: visible;
	padding: .4rem 1.1rem 1.15rem; border-top: 1px solid var(--wk-divider);
}
.wk-space-card__empty { color: var(--wk-faint); font-size: .88rem; padding: .8rem .2rem .2rem; margin: 0; }
.wk-space-card__subhead { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--wk-faint); margin: .95rem .2rem .3rem; }
/* Sub-spaces listed inside a home space card */
.wk-subspaces { list-style: none; margin: 0; padding: 0; }
.wk-subspaces .wk-subspaces { margin: .05rem 0 .05rem .9rem; padding-left: .45rem; border-left: 1px solid var(--wk-border); }
.wk-subspaces__link { display: flex; align-items: center; gap: .5rem; min-width: 0; padding: .4rem .5rem; border-radius: 10px; color: var(--wk-navy); font-size: .9rem; font-weight: 500; transition: background .2s, color .2s; }
.wk-subspaces__link:hover { background: color-mix(in srgb, var(--wk-primary) 10%, transparent); color: var(--wk-primary-dark); }
.wk-subspaces__icon { width: 18px; flex: 0 0 18px; text-align: center; }
.wk-subspaces__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A chapter lists only its own pages, indented under it */
.wk-subspaces .wk-ptree { margin: .1rem 0 .35rem .95rem; padding-left: .4rem; border-left: 1px solid var(--wk-border); }
.wk-space-card__open {
	display: inline-flex; align-items: center; gap: .4rem;
	margin: .95rem .1rem .1rem; padding: .5rem .95rem; border-radius: 999px;
	background: color-mix(in srgb, var(--wk-primary) 12%, transparent);
	color: var(--wk-primary-dark); font-size: .82rem; font-weight: 700;
	transition: background .25s, color .25s, transform .25s;
}
.wk-space-card__open:hover { background: var(--wk-primary); color: #2b2205; transform: translateX(2px); }

/* Nested page tree inside a space card */
.wk-ptree { list-style: none; margin: .7rem 0 0; padding: 0; }
.wk-ptree .wk-ptree { margin: .1rem 0 .1rem .95rem; padding-left: .5rem; border-left: 1px solid var(--wk-border); }
.wk-ptree__row {
	display: flex; align-items: center; gap: .45rem; padding: .38rem .5rem;
	border-radius: 8px; color: var(--wk-body); font-size: .9rem;
}
.wk-ptree__row:hover { background: var(--wk-surface-2); color: var(--wk-primary); }
.wk-ptree__icon { width: 16px; flex: 0 0 16px; text-align: center; font-size: .85rem; }
.wk-ptree__link { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wk-recent { list-style: none; margin: 0; padding: 0; }
.wk-recent li { display: flex; align-items: center; gap: .9rem; padding: .85rem .2rem; border-bottom: 1px solid var(--wk-divider); }
.wk-recent a { font-weight: 500; color: var(--wk-navy); font-size: 1rem; }
.wk-recent__icon { margin-right: .4rem; }
.wk-recent a:hover { color: var(--wk-primary); }
/* Keep every recently-updated row on a single line; long titles/excerpts clip. */
.wk-recent__title { flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-recent__meta { flex: 1 1 auto; min-width: 0; font-size: .85rem; color: var(--wk-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-recent .wk-recent__more { flex: 0 0 auto; color: var(--wk-primary); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.wk-recent .wk-recent__more:hover { color: var(--wk-primary-dark); text-decoration: underline; }
.wk-recent__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.wk-recent__main .wk-recent__meta { flex: none; }
.wk-recent__byline { font-size: .76rem; color: var(--wk-faint); }

/* ---------- Headings ---------- */
.wk-crumbs { font-size: .82rem; color: var(--wk-faint); display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: 1rem; }
.wk-crumbs a { color: var(--wk-body); }
.wk-crumbs a:hover { color: var(--wk-primary); }
.wk-pagehead {
	margin-bottom: 1.6rem; position: relative;
	padding: 1.2rem 1.5rem 1.2rem 1.6rem;
	border: 1px solid var(--wk-border); border-left: 4px solid var(--wk-primary);
	border-radius: 14px;
	background: linear-gradient(100deg, var(--wk-primary-soft) 0%, var(--wk-surface) 70%);
	box-shadow: 0 16px 32px -26px rgba(16, 179, 214, .85);
}
.wk-pagehead__icon { font-size: 1.9rem; display: block; margin-bottom: .5rem; }
.wk-pagehead h1 { font-size: clamp(1.4rem, 2.2vw, 1.7rem); font-weight: 500; letter-spacing: -.01em; margin: 0 0 .5rem; color: var(--wk-navy); }
.wk-pagehead__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .4rem; }
.wk-pagehead__actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.wk-pagehead__author { margin: .3rem 0 0; font-size: .85rem; color: var(--wk-faint); }
.wk-muted { color: var(--wk-body); }

/* Space "About this Space" */
.wk-about {
	margin: 0 0 2.2rem; padding: 1.4rem 1.6rem;
	background: var(--wk-surface-2); border: 1px solid var(--wk-border); border-radius: 14px;
}
.wk-about__title { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wk-primary); margin: 0 0 .7rem; }
.wk-about__body { font-size: .96rem; color: var(--wk-body); line-height: 1.75; }
.wk-about__body p { margin: 0 0 .8rem; }
.wk-about__body p:last-child { margin-bottom: 0; }
.wk-about__body ul, .wk-about__body ol { margin: 0 0 .8rem 1.2rem; }
.wk-about__body a { color: var(--wk-primary); font-weight: 500; }
.wk-about__body strong, .wk-about__body b { color: var(--wk-navy); }

.wk-article__head {
	margin-bottom: 1.8rem; position: relative;
	padding: 1.2rem 1.5rem 1.2rem 1.6rem;
	border: 1px solid var(--wk-border); border-left: 4px solid var(--wk-primary);
	border-radius: 14px;
	background: linear-gradient(100deg, var(--wk-primary-soft) 0%, var(--wk-surface) 70%);
	box-shadow: 0 16px 32px -26px rgba(16, 179, 214, .85);
}
.wk-article__head h1 { font-size: clamp(1.45rem, 2.4vw, 1.8rem); font-weight: 500; letter-spacing: -.01em; margin: 0 0 .7rem; color: var(--wk-navy); }
.wk-article__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; font-size: .85rem; color: var(--wk-faint); }
.wk-article__meta a { color: var(--wk-primary); font-weight: 500; }
.wk-article__meta a:hover { color: var(--wk-primary-dark); }
.wk-article__bar { display: flex; flex-direction: column; align-items: stretch; gap: .55rem; }
.wk-copy {
	display: inline-flex; align-items: center; gap: .45rem; flex: 0 0 auto;
	padding: .45rem .8rem; border: 1px solid var(--wk-border); border-radius: var(--wk-radius);
	background: var(--wk-surface); color: var(--wk-body); font-family: inherit; font-size: .82rem; font-weight: 500; cursor: pointer;
}
.wk-copy:hover { color: var(--wk-primary); border-color: var(--wk-primary); }
.wk-copy--danger { color: #d9534f; border-color: rgba(217, 83, 79, .4); }
.wk-copy--danger:hover { color: #fff; background: #d9534f; border-color: #d9534f; }
.wk-printopt {
	display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; user-select: none;
	font-size: .8rem; font-weight: 500; color: var(--wk-body); padding: .3rem .55rem;
	border: 1px solid var(--wk-border); border-radius: var(--wk-radius); background: var(--wk-surface);
}
.wk-printopt input { margin: 0; }
.wk-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--wk-faint); opacity: .6; }

/* ---------- Content ---------- */
.wk-content { font-size: 16px; line-height: 1.5; color: var(--wk-text); max-width: 1040px; padding: .2rem .5rem 1rem; }
.wk-content h1, .wk-content h2, .wk-content h3, .wk-content h4 { color: var(--wk-navy); font-weight: 500; letter-spacing: -.01em; line-height: 1.35; margin: 2.2rem 0 .9rem; scroll-margin-top: 130px; }
.wk-content h1 { font-size: 2rem; }
.wk-content h2 { font-size: 1.5rem; padding-bottom: .55rem; border-bottom: 1px solid var(--wk-divider); }
.wk-content h3 { font-size: 1.25rem; }
.wk-content h4 { font-size: 1.08rem; }
.wk-content p { margin: 0 0 .8rem; }
.wk-content a { color: var(--wk-primary); font-weight: 500; }
.wk-content a:hover { color: var(--wk-primary-dark); text-decoration: underline; }
.wk-content ul, .wk-content ol { padding-left: 1.4rem; margin: 0 0 1.2rem; }
.wk-content li { margin-bottom: .45rem; }
.wk-content img { display: inline-block; max-width: 100%; height: auto; margin: 1.6rem 0; border-radius: var(--wk-radius); border: 1px solid var(--wk-border); }
/* Honour the editor's alignment for images (text-align needs inline-level img) */
.wk-content .ql-align-center img { display: block; margin-left: auto; margin-right: auto; }
.wk-content .ql-align-right img { display: block; margin-left: auto; margin-right: 0; }
/* Consecutive images flow in a grid: N per row, then wrap to a new line */
.wk-content .wk-gallery {
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem; margin: 1.6rem 0;
}
.wk-content .wk-gallery > p,
.wk-content .wk-gallery > img { margin: 0; }
.wk-content .wk-gallery img { width: 100%; height: auto; margin: 0; display: block; }
@media (max-width: 900px) { .wk-content .wk-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .wk-content .wk-gallery { grid-template-columns: 1fr; } }
.wk-content img { cursor: zoom-in; }
/* Inline PDF viewer */
.wk-content .wk-pdf { display: block; margin: 1.6rem 0; }
.wk-content .wk-pdf iframe {
	display: block; width: 100%; height: 80vh; min-height: 480px;
	border: 1px solid var(--wk-border); border-radius: var(--wk-radius); background: #fff;
}
.wk-content .wk-pdf__open { display: inline-block; margin-top: .5rem; font-size: .85rem; font-weight: 600; color: var(--wk-primary); }
/* Image lightbox */
.wk-lightbox {
	position: fixed; inset: 0; z-index: 99999; display: none;
	align-items: center; justify-content: center; padding: 3rem;
	background: rgba(4, 12, 24, .86);
	-webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.wk-lightbox.is-open { display: flex; }
.wk-lightbox__img {
	max-width: 100%; max-height: 100%; border-radius: 8px; cursor: zoom-out;
	box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .75);
}
.wk-lightbox__close {
	position: absolute; top: 1rem; right: 1.2rem; width: 40px; height: 40px;
	border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff;
	font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.wk-lightbox__close:hover { background: rgba(255, 255, 255, .3); }
.wk-content blockquote { margin: 1.5rem 0; padding: 1rem 1.3rem; border-left: 3px solid var(--wk-primary); background: var(--wk-surface-2); border-radius: 0 var(--wk-radius) var(--wk-radius) 0; color: var(--wk-body); }
.wk-content table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem; }
.wk-content th, .wk-content td { border: 1px solid var(--wk-border); padding: .6rem .85rem; text-align: left; }
.wk-content th { background: var(--wk-surface-2); font-weight: 500; color: var(--wk-navy); }
.wk-content code { font-family: var(--wk-mono); background: var(--wk-primary-soft); color: var(--wk-primary-dark); padding: .1rem .4rem; border-radius: 3px; font-size: .86em; }
.wk-content pre { background: #f8fafb; border: 1px solid var(--wk-border); padding: 1.1rem 1.2rem; border-radius: var(--wk-radius); overflow: auto; }
:root[data-wk-theme="dark"] .wk-content pre { background: var(--wk-surface-2); }
.wk-content pre code { background: transparent; color: inherit; padding: 0; }
.wk-content hr { border: 0; border-top: 1px solid var(--wk-divider); margin: 2.2rem 0; }
/* YouTube / video embeds */
.wk-content .wk-embed { position: relative; width: 100%; max-width: 1040px; aspect-ratio: 16 / 9; margin: 1.6rem 0; border-radius: var(--wk-radius); overflow: hidden; border: 1px solid var(--wk-border); background: #000; }
.wk-content .wk-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.wk-content iframe { max-width: 100%; border: 0; border-radius: var(--wk-radius); }
.wk-editor__area .wk-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 1rem 0; pointer-events: none; }
.wk-editor__area .wk-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* Quill lists */
.wk-content ol, .wk-content ul { padding-left: 1.5em; }
.wk-content li { list-style-type: none; padding-left: 1.5em; }
.wk-content li > .ql-ui::before { display: inline-block; margin-left: -1.5em; margin-right: .3em; text-align: right; white-space: nowrap; width: 1.2em; }
.wk-content ol { counter-reset: list-0; }
.wk-content li[data-list="bullet"] > .ql-ui::before { content: '\2022'; }
.wk-content li[data-list="ordered"] { counter-increment: list-0; }
.wk-content li[data-list="ordered"] > .ql-ui::before { content: counter(list-0, decimal) '. '; }
/* Dot leaders for hand-typed table-of-contents lines (see api.style_toc_lines) */
.wk-content .wk-toc-line { display: flex; align-items: baseline; }
.wk-content .wk-toc-title { flex: 0 1 auto; min-width: 0; }
.wk-content .wk-toc-dots {
	flex: 1 1 auto; min-width: 1.5em; margin: 0 .45em; opacity: .5;
	border-bottom: 1px dotted currentColor; transform: translateY(-.35em);
}
.wk-content .wk-toc-page { flex: 0 0 auto; white-space: nowrap; }
.wk-content li.wk-toc-item > .wk-toc-line { width: 100%; }
.wk-content li.wk-toc-item > .wk-toc-line > .ql-ui { flex: 0 0 auto; }
.wk-content li.wk-toc-item > .wk-toc-line > .ql-ui::before {
	display: inline-block; margin-left: -1.5em; margin-right: .3em;
	text-align: right; white-space: nowrap; width: 1.2em;
}
/* Quill rich content */
.wk-content .ql-align-center { text-align: center; }
.wk-content .ql-align-right { text-align: right; }
.wk-content .ql-align-justify { text-align: justify; }
.wk-content .ql-direction-rtl { direction: rtl; text-align: inherit; }
.wk-content .ql-indent-1 { margin-left: 2rem; }
.wk-content .ql-indent-2 { margin-left: 4rem; }
.wk-content .ql-indent-3 { margin-left: 6rem; }
.wk-content .ql-indent-4 { margin-left: 8rem; }
.wk-content .ql-indent-5 { margin-left: 10rem; }
.wk-content .ql-size-small { font-size: .8em; }
.wk-content .ql-size-large { font-size: 1.4em; }
.wk-content .ql-size-huge { font-size: 2em; }
/* Font family + size chosen in the editor */
.wk .ql-font-roboto { font-family: "Roboto", sans-serif; }
.wk .ql-font-system { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wk .ql-font-arial { font-family: Arial, Helvetica, sans-serif; }
.wk .ql-font-helvetica { font-family: Helvetica, Arial, sans-serif; }
.wk .ql-font-verdana { font-family: Verdana, Geneva, sans-serif; }
.wk .ql-font-tahoma { font-family: Tahoma, Verdana, sans-serif; }
.wk .ql-font-trebuchet { font-family: "Trebuchet MS", Helvetica, sans-serif; }
.wk .ql-font-segoe { font-family: "Segoe UI", Tahoma, sans-serif; }
.wk .ql-font-georgia { font-family: Georgia, "Times New Roman", serif; }
.wk .ql-font-times { font-family: "Times New Roman", Times, serif; }
.wk .ql-font-garamond { font-family: Garamond, "Times New Roman", serif; }
.wk .ql-font-palatino { font-family: "Palatino Linotype", "Book Antiqua", Palatino, serif; }
.wk .ql-font-bookman { font-family: "Bookman Old Style", Georgia, serif; }
.wk .ql-font-cambria { font-family: Cambria, Georgia, serif; }
.wk .ql-font-courier { font-family: "Courier New", Courier, monospace; }
.wk .ql-font-consolas { font-family: Consolas, Monaco, "Courier New", monospace; }
.wk .ql-font-monaco { font-family: Monaco, Consolas, "Courier New", monospace; }
.wk .ql-font-lucida { font-family: "Lucida Console", Monaco, monospace; }
.wk .ql-font-comic { font-family: "Comic Sans MS", "Comic Sans", cursive; }
.wk .ql-font-impact { font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif; }
.wk .ql-size-10px { font-size: 10px; }
.wk .ql-size-12px { font-size: 12px; }
.wk .ql-size-14px { font-size: 14px; }
.wk .ql-size-16px { font-size: 16px; }
.wk .ql-size-18px { font-size: 18px; }
.wk .ql-size-24px { font-size: 24px; }
.wk .ql-size-32px { font-size: 32px; }
/* Tables */
.wk-content table, .wk-editor .ql-editor table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: 1.5rem 0; }
.wk-content table td, .wk-content table th, .wk-editor .ql-editor table td { border: 1px solid var(--wk-border); padding: .55rem .75rem; vertical-align: top; }
.wk-editor .ql-editor table td { min-width: 48px; }
.wk-content table th { background: var(--wk-surface-2); font-weight: 500; color: var(--wk-navy); }
/* Highlight the header (first) row in both the reader and the editor. */
.wk-content table tr:first-child > td,
.wk-content table tr:first-child > th,
.wk-editor .ql-editor table tr:first-child > td,
.wk-editor .ql-editor table tr:first-child > th { background: var(--wk-surface-2); font-weight: 500; color: var(--wk-navy); }
.wk-content .ql-video { display: block; width: 100%; aspect-ratio: 16 / 9; margin: 1.5rem 0; border-radius: var(--wk-radius); border: 1px solid var(--wk-border); }
.wk-content pre.ql-syntax { background: #f8fafb; color: var(--wk-navy); border: 1px solid var(--wk-border); border-radius: var(--wk-radius); padding: 1rem 1.2rem; overflow: auto; }
:root[data-wk-theme="dark"] .wk-content pre.ql-syntax { background: var(--wk-surface-2); color: var(--wk-text); }
.wk-content img.ql-image, .wk-content .ql-editor img { max-width: 100%; }
.wk-content .ql-formula { color: var(--wk-primary); }

/* ---------- Search results ---------- */
.wk-results { display: flex; flex-direction: column; gap: .8rem; }
.wk-result {
	position: relative; display: flex; flex-direction: column; gap: .3rem;
	padding: 1.15rem 1.3rem 1.15rem 1.4rem;
	border: 1px solid var(--wk-border); border-radius: 12px; background: var(--wk-surface);
	overflow: hidden; transition: transform .2s, border-color .2s, box-shadow .2s;
}
.wk-result::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--wk-primary); transform: scaleY(0); transform-origin: top; transition: transform .25s; }
.wk-result:hover { transform: translateX(3px); border-color: var(--wk-primary); box-shadow: var(--wk-shadow); }
.wk-result:hover::before { transform: scaleY(1); }
.wk-result__space { font-size: .72rem; font-weight: 600; color: var(--wk-primary); text-transform: uppercase; letter-spacing: .06em; }
.wk-result__title { font-size: 1.05rem; font-weight: 500; color: var(--wk-navy); }
.wk-result__snippet { font-size: .92rem; color: var(--wk-body); line-height: 1.6; }

/* ---------- Feedback ---------- */
/* ---------- Previous / Next page navigation ---------- */
.wk-pager { display: flex; justify-content: space-between; gap: 1rem; margin: 2.2rem 0 0; }
.wk-pager__btn {
	display: flex; align-items: center; gap: .6rem;
	flex: 1 1 0; max-width: 340px;
	padding: .55rem .85rem;
	border: 1px solid var(--wk-border);
	border-radius: 14px;
	background: var(--wk-surface);
	color: var(--wk-body); text-decoration: none;
	box-shadow: 0 8px 22px -18px rgba(29, 39, 70, .6);
	transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.wk-pager__btn:hover {
	transform: translateY(-2px);
	border-color: var(--wk-primary);
	background: linear-gradient(180deg, var(--wk-surface), var(--wk-primary-soft));
	box-shadow: 0 16px 32px -20px rgba(16, 179, 214, .9);
}
.wk-pager__btn--next { margin-left: auto; text-align: right; }
.wk-pager__btn.is-empty { visibility: hidden; border: 0; padding: 0; box-shadow: none; }
.wk-pager__arrow {
	display: grid; place-items: center; flex: 0 0 auto;
	width: 28px; height: 28px; border-radius: 50%;
	background: var(--wk-primary-soft); color: var(--wk-primary);
	font-size: .95rem; line-height: 1;
	transition: transform .18s ease, background .18s ease;
}
.wk-pager__btn--prev:hover .wk-pager__arrow { transform: translateX(-3px); }
.wk-pager__btn--next:hover .wk-pager__arrow { transform: translateX(3px); }
.wk-pager__text { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.wk-pager__label { font-size: .6rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--wk-faint); }
.wk-pager__title { font-size: .84rem; font-weight: 600; color: var(--wk-navy); line-height: 1.3; overflow-wrap: anywhere; }
.wk-pager__btn:hover .wk-pager__title { color: var(--wk-navy); }
.wk-pager__btn--next .wk-pager__text { align-items: flex-end; }
@media (max-width: 560px) {
	.wk-pager { flex-direction: column; }
	.wk-pager__btn { max-width: none; }
	.wk-pager__btn.is-empty { display: none; }
}

.wk-feedback { margin-top: 2.6rem; padding: 1.4rem 0; border-top: 1px solid var(--wk-divider); border-bottom: 1px solid var(--wk-divider); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; max-width: 1040px; }
.wk-feedback__ask { margin: 0; font-size: 1rem; font-weight: 500; color: var(--wk-navy); }
.wk-feedback__actions { display: flex; gap: .6rem; }
.wk-hbtn { border: 1px solid var(--wk-border); background: var(--wk-surface); color: var(--wk-body); font-family: inherit; font-size: .88rem; font-weight: 500; padding: .5rem 1.1rem; border-radius: var(--wk-radius); cursor: pointer; }
.wk-hbtn:hover { border-color: var(--wk-primary); color: var(--wk-primary); }
.wk-hbtn.is-selected { background: var(--wk-primary); border-color: var(--wk-primary); color: #2b2205; }

/* ---------- Comments ---------- */
.wk-comments { margin-top: 3rem; padding-top: 1.8rem; border-top: 1px solid var(--wk-divider); max-width: 1040px; }
.wk-comments h2 { font-size: 1.25rem; font-weight: 500; margin: 0 0 1.3rem; }
.wk-comments__count { font-size: .78rem; font-weight: 600; color: var(--wk-primary); background: var(--wk-primary-soft); border-radius: 3px; padding: .1rem .5rem; }
.wk-comment { display: flex; gap: .85rem; margin-bottom: 1.1rem; }
.wk-comment__avatar { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: grid; place-items: center; background: var(--wk-primary); color: #2b2205; font-weight: 700; font-size: .82rem; }
.wk-comment__body { flex: 1; background: var(--wk-surface-2); border: 1px solid var(--wk-border); border-radius: var(--wk-radius); padding: .8rem 1rem; }
.wk-comment__head { display: flex; align-items: baseline; gap: .6rem; margin-bottom: .3rem; }
.wk-comment__head strong { font-size: .9rem; color: var(--wk-navy); }
.wk-comment__head time { font-size: .75rem; color: var(--wk-faint); }
.wk-comment__text { font-size: .92rem; line-height: 1.65; color: var(--wk-body); }
.wk-comment-form { margin-top: 1.3rem; display: flex; flex-direction: column; gap: .7rem; align-items: flex-start; }
.wk-comment-form textarea { width: 100%; border: 1px solid var(--wk-border); border-radius: var(--wk-radius); padding: .8rem 1rem; background: var(--wk-surface); color: var(--wk-navy); font-family: inherit; font-size: .95rem; resize: vertical; }
.wk-comment-form textarea:focus { outline: none; border-color: var(--wk-primary); box-shadow: 0 0 0 3px var(--wk-primary-soft); }
.wk-comment-signin { color: var(--wk-body); font-size: .92rem; }
.wk-comment-signin a { color: var(--wk-primary); font-weight: 500; }

.wk-btn { border: 0; border-radius: var(--wk-radius); background: var(--wk-primary); color: #2b2205; font-family: inherit; font-weight: 500; font-size: .9rem; padding: .62rem 1.4rem; cursor: pointer; }
.wk-btn:hover { background: var(--wk-primary-dark); }
.wk-btn--ghost { background: transparent; color: var(--wk-navy); border: 1px solid var(--wk-border); }
.wk-btn--ghost:hover { border-color: var(--wk-primary); color: var(--wk-primary); background: transparent; }

/* ---------- History ---------- */
.wk-history { list-style: none; margin: 0; padding: 0; }
.wk-history__item { display: flex; align-items: center; gap: .9rem; padding: .9rem .2rem; border-bottom: 1px solid var(--wk-divider); }
.wk-history__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--wk-primary); flex: 0 0 10px; }
.wk-history__body { flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.wk-history__title { font-weight: 500; color: var(--wk-navy); }
.wk-history__meta { font-size: .82rem; color: var(--wk-faint); }

/* ---------- Empty ---------- */
.wk-empty { text-align: center; padding: 4rem 1rem; color: var(--wk-body); border: 1px dashed var(--wk-border); border-radius: var(--wk-radius); }
.wk-empty strong { display: block; color: var(--wk-navy); font-size: 1.1rem; font-weight: 500; margin-bottom: .35rem; }
.wk-notfound { margin-top: 2.5rem; }
.wk-notfound .wk-btn { display: inline-block; margin-top: 1.2rem; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
	.wk-shell { grid-template-columns: 290px minmax(0, 1fr); gap: 2.4rem; }
	.wk-rail { display: none; }
}
@media (max-width: 860px) {
	.wk-shell { grid-template-columns: 1fr; gap: 0; padding: 0 18px; }
	.wk-side { position: fixed; top: 0; left: 0; bottom: 0; width: 320px; background: var(--wk-surface); z-index: 60; padding: 1.5rem; transform: translateX(-100%); transition: transform .25s; border-right: 1px solid var(--wk-border); }
	.wk--nav-open .wk-side { transform: none; box-shadow: 0 0 60px rgba(29,39,70,.25); }
	.wk-side__scroll { position: static; max-height: none; }
	.wk-main { padding-top: 1.6rem; }
	.wk-crumbbar__inner { padding: .8rem 18px; flex-direction: column; align-items: flex-start; }
	.wk-hero--banner { padding: 2.2rem 1.4rem; }
}

/* ---------- New / Edit modal ---------- */
.wk-newbtn {
	padding: .55rem 1.1rem; border-radius: var(--wk-radius); border: 1px solid var(--wk-primary);
	background: var(--wk-surface); color: var(--wk-primary); font-family: inherit; font-size: .88rem; font-weight: 500; cursor: pointer;
}
.wk-newbtn:hover { background: var(--wk-primary); color: #2b2205; }
.wk-modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding: 3vh 1rem; }
.wk-modal[hidden] { display: none; }
.wk-modal__backdrop { position: fixed; inset: 0; background: rgba(29, 39, 70, .55); }
:root[data-wk-theme="dark"] .wk-modal__backdrop { background: rgba(0, 0, 0, .7); }
.wk-modal__panel {
	position: relative; width: min(760px, 100%); max-height: 94vh; overflow: auto;
	background: var(--wk-surface); border: 1px solid var(--wk-border); border-radius: var(--wk-radius);
	box-shadow: 0 24px 60px -20px rgba(29, 39, 70, .45); padding: 1.5rem 1.6rem;
}
/* Larger editor for page create / edit */
#wkModal[data-mode="page-new"] .wk-modal__panel,
#wkModal[data-mode="page-edit"] .wk-modal__panel { width: min(1180px, 96vw); max-height: 94vh; }
/* Wider modal for space create / edit */
#wkModal[data-mode="space"] .wk-modal__panel,
#wkModal[data-mode="space-edit"] .wk-modal__panel { width: min(920px, 96vw); }
.wk-modal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.wk-modal__head h3 { font-size: 1.2rem; font-weight: 500; margin: 0; }
.wk-modal__x { border: 0; background: transparent; color: var(--wk-body); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.wk-modal__x:hover { color: var(--wk-primary); }
.wk-field { display: block; margin-bottom: .95rem; }
.wk-field > span { display: block; font-size: .8rem; font-weight: 600; color: var(--wk-navy); margin-bottom: .35rem; }
.wk-field input, .wk-field select {
	width: 100%; padding: .6rem .75rem; border: 1px solid var(--wk-border); border-radius: var(--wk-radius);
	background: var(--wk-surface); color: var(--wk-navy); font-family: inherit; font-size: .95rem;
}
.wk-field input:focus, .wk-field select:focus { outline: none; border-color: var(--wk-primary); box-shadow: 0 0 0 3px var(--wk-primary-soft); }
.wk-field--icon { max-width: 90px; }
/* Icon picker */
.wk-iconpick__btn {
	width: 46px; height: 46px; border-radius: 10px; border: 1px solid var(--wk-border);
	background: var(--wk-surface); font-size: 1.4rem; line-height: 1; cursor: pointer;
	display: grid; place-items: center; padding: 0;
}
.wk-iconpick__btn:hover { border-color: var(--wk-primary); }
.wk-iconpop {
	position: fixed; z-index: 300; width: min(360px, calc(100vw - 24px));
	background: var(--wk-surface); border: 1px solid var(--wk-border); border-radius: 12px;
	box-shadow: 0 24px 60px -20px rgba(29, 39, 70, .5); padding: .6rem;
}
.wk-iconpop[hidden] { display: none; }
.wk-iconpop__search {
	width: 100%; padding: .45rem .6rem; margin-bottom: .5rem; border: 1px solid var(--wk-border);
	border-radius: 8px; background: var(--wk-bg); color: var(--wk-navy); font-family: inherit; font-size: .85rem;
}
.wk-iconpop__search:focus { outline: none; border-color: var(--wk-primary); }
.wk-iconpop__grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: .2rem; max-height: 250px; overflow: auto; }
.wk-iconpop__item {
	border: 1px solid transparent; background: transparent; border-radius: 8px; cursor: pointer;
	font-size: 1.25rem; line-height: 1; padding: .35rem 0; text-align: center;
}
.wk-iconpop__item:hover { background: var(--wk-primary-soft); border-color: var(--wk-primary); }
.wk-card--page .wk-card__icon { width: 46px; height: 46px; font-size: 1.35rem; border-radius: 12px; }
.wk-article__icon { margin-right: .5rem; }
#wkSpaceFields { display: block; }
#wkSpaceFields .wk-field { margin-bottom: .9rem; }
/* Compact editor (space description) */
.wk-editor--sm .ql-toolbar.ql-snow { flex-wrap: wrap; white-space: normal; }
.wk-editor--sm .ql-editor { min-height: 220px; max-height: 46vh; }
.wk-check { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; color: var(--wk-body); margin: .3rem 0 .2rem; }
.wk-editor { position: relative; border: 1px solid var(--wk-border); border-radius: var(--wk-radius); margin-bottom: .9rem; }
.wk-editor__toolbar { background: var(--wk-surface-2); }
.wk-editor__area { background: var(--wk-surface); }
/* Quill integration */
.wk-editor .ql-toolbar.ql-snow {
	border: 0; border-bottom: 1px solid var(--wk-border); padding: .45rem .5rem; font-family: inherit;
	display: flex; flex-wrap: nowrap; align-items: center; white-space: nowrap;
}
.wk-editor .ql-toolbar.ql-snow::after { display: none; }
.wk-editor .ql-toolbar.ql-snow .ql-formats { flex: 0 0 auto; margin-right: 6px; margin-bottom: 0; }
.wk-editor .ql-toolbar.ql-snow .ql-formats:last-child { margin-right: 0; }
.wk-editor .ql-toolbar.ql-snow button { width: 26px; height: 24px; padding: 2px 0; }
.wk-editor .ql-toolbar.ql-snow .ql-color-picker,
.wk-editor .ql-toolbar.ql-snow .ql-icon-picker { width: 26px; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-header { width: 84px; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font { width: 118px; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-size { width: 78px; }
/* Picker labels (snow theme only labels its own built-in font/size values) */
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font .ql-picker-item::before { content: "Default"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="roboto"]::before { content: "Roboto"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="system"]::before { content: "System UI"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="arial"]::before { content: "Arial"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="helvetica"]::before { content: "Helvetica"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="verdana"]::before { content: "Verdana"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="tahoma"]::before { content: "Tahoma"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="trebuchet"]::before { content: "Trebuchet MS"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="segoe"]::before { content: "Segoe UI"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="georgia"]::before { content: "Georgia"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="times"]::before { content: "Times New Roman"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="garamond"]::before { content: "Garamond"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="palatino"]::before { content: "Palatino"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="bookman"]::before { content: "Bookman"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="cambria"]::before { content: "Cambria"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="courier"]::before { content: "Courier New"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="consolas"]::before { content: "Consolas"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="monaco"]::before { content: "Monaco"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="lucida"]::before { content: "Lucida Console"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="comic"]::before { content: "Comic Sans MS"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font :is(.ql-picker-label, .ql-picker-item)[data-value="impact"]::before { content: "Impact"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-size :is(.ql-picker-label, .ql-picker-item)[data-value="10px"]::before { content: "10px"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-size :is(.ql-picker-label, .ql-picker-item)[data-value="12px"]::before { content: "12px"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-size :is(.ql-picker-label, .ql-picker-item)[data-value="14px"]::before { content: "14px"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-size :is(.ql-picker-label, .ql-picker-item)[data-value="16px"]::before { content: "16px"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-size :is(.ql-picker-label, .ql-picker-item)[data-value="18px"]::before { content: "18px"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-size :is(.ql-picker-label, .ql-picker-item)[data-value="24px"]::before { content: "24px"; }
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-size :is(.ql-picker-label, .ql-picker-item)[data-value="32px"]::before { content: "32px"; }
.wk-editor .ql-container.ql-snow { border: 0; font-family: inherit; font-size: 1rem; }
.wk-editor .ql-editor { min-height: 320px; max-height: 50vh; overflow: auto; padding: 1rem 1.1rem; font-size: .96rem; line-height: 1.5; color: var(--wk-editor-text); }
#wkModal[data-mode="page-new"] .wk-editor .ql-editor,
#wkModal[data-mode="page-edit"] .wk-editor .ql-editor { min-height: 56vh; max-height: 66vh; }
.wk-editor .ql-editor.ql-blank::before { color: var(--wk-faint); font-style: normal; left: 1.1rem; right: 1.1rem; }
/* In dark mode keep the editor a light "paper" surface with dark gray text */
:root[data-wk-theme="dark"] .wk-editor,
:root[data-wk-theme="dark"] .wk-editor__area,
:root[data-wk-theme="dark"] .wk-editor .ql-container.ql-snow { background: #ffffff; }
:root[data-wk-theme="dark"] .wk-editor .ql-toolbar.ql-snow { background: #f3f5f8; border-color: #e2e6ea; }
:root[data-wk-theme="dark"] .wk-editor .ql-editor { color: #333333; }
:root[data-wk-theme="dark"] .wk-editor .ql-editor.ql-blank::before { color: #9aa3b6; }
:root[data-wk-theme="dark"] .wk-editor .ql-editor h1,
:root[data-wk-theme="dark"] .wk-editor .ql-editor h2,
:root[data-wk-theme="dark"] .wk-editor .ql-editor h3,
:root[data-wk-theme="dark"] .wk-editor .ql-editor h4 { color: #1d2746; }
:root[data-wk-theme="dark"] .wk-editor .ql-snow .ql-stroke { stroke: #444444; }
:root[data-wk-theme="dark"] .wk-editor .ql-snow .ql-fill { fill: #444444; }
:root[data-wk-theme="dark"] .wk-editor .ql-snow .ql-picker { color: #444444; }
:root[data-wk-theme="dark"] .wk-editor .ql-snow .ql-picker-options { background: #ffffff; border-color: #e2e6ea; }
:root[data-wk-theme="dark"] .wk-editor .ql-editor table td { border-color: #dcdfe4; }
/* Resizable images in the editor */
.wk-editor .ql-editor img { max-width: 100%; cursor: pointer; }
.wk-editor .ql-editor img.wk-img-selected { outline: 2px solid var(--wk-primary); outline-offset: 2px; }
.wk-img-handle {
	position: absolute; width: 14px; height: 14px; border-radius: 3px;
	background: var(--wk-primary); border: 2px solid #fff;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .45); cursor: nwse-resize; z-index: 6;
}
.wk-col-handle {
	position: absolute; width: 6px; border-radius: 3px;
	background: var(--wk-primary); box-shadow: 0 0 0 1px rgba(255, 255, 255, .8);
	cursor: col-resize; z-index: 6;
}
.wk-content table td, .wk-editor .ql-editor table td { overflow-wrap: anywhere; }
.wk-editor .ql-editor h1, .wk-editor .ql-editor h2, .wk-editor .ql-editor h3, .wk-editor .ql-editor h4 { color: var(--wk-navy); font-weight: 500; }
.wk-editor .ql-editor h2 { font-size: 1.35rem; margin: .8rem 0 .5rem; }
.wk-editor .ql-editor h3 { font-size: 1.15rem; margin: .8rem 0 .5rem; }
.wk-editor .ql-snow .ql-stroke { stroke: var(--wk-editor-text); }
.wk-editor .ql-snow .ql-fill { fill: var(--wk-editor-text); }
.wk-editor .ql-snow .ql-picker { color: var(--wk-editor-text); }
.wk-editor .ql-snow .ql-picker-options { background: var(--wk-surface); border-color: var(--wk-border); }
.wk-editor .ql-snow .ql-tooltip { border: 1px solid var(--wk-border); box-shadow: var(--wk-shadow); color: var(--wk-body); }
.wk-editor .ql-snow .ql-active .ql-stroke { stroke: var(--wk-primary); }
.wk-editor .ql-snow .ql-active .ql-fill { fill: var(--wk-primary); }
.wk-editor .ql-snow .ql-toolbar button:hover .ql-stroke, .wk-editor .ql-snow .ql-toolbar button.ql-active .ql-stroke { stroke: var(--wk-primary); }
/* Table toolbar buttons */
.wk-editor .ql-toolbar button.ql-attachment { width: 30px; color: var(--wk-editor-text); }
.wk-editor .ql-toolbar button.ql-attachment svg { display: block; width: 19px; height: 19px; margin: 0 auto; }
.wk-editor .ql-toolbar button.ql-attachment:hover,
.wk-editor .ql-toolbar button.ql-attachment.ql-active { color: var(--wk-primary); }
:root[data-wk-theme="dark"] .wk-editor .ql-toolbar button.ql-attachment { color: #444444; }
:root[data-wk-theme="dark"] .wk-editor .ql-toolbar button.ql-attachment:hover { color: var(--wk-primary); }
.wk-editor .ql-toolbar button.ql-table::before { content: none; }
.wk-editor .ql-toolbar button.ql-table svg { display: block; width: 18px; height: 18px; margin: 0 auto; }
.wk-editor .ql-toolbar button.ql-table-row::before { content: "+R"; font-size: 10px; font-weight: 700; }
.wk-editor .ql-toolbar button.ql-table-row-remove::before { content: "-R"; font-size: 11px; font-weight: 700; }
.wk-editor .ql-toolbar button.ql-table-col::before { content: "+C"; font-size: 10px; font-weight: 700; }
.wk-editor .ql-toolbar button.ql-table-col-remove::before { content: "-C"; font-size: 11px; font-weight: 700; }
.wk-editor .ql-toolbar button.ql-table-remove::before { content: "\2715"; font-size: 11px; font-weight: 700; }
.wk-editor .ql-toolbar button.ql-table-row,
.wk-editor .ql-toolbar button.ql-table-row-remove,
.wk-editor .ql-toolbar button.ql-table-col,
.wk-editor .ql-toolbar button.ql-table-col-remove,
.wk-editor .ql-toolbar button.ql-table-remove { width: 28px; min-width: 0; padding: 0; }
.wk-editor .ql-toolbar button.ql-table::before,
.wk-editor .ql-toolbar button.ql-table-row::before,
.wk-editor .ql-toolbar button.ql-table-row-remove::before,
.wk-editor .ql-toolbar button.ql-table-col::before,
.wk-editor .ql-toolbar button.ql-table-col-remove::before,
.wk-editor .ql-toolbar button.ql-table-remove::before { color: var(--wk-editor-text); }
.wk-editor .ql-toolbar button:hover::before { color: var(--wk-primary); }
/* Table row/column controls stay hidden until the cursor is inside a table */
.wk-editor .ql-toolbar button.ql-table-row,
.wk-editor .ql-toolbar button.ql-table-row-remove,
.wk-editor .ql-toolbar button.ql-table-col,
.wk-editor .ql-toolbar button.ql-table-col-remove,
.wk-editor .ql-toolbar button.ql-table-remove { display: none; }
.wk-editor .ql-toolbar.wk-in-table button.ql-table-row,
.wk-editor .ql-toolbar.wk-in-table button.ql-table-row-remove,
.wk-editor .ql-toolbar.wk-in-table button.ql-table-col,
.wk-editor .ql-toolbar.wk-in-table button.ql-table-col-remove,
.wk-editor .ql-toolbar.wk-in-table button.ql-table-remove { display: inline-block; }
.wk-modal__foot { display: flex; align-items: center; justify-content: flex-end; gap: 1rem; margin-top: 1rem; }
/* Keep the Save action reachable while scrolling the editor */
#wkModal .wk-modal__foot {
	position: sticky; bottom: 0; z-index: 3;
	background: var(--wk-surface);
	padding: .8rem 0 .2rem;
	border-top: 1px solid var(--wk-divider);
}
.wk-modal__err { color: #e05361; font-size: .84rem; margin-right: auto; }
.wk-article__actions { display: flex; gap: .5rem; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.wk-field[hidden], #wkSpaceFields[hidden], #wkParentField[hidden] { display: none; }

.wk-lock { display: inline-flex; align-items: center; gap: .3rem; font-size: .74rem; font-weight: 600; color: var(--wk-primary); background: var(--wk-primary-soft); border-radius: 3px; padding: .12rem .55rem; }

.wk-card--add { border-style: dashed; align-items: center; justify-content: center; text-align: center; background: transparent; }
.wk-card--add::before, .wk-card--add::after { display: none; }
.wk-card--add:hover { border-color: var(--wk-primary); background: var(--wk-surface); transform: translateY(-4px); box-shadow: var(--wk-shadow); }
.wk-card--add .wk-card__icon { background: var(--wk-surface-2); color: var(--wk-primary); box-shadow: none; border-radius: 50%; }

/* ---------- User picker ---------- */
.wk-userpick { position: relative; }
.wk-userpick__chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.wk-userpick__chips:not(:empty) { margin-bottom: .45rem; }
.wk-chip { display: inline-flex; align-items: center; gap: .3rem; background: var(--wk-primary-soft); border: 1px solid var(--wk-border); border-radius: 3px; padding: .18rem .3rem .18rem .6rem; font-size: .82rem; color: var(--wk-navy); }
.wk-chip button { border: 0; background: transparent; color: var(--wk-body); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 .3rem; }
.wk-chip button:hover { color: var(--wk-primary); }
.wk-userpick__menu { position: absolute; z-index: 6; left: 0; right: 0; top: 100%; margin-top: .3rem; background: var(--wk-surface); border: 1px solid var(--wk-border); border-radius: var(--wk-radius); box-shadow: 0 14px 34px -14px rgba(29,39,70,.4); max-height: 230px; overflow: auto; padding: .3rem; }
.wk-userpick__menu[hidden] { display: none; }
.wk-userpick__item { display: flex; flex-direction: column; align-items: flex-start; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 3px; padding: .45rem .6rem; cursor: pointer; }
.wk-userpick__item:hover { background: var(--wk-surface-2); }
.wk-userpick__item b { font-size: .88rem; font-weight: 600; color: var(--wk-navy); }
.wk-userpick__item span { font-size: .78rem; color: var(--wk-body); }

/* ---------- Footer ---------- */
.wk-footer { background: var(--wk-footer); color: rgba(255, 255, 255, .72); margin-top: 3rem; position: relative; z-index: 1; }
.wk-footer::before {
	content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
	background: linear-gradient(90deg, transparent, var(--wk-primary), transparent);
	opacity: .55;
}
.wk-footer__inner {
	max-width: 1680px; margin: 0 auto; padding: 3rem 30px 2.2rem;
	display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 2.5rem;
	align-items: start;
}
.wk-footer__brand { margin: 0 0 .6rem; font-size: 1.25rem; font-weight: 600; color: #fff; letter-spacing: -.01em; }
.wk-footer__brand b { color: var(--wk-primary); font-weight: 700; }
.wk-footer__tagline { margin: 0; max-width: 420px; font-size: .9rem; line-height: 1.6; color: rgba(255, 255, 255, .62); }
.wk-footer__nav { display: flex; gap: 3rem; justify-content: flex-end; }
.wk-footer__heading { margin: 0 0 .9rem; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .5); }
.wk-footer__links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.wk-footer__links a {
	color: rgba(255, 255, 255, .78); font-size: .9rem; font-weight: 500; text-decoration: none;
	transition: color .18s ease, transform .18s ease; display: inline-block;
}
.wk-footer__links a:hover { color: var(--wk-primary); transform: translateX(3px); }
.wk-footer__bottom {
	max-width: 1680px; margin: 0 auto; padding: 1.2rem 30px 1.6rem;
	display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
	border-top: 1px solid rgba(255, 255, 255, .1);
}
.wk-footer__copy { margin: 0; font-size: .84rem; color: rgba(255, 255, 255, .6); }
.wk-footer__top {
	color: rgba(255, 255, 255, .78); font-size: .84rem; font-weight: 600; text-decoration: none;
	transition: color .18s ease;
}
.wk-footer__top:hover { color: var(--wk-primary); }
@media (max-width: 860px) {
	.wk-footer__inner { grid-template-columns: 1fr; gap: 1.8rem; padding: 2.2rem 18px 1.6rem; }
	.wk-footer__nav { justify-content: flex-start; gap: 2.5rem; }
	.wk-footer__bottom { padding: 1.1rem 18px 1.5rem; }
}

/* Wiki home / search: no sidebar, content spans the full shell.
   Declared last so it also wins over the responsive .wk-shell grid rules. */
.wk-shell--noside { grid-template-columns: minmax(0, 1fr); }

/* ---------- Share modal ---------- */
.wk-share__copyrow { display: flex; gap: .5rem; align-items: stretch; }
.wk-share__copyrow input { flex: 1 1 auto; min-width: 0; }
.wk-share__copyrow .wk-btn { flex: 0 0 auto; white-space: nowrap; padding: .55rem 1rem; }
.wk-share__copybtn { margin-top: .5rem; padding: .45rem 1rem; }
.wk-share textarea {
	width: 100%; padding: .6rem .75rem; border: 1px solid var(--wk-border); border-radius: var(--wk-radius);
	background: var(--wk-surface); color: var(--wk-navy); font-family: inherit; font-size: .9rem;
	resize: vertical;
}
#wkShareEmbed { font-family: "JetBrains Mono", monospace; font-size: .8rem; color: var(--wk-body); }
.wk-share textarea:focus { outline: none; border-color: var(--wk-primary); box-shadow: 0 0 0 3px var(--wk-primary-soft); }

/* ---------- Embed mode (?embed=1): render the page without site chrome ---------- */
.wk--embed { background: var(--wk-bg); }
.wk--embed .wk-header,
.wk--embed .wk-crumbbar,
.wk--embed .wk-side,
.wk--embed .wk-rail,
.wk--embed .wk-footer,
.wk--embed .wk-article__actions,
.wk--embed .wk-article__meta,
.wk--embed .wk-feedback,
.wk--embed .wk-comments,
.wk--embed .wk-pager,
.wk--embed .wk-modal,
.wk--embed .wk-iconpop { display: none !important; }
.wk--embed .wk-shell {
	display: block !important; grid-template-columns: none !important;
	max-width: none !important; padding: 0 !important; gap: 0 !important;
}
.wk--embed .wk-main { padding: 1rem 1.2rem 1.5rem !important; margin: 0 auto !important; max-width: 1040px; }
.wk--embed .wk-article__head {
	border: 0; border-radius: 0; background: none; box-shadow: none;
	padding: 0 0 .4rem; margin-bottom: 1rem;
}
.wk--embed .wk-content { padding: 0; }

/* ---------- Table insert grid picker ---------- */
.wk-tablegrid {
	position: fixed; z-index: 320; background: var(--wk-surface);
	border: 1px solid var(--wk-border); border-radius: 10px;
	box-shadow: 0 24px 60px -20px rgba(29, 39, 70, .5); padding: .55rem;
}
.wk-tablegrid[hidden] { display: none; }
.wk-tablegrid__grid { display: grid; grid-template-columns: repeat(8, 16px); gap: 2px; }
.wk-tablegrid__cell {
	width: 16px; height: 16px; border: 1px solid var(--wk-border);
	border-radius: 2px; background: var(--wk-surface); cursor: pointer;
}
.wk-tablegrid__cell.is-on { background: var(--wk-primary-soft); border-color: var(--wk-primary); }
.wk-tablegrid__label {
	margin-top: .45rem; text-align: center; font-size: .8rem;
	color: var(--wk-body); white-space: nowrap;
}

/* ---------- quill-better-table: keep menus above the editor modal ---------- */
.qlbt-operation-menu { z-index: 400 !important; }
.qlbt-col-tool { z-index: 300 !important; }
.wk-editor .ql-editor .quill-better-table-wrapper { margin: 1.5rem 0; }
.wk-editor .ql-editor table.quill-better-table { margin: 0; }
.wk-content .quill-better-table-wrapper { margin: 1.5rem 0; }
.wk-content table.quill-better-table { margin: 0; }
.qlbt-operation-menu-item { color: var(--wk-navy); }

/* ---------- Left sidebar expand / collapse ---------- */
.wk-side-toggle {
	display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
	width: 30px; height: 30px; padding: 0; margin-right: .15rem;
	border: 1px solid var(--wk-border); border-radius: 8px;
	background: var(--wk-surface); color: var(--wk-body); cursor: pointer;
}
.wk-side-toggle:hover { color: var(--wk-primary); border-color: var(--wk-primary); }
.wk-side-toggle.is-collapsed { color: var(--wk-primary); border-color: var(--wk-primary); }

.wk-side__backdrop { display: none; }

@media (min-width: 1181px) {
	/* Collapsed: let the middle column expand into the freed sidebar space. */
	.wk--side-collapsed .wk-shell:not(.wk-shell--noside) { grid-template-columns: minmax(0, 1fr) 310px; }
}
@media (min-width: 861px) and (max-width: 1180px) {
	.wk--side-collapsed .wk-shell:not(.wk-shell--noside) { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 861px) {
	.wk--side-collapsed .wk-side { display: none; }
}
@media (max-width: 860px) {
	.wk--nav-open .wk-side__backdrop {
		display: block; position: fixed; inset: 0; z-index: 55;
		background: rgba(29, 39, 70, .45);
	}
	:root[data-wk-theme="dark"] .wk--nav-open .wk-side__backdrop { background: rgba(0, 0, 0, .6); }
}

/* ---------- Fixed centered reading width on content pages ----------
   The home page (.wk-shell--noside) keeps its own .wk-home centering;
   content/space pages center their blocks at a fixed width. */
.wk-shell:not(.wk-shell--noside) .wk-main > *,
.wk-shell:not(.wk-shell--noside) .wk-article > * {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

/* When the sidebar is collapsed, the text expands into the freed width. */
.wk--side-collapsed .wk-shell:not(.wk-shell--noside) .wk-main > *,
.wk--side-collapsed .wk-shell:not(.wk-shell--noside) .wk-article > *,
.wk--side-collapsed .wk-shell:not(.wk-shell--noside) .wk-content,
.wk--side-collapsed .wk-shell:not(.wk-shell--noside) .wk-content .wk-embed,
.wk--side-collapsed .wk-shell:not(.wk-shell--noside) .wk-feedback,
.wk--side-collapsed .wk-shell:not(.wk-shell--noside) .wk-comments { max-width: none; }

/* Pages without a right TOC rail (e.g. course/chapter pages): when the left
   sidebar is collapsed, use the full width but keep the content centred and
   allow it to grow wider. */
@media (min-width: 1181px) {
	.wk--side-collapsed .wk-shell:not(.wk-shell--noside):not(:has(.wk-rail)) {
		grid-template-columns: minmax(0, 1fr);
	}
}
.wk-shell:not(.wk-shell--noside):not(:has(.wk-rail)) .wk-main > *,
.wk-shell:not(.wk-shell--noside):not(:has(.wk-rail)) .wk-article > *,
.wk-shell:not(.wk-shell--noside):not(:has(.wk-rail)) .wk-content,
.wk-shell:not(.wk-shell--noside):not(:has(.wk-rail)) .wk-content .wk-embed,
.wk-shell:not(.wk-shell--noside):not(:has(.wk-rail)) .wk-feedback,
.wk-shell:not(.wk-shell--noside):not(:has(.wk-rail)) .wk-comments {
	max-width: 1400px;
	margin-left: auto;
	margin-right: auto;
}

/* ============================================================
   Modern button system (overrides earlier button styling)
   ============================================================ */
.wk-btn,
.wk-copy,
.wk-back,
.wk-hbtn,
.wk-rail__tool,
.wk-viewbar__btn,
.wk-newbtn,
.wk-side__new,
.wk-header__icon-btn,
.wk-header__login,
.wk-hero__search button,
.wk-iconpick__btn,
.wk-modal__x,
.wk-restore .wk-btn {
	font-family: inherit;
	transition: transform .18s ease, background .18s ease, border-color .18s ease,
		color .18s ease, box-shadow .18s ease;
}
.wk-btn,
.wk-copy,
.wk-back,
.wk-hbtn,
.wk-rail__tool,
.wk-viewbar__btn,
.wk-newbtn,
.wk-btn--ghost {
	border-radius: 12px;
}

/* Primary */
.wk-btn,
.wk-header__login {
	border: 0;
	background: linear-gradient(180deg, #f6dc7e, var(--wk-primary));
	color: #2b2205;
	font-weight: 600;
	box-shadow: 0 10px 24px -16px rgba(184, 144, 31, .95);
}
.wk-btn:hover,
.wk-header__login:hover {
	transform: translateY(-1px);
	background: linear-gradient(180deg, var(--wk-primary), var(--wk-primary-dark));
	color: #2b2205;
	box-shadow: 0 16px 30px -18px rgba(184, 144, 31, 1);
}

/* Secondary / outline */
.wk-btn--ghost,
.wk-copy,
.wk-back,
.wk-hbtn,
.wk-rail__tool,
.wk-viewbar__btn,
.wk-newbtn,
.wk-iconpick__btn {
	border: 1px solid var(--wk-border);
	background: var(--wk-surface);
	color: var(--wk-body);
	box-shadow: 0 6px 16px -14px rgba(29, 39, 70, .6);
}
.wk-btn--ghost:hover,
.wk-copy:hover,
.wk-back:hover,
.wk-hbtn:hover,
.wk-rail__tool:hover,
.wk-viewbar__btn:hover,
.wk-newbtn:hover,
.wk-iconpick__btn:hover {
	transform: translateY(-1px);
	border-color: var(--wk-primary);
	color: var(--wk-primary);
	background: var(--wk-surface);
	box-shadow: 0 14px 26px -18px rgba(16, 179, 214, .85);
}
.wk-viewbar__btn.is-active,
.wk-hbtn.is-selected {
	background: var(--wk-primary);
	border-color: var(--wk-primary);
	color: #2b2205;
	box-shadow: 0 12px 24px -16px rgba(184, 144, 31, .95);
}
.wk-copy--danger {
	color: #d9534f;
	border-color: rgba(217, 83, 79, .45);
	background: var(--wk-surface);
}
.wk-copy--danger:hover {
	transform: translateY(-1px);
	color: #fff;
	background: #d9534f;
	border-color: #d9534f;
	box-shadow: 0 14px 26px -18px rgba(217, 83, 79, .95);
}
.wk-side__new {
	border: 1px solid var(--wk-border);
	background: var(--wk-surface);
	border-radius: 12px;
}
.wk-side__new:hover {
	transform: translateY(-1px);
	border-color: var(--wk-primary);
	background: var(--wk-primary-soft);
	color: var(--wk-primary);
	box-shadow: 0 14px 26px -18px rgba(16, 179, 214, .85);
}
.wk-hero__search button {
	border: 0;
	border-radius: 12px;
	background: #1d2746;
	color: #fff;
	font-weight: 600;
	box-shadow: 0 10px 22px -16px rgba(29, 39, 70, .95);
}
.wk-hero__search button:hover {
	transform: translateY(-1px);
	background: var(--wk-primary-dark);
	color: #fff;
	box-shadow: 0 16px 28px -18px rgba(184, 144, 31, 1);
}
.wk-header__icon-btn {
	box-shadow: 0 6px 16px -14px rgba(29, 39, 70, .6);
}
.wk-header__icon-btn:hover {
	transform: translateY(-1px);
	background: var(--wk-primary-soft);
	border-color: var(--wk-primary);
	color: var(--wk-primary);
	box-shadow: 0 12px 24px -18px rgba(16, 179, 214, .85);
}

/* Icon / round controls */
.wk-modal__x {
	width: 34px; height: 34px; border-radius: 50%;
	display: grid; place-items: center;
}
.wk-modal__x:hover { background: var(--wk-primary-soft); color: var(--wk-primary); transform: rotate(90deg); }
.wk-iconpick__btn { border-radius: 12px; }
.wk-chip button {
	width: 18px; height: 18px; border-radius: 50%;
	display: grid; place-items: center;
	transition: background .15s ease, color .15s ease;
}
.wk-chip button:hover { background: var(--wk-primary); color: #fff; }
.wk-member__remove {
	width: 22px; height: 22px; border-radius: 50%;
	display: grid; place-items: center; border: 0; background: transparent;
	color: var(--wk-body); cursor: pointer; transition: background .15s ease, color .15s ease;
}
.wk-member__remove:hover { background: #d9534f; color: #fff; }

/* Focus ring */
.wk-btn:focus-visible,
.wk-copy:focus-visible,
.wk-back:focus-visible,
.wk-hbtn:focus-visible,
.wk-rail__tool:focus-visible,
.wk-viewbar__btn:focus-visible,
.wk-newbtn:focus-visible,
.wk-side__new:focus-visible,
.wk-header__icon-btn:focus-visible,
.wk-header__login:focus-visible,
.wk-hero__search button:focus-visible,
.wk-iconpick__btn:focus-visible,
.wk-pager__btn:focus-visible {
	outline: 2px solid var(--wk-primary);
	outline-offset: 2px;
}

/* Keep scrolling inside the editor/modal frame (no background scroll) */
html.wk-modal-open,
html.wk-modal-open body { overflow: hidden; }
.wk-modal,
.wk-modal__panel,
.wk-modal__backdrop { overscroll-behavior: contain; }

/* Editor modal: flex column so ONLY the editor scrolls internally.
   The header and footer stay put and scrolling never escapes the editor. */
#wkModal[data-mode="page-new"] .wk-modal__panel,
#wkModal[data-mode="page-edit"] .wk-modal__panel {
	display: flex;
	flex-direction: column;
	overflow: hidden;
}
#wkModal[data-mode="page-new"] #wkModalForm,
#wkModal[data-mode="page-edit"] #wkModalForm {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}
#wkModal[data-mode="page-new"] #wkModalForm > *,
#wkModal[data-mode="page-edit"] #wkModalForm > * { flex: 0 0 auto; }
#wkModal[data-mode="page-new"] #wkModalForm > .wk-editor,
#wkModal[data-mode="page-edit"] #wkModalForm > .wk-editor {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}
#wkModal[data-mode="page-new"] .wk-editor__area,
#wkModal[data-mode="page-edit"] .wk-editor__area {
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}
#wkModal[data-mode="page-new"] .wk-editor .ql-container.ql-snow,
#wkModal[data-mode="page-edit"] .wk-editor .ql-container.ql-snow { height: auto; }
#wkModal[data-mode="page-new"] .wk-editor .ql-editor,
#wkModal[data-mode="page-edit"] .wk-editor .ql-editor {
	flex: 1 1 auto;
	min-height: 0;
	max-height: none;
	overflow: auto;
	overscroll-behavior: contain;
}
#wkModal[data-mode="page-new"] .wk-modal__foot,
#wkModal[data-mode="page-edit"] .wk-modal__foot { position: static; flex: 0 0 auto; }

/* ---------- Editor toolbar: icon/text alignment ---------- */
.wk-editor .ql-toolbar.ql-snow { align-items: center; gap: 2px; }
.wk-editor .ql-toolbar.ql-snow .ql-formats {
	display: inline-flex; align-items: center; gap: 2px;
	margin-right: .4rem;
}
.wk-editor .ql-toolbar.ql-snow .ql-formats::after { display: none; }
.wk-editor .ql-toolbar.ql-snow button {
	float: none; display: inline-flex; align-items: center; justify-content: center;
	width: 28px; height: 28px; padding: 0; border-radius: 8px;
}
.wk-editor .ql-toolbar.ql-snow button svg { float: none; display: block; width: 18px; height: 18px; }
.wk-editor .ql-toolbar.ql-snow button.ql-attachment svg { width: 18px; height: 18px; }
.wk-editor .ql-toolbar.ql-snow button:hover,
.wk-editor .ql-toolbar.ql-snow button.ql-active { background: var(--wk-primary-soft); }
.wk-editor .ql-toolbar.ql-snow .ql-picker {
	float: none; display: inline-flex; align-items: center; height: 28px; border-radius: 8px;
}
.wk-editor .ql-toolbar.ql-snow .ql-picker-label {
	display: inline-flex; align-items: center; height: 100%; border-radius: 8px;
}
.wk-editor .ql-toolbar.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-label {
	padding-left: 8px; padding-right: 20px;
}
.wk-editor .ql-toolbar.ql-snow .ql-picker-label::before { line-height: 1; }
.wk-editor .ql-toolbar.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) svg {
	position: absolute; right: 3px; top: 50%; transform: translateY(-50%); margin: 0; width: 16px;
}
.wk-editor .ql-toolbar.ql-snow .ql-picker-label:hover,
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label { background: var(--wk-primary-soft); }
/* Size header/font/size pickers to their label so the caret sits next to the text */
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-header,
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-font,
.wk-editor .ql-toolbar.ql-snow .ql-picker.ql-size { width: auto; min-width: 66px; max-width: 150px; }
.wk-editor .ql-toolbar.ql-snow .ql-picker-label { overflow: hidden; }
.wk-editor .ql-toolbar.ql-snow .ql-picker:not(.ql-color-picker):not(.ql-icon-picker) .ql-picker-label::before {
	min-width: 0; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
