:root {
    --page-bg: #f4f7f9;
    --surface: #ffffff;
    --surface-soft: #eef3f2;
    --text: #172026;
    --muted: #64717a;
    --border: #dce4e8;
    --brand: #556ee6;
    --teal: #0f766e;
    --green: #198754;
    --amber: #b7791f;
    --red: #c2410c;
    --shadow: 0 16px 40px rgba(31, 42, 55, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--page-bg);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

button,
a {
    font: inherit;
}

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

.speed-header {
    display: grid;
    grid-template-columns: auto 190px 1fr;
    gap: 28px;
    align-items: center;
    padding: 22px 0 30px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    background: var(--surface);
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(31, 42, 55, 0.05);
}

.brand-logo {
    width: 190px;
    max-width: 100%;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--teal);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: clamp(2rem, 4vw, 3.7rem);
    line-height: 1;
    letter-spacing: 0;
}

h2 {
    font-size: 1.15rem;
    letter-spacing: 0;
}

.header-copy {
    margin-top: 12px;
    max-width: 680px;
    color: var(--muted);
    line-height: 1.55;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.metric-card {
    min-height: 132px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.metric-label {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric-card strong {
    display: block;
    margin-top: 18px;
    font-size: clamp(1.7rem, 3vw, 2.65rem);
    line-height: 1;
    letter-spacing: 0;
}

.metric-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.35;
}

.status-card strong {
    font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.test-board,
.report-board {
    margin-top: 18px;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.board-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.board-head p {
    margin-top: 6px;
    color: var(--muted);
}

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 800;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.primary-button {
    min-width: 156px;
    padding: 0 18px;
    color: #fff;
    background: var(--teal);
}

.primary-button:hover {
    background: #0b5f59;
}

.primary-button:disabled,
.ghost-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.ghost-button {
    min-width: 112px;
    padding: 0 14px;
    color: var(--text);
    background: #f7fafb;
    border-color: var(--border);
}

.ghost-button:hover:not(:disabled) {
    border-color: var(--teal);
    color: var(--teal);
}

.progress-list {
    display: grid;
    gap: 14px;
}

.progress-row {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 16px;
    align-items: center;
    padding: 14px;
    border-radius: 8px;
    background: var(--surface-soft);
}

.progress-row span {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.progress-row strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
}

.progress-track {
    position: relative;
    height: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #d3dddf;
}

.progress-track span {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0%;
    border-radius: inherit;
    background: var(--brand);
    transition: width 0.2s ease;
}

.progress-track span.complete {
    background: var(--green);
}

.progress-track span.error {
    background: var(--red);
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

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

.report-grid div {
    min-height: 82px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcfd;
}

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

dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

dd {
    margin: 8px 0 0;
    overflow-wrap: anywhere;
    line-height: 1.45;
    font-weight: 700;
}

.quality-good {
    color: var(--green);
}

.quality-medium {
    color: var(--amber);
}

.quality-poor {
    color: var(--red);
}

@media (max-width: 920px) {
    .speed-header {
        grid-template-columns: 1fr;
        gap: 16px;
    }

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

@media (max-width: 640px) {
    .speed-shell {
        width: min(100% - 20px, 1180px);
        padding-top: 14px;
    }

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

    .board-head,
    .report-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .primary-button,
    .ghost-button {
        width: 100%;
    }

    .progress-row {
        grid-template-columns: 1fr;
    }
}

@media print {
    body {
        background: #fff;
    }

    .speed-shell {
        width: 100%;
        padding: 0;
    }

    .back-link,
    .test-board,
    .report-actions {
        display: none;
    }

    .speed-header,
    .metric-card,
    .report-board,
    .report-grid div {
        box-shadow: none;
    }
}
