@font-face {
    font-family: "Geist Sans";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../dist/fonts/geist-sans-400.woff2") format("woff2");
}

@font-face {
    font-family: "Geist Sans";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../dist/fonts/geist-sans-600.woff2") format("woff2");
}

@font-face {
    font-family: "Geist Sans";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("../dist/fonts/geist-sans-700.woff2") format("woff2");
}

@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../dist/fonts/geist-mono-400.woff2") format("woff2");
}

@font-face {
    font-family: "Geist Mono";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../dist/fonts/geist-mono-500.woff2") format("woff2");
}

:root {
    --bg: #f7faf7;
    --panel: #fff;
    --panel-subtle: #f4f8f5;
    --text: #17211b;
    --heading: #102015;
    --muted: #526258;
    --line: rgba(37, 71, 51, 0.14);
    --primary: #236d45;
    --primary-dark: #205d3b;
    --p50: #2e8555;
    --p95: #7057a8;
    --bad: #c52e43;
    --good: #147a56;
    --stream-1: #236d45;
    --stream-2: #4a8f69;
    --stream-3: #7057a8;
    --stream-4: #9b6f35;
    --stream-5: #b44f67;
    --stream-6: #397f91;
    --font-sans: "Geist Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "Geist Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background:
        linear-gradient(180deg, rgba(247, 250, 247, 0.96), rgba(255, 255, 255, 1) 34rem),
        var(--bg);
    color: var(--text);
    font: 400 15px/1.6 var(--font-sans);
}

main {
    max-width: 1180px;
    margin: auto;
    padding: 4rem 1.5rem 5rem;
}

h1,
h2,
h3,
h4 {
    color: var(--heading);
    font-weight: 600;
}

h1 {
    margin: 0;
    font-size: clamp(2.5rem, 6vw, 3.8rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
}

h2 {
    margin-top: 0;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--line);
}

a {
    color: var(--primary);
    font-weight: 600;
}

a:hover { color: var(--primary-dark); }

code {
    color: var(--primary-dark);
    font-family: var(--font-mono);
}

.lead {
    max-width: 760px;
    margin-bottom: 0;
    color: #3d4f43;
    font-size: 1.14rem;
    line-height: 1.65;
}

.panel {
    margin: 1.15rem 0;
    padding: 1.4rem;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    background: var(--panel);
}

.panel-subtle {
    margin: 1.15rem 0;
    padding: 1rem 1.2rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    background: var(--panel-subtle);
}

.report-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-top: 2rem;
    padding-block: 1rem;
}

.report-controls .controls { margin: 0; }
.report-controls select { width: 100%; }

.tabs {
    display: flex;
    gap: 0.4rem;
    margin: 2rem 0 1.5rem;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    background: rgba(35, 109, 69, 0.055);
}

.tab {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 0;
    border-radius: 0.45rem;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font: 600 1rem/1.3 var(--font-sans);
}

.tab[aria-selected="true"] {
    background: var(--panel);
    box-shadow: 0 1px 4px rgba(16, 32, 21, 0.12);
    color: var(--heading);
}

.tab:focus-visible,
.button-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.tab-panel[hidden] { display: none; }

.section-intro {
    margin: 0 0 1.5rem;
}

.section-intro h2 {
    margin-bottom: 0.35rem;
    font-size: 1.7rem;
}

.section-intro p {
    max-width: 780px;
    margin: 0;
    color: var(--muted);
    font-size: 1.02rem;
}

.environment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr));
    gap: 1rem;
}

.environment h3 { margin: 0 0 4px; }
.environment h4 { margin: 20px 0 8px; }
.environment-description { max-width: 760px; }
.environment-id { color: var(--muted); }

.environment-summary {
    position: relative;
    padding-block: 1.1rem;
}

.environment-summary h2 {
    display: inline;
    margin: 0 0.65rem 0 0;
    padding: 0;
    border: 0;
    font-size: 1.15rem;
}

.environment-summary .environment-description {
    margin: 0.55rem 0 0;
}

.environment-summary details { margin-top: 0.8rem; }

.environment-summary summary {
    width: max-content;
    color: var(--primary-dark);
    cursor: pointer;
    font-weight: 600;
}

.eyebrow {
    margin-bottom: 0.2rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.environment-facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 6px 18px;
    margin: 18px 0 0;
}

.environment-facts dt {
    color: var(--muted);
    font-weight: 600;
}

.environment-facts dd { margin: 0; }

.environment ul {
    margin: 0;
    padding-left: 20px;
}

.load-heading {
    color: var(--heading);
    font-size: 1.2rem;
    font-weight: 600;
}

.load-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 18px 0;
}

.load-fact {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 0.4rem;
    background: var(--panel-subtle);
}

.load-fact-name {
    color: var(--muted);
    font-size: 0.82rem;
}

.traffic-bar {
    display: flex;
    height: 1.3rem;
    margin: 1.25rem 0;
    overflow: hidden;
    border-radius: 999px;
    background: var(--panel-subtle);
}

.traffic-segment {
    min-width: 3px;
    border-right: 2px solid var(--panel);
}

.traffic-segment:last-child { border-right: 0; }

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

.traffic-key {
    display: grid;
    grid-template-columns: 0.7rem minmax(0, 1fr) max-content;
    align-items: center;
    gap: 0.55rem;
    color: var(--muted);
}

.traffic-key strong {
    color: var(--heading);
    font-variant-numeric: tabular-nums;
}

.traffic-swatch {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
}

.muted,
footer,
.loading { color: var(--muted); }

.release-summary {
    margin: 0.5rem 0 1.75rem;
    color: #254733;
    font-weight: 600;
}

.empty-state {
    padding-block: 2rem;
    text-align: center;
}

.empty-state h2 { border: 0; }

.button-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary);
    cursor: pointer;
    font: 600 1rem/1.5 var(--font-sans);
    text-decoration: underline;
}

.result-case {
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.operation-label { font-weight: 600; }

.operation-description {
    min-width: 280px;
    max-width: 420px;
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
    white-space: normal;
}

.workload-description {
    max-width: 680px;
    margin: 8px 0 12px;
    color: var(--muted);
}

.result-notes {
    margin: 8px 0 0;
    padding-left: 20px;
    color: var(--muted);
    font-size: 0.9rem;
    white-space: normal;
}

.notes-panel {
    border-left: 4px solid var(--primary);
    background: var(--panel-subtle);
}

.notes-panel .result-notes { font-size: 1rem; }

.regression {
    color: var(--bad);
    font-weight: 600;
}

.improvement {
    color: var(--good);
    font-weight: 600;
}

.controls {
    display: grid;
    gap: 6px;
    margin-bottom: 16px;
    color: #254733;
    font-weight: 600;
}

select {
    width: min(100%, 620px);
    padding: 9px 12px;
    border: 1px solid rgba(35, 109, 69, 0.24);
    border-radius: 0.5rem;
    background: var(--panel);
    color: var(--text);
    font: inherit;
}

select:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.legend {
    display: flex;
    gap: 18px;
    margin: 8px 0;
    color: var(--muted);
}

.legend span::before {
    display: inline-block;
    width: 18px;
    height: 3px;
    margin: 0 6px 3px 0;
    content: "";
    background: var(--series-color);
}

.chart { width: 100%; min-width: 560px; height: auto; }
.grid-line { stroke: var(--line); stroke-dasharray: 3 5; }
.axis-label { fill: var(--muted); font-family: var(--font-mono); font-size: 12px; }
.trend-p50 { fill: none; stroke: var(--p50); stroke-width: 3; }
.trend-p95 { fill: none; stroke: var(--p95); stroke-width: 3; }
.point-p50 { fill: var(--p50); }
.point-p95 { fill: var(--p95); }

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

thead { background: var(--panel-subtle); }

th,
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: right;
}

th {
    color: #254733;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

td:not(:first-child) { font-variant-numeric: tabular-nums; }
th:first-child,
td:first-child { text-align: left; }

tbody tr:hover { background: rgba(35, 109, 69, 0.035); }

footer {
    margin-top: 36px;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
}

.error {
    border-color: var(--bad);
    color: var(--bad);
}

.failed-result {
    background: rgba(197, 46, 67, 0.035);
}

@media (max-width: 600px) {
    main { padding: 2.5rem 1rem 4rem; }

    .panel { padding: 1rem; }

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

    .tabs { position: sticky; top: 0.5rem; z-index: 2; }

    .tab { padding-inline: 0.5rem; }

    .traffic-legend { grid-template-columns: 1fr; }

    .environment-facts { grid-template-columns: 1fr; }

    .environment-facts dd { margin-bottom: 0.4rem; }
}
