.race-lab-page {
  margin: 0;
  background: #f4f6fa;
  color: #11151f;
  font-family: -apple-system, "SF Pro Text", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

.race-lab-page .site-header .brand,
.race-lab-page .site-footer .brand {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  overflow: hidden;
  color: #11151f;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.race-lab-page .site-header .brand img,
.race-lab-page .site-footer .brand img {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 5px 16px -6px rgba(20, 40, 120, 0.55);
}

.race-lab-page .site-header .burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.race-lab-page .site-header .burger:hover {
  border: 0;
  background: transparent;
}

.race-lab-page .site-header .burger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background: #11151f;
}

.race-lab-app {
  position: relative;
  overflow: clip;
  color: #11151f;
  font-size: 14px;
  line-height: normal;
}

.lab-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, #5184ff 0%, #2e5be6 58%, #243fc4 100%);
  color: #fff;
}

.lab-hero::after {
  content: "";
  position: absolute;
  right: -8vw;
  bottom: -165px;
  width: min(600px, 54vw);
  height: 340px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 48px rgba(255, 255, 255, 0.06), 0 0 0 96px rgba(255, 255, 255, 0.035);
  pointer-events: none;
  animation: lab-track-enter 650ms cubic-bezier(.16, 1, .3, 1) both;
}

.lab-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr);
  gap: 64px;
  align-items: end;
  min-height: 310px;
  padding-top: 58px;
  padding-bottom: 58px;
}

.lab-hero h1 {
  max-width: 15ch;
  margin: 0;
  color: #fff;
  font-size: clamp(44px, 5.7vw, 74px);
  font-weight: 850;
  letter-spacing: -0.04em;
  line-height: .98;
  text-wrap: balance;
}

.lab-hero-copy p {
  max-width: 58ch;
  margin-top: 22px;
  color: rgba(255, 255, 255, .88);
  font-size: clamp(16px, 1.5vw, 19px);
  font-weight: 550;
  line-height: 1.55;
}

.lab-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-bottom: 4px;
}

.lab-hero-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 17px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.lab-primary-action {
  background: #fff;
  color: #244dc4;
  box-shadow: 0 10px 28px -14px rgba(5, 12, 46, .65);
}

.lab-primary-action:hover { color: #11151f; }
.lab-secondary-action { border: 1px solid rgba(255, 255, 255, .45); color: #fff; }
.lab-secondary-action:hover { border-color: #fff; color: #fff; }

.lab-hero-actions span {
  flex-basis: 100%;
  margin-top: 5px;
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
}

.import-strip {
  border-bottom: 1px solid #dfe5ef;
  background: #fff;
  scroll-margin-top: 116px;
}

.import-strip-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  align-items: center;
  min-height: 124px;
  padding-top: 22px;
  padding-bottom: 22px;
}

.import-strip h2 {
  margin: 0;
  color: #11151f;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.import-strip p {
  margin-top: 8px;
  color: #5f6977;
  font-size: 12px;
  line-height: 1.55;
}

.import-actions,
.paste-import-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#resultsFile {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.file-action,
.paste-toggle,
.sample-results {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid #d6dce7;
  border-radius: 11px;
  background: #fff;
  color: #11151f;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.file-action {
  border-color: #3a6df0;
  background: #3a6df0;
  color: #fff;
  box-shadow: 0 7px 18px -8px rgba(30, 72, 194, .8);
}

.file-action:hover { background: #2a54d6; }
.file-action:focus-within { outline: 3px solid rgba(58, 109, 240, .36); outline-offset: 3px; }
.file-action:has(+ #resultsFile:focus-visible) { outline: 3px solid rgba(58, 109, 240, .36); outline-offset: 3px; }
.file-action svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.paste-toggle:hover,
.sample-results:hover { border-color: #9db4ee; background: #eaf0ff; }
.sample-results { text-decoration: none; }

.lab-hero .hero-file-action {
  min-height: 44px;
  border-color: #fff;
  border-radius: 12px;
  background: #fff;
  color: #244dc4;
  box-shadow: 0 10px 28px -14px rgba(5, 12, 46, .65);
}

.lab-hero .hero-file-action:hover { border-color: #fff; background: #f5f7ff; color: #11151f; }
.lab-hero .hero-file-action:has(+ #resultsFile:focus-visible) { outline-color: rgba(255, 255, 255, .75); }

.hero-import-status {
  flex-basis: 100%;
  min-height: 0;
  margin: 0;
  color: #fff;
  font-size: 11px;
  line-height: 1.5;
}

.hero-import-status:not(:empty) { min-height: 18px; }
.hero-import-status.is-error { color: #fff0f1; }
.hero-import-status.is-success { color: #e7fff1; }

.paste-import {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 10px 16px;
  padding-top: 0;
  padding-bottom: 22px;
}

.paste-import label {
  align-self: center;
  color: #354467;
  font-size: 12px;
  font-weight: 700;
}

.paste-import input,
.paste-import textarea {
  width: 100%;
  border: 1px solid #cbd4e2;
  border-radius: 9px;
  background: #fff;
  color: #11151f;
  font: 13px/1.5 -apple-system, "SF Pro Text", system-ui, sans-serif;
}

.paste-import input { height: 40px; padding: 0 11px; }
.paste-import textarea { min-height: 112px; padding: 10px 11px; resize: vertical; }
.paste-import-footer { grid-column: 2; }
.paste-import-footer a { color: #2a54d6; font-size: 12px; font-weight: 700; }
.import-status { min-height: 0; margin-top: -7px; padding-bottom: 0; color: #354467; }
.import-status:not(:empty) { min-height: 34px; padding-bottom: 16px; }
.import-status.is-error { color: #ad3342; }
.import-status.is-success { color: #087746; }

.race-index {
  max-width: 1120px;
  min-height: 420px;
  padding-top: 44px;
  padding-bottom: 76px;
}

.race-index-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}

.race-index-heading h2 {
  color: #11151f;
  font-size: 28px;
  font-weight: 820;
  letter-spacing: -0.03em;
}

.race-index-heading p {
  max-width: 58ch;
  margin-top: 7px;
  color: #5f6977;
  font-size: 14px;
  line-height: 1.5;
}

.race-index-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.race-index-actions > span {
  flex-shrink: 0;
  color: #657084;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.matchup-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: #3a6df0;
  color: #fff;
  box-shadow: 0 8px 20px -11px rgba(31, 75, 197, .72);
  font-size: 12px;
  font-weight: 780;
}

.matchup-add:hover { background: #2a54d6; }
.matchup-add svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.matchup-add:focus-visible { outline: 3px solid rgba(58, 109, 240, .35); outline-offset: 3px; }

.race-list {
  overflow: hidden;
  border: 1px solid #dbe2ed;
  border-radius: 14px;
  background: #fff;
}

.race-row {
  display: flex;
  align-items: center;
  min-height: 92px;
  color: #11151f;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.race-row + .race-row { border-top: 1px solid #e5e9f0; }
.race-row:hover { background: #f7f9ff; color: #11151f; box-shadow: inset 3px 0 #3a6df0; }
.race-row-link { display: grid; grid-template-columns: minmax(0, 1fr) 92px 108px 78px; gap: 22px; align-items: center; flex: 1; min-width: 0; min-height: 92px; padding: 18px 22px; color: #11151f; text-decoration: none; }
.race-row-main { min-width: 0; }
.race-row-main strong { display: block; overflow: hidden; font-size: 17px; font-weight: 780; letter-spacing: -0.015em; text-overflow: ellipsis; white-space: nowrap; }
.race-row-main small { display: block; margin-top: 7px; color: #687384; font-size: 12px; }
.race-row-kind { display: inline-flex; align-items: center; margin-right: 7px; padding: 2px 6px; border-radius: 999px; background: #eaf0ff; color: #244dc4; font-size: 9px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; vertical-align: 1px; }
.race-row-stat { min-width: 0; color: #2e3c57; font-variant-numeric: tabular-nums; }
.race-row-stat strong { display: block; font-size: 17px; font-weight: 780; }
.race-row-stat small { display: block; margin-top: 2px; color: #7b8492; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; }
.race-row-open { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; color: #2a54d6; font-size: 12px; font-weight: 750; }
.race-row-open svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.race-row-delete { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: 0 0 auto; min-height: 38px; margin-right: 18px; padding: 0 10px; border-color: #e1c7ca; background: #fff; color: #9b3040; }
.race-row-delete:hover { border-color: #cf9fa6; background: #fff1f2; }
.race-row-delete svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.race-list-message {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff6e5;
  color: #6f5118;
  font-size: 12px;
  line-height: 1.5;
}

.race-list-skeleton { display: grid; gap: 10px; min-height: 92px; padding: 25px 22px; }
.race-list-skeleton i { display: block; height: 10px; border-radius: 5px; background: #e8edf6; }
.race-list-skeleton i:first-child { width: 42%; height: 15px; }
.race-list-skeleton i:nth-child(2) { width: 24%; }
.race-list-skeleton i:last-child { width: 70%; }

.matchup-dialog {
  position: fixed;
  width: min(680px, calc(100vw - 32px));
  max-height: min(820px, calc(var(--matchup-viewport-height, 100dvh) - 40px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 16px;
  background: #fff;
  color: #11151f;
  box-shadow: 0 26px 90px -28px rgba(8, 23, 61, .56);
}

.matchup-dialog::backdrop { background: rgba(14, 28, 57, .55); }
html:has(.matchup-dialog[open]) { overflow: hidden; overscroll-behavior: none; }
.matchup-dialog[open] { animation: matchup-enter 180ms cubic-bezier(.16, 1, .3, 1); }
.matchup-dialog form { display: flex; flex-direction: column; max-height: inherit; margin: 0; }
.matchup-dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior-y: contain; scroll-padding-block: 18px; padding-bottom: 12px; }
.matchup-dialog-head { display: flex; flex: 0 0 auto; align-items: start; justify-content: space-between; gap: 24px; padding: 24px 24px 18px; border-bottom: 1px solid #e7e9ed; }
.matchup-dialog-head h2 { margin: 0; color: #11151f; font-size: 24px; font-weight: 820; letter-spacing: -0.025em; line-height: 1.15; }
.matchup-dialog-head p { max-width: 56ch; margin: 8px 0 0; color: #5f6977; font-size: 12px; line-height: 1.55; }
.matchup-close { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 10px; background: #f1f4f9; color: #42506a; }
.matchup-close:hover { background: #e7ecf5; }
.matchup-close svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.matchup-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 16px 18px; padding: 20px 24px 18px; }
.matchup-field { display: block; min-width: 0; }
.matchup-field > span,
.projection-method legend { display: block; margin-bottom: 7px; color: #354467; font-size: 11px; font-weight: 760; }
.matchup-field input,
.matchup-field select { width: 100%; height: 42px; padding: 0 12px; border: 1px solid #cbd4e2; border-radius: 10px; background: #fff; color: #11151f; font-size: 13px; }
.matchup-field input:focus,
.matchup-field select:focus { border-color: #3a6df0; outline: 3px solid rgba(58, 109, 240, .18); outline-offset: 1px; }
.projection-method { grid-row: span 2; margin: 0; padding: 0; border: 0; }
.projection-method label { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 9px; align-items: start; padding: 10px 11px; border: 1px solid #dbe2ed; background: #fff; cursor: pointer; }
.projection-method label:first-of-type { border-radius: 10px 10px 0 0; }
.projection-method label + label { margin-top: -1px; }
.projection-method label:last-of-type { border-radius: 0 0 10px 10px; }
.projection-method label:has(input:checked) { position: relative; z-index: 1; border-color: #7d9cf1; background: #f3f6ff; }
.projection-method input { margin: 2px 0 0; accent-color: #3a6df0; }
.projection-method strong { display: block; font-size: 12px; }
.projection-method small { display: block; margin-top: 3px; color: #657084; font-size: 10px; line-height: 1.4; }
.matchup-team-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; padding: 0 24px 10px; }
.matchup-team-heading h3 { margin: 0; font-size: 16px; font-weight: 790; }
.matchup-team-heading p { margin: 4px 0 0; color: #687384; font-size: 10px; line-height: 1.45; }
.matchup-team-search { margin: 0 24px 10px; }
.matchup-search-control { display: flex; align-items: center; gap: 9px; min-height: 44px; padding-left: 12px; border: 1px solid #cbd4e2; border-radius: 10px; background: #fff; }
.matchup-search-control:focus-within { border-color: #3a6df0; outline: 3px solid rgba(58, 109, 240, .18); outline-offset: 1px; }
.matchup-search-control > svg { flex: 0 0 17px; width: 17px; height: 17px; fill: none; stroke: #5f6977; stroke-width: 1.7; stroke-linecap: round; }
.matchup-search-control input { min-width: 0; width: 100%; height: 44px; padding: 0 10px 0 0; border: 0; border-radius: 10px; background: transparent; color: #11151f; font-size: 13px; outline: none; }
.matchup-search-control input::placeholder { color: #5f6977; opacity: 1; }
.matchup-search-control input::-webkit-search-cancel-button { display: none; }
.matchup-search-control button { display: grid; flex: 0 0 44px; width: 44px; min-height: 44px; place-items: center; padding: 0; border: 0; background: transparent; }
.matchup-search-control button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
#matchupSearchCount { margin-top: 7px; color: #5f6977; font-size: 11px; line-height: 1.4; }
.matchup-no-teams { margin: 0 24px; padding: 18px 0; color: #5f6977; font-size: 13px; line-height: 1.5; }
.matchup-teams { min-width: 0; margin: 0 24px; padding: 0; border: 1px solid #dbe2ed; border-radius: 12px; background: #fff; }
.matchup-teams:has(.matchup-team):not(:has(.matchup-team:not([hidden]))) { display: none; }
.matchup-team { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 58px; padding: 9px 12px; cursor: pointer; }
.matchup-team + .matchup-team { border-top: 1px solid #e7e9ed; }
.matchup-team:hover { background: #f7f9ff; }
.matchup-team:has(input:checked) { background: #eef3ff; }
.matchup-team input { width: 16px; height: 16px; margin: 0; accent-color: #3a6df0; }
.matchup-team strong { display: block; overflow: hidden; color: #11151f; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.matchup-team small { display: block; margin-top: 4px; color: #687384; font-size: 10px; }
.matchup-team time { color: #42506a; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.matchup-teams-empty { display: grid; min-height: 110px; place-items: center; padding: 20px; color: #687384; font-size: 12px; text-align: center; }
.matchup-help { margin: 9px 24px 0; color: #687384; font-size: 10px; line-height: 1.5; }
.matchup-status { min-height: 18px; margin: 8px 24px 0; color: #ad3342; font-size: 11px; line-height: 1.45; }
.matchup-dialog-foot { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 24px 18px; border-top: 1px solid #e7e9ed; background: #f8faff; }
#matchupTeamCount { margin-right: auto; color: #244dc4; font-size: 12px; font-weight: 760; font-variant-numeric: tabular-nums; white-space: nowrap; }
.matchup-dialog-foot button { flex-shrink: 0; min-height: 44px; padding: 0 15px; border-radius: 10px; }
.matchup-create { border-color: #3a6df0; background: #3a6df0; color: #fff; }
.matchup-create:hover { border-color: #2a54d6; background: #2a54d6; }
.matchup-create:disabled { border-color: #cbd4e2; background: #dfe5ef; color: #7b8492; }

.delete-race-dialog { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 24px); padding: 0; overflow: hidden; border: 0; border-radius: 16px; background: #fff; color: #11151f; box-shadow: 0 26px 90px -28px rgba(8, 23, 61, .56); }
.delete-race-dialog::backdrop { background: rgba(14, 28, 57, .55); }
.delete-race-dialog[open] { animation: matchup-enter 180ms cubic-bezier(.16, 1, .3, 1); }
.delete-race-dialog form { display: flex; flex-direction: column; max-height: inherit; margin: 0; }
.delete-race-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 24px; }
.delete-race-body h2 { margin: 0; font-size: 23px; font-weight: 820; letter-spacing: -.025em; }
.delete-race-body p { margin: 10px 0 0; color: #5f6977; font-size: 13px; line-height: 1.55; }
.delete-race-body p strong { color: #11151f; }
.delete-race-status { min-height: 18px; color: #ad3342!important; font-size: 14px!important; }
.delete-race-actions { display: flex; flex: 0 0 auto; justify-content: flex-end; gap: 8px; padding: 14px 24px 18px; border-top: 1px solid #e7e9ed; background: #f8faff; }
.delete-race-actions button { min-height: 44px; padding-inline: 15px; }
.delete-race-confirm { border-color: #ad3342; background: #ad3342; color: #fff; }
.delete-race-confirm:hover { border-color: #942c3a; background: #942c3a; }
.delete-race-confirm:disabled { border-color: #d8a9af; background: #d8a9af; }
.race-list-message.is-success { background: #eaf8f0; color: #087746; }

@keyframes matchup-enter {
  from { transform: translateY(14px) scale(.985); opacity: .7; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.share-race { display: inline-flex; align-items: center; }
.save-race { border-color: #3a6df0; background: #3a6df0; color: #fff; }
.save-race:hover { border-color: #2a54d6; background: #2a54d6; }
.share-race { gap: 7px; }
.share-race svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.race-lab-app .editor { top: 124px; max-height: calc(100dvh - 142px); }

.lab-main { padding-top: 32px; }
.event-state { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px 12px; }
.event-state > a { font-size: 11px; white-space: nowrap; }
.event-state > a svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -2px; }
.event-line h2 { font-size: 27px; line-height: 1.2; }
.event-line > div { min-width: 0; }
.event-line .temporary-note { max-width: 65ch; font-size: 13px; line-height: 1.5; }
.race-tabs small { color: #5f6977; opacity: 1; }
.race-tabs button[aria-current="true"] small { color: #2447b5; }
.workspace { scroll-margin-top: 124px; }

.race-lab-page .site-footer { margin-top: 0; }

@keyframes lab-track-enter {
  from { transform: translateX(44px); opacity: .35; }
  to { transform: translateX(0); opacity: 1; }
}

@media (max-width: 1080px) {
  .race-lab-page .site-header .burger { display: flex; }
}

@media (max-width: 760px) {
  .lab-hero-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    min-height: 0;
    padding-top: 28px;
    padding-bottom: 28px;
  }

  .lab-hero h1 { max-width: 15ch; font-size: clamp(38px, 10.5vw, 46px); line-height: 1; }
  .lab-hero-copy p { max-width: 44ch; margin-top: 13px; font-size: 14px; line-height: 1.45; }
  .lab-hero-actions { padding-bottom: 0; }
  .lab-hero-actions a { min-height: 40px; }
  .lab-hero-actions .hero-file-action,
  .lab-hero-actions .lab-secondary-action { flex: 1 1 calc(50% - 5px); min-width: 0; padding-inline: 10px; }
  .lab-hero-actions span { margin-top: 0; font-size: 11px; }
  .lab-hero::after { right: -55vw; bottom: -130px; width: 120vw; }
  .import-strip-grid { grid-template-columns: 1fr; gap: 14px; min-height: 0; padding-top: 18px; padding-bottom: 18px; }
  .import-strip h2 { font-size: 20px; }
  .import-strip p { margin-top: 5px; }
  .import-actions { align-items: stretch; }
  .file-action,
  .paste-toggle,
  .sample-results { flex: 1 1 calc(50% - 4px); min-width: 0; padding-inline: 10px; }
  .paste-import { grid-template-columns: 1fr; gap: 7px; }
  .paste-import label { margin-top: 5px; }
  .paste-import-footer { grid-column: 1; margin-top: 4px; }
  .race-index { padding-top: 30px; padding-bottom: 50px; }
  .race-index-heading { align-items: start; margin-bottom: 14px; }
  .race-index-heading h2 { font-size: 24px; }
  .race-index-heading p { font-size: 13px; }
  .race-index-actions { align-items: flex-end; flex-direction: column; gap: 8px; }
  .matchup-add { width: 44px; padding: 0; }
  .matchup-add span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .race-row { min-height: 88px; }
  .race-row-link { grid-template-columns: minmax(0, 1fr) auto; gap: 12px; min-height: 88px; padding: 16px; }
  .race-row-stat { display: none; }
  .race-row-open { align-self: stretch; }
  .race-row-delete { width: 42px; min-height: 42px; margin-right: 10px; padding: 0; }
  .race-row-delete span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
  .share-race { font-size: 0; width: 42px; justify-content: center; }
  .share-race svg { width: 17px; height: 17px; }
  .race-lab-app .editor { top: auto; max-height: 85dvh; }
  .lab-main { padding-top: 20px; }
  .event-state { width: 100%; justify-content: space-between; }
  .event-line h2 { font-size: 23px; }
  .matchup-dialog { inset: auto 0 max(0px, calc(100% - var(--matchup-viewport-height, 100dvh) - var(--matchup-viewport-top, 0px))); width: 100%; max-width: none; max-height: calc(var(--matchup-viewport-height, 100dvh) - max(12px, env(safe-area-inset-top))); margin: 0; border-radius: 16px 16px 0 0; }
  .matchup-dialog-head { gap: 12px; padding: 16px max(18px, env(safe-area-inset-right)) 14px max(18px, env(safe-area-inset-left)); }
  .matchup-dialog-head h2 { font-size: 21px; }
  .matchup-fields { grid-template-columns: 1fr; gap: 14px; padding: 17px max(18px, env(safe-area-inset-right)) 17px max(18px, env(safe-area-inset-left)); }
  .matchup-field input,
  .matchup-field select,
  .matchup-search-control input { min-height: 44px; font-size: 16px; }
  .projection-method { grid-row: auto; }
  .matchup-team-heading { padding-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right)); }
  .matchup-teams { margin-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right)); }
  .matchup-team { grid-template-columns: 20px minmax(0, 1fr); gap: 4px 10px; min-height: 64px; }
  .matchup-team > input { grid-row: span 2; }
  .matchup-team strong { overflow: visible; font-size: 14px; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
  .matchup-team small { font-size: 11px; }
  .matchup-team time { grid-column: 2; font-size: 11px; }
  .matchup-team-search,
  .matchup-no-teams,
  .matchup-help,
  .matchup-status { margin-inline: max(18px, env(safe-area-inset-left)) max(18px, env(safe-area-inset-right)); }
  .matchup-dialog-foot { padding: 12px max(14px, env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left)); }
  .matchup-dialog-foot button { padding-inline: 12px; }
  .delete-race-dialog { width: 100vw; max-width: none; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .delete-race-body { padding: 22px 18px 18px; }
  .delete-race-actions { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .lab-hero::after { animation: none; }
  .matchup-dialog[open] { animation: none; }
  .delete-race-dialog[open] { animation: none; }
}
