/*
 * DE Dashboard v2.
 * Brand tokens (--brand-*, --font-*) are printed in <head> by functions.php; every
 * other color here is derived from them with color-mix(), so a new client only
 * changes the tokens. Values below are fallbacks.
 */

:root {
	--brand-header: #27272a;
	--brand-accent: #cdab2b;
	--brand-surface: #f1f1f1;
	--brand-text: #27272a;
	--brand-on-header: #ffffff;
	--brand-on-accent: #1d1d1f;
	--brand-accent-ink: #7a6519;
	--brand-accent-on-head: #cdab2b;
	--font-heading: Georgia, serif;
	--font-body: system-ui, sans-serif;

	/* Light side */
	--ink: var(--brand-text);
	--paper: var(--brand-surface);
	--sheet: color-mix(in oklab, var(--brand-surface) 18%, #fff);
	--muted: color-mix(in oklab, var(--brand-text) 74%, #fff);
	--rule: color-mix(in oklab, var(--brand-text) 11%, transparent);
	--rule-strong: color-mix(in oklab, var(--brand-text) 22%, transparent);
	--wash: color-mix(in oklab, var(--brand-text) 5%, transparent);

	/* Dark side (the brand header color) */
	--head: var(--brand-header);
	--on-head: var(--brand-on-header);
	--on-head-muted: color-mix(in oklab, var(--brand-on-header) 72%, var(--brand-header));
	--head-rule: color-mix(in oklab, var(--brand-on-header) 14%, var(--brand-header));
	--head-raise: color-mix(in oklab, var(--brand-on-header) 8%, var(--brand-header));

	/* Accent: fills and marks only; --gold-ink is the text-safe version on light */
	--gold: var(--brand-accent);
	--gold-ink: var(--brand-accent-ink);
	--gold-head: var(--brand-accent-on-head);
	--gold-soft: color-mix(in oklab, var(--brand-accent) 16%, #fff);

	/* Status */
	--good: #2d7a4f;
	--bad: #b3321f;
	--good-on-head: #8fdcae;
	--bad-on-head: #ffab98;
	--bad-soft: color-mix(in oklab, var(--bad) 10%, #fff);

	/* Chart roles */
	--c-ink: var(--brand-text);
	--c-muted: var(--muted);
	--c-grid: color-mix(in oklab, var(--brand-text) 9%, #fff);
	--c-calls: var(--brand-header);
	--c-missed: color-mix(in oklab, var(--bad) 62%, #fff);
	--c-forms: var(--brand-accent);
	--c-chats: color-mix(in oklab, var(--brand-header) 32%, #fff);
	--c-texts: color-mix(in oklab, var(--brand-accent) 42%, #fff);
	--c-line: var(--brand-header);
	--c-line2: color-mix(in oklab, var(--brand-text) 50%, #fff);
	--c-fill: color-mix(in oklab, var(--brand-header) 7%, transparent);

	/* Type scale (Bringhurst-ish, 15px body) */
	--t-12: 0.75rem;
	--t-13: 0.8125rem;
	--t-14: 0.875rem;
	--t-15: 0.9375rem;
	--t-18: 1.125rem;
	--t-22: 1.375rem;
	--t-28: 1.75rem;
	--t-lead: clamp(1.75rem, 1.05rem + 2.3vw, 3.1rem);

	--focus: var(--brand-text);
	--r-l: 22px;
	--r-m: 14px;
	--r-s: 8px;
	--gutter: clamp(1rem, 3.2vw, 2.75rem);
	--max: 1320px;
	--ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

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

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font: 400 var(--t-15) / 1.6 var(--font-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

body.is-login,
body.is-app {
	background: var(--head);
}

img,
svg {
	display: block;
	max-width: 100%;
}

button,
input {
	font: inherit;
	color: inherit;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd,
figure {
	margin: 0;
}

ol,
ul {
	padding: 0;
	list-style: none;
}

a {
	color: inherit;
}

:focus-visible {
	outline: 2px solid var(--focus);
	outline-offset: 3px;
	border-radius: 4px;
}

[tabindex="-1"]:focus {
	outline: none;
}

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

.ico {
	width: 20px;
	height: 20px;
	flex: none;
}

.ico--s {
	width: 16px;
	height: 16px;
}

.ico--l {
	width: 28px;
	height: 28px;
}

.ico-wrap {
	display: inline-flex;
}

.skip {
	position: absolute;
	left: 12px;
	top: -60px;
	z-index: 50;
	padding: 10px 16px;
	background: var(--gold);
	color: var(--brand-on-accent);
	border-radius: var(--r-s);
	font-weight: 600;
	text-decoration: none;
}

.skip:focus {
	top: 12px;
}

/* Dark contexts get a gold focus ring (gold on the header color is high contrast). */
.rail,
.topbar,
.band,
.tabbar,
.panel--ink,
.gate,
.solo {
	--focus: var(--gold-head);
}

/* ================================================================ */
/* Shell                                                            */
/* ================================================================ */

.shell {
	display: grid;
	grid-template-columns: 248px minmax(0, 1fr);
	min-height: 100vh;
	min-height: 100dvh;
}

.rail {
	position: sticky;
	top: 0;
	height: 100vh;
	height: 100dvh;
	display: flex;
	flex-direction: column;
	background: var(--head);
	color: var(--on-head);
	padding: 28px 18px 22px;
	z-index: 5;
}

.rail__brand {
	display: block;
	padding: 0 10px 30px;
	text-decoration: none;
}

.rail__brand img {
	width: 124px;
	height: auto;
}

.rail__name {
	font: 500 var(--t-22) / 1.2 var(--font-heading);
}

.rail__nav {
	position: relative;
	display: grid;
	gap: 4px;
}

.rail__marker {
	position: absolute;
	left: 0;
	top: 0;
	width: 100%;
	height: 44px;
	border-radius: 12px;
	background: var(--head-raise);
	transform: translateY(calc(var(--tab, 0) * 48px));
	transition: transform 0.45s var(--ease);
	opacity: 0;
}

.shell.is-ready .rail__marker {
	opacity: 1;
}

.rail__marker::before {
	content: "";
	position: absolute;
	left: 0;
	top: 11px;
	bottom: 11px;
	width: 3px;
	border-radius: 0 3px 3px 0;
	background: var(--gold);
}

.rail__link {
	position: relative;
	display: flex;
	align-items: center;
	gap: 14px;
	height: 44px;
	padding: 0 14px;
	border-radius: 12px;
	color: var(--on-head-muted);
	text-decoration: none;
	font-weight: 500;
	font-size: var(--t-15);
	transition: color 0.2s;
}

.rail__link:hover,
.rail__link[aria-current="page"] {
	color: var(--on-head);
}

.rail__link[aria-current="page"] .ico {
	color: var(--gold-head);
}

.rail__foot {
	margin-top: auto;
	padding: 18px 10px 0;
	border-top: 1px solid var(--head-rule);
}

.rail__user {
	font-size: var(--t-14);
	font-weight: 600;
	line-height: 1.35;
	overflow-wrap: anywhere;
}

.rail__user span {
	display: block;
	font-size: var(--t-12);
	font-weight: 400;
	color: var(--on-head-muted);
}

.rail__signout {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 12px;
	padding: 6px 0;
	background: none;
	border: 0;
	color: var(--on-head-muted);
	font-size: var(--t-13);
	font-weight: 500;
	cursor: pointer;
}

.rail__signout:hover {
	color: var(--on-head);
}

.rail__signout .ico {
	width: 18px;
	height: 18px;
}

.stage {
	min-width: 0;
	display: flex;
	flex-direction: column;
	background: var(--head);
}

.topbar {
	display: flex;
	align-items: flex-end;
	gap: 16px 24px;
	flex-wrap: wrap;
	padding: 30px var(--gutter) 0;
	max-width: calc(var(--max) + 2 * var(--gutter));
	width: 100%;
	color: var(--on-head);
}

.topbar__brand {
	display: none;
}

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

.topbar__hello {
	font-size: var(--t-13);
	color: var(--on-head-muted);
	margin-bottom: 2px;
}

.topbar__title {
	font: 500 var(--t-28) / 1.15 var(--font-heading);
	letter-spacing: -0.005em;
}

.topbar__tools {
	display: flex;
	align-items: center;
	gap: 18px;
	flex-wrap: wrap;
}

.topbar__through {
	font-size: var(--t-13);
	color: var(--on-head-muted);
	cursor: help;
}

.topbar__signout {
	display: none;
	width: 40px;
	height: 40px;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid var(--head-rule);
	background: none;
	color: var(--on-head);
	cursor: pointer;
}

.main {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: var(--head);
}

.main:focus {
	outline: none;
}

.tabbar {
	display: none;
}

/* ================================================================ */
/* View: band + content                                             */
/* ================================================================ */

.view {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: var(--head);
}

.band {
	color: var(--on-head);
}

.band__inner {
	max-width: calc(var(--max) + 2 * var(--gutter));
	padding: 26px var(--gutter) 64px;
}

.lead {
	font: 400 var(--t-lead) / 1.1 var(--font-heading);
	letter-spacing: -0.012em;
	max-width: 24ch;
	text-wrap: balance;
}

.sub {
	margin-top: 14px;
	max-width: 64ch;
	color: var(--on-head-muted);
	font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
	line-height: 1.6;
	text-wrap: pretty;
}

.band__meta {
	margin-top: 14px;
	font-size: var(--t-13);
	color: var(--on-head-muted);
}

.band__split {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 32px 48px;
	flex-wrap: wrap;
}

.band__split > div:first-child {
	flex: 1 1 420px;
}

.band__rings {
	display: flex;
	gap: 36px;
}

/* Ledger: the row of headline numbers, separated by hairlines rather than boxed. */
.ledger {
	display: grid;
	grid-template-columns: minmax(220px, 1.35fr) repeat(3, minmax(0, 1fr));
	margin-top: 40px;
	border-top: 1px solid var(--head-rule);
}

.ledger__item {
	padding: 18px 22px 4px;
	border-left: 1px solid var(--head-rule);
	min-width: 0;
}

.ledger__item--lead {
	padding-left: 0;
	border-left: 0;
	padding-right: 32px;
}

.ledger--5 .ledger__item--lead,
.ledger--6 .ledger__item--lead,
.ledger--7 .ledger__item--lead {
	grid-row: span 2;
}

/* Second-row items get a rule above so rows read as a table. */
.ledger--5 .ledger__item:nth-child(n + 5),
.ledger--6 .ledger__item:nth-child(n + 5),
.ledger--7 .ledger__item:nth-child(n + 5) {
	border-top: 1px solid var(--head-rule);
	margin-top: 14px;
}

.ledger__label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: var(--t-13);
	font-weight: 500;
	color: var(--on-head-muted);
	line-height: 1.3;
	min-height: 2.1em;
}

.ledger__value {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin-top: 4px;
}

.ledger__num {
	font: 500 2rem / 1.05 var(--font-heading);
	font-variant-numeric: lining-nums tabular-nums;
	letter-spacing: -0.01em;
	color: var(--on-head);
}

.ledger__item--lead .ledger__num {
	font-size: clamp(3rem, 2.2rem + 2.2vw, 4.25rem);
	line-height: 1;
}

.ledger__aside {
	font-size: var(--t-13);
	color: var(--on-head-muted);
}

.ledger__spark {
	margin-top: 14px;
}

.spark {
	overflow: visible;
}

.spark__line {
	fill: none;
	stroke: var(--gold-head);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
	animation: draw 1.4s 0.35s var(--ease) forwards;
}

.spark__dot {
	fill: var(--gold-head);
	opacity: 0;
	animation: pop 0.4s 1.5s var(--ease) forwards;
}

.num {
	font-variant-numeric: lining-nums tabular-nums;
}

/* Delta chips (they sit on the dark band) */
.delta {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font: 600 var(--t-13) / 1 var(--font-body);
	white-space: nowrap;
	cursor: help;
}

.delta--good {
	color: var(--good-on-head);
}

.delta--bad {
	color: var(--bad-on-head);
}

.delta--flat {
	color: var(--on-head-muted);
}

/* Content: the paper sheet that tucks under the band with a rounded corner. */
.content {
	flex: 1;
	background: var(--paper);
	border-top-left-radius: 34px;
	padding: 36px 0 24px;
	transition: opacity 0.25s;
}

.content.is-refreshing {
	opacity: 0.55;
	pointer-events: none;
}

.grid {
	display: grid;
	align-items: start;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 26px;
	max-width: calc(var(--max) + 2 * var(--gutter));
	padding: 0 var(--gutter);
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: 1 / -1; }

.foot {
	background: var(--paper);
	padding: 8px var(--gutter) 40px;
	max-width: none;
	color: var(--muted);
	font-size: var(--t-12);
	display: grid;
	gap: 2px;
}

.foot p {
	max-width: var(--max);
}

/* ================================================================ */
/* Panels: three tones by weight                                    */
/* ================================================================ */

.panel {
	min-width: 0;
	position: relative;
}

.panel--sheet {
	background: var(--sheet);
	border-radius: var(--r-l);
	padding: 24px 26px 22px;
	box-shadow: 0 0 0 1px var(--rule);
}

.panel--plain {
	padding: 18px 2px 4px;
	border-top: 2px solid var(--ink);
}

.panel--ink {
	background: var(--head);
	color: var(--on-head);
	border-radius: var(--r-l);
	padding: 24px 26px 24px;
}

.panel__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px 20px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.panel__titles {
	min-width: 0;
}

.panel__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font: 500 1.3rem / 1.25 var(--font-heading);
	letter-spacing: -0.005em;
}

.panel__note {
	margin-top: 3px;
	font-size: var(--t-13);
	color: var(--muted);
	line-height: 1.45;
}

.panel--ink .panel__note {
	color: var(--on-head-muted);
}

.panel__source {
	margin-top: 14px;
	font-size: var(--t-12);
	color: var(--muted);
}

.muted-note {
	color: var(--muted);
	font-size: var(--t-14);
}

.text-link {
	display: inline-block;
	margin-top: 16px;
	font-weight: 600;
	font-size: var(--t-14);
	text-decoration: underline;
	text-decoration-color: var(--gold);
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

.text-link:hover {
	text-decoration-color: currentColor;
}

/* Info tip */
.tip {
	position: relative;
	display: inline-flex;
	vertical-align: middle;
}

.tip__btn {
	display: inline-flex;
	padding: 2px;
	border: 0;
	background: none;
	color: inherit;
	opacity: 0.6;
	cursor: help;
	border-radius: 50%;
}

.tip__btn:hover,
.tip__btn[aria-expanded="true"] {
	opacity: 1;
}

.tip__bubble {
	position: absolute;
	left: 50%;
	bottom: calc(100% + 8px);
	width: max-content;
	max-width: min(260px, calc(100vw - 24px));
	padding: 10px 12px;
	border-radius: 10px;
	background: var(--sheet);
	color: var(--ink);
	box-shadow: 0 10px 30px -10px rgb(0 0 0 / 0.35), 0 0 0 1px var(--rule);
	font: 400 var(--t-13) / 1.45 var(--font-body);
	letter-spacing: 0;
	text-align: left;
	z-index: 30;
	display: none;
	transform: translateX(calc(-50% + var(--shift, 0px)));
	pointer-events: none;
}

.band .tip__bubble,
.panel--ink .tip__bubble {
	box-shadow: 0 10px 30px -8px rgb(0 0 0 / 0.5);
}

.tip__bubble.is-open {
	display: block;
	animation: tip-in 0.16s var(--ease);
}

@keyframes tip-in {
	from {
		opacity: 0;
		margin-bottom: -4px;
	}
}

.ledger__item--lead .tip__bubble,
.panel__title .tip__bubble {
	left: 0;
	transform: translateX(var(--shift, 0px));
}

/* Legend */
.legend {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 16px;
	font-size: var(--t-13);
	color: var(--muted);
	padding-top: 4px;
}

.legend li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.legend__key {
	width: 11px;
	height: 11px;
	border-radius: 3px;
	background: var(--k);
}

.legend__key--dash {
	height: 0;
	width: 16px;
	border-radius: 0;
	background: none;
	border-top: 2px dashed var(--k);
}

.legend__key--line {
	height: 2px;
	width: 16px;
	border-radius: 2px;
}

.chart {
	position: relative;
	width: 100%;
}

/* Bars */
.bars {
	display: grid;
	gap: 14px;
}

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

.bars__label {
	font-size: var(--t-14);
	font-weight: 500;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bars__sub {
	margin-left: 8px;
	font-weight: 400;
	font-size: var(--t-12);
	color: var(--muted);
}

.bars__value {
	font: 500 var(--t-15) / 1 var(--font-heading);
	font-variant-numeric: lining-nums tabular-nums;
}

.bars__share {
	display: inline-block;
	min-width: 3.2ch;
	margin-left: 10px;
	text-align: right;
	font: 500 var(--t-12) / 1 var(--font-body);
	color: var(--muted);
}

.bars__track {
	grid-column: 1 / -1;
	height: 6px;
	border-radius: 6px;
	background: var(--wash);
	overflow: hidden;
}

.bars__fill {
	display: block;
	height: 100%;
	width: 0;
	border-radius: inherit;
	background: var(--head);
	transition: width 0.9s var(--ease);
	transition-delay: calc(var(--i, 0) * 50ms);
}

.bars--accent .bars__fill {
	background: var(--gold);
}

.bars.is-grown .bars__fill {
	width: var(--w);
}

/* Heatmap: a gold-to-charcoal ramp */
.heat__grid {
	display: grid;
	grid-template-columns: 34px repeat(24, minmax(0, 1fr));
	gap: 3px;
	align-items: center;
}

.heat__day {
	font-size: var(--t-12);
	color: var(--muted);
	font-weight: 500;
}

.heat__cell {
	aspect-ratio: 1;
	border-radius: 3px;
	background: var(--wash);
	opacity: 0;
	transform: scale(0.6);
	transition: opacity 0.35s, transform 0.35s var(--ease);
	transition-delay: calc(var(--d) * 2.5ms);
}

.heat.is-shown .heat__cell {
	opacity: 1;
	transform: none;
}

.lv1 { background: color-mix(in oklab, var(--gold) 22%, #fff) !important; }
.lv2 { background: color-mix(in oklab, var(--gold) 55%, #fff) !important; }
.lv3 { background: var(--gold) !important; }
.lv4 { background: color-mix(in oklab, var(--gold) 45%, var(--head)) !important; }
.lv5 { background: var(--head) !important; }

.heat__tick {
	font-size: 11px;
	color: var(--muted);
	white-space: nowrap;
	overflow: visible;
	height: 16px;
	line-height: 16px;
}

.heat__caption {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 12px 24px;
	flex-wrap: wrap;
	margin-top: 18px;
	font-size: var(--t-14);
	line-height: 1.5;
}

.heat__caption > span:first-child {
	max-width: 56ch;
}

.heat__scale {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: var(--t-12);
	color: var(--muted);
}

.heat__scale i {
	width: 12px;
	height: 12px;
	border-radius: 3px;
}

.heat__scale i:first-child {
	margin-left: 4px;
}

.heat__scale i:last-child {
	margin-right: 4px;
}

/* Rings */
.ring {
	position: relative;
	display: grid;
	justify-items: center;
	gap: 10px;
}

.ring svg {
	overflow: visible;
}

.ring__track {
	stroke: var(--wash);
}

.ring--dark .ring__track {
	stroke: var(--head-rule);
}

.ring__arc {
	stroke-linecap: round;
	transition: stroke-dashoffset 1.2s var(--ease);
}

.ring--good .ring__arc { stroke: #3a9a62; }
.ring--ok .ring__arc { stroke: var(--gold); }
.ring--poor .ring__arc { stroke: #d2553c; }

.ring__score {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	display: grid;
	place-items: center;
	aspect-ratio: 1;
	font: 500 calc(var(--rs, 1) * 1.5rem) / 1 var(--font-heading);
	font-variant-numeric: lining-nums tabular-nums;
}

.band__rings .ring__score {
	font-size: 2.75rem;
}

.glance .ring__score {
	font-size: 1.35rem;
}

.minis .ring__score {
	font-size: 1.05rem;
}

.ring__label {
	display: grid;
	justify-items: center;
	text-align: center;
	line-height: 1.3;
	font-size: var(--t-13);
}

.ring__label strong {
	font-weight: 600;
	font-size: var(--t-14);
}

.ring__label span {
	color: var(--muted);
}

.ring--dark .ring__label span {
	color: var(--on-head-muted);
}

/* At a glance strip */
.glance {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	background: var(--sheet);
	border-radius: var(--r-l);
	box-shadow: 0 0 0 1px var(--rule);
	overflow: hidden;
}

.glance__item {
	position: relative;
	padding: 24px 26px;
	border-left: 1px solid var(--rule);
	text-decoration: none;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.glance__item:first-child {
	border-left: 0;
}

.glance__item--today {
	background: var(--gold-soft);
}

.glance__item--link {
	transition: background 0.2s;
}

.glance__item--link:hover {
	background: var(--wash);
}

.glance__item--link:focus-visible {
	outline-offset: -4px;
	border-radius: var(--r-l);
}

.glance__title {
	font: 500 1.15rem / 1.2 var(--font-heading);
	margin-bottom: 6px;
}

.glance__big {
	font: 500 1.75rem / 1.15 var(--font-heading);
	font-variant-numeric: lining-nums tabular-nums;
}

.glance__big > .glance__unit {
	font: 500 var(--t-14) / 1 var(--font-body);
	color: var(--muted);
	margin-left: 4px;
}

.glance__note {
	font-size: var(--t-12);
	color: var(--muted);
	margin-top: auto;
	padding-top: 8px;
}

.glance__rings {
	display: flex;
	gap: 26px;
}

.glance__more {
	margin-top: auto;
	padding-top: 12px;
	font-size: var(--t-13);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: var(--gold);
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

/* Feed */
.feed {
	display: grid;
}

/* Two columns read top to bottom, then the next column (newest first down the left). */
.feed--cols {
	display: block;
	columns: 2;
	column-gap: 40px;
}

.feed--cols .feed__item {
	break-inside: avoid;
}

.feed__item {
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr) auto;
	gap: 14px;
	align-items: center;
	padding: 11px 0;
	border-bottom: 1px solid var(--rule);
}

.feed__icon {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--sheet);
	box-shadow: 0 0 0 1px var(--rule);
}

.feed__icon .ico {
	width: 18px;
	height: 18px;
}

.feed__item--form .feed__icon {
	background: var(--gold-soft);
	box-shadow: none;
}

.feed__item.is-missed .feed__icon {
	background: var(--bad-soft);
	color: var(--bad);
	box-shadow: none;
}

.feed__body {
	display: grid;
	min-width: 0;
}

.feed__title {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
	font-size: var(--t-14);
	line-height: 1.35;
}

.feed__new {
	padding: 2px 8px;
	border-radius: 999px;
	background: var(--gold-soft);
	box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--gold) 45%, transparent);
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
}

.feed__detail {
	font-size: var(--t-13);
	color: var(--muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.feed__when {
	font-size: var(--t-12);
	color: var(--muted);
	white-space: nowrap;
}

/* Segmented control */
.seg {
	position: relative;
	display: inline-grid;
	grid-template-columns: repeat(var(--n), minmax(0, 1fr));
	padding: 4px;
	border-radius: 999px;
	background: var(--wash);
	box-shadow: inset 0 0 0 1px var(--rule);
	isolation: isolate;
}

.seg__thumb {
	position: absolute;
	top: 4px;
	bottom: 4px;
	left: 4px;
	width: calc((100% - 8px) / var(--n));
	border-radius: 999px;
	background: var(--sheet);
	box-shadow: 0 1px 3px rgb(0 0 0 / 0.12), 0 0 0 1px var(--rule);
	transform: translateX(calc(var(--i) * 100%));
	transition: transform 0.4s var(--ease);
	z-index: -1;
}

.seg__opt {
	position: relative;
	min-width: 76px;
	padding: 8px 16px;
	border: 0;
	background: none;
	border-radius: 999px;
	font-size: var(--t-13);
	font-weight: 600;
	color: var(--muted);
	cursor: pointer;
	white-space: nowrap;
	transition: color 0.25s;
}

.seg__opt[aria-checked="true"] {
	color: var(--ink);
}

.seg__short {
	display: none;
}

.seg--dark {
	background: var(--head-raise);
	box-shadow: inset 0 0 0 1px var(--head-rule);
}

.seg--dark .seg__thumb {
	background: var(--gold);
	box-shadow: none;
}

.seg--dark .seg__opt {
	color: var(--on-head-muted);
}

.seg--dark .seg__opt[aria-checked="true"] {
	color: var(--brand-on-accent);
}

.toolbar {
	display: flex;
	justify-content: flex-start;
}

/* Table */
.table-wrap {
	overflow-x: auto;
	margin: 0 -4px;
}

.table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--t-14);
}

.table th,
.table td {
	padding: 10px 4px;
	border-bottom: 1px solid var(--rule);
	text-align: left;
	vertical-align: middle;
}

.table thead th {
	font-size: var(--t-12);
	font-weight: 600;
	color: var(--muted);
	padding-top: 0;
}

.table tbody th {
	font-weight: 500;
}

.table__main {
	display: block;
}

.table__sub {
	display: block;
	font-size: var(--t-12);
	color: var(--muted);
	font-weight: 400;
}

.num-col {
	text-align: right !important;
	font: 500 var(--t-15) / 1 var(--font-heading);
	font-variant-numeric: lining-nums tabular-nums;
	white-space: nowrap;
	width: 1%;
	padding-left: 18px !important;
}

.table thead .num-col {
	font: 600 var(--t-12) / 1 var(--font-body);
}

.table__bar {
	display: block;
	height: 4px;
	width: var(--w);
	margin-top: 7px;
	border-radius: 4px;
	background: color-mix(in oklab, var(--head) 22%, transparent);
	transform-origin: left;
	animation: grow 0.9s 0.3s var(--ease) both;
}

/* Split (devices) */
.split__bar {
	display: flex;
	height: 16px;
	border-radius: 999px;
	overflow: hidden;
	background: var(--head-raise);
	gap: 3px;
}

.split__seg {
	width: 0;
	transition: width 1s var(--ease);
}

.split.is-grown .split__bar .split__seg {
	width: var(--w);
}

.split__seg--0 { background: var(--gold); }
.split__seg--1 { background: color-mix(in oklab, var(--on-head) 80%, var(--head)); }
.split__seg--2 { background: color-mix(in oklab, var(--on-head) 38%, var(--head)); }
.split__seg--3 { background: color-mix(in oklab, var(--on-head) 20%, var(--head)); }

.split__list {
	display: grid;
	margin-top: 22px;
}

.split__item {
	display: grid;
	grid-template-columns: 10px 22px minmax(0, 1fr) auto;
	grid-template-rows: auto auto;
	align-items: center;
	column-gap: 10px;
	padding: 12px 0;
	border-top: 1px solid var(--head-rule);
}

.split__key {
	width: 10px;
	height: 10px;
	border-radius: 50%;
}

.split__icon {
	color: var(--on-head-muted);
}

.split__name {
	font-weight: 600;
}

.split__pct {
	font: 500 1.6rem / 1 var(--font-heading);
	font-variant-numeric: lining-nums tabular-nums;
	grid-row: span 2;
}

.split__n {
	grid-column: 3;
	font-size: var(--t-12);
	color: var(--on-head-muted);
}

/* Vitals */
.vitals {
	display: grid;
	gap: 26px;
}

.vital__head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
}

.vital__name {
	display: inline;
	font-weight: 600;
	font-size: var(--t-15);
}

.vital__value {
	font: 500 1.6rem / 1 var(--font-heading);
	font-variant-numeric: lining-nums tabular-nums;
}

.vital__track {
	position: relative;
	display: grid;
	grid-template-columns: 40fr 30fr 30fr;
	gap: 3px;
	height: 8px;
	margin: 12px 0 8px;
}

.vital__zone {
	border-radius: 4px;
}

.vital__zone--good { background: color-mix(in oklab, #3a9a62 45%, #fff); }
.vital__zone--ok { background: color-mix(in oklab, var(--gold) 55%, #fff); }
.vital__zone--poor { background: color-mix(in oklab, #d2553c 45%, #fff); }

.vital__mark {
	position: absolute;
	top: 50%;
	width: 18px;
	height: 18px;
	margin-left: -9px;
	border-radius: 50%;
	background: var(--sheet);
	border: 4px solid var(--ink);
	transform: translateY(-50%);
	transition: left 1.1s var(--ease);
	box-shadow: 0 1px 4px rgb(0 0 0 / 0.2);
}

.vital__foot {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: var(--t-12);
	color: var(--muted);
}

.vital__verdict {
	font-weight: 600;
	font-size: var(--t-13);
}

.vital--good .vital__verdict { color: var(--good); }
.vital--ok .vital__verdict { color: var(--gold-ink); }
.vital--poor .vital__verdict { color: var(--bad); }

/* Other checks */
.minis {
	display: grid;
	gap: 16px;
}

.minis li {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	gap: 18px;
	align-items: center;
}

.minis li > span {
	display: grid;
	font-size: var(--t-13);
	color: var(--muted);
	line-height: 1.45;
}

.minis strong {
	color: var(--ink);
	font-size: var(--t-15);
	font-weight: 600;
}

/* Opportunities */
.opps {
	display: grid;
	gap: 16px;
}

.opps li {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 6px 16px;
}

.opps__title {
	font-weight: 500;
	font-size: var(--t-14);
}

.opps__save {
	font-size: var(--t-13);
	color: var(--muted);
	white-space: nowrap;
}

.opps__bar {
	grid-column: 1 / -1;
	height: 5px;
	width: var(--w);
	border-radius: 5px;
	background: var(--gold);
	transform-origin: left;
	animation: grow 0.9s 0.2s var(--ease) both;
}

.labs {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-top: 26px;
	border-top: 1px solid var(--rule);
}

.labs li {
	display: grid;
	gap: 4px;
	padding: 14px 16px 0 0;
	font-size: var(--t-12);
	color: var(--muted);
}

.labs li + li {
	padding-left: 16px;
	border-left: 1px solid var(--rule);
}

.labs strong {
	font: 500 1.35rem / 1 var(--font-heading);
	color: var(--ink);
}

/* Health list (ink panel) */
.health {
	display: grid;
}

.health li {
	display: grid;
	grid-template-columns: 36px minmax(0, 1fr);
	gap: 14px;
	padding: 14px 0;
	border-top: 1px solid var(--head-rule);
}

.health li:first-child {
	border-top: 0;
	padding-top: 0;
}

.health li > span:last-child {
	display: grid;
	font-size: var(--t-13);
	color: var(--on-head-muted);
	line-height: 1.45;
}

.health strong {
	color: var(--on-head);
	font-size: var(--t-15);
	font-weight: 600;
}

.health__icon {
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--head-raise);
	color: var(--good-on-head);
}

.health .is-warn .health__icon {
	color: var(--gold-head);
}

.health .is-bad .health__icon {
	color: var(--bad-on-head);
}

/* Security checklist */
.checks {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 4px 28px;
}

.checks li {
	display: grid;
	grid-template-columns: 30px minmax(0, 1fr);
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--rule);
	opacity: 0;
	animation: rise 0.5s var(--ease) forwards;
	animation-delay: calc(0.2s + var(--i) * 60ms);
}

.checks__mark {
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--head);
	color: var(--gold-head);
}

.checks__mark .ico {
	width: 16px;
	height: 16px;
	stroke-width: 2.4;
}

.checks__body {
	display: grid;
	gap: 2px;
	font-size: var(--t-13);
	color: var(--muted);
	line-height: 1.45;
}

.checks__body strong {
	color: var(--ink);
	font-size: var(--t-14);
	font-weight: 600;
}

.checks__val {
	margin-left: 8px;
	font-style: normal;
	font-weight: 500;
	font-size: var(--t-12);
	color: var(--muted);
}

/* Certificate */
.cert__days {
	display: grid;
	font: 500 3.5rem / 1 var(--font-heading);
	font-variant-numeric: lining-nums tabular-nums;
}

.cert__days span:last-child {
	font: 500 var(--t-14) / 1.4 var(--font-body);
	color: var(--on-head-muted);
	margin-top: 8px;
}

.cert__track {
	height: 8px;
	border-radius: 8px;
	margin: 22px 0 16px;
	background: var(--head-raise);
	overflow: hidden;
}

.cert__track span {
	display: block;
	height: 100%;
	width: var(--w);
	background: var(--gold);
	border-radius: inherit;
	transform-origin: left;
	animation: grow 1.1s 0.3s var(--ease) both;
}

.cert__meta {
	font-size: var(--t-13);
	color: var(--on-head-muted);
	line-height: 1.5;
}

/* States */
.state {
	display: flex;
	gap: 20px;
	align-items: flex-start;
	max-width: 640px;
	margin: 8px var(--gutter) 40px;
	padding: 28px 30px;
	border-radius: var(--r-l);
	background: var(--sheet);
	box-shadow: 0 0 0 1px var(--rule);
}

.state__mark {
	flex: none;
	width: 14px;
	height: 14px;
	margin-top: 8px;
	border-radius: 50%;
	background: var(--gold);
	box-shadow: 0 0 0 6px var(--gold-soft);
}

.state--error .state__mark {
	background: var(--bad);
	box-shadow: 0 0 0 6px var(--bad-soft);
}

.state__title {
	font: 500 1.4rem / 1.25 var(--font-heading);
}

.state__body {
	margin-top: 6px;
	color: var(--muted);
	max-width: 52ch;
}

.state .btn {
	margin-top: 18px;
}

/* Buttons */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 46px;
	padding: 0 22px;
	border-radius: 12px;
	border: 0;
	font-weight: 600;
	font-size: var(--t-15);
	text-decoration: none;
	cursor: pointer;
	transition: background 0.2s, transform 0.15s, color 0.2s;
}

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

.btn--primary {
	background: var(--head);
	color: var(--on-head);
}

.btn--primary:hover {
	background: color-mix(in oklab, var(--head) 88%, var(--on-head));
}

.btn--ghost {
	background: transparent;
	color: var(--ink);
	box-shadow: inset 0 0 0 1.5px var(--rule-strong);
}

.btn--ghost:hover {
	box-shadow: inset 0 0 0 1.5px var(--ink);
}

.btn--block {
	width: 100%;
}

.btn[disabled] {
	cursor: default;
}

.btn.is-busy {
	background: color-mix(in oklab, var(--head) 80%, var(--sheet));
}

.btn.is-ok {
	background: var(--gold);
	color: var(--brand-on-accent);
}

.btn__spin {
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid color-mix(in oklab, currentColor 30%, transparent);
	border-top-color: currentColor;
	animation: spin 0.8s linear infinite;
}

.btn__ok .ico {
	width: 18px;
	height: 18px;
	stroke-width: 2.4;
	stroke-dasharray: 24;
	stroke-dashoffset: 24;
	animation: tick 0.45s var(--ease) forwards;
}

.link-btn {
	padding: 4px 0;
	border: 0;
	background: none;
	font-size: var(--t-14);
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	text-decoration-color: var(--gold);
	text-decoration-thickness: 2px;
	text-underline-offset: 5px;
}

.link-btn:hover {
	text-decoration-color: currentColor;
}

/* Skeletons */
.sk {
	border-radius: 10px;
	background: var(--wash);
	animation: pulse 1.4s ease-in-out infinite;
}

.band .sk,
.shell--boot .sk {
	background: var(--head-raise);
}

.sk--lead {
	height: 48px;
	width: min(640px, 80%);
}

.sk--line {
	height: 16px;
	width: min(480px, 60%);
	margin-top: 18px;
}

.sk--kpi {
	height: 84px;
}

.sk--title {
	height: 20px;
	width: 40%;
	margin-bottom: 20px;
}

.sk--chart {
	height: 260px;
}

.sk--block {
	height: 200px;
}

.sk--row {
	height: 18px;
	margin-bottom: 14px;
}

.band-skel__ledger {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 18px;
	margin-top: 44px;
}

.skel .panel {
	min-height: 140px;
}

/* Boot shell (static first paint before Vue mounts) */
.shell--boot .stage {
	background: var(--head);
}

.shell--boot .band__inner {
	padding-top: 96px;
}

.solo-note {
	padding: 40px;
	color: var(--on-head);
	text-align: center;
}

.solo {
	min-height: 100vh;
	display: grid;
	place-items: center;
	padding: 24px;
	background: var(--head);
}

.solo__card {
	max-width: 460px;
	padding: 36px;
	border-radius: var(--r-l);
	background: var(--sheet);
	color: var(--ink);
	--focus: var(--ink);
}

.solo__card h1 {
	font: 500 1.6rem / 1.25 var(--font-heading);
}

.solo__card p {
	margin: 10px 0 22px;
	color: var(--muted);
}

.solo__logo {
	width: 110px;
	height: auto;
	margin-bottom: 20px;
	padding: 14px;
	border-radius: var(--r-m);
	background: var(--head);
}

/* ================================================================ */
/* Motion                                                           */
/* ================================================================ */

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

@keyframes draw {
	to {
		stroke-dashoffset: 0;
	}
}

@keyframes pop {
	from {
		opacity: 0;
		transform: scale(0);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes grow {
	from {
		transform: scaleX(0);
	}
}

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

@keyframes tick {
	to {
		stroke-dashoffset: 0;
	}
}

@keyframes pulse {
	50% {
		opacity: 0.5;
	}
}

/* One orchestrated entrance per view: sentence, sub, numbers, then panels in order. */
.rv {
	animation: rise 0.6s var(--ease) both;
}

.band .rv:nth-child(2) { animation-delay: 0.08s; }
.band .rv:nth-child(3) { animation-delay: 0.16s; }
.band .rv:nth-child(4) { animation-delay: 0.22s; }
.grid > .rv:nth-child(1) { animation-delay: 0.2s; }
.grid > .rv:nth-child(2) { animation-delay: 0.27s; }
.grid > .rv:nth-child(3) { animation-delay: 0.34s; }
.grid > .rv:nth-child(4) { animation-delay: 0.41s; }
.grid > .rv:nth-child(5) { animation-delay: 0.48s; }
.grid > .rv:nth-child(n + 6) { animation-delay: 0.54s; }

.view-enter-active {
	transition: opacity 0.28s var(--ease);
}

.view-leave-active {
	transition: opacity 0.16s ease-in;
}

.view-enter-from,
.view-leave-to {
	opacity: 0;
}

.view-leave-active .rv {
	animation: none;
}

/* ================================================================ */
/* Responsive                                                       */
/* ================================================================ */

@media (max-width: 1240px) {
	.span-4,
	.span-5,
	.span-7,
	.span-8 {
		grid-column: 1 / -1;
	}

	.ledger {
		grid-template-columns: minmax(200px, 1.2fr) repeat(3, minmax(0, 1fr));
	}
}

/* Tablet: icon rail */
@media (max-width: 1023px) {
	.shell {
		grid-template-columns: 84px minmax(0, 1fr);
	}

	.rail {
		padding: 22px 12px;
		align-items: center;
	}

	.rail__brand {
		padding: 0 0 26px;
	}

	.rail__brand img {
		width: 56px;
	}

	.rail__nav {
		width: 100%;
	}

	.rail__link {
		justify-content: center;
		padding: 0;
	}

	.rail__label,
	.rail__user {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
	}

	.rail__foot {
		padding: 14px 0 0;
		width: 100%;
		display: flex;
		justify-content: center;
	}

	.rail__signout {
		font-size: 0;
		gap: 0;
	}

	.rail__signout .ico {
		width: 22px;
		height: 22px;
	}

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

	.ledger .ledger__item--lead {
		grid-column: 1 / -1;
		grid-row: auto;
		display: flex;
		align-items: flex-end;
		justify-content: space-between;
		flex-wrap: wrap;
		gap: 0 24px;
		padding: 18px 0 18px;
		border-bottom: 1px solid var(--head-rule);
	}

	.ledger .ledger__item--lead .ledger__label {
		flex-basis: 100%;
	}

	.ledger .ledger__item:nth-child(n) {
		margin-top: 0;
		border-top: 0;
	}

	.ledger .ledger__item:nth-child(3n + 2) {
		border-left: 0;
		padding-left: 0;
	}

	.ledger .ledger__item:nth-child(n + 5) {
		border-top: 1px solid var(--head-rule);
	}

	.ledger__spark {
		margin-top: 0;
	}

	.feed--cols {
		columns: 1;
	}
}

/* Phone: compact top bar + bottom tab bar */
@media (max-width: 759px) {
	:root {
		--gutter: 16px;
	}

	.shell {
		display: block;
	}

	.rail {
		display: none;
	}

	.topbar {
		padding-top: calc(14px + env(safe-area-inset-top));
		align-items: center;
		gap: 14px 12px;
	}

	.topbar__brand {
		display: block;
		flex: none;
	}

	.topbar__brand img {
		width: 46px;
		height: auto;
	}

	.topbar__title {
		font-size: 1.35rem;
	}

	.topbar__hello {
		font-size: var(--t-12);
	}

	.topbar__tools {
		display: contents;
	}

	.topbar__signout {
		display: inline-flex;
		order: 2;
	}

	.topbar__tools .seg {
		order: 3;
		flex: 1 1 100%;
		display: grid;
	}

	.topbar__through {
		order: 4;
		flex: 1 1 100%;
		margin-top: -4px;
	}

	.seg__opt {
		min-width: 0;
		padding: 9px 8px;
	}

	.band__inner {
		padding-top: 18px;
		padding-bottom: 44px;
	}

	.lead {
		font-size: 1.85rem;
		line-height: 1.12;
	}

	.sub {
		font-size: var(--t-15);
	}

	.ledger,
	.ledger--4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		margin-top: 28px;
	}

	.ledger__item {
		padding: 14px 14px 12px;
	}

	.ledger .ledger__item:nth-child(n) {
		border-left: 1px solid var(--head-rule);
		padding-left: 14px;
		border-top: 1px solid var(--head-rule);
	}

	.ledger .ledger__item:nth-child(2n) {
		border-left: 0;
		padding-left: 0;
	}

	.ledger .ledger__item--lead {
		border-top: 0;
		padding-left: 0;
		border-left: 0;
	}

	.ledger .ledger__item--lead .ledger__label {
		min-height: 0;
	}

	.ledger__num {
		font-size: 1.65rem;
	}

	.ledger__item--lead .ledger__num {
		font-size: 3rem;
	}

	.content {
		border-radius: 24px 24px 0 0;
		padding-top: 24px;
	}

	.grid {
		gap: 20px;
	}

	.grid > * {
		grid-column: 1 / -1 !important;
	}

	.panel--sheet,
	.panel--ink {
		padding: 20px 18px;
		border-radius: 18px;
	}

	.panel__title {
		font-size: 1.2rem;
	}

	.glance {
		grid-template-columns: 1fr;
	}

	.glance__item {
		border-left: 0;
		border-top: 1px solid var(--rule);
	}

	.glance__item:first-child {
		border-top: 0;
	}

	.heat__grid {
		grid-template-columns: 28px repeat(24, minmax(0, 1fr));
		gap: 2px;
	}

	.heat__cell {
		border-radius: 2px;
	}

	.heat__tick {
		font-size: 9px;
	}

	.checks,
	.labs {
		grid-template-columns: 1fr;
	}

	.labs li + li {
		padding-left: 0;
		border-left: 0;
	}

	.labs li {
		padding: 12px 0;
		border-bottom: 1px solid var(--rule);
		grid-template-columns: 1fr auto;
		align-items: baseline;
	}

	.band__rings {
		width: 100%;
		justify-content: space-around;
		gap: 12px;
	}

	.band__rings .ring svg {
		width: 128px;
		height: 128px;
	}

	.band__rings .ring {
		width: 128px !important;
	}

	.band__rings .ring__score {
		font-size: 2.3rem;
	}

	.state {
		margin: 0 var(--gutter) 24px;
		padding: 22px 20px;
	}

	.main {
		padding-bottom: calc(68px + env(safe-area-inset-bottom));
		background: var(--paper);
	}

	.view {
		background: var(--head);
	}

	.tabbar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 20;
		display: grid;
		grid-template-columns: repeat(var(--tabs), minmax(0, 1fr));
		padding-bottom: env(safe-area-inset-bottom);
		background: var(--head);
		border-top: 1px solid var(--head-rule);
	}

	.tabbar__marker {
		position: absolute;
		top: -1px;
		left: 0;
		width: calc(100% / var(--tabs));
		height: 3px;
		display: flex;
		justify-content: center;
		transform: translateX(calc(var(--tab) * 100%));
		transition: transform 0.4s var(--ease);
	}

	.tabbar__marker::before {
		content: "";
		width: 32px;
		border-radius: 0 0 3px 3px;
		background: var(--gold);
	}

	.tabbar__link {
		display: grid;
		justify-items: center;
		gap: 3px;
		padding: 10px 2px 9px;
		color: var(--on-head-muted);
		text-decoration: none;
		font-size: 11px;
		font-weight: 600;
	}

	.tabbar__link[aria-current="page"] {
		color: var(--on-head);
	}

	.tabbar__link[aria-current="page"] .ico {
		color: var(--gold-head);
	}

	.tabbar__link:focus-visible {
		outline-offset: -3px;
	}

	.foot {
		padding-bottom: 24px;
	}
}

@media (max-width: 380px) {
	.seg__long {
		display: none;
	}

	.seg__short {
		display: inline;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.001ms !important;
		animation-delay: 0s !important;
		transition-duration: 0.001ms !important;
		transition-delay: 0s !important;
		scroll-behavior: auto !important;
	}
}

/* ================================================================ */
/* Login                                                            */
/* ================================================================ */

.gate {
	position: relative;
	min-height: 100vh;
	min-height: 100dvh;
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px);
	grid-template-rows: 1fr auto;
	align-items: center;
	gap: 40px clamp(40px, 7vw, 120px);
	padding: clamp(28px, 6vw, 96px) clamp(24px, 7vw, 120px) 28px;
	background: var(--head);
	color: var(--on-head);
	overflow: hidden;
	isolation: isolate;
}

.gate__line {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: -1;
	pointer-events: none;
}

.gate__stroke {
	fill: none;
	stroke: var(--gold);
	stroke-width: 1.6;
	stroke-linecap: round;
	vector-effect: non-scaling-stroke;
	stroke-dasharray: 1;
	stroke-dashoffset: 1;
	animation: draw 3.2s 0.2s cubic-bezier(0.45, 0.05, 0.25, 1) forwards;
}

.gate__stroke--echo {
	stroke: var(--head-rule);
	stroke-width: 1;
	animation-duration: 3.6s;
	animation-delay: 0.5s;
}

.gate.is-ok .gate__stroke {
	stroke-width: 2.4;
	transition: stroke-width 0.6s;
}

.gate__intro {
	align-self: center;
	animation: rise 0.9s 0.1s var(--ease) both;
}

.gate__logo {
	width: clamp(150px, 15vw, 210px);
	height: auto;
	margin-bottom: clamp(28px, 5vh, 56px);
}

.gate__name {
	font: 500 var(--t-28) / 1.2 var(--font-heading);
	margin-bottom: 40px;
}

.gate__hello {
	font: 400 clamp(2.5rem, 1.6rem + 3.6vw, 5rem) / 1 var(--font-heading);
	letter-spacing: -0.02em;
}

.gate__pitch {
	margin-top: 20px;
	max-width: 34ch;
	font-size: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
	line-height: 1.6;
	color: var(--on-head-muted);
}

.gate__panel {
	position: relative;
	padding: clamp(28px, 3vw, 40px);
	border-radius: 26px;
	background: var(--sheet);
	color: var(--ink);
	box-shadow: 0 40px 90px -40px rgb(0 0 0 / 0.7);
	--focus: var(--ink);
	animation: rise 0.8s 0.25s var(--ease) both;
	transition: transform 0.5s var(--ease), opacity 0.5s;
}

.gate.is-ok .gate__panel {
	transform: translateY(-6px) scale(0.985);
}

.gate__foot {
	grid-column: 1 / -1;
	font-size: var(--t-12);
	color: var(--on-head-muted);
}

.auth {
	display: grid;
	gap: 18px;
}

.auth__title {
	font: 500 1.9rem / 1.15 var(--font-heading);
	letter-spacing: -0.01em;
	margin-bottom: 4px;
}

.auth__lede {
	color: var(--muted);
	margin-top: -8px;
}

.auth__row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin-top: -4px;
}

.auth__error {
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--bad-soft);
	color: var(--bad);
	font-size: var(--t-14);
	font-weight: 500;
	box-shadow: inset 3px 0 0 var(--bad);
	animation: nudge 0.35s var(--ease);
}

.auth__back {
	justify-self: center;
}

.auth__glyph {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--gold-soft);
	color: var(--ink);
}

.auth__glyph--ok .ico {
	width: 26px;
	height: 26px;
	stroke-width: 2.2;
}

.auth--note .btn {
	margin-top: 6px;
}

@keyframes nudge {
	30% { transform: translateX(-5px); }
	60% { transform: translateX(4px); }
}

.field {
	display: grid;
	gap: 7px;
}

.field__label {
	font-size: var(--t-13);
	font-weight: 600;
}

.field__control {
	position: relative;
}

.field__input {
	width: 100%;
	height: 50px;
	padding: 0 14px;
	border-radius: 12px;
	border: 1.5px solid var(--rule-strong);
	background: #fff;
	color: var(--ink);
	font-size: 1rem;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.field__input:hover {
	border-color: color-mix(in oklab, var(--ink) 40%, transparent);
}

.field__input:focus {
	outline: none;
	border-color: var(--ink);
	box-shadow: 0 0 0 4px color-mix(in oklab, var(--gold) 38%, transparent);
}

.field.is-invalid .field__input {
	border-color: var(--bad);
}

.field__control:has(.field__reveal) .field__input {
	padding-right: 52px;
}

.field__reveal {
	position: absolute;
	right: 5px;
	top: 5px;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 9px;
	background: none;
	color: var(--muted);
	cursor: pointer;
}

.field__reveal:hover {
	color: var(--ink);
	background: var(--wash);
}

.field__hint {
	font-size: var(--t-12);
	color: var(--muted);
}

.req {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: color 0.2s;
}

.req .ico {
	width: 14px;
	height: 14px;
	stroke-width: 2.4;
	opacity: 0.35;
	transition: opacity 0.2s;
}

.req.is-met {
	color: var(--good);
	font-weight: 600;
}

.req.is-met .ico {
	opacity: 1;
}

.check {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: var(--t-14);
	cursor: pointer;
	position: relative;
}

.check input {
	position: absolute;
	opacity: 0;
	width: 20px;
	height: 20px;
	margin: 0;
}

.check__box {
	display: grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 6px;
	border: 1.5px solid var(--rule-strong);
	background: #fff;
	color: transparent;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.check__box .ico {
	width: 14px;
	height: 14px;
	stroke-width: 2.6;
}

.check input:checked + .check__box {
	background: var(--head);
	border-color: var(--head);
	color: var(--gold-head);
}

.check input:focus-visible + .check__box {
	outline: 2px solid var(--focus);
	outline-offset: 2px;
}

.swap-enter-active,
.swap-leave-active {
	transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.swap-enter-from {
	opacity: 0;
	transform: translateX(14px);
}

.swap-leave-to {
	opacity: 0;
	transform: translateX(-14px);
}

.gate--boot {
	grid-template-columns: 1fr;
	place-items: center;
}

.gate--boot .gate__logo {
	margin: 0;
}

@media (max-width: 859px) {
	.gate {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto auto auto;
		align-items: start;
		gap: 28px;
		padding: calc(28px + env(safe-area-inset-top)) 16px 20px;
	}

	.gate__logo {
		width: 104px;
		margin-bottom: 22px;
	}

	.gate__hello {
		font-size: 2.6rem;
	}

	.gate__pitch {
		margin-top: 12px;
		font-size: var(--t-15);
	}

	.gate__panel {
		padding: 26px 20px;
		border-radius: 22px;
	}

	.auth__title {
		font-size: 1.6rem;
	}

	.gate__foot {
		text-align: center;
	}
}

.opps__tech {
	display: block;
	font-size: var(--t-12);
	font-weight: 400;
	color: var(--muted);
}

.bars--cols {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 48px;
}

@media (max-width: 759px) {
	.bars--cols {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 759px) {
	.feed__detail {
		white-space: normal;
	}

	.feed__item {
		grid-template-columns: 34px minmax(0, 1fr) auto;
		gap: 12px;
		align-items: start;
	}

	.feed__icon {
		width: 34px;
		height: 34px;
	}
}

/* When the second row of the ledger is one short, the last figure takes the spare column. */
.ledger--fill .ledger__item:last-child {
	grid-column: span 2;
}

@media (max-width: 1023px) {
	.ledger--fill .ledger__item:last-child {
		grid-column: auto;
	}
}

.stack {
	display: grid;
	gap: 26px;
	align-content: start;
	min-width: 0;
}

.stack > .panel--plain {
	padding-top: 18px;
}

.vital__name .tip {
	margin-left: 4px;
	vertical-align: -3px;
}

@media (max-width: 759px) {
	/* An odd tile left over after the lead figure takes the full row. */
	.ledger--odd .ledger__item:last-child {
		grid-column: 1 / -1;
		border-left: 0;
		padding-left: 0;
	}
}
