:root {
	--bg: #10151f;
	--panel: #192232;
	--panel-soft: #212d41;
	--ink: #edf4ff;
	--muted: #9fb0ca;
	--line: rgba(255, 255, 255, 0.12);
	--revenue: #73e0a9;
	--spending: #ffb86b;
	--accent: #91b7ff;
	--danger: #ff7a8a;
	font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: radial-gradient(circle at top left, #243c61 0, var(--bg) 34rem);
	color: var(--ink);
}

.hero,
main {
	width: min(1180px, calc(100vw - 32px));
	margin: 0 auto;
}

.hero {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 28px;
	padding: 56px 0 28px;
}

.hero h1 {
	margin: 0;
	font-size: clamp(2.6rem, 8vw, 5.8rem);
	letter-spacing: -0.08em;
	line-height: 0.9;
}

.lede {
	max-width: 650px;
	color: var(--muted);
	font-size: 1.15rem;
}

.control-stack {
	display: grid;
	gap: 10px;
	flex: 0 0 390px;
	width: 390px;
}

.basis-toggle,
.mode-toggle {
	border: 1px solid var(--line);
	border-radius: 22px;
	background: rgba(25, 34, 50, 0.84);
}

.basis-toggle {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	padding: 10px;
}

.mode-toggle {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	min-height: 170px;
	padding: 14px;
}

.basis-button,
.mode-button {
	margin: 0;
	padding: 10px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 0.92rem;
	font-weight: 800;
	white-space: nowrap;
	cursor: pointer;
}

.basis-button.active,
.mode-button.active {
	border-color: var(--accent);
	background: rgba(145, 183, 255, 0.16);
	color: var(--ink);
}

.mode-toggle p {
	grid-column: 1 / -1;
	min-height: 54px;
	margin: 4px 2px 0;
	color: var(--muted);
	font-size: 0.84rem;
}

.eyebrow {
	margin: 0 0 8px;
	color: var(--accent);
	font-size: 0.75rem;
	font-weight: 800;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.panel,
.metric-card {
	border: 1px solid var(--line);
	background: color-mix(in srgb, var(--panel) 92%, transparent);
	border-radius: 28px;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.22);
}

.panel {
	padding: 24px;
}

.panel-heading {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 20px;
}

.panel-heading h2,
.metric-card h2 {
	margin: 0;
}

.hint {
	max-width: 360px;
	margin: 0;
	color: var(--muted);
	font-size: 0.92rem;
}

.timeline {
	display: flex;
	align-items: end;
	gap: 10px;
	min-height: 260px;
	overflow-x: auto;
	padding-bottom: 8px;
}

.line-panel {
	margin-bottom: 16px;
}

.line-chart {
	min-height: 270px;
	overflow-x: auto;
}

.line-chart svg {
	display: block;
	width: 100%;
	min-width: 780px;
	height: 270px;
}

.line-chart .axis,
.line-chart .grid {
	stroke: var(--line);
	stroke-width: 1;
}

.line-chart .line {
	fill: none;
	stroke: var(--revenue);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 4;
}

.line-chart .area {
	fill: url(#revenueGradient);
	opacity: 0.32;
}

.line-chart .point {
	fill: var(--bg);
	stroke: var(--revenue);
	stroke-width: 3;
}

.line-chart .label {
	fill: var(--muted);
	font-size: 12px;
}

.line-chart .value-label {
	fill: var(--ink);
	font-size: 13px;
	font-weight: 800;
}

.year-bar {
	display: grid;
	grid-template-rows: 1fr auto;
	flex: 1 0 74px;
	gap: 10px;
	min-height: 230px;
	padding: 8px;
	border: 1px solid transparent;
	border-radius: 18px;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.year-bar:hover,
.year-bar.active {
	border-color: var(--accent);
	background: rgba(145, 183, 255, 0.08);
}

.bar-stack {
	display: flex;
	align-items: end;
	justify-content: center;
	gap: 5px;
}

.bar {
	width: 22px;
	min-height: 3px;
	border-radius: 999px 999px 4px 4px;
}

.bar.revenue {
	background: linear-gradient(180deg, #b4ffd7, var(--revenue));
}

.bar.spending {
	background: linear-gradient(180deg, #ffd6a8, var(--spending));
}

.year-label {
	color: var(--muted);
	font-size: 0.75rem;
	line-height: 1.1;
}

.summary-grid,
.charts-grid {
	display: grid;
	gap: 16px;
	margin-top: 16px;
}

.summary-grid {
	grid-template-columns: repeat(4, 1fr);
}

.charts-grid {
	grid-template-columns: repeat(2, 1fr);
}

.metric-card {
	padding: 20px;
}

.metric-card h2 {
	font-size: clamp(1.35rem, 3vw, 2.2rem);
}

.chart-layout {
	display: grid;
	grid-template-columns: 230px 1fr;
	gap: 22px;
	align-items: center;
}

.donut {
	position: relative;
	width: 230px;
	aspect-ratio: 1;
	border-radius: 50%;
	background: var(--panel-soft);
}

.donut::after {
	content: attr(data-label);
	position: absolute;
	inset: 22%;
	display: grid;
	place-items: center;
	padding: 14px;
	border-radius: 50%;
	background: var(--panel);
	color: var(--muted);
	font-size: 0.82rem;
	font-weight: 700;
	text-align: center;
}

.category-list {
	display: grid;
	gap: 10px;
}

.category-row {
	display: grid;
	grid-template-columns: 14px 1fr auto;
	gap: 10px;
	align-items: center;
	color: var(--muted);
	font-size: 0.92rem;
}

.swatch {
	width: 12px;
	height: 12px;
	border-radius: 4px;
}

.category-value {
	color: var(--ink);
	font-weight: 700;
}

.notes {
	margin: 16px 0 40px;
	color: var(--muted);
}

.notes h2,
.notes h3 {
	color: var(--ink);
}

.notes h2 {
	margin: 0 0 18px;
}

.notes h3 {
	margin: 20px 0 10px;
	font-size: 1rem;
}

.notes p {
	margin: 0 0 10px;
}

.status-panel {
	margin-bottom: 40px;
}

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

.status-card {
	display: grid;
	gap: 6px;
	padding: 14px;
	border: 1px solid var(--line);
	border-radius: 18px;
	background: var(--panel-soft);
}

.status-card span,
.status-card small {
	color: var(--muted);
}

.status-card strong {
	font-size: 1.05rem;
}

@media (max-width: 900px) {
	.hero {
		display: block;
	}

	.control-stack {
		width: 100%;
		max-width: 390px;
		margin-top: 22px;
	}

	.summary-grid,
	.charts-grid,
	.chart-layout {
		grid-template-columns: 1fr;
	}

	.donut {
		width: min(260px, 100%);
		justify-self: center;
	}

	.panel-heading {
		display: block;
	}
}

@media (max-width: 560px) {
	.hero,
	main {
		width: min(100vw - 20px, 1180px);
	}

	.panel,
	.metric-card {
		border-radius: 20px;
		padding: 16px;
	}

	.timeline {
		margin-inline: -4px;
		padding-inline: 4px;
	}
}
