@layer semantic, ak.tokens, ag.tokens, ak.base, ag.base, ak.theme, ag.theme, app;

@font-face {
	font-family: "Plus Jakarta Sans";
	font-style: normal;
	font-weight: 200 800;
	font-display: swap;
	src: url("/shared/fonts/PlusJakartaSans-VariableFont_wght.woff2") format("woff2");
}

@layer app {
	:root,
	[data-theme="light"] {
		color-scheme: light;
		--bg-page: #F6F2E8;
		--bg-card: #FDFBF7;
		--bg-subtle: #EFE9DC;
		--text-main: #15292E;
		--text-muted: #4A6167;
		--border: #CFC5B4;
		--accent: #B85227;
		--accent-hover: #9C421C;
		--accent-soft: #F9EAE3;
		--accent-on: #FFFFFF;
		--leaf: #2D6638;
		--leaf-hover: #23512C;
		--leaf-soft: #E5F0E8;
		--leaf-on: #FFFFFF;
		--bp-spruce: #183038;
		--bp-spruce-hover: #23434D;
		--bp-spruce-active: #2D6638;
		--bp-spruce-text: #EDF2EC;
		--bp-spruce-muted: #B6C7C4;
		--focus-ring: #2D6638;
		--ok-bg: #E5F3E9;
		--ok-fg: #14532D;
		--warn-bg: #FEF3C7;
		--warn-fg: #78350F;
		--danger-bg: #FEE2E2;
		--danger-fg: #991B1B;
		--danger-solid: #B91C1C;
		--muted-bg: #EFE9DC;
		--muted-fg: #4A6167;
		--border-default: var(--border);
		--border-strong: color-mix(in srgb, var(--text-muted) 45%, var(--border));
		--bg-surface: var(--bg-card);
		--bg-table-stripe: #F8F4EC;
		--text-primary: var(--text-main);
		--radius-sm: 8px;
		--radius-md: 12px;
		--shadow-sm: var(--ak-shadow-1);
		--bp-scroll-thumb: #607274;
		--bp-scroll-track: var(--bg-subtle);
	}

	[data-theme="dark"] {
		color-scheme: dark;
		--bg-page: #0F1D22;
		--bg-card: #16282F;
		--bg-subtle: #1D333B;
		--text-main: #EDF2EC;
		--text-muted: #9FB4BA;
		--border: #2C4852;
		--accent: #E4845B;
		--accent-hover: #EE9B77;
		--accent-soft: #31211B;
		--accent-on: #190C07;
		--leaf: #74B982;
		--leaf-hover: #89C996;
		--leaf-soft: #1B3427;
		--leaf-on: #0A1A10;
		--bp-spruce: #0E1D22;
		--bp-spruce-hover: #1A3139;
		--bp-spruce-active: #254D3E;
		--bp-spruce-text: #EDF2EC;
		--bp-spruce-muted: #A9BEC0;
		--focus-ring: #74B982;
		--ok-bg: #153425;
		--ok-fg: #86EFAC;
		--warn-bg: #3B2811;
		--warn-fg: #FCD34D;
		--danger-bg: #3D1A1E;
		--danger-fg: #FCA5A5;
		--danger-solid: #DC2626;
		--muted-bg: #1D333B;
		--muted-fg: #9FB4BA;
		--border-default: var(--border);
		--border-strong: color-mix(in srgb, var(--text-muted) 45%, var(--border));
		--bg-surface: var(--bg-card);
		--bg-table-stripe: #132329;
		--text-primary: var(--text-main);
		--radius-sm: 8px;
		--radius-md: 12px;
		--shadow-sm: var(--ak-shadow-1);
		--bp-scroll-thumb: #5D8B97;
		--bp-scroll-track: var(--bg-page);
	}

	@media (prefers-color-scheme: dark) {
		:root:not([data-theme]) {
			--bg-page: #0F1D22;
			--bg-card: #16282F;
			--bg-subtle: #1D333B;
			--text-main: #EDF2EC;
			--text-muted: #9FB4BA;
			--border: #2C4852;
			--accent: #E4845B;
			--accent-hover: #EE9B77;
			--accent-soft: #31211B;
			--accent-on: #190C07;
			--leaf: #74B982;
			--leaf-hover: #89C996;
			--leaf-soft: #1B3427;
			--leaf-on: #0A1A10;
			--bp-spruce: #0E1D22;
			--bp-spruce-hover: #1A3139;
			--bp-spruce-active: #254D3E;
			--bp-spruce-text: #EDF2EC;
			--bp-spruce-muted: #A9BEC0;
			--focus-ring: #74B982;
			--ok-bg: #153425;
			--ok-fg: #86EFAC;
			--warn-bg: #3B2811;
			--warn-fg: #FCD34D;
			--danger-bg: #3D1A1E;
			--danger-fg: #FCA5A5;
			--danger-solid: #DC2626;
			--muted-bg: #1D333B;
			--muted-fg: #9FB4BA;
			--border-default: var(--border);
			--border-strong: color-mix(in srgb, var(--text-muted) 45%, var(--border));
			--bg-surface: var(--bg-card);
			--bg-table-stripe: #132329;
			--text-primary: var(--text-main);
			--radius-sm: 8px;
			--radius-md: 12px;
			--shadow-sm: var(--ak-shadow-1);
			--bp-scroll-thumb: #5D8B97;
			--bp-scroll-track: var(--bg-page);
		}
	}

	:root,
	* {
		scrollbar-width: thin;
		scrollbar-color: var(--bp-scroll-thumb) var(--bp-scroll-track);
	}

	@media (prefers-contrast: more) {
		:root,
		[data-theme="light"] {
			--bp-scroll-thumb: #15292E;
			--bp-scroll-track: #FFFFFF;
		}
		[data-theme="dark"] {
			--bp-scroll-thumb: #EDF2EC;
			--bp-scroll-track: #0F1D22;
		}
		@media (prefers-color-scheme: dark) {
			:root:not([data-theme]) {
				--bp-scroll-thumb: #EDF2EC;
				--bp-scroll-track: #0F1D22;
			}
		}
	}

	@supports not (scrollbar-color: auto) {
		:root,
		* {
			scrollbar-width: auto;
		}
		::-webkit-scrollbar {
			width: 8px;
			height: 8px;
		}
		::-webkit-scrollbar-thumb {
			background: var(--bp-scroll-thumb);
			border-radius: 999px;
		}
		::-webkit-scrollbar-track {
			background: var(--bp-scroll-track);
		}
	}

	html,
	body {
		background-color: var(--bg-page);
		color: var(--text-main);
		font-family: var(--ak-font-family-sans, "Plus Jakarta Sans", system-ui, sans-serif);
		font-variant-numeric: tabular-nums;
	}

	/* Dark spruce inset sidebar matching BlendPack mockup boards */
	.ak-shell__nav {
		background: var(--bp-spruce);
		color: var(--bp-spruce-text);
		border-color: color-mix(in srgb, var(--bp-spruce-muted) 18%, transparent);
		--ak-color-text: var(--bp-spruce-text);
		--ak-color-text-strong: #FFFFFF;
		--ak-color-text-muted: var(--bp-spruce-muted);
		--ak-color-surface-sunken: var(--bp-spruce-hover);
		--ak-color-border: color-mix(in srgb, var(--bp-spruce-muted) 20%, transparent);
	}

	.ak-shell--inset .ak-shell__nav {
		border-radius: 14px;
		box-shadow: var(--ak-shadow-2);
	}

	.ak-app-sidenav,
	.ak-shell__nav {
		--bp-scroll-thumb: #6493A0;
		--bp-scroll-track: var(--bp-spruce);
	}

	.ak-app-sidenav {
		padding-inline-end: 0.25rem;
	}

	@media (prefers-contrast: more) {
		.ak-app-sidenav,
		.ak-shell__nav {
			--bp-scroll-thumb: #EDF2EC;
			--bp-scroll-track: #0E1D22;
		}
	}

	@supports not (scrollbar-color: auto) {
		.ak-app-sidenav::-webkit-scrollbar,
		.ak-shell__nav::-webkit-scrollbar {
			width: 6px;
			height: 6px;
		}
	}

	.ak-app-brand {
		padding: 0.75rem 0.75rem 0.6rem;
		border-bottom: 1px solid color-mix(in srgb, var(--bp-spruce-muted) 14%, transparent);
		margin-bottom: 0.35rem;
	}

	.ak-app-brand__link {
		display: flex;
		align-items: center;
		width: 100%;
		text-decoration: none;
		border-radius: 10px;
	}

	.bp-brand-plaque {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		max-width: 100%;
		border-radius: 10px;
	}

	.bp-brand-plaque--sidebar {
		width: 100%;
		background: #F6F2E8;
		padding: 7px 12px;
	}

	.bp-brand-plaque--auth {
		background: transparent;
		padding: 0;
	}

	[data-theme="dark"] .bp-brand-plaque--auth {
		background: #F6F2E8;
		padding: 8px 14px;
	}

	@media (prefers-color-scheme: dark) {
		:root:not([data-theme]) .bp-brand-plaque--auth {
			background: #F6F2E8;
			padding: 8px 14px;
		}
	}

	.bp-brand-logo {
		display: block;
		width: auto;
		height: auto;
		max-width: 100%;
		object-fit: contain;
	}

	.ak-app-brand__logo {
		max-height: 32px;
	}

	.ak-app-auth__logo {
		max-height: 44px;
	}

	.bp-nav-section {
		margin-bottom: 0.55rem;
	}

	.bp-nav-section__title {
		margin: 0.4rem 0.65rem 0.2rem;
		font-size: 0.65rem;
		font-weight: 700;
		letter-spacing: 0.08em;
		text-transform: uppercase;
		color: color-mix(in srgb, var(--bp-spruce-muted) 85%, transparent);
	}

	.bp-nav-section__list {
		list-style: none;
		margin: 0;
		padding: 0;
		display: flex;
		flex-direction: column;
		gap: 1px;
	}

	.ak-shell__nav .ak-sidenav__item {
		color: var(--bp-spruce-text);
		border-radius: 8px;
		font-size: 0.8125rem;
		font-weight: 500;
		height: 30px;
		min-height: 30px;
		padding: 0.25rem 0.7rem;
	}

	.ak-app-sidenav .ak-sidenav__item > .ak-icon {
		display: none;
	}

	.ak-shell__nav .ak-sidenav__item:hover {
		background: var(--bp-spruce-hover);
		color: #FFFFFF;
	}

	.ak-shell__nav .ak-sidenav__item[aria-current="page"]::before,
	.ak-shell__nav .ak-sidenav__item[aria-current="page"]::after,
	.ak-app-sidenav a.ak-sidenav__item[aria-current="page"]::before,
	.ak-app-sidenav a.ak-sidenav__item[aria-current="page"]::after {
		content: none;
		display: none;
	}

	.ak-shell__nav .ak-sidenav__item[aria-current="page"] {
		background: var(--bp-spruce-active);
		color: #FFFFFF;
		font-weight: 600;
		box-shadow: none;
	}

	.ak-shell__nav .ak-app-user {
		border-top: 1px solid color-mix(in srgb, var(--bp-spruce-muted) 16%, transparent);
		padding-top: 0.7rem;
		margin-top: auto;
	}

	.ak-shell__nav .ak-app-user__avatar {
		background: var(--bp-spruce-active);
		color: #FFFFFF;
		border: 0;
		font-weight: 700;
	}

	.bp-user-links {
		display: inline-flex;
		align-items: center;
		gap: 0.35rem;
		flex-wrap: wrap;
		color: var(--bp-spruce-muted);
	}

	.bp-user-link,
	.bp-user-signout {
		background: none;
		border: 0;
		padding: 0;
		margin: 0;
		font: inherit;
		font-size: 0.75rem;
		color: var(--bp-spruce-muted);
		text-decoration: none;
		cursor: pointer;
	}

	.bp-user-link:hover,
	.bp-user-signout:hover {
		color: #FFFFFF;
		text-decoration: underline;
		text-underline-offset: 2px;
	}

	.bp-bar-icon {
		width: 22px;
		height: 22px;
		border-radius: 6px;
		object-fit: cover;
		flex-shrink: 0;
	}

	.ak-app-bar {
		background: var(--bg-page);
		border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
		backdrop-filter: none;
		gap: 0.65rem;
	}

	.ak-app-finder-trigger {
		background: var(--bg-subtle);
		border: 1px solid transparent;
		border-radius: 8px;
		min-height: 34px;
		height: 34px;
		color: var(--text-muted);
	}

	.ak-app-finder-trigger:hover {
		background: color-mix(in srgb, var(--bg-subtle) 85%, var(--border));
		color: var(--text-main);
	}

	.bp-theme-pill {
		width: auto;
		min-width: 0;
		height: 34px;
		min-height: 34px;
		padding: 0 0.75rem;
		gap: 0.4rem;
		border-radius: 8px;
		background: var(--bg-subtle);
		color: var(--text-main);
		border: 1px solid var(--border);
		font-size: 0.8125rem;
		font-weight: 600;
	}

	.bp-theme-pill:hover {
		background: var(--bg-card);
	}

	.bp-auth-top .bp-theme-pill {
		border-radius: 999px;
		background: #183038;
		color: #F6F2E8;
		border: 1px solid rgba(237, 242, 236, 0.16);
		box-shadow: var(--ak-shadow-2);
	}

	.bp-auth-top .bp-theme-pill:hover {
		background: #23434D;
	}

	.bp-theme-pill__label {
		line-height: 1;
	}

	.bp-menu-label {
		font-size: 0.8125rem;
		font-weight: 600;
	}

	@media (min-width: 1024px) {
		.bp-menu-label {
			display: none;
		}
	}

	[hidden] {
		display: none !important;
	}

	:where(.bp-page, .card) a:not(.btn):not(.ak-button):not(.ak-viewnav__item):not([aria-current="page"]):not(nav[aria-label$="actions"] > a) {
		color: var(--ak-color-link, var(--leaf));
		text-underline-offset: 2px;
	}

	:where(.bp-page, .card) a:not(.btn):not(.ak-button):not(.ak-viewnav__item):not([aria-current="page"]):not(nav[aria-label$="actions"] > a):hover {
		color: var(--ak-color-link-hover, var(--accent));
	}

	.ak-app-main {
		padding: 1.25rem 1.5rem 2.5rem;
	}

	/* Soft filled borderless inputs & tactile CTA buttons */
	:where(.ak-input,
	.ak-select,
	.ak-textarea,
	.bp-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
	.bp-page select,
	.bp-page textarea,
	.bp-auth-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"])) {
		box-sizing: border-box;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		--ak-control-bg: var(--bg-subtle);
		--ak-control-border: transparent;
		background-color: var(--bg-subtle);
		color: var(--text-main);
		border: 1px solid transparent;
		border-radius: 8px;
		padding: 0.5rem 0.75rem;
		font-family: inherit;
		font-size: 0.875rem;
		min-height: 38px;
		outline: none;
		box-shadow: none;
		transition: border-color 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
	}

	.bp-page select {
		text-overflow: ellipsis;
		overflow: hidden;
	}

	:where([data-theme="dark"] .ak-input,
	[data-theme="dark"] .ak-select,
	[data-theme="dark"] .ak-textarea,
	[data-theme="dark"] .bp-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
	[data-theme="dark"] .bp-page select,
	[data-theme="dark"] .bp-page textarea,
	[data-theme="dark"] .bp-auth-page input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"])) {
		background-color: #1D333B;
		color: #EDF2EC;
		border-color: transparent;
	}

	.ak-input-wrap .ak-input.ak-input--icon-start {
		padding-inline-start: 2.65rem;
	}

	.ak-input-wrap .ak-input.ak-input--icon-end {
		padding-inline-end: 2.65rem;
	}

	.bp-page input::placeholder,
	.bp-auth-page input::placeholder,
	.ak-input::placeholder,
	.ak-textarea::placeholder {
		color: var(--text-muted);
		opacity: 1;
	}

	.bp-page input:focus-visible,
	.bp-page select:focus-visible,
	.bp-page textarea:focus-visible,
	.bp-auth-page input:focus-visible,
	.ak-input:focus-visible,
	.ak-input:focus,
	.ak-select:focus-visible,
	.ak-textarea:focus-visible {
		outline: none;
		border-color: transparent;
		box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus-ring) 38%, transparent);
		background-color: var(--bg-subtle);
	}

	.ak-input[aria-invalid="true"],
	.bp-page input[aria-invalid="true"],
	.bp-page select[aria-invalid="true"],
	.bp-page textarea[aria-invalid="true"],
	.bp-auth-page input[aria-invalid="true"] {
		border-color: var(--danger-solid);
	}

	.btn,
	.btn-primary,
	.btn-secondary,
	.btn-danger,
	.btn-leaf {
		box-sizing: border-box;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 0.4rem;
		min-height: 36px;
		padding: 0.45rem 0.95rem;
		border-radius: 8px;
		font-family: inherit;
		font-size: 0.875rem;
		font-weight: 600;
		text-decoration: none;
		cursor: pointer;
		border: 1px solid var(--border);
		background-color: var(--bg-card);
		color: var(--text-main);
	}

	.ak-button--primary,
	.btn-primary,
	.btn.btn-primary {
		background-color: var(--accent);
		color: var(--accent-on);
		border-color: var(--accent);
		font-weight: 600;
	}

	.ak-button--primary:hover:not(:disabled),
	.btn-primary:hover:not(:disabled),
	.btn.btn-primary:hover:not(:disabled) {
		background-color: var(--accent-hover);
		border-color: var(--accent-hover);
	}

	.btn-leaf,
	.btn.btn-leaf {
		background-color: var(--leaf);
		color: var(--leaf-on);
		border-color: var(--leaf);
		font-weight: 600;
	}

	.btn-leaf:hover:not(:disabled),
	.btn.btn-leaf:hover:not(:disabled) {
		background-color: var(--leaf-hover);
		border-color: var(--leaf-hover);
		color: var(--leaf-on);
	}

	.btn-secondary {
		background-color: var(--bg-card);
		color: var(--text-main);
		border-color: var(--border);
	}

	.btn-secondary:hover:not(:disabled) {
		background-color: var(--bg-subtle);
	}

	.btn-danger {
		background-color: var(--danger-bg);
		color: var(--danger-fg);
		border-color: color-mix(in srgb, var(--danger-fg) 35%, transparent);
	}

	.btn-danger:hover:not(:disabled) {
		background-color: var(--danger-solid);
		color: #FFFFFF;
	}

	/* Login split card with flush 0px artwork pane on left */
	.bp-auth-page {
		position: relative;
		min-height: 100dvh;
		display: grid;
		place-items: center;
		padding: 1.5rem;
		overflow-x: hidden;
	}

	.bp-auth-backdrop {
		position: fixed;
		inset: -24px;
		background-image:
			linear-gradient(135deg, color-mix(in srgb, #183038 54%, transparent), color-mix(in srgb, #F6F2E8 48%, transparent)),
			url("/shared/blendpack-background.jpg");
		background-size: cover;
		background-position: center;
		filter: blur(18px) saturate(0.92);
		transform: scale(1.06);
		z-index: 0;
		pointer-events: none;
	}

	[data-theme="dark"] .bp-auth-backdrop {
		background-image:
			linear-gradient(135deg, rgba(10, 22, 26, 0.78), rgba(16, 33, 38, 0.68)),
			url("/shared/blendpack-background.jpg");
	}

	@media (prefers-color-scheme: dark) {
		:root:not([data-theme]) .bp-auth-backdrop {
			background-image:
				linear-gradient(135deg, rgba(10, 22, 26, 0.78), rgba(16, 33, 38, 0.68)),
				url("/shared/blendpack-background.jpg");
		}
	}

	.bp-auth-top {
		position: fixed;
		top: 1.25rem;
		right: 1.5rem;
		z-index: 20;
	}

	.bp-auth-split {
		position: relative;
		z-index: 1;
		width: min(920px, 100%);
		min-height: 500px;
		background: var(--bg-card);
		border: 0;
		border-radius: 18px;
		box-shadow: 0 24px 60px rgba(15, 29, 34, 0.28);
		display: grid;
		grid-template-columns: minmax(0, 1.04fr) minmax(0, 1fr);
		overflow: hidden;
	}

	.bp-auth-pane {
		padding: 2.5rem 2.75rem;
		display: flex;
		flex-direction: column;
		justify-content: center;
		gap: 1rem;
		background: var(--bg-card);
	}

	.bp-auth-logo-wrap {
		display: flex;
		justify-content: center;
		margin-bottom: 0.35rem;
	}

	.bp-auth-art {
		padding: 0;
		margin: 0;
		position: relative;
		min-height: 500px;
		background: #183038;
	}

	.bp-auth-art__img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
		object-position: center;
	}

	.bp-auth-divider {
		display: flex;
		align-items: center;
		gap: 0.75rem;
		margin: 0.25rem 0;
		font-size: 0.72rem;
		font-weight: 700;
		letter-spacing: 0.06em;
		text-transform: uppercase;
		color: var(--text-muted);
	}

	.bp-auth-divider::before,
	.bp-auth-divider::after {
		content: "";
		flex: 1;
		height: 1px;
		background: var(--border);
	}

	.bp-password-toggle {
		pointer-events: auto;
		background: transparent;
		border: 0;
		padding: 0.3rem;
		border-radius: 6px;
		color: var(--text-muted);
		cursor: pointer;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.bp-password-toggle:hover {
		color: var(--text-main);
	}

	.bp-oidc-btn {
		width: 100%;
		min-height: 44px;
		justify-content: center;
		border-radius: 8px;
		font-size: 0.9rem;
	}

	.bp-signin-btn {
		width: 100%;
		min-height: 44px;
		justify-content: center;
		border-radius: 8px;
		font-size: 0.9rem;
	}

	/* 5 mandatory UI states */
	.bp-state-loading {
		padding: 1.25rem;
		background: var(--bg-card);
		border: 1px solid var(--border);
		border-radius: 12px;
	}

	.bp-empty-card {
		background: var(--bg-card);
		border: 1px dashed var(--border);
		border-radius: 12px;
		padding: 2rem 1.5rem;
	}

	.bp-alert-banner,
	.bp-success-banner {
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		gap: 0.75rem;
		flex-wrap: wrap;
		margin-bottom: 1rem;
	}

	.bp-retry-key {
		margin: 0.25rem 0 0;
		font-size: 0.8125rem;
		color: var(--text-muted);
	}

	/* KPI & Dashboard layouts */
	.ak-app-main > :where(div, section, article),
	.bp-page {
		display: flex;
		flex-direction: column;
		gap: 1.25rem;
		width: 100%;
		max-width: var(--ak-content-max-width, 1280px);
		margin-inline: auto;
		min-width: 0;
	}

	.bp-page > * {
		min-width: 0;
	}

	.bp-page-head {
		display: flex;
		align-items: flex-end;
		justify-content: space-between;
		gap: 1rem;
		flex-wrap: wrap;
	}

	.bp-page-head > div:first-child {
		flex: 1 1 380px;
		min-width: 0;
	}

	.bp-page-head__sub {
		margin: 0.25rem 0 0;
		color: var(--text-muted);
		font-size: 0.925rem;
	}

	.bp-kpi-grid {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 0.95rem;
	}

	.bp-kpi-card {
		background: var(--bg-card);
		border: 1px solid var(--border);
		border-radius: 12px;
		padding: 1rem 1.1rem;
		box-shadow: var(--ak-shadow-1);
		display: flex;
		flex-direction: column;
		gap: 0.35rem;
	}

	.bp-kpi-card h3 {
		margin: 0;
		font-size: 0.875rem;
		font-weight: 650;
		line-height: 1.3;
		color: var(--text-muted);
	}

	.bp-kpi-card__label {
		margin: 0;
		font-size: 0.78rem;
		font-weight: 650;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		color: var(--text-muted);
	}

	.bp-kpi-card__value {
		margin: 0;
		font-size: clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem);
		font-weight: 700;
		line-height: 1.15;
		font-variant-numeric: tabular-nums;
		color: var(--text-main);
	}

	.bp-kpi-card__meta {
		margin: 0;
		font-size: 0.8125rem;
		color: var(--text-muted);
		flex: 1;
	}

	.bp-kpi-card__cta {
		margin-top: 0.45rem;
		width: 100%;
		min-height: 36px;
		font-size: 0.84rem;
	}

	.bp-card-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
		flex-wrap: wrap;
		margin-bottom: 0.85rem;
	}

	.bp-card-head h2,
	.bp-card-head h3 {
		margin: 0;
		font-size: 1.05rem;
		line-height: 1.3;
	}

	.bp-card-head__meta {
		font-size: 0.78rem;
		font-weight: 600;
		color: var(--text-muted);
	}

	.bp-filter-bar {
		display: flex;
		flex-wrap: wrap;
		gap: 0.75rem;
		align-items: flex-end;
	}

	.bp-filter-card {
		padding: 0.85rem 1.05rem;
	}

	.bp-filter-bar > label,
	.bp-filter-bar > .select-field {
		display: flex;
		flex-direction: column;
		gap: 0.3rem;
		flex: 1 1 190px;
		min-width: 0;
		font-size: 0.8125rem;
		font-weight: 600;
		color: var(--text-muted);
	}

	.bp-filter-bar > .select-field > label {
		display: flex;
		flex-direction: column;
		gap: 0.3rem;
		min-width: 0;
		font-size: 0.8125rem;
		font-weight: 600;
		color: var(--text-muted);
	}

	.bp-filter-bar__actions {
		display: inline-flex;
		align-items: center;
		gap: 0.5rem;
		flex-shrink: 0;
	}

	.bp-head-actions {
		display: inline-flex;
		align-items: center;
		gap: 0.5rem;
		flex-wrap: wrap;
	}

	.bp-status-pill {
		display: inline-flex;
		align-items: center;
		gap: 0.35rem;
		padding: 0.3rem 0.75rem;
		border-radius: 999px;
		background: var(--bg-subtle);
		border: 1px solid var(--border);
		color: var(--text-muted);
		font-size: 0.78rem;
		font-weight: 650;
		white-space: nowrap;
		text-decoration: none;
	}

	a.bp-status-pill:hover {
		color: var(--text-main);
		border-color: var(--leaf);
	}

	.bp-ref-link {
		color: var(--text-main);
		text-decoration: none;
		font-weight: 700;
		white-space: nowrap;
	}

	.bp-ref-link:hover {
		color: var(--leaf);
		text-decoration: underline;
	}

	.bp-card-head__meta {
		font-size: 0.8125rem;
		font-weight: 600;
		color: var(--text-muted);
	}

	.bp-section-title {
		margin: 0 0 0.65rem;
		font-size: 1rem;
		font-weight: 700;
	}

	.bp-dialog {
		width: min(520px, calc(100vw - 2rem));
		border: 1px solid var(--border);
		border-radius: 14px;
		padding: 1.35rem 1.5rem;
		background: var(--bg-card);
		color: var(--text-main);
		box-shadow: var(--ak-shadow-3);
	}

	.bp-dialog:modal {
		overscroll-behavior: contain;
	}

	.bp-dialog::backdrop {
		background: rgba(15, 29, 34, 0.55);
		overflow: hidden;
		overscroll-behavior: contain;
	}

	.bp-dialog__head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
		margin-bottom: 0.75rem;
	}

	.bp-dialog__head h2 {
		margin: 0;
	}

	/* Compatibility primitives for phased HBS & test contracts */
	.card,
	.panel,
	.home-card {
		background: var(--bg-card);
		border: 1px solid var(--border);
		border-radius: 12px;
		padding: 1.15rem 1.25rem;
		box-shadow: var(--ak-shadow-1);
	}

	.tabs {
		display: flex;
		flex-wrap: wrap;
		gap: 0.4rem;
		margin-bottom: 0.85rem;
	}

	.grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
		gap: 1rem;
	}

	.fields,
	.form-grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
		gap: 0.85rem;
		align-items: end;
	}

	.fields label,
	.form-grid label {
		display: flex;
		flex-direction: column;
		gap: 0.3rem;
		font-size: 0.84rem;
		font-weight: 600;
	}

	.form-actions {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.65rem;
		margin-top: 0.75rem;
	}

	.ak-viewnav,
	nav[aria-label$="actions"] {
		display: flex;
		flex-wrap: wrap;
		gap: 0.4rem;
		padding: 0.35rem;
		background: var(--bg-subtle);
		border: 1px solid var(--border);
		border-radius: 10px;
	}

	.ak-viewnav__item,
	nav[aria-label$="actions"] > a {
		display: inline-flex;
		align-items: center;
		min-height: 32px;
		padding: 0.35rem 0.85rem;
		border-radius: 7px;
		border: 1px solid transparent;
		background: transparent;
		font-family: inherit;
		font-size: 0.85rem;
		font-weight: 600;
		color: var(--text-muted);
		text-decoration: none;
		cursor: pointer;
		transition: background-color 120ms ease, color 120ms ease;
	}

	.ak-viewnav__item:hover,
	nav[aria-label$="actions"] > a:hover {
		color: var(--text-main);
		background: color-mix(in srgb, var(--bg-card) 75%, transparent);
	}

	.ak-viewnav__item[aria-current="page"]::after,
	nav[aria-label$="actions"] > a[aria-current="page"]::after {
		content: none;
		display: none;
	}

	.ak-viewnav__item[aria-current="page"],
	nav[aria-label$="actions"] > a[aria-current="page"] {
		background: var(--leaf);
		color: var(--leaf-on);
		box-shadow: none;
		border: 1px solid var(--leaf);
	}

	form.bp-form {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
		gap: 0.85rem 1rem;
		align-items: end;
	}

	form.bp-form > label,
	form.bp-form > .select-field {
		display: flex;
		flex-direction: column;
		gap: 0.3rem;
		min-width: 0;
		font-size: 0.84rem;
		font-weight: 600;
	}

	form.bp-form > fieldset,
	form.bp-form > h2,
	form.bp-form > h3,
	form.bp-form > p,
	form.bp-form > .source-lines,
	form.bp-form > .purchase-lots,
	form.bp-form > .charges,
	form.bp-form > .live-readout,
	form.bp-form > .confirm-irreversible,
	form.bp-form > .form-actions,
	form.bp-form > #opening-splits,
	form.bp-form > #plan-allocation-rows,
	form.bp-form > #plan-owner-rows,
	form.bp-form > #plan-input-rows,
	form.bp-form > #packing-inputs,
	form.bp-form > #packing-removed-section,
	form.bp-form > #packing-orders,
	form.bp-form > #packing-counts,
	form.bp-form > #auction-fields,
	form.bp-form > .bp-full-span {
		grid-column: 1 / -1;
	}

	.bp-split-pane {
		display: grid;
		grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
		gap: 1rem;
		align-items: start;
	}

	.bp-split-pane > * {
		min-width: 0;
	}

	.bp-split-col {
		display: flex;
		flex-direction: column;
		gap: 1rem;
		min-width: 0;
	}

	.bp-step-pill {
		display: inline-flex;
		align-items: center;
		gap: 0.35rem;
		padding: 0.22rem 0.65rem;
		margin-bottom: 0.45rem;
		border-radius: 999px;
		background: var(--bg-subtle);
		color: var(--text-muted);
		font-size: 0.68rem;
		font-weight: 700;
		letter-spacing: 0.05em;
		text-transform: uppercase;
	}

	.bp-milestone-box {
		display: flex;
		flex-direction: column;
		gap: 0.35rem;
		padding: 0.85rem 1rem;
		border-radius: 10px;
		background: var(--bg-subtle);
		font-size: 0.84rem;
		line-height: 1.45;
		color: var(--text-main);
	}

	.bp-milestone-box__row {
		display: flex;
		align-items: baseline;
		gap: 0.45rem;
	}

	.bp-milestone-box__row strong,
	.bp-milestone-box__link {
		font-weight: 700;
	}

	.bp-qr-box {
		flex-shrink: 0;
		width: 56px;
		height: 56px;
		padding: 4px;
		border-radius: 8px;
		background: #FFFFFF;
		border: 1px solid var(--border);
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.bp-qr-box img {
		display: block;
		width: 48px;
		height: 48px;
	}

	.bp-split-pane .table-wrap th,
	.bp-split-pane .table-wrap td {
		padding: 0.48rem 0.52rem;
		font-size: 0.79rem;
	}

	.bp-split-pane .table-wrap th {
		font-size: 0.7rem;
	}

	.bp-table-row {
		cursor: pointer;
		transition: background-color 120ms ease;
	}

	.bp-table-row:hover {
		background: color-mix(in srgb, var(--bg-subtle) 65%, transparent);
	}

	.bp-table-row.is-selected,
	.bp-table-row[aria-selected="true"] {
		background: var(--leaf-soft);
	}

	.bp-subcell {
		display: block;
		font-size: 0.75rem;
		color: var(--text-muted);
		font-weight: 400;
	}

	.bp-table-footer {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.75rem;
		flex-wrap: wrap;
		padding-top: 0.75rem;
		margin-top: 0.35rem;
		font-size: 0.8rem;
		color: var(--text-muted);
	}

	.bp-inspector-card {
		position: sticky;
		top: 4.5rem;
	}

	.bp-inspector__head {
		display: flex;
		align-items: flex-start;
		justify-content: space-between;
		gap: 0.75rem;
	}

	.bp-inspector__head h2,
	.bp-inspector__head h3 {
		margin: 0;
		font-size: 1.05rem;
		line-height: 1.3;
	}

	.bp-inspector__sub {
		margin: 0.25rem 0 0;
		font-size: 0.8125rem;
		color: var(--text-muted);
	}

	.bp-inspector__metrics {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.75rem 1rem;
		margin: 0.85rem 0;
		padding: 0.85rem 1rem;
		background: var(--bg-subtle);
		border-radius: 10px;
	}

	.bp-inspector__metrics dt {
		font-size: 0.68rem;
		font-weight: 700;
		letter-spacing: 0.05em;
		text-transform: uppercase;
		color: var(--text-muted);
	}

	.bp-inspector__metrics dd {
		margin: 0.15rem 0 0;
		font-size: 0.925rem;
		font-weight: 700;
		font-variant-numeric: tabular-nums;
		color: var(--text-main);
		overflow-wrap: anywhere;
	}

	.bp-inspector__actions {
		display: flex;
		flex-wrap: wrap;
		gap: 0.5rem;
		margin-top: 0.85rem;
	}

	.bp-inspector__actions .btn,
	.bp-inspector__actions button {
		min-height: 34px;
		padding: 0.38rem 0.78rem;
		font-size: 0.8125rem;
	}

	.bp-progress-block {
		margin: 0.75rem 0;
	}

	.bp-progress-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 0.5rem;
		margin-bottom: 0.35rem;
		font-size: 0.8125rem;
		font-weight: 600;
		color: var(--text-main);
		font-variant-numeric: tabular-nums;
	}

	.bp-progress {
		display: block;
		width: 100%;
		height: 8px;
		border: 0;
		border-radius: 999px;
		background: var(--bg-subtle);
		overflow: hidden;
		appearance: none;
	}

	.bp-progress::-webkit-progress-bar {
		background: var(--bg-subtle);
		border-radius: 999px;
	}

	.bp-progress::-webkit-progress-value {
		background: var(--leaf);
		border-radius: 999px;
	}

	.bp-progress::-moz-progress-bar {
		background: var(--leaf);
		border-radius: 999px;
	}

	details.tech-ids,
	details.collapsible-section {
		background: var(--bg-subtle);
		border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
		border-radius: 8px;
		padding: 0.5rem 0.8rem;
		margin: 0.65rem 0;
		font-size: 0.8125rem;
	}

	details.tech-ids > summary,
	details.collapsible-section > summary {
		cursor: pointer;
		font-weight: 600;
		color: var(--text-muted);
		list-style-position: inside;
	}

	details.tech-ids > dl {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		gap: 0.25rem 0.75rem;
		margin: 0.55rem 0 0;
	}

	details.tech-ids > dl dt {
		font-weight: 600;
		color: var(--text-muted);
	}

	details.tech-ids > dl dd {
		margin: 0;
		word-break: break-all;
	}

	td details.tech-ids {
		margin: 0.25rem 0 0;
		padding: 0.18rem 0.5rem;
		font-size: 0.74rem;
		display: inline-block;
	}

	.table-wrap td .btn,
	.table-wrap td .btn-secondary {
		white-space: nowrap;
	}

	@media (max-width: 1023px) {
		.bp-split-pane {
			grid-template-columns: 1fr;
		}
		.bp-inspector-card {
			position: static;
		}
	}

	.bp-pinned-summary {
		margin: 0.35rem 0 0;
		padding-left: 1.15rem;
		font-size: 0.84rem;
		color: var(--text-muted);
	}

	.bp-pin-defaults-btn {
		margin-left: auto;
	}

	.badge {
		display: inline-flex;
		align-items: center;
		gap: 0.25rem;
		padding: 0.16rem 0.55rem;
		border-radius: 999px;
		font-size: 0.75rem;
		font-weight: 650;
		line-height: 1.35;
		white-space: nowrap;
	}

	.badge-ok,
	.is-ok {
		background: var(--ok-bg);
		color: var(--ok-fg);
	}

	.badge-warn,
	.is-warn {
		background: var(--warn-bg);
		color: var(--warn-fg);
	}

	.badge-danger,
	.is-danger {
		background: var(--danger-bg);
		color: var(--danger-fg);
	}

	.badge-muted {
		background: var(--muted-bg);
		color: var(--muted-fg);
	}

	.table-wrap,
	.table-scroll {
		width: 100%;
		overflow-x: auto;
		border: 1px solid var(--border);
		border-radius: 10px;
		background: var(--bg-card);
	}

	.table-wrap table,
	.table-scroll table {
		width: 100%;
		border-collapse: collapse;
		font-size: 0.875rem;
	}

	.table-wrap th,
	.table-wrap td,
	.table-scroll th,
	.table-scroll td {
		padding: 0.55rem 0.75rem;
		border-bottom: 1px solid var(--border);
		text-align: left;
		vertical-align: top;
	}

	.table-wrap th,
	.table-scroll th {
		background: var(--bg-subtle);
		font-size: 0.78rem;
		font-weight: 700;
		letter-spacing: 0.03em;
		text-transform: uppercase;
		color: var(--text-muted);
	}

	.num {
		text-align: right;
		font-variant-numeric: tabular-nums;
		white-space: nowrap;
	}

	dl.summary-grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
		gap: 0.75rem;
		margin: 0.75rem 0;
		padding: 0.85rem;
		background: var(--bg-subtle);
		border: 1px solid var(--border);
		border-radius: 10px;
	}

	dl.summary-grid dt {
		font-size: 0.75rem;
		font-weight: 650;
		text-transform: uppercase;
		letter-spacing: 0.04em;
		color: var(--text-muted);
	}

	dl.summary-grid dd {
		margin: 0.15rem 0 0;
		font-size: 1rem;
		font-weight: 700;
		font-variant-numeric: tabular-nums;
	}

	label.confirm-irreversible {
		display: flex;
		align-items: flex-start;
		gap: 0.5rem;
		padding: 0.65rem 0.8rem;
		border-radius: 8px;
		background: var(--danger-bg);
		color: var(--danger-fg);
		border: 1px solid color-mix(in srgb, var(--danger-fg) 30%, transparent);
		font-size: 0.875rem;
		font-weight: 600;
	}

	.live-readout {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
		gap: 0.6rem;
		padding: 0.75rem;
		border-radius: 10px;
		background: var(--bg-subtle);
		border: 1px solid var(--border);
		margin: 0.65rem 0;
	}

	.live-readout-item {
		display: flex;
		flex-direction: column;
		gap: 0.15rem;
	}

	.live-readout-label {
		font-size: 0.75rem;
		color: var(--text-muted);
	}

	.live-readout-value {
		font-size: 0.95rem;
		font-weight: 700;
		font-variant-numeric: tabular-nums;
	}

	.slice-summary {
		background: var(--bg-subtle);
		border: 1px solid var(--border);
		border-radius: 10px;
		padding: 0.8rem;
	}

	.slice-summary-grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
		gap: 0.6rem;
	}

	.form-feedback {
		margin: 0.65rem 0;
		padding: 0.65rem 0.85rem;
		border-radius: 8px;
		font-size: 0.875rem;
		font-weight: 600;
	}

	.feedback-error {
		background: var(--danger-bg);
		color: var(--danger-fg);
	}

	.feedback-warn {
		background: var(--warn-bg);
		color: var(--warn-fg);
	}

	.feedback-ok {
		background: var(--ok-bg);
		color: var(--ok-fg);
	}

	.callout {
		padding: 0.85rem 1rem;
		border-radius: 10px;
		background: var(--leaf-soft);
		border: 1px solid color-mix(in srgb, var(--leaf) 35%, var(--border));
	}

	.next-steps {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.5rem;
		margin: 0.65rem 0;
		padding: 0.75rem 0.9rem;
		border-radius: 10px;
		background: var(--ok-bg);
		color: var(--ok-fg);
	}

	.next-step-link {
		font-weight: 650;
		color: inherit;
	}

	.is-highlighted {
		outline: 2px solid var(--accent);
		background: var(--accent-soft);
	}

	.muted-note,
	.v2 {
		color: var(--text-muted);
		font-size: 0.84rem;
	}

	.home-grid {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
		gap: 1rem;
	}

	.home-count {
		margin: 0.25rem 0;
		font-size: 1.65rem;
		font-weight: 700;
		font-variant-numeric: tabular-nums;
	}

	.scope-picker {
		border: 1px solid var(--border);
		border-radius: 10px;
		padding: 0.75rem;
		background: var(--bg-card);
	}

	.scope-options {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
		gap: 0.35rem;
		max-height: 220px;
		overflow-y: auto;
	}

	.select-field {
		display: flex;
		flex-direction: column;
		gap: 0.35rem;
	}

	.select-tools {
		display: flex;
		gap: 0.4rem;
		align-items: center;
	}

	.mfa-qr {
		padding: 0.75rem;
		background: #FFFFFF;
		border-radius: 10px;
		display: inline-block;
		border: 1px solid var(--border);
	}

	.mfa-secret {
		font-family: var(--ak-font-family-mono, monospace);
		font-size: 0.875rem;
		word-break: break-all;
	}

	.skip-link:focus {
		position: fixed;
		top: 0.75rem;
		left: 0.75rem;
		z-index: 4000;
		width: auto;
		height: auto;
		clip: auto;
		clip-path: none;
		padding: 0.5rem 0.9rem;
		border-radius: 8px;
		background: var(--bp-spruce);
		color: #FFFFFF;
		font-weight: 600;
		text-decoration: none;
	}

	.visually-hidden {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
		border: 0;
	}

	/* alpine-grid surface integration */
	.bp-grid-host {
		min-height: 260px;
		border-radius: 10px;
	}

	/* Responsive breakpoints: Tablet (<1024px) and Mobile (<768px) */
	@media (max-width: 1100px) {
		.bp-kpi-grid {
			grid-template-columns: repeat(2, minmax(0, 1fr));
		}
	}

	@media (max-width: 1023px) {
		.ak-app-main {
			padding: 1rem;
		}
	}

	@media (max-width: 767px) {
		.bp-auth-page {
			padding: 0.75rem;
		}
		.bp-auth-top {
			top: 0.75rem;
			right: 0.75rem;
		}
		.bp-auth-split {
			grid-template-columns: 1fr;
			min-height: 0;
		}
		.bp-auth-art {
			min-height: 190px;
			max-height: 220px;
		}
		.bp-auth-pane {
			padding: 1.5rem 1.25rem;
		}
		.ak-app-main {
			padding: 0.85rem 0.75rem 2rem;
		}
		.bp-kpi-grid {
			grid-template-columns: 1fr;
		}
	}

	@media (prefers-reduced-motion: reduce) {
		*,
		*::before,
		*::after {
			animation-duration: 0.01ms !important;
			animation-iteration-count: 1 !important;
			transition-duration: 0.01ms !important;
			scroll-behavior: auto !important;
		}
	}

	@media (forced-colors: active) {
		.card,
		.panel,
		.bp-kpi-card,
		.table-wrap,
		.btn,
		.badge {
			border: 1px solid CanvasText;
		}
		:focus-visible {
			outline: 2px solid Highlight;
		}
	}

	@media print {
		.ak-shell__nav,
		.ak-shell__bar,
		.ak-app-views,
		.bp-no-print,
		form,
		.btn,
		.ak-button {
			display: none !important;
		}
		.ak-shell,
		.ak-shell__main,
		.ak-app-main {
			display: block !important;
			padding: 0 !important;
			margin: 0 !important;
			background: #FFFFFF !important;
			color: #000000 !important;
		}
		.card,
		.table-wrap {
			box-shadow: none !important;
			border-color: #000000 !important;
		}
	}
}
