.st-royalty-dashboard {
	max-width: 1180px;
	margin: 0 auto 64px;
	padding: 0 clamp(10px, 3vw, 8px);
	font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
	color: #0b1220;
	background: transparent;
	animation: stFadeUp 0.7s ease both;
}

.st-royalty-dashboard *,
.st-royalty-dashboard *::before,
.st-royalty-dashboard *::after {
	box-sizing: border-box;
}

@keyframes stFadeUp {
	from {
		opacity: 0;
		transform: translate3d(0, 14px, 0);
	}
	to {
		opacity: 1;
		transform: translate3d(0, 0, 0);
	}
}

/* Empty state */
.st-empty-dashboard {
	position: relative;
	border-radius: 32px;
	padding: clamp(32px, 5vw, 52px);
	overflow: hidden;
	background: radial-gradient(circle at 20% 20%, #eef2ff, #ffffff);
	border: 1px solid #e3e9ff;
	box-shadow:
		0 40px 90px rgba(15, 30, 75, 0.12),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
	text-align: center;
}

.st-empty-dashboard__glow {
	position: absolute;
	inset: -40% -10% auto;
	height: 120%;
	background: conic-gradient(from 120deg, rgba(99, 102, 241, 0.35), rgba(14, 165, 233, 0.35), rgba(16, 185, 129, 0.25), rgba(99, 102, 241, 0.35));
	filter: blur(90px);
	opacity: 0.45;
	pointer-events: none;
}

.st-empty-dashboard__inner {
	position: relative;
	max-width: 640px;
	margin: 0 auto;
	z-index: 1;
}

.st-empty-eyebrow {
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.28em;
	margin: 0 0 10px;
	font-weight: 700;
	color: #6366f1;
}

.st-empty-dashboard h2 {
	font-size: clamp(28px, 4vw, 38px);
	margin: 0 0 16px;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.st-empty-lead {
	font-size: clamp(17px, 2.4vw, 20px);
	line-height: 1.55;
	margin: 0 0 16px;
	color: #1f2a44;
	font-weight: 600;
}

.st-empty-hint {
	margin: 0;
	font-size: 15px;
	line-height: 1.65;
	color: #5c6b8f;
}

.st-royalty-dashboard.st-empty-state .js-st-dashboard-body {
	display: none;
}

/* Hero */
.st-royalty-hero {
	display: flex;
	flex-direction: column;
	gap: clamp(20px, 3vw, 28px);
	padding: clamp(26px, 4vw, 36px);
	background:
		radial-gradient(1200px 500px at 0% -40%, rgba(79, 70, 229, 0.08), transparent 60%),
		radial-gradient(900px 420px at 110% -30%, rgba(14, 165, 233, 0.1), transparent 55%),
		#ffffff;
	border-radius: 30px;
	border: 1px solid rgba(226, 232, 240, 0.9);
	box-shadow:
		0 35px 80px rgba(15, 23, 42, 0.07),
		inset 0 1px 0 rgba(255, 255, 255, 0.9);
	margin-bottom: clamp(22px, 3vw, 28px);
	position: relative;
	overflow: hidden;
}

.st-hero-copy {
	max-width: 720px;
}

.st-hero-description {
	margin: 10px 0 0;
	color: #4b5c80;
	font-size: 15px;
	line-height: 1.6;
}

.st-fx-footnote {
	margin: 16px 0 0;
	font-size: 13px;
	color: #6b778d;
	font-weight: 500;
}

/* Unified toolbar — consistent SaaS control bar */
.st-royalty-dashboard {
	--st-control-radius: 10px;
	--st-control-height: 44px;
	--st-control-border: #e2e8f0;
	--st-control-bg: #f8fafc;
	--st-control-bg-hover: #f1f5f9;
	--st-control-label: #64748b;
	--st-control-text: #0f172a;
	--st-control-active-bg: #0f172a;
	--st-control-active-text: #ffffff;
	--st-control-focus: rgba(15, 23, 42, 0.12);
}

.st-hero-toolbar {
	padding: 0;
	border: none;
	background: transparent;
	box-shadow: none;
}

.st-controls-bar,
.st-hero-toolbar--controls {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
	width: 100%;
	max-width: 880px;
	margin-left: auto;
	margin-right: auto;
	background: #ffffff;
	border: 1px solid var(--st-control-border);
	border-radius: 14px;
	box-shadow:
		0 1px 2px rgba(15, 23, 42, 0.04),
		0 8px 24px rgba(15, 23, 42, 0.04);
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}

.st-controls-bar:hover {
	box-shadow:
		0 1px 2px rgba(15, 23, 42, 0.05),
		0 12px 32px rgba(15, 23, 42, 0.06);
}

.st-control-unit {
	flex: 1 1 200px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	padding: 18px 22px;
	min-width: 0;
	border-right: 1px solid var(--st-control-border);
	transition: background-color 0.18s ease;
}

.st-control-unit:last-child {
	border-right: none;
}

.st-control-unit:hover {
	background-color: rgba(248, 250, 252, 0.65);
}

.st-control-unit__label {
	display: block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--st-control-label);
	text-align: center;
	line-height: 1.2;
}

.st-control-unit__field {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin: 0;
	width: 100%;
}

.st-control-surface {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: var(--st-control-height);
	height: var(--st-control-height);
	padding: 0 4px;
	border-radius: var(--st-control-radius);
	background: var(--st-control-bg);
	border: 1px solid var(--st-control-border);
	transition:
		background-color 0.18s ease,
		border-color 0.18s ease;
}

.st-control-unit:hover .st-control-surface {
	background: var(--st-control-bg-hover);
	border-color: #cbd5e1;
}

.st-currency-toggle {
	display: inline-flex;
	align-items: center;
	width: 100%;
	height: 100%;
	padding: 3px;
	gap: 2px;
	border-radius: calc(var(--st-control-radius) - 2px);
}

.st-currency-toggle button {
	flex: 1 1 0;
	border: none;
	background: transparent;
	color: var(--st-control-label);
	font-weight: 600;
	font-size: 13px;
	line-height: 1;
	padding: 0 10px;
	height: calc(var(--st-control-height) - 10px);
	min-height: 34px;
	border-radius: calc(var(--st-control-radius) - 3px);
	cursor: pointer;
	transition:
		background-color 0.18s ease,
		color 0.18s ease;
}

.st-currency-toggle button:hover:not(.is-active) {
	background: rgba(255, 255, 255, 0.85);
	color: var(--st-control-text);
}

.st-currency-toggle button.is-active {
	background: var(--st-control-active-bg);
	color: var(--st-control-active-text);
}

.st-control-action {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 100%;
	padding: 0 14px;
	border: none;
	border-radius: calc(var(--st-control-radius) - 2px);
	background: transparent;
	color: var(--st-control-text);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	white-space: nowrap;
	transition:
		background-color 0.18s ease,
		color 0.18s ease;
}

.st-control-action:hover {
	background: rgba(255, 255, 255, 0.9);
	color: var(--st-control-text);
}

.st-control-action:focus-visible,
.st-currency-toggle button:focus-visible,
.st-control-select:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--st-control-focus);
}

.st-control-action__icon {
	flex-shrink: 0;
	color: var(--st-control-label);
	transition: color 0.18s ease;
}

.st-control-action:hover .st-control-action__icon {
	color: var(--st-control-text);
}

.st-control-select {
	width: 100%;
	height: 100%;
	min-height: calc(var(--st-control-height) - 2px);
	padding: 0 32px 0 12px;
	border: none;
	border-radius: calc(var(--st-control-radius) - 2px);
	background: transparent;
	color: var(--st-control-text);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	appearance: none;
	cursor: pointer;
	background-image:
		linear-gradient(45deg, transparent 49%, #94a3b8 50%),
		linear-gradient(135deg, #94a3b8 50%, transparent 51%);
	background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	transition: background-color 0.18s ease;
}

.st-control-select:hover {
	background-color: rgba(255, 255, 255, 0.75);
}

.st-control-select:focus {
	background-color: #ffffff;
}

.eyebrow {
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.22em;
	color: #6366f1;
	font-weight: 700;
	margin: 0;
}

.st-royalty-dashboard h1 {
	font-size: clamp(30px, 4vw, 40px);
	margin: 12px 0 10px;
	letter-spacing: -0.025em;
}

.muted {
	color: #5b6b86;
	margin: 0;
	font-size: 15px;
	line-height: 1.55;
}

.st-royalty-warnings:not([hidden]) {
	background: #fff5f5;
	border: 1px solid #fecdd3;
	padding: 14px 18px;
	border-radius: 18px;
	color: #9f2b3a;
	font-size: 14px;
	margin-bottom: 18px;
	line-height: 1.55;
}

.st-select {
	width: 100%;
	border-radius: 16px;
	border: 1px solid #d8e0f5;
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
	padding: 13px 16px;
	font-weight: 600;
	color: #111827;
	min-height: 50px;
	appearance: none;
	background-image:
		linear-gradient(45deg, transparent 49%, #6366f1 50%),
		linear-gradient(135deg, #6366f1 50%, transparent 51%);
	background-position: calc(100% - 20px), calc(100% - 15px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	background-color: #f9fafb;
	transition:
		border-color 0.2s ease,
		box-shadow 0.2s ease,
		background-color 0.2s ease;
}

.st-select:focus {
	outline: none;
	border-color: #6366f1;
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
	background-color: #ffffff;
}

.st-button {
	border: none;
	border-radius: 16px;
	padding: 14px 18px;
	font-weight: 700;
	cursor: pointer;
	text-transform: uppercase;
	font-size: 11px;
	letter-spacing: 0.09em;
	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

.st-button:hover {
	transform: translateY(-1px);
}

.st-button.accent {
	background: linear-gradient(115deg, #4f46e5, #0ea5e9);
	color: #fff;
	box-shadow: 0 15px 32px rgb(79 117 239 / 0.35);
}

.st-button.ghost {
	background: #ffffff;
	color: #3730a3;
	border: 1px solid #dcd7ff;
	box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
	margin-bottom: clamp(24px, 3vw, 32px);
}

.stat-card {
	border-radius: 22px;
	padding: clamp(22px, 4vw, 28px);
	background: #ffffff;
	border: 1px solid #e8ecf4;
	box-shadow: 0 22px 52px rgba(15, 23, 42, 0.06);
	transition:
		transform 0.25s ease,
		box-shadow 0.25s ease;
	animation: stFadeUp 0.65s ease both;
}

.stat-card:nth-child(2) {
	animation-delay: 0.05s;
}

.stat-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 30px 60px rgba(15, 23, 42, 0.09);
}

@media screen and (max-width: 640px) {
	.cards {
		grid-template-columns: 1fr;
	}
}

.stat-card.accent {
	background:
		linear-gradient(145deg, rgba(255, 255, 255, 0.95), #f5f3ff),
		radial-gradient(420px 220px at 90% -40%, rgba(14, 165, 233, 0.15), transparent 60%);
	border-color: #e4e3ff;
}

.stat-card .label {
	margin: 0;
	font-weight: 600;
	color: #8b95ad;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-size: 11px;
}

.stat-card .value {
	margin: 12px 0 6px;
	font-size: clamp(28px, 4vw, 36px);
}

.stat-card .spark {
	font-size: 13px;
	color: #6c7a96;
	font-weight: 500;
}

.st-royalty-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(18px, 2vw, 22px);
}

@media screen and (max-width: 860px) {
	.st-royalty-grid {
		grid-template-columns: 1fr;
	}
}

.panel {
	background: #ffffff;
	border-radius: 26px;
	border: 1px solid #e8ecf4;
	box-shadow: 0 26px 60px rgba(15, 23, 42, 0.07);
	padding: clamp(20px, 3vw, 26px);
	animation: stFadeUp 0.75s ease both;
}

.panel:nth-of-type(2) {
	animation-delay: 0.05s;
}

.panel:nth-of-type(3) {
	animation-delay: 0.1s;
}

.panel:nth-of-type(4) {
	animation-delay: 0.15s;
}

.panel.tall {
	min-height: 360px;
}

.panel__head h3 {
	margin: 4px 0 6px;
	font-size: 19px;
	letter-spacing: -0.015em;
}

.panel__head--split {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 14px;
}

.st-chart-type-toggle {
	display: inline-flex;
	padding: 4px;
	border-radius: 999px;
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	gap: 4px;
	flex-shrink: 0;
}

.st-chart-type-toggle button {
	border: none;
	background: transparent;
	color: #64748b;
	font-weight: 600;
	font-size: 12px;
	padding: 8px 14px;
	border-radius: 999px;
	cursor: pointer;
	transition:
		background-color 0.18s ease,
		color 0.18s ease,
		box-shadow 0.18s ease;
}

.st-chart-type-toggle button.is-active {
	background: #ffffff;
	color: #3730a3;
	box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.panel__canvas {
	position: relative;
	height: clamp(234px, 26vw, 280px);
}

.panel__canvas.donut {
	height: clamp(294px, 30vw, 340px);
}

.panel__canvas canvas {
	width: 100% !important;
	height: 100% !important;
}

.st-royalty-dashboard.is-loading {
	opacity: 0.58;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.st-royalty-dashboard .hidden {
	display: none !important;
}

.st-royalty-card {
	padding: 32px;
	border-radius: 20px;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	box-shadow: 0 22px 50px rgb(15 71 173 / 0.08);
}

.st-royalty-card--center {
	text-align: center;
	max-width: 420px;
	margin: 0 auto;
}

.st-royalty-card .button {
	margin-top: 12px;
	display: inline-block;
}

/* Desktop: centered single bar, three equal columns */
@media screen and (min-width: 900px) {
	.st-controls-bar,
	.st-hero-toolbar--controls {
		flex-wrap: nowrap;
		max-width: 840px;
	}

	.st-control-unit {
		flex: 1 1 0;
		min-width: 0;
		padding: 20px 24px;
	}
}

/* Mobile: stacked units */
@media screen and (max-width: 899px) {
	.st-controls-bar,
	.st-hero-toolbar--controls {
		flex-direction: column;
		max-width: 360px;
		border-radius: 14px;
	}

	.st-control-unit {
		flex: none;
		width: 100%;
		padding: 16px 18px;
		border-right: none;
		border-bottom: 1px solid var(--st-control-border);
	}

	.st-control-unit:last-child {
		border-bottom: none;
	}

	.st-control-select {
		text-align: center;
		text-align-last: center;
	}
}

@media screen and (max-width: 600px) {
	.st-royalty-hero {
		padding: 22px;
	}

	.st-controls-bar,
	.st-hero-toolbar--controls {
		max-width: 100%;
	}
}
