:root {
    color-scheme: light dark;
    --navy: #0a1446;
    --teal: #0e8476;
    --ink: #0a1446;
    --muted: #52627a;
    --line: #dce4e9;
    --panel: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: #f8f8f5;
    color: var(--ink);
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.site-header { background: var(--panel); }
.header-content {
    max-width: 1100px;
    margin: auto;
    padding: 18px 28px;
    display: flex;
    align-items: center;
    gap: 24px;
}
.header-content a { display: inline-flex; }
.site-menu-logo { display: block; width: 190px; height: auto; max-width: 100%; }
.product-label {
    border-left: 1px solid var(--line);
    padding-left: 24px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
}
.container { max-width: 1100px; margin: 0 auto; padding: 0 28px 32px; }
p { margin: 0; }
.workspace { display: grid; grid-template-columns: minmax(0, 2.8fr) minmax(220px, 1fr); background: var(--panel); }
.panel { min-width: 0; padding: 26px; }
.metrics { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr 1fr; gap: 12px; margin: 0 0 22px; }
.metrics > div { min-width: 0; }
.metrics dt { color: var(--muted); font-size: 11px; letter-spacing: .7px; text-transform: uppercase; }
.metrics dd { margin: 6px 0 0; font-size: 32px; font-weight: 600; line-height: 1.25; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metrics > div:nth-child(-n+2) dd { font-size: 42px; font-weight: 700; letter-spacing: -2px; }
.metrics > div:nth-child(n+3) { border-left: 1px solid var(--line); padding-left: 16px; }
.metrics small { color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.graphs { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.chart-container { min-width: 0; }
.chart-container h3 { margin: 0 0 12px; font-size: 13px; font-weight: 600; }
.chart-container h3 span { margin-left: 5px; color: var(--muted); font-size: 11px; font-weight: 400; }
.chart-frame { position: relative; height: 160px; width: 100%; }
.chart-frame canvas { max-width: 100%; }
.chart-note { color: var(--muted); font-size: 12px; margin-top: 12px; }
.stage { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 18px; }
.stage-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.stage h2 { margin: 0; font-size: 12px; font-weight: 600; white-space: nowrap; }
#status-text { font-size: 12px; text-align: right; }
#phase-progress { display: flex; gap: 3px; width: 100%; height: 9px; padding: 0 2px; }
#phase-progress span { flex: 1; background: var(--line); transform: skewX(-18deg); }
#phase-progress .phase-segment[data-state="done"] { background: var(--teal); }
#phase-progress .phase-segment[data-state="active"] { background: var(--navy); opacity: .5; }
#phase-progress .phase-segment[data-state="stopped"] { background: var(--navy); opacity: .65; }
.phase-labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 9px; color: var(--muted); font-size: 11px; }
.phase-labels span:nth-child(2), .phase-labels span:nth-child(3) { text-align: center; }
.phase-labels span:last-child { text-align: right; }
#phase-detail { margin-top: 9px; color: var(--muted); font-size: 12px; }
.measurement-errors:not(:empty) { margin-top: 18px; padding: 12px 14px; border-left: 3px solid #ad640d; background: #fff5e7; color: #744005; font-size: 13px; overflow-wrap: anywhere; }
.measurement-errors ul { margin: 0; padding-left: 18px; }
.connection { border-left: 1px solid var(--line); background: #f0f3f1; }
.connection h2 { font-size: 11px; text-transform: uppercase; letter-spacing: 1.2px; margin: 0 0 20px; }
.connection dl { margin: 0; }
.connection dt { color: var(--muted); font-size: 12px; margin-top: 16px; }
.connection dd { margin: 3px 0 0; overflow-wrap: anywhere; font: 12px/1.6 Consolas, monospace; }
.connection-note { margin-top: 12px; color: var(--muted); font-size: 12px; }
.connection-note a { color: var(--ink); text-underline-offset: 2px; }
#connection-status:empty { display: none; }
#submission-status:not(:empty) { margin-top: 18px; }
#submission-status, #copy-status { font-size: 12px; color: var(--muted); }
#copy-status:not(:empty) { margin-top: 10px; }
button { flex-shrink: 0; font: inherit; font-weight: 600; border: 1px solid var(--teal); border-radius: 2px; padding: 9px 16px; background: var(--teal); color: #fff; cursor: pointer; }
button:hover:not(:disabled) { background: #096d62; }
button:disabled { background: #e6ebe8; color: #58675f; border-color: #cbd5ce; cursor: not-allowed; }
a:focus-visible, button:focus-visible, summary:focus-visible, textarea:focus-visible { outline: 3px solid var(--teal); outline-offset: 4px; }
#report-text { width: 100%; margin-top: 14px; padding: 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font: 12px/1.6 Consolas, monospace; resize: vertical; }
[hidden] { display: none !important; }
.technical-details { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; font-size: 12px; color: var(--muted); }
.technical-details summary { cursor: pointer; width: fit-content; }
.technical-details h2 { font-size: 12px; margin: 16px 0 8px; }
.technical-details pre { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font: 12px/1.6 Consolas, monospace; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
    .metrics { grid-template-columns: 1fr 1fr; }
    .metrics > div:nth-child(n+3) { border-left: 0; padding-left: 0; }
    .graphs { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .workspace { grid-template-columns: minmax(0, 1fr); }
    .connection { border-left: 0; border-top: 1px solid var(--line); }
}

@media (max-width: 700px) {
    .header-content { padding: 18px 20px; gap: 16px; }
    .site-menu-logo { width: 155px; }
    .product-label { padding-left: 16px; font-size: 10px; letter-spacing: 1px; }
    .container { padding: 0 16px 24px; }
    .workspace { grid-template-columns: minmax(0, 1fr); }
    .panel { padding: 24px 20px; }
    .connection { border-left: 0; border-top: 1px solid var(--line); }
    .metrics > div:nth-child(-n+2) dd { font-size: 32px; }
    .metrics > div:nth-child(-n+2) small { display: block; margin-top: 6px; }
    .metrics dd { font-size: 30px; }
    .stage-heading { align-items: flex-start; flex-direction: column; gap: 6px; }
    #status-text { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.loaded-latency { display: flex; flex-wrap: wrap; gap: 12px 24px; margin: -6px 0 22px; font-size: 12px; }
.loaded-latency > div { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.loaded-latency dt { color: var(--muted); }
.loaded-latency dd { margin: 0; font-variant-numeric: tabular-nums; }
.workload { margin-top: 18px; padding: 20px 26px; background: var(--panel); border-top: 1px solid var(--line); }
.workload-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.workload h2 { margin: 0; font-size: 13px; font-weight: 600; }
#copy-results { padding: 5px 10px; font-size: 12px; }
.table-scroll { max-width: 100%; overflow-x: auto; }
.table-scroll:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
.workload table { border-collapse: collapse; width: 100%; font-size: 12px; text-align: left; }
.workload th, .workload td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.workload th { font-weight: 600; color: var(--muted); }
.workload td { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.workload th:first-child, .workload td:first-child { padding-left: 0; }
.workload th:last-child, .workload td:last-child { padding-right: 0; }

.measurement-errors p + p { margin-top: 6px; }
@media (max-width: 700px) { .workload { padding: 20px; } }

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e7ecff;
        --muted: #afbdd2;
        --line: #354155;
        --panel: #1a2334;
        --teal: #55d4bd;
    }
    body { background: #111725; }
    .site-menu-logo { filter: brightness(0) invert(1); }
    .connection { background: #182333; }
    button { color: #062c28; }
    button:hover:not(:disabled) { background: #75e2ce; }
    button:disabled { background: #293648; color: #afbdd2; border-color: var(--line); }
    #phase-progress .phase-segment[data-state="active"],
    #phase-progress .phase-segment[data-state="stopped"] { background: #9caee6; }
    .measurement-errors:not(:empty) { background: #30281d; color: #f4ce94; border-left-color: #d79b42; }
}
