:root {
	--bg: #0f1420;
	--panel: #171e2e;
	--panel-2: #1e2740;
	--line: #2a3552;
	--text: #e6ebf5;
	--muted: #8f9bb8;
	--accent: #4cc2ff;
	--accent-2: #7cf0b2;
	--warn: #ffb454;
	--bad: #ff6b6b;
}

* { box-sizing: border-box; }

html, body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
	line-height: 1.5;
}

a { color: var(--accent); }

.boot { padding: 4rem; text-align: center; color: var(--muted); }

.shell { max-width: 1080px; margin: 0 auto; padding: 0 1.25rem 4rem; }

.topbar {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	padding: 1rem 0;
	border-bottom: 1px solid var(--line);
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.brand { font-weight: 700; font-size: 1.25rem; letter-spacing: 0.02em; }
.brand span { color: var(--accent); }

.topbar nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.topbar nav a { color: var(--muted); text-decoration: none; padding: 0.25rem 0.5rem; border-radius: 6px; }
.topbar nav a:hover, .topbar nav a.active { color: var(--text); background: var(--panel); }

h1 { font-size: 2rem; margin: 0 0 0.5rem; }
h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; }
p.lead { color: var(--muted); font-size: 1.1rem; max-width: 46rem; }

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

.card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 1.1rem 1.25rem;
}

.card h3 { margin: 0 0 0.4rem; font-size: 1rem; }
.card p { margin: 0.25rem 0; color: var(--muted); }

.stat { font-size: 2rem; font-weight: 700; color: var(--accent); }

button, .button {
	background: var(--accent);
	color: #06202e;
	border: 0;
	border-radius: 8px;
	padding: 0.6rem 1.1rem;
	font-weight: 600;
	cursor: pointer;
	font-size: 0.95rem;
}

button.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
button:disabled { opacity: 0.5; cursor: default; }

.row { display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: center; margin: 0.75rem 0; }

canvas {
	width: 100%;
	background: #0a0e18;
	border: 1px solid var(--line);
	border-radius: 10px;
	display: block;
}

.dropzone {
	border: 2px dashed var(--line);
	border-radius: 12px;
	padding: 1.5rem;
	text-align: center;
	color: var(--muted);
}

.result {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.5rem 1rem;
	align-items: center;
}

.result .title { font-size: 1.4rem; font-weight: 700; }
.result .meta { color: var(--muted); }

.meter { height: 10px; border-radius: 6px; background: var(--panel-2); overflow: hidden; min-width: 160px; }
.meter > div { height: 100%; background: linear-gradient(90deg, var(--warn), var(--accent-2)); }

.badge { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.8rem; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { color: var(--accent-2); border-color: var(--accent-2); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }

.timeline { display: flex; flex-direction: column; gap: 0.4rem; }
.timeline .item { display: flex; gap: 0.75rem; align-items: baseline; padding: 0.4rem 0.7rem; background: var(--panel); border-radius: 8px; border: 1px solid var(--line); }
.timeline .time { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 4.5rem; }

.steps { counter-reset: step; display: grid; gap: 0.75rem; }
.steps .step { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1.1rem 0.9rem 3.4rem; position: relative; }
.steps .step::before { counter-increment: step; content: counter(step); position: absolute; left: 1rem; top: 0.85rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--accent); color: #06202e; font-weight: 700; display: grid; place-items: center; }

code, .mono { font-family: "Cascadia Mono", Consolas, monospace; font-size: 0.9em; }
.hist { display: flex; align-items: flex-end; gap: 1px; overflow: hidden; height: 120px; padding: 6px; background: #0a0e18; border: 1px solid var(--line); border-radius: 10px; }
.hist div { flex: 1; background: var(--accent); min-width: 1px; border-radius: 2px 2px 0 0; }
.hist div.peak { background: var(--accent-2); }
.note { color: var(--muted); font-size: 0.9rem; }
select, input[type=text] { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.7rem; }
progress { width: 100%; }

.formula { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem 1.1rem; font-size: 1.05rem; overflow-x: auto; }
.hist-wrap { position: relative; }
.hist-wrap .marker { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; opacity: 0.85; pointer-events: none; }
label { color: var(--muted); }
label strong { color: var(--text); }
input[type=range] { vertical-align: middle; width: 14rem; margin-left: 0.5rem; }
.steps-note { color: var(--muted); }
h2 { margin-top: 2.4rem; }
