:root {
  color-scheme: light;
  --canvas: #f7f8fa;
  --paper: #fff;
  --ink: #17212e;
  --muted: #596c82;
  --subtle: #68798c;
  --border: #e1e5eb;
  --soft: #edf0f4;
  --blue: #3455f5;
  --blue-hover: #2545de;
  font: 14px/1.5 Arial, Helvetica, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--ink); background: var(--canvas); }
main { flex: 1; }
h1, h2, h3, p, ol, ul, figure, dl, dd { margin: 0; }
a { color: var(--blue-hover); text-underline-offset: 3px; }
button { font: inherit; }
button:not(:disabled) { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
code, pre { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; }
.site-header, .site-footer { padding-inline: clamp(22px, 5.5vw, 90px); }
.site-header { min-height: 73px; background: var(--paper); border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.site-footer { min-height: 60px; display: flex; align-items: center; color: var(--subtle); font-size: 11px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: 19px; font-weight: 700; letter-spacing: -.6px; }
.brand-icon { display: grid; grid-template-columns: repeat(2, 6px); gap: 2px; transform: rotate(-9deg); }
.brand-icon i { background: var(--blue); width: 6px; height: 6px; }
.brand-icon i:last-child { background: #bbc7ff; }
.header-actions { display: flex; align-items: center; gap: 14px; color: var(--subtle); font-size: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 15px; border: 1px solid var(--border); border-radius: 7px; background: var(--paper); color: var(--ink); min-height: 36px; font-size: 13px; white-space: nowrap; text-decoration: none; }
.button:hover { background: var(--soft); }
.button:disabled { opacity: .65; }
.button.primary { color: #fff; border-color: var(--blue); background: var(--blue); }
.button.primary:hover:not(:disabled) { background: var(--blue-hover); }
.button.large { padding: 11px 22px; min-height: 43px; font-size: 14px; }
.card { background: var(--paper); border: 1px solid var(--border); border-radius: 10px; }
.eyebrow { color: var(--muted); font-size: 12px; }
.eyebrow a { color: inherit; }
.hint { font-size: 11px; color: var(--subtle); }
.error { color: #a63137; margin-top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.inline-list { display: flex; flex-wrap: wrap; align-items: center; padding: 0; list-style: none; }
.inline-list li + li::before { content: "·"; color: var(--subtle); margin-inline: .55em; }

.landing, .protocol { width: min(calc(100% - 44px), 588px); margin-inline: auto; }
.start { padding-top: clamp(74px, 17vh, 152px); }
.start h1 { margin-top: 18px; font-size: clamp(34px, 4.7vw, 44px); line-height: 1.14; letter-spacing: -.045em; }
.intro { margin-top: 22px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.facts { color: var(--muted); font-size: 12px; margin: 30px 0; }
.facts li + li::before { margin-inline: 16px; }
.start .hint { margin-top: 12px; }
.connection { padding-top: clamp(42px, 9vh, 77px); }
.connection h1, .protocol h1 { margin-top: 16px; font-size: clamp(29px, 4.3vw, 35px); letter-spacing: -.043em; line-height: 1.2; }
.connection h1:focus { outline: none; }
.connection-intro { margin-top: 12px; color: var(--muted); font-size: 15px; }
.connection-card { margin-top: 26px; padding: 18px 22px; }
.connection-card h2 { font-size: 13px; }
.connection-card h3 { margin-top: 14px; color: var(--subtle); font-size: 10px; letter-spacing: .08em; font-weight: 400; text-transform: uppercase; }
.endpoint { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; }
.endpoint:first-child { margin-top: 2px; }
.endpoint code { color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.copy, .icon-button { background: none; border: none; color: var(--subtle); border-radius: 5px; display: grid; place-items: center; flex: none; }
.copy { width: 24px; height: 24px; margin-right: -4px; }
.copy svg { stroke: currentColor; }
.copy svg rect:last-child { fill: var(--paper); }
.copy.copied { color: #26785a; }
.copy:hover, .icon-button:hover { background: var(--soft); color: var(--ink); }
.connection-footer { min-height: 62px; border-top: 1px solid var(--soft); margin-top: 16px; padding-top: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.run-state { flex: 1; }
.run-state p { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.run-state p::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ca9c40; flex: none; }
.run-state p[data-state="running"]::before { background: var(--blue); }
.run-state p[data-state="complete"]::before { background: #328464; }
.run-state p[data-state="error"]::before { background: #a63137; }
.run-state progress { appearance: none; accent-color: var(--blue); width: 100%; height: 6px; margin-top: 7px; border: 0; border-radius: 9px; background: var(--soft); }
.run-state progress::-webkit-progress-bar { background: var(--soft); border-radius: 9px; }
.run-state progress::-webkit-progress-value { background: var(--blue); border-radius: 9px; }
.run-state progress::-moz-progress-bar { background: var(--blue); border-radius: 9px; }
.connection-hint { margin-top: 13px; overflow-wrap: anywhere; }

dialog { max-height: calc(100% - 36px); width: min(calc(100% - 36px), 578px); padding: 28px 33px; color: var(--ink); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 20px 80px #14274038; }
dialog::backdrop { background: #1b29354c; backdrop-filter: blur(2px); }
.dialog-heading, .dialog-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { font-size: 22px; letter-spacing: -.032em; }
.icon-button { font-size: 21px; width: 28px; height: 28px; }
.steps { list-style: none; counter-reset: steps; padding: 0; margin-top: 24px; }
.steps li { position: relative; counter-increment: steps; padding-left: 37px; margin-bottom: 21px; }
.steps li::before { content: counter(steps); position: absolute; left: 0; top: 0; width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: #eff1f8; font-size: 11px; }
.steps strong { font-size: 13px; }
.steps p, .dialog-notes { color: var(--muted); line-height: 1.7; }
.steps p { max-width: 396px; margin-top: 4px; font-size: 12px; }
.dialog-notes { padding-top: 17px; border-top: 1px solid var(--soft); font-size: 11px; }
.dialog-actions { margin-top: 24px; }
.dialog-actions a { color: var(--muted); font-size: 11px; text-decoration: none; }
.dialog-actions a:hover { text-decoration: underline; }

.protocol { width: min(calc(100% - 44px), 760px); padding-block: 47px 52px; }
.protocol-card { margin-top: 24px; padding: 25px; scroll-margin-top: 16px; }
.protocol-card h2 { font-size: 16px; }
.protocol-card h2:not(:first-child) { margin-top: 24px; }
.protocol-card p { margin-top: 8px; color: var(--muted); overflow-wrap: anywhere; }
.protocol-card pre { margin: 10px 0 0; padding: 10px 12px; overflow: auto; border-radius: 6px; background: var(--canvas); font-size: 12px; }

.report { width: min(calc(100% - 48px), 1048px); margin-inline: auto; padding-block: 34px 16px; }
.report h1 { font-size: 27px; letter-spacing: -.04em; line-height: 1.25; }
.report-header, .report-actions { display: flex; align-items: center; gap: 10px; }
.report-header { justify-content: space-between; }
.report-meta { margin-top: 5px; font-size: 11px; color: var(--subtle); }
.report-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-block: 23px 18px; }
.report-stats > div:not(:first-child) { border-left: 1px solid var(--border); padding-left: clamp(12px, 2.3vw, 30px); }
.report-stats dt, .behavior-stats dt { color: var(--muted); font-size: 11px; }
.report-stats dd { margin-top: 4px; letter-spacing: -.038em; font-size: clamp(22px, 2.4vw, 31px); white-space: nowrap; line-height: 1.3; }
.report-stats dd span { letter-spacing: -.02em; font-size: .57em; color: var(--muted); }
.scoring-note { padding-top: 12px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 8px; color: var(--subtle); font-size: 11px; }
.scoring-note a { color: var(--muted); white-space: nowrap; text-decoration: none; }
.scoring-note a:hover { text-decoration: underline; }
.report-tabs { display: flex; gap: clamp(14px, 2vw, 25px); margin: 6px 0 17px; border-bottom: 1px solid var(--border); }
.report-tabs button { position: relative; background: none; border: 0; padding: 11px 0 9px; color: var(--subtle); font-size: 12px; }
.report-tabs button[aria-selected="true"] { color: var(--ink); }
.report-tabs button[aria-selected="true"]::after { content: ""; position: absolute; bottom: -1px; inset-inline: 0; height: 2px; background: var(--blue); }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.chart-card { padding: 17px 21px 18px; min-width: 0; }
.chart-card h2, .tail-card h2 { font-size: 13px; }
.chart-subtitle { color: var(--subtle); font-size: 11px; line-height: 1.4; margin-top: 3px; }
.chart { min-width: 0; min-height: 218px; margin-top: 9px; }
.chart svg { display: block; overflow: hidden; }
.chart text { font: 10px Arial, Helvetica, sans-serif; }
.chart text:not(.point-label) { fill: var(--subtle); }
.chart .grid { stroke: var(--soft); }
.chart-empty { min-height: 178px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.chart-toggle { background: none; border: 0; color: var(--blue-hover); padding: 0; font-size: 10px; text-decoration: underline; text-underline-offset: 2px; margin: -3px 0 7px; }
.chart-with-aside { display: grid; grid-template-columns: minmax(0, 1fr) minmax(160px, 24%); gap: 22px; }
.legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 6px; row-gap: 6px; padding: 0; list-style: none; color: var(--muted); font-size: 10px; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend span { width: 12px; flex-shrink: 0; border-top: 2px solid var(--series-color); }
.legend .dashed { border-top-style: dashed; }
.figure-footer, .report-footnote { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--subtle); font-size: 11px; }
.figure-footer { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--soft); }
.figure-footer strong { color: var(--muted); font-weight: 400; }
.report-footnote { margin-top: 15px; }
.chart-aside { min-width: 0; padding-top: 13px; }
.chart-aside h3, .percentiles dt, .credit-note, .credit-bars { color: var(--subtle); font-weight: 400; font-size: 11px; }
.percentiles dt { margin-top: 12px; }
.percentiles dd { font-size: 21px; line-height: 1.25; letter-spacing: -.04em; }
.credit-total { margin-top: 11px; font-size: 30px; letter-spacing: -.04em; }
.credit-note { margin-top: 5px; line-height: 1.6; }
.credit-bars { margin-top: 14px; }
.credit-bars div { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; margin-top: 8px; }
.credit-bars span { grid-column: 1 / -1; height: 5px; background: var(--soft); border-radius: 5px; }
.credit-bars i { height: 100%; background: #c6cfde; border-radius: inherit; display: block; }
.credit-bars .accent { background: var(--blue); }
.table-heading { margin: 18px 0 -8px; padding-left: 14px; font-size: 12px; font-weight: 400; }
.table-scroll { margin-top: 12px; overflow: auto; }
table { width: 100%; background: var(--paper); text-align: left; border-collapse: collapse; color: var(--muted); font-size: 11px; white-space: nowrap; }
table :is(th, td) { padding: 5px 14px; border-bottom: 1px solid var(--soft); font-weight: 400; }
table thead { color: var(--subtle); }
table tbody th { color: var(--ink); }
#latency tbody tr:first-child { background: #f0f3fb; }
.behavior-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; padding: 13px 20px; }
.behavior-stats > div:not(:first-child) { border-left: 1px solid var(--border); padding-left: clamp(12px, 2.5vw, 25px); }
.behavior-stats dd { margin-top: 3px; font-size: 20px; }
.tail-card { margin-top: 16px; padding: 18px 21px; }
.tail-rows, .attempts { list-style-type: none; padding: 0; }
.tail-row { border-top: 1px solid var(--soft); padding-block: 10px; }
.tail-row:first-child { margin-top: 12px; }
.tail-request { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; font-weight: 700; }
.tail-request span { color: var(--muted); text-align: right; }
.attempts li { display: grid; grid-template-columns: minmax(94px, max-content) minmax(45px, 1fr) minmax(180px, 32%); align-items: center; gap: 8px; color: var(--muted); font-size: 10px; margin-top: 6px; }
.attempt-track { position: relative; height: 5px; background: var(--soft); border-radius: 5px; }
.attempt-track i { position: absolute; inset-block: 0; left: var(--start); width: var(--duration); background: var(--attempt-color); border-radius: 5px; }
.attempt-track .attempt-muted { opacity: .59; }
.empty-attempts { margin-top: 5px; font-size: 11px; color: var(--subtle); }
.report-state { padding-block: 35px; }
.report-state p { margin: 8px 0 16px; color: var(--muted); }
.report-state noscript { display: block; margin-top: 10px; }

@media (min-width: 740px) {
  #overview .chart-card { display: flex; flex-direction: column; }
  #overview .chart-card figure { flex: 1; }
}
@media (max-width: 739px) {
  .report-grid, .chart-with-aside { grid-template-columns: minmax(0, 1fr); }
  .chart-with-aside { gap: 10px; }
  .chart-aside { border-top: 1px solid var(--soft); }
}
@media (max-width: 520px) {
  .header-actions span { display: none; }
  .facts li + li::before { margin-inline: 7px; }
  .connection-card { padding-inline: 15px; }
  dialog { padding: 23px; }
  .report { width: calc(100% - 34px); }
  .report-header { flex-direction: column; align-items: flex-start; }
  .report-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 10px; }
  .report-stats > div:nth-child(3) { border-left: 0; padding-left: 0; }
  .scoring-note { flex-direction: column; }
  .chart-card, .tail-card { padding-inline: 12px; }
  .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attempts li { grid-template-columns: 1fr auto; }
  .attempt-track { grid-row: 2; grid-column: 1 / -1; }
}
@media print {
  body { background: white; }
  .site-header, .site-footer, .report-tabs, .report-actions, .scoring-note a, .chart-toggle { display: none; }
  .report { width: 100%; padding: 0; }
  .report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card, tr, .tail-row { break-inside: avoid; }
  * { print-color-adjust: exact; }
}
