.race-history-tools{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;margin:12px 0;color:#42677f;min-width:0}
.race-history-tools label{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600}.race-history-tools select{width:auto;max-width:160px;padding:8px 28px 8px 10px;background:#fff;border:1px solid #bed8e8;border-radius:8px;color:#244f6d;font:inherit}.race-history-tools small{flex:1;min-width:180px;font-size:12px}.race-filter-status{width:100%;margin:0;font-size:12px}
.race-pagination{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;font-size:12px}.race-pagination button{border:1px solid #bdd8e8;border-radius:7px;padding:8px 12px;background:#f2f9fd;color:#175a84;font:inherit;cursor:pointer}.race-pagination button:disabled{opacity:.45;cursor:default}
.race-records-scroll{max-height:none;min-width:0;max-width:100%;scrollbar-gutter:auto}
.race-records-table tr[hidden],.race-records-table tbody[hidden]{display:none!important}
@media(max-width:640px){
#record,#detail,#detailpanel,.rep,.race-records{min-width:0;max-width:100%;box-sizing:border-box}
.race-records-scroll{overflow:visible;border:0;border-radius:0}.race-records-table{display:block;width:100%;min-width:0!important;max-width:100%;table-layout:auto}.race-records-table thead{display:none}.race-records-table tbody{display:block;width:100%;min-width:0}
.race-records-table .race-event tr,.race-records-table .race-event td{display:block;width:100%;box-sizing:border-box}
.race-event-toggle{display:grid;grid-template-columns:18px minmax(0,1fr) auto;gap:6px;padding:12px 8px;border:1px solid #cfe2ef;border-radius:9px;margin:10px 0 4px;box-sizing:border-box;white-space:normal}.race-event-name{min-width:0;overflow-wrap:anywhere}.race-event-best{font-size:12px;white-space:normal}.race-event-count{grid-column:2/4;font-size:11px}.coach-event-label{grid-column:2/4;margin-left:0}
.race-records-table .race-history>tr:not(.race-page-row){display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr) minmax(0,.8fr);border:1px solid #d8e7f1;border-radius:9px;overflow:hidden;margin:8px 0;background:#fff}
.race-records-table .race-history>tr>td{display:block;min-width:0;max-width:100%;width:auto;box-sizing:border-box;padding:9px 8px;text-align:left;white-space:normal;overflow-wrap:anywhere;border:0;font-size:13px}.race-history>tr>td[data-label]::before{content:attr(data-label);display:block;color:#56738a;font-size:10px;font-weight:600;margin-bottom:4px}
.race-records-table .race-history>tr>td:nth-child(4){grid-column:1/3;border-top:1px solid #e4edf4}.race-records-table .race-history>tr>td:nth-child(5){grid-column:3;border-top:1px solid #e4edf4}.race-records-table .race-page-row{display:block}.race-records-table .race-page-row>td{padding:10px 0}.race-pagination{gap:5px;font-size:11px}.race-pagination button{padding:9px}
.race-history .saved-splits{font-size:11px}.race-history .saved-splits li{display:block}.race-history .saved-splits li>*{display:block;max-width:100%}.race-history .saved-splits ul{margin-left:0}.race-pb{margin-left:0}
}
@media print{.race-history-tools,.race-page-row{display:none!important}.race-records-table .race-history>tr[data-race-date][hidden]{display:table-row!important}}
/* Event headings and record cells have distinct, aligned visual fields. */
.race-records-scroll{border-color:#c9e1ee;background:#fff}
.race-records-table .race-event td{border-top:8px solid white;background:#eff8fd}
/* Each event header is a one-row tbody, so the sheet's last-row divider would sit below every card. */
.race-records-table tbody.race-event > tr > td { border-bottom: 0; }
.race-event-toggle{display:grid;grid-template-columns:24px minmax(0,1fr) auto auto;gap:12px;padding:14px 16px;align-items:center;background:#eff8fd;border-left:4px solid transparent;box-sizing:border-box}
.race-event-toggle:hover{background:#e3f3fc}.race-event-toggle[aria-expanded=true]{background:#def0fb;border-left-color:#1689ba}
.race-chevron{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:white;color:#14749b;font-size:22px}
.race-event-name{font-size:14px;line-height:1.45}.race-event-name small{margin-top:2px}
.race-event-best{padding:7px 10px;border:1px solid #b8dce9;border-radius:8px;background:#fff;color:#175d7e;font-size:13px}
.race-event-count{padding:6px 8px;border-radius:6px;background:#e0edf6;font-size:11px;white-space:nowrap}.coach-event-label{grid-column:2/-1;margin:0}
.race-records-table .race-history>tr[data-race-date]>td{border-right:1px solid #e0ebf2;border-bottom:1px solid #dce8f0;vertical-align:top;padding:13px 12px}
.race-records-table .race-history>tr[data-race-date]>td:last-child{border-right:0}
.race-records-table .race-history>tr[data-race-date]>td:nth-child(2){font-weight:700;color:#164b69;font-variant-numeric:tabular-nums}
.race-records-table .race-history>tr[data-race-date]>td:nth-child(3){font-variant-numeric:tabular-nums}
.race-history-tools{padding:12px 14px;border:1px solid #d8e8f2;border-radius:10px;background:#f6fbfe}
@media(max-width:640px){
.race-event-toggle{grid-template-columns:22px minmax(0,1fr) auto;gap:8px;padding:12px 9px;border-left:4px solid transparent;border-radius:10px}
.race-event-name{font-size:13px}.race-event-best{padding:6px;font-size:11px}.race-event-count{grid-column:2/4;justify-self:start;padding:3px 7px}.coach-event-label{grid-column:2/4}
.race-records-table .race-history>tr[data-race-date]{gap:1px;border:1px solid #cbdfe9;background:#dbe8f0!important;box-shadow:0 2px 5px #12334a08}
.race-records-table .race-history>tr[data-race-date]>td{padding:10px 8px;border:0;background:#fff;min-height:58px;font-size:12px}
.race-records-table .race-history>tr.is-best>td{background:#f0f9ff}
.race-records-table .race-history>tr[data-race-date]>td::before{font-size:10px;letter-spacing:.02em;margin-bottom:6px}
.race-records-table .race-event td{border-top:0}
.race-records-table .race-event:not(.race-group-open) > tr > td { background: transparent; }
.race-records-table .race-event { margin-top: 10px; }
.race-event .race-event-toggle { margin: 0; }
.race-history-tools{padding:10px}.race-records-table .race-history .race-edit{font-size:12px;padding:4px 0}
}
/* Open heading and its record body share one boundary and background. */
.race-records-table .race-group-open>tr>td{border-left:2px solid #73bbdb;border-right:2px solid #73bbdb;border-top:2px solid #73bbdb;background:#e8f6fd}
.race-group-open .race-event-toggle{border-radius:0;background:#e8f6fd;border-left:0}
.race-records-table .race-group-content>tr>td:first-child{border-left:2px solid #73bbdb}
.race-records-table .race-group-content>tr>td:last-child{border-right:2px solid #73bbdb}
.race-records-table .race-group-content{background:#f4fbff}
.race-records-table .race-group-content{border-bottom:2px solid #73bbdb}
@media(max-width:640px){
.race-records-table .race-group-open>tr>td{border:2px solid #73bbdb;border-bottom:0;border-radius:12px 12px 0 0;}
.race-group-open .race-event-toggle{margin:0;border:0;border-radius:10px 10px 0 0}
.race-records-table .race-group-content{box-sizing:border-box;padding:4px 8px 8px;border:2px solid #73bbdb;border-top:0;border-radius:0 0 12px 12px;margin:0 0 12px}
.race-records-table .race-group-content>tr>td:first-child,.race-records-table .race-group-content>tr>td:last-child{border-left:0;border-right:0}
}

.race-stroke-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}
.race-stroke-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #aacbdc;
  border-radius: 10px;
  background: white;
  color: #245773;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}
.race-stroke-tabs button[aria-selected="true"] {
  color: white;
  background: #115c80;
  border-color: #115c80;
}
.race-stroke-tabs button:focus-visible { outline: 3px solid #1384bf; outline-offset: 2px; }
.race-stroke-tabs svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.race-records-table[hidden] { display: none !important; }

.race-stroke-tabs .stroke-short,
.record-footer-actions .record-action-short { display: none; }
.record-footer-actions svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#view-overview .record-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.record-footer-actions .btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
}

@media screen and (max-width: 640px) {
  .race-stroke-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(46px, 1fr);
    gap: 4px;
    max-width: 100%;
    overflow-x: auto;
    padding: 3px;
  }
  .race-stroke-tabs button {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    min-width: 0;
    padding: 6px 1px;
    font-size: 12px;
    line-height: 1.15;
  }
  .race-stroke-tabs .stroke-short,
  .record-footer-actions .record-action-short { display: inline; }
  .race-stroke-tabs .stroke-full,
  .record-footer-actions .record-action-full { display: none; }

  #view-overview .quick-grid,
  #view-overview .record-footer-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  #view-overview .quick-grid .quick {
    width: 100%;
    max-width: 125px;
    min-width: 0;
    min-height: 44px;
    aspect-ratio: 1;
    box-sizing: border-box;
    justify-self: center;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 2px;
    text-align: center;
  }
  #view-overview .quick__icon { width: 28px; height: 28px; }
  #view-overview .quick__title { font-size: 13px; line-height: 1.15; }
  #view-overview .quick__sub { display: none; }
  #view-overview .record-footer-actions .btn {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    box-sizing: border-box;
    flex-direction: column;
    gap: 4px;
    padding: 6px 2px;
    font-size: 13px;
    text-align: center;
  }
}
@media print {
  #view-overview .record-footer-actions, .race-stroke-tabs { display: none; }
}
