html, body, #root { margin: 0; min-height: 100%; }
body { background: var(--ds-page); }
.file-nav { display: flex; flex-wrap: wrap; gap: 20px; border-bottom: 1px solid var(--ds-hairline); }
.file-nav a { padding: 10px 0; color: var(--ds-ink-2); text-decoration: none; }
.file-nav a[aria-current="page"] { color: var(--ds-ink); box-shadow: inset 0 -1px 0 var(--ds-ink); }
@media (max-width: 600px) { .file-nav a { display: inline-flex; align-items: center; min-height: 44px; } }

.race-lede { margin: 0 0 16px; color: var(--ds-ink); }
.race-meta { margin: 8px 0 0; color: var(--ds-ink-2); }
.race-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
.race-textarea { width: 100%; box-sizing: border-box; min-height: 240px; resize: vertical; font: inherit; line-height: 28px; padding: 12px 14px; }
.race-big { width: 100%; min-height: 56px; box-sizing: border-box; justify-content: center; font-size: 17px; }

.race-start {
  display: block; width: 100%; min-height: 96px; margin: 8px 0 20px; border: 0; border-radius: 16px;
  background: var(--ds-ink); color: #fff; font: inherit; font-size: 26px; font-weight: 600; letter-spacing: -0.01em;
  cursor: pointer; touch-action: manipulation;
}
.race-start:active { transform: scale(0.99); background: #000; }
.race-start:disabled { opacity: 0.4; }

.race-clock-panel { text-align: center; padding: 20px 0 16px; border-bottom: 1px solid var(--ds-hairline); }
.race-clock { font-size: 64px; line-height: 1.05; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--ds-ink); }
.race-clock-sub { margin: 6px 0 8px; color: var(--ds-ink-2); font-size: 15px; }

.race-list { list-style: none; margin: 0; padding: 0; }
.race-item { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 8px 0; border-bottom: 1px solid var(--ds-hairline); }
.race-item:last-child { border-bottom: 0; }
.race-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.race-who strong { font-weight: 600; font-size: 17px; line-height: 24px; overflow-wrap: anywhere; }
.race-bib { color: var(--ds-ink-2); font-size: 14px; line-height: 20px; font-variant-numeric: tabular-nums; }
.race-rank { flex: 0 0 36px; text-align: center; font-weight: 600; font-size: 17px; color: var(--ds-ink-2); font-variant-numeric: tabular-nums; }
.race-time { flex: 0 0 auto; font-weight: 600; font-size: 19px; color: var(--ds-teal-600, #3f7a6b); font-variant-numeric: tabular-nums; }
.race-status { flex: 0 0 auto; color: var(--ds-ink-2); font-variant-numeric: tabular-nums; }
.race-finish {
  flex: 0 0 auto; min-width: 112px; min-height: 52px; padding: 0 18px; border: 1.5px solid var(--ds-ink); border-radius: 12px;
  background: #fff; color: var(--ds-ink); font: inherit; font-size: 17px; font-weight: 600; cursor: pointer; touch-action: manipulation;
}
.race-finish:active { background: var(--ds-ink); color: #fff; }

.race-search { display: flex; gap: 12px; align-items: flex-end; margin-bottom: 8px; }
.race-search > .file-control { flex: 1 1 auto; }
.race-late { display: grid; gap: 12px; margin-top: 12px; padding: 16px; border: 1px solid var(--ds-hairline); border-radius: 12px; }
.race-reset { padding: 16px; border: 1px solid var(--ds-hairline); border-radius: 12px; }
.race-danger {
  min-height: 48px; padding: 0 16px; border: 1.5px solid var(--ds-red); border-radius: 8px; background: #fff; color: var(--ds-red);
  font: inherit; font-weight: 600; cursor: pointer;
}
.race-danger:active { background: var(--ds-red); color: #fff; }

.race-results-head { padding-top: 8px; }
.race-results-title { margin: 0; font-family: var(--ds-font-display, inherit); font-weight: 400; font-size: 24px; letter-spacing: -0.025em; }
.race-table-wrap { overflow-x: auto; }
.race-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.race-table th { text-align: left; font-weight: 350; color: var(--ds-ink-2); padding: 8px 8px 8px 0; border-bottom: 1px solid var(--ds-ink); font-size: 13px; }
.race-table td { padding: 12px 8px 12px 0; border-bottom: 1px solid var(--ds-hairline); font-size: 16px; vertical-align: top; }
.race-table .is-pos { width: 44px; font-weight: 600; }
.race-table .is-name { font-weight: 600; overflow-wrap: anywhere; }
.race-table .is-bib { width: 64px; color: var(--ds-ink-2); }
.race-table .is-time { width: 92px; text-align: right; padding-right: 0; font-weight: 600; }
.race-table tr.is-podium .is-time { color: var(--ds-teal-600, #3f7a6b); }

@media (min-width: 768px) {
  .race-clock { font-size: 88px; }
  .race-start { font-size: 30px; }
}
.race-item .file-button { min-width: 84px; display: inline-flex; align-items: center; justify-content: center; align-self: center; }
.race-table th.is-pos, .race-table th.is-time { font-weight: 350; }
.race-copy { margin-top: 16px; }
.race-textarea.is-results { min-height: 180px; font-size: 14px; line-height: 22px; }
.race-splits { color: var(--ds-ink-2); font-size: 13px; line-height: 20px; font-variant-numeric: tabular-nums; }
.race-time.is-split { color: var(--ds-ink); font-weight: 600; }
.race-stepper { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.race-step { width: 56px; height: 56px; border-radius: 12px; border: 1.5px solid var(--ds-ink); background: #fff; color: var(--ds-ink); font: inherit; font-size: 28px; line-height: 1; cursor: pointer; touch-action: manipulation; }
.race-step:disabled { border-color: var(--ds-hairline); color: var(--ds-ink-4); cursor: default; }
.race-step-value { min-width: 72px; text-align: center; display: flex; flex-direction: column; }
.race-step-value strong { font-size: 32px; line-height: 36px; font-weight: 600; font-variant-numeric: tabular-nums; }
.race-step-value span { color: var(--ds-ink-2); font-size: 13px; }
.race-step-note { flex-basis: 100%; margin: 0; }
.race-table.is-laps { min-width: 100%; width: max-content; }
.race-table.is-laps .is-name { min-width: 140px; }
.race-table .is-lap { width: 72px; text-align: right; color: var(--ds-ink-2); padding-left: 8px; }
.race-table th.is-lap { font-weight: 350; }
