:root {
  --ink: #182542;
  --muted: #566177;
  --line: #d9dfe8;
  --canvas: #f7f8fa;
  --yellow: #f8c44f;
  --green: #116b43;
  --green-bg: #e8f6ee;
  --navy-bg: #eef2fb;
  --brand-blue: #00a3e0;
  /* Brand blue for text on white: 5.4:1. --brand-blue itself is 2.9:1, fine for fills only. */
  --brand-blue-text: #0070a8;
  --blue-tint: #eaf7fc;
}
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font:
    400 16px/1.5 'DM Sans',
    Arial,
    sans-serif;
}
.shell {
  width: min(1100px, calc(100% - 40px));
  margin: auto;
}
.topbar {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
.brand b,
.hero h1,
.race-info h2,
.dialog-header h2 {
  font-family: Outfit, sans-serif;
}
.brand-logo {
  display: block;
  height: 80px;
  width: auto;
}
.text-button,
.icon-button {
  /* inline-flex, or min-width/min-height do nothing on an <a class=
     "text-button"> (the header's Admin link) and it sits off the baseline. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}
.text-button:hover {
  color: var(--ink);
}
.hero {
  border-radius: 9px;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
}
.hero-copy {
  padding: 48px 54px;
}
.eyebrow {
  margin: 0 0 9px;
  color: #f6cf69;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -1.5px;
}
.hero h1 em {
  color: var(--yellow);
  font-style: normal;
}
.hero-copy > p:not(.eyebrow) {
  max-width: 440px;
  margin: 17px 0 26px;
  color: #edf0f7;
  line-height: 1.6;
}
.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 10px 17px;
  border: 0;
  border-radius: 9px;
  font: 700 15px 'DM Sans';
  cursor: pointer;
}
.primary-button {
  background: var(--yellow);
  color: var(--ink);
}
.primary-button span {
  margin-left: 8px;
  font-size: 17px;
}
.secondary-button {
  background: #eef0f4;
  color: var(--ink);
}
.toolbar {
  display: flex;
  align-items: end;
  gap: 15px;
  margin: 30px 0 17px;
}
.race-count {
  margin: 0 auto 9px 0;
  color: var(--ink);
  font: 700 30px Outfit;
  letter-spacing: -0.5px;
}
.race-count span {
  color: inherit;
}
.athlete-filter {
  display: grid;
  gap: 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.athlete-filter input,
.dialog-card input,
.input-add input,
.save-row input,
.add-form-fields input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #aab5c6;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: 16px 'DM Sans';
}
.athlete-filter input {
  width: 260px;
}
.race-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 55px;
}
.month-label {
  margin: 13px 3px 0;
  color: #5b6578;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.15px;
}
.race-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
.race-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  min-height: 72px;
  padding: 14px 20px;
  border: 0;
  background: var(--green);
  color: #fff;
  text-align: left;
  cursor: pointer;
}
.date-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding-right: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.35);
}
.date-tile strong {
  font: 700 24px Outfit;
}
.date-tile span {
  color: rgba(255, 255, 255, 0.85);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}
.race-info {
  min-width: 0;
  flex: 1;
}
.race-info h2 {
  margin: 0;
  font-size: 18px;
}
.race-meta {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
}
.chevron {
  margin-left: 4px;
  color: #fff;
  font-size: 24px;
  transition: transform 0.2s;
}
.race-card.open .chevron {
  transform: rotate(180deg);
}
.race-card.open {
  margin-bottom: 12px;
}
.roster-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eff1f4;
  font-size: 15px;
}
.roster-remove {
  flex-shrink: 0;
  min-height: 32px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font: 600 13px 'DM Sans';
  cursor: pointer;
}
.roster-remove:hover {
  border-color: #e3a3a3;
  background: #fdecec;
  color: #b3261e;
}
.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}
.choice {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font: 600 14px 'DM Sans';
  cursor: pointer;
}
.choice.selected {
  border-color: #92a4c6;
  background: var(--navy-bg);
  color: var(--ink);
}
.choice.level-locked.selected {
  border-color: #80c7a0;
  background: var(--green-bg);
  color: var(--green);
}
.save-row,
.input-add {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.save-row input {
  flex: 1;
}
.save-button,
.input-add button {
  min-height: 44px;
  padding: 8px 13px;
  border: 0;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font: 700 14px 'DM Sans';
  cursor: pointer;
}
.input-add button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}
.hidden {
  display: none !important;
}
/* Present to screen readers, invisible on screen: for live-region status
   text and similar content with nothing to show sighted users. Unlike
   .hidden, this must not use display:none, which removes it from the
   accessibility tree along with the page. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.empty-state {
  padding: 34px;
  border: 1px dashed #cbd1da;
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  text-align: center;
}
dialog {
  width: min(500px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 9px;
  box-shadow: 0 20px 60px rgba(18, 31, 55, 0.25);
}
dialog::backdrop {
  background: rgba(12, 22, 41, 0.5);
}
.dialog-card {
  padding: 28px;
}
.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 20px;
}
.dialog-header h2 {
  margin: 0;
  font-size: 28px;
}
.icon-button {
  font-size: 28px;
  line-height: 1;
}
.dialog-card label {
  display: block;
  margin: 16px 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.dialog-card input {
  margin-top: 6px;
}
.optional,
.helper-text {
  color: var(--muted);
  font-weight: 400;
}
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 23px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #285ba8;
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}
@media (max-width: 700px) {
  .shell {
    width: min(100% - 24px, 1100px);
  }
  .topbar {
    min-height: 96px;
  }
  .text-button {
    display: none;
  }
  .hero-copy {
    padding: 36px 28px;
  }
  .toolbar {
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
  }
  .race-count {
    width: 100%;
    margin: 0;
  }
  .athlete-filter {
    flex: 1;
    min-width: min(100%, 220px);
  }
  .athlete-filter input {
    width: 100%;
  }
  .race-summary {
    gap: 12px;
    padding: 14px 13px;
  }
  .two-columns {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .dialog-card {
    padding: 22px 18px;
  }
  .dialog-footer {
    flex-direction: column-reverse;
  }
  .dialog-footer button {
    width: 100%;
  }
}
@media (max-width: 390px) {
  .hero-copy {
    padding: 30px 20px;
  }
  .athlete-filter {
    width: 100%;
  }
  .date-tile {
    min-width: 46px;
    padding-right: 10px;
  }
  .race-info h2 {
    font-size: 16px;
  }
  .save-row,
  .input-add {
    flex-direction: column;
  }
  .save-row button,
  .input-add button {
    width: 100%;
  }
}
