.relay-calc-page [hidden] { display: none !important; }
.relay-calc-page { --relay-ink: #0b2a5b; --relay-muted: #586c89; }

/* Keep the club calculator on the site's original shared styles. */
.relay-mode-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.relay-mode-switch button { border: 1px solid #c8d8eb; border-radius: 999px; padding: 8px 14px; background: #fff; color: #526b90; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600; line-height: 1.3; min-height: 36px; }
.relay-mode-switch button:hover { background: #f1f6ff; color: #0b2a5b; }
.relay-mode-switch button.is-active { background: #e8f1ff; border-color: #b8cce9; color: #0b2a5b; }
.relay-mode-switch button:focus-visible, .relay-generic-panel :is(button, input, select):focus-visible, .relay-login-panel button:focus-visible, #relay-dtsc-retry:focus-visible { outline: 3px solid #4489ef; outline-offset: 3px; }
.relay-mode-switch button, .relay-generic-panel button { touch-action: manipulation; }
.relay-generic-panel, .relay-generic-panel *, .relay-generic-panel *::before, .relay-generic-panel *::after { box-sizing: border-box; }
.relay-generic-panel button, .relay-generic-panel input, .relay-generic-panel select { font-family: inherit; }
.relay-generic-panel button:disabled { opacity: .5; cursor: not-allowed; }
.relay-calc-page .relay-generic-panel { padding: clamp(18px, 2.5vw, 28px); }
.relay-section-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.relay-generic-panel h2, .relay-generic-panel h3 { color: var(--relay-ink); margin: 0; }
.relay-generic-panel h2 { font-size: clamp(22px, 2.5vw, 28px); line-height: 1.25; }
.relay-generic-panel h3 { font-size: 20px; }
.relay-mixed-control { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; min-height: 44px; color: var(--relay-ink); font-size: 14px; font-weight: 600; }
.relay-mixed-control input { margin: 0; height: 18px; width: 18px; accent-color: #0b2a5b; }
#relay-generic-time-hint { margin: 12px 0 22px; font-size: 13px; line-height: 1.6; color: var(--relay-muted); }
#relay-generic-count { color: var(--relay-muted); font-size: 12px; white-space: nowrap; }
.relay-generic-swimmers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.relay-entry { min-width: 0; margin: 0; border: 1px solid #d7e2f1; border-radius: 16px; padding: 18px; background: #fff; }
.relay-entry-top { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; }
.relay-field { display: grid; gap: 7px; min-width: 0; color: #36516f; font-size: 13px; font-weight: 600; }
.relay-field input, .relay-field select { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #c7d5e8; border-radius: 10px; background: white; color: var(--relay-ink); padding: 10px 12px; font-size: 16px; font-weight: 400; }
.relay-field input::placeholder { color: #647c9b; opacity: 1; }
.relay-name-field { flex: 1; }
.relay-sex-field { width: 78px; flex: 0 0 78px; }
.relay-field.relay-sex-field select { padding-left: 9px; padding-right: 4px; font-size: 14px; }
.relay-sex-field .dtsc-select__trigger { min-height: 46px; padding: 10px; gap: 8px; border-radius: 10px; font-size: 14px; font-weight: 400; }
.relay-remove-swimmer { display: grid; place-items: center; border: 1px solid #f1c6ce; background: #fff2f4; color: #b32b42; border-radius: 10px; height: 44px; width: 44px; flex: 0 0 44px; cursor: pointer; font-size: 24px; line-height: 1; }
.relay-remove-swimmer:hover:enabled { background: #ffe3e8; border-color: #df94a2; }
.relay-entry-times { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.relay-entry-times .relay-field { font-size: 12px; }
.relay-entry-times input { padding: 10px; font-variant-numeric: tabular-nums; }
.relay-stroke-0 > span { color: #007d86; }
.relay-stroke-1 > span { color: #a96712; }
.relay-stroke-2 > span { color: #bb437b; }
.relay-stroke-3 > span { color: #346cbd; }
.relay-primary, .relay-secondary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; cursor: pointer; min-height: 44px; border-radius: 999px; padding: 11px 18px; font-family: inherit; font-size: 14px; line-height: 1.25; font-weight: 700; transition: background .15s, border-color .15s; }
.relay-primary { border: 1px solid #0b2a5b; background: #0b2a5b; color: white; box-shadow: 0 3px 8px #0b2a5b16; }
.relay-primary:hover { background: #184786; border-color: #184786; }
.relay-primary > span { font-size: 20px; line-height: 1; margin-left: 4px; }
.relay-secondary { border: 1px solid #c8d8eb; background: #fff; color: var(--relay-ink); }
.relay-secondary:hover:enabled { background: #edf4ff; border-color: #9dbce5; }
#relay-generic-clear { color: #526b90; background: #f6f9fe; }
#relay-generic-clear::before { content: '\21ba'; font-size: 20px; line-height: 1; }
#relay-generic-clear:hover { color: #0b2a5b; background: #edf4ff; }
.relay-entry-actions { display: flex; align-items: center; gap: 10px; margin: 18px 0 22px; flex-wrap: wrap; }
.relay-add-group { display: flex; align-items: center; gap: 10px; }
#relay-generic-clear { margin-left: auto; }
.relay-calculate-row { display: flex; border-top: 1px solid #dde6f2; padding-top: 22px; }
.relay-calculate-row .relay-primary { padding: 14px 22px; }
.relay-generic-results { margin-top: 28px; padding-top: 24px; border-top: 1px solid #dde6f2; scroll-margin-top: 24px; }
.relay-generic-results > h3 { margin-bottom: 16px; }
.relay-generic-team-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.relay-generic-results .relay-team-swimmer { cursor: default; }

/* Club relay teams and available swimmers use the meet-page sex bands. */
#relay-dtsc-panel :is(.relay-team-swimmer,.relay-roster-chip,.relay-exclude-chip).relay-sex-male,
#relay-dtsc-panel :is(.relay-roster-chip,.relay-exclude-chip).male {
  border: 1px solid #d6deed !important;
  border-left: 4px solid #7fb0ff !important;
}
#relay-dtsc-panel :is(.relay-team-swimmer,.relay-roster-chip,.relay-exclude-chip).relay-sex-female,
#relay-dtsc-panel :is(.relay-roster-chip,.relay-exclude-chip).female {
  border: 1px solid #d6deed !important;
  border-left: 4px solid #f3a7c3 !important;
}
.relay-generic-results .relay-team-card { min-width: 0; }
.relay-generic-results .relay-summary { font-size: 16px; }
.relay-form-error { background: #fff2f3; border: 1px solid #f1bfc7; border-radius: 10px; color: #9c2538; padding: 12px 14px; font-size: 14px; line-height: 1.5; }
.relay-generic-panel [aria-invalid=true] { border-color: #c32e49; background: #fff8f9; }
.relay-login-panel p, .relay-load-status { color: #586c89; font-size: 14px; line-height: 1.6; }
.relay-login-panel p { margin: 0; font-style: italic; }
.relay-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); overflow: hidden; white-space: nowrap; }
@media (max-width: 1100px) {
  .relay-entry-times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .relay-generic-team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .relay-generic-swimmers, .relay-generic-team-grid { grid-template-columns: minmax(0, 1fr); }
  .relay-calc-page .relay-generic-panel { padding: 18px 14px; }
  .relay-entry { padding: 14px; }
  .relay-section-heading { gap: 4px 12px; }
  .relay-entry-actions { gap: 8px; }
  .relay-secondary { font-size: 13px; padding: 10px 13px; }
  .relay-calculate-row .relay-primary { width: 100%; }
  .relay-mode-switch button { padding: 8px 10px; font-size: 12px; min-height: 40px; }
}
@media (max-width: 360px) {
  .relay-calc-page .relay-generic-panel { padding: 16px 11px; }
  .relay-entry { padding: 12px; }
  .relay-entry-top { gap: 6px; }
  .relay-sex-field { width: 68px; flex-basis: 68px; }
  .relay-field input { padding: 10px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .relay-primary, .relay-secondary { transition: none; }
}
