:root {
    color-scheme: light;
    --bg: #eef3f8;
    --panel: #ffffff;
    --ink: #142033;
    --muted: #66738a;
    --line: #d9e2ec;
    --accent: #0f8b8d;
    --accent-dark: #0a6e70;
    --warn: #b45309;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fbfd 0%, var(--bg) 100%);
    color: var(--ink);
    font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 32px 0;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 50px rgba(31, 45, 61, 0.08);
    padding: 24px;
    margin-bottom: 18px;
}

.intro {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    background: #102235;
    color: #fff;
}

.intro p {
    max-width: 760px;
    color: #c6d4e2;
    margin: 0;
}

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

h1,
h2 {
    line-height: 1.1;
    letter-spacing: 0;
    margin: 0 0 12px;
}

h1 {
    font-size: clamp(32px, 5vw, 56px);
    max-width: 900px;
}

h2 {
    font-size: 28px;
}

.badge {
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    color: #d8e7f5;
    padding: 8px 12px;
    font-size: 13px;
}

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

.wide {
    grid-column: 1 / -1;
}

label {
    display: grid;
    gap: 7px;
    color: #24324a;
    font-weight: 700;
}

label span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
}

input,
select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--ink);
    background: #fbfdff;
    padding: 10px 12px;
    font: inherit;
}

input:focus,
select:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(15, 139, 141, .14);
}

.checks,
.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 20px;
}

.checks label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.checks input {
    width: 18px;
    min-height: 18px;
}

button,
.downloads a {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 10px 16px;
    text-decoration: none;
}

button:hover,
.downloads a:hover {
    background: var(--accent-dark);
}

button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

#finishButton {
    background: #32465f;
}

.statusHead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.meter {
    height: 12px;
    overflow: hidden;
    background: #e5edf5;
    border-radius: 999px;
    margin: 12px 0 18px;
}

.meter span {
    display: block;
    width: 8%;
    height: 100%;
    background: linear-gradient(90deg, #0f8b8d, #62b6cb);
    transition: width .25s ease;
}

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

.activity {
    display: grid;
    gap: 6px;
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdff;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.activity strong {
    color: var(--ink);
}

.stats div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fbfdff;
}

.stats strong {
    display: block;
    font-size: 30px;
    line-height: 1;
}

.stats span {
    color: var(--muted);
    font-size: 13px;
}

.downloads {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

details {
    margin-top: 16px;
    color: var(--warn);
}

.loader {
    width: 28px;
    height: 28px;
    border: 3px solid #d7e5ef;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

.diagnostics {
    border-color: #f3c174;
    background: #fffaf0;
}

.diagnostics h2 {
    color: #8a4b0f;
}

.diagnostics li {
    margin: 6px 0;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 820px) {
    .intro,
    .statusHead {
        display: block;
    }

    .badge {
        display: inline-flex;
        margin-top: 16px;
    }

    .grid,
    .stats {
        grid-template-columns: 1fr;
    }

    .app {
        width: min(100% - 20px, 1180px);
        padding: 10px 0;
    }

    .panel {
        padding: 18px;
    }
}
