:root {
  color-scheme: light;
  --ink: #16283c;
  --muted: #516376;
  --line: #d5e0e9;
  --surface: #fff;
  --action: #0a655d;
  --error: #9b2528;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f7fa;
  color: var(--ink);
  line-height: 1.5;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
p, h1, h2 { margin: 0; }
h1 { font-size: clamp(1.65rem, 4.5vw, 2.5rem); line-height: 1.18; letter-spacing: -.035em; }
h2 { font-size: 1.12rem; letter-spacing: -.015em; }
button, input { font: inherit; }

.layout { width: min(80rem, 100% - 3rem); margin-inline: auto; }
.masthead { background: #14283c; color: #f5f9fd; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 2rem; }
.masthead p { margin-top: .55rem; color: #c8d8e6; }
main.layout { padding-block: 1.5rem 2.5rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: .9rem; padding: 1.25rem; }
.notice { color: var(--muted); }
.signin { max-width: 29rem; }
.signin form { margin-top: 1rem; display: grid; gap: .4rem; }
.signin input { margin-bottom: .45rem; }
.signin button { margin-top: .35rem; justify-self: start; }
.baseline { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: .5rem 1.25rem; margin-bottom: 1rem; }
.baseline p { margin-top: .25rem; }
.baseline-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.baseline-actions a { color: #19597a; font-size: .93rem; text-underline-offset: .16em; }
.baseline .feedback { grid-column: 1 / -1; }
.baseline .feedback:empty { display: none; }
.timing-file { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; overflow: hidden; clip-path: inset(50%); }
.file-button { display: grid; place-items: center; min-height: 2.5rem; padding: .45rem .95rem; font-size: 1rem; border: 1px solid #b8c9d9; border-radius: .45rem; color: #244561; cursor: pointer; }
.file-button:hover { background: #eef5f9; }
.baseline-actions:has(.timing-file:focus-visible) .file-button { outline: 3px solid #007cb3; outline-offset: 2px; }
.baseline-actions:has(.timing-file:disabled) .file-button { opacity: .56; cursor: default; }
.native-direct { grid-template-columns: 1fr; margin-top: 1rem; }
.controls { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: .85rem 1.25rem; }
.control-title { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-bottom: .35rem; }
.mode { padding: .12rem .55rem; border-radius: .4rem; background: #e9f0f7; color: #294b68; font-size: .77rem; font-weight: 650; }
.run-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .65rem; }
.feedback { font-size: .91rem; min-height: 1.35em; color: var(--muted); }
.controls .feedback { grid-column: 1 / -1; }
.signin .feedback { margin-top: .75rem; }
.feedback[data-error="true"], .notice[data-error="true"] { color: var(--error); }
.muted { color: var(--muted); }

label { display: block; font-weight: 650; font-size: .87rem; }
.pair-control label { margin-bottom: .24rem; }
input { min-height: 2.5rem; padding: .45rem .62rem; color: var(--ink); background: #fff; border: 1px solid #a8b9c9; border-radius: .45rem; }
.pair-control input { width: 4.6rem; }
button { min-height: 2.5rem; padding: .45rem .95rem; border: 1px solid transparent; border-radius: .45rem; background: var(--action); color: #fff; font-weight: 665; white-space: nowrap; cursor: pointer; }
button:hover:not(:disabled) { background: #084e49; }
button:disabled { cursor: default; opacity: .56; }
button.quiet { background: #fff; color: #244561; border-color: #b8c9d9; }
button.quiet:hover:not(:disabled) { background: #eef5f9; }
button.masthead-button { color: #edf5fb; background: transparent; border-color: #809ab0; }
button.masthead-button:hover:not(:disabled) { background: #263f55; }
:focus-visible { outline: 3px solid #007cb3; outline-offset: 2px; }
.masthead :focus-visible { outline-color: #7bd4f7; }

.summary { margin-top: 1rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.summary[data-native="true"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.summary-card h2 { display: flex; align-items: center; gap: .5rem; }
.median { font-size: 1.7rem; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; margin-top: .4rem; }
.summary-card .muted, .summary-note { font-size: .87rem; }
.summary-note { grid-column: 1 / -1; }
.path-tag { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; flex: 0 0 auto; border-radius: .4rem; font-size: .78rem; font-weight: 760; }
.path-a { background: #e9f0f7; color: #254763; }
.path-b { background: #dcf3ed; color: #07584f; }

.results { margin-top: 1rem; }
.section-header { display: flex; align-items: center; justify-content: space-between; gap: .85rem; }
.empty { margin-top: 1rem; padding: 1.25rem; background: #f4f7fa; border-radius: .45rem; color: var(--muted); }
.table-wrap { margin-top: .8rem; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .87rem; }
th, td { text-align: right; padding: .65rem .55rem; white-space: nowrap; border-bottom: 1px solid var(--line); }
thead { background: #f2f6fa; }
thead th { color: #344d63; }
th:first-child, th:nth-child(2), td:first-child, td:nth-child(2), th:last-child, td:last-child { text-align: left; }
tbody tr:nth-child(4n + 3), tbody tr:nth-child(4n + 4) { background: #fbfcfd; }
tbody tr.baseline-row { background: #edf4f9; }
tbody tr.error td:last-child { color: var(--error); white-space: normal; min-width: 10rem; }
tbody td:nth-child(2) .path-tag { margin-right: .35rem; }
.method { margin-top: .7rem; font-size: .84rem; }

@media (max-width: 52rem) {
  .layout { width: calc(100% - 2rem); }
  .baseline { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary-card:nth-child(3) { grid-column: span 2; }
}

@media (max-width: 33rem) {
  .layout { width: calc(100% - 1.25rem); }
  .masthead-inner { align-items: flex-start; flex-direction: column; padding-block: 1.3rem; }
  main.layout { padding-top: 1rem; }
  .controls, .summary, .summary[data-native="true"] { grid-template-columns: 1fr; }
  .summary-card:nth-child(3) { grid-column: auto; }
  .panel { padding: 1rem; }
}
