:root {
	--bg: #eef1f6;
	--panel: #ffffff;
	--line: #e6e9f0;
	--text: #1b2430;
	--muted: #707a8a;
	--primary: #4361ee;
	--primary-d: #2f49c9;
	--font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	--font-head: 'Poppins', var(--font);
}

* { box-sizing: border-box; }

body {
	margin: 0;
	font-family: var(--font);
	background:
		radial-gradient(1200px 600px at 50% -200px, #e3e9ff 0%, rgba(227, 233, 255, 0) 60%),
		var(--bg);
	background-attachment: fixed;
	color: var(--text);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
}

#app {
	max-width: 1180px;
	margin: 0 auto;
	padding: 40px 20px 70px;
}

.app-header h1 {
	margin: 0 0 6px;
	font-family: var(--font-head);
	font-weight: 700;
	font-size: 1.9rem;
	letter-spacing: -0.01em;
}
.app-header .sub {
	margin: 0 0 26px;
	color: var(--muted);
	font-size: 0.97rem;
	max-width: 620px;
}

.panel {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 16px;
	padding: 24px 26px;
	margin-bottom: 26px;
	box-shadow: 0 10px 30px -18px rgba(27, 36, 48, 0.25), 0 1px 2px rgba(16, 24, 40, 0.04);
}

/* ---- Form ---- */
.form-grid {
	display: grid;
	grid-template-columns: 1fr 160px 44px;
	gap: 10px 14px;
	align-items: center;
}
.grid-head {
	font-size: 0.74rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--muted);
	padding-bottom: 4px;
}
.grid-head:last-child { display: none; }

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

.swatch {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	flex: 0 0 auto;
	border: 1px solid rgba(0, 0, 0, 0.15);
}

.inp {
	width: 100%;
	padding: 9px 11px;
	border: 1px solid var(--line);
	border-radius: 8px;
	font-size: 0.95rem;
	background: #fff;
	color: var(--text);
}
.inp:focus {
	outline: none;
	border-color: var(--primary);
	box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.15);
}

.form-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 18px;
	gap: 12px;
	flex-wrap: wrap;
}
.actions-left {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.btn {
	font-family: var(--font);
	font-weight: 600;
	font-size: 0.92rem;
	border-radius: 10px;
	padding: 10px 18px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: background 0.14s, border-color 0.14s, box-shadow 0.14s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
	background: var(--primary);
	color: #fff;
	box-shadow: 0 8px 18px -8px rgba(67, 97, 238, 0.7);
}
.btn.primary:hover { background: var(--primary-d); }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: #c3cad6; background: #f8fafc; }
.btn.icon {
	width: 36px;
	height: 36px;
	padding: 0;
	font-size: 1.3rem;
	line-height: 1;
	color: var(--muted);
	background: #fff;
	border-color: var(--line);
}
.btn.icon:hover { color: #d6453f; border-color: #f0bdbb; }

/* ---- Chart ---- */
.chart-toolbar {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 8px;
}
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; }

.grid {
	stroke: #c7ccd6;
	stroke-width: 1;
	stroke-dasharray: 5 6;
}
.axis { stroke: #333; stroke-width: 2; }
.axis-num {
	fill: #3a4250;
	font-size: 25px;
	font-weight: 500;
	text-anchor: middle;
}
.arrow-label {
	font-size: 22px;
	font-weight: 600;
	text-anchor: middle;
	letter-spacing: -0.01em;
}
.band-pct {
	fill: #8a6d12;
	font-size: 34px;
	font-weight: 700;
	text-anchor: middle;
}
.band-pct-sub {
	fill: #8a6d12;
	font-size: 19px;
	font-weight: 500;
	text-anchor: middle;
	opacity: 0.85;
}

@media (max-width: 560px) {
	.form-grid { grid-template-columns: 1fr 110px 40px; }
	.app-header h1 { font-size: 1.35rem; }
}
