:root {
    color-scheme: dark;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #10141c;
    color: #edf2f7;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-width: 320px;
    background: linear-gradient(145deg, #10141c, #1a2230);
}

.shell {
    width: min(760px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0 64px;
}

header {
    margin-bottom: 28px;
}

.eyebrow,
.result-label,
.result-unit,
.muted,
.browser-note {
    color: #9aa8ba;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1;
}

h2 {
    margin-bottom: 20px;
    font-size: 1rem;
}

.lede {
    margin-bottom: 0;
    color: #c4cfdd;
    font-size: 1.1rem;
}

.panel,
.result-card {
    border: 1px solid #2c3848;
    border-radius: 14px;
    background: rgba(24, 32, 45, 0.88);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.16);
}

.panel {
    padding: 22px;
    margin-bottom: 16px;
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

label {
    display: grid;
    gap: 8px;
    color: #c4cfdd;
    font-size: 0.9rem;
}

select,
button {
    border: 1px solid #3b4b60;
    border-radius: 8px;
    font: inherit;
}

select {
    padding: 10px 12px;
    background: #111821;
    color: #edf2f7;
}

button {
    width: 100%;
    padding: 12px 16px;
    background: #3d8bfd;
    color: white;
    cursor: pointer;
    font-weight: 700;
}

button:hover:not(:disabled) {
    background: #5a9fff;
}

button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.status-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

#progress-label {
    color: #8bc1ff;
    font-variant-numeric: tabular-nums;
}

progress {
    display: block;
    width: 100%;
    height: 12px;
    accent-color: #3d8bfd;
}

.status-panel .muted {
    margin: 12px 0 0;
    font-size: 0.9rem;
}

.results {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.result-card {
    display: grid;
    gap: 6px;
    padding: 18px 14px;
}

.result-card strong {
    font-size: clamp(1.4rem, 4vw, 2rem);
    font-variant-numeric: tabular-nums;
}

.result-label,
.result-unit {
    font-size: 0.8rem;
}

.error {
    margin: 18px 0 0;
    padding: 14px 16px;
    border: 1px solid #a94452;
    border-radius: 8px;
    background: rgba(169, 68, 82, 0.15);
    color: #ffb8c0;
}

.browser-note {
    margin: 20px 0 0;
    font-size: 0.8rem;
    text-align: center;
}

@media (max-width: 620px) {
    .shell {
        padding-top: 32px;
    }

    .control-grid,
    .results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
