.add-panel {
  width: 100%;
  margin: -3px 0 24px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(25, 37, 66, 0.05);
}
.add-form-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
}
.add-form-heading .eyebrow {
  color: var(--brand-blue);
}
.add-form-heading h2 {
  margin: 0;
  font: 700 28px Outfit;
}
.add-form-fields {
  display: grid;
  grid-template-columns: 2fr 1fr 2fr 2fr;
  gap: 12px;
}
.add-form-fields label {
  display: block;
  margin-top: 18px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.add-form-fields input,
.add-form-fields select {
  display: block;
  margin-top: 6px;
  width: 100%;
  min-height: 44px;
  border: 1px solid #aab5c6;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: 16px 'DM Sans';
}
.add-form-fields label.checkbox-field {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.add-form-fields label.checkbox-field input {
  appearance: none;
  -webkit-appearance: none;
  display: inline-grid;
  place-content: center;
  width: 22px;
  height: 22px;
  min-height: auto;
  margin: 0;
  border: 1.5px solid var(--line);
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.add-form-fields label.checkbox-field input::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
}
.add-form-fields label.checkbox-field input:checked {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
}
.add-form-fields label.checkbox-field input:checked::after {
  transform: rotate(45deg) scale(1);
}
.add-panel .dialog-footer {
  margin-top: 22px;
}
.race-link {
  color: inherit;
  text-decoration: none;
}
.race-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.toolbar {
  gap: 30px;
}
.race-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  vertical-align: bottom;
  font-size: 14px;
  font-weight: 700;
}
.race-details {
  padding: 0;
}
.details-card {
  border-top: 1px solid var(--line);
}
.card-header {
  padding: 14px 20px;
  color: var(--muted);
  background: #eef0f3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.details-card .card-header:not(:first-child) {
  border-top: 1px solid var(--line);
}
.card-body {
  padding: 18px 20px;
}
.race-embed-body {
  padding: 0;
}
.race-embed {
  display: block;
  width: 100%;
  height: 640px;
  min-height: 640px;
  border: 0;
}
.roster-group + .roster-group {
  margin-top: 16px;
}
.roster-group-label {
  margin: 0 0 2px;
  color: var(--brand-blue-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.roster-who {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.roster-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.roster-level {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--navy-bg);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.roster-level.level-locked {
  background: var(--green-bg);
  color: var(--green);
}
.roster-group .roster-entry:last-child {
  border-bottom: 0;
}
.card-body .helper-text {
  margin: 0;
}
.card-body .choices:first-child {
  margin-top: 0;
}
.name-row {
  margin: 0 0 12px;
}
.other-row {
  margin: -4px 0 12px;
}
.name-row input,
.other-row 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';
}
.choice-label {
  margin: 18px 0 8px;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.choice-label:first-child {
  margin-top: 0;
}
.club-focus-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--yellow);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.event-type-badge {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--navy-bg);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.race-summary.club-focus {
  background: var(--brand-blue);
}
/* Past races: one muted slate for every card, club focus included, so the
   list reads as history. Two classes beat .race-summary.club-focus above. */
.race-summary.past,
.race-summary.past.club-focus {
  background: #5d6b85;
}
.when-toggle {
  display: flex;
  gap: 8px;
}
/* .race-summary is an <a> (each race has a shareable /race/<slug> URL), so the
   default link underline has to be turned off; its colour is already set in
   styles.css. */
.race-summary {
  text-decoration: none;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
/* Header labels never wrap: a two-line "Sign out" or "Add a race" reads as
   broken. */
.header-actions button,
.header-actions a {
  white-space: nowrap;
}
.header-actions .text-button {
  font-size: 14px;
}
/* display on .text-button would otherwise beat the hidden attribute. */
.header-actions .guide-link[hidden] {
  display: none;
}
.hero-copy .view-toggle {
  display: flex;
  gap: 4px;
  margin-top: 22px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  width: fit-content;
}
.view-toggle-btn {
  min-height: 38px;
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font: 600 14px 'DM Sans';
  cursor: pointer;
}
.view-toggle-btn.selected {
  background: var(--yellow);
  color: var(--ink);
}
@media (max-width: 700px) {
  .header-actions {
    gap: 6px;
  }
}
.toolbar {
  justify-content: flex-start;
}
.toolbar label[for='athleteFilter'] {
  margin-left: auto;
}
.upcoming-heading {
  margin: 8px 0 4px;
  text-align: left;
}
@media (max-width: 900px) {
  .add-form-fields {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 700px) {
  .add-panel {
    padding: 22px 18px;
  }
  .add-form-fields {
    grid-template-columns: 1fr;
  }
  .add-form-heading h2 {
    font-size: 24px;
  }
}
.commit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.edit-race-button,
.roster-edit {
  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';
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}
.edit-race-button:hover,
.roster-edit:hover {
  border-color: #92a4c6;
  color: var(--ink);
}
.edit-screen {
  margin: 4px 0 40px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font: 600 14px 'DM Sans';
  cursor: pointer;
}
.back-link:hover {
  color: var(--brand-blue);
}
.back-link svg {
  flex-shrink: 0;
}
.update-banner {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 9px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 14px;
  font-weight: 700;
}
/* A write failure reuses the same banner, swapped to the destructive
   palette used elsewhere (.remove-commit-button:hover); see
   showToast(msg, 'error') and the two SVGs it toggles between. */
.update-banner.error {
  background: #fdecec;
  color: #b3261e;
}
.member-banner {
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 9px;
  background: #fdf3de;
  color: #7a5b12;
  font-size: 14px;
  font-weight: 600;
}
.member-banner a {
  color: inherit;
  text-decoration: underline;
}
/* "Ask to join" inside the banner: a link-styled button, so it reads as part
   of the sentence but still has a 44px-tall target. */
.member-banner-action {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}
@media (max-width: 700px) {
  .edit-screen .add-panel {
    padding: 22px 18px;
  }
}
.event-type-filter select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  box-sizing: border-box;
  width: 100%;
  min-height: 44px;
  border: 1px solid #aab5c6;
  border-radius: 9px;
  padding: 10px 34px 10px 12px;
  background: #fff
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1l5 5 5-5" fill="none" stroke="%23566177" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>')
    no-repeat right 12px center;
  color: var(--ink);
  font: 16px 'DM Sans';
}
.add-form-fields select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  background: #fff
    url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8"><path d="M1 1l5 5 5-5" fill="none" stroke="%23566177" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"/></svg>')
    no-repeat right 12px center;
}
#editScreen .add-form-fields,
#addPanel .add-form-fields {
  grid-template-columns: 1fr;
  gap: 22px;
}
#editScreen .add-form-fields label,
#addPanel .add-form-fields label {
  margin-top: 0;
}
#editScreen .add-form-heading,
#addPanel .add-form-heading {
  margin-bottom: 40px;
}
/* Race screen only: doubles the gap under the race title. The card header below it supplies 14px of padding-top and nothing else separated them, so matching that 14px here takes the gap from 14px to 28px. */
#raceScreen .add-form-heading {
  margin-bottom: 14px;
}
.commit-toggle-button {
  min-height: 44px;
  padding: 8px 13px;
  border: 0;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font: 700 14px 'DM Sans';
  cursor: pointer;
}
.remove-commit-button {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: var(--muted);
  font: 700 14px 'DM Sans';
  cursor: pointer;
}
.remove-commit-button:hover {
  border-color: #e3a3a3;
  background: #fdecec;
  color: #b3261e;
}
.danger-button {
  margin-right: auto;
  color: #b3261e;
}
.danger-button:hover {
  background: #fdecec;
}
/* The account cluster (name, Admin, Sign out, or Sign in) sits last, split
   from the page actions by a hairline so it reads as its own group. */
.auth-widget {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  font-size: 14px;
}
.auth-widget .auth-name {
  margin-right: 6px;
  color: var(--ink);
  font-weight: 700;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sign-in-form {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
}
.sign-in-form input {
  flex: 1;
  /* Flex items default to min-width:auto (their content's intrinsic width as
     a floor), which a native text input can push past this row's available
     space on a narrow header. Without this, the input can refuse to shrink
     and force the row wider than its container. */
  min-width: 0;
  min-height: 36px;
  border: 1px solid #aab5c6;
  border-radius: 9px;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
  font: 14px 'DM Sans';
  /* Native form controls carry their own UA theming (-webkit-appearance),
     which on some WebKit versions has sized itself independently of the
     author's box-sizing: border-box, adding padding/border on top of the
     computed width instead of inside it. Resetting appearance removes that
     native theming so the box-sizing rule actually governs the box. */
  -webkit-appearance: none;
  appearance: none;
}
.sign-in-form button {
  flex-shrink: 0;
}
.send-link-button {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font: 700 13px 'DM Sans';
  cursor: pointer;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
}
/* The header's account menu: "Account" opens Change password and Sign out.
   Sign out lives inside it so it stays at the edge, hard to hit by mistake. */
.account-menu-wrap {
  position: relative;
}
.account-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 30;
  min-width: 180px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 37, 66, 0.14);
}
.account-menu.hidden {
  display: none;
}
.account-menu-who {
  margin: 0;
  padding: 8px 12px 6px;
  border-bottom: 1px solid var(--line);
  color: var(--muted, #566177);
  font: 500 13px 'DM Sans';
  overflow-wrap: anywhere;
}
/* A dot on the Menu button when an admin has requests waiting. */
.account-menu-wrap.has-waiting #accountMenuButton::after {
  content: '';
  width: 8px;
  height: 8px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--yellow);
}
.account-menu-item {
  display: flex;
  align-items: center;
  text-decoration: none;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: 600 14px 'DM Sans';
  text-align: left;
  cursor: pointer;
}
.account-menu-item:hover {
  background: var(--navy-bg);
}
@media (max-width: 700px) {
  .auth-widget {
    padding-left: 0;
  }
  /* Two controls beside the logo: the primary action and one quiet control. */
  .brand-logo {
    height: 52px;
  }
  .header-actions .primary-button {
    padding: 10px 14px;
  }
  .header-actions .primary-button span {
    display: none;
  }
  /* #signInButton and #accountMenuButton are .text-button, hidden by
     styles.css's blanket mobile rule; the header's sign-in control is meant to
     "stay available regardless" (README), so unhide just this widget's buttons.
     The Guide link is not needed in the row: the footer links it. */
  #authWidget .text-button {
    display: inline-flex;
  }
  .header-actions .guide-link {
    display: none;
  }
}
/* Signed-out stand-in for the write buttons: Sign in and Sign up side by side.
   In the header it sits where the quiet Sign in control was. */
.auth-lockup-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-lockup-header .auth-lockup-buttons {
  gap: 14px;
}
.auth-lockup:not(.auth-lockup-header) .auth-lockup-buttons button {
  flex: 1 1 120px;
  min-height: 44px;
}
.auth-lockup:not(.auth-lockup-header) .secondary-button {
  background: transparent;
  border: 1.5px solid rgba(24, 37, 66, 0.4);
  color: var(--ink);
}
.auth-lockup-message {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

/* The sign-in overlay: the front door (shown once per visit, unless
   snoozed), the gate shown when a signed-out visitor tries to save, edit or
   remove a commitment, and the header's own "Sign in" button all open this
   same panel. A bottom sheet on desktop; full screen below 700px, since
   docking it to the bottom on a phone left too little room and its own
   .sign-in-form used to get inlined straight into the header instead
   (the "condensing" bug — real layout, not an overlay, squeezing
   .header-actions on narrow screens). Both reuse #authSheetBody/openSignInForm. */
.auth-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  /* Opaque white, not a translucent scrim: the sheet is a destination, not a
     layer over the calendar. Nothing behind it should read through. */
  background: #fff;
}
.auth-sheet-backdrop.hidden {
  display: none;
}
.auth-sheet {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 8px 32px rgba(24, 37, 66, 0.18);
}
/* The brand strip: always visible (it doesn't scroll), carries the drag
   handle so it stays reachable however tall the panel below gets. */
.auth-sheet-hero {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-blue);
  padding: 36px 24px 0;
}
.auth-sheet-logo {
  height: 150px;
  width: auto;
  display: block;
}
.auth-sheet-handle {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 4px;
  background: rgba(24, 37, 66, 0.3);
  border-radius: 999px;
}
.auth-sheet-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
}
.auth-sheet-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  background: var(--blue-tint);
  color: var(--ink);
  border-radius: 22px 22px 0 0;
  /* Negative, not positive: pulls the panel up to overlap the hero's
     bottom edge so its rounded top reads flush against the dark blue,
     instead of leaving a gap where the backdrop's white shows through. */
  margin-top: -20px;
  padding: 28px 22px 26px;
}
.auth-sheet-panel-inner {
  width: 100%;
}
.auth-sheet-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font:
    600 12px Outfit,
    sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.7;
}
.auth-sheet-eyebrow svg {
  flex-shrink: 0;
}
.auth-sheet-title {
  margin: 8px 0 16px;
  font:
    700 28px Outfit,
    sans-serif;
  line-height: 1.15;
  color: var(--ink);
}
@media (max-width: 700px) {
  .auth-sheet-backdrop {
    align-items: stretch;
  }
  .auth-sheet {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    box-shadow: none;
  }
  .auth-sheet-hero {
    padding-top: calc(36px + env(safe-area-inset-top));
  }
  .auth-sheet-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}
.auth-sheet h2 {
  margin: 0 0 8px;
  font:
    600 17px Outfit,
    sans-serif;
  color: var(--ink);
}
.auth-sheet .auth-sheet-hint {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(24, 37, 66, 0.72);
  /* Belt-and-suspenders against clipping on the narrowest phones: wrap
     rather than let any word (or the "her[e]"-cutting content itself) run
     past the sheet's edge. */
  overflow-wrap: break-word;
  word-break: break-word;
}
.auth-sheet .auth-sheet-hint:last-of-type {
  margin-bottom: 18px;
}
.auth-sheet .auth-sheet-hint a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-sheet .auth-sheet-hint-muted {
  text-align: center;
  color: rgba(24, 37, 66, 0.65);
  margin-top: 10px;
}
.auth-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 12px;
}
.auth-sheet-actions .primary-button,
.auth-sheet-actions .secondary-button {
  flex: 1 1 120px;
  min-height: 44px;
}
.auth-sheet-actions .secondary-button {
  background: transparent;
  border: 1.5px solid rgba(24, 37, 66, 0.4);
  color: var(--ink);
}
.auth-sheet-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  padding: 4px 2px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
}
.auth-sheet-checkbox input {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border: 1.5px solid rgba(24, 37, 66, 0.45);
  border-radius: 4px;
  background: transparent;
  flex-shrink: 0;
  cursor: pointer;
}
.auth-sheet-checkbox input::after {
  content: '';
  display: block;
  width: 5px;
  height: 9px;
  margin: 2px auto 0;
  border: solid var(--ink);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
}
.auth-sheet-checkbox input:checked {
  background: var(--yellow);
  border-color: var(--yellow);
}
.auth-sheet-checkbox input:checked::after {
  transform: rotate(45deg) scale(1);
  border-color: var(--ink);
}
.auth-sheet .sign-in-form {
  margin-top: 4px;
}
/* Pick your races: the upcoming races as a ticked list inside the sheet. It
   scrolls on its own when there are many, so Save and Skip stay in view. */
.auth-sheet .onboarding-races {
  min-width: 0;
  max-height: 40vh;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  overflow-y: auto;
}
.auth-sheet .onboarding-races legend {
  padding: 0;
  margin-bottom: 4px;
  font-weight: 600;
}
.auth-sheet .onboarding-races .auth-sheet-checkbox {
  font-size: 14px;
}
.auth-sheet .onboarding-saved {
  margin: 0 0 14px;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.6;
}
.auth-sheet .onboarding-saved a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* A failed send-link/verify-code attempt, inline rather than a showToast()
   banner — the sheet's own opaque backdrop would hide that banner until
   the member closed the sheet, which defeats the point. */
.auth-sheet-error {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #b3261e;
}
.auth-sheet .sign-in-form input {
  min-height: 44px;
  /* Explicit width rather than relying solely on align-items:stretch: the
     code-form below is a column flex container, and native form controls
     have historically been inconsistent (WebKit especially) about fully
     honoring stretch alignment on their own intrinsic/UA-default width. An
     explicit width:100% + min-width:0 stops the input from falling back to
     that intrinsic width and overflowing the sheet on narrow phones. */
  width: 100%;
  min-width: 0;
  max-width: 100%;
  border: 1px solid rgba(24, 37, 66, 0.25);
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: 14px 'DM Sans';
  -webkit-text-size-adjust: 100%;
}
.auth-sheet .send-link-button {
  background: var(--yellow);
  color: var(--ink);
}
/* The 6-digit code box. Wide-tracked and centred so a typed code reads back
   the way it looks in the email, and 18px so iOS doesn't zoom the sheet on
   focus (anything under 16px triggers it). */
.auth-sheet .code-input {
  text-align: center;
  font:
    700 18px/1 'DM Sans',
    monospace;
  /* 8px on anything past ~440px wide (i.e. everywhere above the 700px
     mobile breakpoint, where this clamps to its 8px ceiling); tapers down
     on the narrowest phones so six widely-tracked digits plus the leading
     indent can't out-grow the input's own content box. */
  letter-spacing: clamp(5px, 2vw, 8px);
  text-indent: clamp(5px, 2vw, 8px);
}
.auth-sheet .code-form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}
/* .sign-in-form is a row and sets flex:1 on its input to eat the space beside
   the button. Stacked, that same rule stretches the input vertically, so the
   code form opts out of it. */
.auth-sheet .code-form input {
  flex: none;
}
/* Same reasoning as the input above: don't lean on stretch alignment alone
   to size the submit button to the column's width. */
.auth-sheet .code-form .send-link-button {
  width: 100%;
}
.auth-sheet .auth-sheet-cancel {
  display: block;
  margin-top: 8px;
  min-height: 44px;
  min-width: 44px;
  border: 0;
  background: transparent;
  color: rgba(24, 37, 66, 0.72);
  font: 600 13px 'DM Sans';
  cursor: pointer;
}
.auth-sheet .auth-name {
  display: block;
  padding: 8px 0;
  font-size: 13px;
  color: var(--ink);
}
/* The forms (sign in, join, ask to join, set a password): labelled fields in
   one column. 16px type so iOS doesn't zoom the sheet on focus. */
.auth-sheet .auth-form {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  margin-top: 10px;
}
.auth-field label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.auth-form .auth-field input,
.auth-form .auth-field textarea,
.feedback-field textarea,
.feedback-field input {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  /* Stronger than the older .sign-in-form inputs' border: 3.8:1 against the
     sheet's panel, so the box edge meets the 3:1 non-text contrast bar. */
  border: 1px solid rgba(24, 37, 66, 0.6);
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  font: 16px 'DM Sans';
}
.auth-form .auth-field textarea {
  resize: vertical;
}
.auth-field-hint {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(24, 37, 66, 0.72);
  overflow-wrap: break-word;
}
.auth-field-hint:empty {
  display: none;
}
.auth-form .send-link-button {
  width: 100%;
}
/* Password box with its show/hide eye inside the right edge. */
.password-input {
  position: relative;
}
.auth-form .password-input input {
  padding-right: 48px;
}
.password-toggle {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: rgba(24, 37, 66, 0.72);
  cursor: pointer;
}
.password-toggle .eye-shut,
.password-toggle[aria-pressed='true'] .eye-open {
  display: none;
}
.password-toggle[aria-pressed='true'] .eye-shut {
  display: block;
}
/* A text link between steps ("Join the club", "Sign in"). */
.auth-sheet .auth-sheet-link {
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 700 15px 'DM Sans';
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
/* The forced set-password step can't be backed out of. */
.auth-sheet.is-locked .auth-sheet-close {
  display: none;
}
/* At desktop width the sheet stops being a compact centered card and
   becomes a full-bleed two-column split: the brand strip as a left column
   instead of a top strip, the panel filling the rest. */
@media (min-width: 701px) {
  .auth-sheet-backdrop {
    align-items: stretch;
  }
  .auth-sheet {
    width: 100%;
    height: 100%;
    max-height: none;
    max-width: none;
    flex-direction: row;
    border-radius: 0;
    box-shadow: none;
  }
  .auth-sheet-hero {
    width: min(42%, 640px);
    padding: 0;
  }
  .auth-sheet-logo {
    height: 220px;
  }
  .auth-sheet-handle {
    display: none;
  }
  .auth-sheet-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 0;
    border-radius: 0;
    padding: 60px;
  }
  .auth-sheet-panel-inner {
    max-width: 440px;
  }
  .auth-sheet-title {
    margin-top: 14px;
    font-size: 40px;
  }
}
/* hCaptcha. The slot only exists while a sign-in email is being sent, and
   stays empty (so takes no space) unless hCaptcha decides the member needs
   to complete a challenge. */
.captcha-slot:not(:empty) {
  margin-top: 12px;
}

/* First-load state in #raceList (see index.html). Three groups of bars: the
   plan (full, yellow), the bad patch (low, grey) and it passing (rising back
   to full, green). A slow shimmer runs left to right across all twelve;
   reduced motion stops it and leaves the chart still. */
.race-loading {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}
/* Shared with the feedback panel's eyebrow. */
.race-loading-eyebrow,
.feedback-eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.race-loading-title {
  margin: 0;
  font-family: Outfit, sans-serif;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}
.race-loading-sub {
  margin: 8px 0 24px;
  color: var(--muted);
}
.race-loading-sub strong {
  color: var(--ink);
}
.race-loading-chart {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 4vw, 32px);
}
.race-loading-bars {
  display: flex;
  align-items: flex-end;
  gap: clamp(4px, 1vw, 8px);
  height: 96px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--ink);
}
.race-loading-group p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.race-loading-group span {
  flex: 1;
  border-radius: 5px 5px 0 0;
  animation: race-loading-shimmer 2.4s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.12s);
}
.race-loading-group.plan span {
  height: 100%;
  background: var(--yellow);
}
.race-loading-group.patch span {
  background: #c9d1de;
}
.race-loading-group.patch span:nth-child(1) {
  height: 55%;
}
.race-loading-group.patch span:nth-child(2),
.race-loading-group.patch span:nth-child(3) {
  height: 30%;
}
.race-loading-group.patch span:nth-child(4) {
  height: 50%;
}
.race-loading-group.passes span {
  background: var(--green);
}
.race-loading-group.passes span:nth-child(1) {
  height: 70%;
}
.race-loading-group.passes span:nth-child(2) {
  height: 82%;
}
.race-loading-group.passes span:nth-child(3),
.race-loading-group.passes span:nth-child(4) {
  height: 100%;
}
@keyframes race-loading-shimmer {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}
@media (max-width: 700px) {
  .race-loading {
    padding: 20px;
  }
  .race-loading-title {
    font-size: 24px;
  }
  .race-loading-bars {
    height: 64px;
  }
  .race-loading-group p {
    font-size: 11px;
  }
}
/* Next race countdown in the hero (renderNextRace in app.js). Stacked under
   the intro on phones; a right-hand column beside the hero copy from
   900px up. */
.next-race {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
  text-decoration: none;
}
.next-race:hover {
  background: rgba(255, 255, 255, 0.12);
}
.next-race:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}
.next-race-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.next-race-foot {
  display: flex;
  justify-content: flex-end;
}
.next-race-eyebrow {
  color: #f6cf69;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
}
.next-race-badge {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--blue-tint);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.next-race-badge.club-focus {
  background: var(--yellow);
}
.next-race-count {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-family: Outfit, sans-serif;
}
.next-race-count strong {
  color: var(--yellow);
  font-size: 64px;
  line-height: 0.9;
  letter-spacing: -2px;
}
.next-race-count.is-word strong {
  font-size: 44px;
  letter-spacing: -1px;
}
.next-race-count span {
  font-size: 20px;
  font-weight: 600;
}
.next-race-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}
.next-race-name {
  font:
    600 20px/1.2 Outfit,
    sans-serif;
}
.next-race-meta {
  color: #edf0f7;
  font-size: 15px;
}
.next-race-open {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}
@media (min-width: 900px) {
  .hero-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    column-gap: 48px;
    align-items: start;
  }
  .hero-copy > * {
    grid-column: 1;
  }
  /* Grid items don't collapse margins: keep the gaps the block layout had. */
  .hero-copy > p:not(.eyebrow) {
    margin-bottom: 0;
  }
  .hero-copy .view-toggle {
    margin-top: 26px;
  }
  .hero-copy > .next-race {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: center;
    margin-top: 0;
    padding: 26px;
  }
  .next-race-count strong {
    font-size: 96px;
    letter-spacing: -4px;
  }
  .next-race-count.is-word strong {
    font-size: 64px;
    letter-spacing: -2px;
  }
  .next-race-count span {
    font-size: 24px;
  }
  .next-race-name {
    font-size: 22px;
  }
}

/* App feedback: a quiet footer at the foot of the page, and the inline panel
   its button opens. The panel matches .add-panel (white card, 9px radius,
   the same field and footer rules). Measured contrast (WCAG 2.1, see
   style-guide.html "App feedback"): footer text --muted on --canvas 5.9:1;
   button text --ink on white 15.2:1, white on --ink when open 15.2:1, --ink
   on the --navy-bg hover 13.6:1; hint text --muted on white 6.2:1; eyebrow
   --green on white 6.6:1; error #b3261e on #fdecec 5.7:1; success --green on
   --green-bg 5.9:1. Borders (--ink at 60%) 4.2:1 on white and 3.9:1 where the
   button meets --canvas. Floor: text 5.7:1, UI 3.9:1. */
.app-footer {
  --footer-navy: #0d1b2a;
  --footer-blue: #3694d7;
  margin-top: 48px;
}
.app-footer .feedback-panel {
  margin-bottom: 32px;
}
.app-footer-band {
  background: var(--footer-blue);
  color: var(--footer-navy);
}
.app-footer-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  padding: 28px 0;
}
.app-footer-logo {
  display: block;
  width: 240px;
  height: 76px;
  overflow: hidden;
  border-radius: 4px;
}
.app-footer-logo img {
  display: block;
  width: 312px;
  max-width: none;
  margin: -37px 0 0 -39px;
}
.app-footer-text {
  flex: 1 1 auto;
  margin: 0;
  color: var(--footer-navy);
  font: 800 22px/1.3 Outfit;
  text-align: right;
  text-transform: uppercase;
}
.app-footer-links {
  background: var(--footer-navy);
  color: #e8e8e8;
}
.app-footer-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px 64px;
  padding-top: 56px;
}
.app-footer-columns nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.app-footer-columns h2 {
  margin: 0 0 8px;
  color: var(--yellow);
  font: 700 14px Outfit;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.app-footer-columns a {
  padding: 10px 0;
  color: #e8e8e8;
  line-height: 24px;
  text-decoration: none;
}
.app-footer-columns a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.app-footer-columns a:focus-visible,
.app-footer-logo:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}
.app-footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  margin-top: 48px;
  padding: 24px 0 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 14px;
  line-height: 20px;
}
.app-footer-legal p {
  margin: 0;
}
.feedback-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 17px;
  border: 1px solid rgba(24, 37, 66, 0.6);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font: 700 15px 'DM Sans';
  cursor: pointer;
}
.feedback-button:hover {
  background: var(--navy-bg);
}
.feedback-button[aria-expanded='true'] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.app-footer-band .feedback-button {
  border-color: var(--footer-navy);
  border-radius: 999px;
  background: var(--footer-navy);
  color: #fff;
  padding: 10px 22px;
}
.app-footer-band .feedback-button svg {
  color: var(--yellow);
}
.app-footer-band .feedback-button:hover {
  background: #1b3350;
}
.app-footer-band .feedback-button:focus-visible {
  outline: 3px solid var(--footer-navy);
  outline-offset: 3px;
}
.app-footer-band .feedback-button[aria-expanded='true'] {
  background: #fff;
  color: var(--footer-navy);
}
.feedback-panel {
  margin-top: 16px;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 2px 6px rgba(25, 37, 66, 0.05);
}
.feedback-panel:focus {
  outline: none;
}
.feedback-heading h2 {
  margin: 0;
  color: var(--ink);
  font: 700 28px Outfit;
  line-height: 1.15;
}
.feedback-intro {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 15px;
}
.feedback-field label {
  display: block;
  margin: 18px 0 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
}
.feedback-field textarea {
  min-height: 132px;
  line-height: 1.5;
  resize: vertical;
}
.feedback-field textarea:focus-visible {
  outline: 3px solid #285ba8;
  outline-offset: 3px;
}
.feedback-field [aria-invalid='true'] {
  border-color: #b3261e;
  box-shadow: 0 0 0 1px #b3261e;
}
.feedback-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
/* The honeypot: off-screen rather than display:none, since some bots skip
   fields that are not rendered. aria-hidden and tabindex=-1 keep people out. */
.feedback-trap {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
/* Rendered even when empty (zero size), so text written into this
   role="alert" is announced. */
.feedback-status {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-radius: 9px;
  background: #fdecec;
  color: #b3261e;
  font-size: 14px;
  font-weight: 700;
}
.feedback-status:empty {
  margin: 0;
  padding: 0;
}
.feedback-done-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 12px 16px;
  border-radius: 9px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 15px;
  font-weight: 700;
}
.feedback-done-title:focus {
  outline: none;
}
.feedback-done-title:focus-visible {
  outline: 3px solid #285ba8;
  outline-offset: 3px;
}
.feedback-done-title svg {
  flex-shrink: 0;
}
@media (max-width: 700px) {
  .app-footer-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .app-footer-logo {
    width: 220px;
    height: 70px;
  }
  .app-footer-logo img {
    width: 286px;
    margin: -34px 0 0 -36px;
  }
  .app-footer-text {
    text-align: left;
  }
  .app-footer-band .feedback-button {
    min-height: 48px;
  }
  .app-footer-columns {
    grid-template-columns: 1fr;
    gap: 0;
    padding-top: 32px;
  }
  .app-footer-columns nav {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
  }
  .app-footer-columns nav:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
  .app-footer-columns a {
    display: flex;
    align-items: center;
    min-height: 44px;
    box-sizing: border-box;
  }
  .app-footer-legal {
    flex-direction: column;
    gap: 8px;
    margin-top: 32px;
  }
  .feedback-panel {
    padding: 22px 18px;
  }
  .feedback-heading h2 {
    font-size: 24px;
  }
}

/* The member's own name on the commitment form is fixed, so it reads as a
   label, not a field to type in. */
.name-row input[readonly] {
  background: #f1f3f7;
  color: var(--muted);
  cursor: default;
}

/* Results on past races (approved members only) */
.result-entry {
  border-bottom: 1px solid #eff1f4;
}
.roster-group .result-entry:last-child {
  border-bottom: 0;
}
.result-entry .roster-entry {
  flex-wrap: wrap;
  border-bottom: 0;
}
.result-entry .roster-who {
  flex-wrap: wrap;
}
.result-summary {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}
.result-status {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.result-status.result-dnf,
.result-status.result-dns {
  color: var(--muted);
}
.result-places {
  color: var(--muted);
  font-size: 13px;
}
.result-pb {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--green-bg);
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.result-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.result-edit,
.result-form .roster-edit {
  min-height: 44px;
}
.result-form {
  margin: 4px 0 14px;
}
.result-fieldset {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--canvas);
}
.result-legend {
  padding: 0 6px;
  font-size: 14px;
  font-weight: 700;
}
.result-field {
  margin-top: 12px;
}
.result-input {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #727b8f;
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  font:
    400 16px 'DM Sans',
    Arial,
    sans-serif;
}
.result-note-input {
  resize: vertical;
}
.result-places-row {
  display: flex;
  gap: 12px;
}
.result-places-row .result-field {
  flex: 1;
  min-width: 0;
}
.result-pb-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 8px;
  font-weight: 600;
}
.result-pb-check input {
  width: 20px;
  height: 20px;
}
.result-error {
  margin: 12px 0 0;
  color: #b3261e;
  font-weight: 600;
}
.result-form .save-row {
  margin-top: 14px;
}
.result-form .choice-label {
  color: var(--brand-blue-text);
}
.result-places-row .result-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* "How did it go?" reminder on the home screen */
.result-reminder {
  margin: 0 0 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-left: 6px solid var(--brand-blue);
  border-radius: 14px;
  background: #fff;
}
.result-reminder-title {
  margin: 0 0 4px;
  font-size: 18px;
}
.result-reminder-text {
  margin: 0 0 12px;
  color: var(--muted);
}
.result-reminder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.result-reminder-actions button {
  min-height: 44px;
}
.result-reminder-add {
  padding: 8px 16px;
  border: 0;
  border-radius: 9px;
  background: var(--ink);
  color: #fff;
  font: 700 14px 'DM Sans';
  cursor: pointer;
}
/* Race screen for a visitor or an account waiting for approval: counts and a
   way in, no names. */
.members-only-count {
  margin: 0 0 6px;
  color: var(--ink);
  font-weight: 700;
}
.members-only-note {
  margin: 0 0 12px;
}
