/*
 * SmartCard App: design system and shell (SmartCard Platform 0.2.0).
 *
 * Everything is scoped to .scplat-root (the element app-core.js mounts inside #scplat-app)
 * and every class starts with scplat-. No web fonts, no images, nothing from another origin.
 *
 * Contents
 *   1. Tokens and base
 *   2. Layout helpers (documented for view builders in notes/fe-core.md)
 *   3. Shell: sidebar, top bar, tab bar, nav sheet
 *   4. Page frame, cards, tiles, lists
 *   5. Buttons, pills, forms
 *   6. Tables, tabs, segmented control, pager
 *   7. States: skeleton, empty, error, locked, notice
 *   8. Overlays: dialog, toast
 *   9. Charts
 *  10. Core screens: hero, plans, account, gates
 *  11. Responsive rules and reduced motion
 */

/* ------------------------------------------------------------------
 * 1. Tokens and base
 * ---------------------------------------------------------------- */

.scplat-body {
	margin: 0;
	background: #F5F7FC;
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}

#scplat-app > noscript p,
#scplat-app > p {
	max-width: 520px;
	margin: 48px auto;
	padding: 0 20px;
	font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: #121826;
}

.scplat-root {
	--scplat-blue: #0533F5;
	--scplat-blue-dark: #0428C4;
	--scplat-blue-light: #5B86FF;
	--scplat-sky: #EEF2FF;
	--scplat-ink: #121826;
	--scplat-navy: #0B1236;
	--scplat-night: #0B1020;
	--scplat-muted: #5B6475;
	--scplat-line: #E6E9F0;
	--scplat-soft: #F5F7FC;
	--scplat-white: #fff;
	--scplat-gold: #FFC83D;
	--scplat-purple: #7B2FF7;
	--scplat-ok-bg: #E7F7EF;
	--scplat-ok: #0F7A55;
	--scplat-warn-bg: #FFF4E5;
	--scplat-warn: #995400;
	--scplat-bad-bg: #FEF3F2;
	--scplat-bad: #B42318;
	--scplat-r-sm: 10px;
	--scplat-r: 14px;
	--scplat-r-lg: 22px;
	--scplat-pill: 999px;
	--scplat-shadow: 0 10px 30px rgba(18, 24, 38, .06);
	--scplat-shadow-lg: 0 24px 60px rgba(18, 24, 38, .16);
	--scplat-font-head: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	--scplat-font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	/* Derived values used by the components below. */
	/* WCAG 1.4.11 (3:1) for field edges, the switch track and the focus ring (SPEC 5.4 asks for AA;
	   the brand values it names, #D9DEE8 and a 25% blue ring, are 1.35:1 and 1.58:1). */
	--scplat-input-line: #8A93A6;
	--scplat-hair: #EEF0F5;
	--scplat-nav-ink: #3A4254;
	--scplat-grey-bg: #F1F3F8;
	--scplat-hover: #F2F5FF;
	--scplat-on-dark: #C9D3F5;
	--scplat-ring: 0 0 0 2px #FFFFFF, 0 0 0 4px #0533F5;
	--scplat-ring-dark: 0 0 0 3px rgba(255, 255, 255, .6);
	--scplat-card-r: 20px;
	--scplat-btn-r: 12px;
	--scplat-speed: .16s;
	--scplat-sidebar: 264px;
	--scplat-topbar: 56px;
	--scplat-tabbar: 62px;
	--scplat-safe-t: env(safe-area-inset-top, 0px);
	--scplat-safe-b: env(safe-area-inset-bottom, 0px);
	--scplat-safe-l: env(safe-area-inset-left, 0px);
	--scplat-safe-r: env(safe-area-inset-right, 0px);

	min-height: 100vh;
	min-height: 100dvh;
	background: var(--scplat-soft);
	color: var(--scplat-ink);
	font-family: var(--scplat-font-body);
	font-size: 15px;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	color-scheme: light;
	overflow-wrap: break-word;
}

.scplat-root *,
.scplat-root *::before,
.scplat-root *::after {
	box-sizing: border-box;
}

/* Element defaults use :where() so that any component class overrides them. */
.scplat-root :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure) {
	margin: 0;
	padding: 0;
}

.scplat-root :where(ul, ol) {
	list-style: none;
}

.scplat-root :where(h1, h2, h3, h4) {
	font-family: var(--scplat-font-head);
	color: var(--scplat-navy);
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.scplat-root :where(a) {
	color: var(--scplat-blue);
	text-decoration: none;
	text-underline-offset: 3px;
}

.scplat-root :where(a:hover) {
	color: var(--scplat-blue-dark);
}

.scplat-root p a,
.scplat-root .scplat-textlink {
	font-weight: 600;
}

.scplat-root p a:hover,
.scplat-root .scplat-textlink:hover {
	text-decoration: underline;
}

.scplat-root :where(img, svg) {
	display: block;
	max-width: 100%;
}

.scplat-root :where(button, input, select, textarea) {
	font: inherit;
	color: inherit;
	margin: 0;
}

.scplat-root :where(button) {
	cursor: pointer;
}

.scplat-root [hidden] {
	display: none !important;
}

.scplat-root :focus {
	outline: none;
}

.scplat-root :focus-visible {
	outline: 2px solid transparent;
	outline-offset: 2px;
	box-shadow: var(--scplat-ring);
}

.scplat-root a:focus-visible {
	border-radius: 6px;
}

.scplat-root ::selection {
	background: rgba(5, 51, 245, .18);
}

/* Set on <html> while a dialog or the menu sheet is open. */
.scplat-noscroll {
	overflow: hidden;
}

/* Visually hidden, still read by screen readers. */
.scplat-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.scplat-skip {
	position: fixed;
	z-index: 400;
	top: 10px;
	left: 10px;
	padding: 10px 16px;
	border-radius: var(--scplat-btn-r);
	background: var(--scplat-navy);
	color: var(--scplat-white) !important;
	font-weight: 700;
	transform: translateY(-200%);
}

.scplat-skip:focus {
	transform: none;
}

.scplat-icon {
	flex: none;
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.scplat-icon--sm {
	width: 16px;
	height: 16px;
}

.scplat-icon--lg {
	width: 24px;
	height: 24px;
}

/* ------------------------------------------------------------------
 * 2. Layout helpers
 * ---------------------------------------------------------------- */

.scplat-stack {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.scplat-stack > * {
	min-width: 0;
}

.scplat-stack--xs { gap: 6px; }
.scplat-stack--sm { gap: 12px; }
.scplat-stack--lg { gap: 28px; }

.scplat-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 12px;
	min-width: 0;
}

.scplat-row > * {
	min-width: 0;
}

.scplat-row--between { justify-content: space-between; }
.scplat-row--end { justify-content: flex-end; }
.scplat-row--top { align-items: flex-start; }
.scplat-row--nowrap { flex-wrap: nowrap; }
.scplat-grow { flex: 1 1 0; min-width: 0; }

.scplat-grid {
	display: grid;
	gap: 20px;
	min-width: 0;
}

.scplat-grid > * {
	min-width: 0;
}

.scplat-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.scplat-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.scplat-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.scplat-grid--split { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
.scplat-grid--auto { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }

/*
 * Home overview cards. One column below 1024px (DOM order: chart, attention, activity, links).
 * From 1024px: chart and Recent activity in the wide column, Needs attention and Quick links in
 * the narrow one. The middle row is flexible, so each column ends at the same line and a long
 * attention list no longer leaves a hole under the chart.
 */
@media (min-width: 1024px) {
	.scplat-home__board {
		grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
		grid-template-rows: auto 1fr auto;
		grid-template-areas:
			"chart attention"
			"activity attention"
			"activity links";
	}

	.scplat-home__chart { grid-area: chart; }
	.scplat-home__attention { grid-area: attention; }
	.scplat-home__activity { grid-area: activity; }
	.scplat-home__links { grid-area: links; }
}

.scplat-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
	gap: 14px;
}

.scplat-muted { color: var(--scplat-muted); }
.scplat-small { font-size: 13px; }
.scplat-strong { font-weight: 700; color: var(--scplat-navy); }
.scplat-num { font-variant-numeric: tabular-nums; }
.scplat-wrap { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.scplat-nowrap { white-space: nowrap; }
.scplat-center { text-align: center; }

.scplat-truncate {
	display: block;
	position: relative; /* clips an absolutely placed .scplat-sr child too */
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.scplat-clamp {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	overflow-wrap: anywhere;
}

.scplat-divider {
	height: 1px;
	border: 0;
	margin: 0;
	background: var(--scplat-hair);
}

.scplat-section-title {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -.005em;
}

.scplat-kicker {
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--scplat-muted);
}

.scplat-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 10px 12px;
}

.scplat-toolbar > .scplat-field {
	flex: 1 1 180px;
	max-width: 320px;
}

.scplat-toolbar__end {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-left: auto;
}

/* ------------------------------------------------------------------
 * 3. Shell
 * ---------------------------------------------------------------- */

.scplat-shell {
	min-height: 100vh;
	min-height: 100dvh;
}

.scplat-brand {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	border-radius: 12px;
	color: var(--scplat-navy) !important;
	font-family: var(--scplat-font-head);
	font-size: 18.5px;
	font-weight: 800;
	letter-spacing: -.02em;
}

.scplat-brand__chip {
	display: grid;
	place-items: center;
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 11px;
	background: linear-gradient(135deg, var(--scplat-blue), var(--scplat-navy) 140%);
	color: var(--scplat-white);
	box-shadow: 0 8px 16px -8px rgba(5, 51, 245, .7);
}

.scplat-brand__chip .scplat-icon {
	width: 19px;
	height: 19px;
}

.scplat-sidebar {
	position: fixed;
	z-index: 30;
	top: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	width: var(--scplat-sidebar);
	padding: 18px 14px 14px;
	padding-left: calc(14px + var(--scplat-safe-l));
	background: var(--scplat-white);
	border-right: 1px solid var(--scplat-line);
}

.scplat-sidebar .scplat-brand {
	margin: 0 6px 14px;
	align-self: flex-start;
}

.scplat-nav {
	flex: 1 1 auto;
	min-height: 0;
	margin: 0 -6px;
	padding: 2px 6px 12px;
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
}

.scplat-nav__label {
	margin: 18px 12px 6px;
	font-size: 10.5px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--scplat-muted);
}

.scplat-nav__list {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.scplat-nav__item {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 10px 12px;
	border-radius: 12px;
	color: var(--scplat-nav-ink) !important;
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.3;
	transition: background var(--scplat-speed), color var(--scplat-speed), box-shadow var(--scplat-speed);
}

.scplat-nav__item:hover {
	background: var(--scplat-hover);
	color: var(--scplat-blue) !important;
}

.scplat-root .scplat-nav__item:focus-visible {
	border-radius: 12px;
}

.scplat-nav__item[aria-current="page"] {
	background: var(--scplat-blue);
	color: var(--scplat-white) !important;
	box-shadow: 0 8px 18px -10px rgba(5, 51, 245, .8);
}

.scplat-root .scplat-nav__item[aria-current="page"]:focus-visible {
	box-shadow: 0 0 0 2px var(--scplat-white), 0 0 0 5px rgba(5, 51, 245, .45);
}

.scplat-nav__text {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.scplat-badge {
	flex: none;
	min-width: 22px;
	padding: 2px 7px;
	border-radius: var(--scplat-pill);
	background: var(--scplat-blue);
	color: var(--scplat-white);
	font-size: 11.5px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.scplat-nav__item[aria-current="page"] .scplat-badge {
	background: var(--scplat-white);
	color: var(--scplat-blue);
}

.scplat-sidebar__foot {
	flex: none;
	margin: 0 -14px -14px;
	padding: 12px 14px 14px;
	border-top: 1px solid var(--scplat-hair);
}

.scplat-user {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	padding: 8px;
	border-radius: 14px;
	color: inherit !important;
	transition: background var(--scplat-speed);
}

a.scplat-user:hover {
	background: var(--scplat-hover);
}

.scplat-root a.scplat-user:focus-visible {
	border-radius: 14px;
}

.scplat-user__text {
	flex: 1 1 auto;
	min-width: 0;
}

.scplat-user__name {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--scplat-navy);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
}

.scplat-user__mail {
	display: block;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	color: var(--scplat-muted);
	font-size: 12.5px;
	line-height: 1.35;
}

.scplat-avatar {
	position: relative;
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	overflow: hidden;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--scplat-blue), var(--scplat-purple));
	color: var(--scplat-white);
	font-family: var(--scplat-font-head);
	font-size: 14px;
	font-weight: 800;
	letter-spacing: .02em;
	user-select: none;
}

.scplat-avatar img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.scplat-avatar--lg {
	width: 64px;
	height: 64px;
	font-size: 22px;
}

.scplat-logout {
	margin: 4px 0 0;
}

.scplat-logout__btn {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: 44px;
	padding: 10px 12px;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: var(--scplat-bad) !important;
	font-size: 14.5px;
	font-weight: 600;
	text-align: left;
	transition: background var(--scplat-speed);
}

.scplat-logout__btn:hover {
	background: var(--scplat-bad-bg);
}

.scplat-topbar,
.scplat-tabbar {
	display: none;
}

.scplat-main {
	min-width: 0;
	margin-left: var(--scplat-sidebar);
}

.scplat-content {
	width: 100%;
	max-width: 1120px;
	margin: 0 auto;
	padding: 32px 32px 64px;
}

/* Nav sheet (the mobile menu). */
.scplat-layer {
	position: relative;
	z-index: 100;
}

.scplat-backdrop {
	position: fixed;
	inset: 0;
	z-index: 110;
	background: rgba(11, 16, 32, .5);
	animation: scplat-fade var(--scplat-speed) ease-out both;
}

.scplat-sheet {
	position: fixed;
	z-index: 120;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(88vw, 340px);
	padding: calc(10px + var(--scplat-safe-t)) calc(14px + var(--scplat-safe-r)) calc(14px + var(--scplat-safe-b)) 14px;
	background: var(--scplat-white);
	box-shadow: var(--scplat-shadow-lg);
	animation: scplat-slide-in .2s ease-out both;
}

.scplat-sheet__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 6px 6px;
}

.scplat-sheet .scplat-nav {
	margin: 0 -6px;
}

.scplat-sheet__foot {
	flex: none;
	margin: 0 -14px;
	padding: 12px 14px 0;
	border-top: 1px solid var(--scplat-hair);
}

/* ------------------------------------------------------------------
 * 4. Page frame, cards, tiles, lists
 * ---------------------------------------------------------------- */

.scplat-page {
	display: flex;
	flex-direction: column;
	gap: 24px;
	min-width: 0;
	animation: scplat-rise .2s ease-out both;
}

.scplat-page__head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 14px 20px;
}

.scplat-page__heading {
	flex: 1 1 280px;
	min-width: 0;
}

.scplat-page__title {
	font-size: 26px;
	font-weight: 800;
	letter-spacing: -.015em;
	line-height: 1.2;
}

.scplat-root .scplat-page__title:focus,
.scplat-root .scplat-hero__title:focus,
.scplat-root .scplat-gate__title:focus,
.scplat-root .scplat-main:focus {
	box-shadow: none;
	outline: none;
}

.scplat-page__sub {
	margin-top: 4px;
	color: var(--scplat-muted);
	font-size: 14.5px;
	overflow-wrap: anywhere;
}

.scplat-page__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.scplat-page__body {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.scplat-page__body > * {
	min-width: 0;
}

.scplat-back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	align-self: flex-start;
	min-height: 32px;
	margin: -6px 0 -12px -6px;
	padding: 4px 10px 4px 4px;
	border-radius: 10px;
	color: var(--scplat-muted) !important;
	font-size: 13.5px;
	font-weight: 600;
	transition: background var(--scplat-speed), color var(--scplat-speed);
}

.scplat-back:hover {
	background: var(--scplat-white);
	color: var(--scplat-blue) !important;
}

.scplat-back .scplat-icon {
	width: 18px;
	height: 18px;
}

.scplat-card {
	min-width: 0;
	padding: 22px;
	border: 1px solid var(--scplat-line);
	border-radius: var(--scplat-card-r);
	background: var(--scplat-white);
	box-shadow: var(--scplat-shadow);
}

.scplat-card--flush {
	padding: 0;
	overflow: hidden;
}

.scplat-card--flush > .scplat-card__head {
	padding: 20px 22px 0;
}

.scplat-card--soft {
	background: var(--scplat-soft);
	box-shadow: none;
}

.scplat-card__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 14px;
	margin-bottom: 16px;
}

.scplat-card__heading {
	flex: 1 1 auto;
	min-width: 0;
}

.scplat-card__title {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -.005em;
}

.scplat-card__sub {
	margin-top: 2px;
	color: var(--scplat-muted);
	font-size: 13.5px;
}

.scplat-card__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.scplat-card__body {
	min-width: 0;
}

.scplat-card__body > * + * {
	margin-top: 16px;
}

.scplat-card__foot {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--scplat-hair);
}

.scplat-chip {
	display: grid;
	place-items: center;
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--scplat-sky);
	color: var(--scplat-blue);
}

.scplat-chip--lg {
	width: 48px;
	height: 48px;
	border-radius: 15px;
}

.scplat-chip--lg .scplat-icon {
	width: 24px;
	height: 24px;
}

.scplat-chip--ok { background: var(--scplat-ok-bg); color: var(--scplat-ok); }
.scplat-chip--warn { background: var(--scplat-warn-bg); color: var(--scplat-warn); }
.scplat-chip--bad { background: var(--scplat-bad-bg); color: var(--scplat-bad); }
.scplat-chip--grey { background: var(--scplat-grey-bg); color: var(--scplat-muted); }
.scplat-chip--pro { background: linear-gradient(135deg, #0533F5, #7B2FF7); color: var(--scplat-white); }

/* KPI tile */
.scplat-kpi {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	padding: 16px 18px;
	border: 1px solid var(--scplat-line);
	border-radius: 18px;
	background: var(--scplat-white);
	box-shadow: var(--scplat-shadow);
	color: inherit !important;
}

a.scplat-kpi {
	transition: border-color var(--scplat-speed), transform var(--scplat-speed), box-shadow var(--scplat-speed);
}

a.scplat-kpi:hover {
	border-color: rgba(5, 51, 245, .45);
	transform: translateY(-2px);
	box-shadow: 0 18px 32px -18px rgba(5, 51, 245, .45);
}

.scplat-root a.scplat-kpi:focus-visible {
	border-radius: 18px;
}

.scplat-kpi__label {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--scplat-muted);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.35;
}

.scplat-kpi__label .scplat-icon {
	width: 15px;
	height: 15px;
}

.scplat-kpi__value {
	font-family: var(--scplat-font-head);
	font-size: 28px;
	font-weight: 800;
	letter-spacing: -.02em;
	line-height: 1.15;
	color: var(--scplat-navy);
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

.scplat-kpi__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	min-height: 22px;
	color: var(--scplat-muted);
	font-size: 12px;
}

.scplat-delta {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 2px 8px 2px 6px;
	border-radius: var(--scplat-pill);
	background: var(--scplat-grey-bg);
	color: var(--scplat-nav-ink);
	font-size: 11.5px;
	font-weight: 700;
	line-height: 18px;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.scplat-delta .scplat-icon {
	width: 12px;
	height: 12px;
	stroke-width: 2.6;
}

.scplat-delta--up { background: var(--scplat-ok-bg); color: var(--scplat-ok); }
.scplat-delta--down { background: var(--scplat-bad-bg); color: var(--scplat-bad); }
.scplat-delta--flat { padding-left: 8px; }

/* Small inline stat */
.scplat-stat {
	display: inline-flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.scplat-stat__value {
	font-family: var(--scplat-font-head);
	font-size: 17px;
	font-weight: 800;
	line-height: 1.25;
	color: var(--scplat-navy);
	font-variant-numeric: tabular-nums;
	overflow-wrap: anywhere;
}

.scplat-stat__label {
	color: var(--scplat-muted);
	font-size: 12px;
	font-weight: 600;
}

.scplat-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 28px;
}

/* Tiles (shortcuts) */
.scplat-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(210px, 100%), 1fr));
	gap: 14px;
}

.scplat-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
	padding: 18px;
	border: 1px solid var(--scplat-line);
	border-radius: var(--scplat-card-r);
	background: var(--scplat-white);
	box-shadow: var(--scplat-shadow);
	color: inherit !important;
	transition: border-color var(--scplat-speed), transform var(--scplat-speed), box-shadow var(--scplat-speed);
}

.scplat-tile:hover {
	border-color: rgba(5, 51, 245, .45);
	transform: translateY(-2px);
	box-shadow: 0 18px 32px -18px rgba(5, 51, 245, .5);
}

.scplat-root .scplat-tile:focus-visible {
	border-radius: var(--scplat-card-r);
}

.scplat-tile__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.scplat-tile__go {
	color: var(--scplat-muted);
	transition: color var(--scplat-speed), transform var(--scplat-speed);
}

.scplat-tile:hover .scplat-tile__go {
	color: var(--scplat-blue);
	transform: translateX(2px);
}

.scplat-tile__title {
	display: block;
	font-family: var(--scplat-font-head);
	font-size: 15.5px;
	font-weight: 800;
	color: var(--scplat-navy);
	line-height: 1.3;
}

.scplat-tile__sub {
	display: block;
	margin-top: 2px;
	color: var(--scplat-muted);
	font-size: 13px;
	overflow-wrap: anywhere;
}

/* Lists of rows (activity, attention, links) */
.scplat-list {
	display: flex;
	flex-direction: column;
	margin: -6px -10px;
}

.scplat-list__item + .scplat-list__item {
	border-top: 1px solid var(--scplat-hair);
}

.scplat-list__row {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	min-height: 56px;
	padding: 10px;
	border-radius: 14px;
	color: inherit !important;
	transition: background var(--scplat-speed);
}

a.scplat-list__row:hover,
button.scplat-list__row:hover {
	background: var(--scplat-hover);
}

.scplat-root a.scplat-list__row:focus-visible {
	border-radius: 14px;
}

.scplat-list__text {
	flex: 1 1 auto;
	min-width: 0;
}

.scplat-list__title {
	display: block;
	color: var(--scplat-navy);
	font-size: 14.5px;
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.scplat-list__detail {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
	margin-top: 1px;
	color: var(--scplat-muted);
	font-size: 13px;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.scplat-list__meta {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: none;
	color: var(--scplat-muted);
	font-size: 12.5px;
	white-space: nowrap;
}

.scplat-list__meta .scplat-icon {
	width: 16px;
	height: 16px;
}

/* Definition rows for detail pages */
.scplat-details {
	display: grid;
	grid-template-columns: minmax(110px, 180px) minmax(0, 1fr);
	gap: 0 16px;
}

.scplat-details dt,
.scplat-details dd {
	padding: 11px 0;
	border-top: 1px solid var(--scplat-hair);
}

.scplat-details dt:first-of-type,
.scplat-details dt:first-of-type + dd {
	border-top: 0;
	padding-top: 0;
}

.scplat-details dt {
	color: var(--scplat-muted);
	font-size: 13px;
	font-weight: 600;
}

.scplat-details dd {
	min-width: 0;
	overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------
 * 5. Buttons, pills, forms
 * ---------------------------------------------------------------- */

.scplat-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	max-width: 100%;
	min-height: 44px;
	padding: 10px 18px;
	border: 1px solid transparent;
	border-radius: var(--scplat-btn-r);
	background: var(--scplat-sky);
	color: var(--scplat-blue) !important;
	font-family: var(--scplat-font-body);
	font-size: 14.5px;
	font-weight: 700;
	line-height: 1.25;
	text-align: center;
	text-decoration: none !important;
	white-space: normal;
	/* break-word (not anywhere) keeps a button from being squeezed letter by letter in a row,
	   while max-width still lets a very long word break inside it. */
	overflow-wrap: break-word;
	user-select: none;
	-webkit-tap-highlight-color: transparent;
	transition: background var(--scplat-speed), color var(--scplat-speed), border-color var(--scplat-speed), box-shadow var(--scplat-speed), transform var(--scplat-speed);
}

.scplat-root .scplat-btn:focus-visible {
	border-radius: var(--scplat-btn-r);
}

.scplat-btn:hover {
	background: #E1E8FF;
}

.scplat-btn:active {
	transform: translateY(1px);
}

.scplat-btn--primary {
	background: var(--scplat-blue);
	color: var(--scplat-white) !important;
	box-shadow: 0 8px 18px -10px rgba(5, 51, 245, .8);
}

.scplat-btn--primary:hover {
	background: var(--scplat-blue-dark);
}

.scplat-btn--ghost {
	background: transparent;
	color: var(--scplat-blue) !important;
}

.scplat-btn--ghost:hover {
	background: var(--scplat-hover);
}

.scplat-btn--danger {
	background: var(--scplat-bad-bg);
	color: var(--scplat-bad) !important;
}

.scplat-btn--danger:hover {
	background: #FDE4E1;
}

.scplat-btn--white {
	background: var(--scplat-white);
	color: var(--scplat-blue) !important;
}

.scplat-btn--white:hover {
	background: var(--scplat-sky);
}

.scplat-btn--glass {
	background: rgba(255, 255, 255, .12);
	color: var(--scplat-white) !important;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}

.scplat-btn--glass:hover {
	background: rgba(255, 255, 255, .2);
}

.scplat-root .scplat-btn--white:focus-visible,
.scplat-root .scplat-btn--glass:focus-visible {
	box-shadow: var(--scplat-ring-dark);
}

.scplat-btn--sm {
	min-height: 36px;
	padding: 6px 12px;
	border-radius: 10px;
	font-size: 13.5px;
}

/* Small buttons keep a 44px touch target. */
.scplat-btn--sm::after {
	content: "";
	position: absolute;
	inset: -4px 0;
}

.scplat-btn--block {
	display: flex;
	width: 100%;
}

.scplat-btn--icon {
	width: 44px;
	padding: 0;
}

.scplat-btn--icon.scplat-btn--sm {
	width: 36px;
}

.scplat-btn--icon.scplat-btn--sm::after {
	inset: -4px;
}

.scplat-btn__label {
	min-width: 0;
}

.scplat-btn[disabled],
.scplat-btn[aria-disabled="true"] {
	cursor: not-allowed;
	opacity: .55;
	box-shadow: none;
	transform: none;
}

.scplat-btn--busy {
	cursor: progress !important;
}

.scplat-btn--busy > :not(.scplat-spinner) {
	opacity: .35;
}

.scplat-btn--busy[disabled],
.scplat-btn--busy[aria-disabled="true"] {
	opacity: 1;
}

.scplat-spinner {
	display: inline-block;
	flex: none;
	width: 18px;
	height: 18px;
	border: 2.5px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: scplat-spin .7s linear infinite;
}

.scplat-btn--busy > .scplat-spinner {
	position: absolute;
	top: calc(50% - 9px);
	left: calc(50% - 9px);
}

.scplat-pill {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	max-width: 100%;
	padding: 3px 10px;
	border-radius: var(--scplat-pill);
	background: var(--scplat-grey-bg);
	color: var(--scplat-nav-ink);
	font-size: 11.5px;
	font-weight: 700;
	line-height: 18px;
	vertical-align: middle;
	overflow-wrap: anywhere;
}

.scplat-pill--blue { background: var(--scplat-sky); color: var(--scplat-blue); }
.scplat-pill--ok { background: var(--scplat-ok-bg); color: var(--scplat-ok); }
.scplat-pill--warn { background: var(--scplat-warn-bg); color: var(--scplat-warn); }
.scplat-pill--bad { background: var(--scplat-bad-bg); color: var(--scplat-bad); }

.scplat-pill--pro {
	background: linear-gradient(135deg, #0533F5, #7B2FF7);
	color: var(--scplat-white);
	letter-spacing: .06em;
}

.scplat-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

/* Fields */
.scplat-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.scplat-label {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	color: var(--scplat-navy);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
}

.scplat-label__opt {
	color: var(--scplat-muted);
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
}

.scplat-input,
.scplat-select,
.scplat-textarea {
	display: block;
	width: 100%;
	min-width: 0;
	min-height: 48px;
	padding: 11px 14px;
	border: 1px solid var(--scplat-input-line);
	border-radius: 12px;
	background: var(--scplat-white);
	color: var(--scplat-ink);
	font-size: 15px;
	line-height: 1.4;
	appearance: none;
	-webkit-appearance: none;
	transition: border-color var(--scplat-speed), box-shadow var(--scplat-speed);
}

.scplat-textarea {
	min-height: 112px;
	resize: vertical;
}

.scplat-select {
	padding-right: 40px;
	background-image:
		linear-gradient(45deg, transparent 50%, var(--scplat-muted) 50%),
		linear-gradient(135deg, var(--scplat-muted) 50%, transparent 50%);
	background-position: calc(100% - 21px) 21px, calc(100% - 15px) 21px;
	background-size: 6px 6px, 6px 6px;
	background-repeat: no-repeat;
	text-overflow: ellipsis;
}

.scplat-input::placeholder,
.scplat-textarea::placeholder {
	color: #8A93A6;
	opacity: 1;
}

.scplat-input:hover,
.scplat-select:hover,
.scplat-textarea:hover {
	border-color: #B9C1D1;
}

.scplat-root .scplat-input:focus,
.scplat-root .scplat-select:focus,
.scplat-root .scplat-textarea:focus {
	border-color: var(--scplat-blue);
	box-shadow: var(--scplat-ring);
}

.scplat-input[disabled],
.scplat-select[disabled],
.scplat-textarea[disabled],
.scplat-input[readonly] {
	background: var(--scplat-soft);
	color: var(--scplat-muted);
	cursor: not-allowed;
}

.scplat-field--invalid .scplat-input,
.scplat-field--invalid .scplat-select,
.scplat-field--invalid .scplat-textarea {
	border-color: var(--scplat-bad);
}

.scplat-root .scplat-field--invalid .scplat-input:focus,
.scplat-root .scplat-field--invalid .scplat-select:focus,
.scplat-root .scplat-field--invalid .scplat-textarea:focus {
	box-shadow: 0 0 0 3px rgba(180, 35, 24, .2);
}

.scplat-help {
	color: var(--scplat-muted);
	font-size: 12.5px;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.scplat-field__foot {
	display: flex;
	justify-content: space-between;
	gap: 12px;
}

.scplat-field__foot:empty {
	display: none;
}

.scplat-count {
	margin-left: auto;
	color: var(--scplat-muted);
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.scplat-error {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	color: var(--scplat-bad);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.scplat-error:empty {
	display: none;
}

.scplat-input--search {
	padding-left: 42px;
}

.scplat-inputwrap {
	position: relative;
}

.scplat-inputwrap > .scplat-icon {
	position: absolute;
	top: 14px;
	left: 14px;
	color: var(--scplat-muted);
	pointer-events: none;
}

/* Switch (type "toggle") */
.scplat-switch {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 48px;
	padding: 6px 0;
	cursor: pointer;
}

.scplat-switch__text {
	min-width: 0;
}

.scplat-switch__label {
	display: block;
	color: var(--scplat-navy);
	font-size: 14.5px;
	font-weight: 600;
}

.scplat-switch__input {
	position: relative;
	flex: none;
	width: 46px;
	height: 28px;
	margin: 0;
	border: 0;
	border-radius: var(--scplat-pill);
	background: #8A93A6;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	transition: background var(--scplat-speed);
}

.scplat-switch__input::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--scplat-white);
	box-shadow: 0 1px 3px rgba(18, 24, 38, .3);
	transition: transform var(--scplat-speed);
}

.scplat-switch__input:checked {
	background: var(--scplat-blue);
}

.scplat-switch__input:checked::after {
	transform: translateX(18px);
}

.scplat-switch__input[disabled] {
	cursor: not-allowed;
	opacity: .55;
}

/* Colour field */
.scplat-color {
	display: flex;
	align-items: center;
	gap: 10px;
}

.scplat-color__swatch {
	flex: none;
	width: 48px;
	height: 48px;
	padding: 4px;
	border: 1px solid var(--scplat-input-line);
	border-radius: 12px;
	background: var(--scplat-white);
	cursor: pointer;
}

.scplat-color__swatch::-webkit-color-swatch-wrapper { padding: 0; }
.scplat-color__swatch::-webkit-color-swatch { border: 0; border-radius: 8px; }
.scplat-color__swatch::-moz-color-swatch { border: 0; border-radius: 8px; }

.scplat-color .scplat-input {
	max-width: 140px;
	font-variant-numeric: tabular-nums;
	text-transform: uppercase;
}

/* Form */
.scplat-form {
	display: flex;
	flex-direction: column;
	gap: 18px;
	min-width: 0;
}

.scplat-form__group {
	margin-top: 8px;
	padding-top: 18px;
	border-top: 1px solid var(--scplat-hair);
	font-size: 15px;
	font-weight: 800;
}

.scplat-form__group:first-child {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.scplat-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px 16px;
}

.scplat-form__grid > .scplat-field--wide {
	grid-column: 1 / -1;
}

.scplat-form__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding-top: 4px;
}

.scplat-form__alert:empty {
	display: none;
}

/* ------------------------------------------------------------------
 * 6. Tables, tabs, segmented control, pager
 * ---------------------------------------------------------------- */

.scplat-tablewrap {
	min-width: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.scplat-table {
	width: 100%;
	border-collapse: collapse;
	border-spacing: 0;
	font-size: 14.5px;
}

.scplat-table caption {
	text-align: left;
}

.scplat-table th {
	padding: 0 12px 10px;
	color: var(--scplat-muted);
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: .08em;
	line-height: 1.4;
	text-align: left;
	text-transform: uppercase;
	white-space: nowrap;
	vertical-align: bottom;
}

.scplat-table td {
	padding: 14px 12px;
	border-top: 1px solid var(--scplat-hair);
	vertical-align: middle;
	overflow-wrap: anywhere;
	min-width: 0;
}

.scplat-table th:first-child,
.scplat-table td:first-child {
	padding-left: 0;
}

.scplat-table th:last-child,
.scplat-table td:last-child {
	padding-right: 0;
}

.scplat-card--flush .scplat-table th:first-child,
.scplat-card--flush .scplat-table td:first-child {
	padding-left: 22px;
}

.scplat-card--flush .scplat-table th:last-child,
.scplat-card--flush .scplat-table td:last-child {
	padding-right: 22px;
}

.scplat-table .scplat-cell--right { text-align: right; font-variant-numeric: tabular-nums; }
.scplat-table .scplat-cell--center { text-align: center; }

.scplat-table__row--click {
	cursor: pointer;
	transition: background var(--scplat-speed);
}

.scplat-table__row--click:hover {
	background: #FAFBFE;
}

.scplat-root .scplat-table__row--click:focus-visible {
	box-shadow: inset 0 0 0 2px var(--scplat-blue);
	background: var(--scplat-hover);
}

/* Tabs */
.scplat-tabs {
	display: flex;
	flex-direction: column;
	gap: 20px;
	min-width: 0;
}

.scplat-tabs__list {
	display: flex;
	gap: 4px;
	min-width: 0;
	padding: 0 2px;
	border-bottom: 1px solid var(--scplat-line);
	overflow-x: auto;
	scrollbar-width: none;
}

.scplat-tabs__list::-webkit-scrollbar {
	display: none;
}

.scplat-tabs__tab {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: none;
	min-height: 44px;
	padding: 10px 14px;
	border: 0;
	border-radius: 10px 10px 0 0;
	background: transparent;
	color: var(--scplat-muted);
	font-size: 14.5px;
	font-weight: 700;
	white-space: nowrap;
	transition: color var(--scplat-speed), background var(--scplat-speed);
}

.scplat-tabs__tab:hover {
	color: var(--scplat-blue);
	background: var(--scplat-hover);
}

.scplat-tabs__tab[aria-selected="true"] {
	color: var(--scplat-blue);
}

.scplat-tabs__tab[aria-selected="true"]::after {
	content: "";
	position: absolute;
	right: 10px;
	bottom: -1px;
	left: 10px;
	height: 3px;
	border-radius: 3px 3px 0 0;
	background: var(--scplat-blue);
}

.scplat-root .scplat-tabs__tab:focus-visible {
	box-shadow: inset 0 0 0 2px #0533F5;
}

.scplat-tabs__panel {
	min-width: 0;
}

.scplat-root .scplat-tabs__panel:focus-visible {
	border-radius: var(--scplat-card-r);
}

/* Segmented control */
.scplat-seg {
	display: inline-flex;
	max-width: 100%;
	padding: 3px;
	border-radius: 12px;
	background: #E9EDF6;
}

.scplat-seg__btn {
	flex: 1 1 auto;
	min-height: 38px;
	padding: 6px 14px;
	border: 0;
	border-radius: 9px;
	background: transparent;
	color: var(--scplat-nav-ink);
	font-size: 13.5px;
	font-weight: 700;
	white-space: nowrap;
	transition: background var(--scplat-speed), color var(--scplat-speed), box-shadow var(--scplat-speed);
}

.scplat-seg__btn:hover {
	color: var(--scplat-blue);
}

.scplat-seg__btn[aria-checked="true"] {
	background: var(--scplat-white);
	color: var(--scplat-blue);
	box-shadow: 0 1px 3px rgba(18, 24, 38, .14);
}

.scplat-root .scplat-seg__btn:focus-visible {
	box-shadow: var(--scplat-ring);
}

/* Pager */
.scplat-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
}

.scplat-pager__info {
	color: var(--scplat-muted);
	font-size: 13.5px;
	font-variant-numeric: tabular-nums;
}

.scplat-pager__nav {
	display: flex;
	align-items: center;
	gap: 8px;
}

.scplat-pager__nav > .scplat-btn {
	flex: none;
	white-space: nowrap;
}

/* ------------------------------------------------------------------
 * 7. States
 * ---------------------------------------------------------------- */

.scplat-load {
	min-width: 0;
}

.scplat-skel {
	display: flex;
	flex-direction: column;
	gap: 16px;
	animation: scplat-fade .25s ease-out .12s both;
}

.scplat-skel__bar,
.scplat-skel__block {
	display: block;
	border-radius: 8px;
	background: linear-gradient(90deg, #E9EDF5 25%, #F4F6FB 37%, #E9EDF5 63%);
	background-size: 400% 100%;
	animation: scplat-shimmer 1.4s ease infinite;
}

.scplat-skel__bar {
	height: 12px;
}

.scplat-skel__bar--title { width: 220px; max-width: 60%; height: 26px; border-radius: 10px; }
.scplat-skel__bar--sub { width: 320px; max-width: 80%; }
.scplat-skel__bar--w30 { width: 30%; }
.scplat-skel__bar--w45 { width: 45%; }
.scplat-skel__bar--w60 { width: 60%; }
.scplat-skel__bar--w80 { width: 80%; }
.scplat-skel__bar--value { width: 90px; height: 28px; border-radius: 10px; }
.scplat-skel__block { width: 40px; height: 40px; border-radius: 12px; flex: none; }
.scplat-skel__block--chart { width: 100%; height: 220px; border-radius: 14px; }
.scplat-skel__block--hero { width: 100%; height: 190px; border-radius: 24px; }

.scplat-skel__card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px;
	border: 1px solid var(--scplat-line);
	border-radius: var(--scplat-card-r);
	background: var(--scplat-white);
}

.scplat-skel__line {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 6px 0;
}

.scplat-skel__line > .scplat-skel__lines {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.scplat-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	max-width: 440px;
	margin: 0 auto;
	padding: 28px 12px;
	text-align: center;
}

.scplat-empty__icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin-bottom: 8px;
	border-radius: 18px;
	background: var(--scplat-sky);
	color: var(--scplat-blue);
}

.scplat-empty__icon .scplat-icon {
	width: 26px;
	height: 26px;
}

.scplat-empty__title {
	font-size: 16.5px;
	font-weight: 800;
}

.scplat-empty__text {
	color: var(--scplat-muted);
	font-size: 14px;
	overflow-wrap: anywhere;
}

.scplat-empty__action {
	margin-top: 12px;
}

.scplat-empty--quiet {
	padding: 18px 12px;
}

.scplat-notice {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	border-radius: var(--scplat-r);
	background: var(--scplat-hover);
	color: var(--scplat-navy);
	font-size: 14px;
}

.scplat-notice > .scplat-icon {
	margin-top: 1px;
	color: var(--scplat-blue);
}

.scplat-notice__text {
	flex: 1 1 auto;
	min-width: 0;
	overflow-wrap: anywhere;
}

.scplat-notice__title {
	display: block;
	font-weight: 700;
}

.scplat-notice__action {
	flex: none;
	align-self: center;
}

.scplat-notice--ok { background: var(--scplat-ok-bg); }
.scplat-notice--ok > .scplat-icon { color: var(--scplat-ok); }
.scplat-notice--warn { background: var(--scplat-warn-bg); }
.scplat-notice--warn > .scplat-icon { color: var(--scplat-warn); }
.scplat-notice--bad { background: var(--scplat-bad-bg); color: #7A1C14; }
.scplat-notice--bad > .scplat-icon { color: var(--scplat-bad); }

.scplat-errorcard {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 16px;
	padding: 18px 20px;
	border: 1px solid #F7D0CC;
	border-radius: var(--scplat-card-r);
	background: var(--scplat-white);
	box-shadow: var(--scplat-shadow);
}

.scplat-errorcard__text {
	flex: 1 1 220px;
	min-width: 0;
}

.scplat-errorcard__title {
	display: block;
	color: var(--scplat-navy);
	font-family: var(--scplat-font-head);
	font-size: 15.5px;
	font-weight: 800;
}

.scplat-errorcard__msg {
	display: block;
	margin-top: 2px;
	color: var(--scplat-muted);
	font-size: 14px;
	overflow-wrap: anywhere;
}

/* Locked (Pro) panel */
.scplat-locked {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	overflow: hidden;
}

.scplat-locked::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 4px;
	background: linear-gradient(135deg, #0533F5, #7B2FF7);
}

.scplat-locked__title {
	font-size: 19px;
	font-weight: 800;
	letter-spacing: -.01em;
}

.scplat-locked__text {
	max-width: 620px;
	color: var(--scplat-ink);
	overflow-wrap: anywhere;
}

.scplat-locked__price {
	color: var(--scplat-muted);
	font-size: 14px;
}

.scplat-locked__price b {
	color: var(--scplat-navy);
	font-weight: 700;
}

.scplat-locked__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 6px;
}

/* ------------------------------------------------------------------
 * 8. Overlays
 * ---------------------------------------------------------------- */

.scplat-root--lock {
	overflow: hidden;
}

.scplat-dialogwrap {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: grid;
	place-items: center;
	padding: 20px;
	padding-top: calc(20px + var(--scplat-safe-t));
	padding-bottom: calc(20px + var(--scplat-safe-b));
	background: rgba(11, 16, 32, .5);
	overflow-y: auto;
	overscroll-behavior: contain;
	animation: scplat-fade var(--scplat-speed) ease-out both;
}

.scplat-dialog {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 480px;
	max-height: 100%;
	border-radius: var(--scplat-r-lg);
	background: var(--scplat-white);
	box-shadow: var(--scplat-shadow-lg);
	animation: scplat-pop .18s ease-out both;
}

.scplat-dialog--wide {
	max-width: 640px;
}

.scplat-dialog__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: 20px 14px 0 24px;
}

.scplat-dialog__title {
	padding-top: 8px;
	font-size: 19px;
	font-weight: 800;
	letter-spacing: -.01em;
}

.scplat-root .scplat-dialog__title:focus {
	box-shadow: none;
}

.scplat-dialog__body {
	min-height: 0;
	padding: 10px 24px 4px;
	overflow-y: auto;
	color: var(--scplat-ink);
	overflow-wrap: anywhere;
}

.scplat-dialog__body > * + * {
	margin-top: 12px;
}

.scplat-dialog__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: 10px;
	padding: 18px 24px 22px;
}

.scplat-toasts {
	position: fixed;
	z-index: 300;
	right: 0;
	bottom: calc(24px + var(--scplat-safe-b));
	left: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 0 16px;
	pointer-events: none;
}

.scplat-toast {
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: min(440px, 100%);
	padding: 12px 14px 12px 16px;
	border-radius: 14px;
	background: var(--scplat-navy);
	color: var(--scplat-white);
	font-size: 14px;
	font-weight: 600;
	box-shadow: var(--scplat-shadow-lg);
	pointer-events: auto;
	overflow-wrap: anywhere;
	animation: scplat-toast-in .2s ease-out both;
}

.scplat-toast > .scplat-icon {
	color: #7BE0B2;
}

.scplat-toast--bad > .scplat-icon { color: #FFB4AB; }
.scplat-toast--info > .scplat-icon { color: #A9BCFF; }

.scplat-toast__text {
	flex: 1 1 auto;
	min-width: 0;
}

.scplat-toast__close {
	display: grid;
	place-items: center;
	flex: none;
	width: 32px;
	height: 32px;
	margin: -4px -4px -4px 0;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--scplat-on-dark);
}

.scplat-toast__close:hover {
	background: rgba(255, 255, 255, .12);
	color: var(--scplat-white);
}

.scplat-root .scplat-toast__close:focus-visible {
	box-shadow: var(--scplat-ring-dark);
}

.scplat-toast--out {
	animation: scplat-toast-out .18s ease-in both;
}

/* ------------------------------------------------------------------
 * 9. Charts
 * ---------------------------------------------------------------- */

.scplat-chart {
	position: relative;
	min-width: 0;
}

.scplat-chart__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 18px;
	margin-bottom: 12px;
}

.scplat-chart__key {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: var(--scplat-nav-ink);
	font-size: 13px;
	font-weight: 600;
}

.scplat-chart__dot {
	flex: none;
	width: 10px;
	height: 10px;
}

.scplat-chart__total {
	color: var(--scplat-muted);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.scplat-chart__plot {
	position: relative;
	border-radius: 12px;
	touch-action: pan-y;
}

.scplat-chart__svg {
	width: 100%;
	height: auto;
	overflow: visible;
}

.scplat-chart__grid {
	stroke: var(--scplat-hair);
	stroke-width: 1;
}

.scplat-chart__axis {
	fill: var(--scplat-muted);
	font-family: var(--scplat-font-body);
	font-size: 11.5px;
	font-variant-numeric: tabular-nums;
}

.scplat-chart__line {
	fill: none;
	stroke-width: 2.25;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.scplat-chart__guide {
	stroke: #B9C1D1;
	stroke-width: 1;
	stroke-dasharray: 3 3;
}

.scplat-chart__point {
	stroke: var(--scplat-white);
	stroke-width: 2;
}

.scplat-chart__note {
	fill: var(--scplat-muted);
	font-family: var(--scplat-font-body);
	font-size: 13px;
	font-weight: 600;
}

.scplat-chart__tip {
	position: absolute;
	z-index: 2;
	top: 0;
	left: 0;
	min-width: 132px;
	max-width: 220px;
	padding: 9px 12px;
	border-radius: 12px;
	background: var(--scplat-navy);
	color: var(--scplat-white);
	font-size: 12.5px;
	line-height: 1.45;
	box-shadow: var(--scplat-shadow-lg);
	pointer-events: none;
}

.scplat-chart__tipdate {
	display: block;
	margin-bottom: 3px;
	color: var(--scplat-on-dark);
	font-weight: 600;
}

.scplat-chart__tiprow {
	display: flex;
	align-items: center;
	gap: 7px;
}

.scplat-chart__tiprow b {
	margin-left: auto;
	padding-left: 10px;
	font-variant-numeric: tabular-nums;
}

.scplat-chart__tiprow .scplat-chart__dot {
	width: 8px;
	height: 8px;
}

/* Horizontal bars */
.scplat-bars {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.scplat-bars__row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 5px 12px;
	align-items: baseline;
}

.scplat-bars__label {
	min-width: 0;
	color: var(--scplat-ink);
	font-size: 14px;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.scplat-bars__value {
	color: var(--scplat-navy);
	font-size: 14px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.scplat-bars__value small {
	margin-left: 6px;
	color: var(--scplat-muted);
	font-size: 12px;
	font-weight: 500;
}

.scplat-bars__track {
	grid-column: 1 / -1;
	width: 100%;
	height: 8px;
	border-radius: 4px;
	overflow: hidden;
}

.scplat-bars__bg { fill: var(--scplat-grey-bg); }
.scplat-bars__fill {
	fill: none;
	stroke-width: 8;
	stroke-linecap: round;
	vector-effect: non-scaling-stroke;
}

/* Hours strip */
.scplat-hours__svg {
	width: 100%;
	height: auto;
	overflow: visible;
}

.scplat-hours__track { fill: var(--scplat-soft); }
.scplat-hours__bar { fill: var(--scplat-blue); }
.scplat-hours__bar--peak { fill: var(--scplat-purple); }

/* ------------------------------------------------------------------
 * 10. Core screens
 * ---------------------------------------------------------------- */

.scplat-hero {
	position: relative;
	overflow: hidden;
	padding: 28px 30px;
	border-radius: 24px;
	background: radial-gradient(120% 150% at 100% 0, #2A55FF 0, var(--scplat-blue) 18%, var(--scplat-navy) 62%, var(--scplat-night) 100%);
	color: var(--scplat-white);
	box-shadow: 0 24px 50px -28px rgba(5, 51, 245, .65);
}

.scplat-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, .14) 1px, transparent 1.3px);
	background-size: 15px 15px;
	-webkit-mask-image: linear-gradient(to left, #000, transparent 62%);
	mask-image: linear-gradient(to left, #000, transparent 62%);
	pointer-events: none;
}

.scplat-hero > * {
	position: relative;
}

.scplat-hero__kicker {
	color: #A9BCFF;
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.scplat-root .scplat-hero__title {
	margin-top: 6px;
	color: var(--scplat-white);
	font-size: 30px;
	font-weight: 800;
	letter-spacing: -.015em;
	line-height: 1.15;
}

.scplat-hero__text {
	max-width: 560px;
	margin-top: 8px;
	color: var(--scplat-on-dark);
	font-size: 15px;
}

.scplat-hero__plans {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 20px;
}

.scplat-planpill {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	max-width: 100%;
	padding: 6px 14px 6px 12px;
	border-radius: var(--scplat-pill);
	background: rgba(255, 255, 255, .12);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22);
	color: var(--scplat-white) !important;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.3;
	transition: background var(--scplat-speed);
}

/* The pill looks 36px high; this invisible layer makes the touch target 44px. */
.scplat-planpill::before {
	content: "";
	position: absolute;
	inset: -4px 0;
}

.scplat-planpill:hover {
	background: rgba(255, 255, 255, .2);
}

.scplat-root .scplat-planpill:focus-visible {
	border-radius: var(--scplat-pill);
	box-shadow: var(--scplat-ring-dark);
}

.scplat-planpill__dot {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .45);
}

.scplat-planpill--on .scplat-planpill__dot { background: #4ADE9A; box-shadow: 0 0 0 3px rgba(74, 222, 154, .22); }
.scplat-planpill--trial .scplat-planpill__dot { background: var(--scplat-gold); box-shadow: 0 0 0 3px rgba(255, 200, 61, .22); }
.scplat-planpill--ended .scplat-planpill__dot { background: #FF9A8F; }

.scplat-planpill__state {
	color: var(--scplat-on-dark);
	font-weight: 600;
}

.scplat-sectionhead {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 16px;
}

.scplat-sectionhead__note {
	margin: 0;
}

/* Plan cards on Plans and billing */
.scplat-plans {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 18px;
	align-items: stretch;
}

.scplat-plan {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.scplat-plan__head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.scplat-plan__heading {
	flex: 1 1 auto;
	min-width: 0;
}

.scplat-plan__name {
	font-size: 17px;
	font-weight: 800;
	letter-spacing: -.005em;
}

.scplat-plan__pill {
	margin-top: 6px;
}

.scplat-plan__desc {
	color: var(--scplat-muted);
	font-size: 14px;
}

.scplat-plan__state {
	padding: 12px 14px;
	border-radius: var(--scplat-r);
	background: var(--scplat-soft);
	font-size: 14px;
}

.scplat-plan__state b {
	display: block;
	color: var(--scplat-navy);
	font-weight: 700;
}

.scplat-plan__state span {
	display: block;
	color: var(--scplat-muted);
	font-size: 13px;
}

.scplat-plan__prices {
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 14px;
	color: var(--scplat-muted);
}

.scplat-plan__prices b {
	color: var(--scplat-navy);
	font-family: var(--scplat-font-head);
	font-size: 17px;
	font-weight: 800;
}

.scplat-plan__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: auto;
	padding-top: 4px;
}

/*
 * 44px touch target. The negative margins keep the card close to how it looked with a plain
 * text link; the top one stops at the button above, so the two targets never overlap.
 */
.scplat-plan__more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: center;
	min-height: 44px;
	margin: -8px 0 -12px;
	padding: 0 12px;
	font-size: 13.5px;
}

/* History */
.scplat-history__when {
	color: var(--scplat-muted);
	font-size: 13px;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* Account */
.scplat-profile {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
}

.scplat-profile__text {
	flex: 1 1 auto;
	min-width: 0;
}

.scplat-profile__name {
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -.01em;
}

.scplat-profile__mail {
	color: var(--scplat-muted);
	overflow-wrap: anywhere;
}

.scplat-steps {
	display: flex;
	flex-direction: column;
	gap: 10px;
	counter-reset: scplat-step;
}

.scplat-steps li {
	position: relative;
	min-height: 26px;
	padding-left: 38px;
	counter-increment: scplat-step;
	font-size: 14.5px;
}

.scplat-steps li::before {
	content: counter(scplat-step);
	position: absolute;
	top: -1px;
	left: 0;
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: var(--scplat-sky);
	color: var(--scplat-blue);
	font-size: 12.5px;
	font-weight: 800;
}

.scplat-version {
	color: var(--scplat-muted);
	font-size: 12.5px;
	text-align: center;
}

/* Gates: sign in, not available, session expired, start-up error */
.scplat-gate {
	display: grid;
	place-items: center;
	min-height: 100vh;
	min-height: 100dvh;
	padding: calc(24px + var(--scplat-safe-t)) 16px calc(24px + var(--scplat-safe-b));
	background: radial-gradient(120% 120% at 100% 0, #2A55FF 0, var(--scplat-blue) 14%, var(--scplat-navy) 58%, var(--scplat-night) 100%);
}

.scplat-gate__card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 100%;
	max-width: 420px;
	padding: 34px 28px 28px;
	border-radius: 24px;
	background: var(--scplat-white);
	box-shadow: var(--scplat-shadow-lg);
	text-align: center;
	animation: scplat-pop .2s ease-out both;
}

.scplat-gate__logo {
	display: grid;
	place-items: center;
	width: 58px;
	height: 58px;
	margin-bottom: 10px;
	border-radius: 19px;
	background: linear-gradient(135deg, var(--scplat-blue), var(--scplat-navy));
	color: var(--scplat-white);
	box-shadow: 0 14px 26px -12px rgba(5, 51, 245, .7);
}

.scplat-gate__logo .scplat-icon {
	width: 30px;
	height: 30px;
}

.scplat-gate__logo--calm {
	background: var(--scplat-sky);
	color: var(--scplat-blue);
	box-shadow: none;
}

.scplat-gate__title {
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -.015em;
}

.scplat-gate__text {
	color: var(--scplat-muted);
	font-size: 15px;
	overflow-wrap: anywhere;
}

.scplat-gate__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	width: 100%;
	margin-top: 16px;
}

.scplat-gate .scplat-notice {
	width: 100%;
	margin-bottom: 6px;
	text-align: left;
}

/* ------------------------------------------------------------------
 * 11. Responsive rules and reduced motion
 * ---------------------------------------------------------------- */

@keyframes scplat-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes scplat-rise {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: none; }
}

@keyframes scplat-pop {
	from { opacity: 0; transform: translateY(8px) scale(.98); }
	to { opacity: 1; transform: none; }
}

@keyframes scplat-slide-in {
	from { transform: translateX(100%); }
	to { transform: none; }
}

@keyframes scplat-sheet-up {
	from { transform: translateY(24px); opacity: 0; }
	to { transform: none; opacity: 1; }
}

@keyframes scplat-toast-in {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: none; }
}

@keyframes scplat-toast-out {
	from { opacity: 1; transform: none; }
	to { opacity: 0; transform: translateY(6px); }
}

@keyframes scplat-spin {
	to { transform: rotate(360deg); }
}

@keyframes scplat-shimmer {
	0% { background-position: 100% 50%; }
	100% { background-position: 0 50%; }
}

@media (max-width: 1180px) {
	.scplat-plans {
		grid-template-columns: minmax(0, 1fr);
	}

	.scplat-plan__actions {
		flex-direction: row;
		flex-wrap: wrap;
	}

	.scplat-plan__actions .scplat-btn--block {
		flex: 1 1 200px;
		width: auto;
	}

	.scplat-plan__more {
		flex: 1 1 100%;
		text-align: center;
	}
}

@media (max-width: 1023.98px) {
	.scplat-sidebar {
		display: none;
	}

	.scplat-main {
		margin-left: 0;
	}

	.scplat-topbar {
		position: sticky;
		z-index: 40;
		top: 0;
		display: flex;
		align-items: center;
		gap: 10px;
		min-height: calc(var(--scplat-topbar) + var(--scplat-safe-t));
		padding: var(--scplat-safe-t) calc(8px + var(--scplat-safe-r)) 0 calc(14px + var(--scplat-safe-l));
		border-bottom: 1px solid var(--scplat-line);
		background: rgba(255, 255, 255, .92);
		-webkit-backdrop-filter: saturate(180%) blur(12px);
		backdrop-filter: saturate(180%) blur(12px);
	}

	.scplat-topbar .scplat-brand {
		flex: none;
	}

	.scplat-topbar__title {
		flex: 1 1 auto;
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		color: var(--scplat-navy);
		font-family: var(--scplat-font-head);
		font-size: 16.5px;
		font-weight: 800;
		letter-spacing: -.01em;
	}

	.scplat-tabbar {
		position: fixed;
		z-index: 40;
		right: 0;
		bottom: 0;
		left: 0;
		display: flex;
		padding: 0 calc(4px + var(--scplat-safe-r)) var(--scplat-safe-b) calc(4px + var(--scplat-safe-l));
		border-top: 1px solid var(--scplat-line);
		background: rgba(255, 255, 255, .96);
		-webkit-backdrop-filter: saturate(180%) blur(12px);
		backdrop-filter: saturate(180%) blur(12px);
	}

	.scplat-tabbar__item {
		position: relative;
		display: flex;
		flex: 1 1 0;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-width: 0;
		height: var(--scplat-tabbar);
		padding: 6px 2px;
		border: 0;
		border-radius: 12px;
		background: transparent;
		color: var(--scplat-muted) !important;
		font-size: 11px;
		font-weight: 700;
		line-height: 1.2;
		-webkit-tap-highlight-color: transparent;
	}

	.scplat-tabbar__icon {
		position: relative;
		display: grid;
		place-items: center;
		width: 48px;
		height: 28px;
		border-radius: var(--scplat-pill);
		transition: background var(--scplat-speed), color var(--scplat-speed);
	}

	.scplat-tabbar__icon .scplat-icon {
		width: 22px;
		height: 22px;
	}

	.scplat-tabbar__label {
		max-width: 100%;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.scplat-tabbar__item[aria-current="page"],
	.scplat-tabbar__item--on {
		color: var(--scplat-blue) !important;
	}

	.scplat-tabbar__item[aria-current="page"] .scplat-tabbar__icon,
	.scplat-tabbar__item--on .scplat-tabbar__icon {
		background: var(--scplat-sky);
	}

	.scplat-root .scplat-tabbar__item:focus-visible {
		border-radius: 12px;
		box-shadow: inset 0 0 0 2px #0533F5;
	}

	.scplat-tabbar__dot {
		position: absolute;
		top: 1px;
		right: 8px;
		width: 9px;
		height: 9px;
		border: 2px solid var(--scplat-white);
		border-radius: 50%;
		background: var(--scplat-blue);
		box-sizing: content-box;
	}

	.scplat-content {
		padding: 20px calc(16px + var(--scplat-safe-r)) calc(var(--scplat-tabbar) + var(--scplat-safe-b) + 32px) calc(16px + var(--scplat-safe-l));
	}

	.scplat-toasts {
		bottom: calc(var(--scplat-tabbar) + var(--scplat-safe-b) + 14px);
	}

	.scplat-grid--split {
		grid-template-columns: minmax(0, 1fr);
	}

	.scplat-grid--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 719.98px) {
	.scplat-grid--2,
	.scplat-grid--3,
	.scplat-grid--4,
	.scplat-form__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.scplat-page {
		gap: 20px;
	}

	.scplat-page__title {
		font-size: 24px;
	}

	.scplat-page__head {
		align-items: stretch;
	}

	.scplat-page__actions {
		flex: 1 1 100%;
	}

	.scplat-card {
		padding: 18px;
		border-radius: 18px;
	}

	.scplat-card--flush {
		padding: 0;
	}

	.scplat-card--flush > .scplat-card__head {
		padding: 18px 18px 0;
	}

	.scplat-kpis {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.scplat-kpi {
		padding: 14px;
		border-radius: 16px;
	}

	.scplat-kpi__value {
		font-size: 22px;
	}

	.scplat-tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.scplat-tile {
		padding: 14px;
		border-radius: 18px;
	}

	.scplat-hero {
		padding: 22px 20px;
		border-radius: 22px;
	}

	.scplat-root .scplat-hero__title {
		font-size: 25px;
	}

	.scplat-details {
		grid-template-columns: minmax(0, 1fr);
	}

	.scplat-details dt {
		padding-bottom: 0;
	}

	.scplat-details dd {
		padding-top: 2px;
		border-top: 0;
	}

	.scplat-details dt:first-of-type + dd {
		padding-top: 2px;
	}

	/* Tables become stacked cards. */
	.scplat-tablewrap {
		overflow: visible;
	}

	.scplat-table,
	.scplat-table tbody,
	.scplat-table tr,
	.scplat-table td {
		display: block;
		width: 100%;
	}

	.scplat-table thead {
		position: absolute !important;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		clip-path: inset(50%);
		white-space: nowrap;
	}

	.scplat-table tbody {
		display: flex;
		flex-direction: column;
		gap: 10px;
	}

	.scplat-table tr {
		padding: 12px 14px;
		border: 1px solid var(--scplat-line);
		border-radius: 16px;
		background: var(--scplat-white);
	}

	/* Inside a flush card the rows are already on white: hairlines instead of nested boxes. */
	.scplat-card--flush .scplat-table tbody {
		gap: 0;
		padding: 0 18px 6px;
	}

	.scplat-card--flush .scplat-table tr {
		padding: 14px 0;
		border: 0;
		border-top: 1px solid var(--scplat-line);
		border-radius: 0;
		background: transparent;
	}

	.scplat-card--flush .scplat-table tr:first-child {
		border-top: 0;
	}

	.scplat-table td,
	.scplat-card--flush .scplat-table td:first-child,
	.scplat-card--flush .scplat-table td:last-child,
	.scplat-table td:first-child,
	.scplat-table td:last-child {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 14px;
		padding: 7px 0;
		border-top: 1px solid var(--scplat-hair);
		text-align: right;
	}

	.scplat-table td:first-child,
	.scplat-card--flush .scplat-table td:first-child {
		border-top: 0;
	}

	.scplat-table td::before {
		content: attr(data-label);
		flex: none;
		max-width: 45%;
		color: var(--scplat-muted);
		font-size: 11.5px;
		font-weight: 800;
		letter-spacing: .06em;
		text-align: left;
		text-transform: uppercase;
	}

	.scplat-table td[data-label=""]::before,
	.scplat-table td.scplat-cell--primary::before {
		content: none;
	}

	.scplat-table td.scplat-cell--primary {
		display: block;
		padding-bottom: 9px;
		font-weight: 700;
		text-align: left;
	}

	.scplat-table td > * {
		min-width: 0;
	}

	.scplat-pager {
		justify-content: center;
	}

	.scplat-pager > .scplat-pager__info {
		flex: 1 1 100%;
		text-align: center;
	}

	.scplat-pager__nav {
		flex: 1 1 100%;
		justify-content: space-between;
	}

	.scplat-dialogwrap {
		place-items: end center;
		padding: 12px;
		padding-bottom: calc(12px + var(--scplat-safe-b));
	}

	.scplat-dialog {
		animation-name: scplat-sheet-up;
	}

	.scplat-dialog__actions {
		flex-direction: column-reverse;
	}

	.scplat-dialog__actions .scplat-btn {
		width: 100%;
	}

	.scplat-seg {
		display: flex;
		width: 100%;
	}

	.scplat-seg__btn {
		padding: 6px 8px;
	}

	.scplat-toolbar > .scplat-field {
		max-width: none;
		flex-basis: 100%;
	}

	.scplat-toolbar__end {
		margin-left: 0;
	}

	.scplat-form__actions .scplat-btn {
		flex: 1 1 auto;
	}

	.scplat-locked__actions {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
	}

	.scplat-errorcard .scplat-btn {
		flex: 1 1 100%;
	}

	.scplat-profile {
		align-items: flex-start;
	}
}

@media (max-width: 359.98px) {
	.scplat-kpis,
	.scplat-tiles {
		grid-template-columns: minmax(0, 1fr);
	}

	.scplat-tabbar__label {
		font-size: 10px;
	}
}

@media (min-width: 720px) {
	.scplat-hide-lg { display: none !important; }

	/* Six or three tiles: balanced rows of three instead of a row of five and an orphan. */
	.scplat-kpis--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 559.98px) {
	/* On a phone the time or pill of a list row moves under its text, so titles keep the width. */
	.scplat-list__row {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		column-gap: 12px;
		row-gap: 3px;
		align-items: center;
	}

	.scplat-list__row > .scplat-chip {
		grid-row: 1 / span 2;
		align-self: start;
	}

	.scplat-list__row > .scplat-list__meta {
		grid-column: 2;
		white-space: normal;
		flex-wrap: wrap;
	}

	.scplat-list__row > .scplat-list__meta > .scplat-icon:last-child {
		display: none;
	}
}

@media (max-width: 719.98px) {
	.scplat-hide-sm { display: none !important; }
}

@media (hover: none) {
	.scplat-tile:hover,
	a.scplat-kpi:hover {
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.scplat-root *,
	.scplat-root *::before,
	.scplat-root *::after {
		animation-duration: .001ms !important;
		animation-delay: 0s !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}

	.scplat-skel__bar,
	.scplat-skel__block {
		animation: none !important;
		background: #E9EDF5;
	}

	.scplat-spinner {
		animation-duration: 1.4s !important;
		animation-iteration-count: infinite !important;
	}

	.scplat-tile:hover,
	a.scplat-kpi:hover,
	.scplat-btn:active {
		transform: none;
	}
}

@media (forced-colors: active) {
	.scplat-root :focus-visible {
		outline: 2px solid Highlight;
	}

	.scplat-nav__item[aria-current="page"],
	.scplat-seg__btn[aria-checked="true"],
	.scplat-tabs__tab[aria-selected="true"] {
		outline: 2px solid Highlight;
		outline-offset: -2px;
	}
}

@media print {
	.scplat-sidebar,
	.scplat-topbar,
	.scplat-tabbar,
	.scplat-layer,
	.scplat-skip {
		display: none !important;
	}

	.scplat-main {
		margin: 0;
	}
}

/* ------------------------------------------------------------------
 * Fix review: focus never hidden under the fixed bars, 44px touch targets,
 * people's names isolated from the app's own wording.
 * ---------------------------------------------------------------- */

/* Data from the public (names, labels) is shown in its own bidi run, so a right-to-left name
   cannot reorder the app's text next to it. Bidi override characters are removed in app-core.js. */
.scplat-root .scplat-list__title,
.scplat-root .scplat-list__detail,
.scplat-root .scplat-topbar__title,
.scplat-root .scplat-page__title,
.scplat-root .scplat-table td .scplat-wrap,
.scplat-root .scplat-user__name,
.scplat-root .scplat-user__mail {
	unicode-bidi: isolate;
}

@media (max-width: 1023.98px) {
	/* The top bar and the tab bar are fixed: keyboard focus scrolls into the space between them
	   (WCAG 2.4.11). Pixel values, because the bar tokens live on .scplat-root, not on html. */
	html {
		scroll-padding-top: calc(56px + env(safe-area-inset-top, 0px) + 8px);
		scroll-padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px) + 12px);
	}

	/* SPEC 5.4: minimum touch target 44px. */
	.scplat-root .scplat-btn--sm,
	.scplat-root .scplat-back,
	.scplat-root .scplat-seg__btn {
		min-height: 44px;
	}

	.scplat-root .scplat-btn--sm::after {
		inset: 0;
	}
}
