/* TSL Tracks homepage modules v1.0 */
.tsl-track-module {
  --tsl-red: #e31b23;
  --tsl-dark: #15191f;
  --tsl-dark-2: #20252d;
  --tsl-line: #e4e7eb;
  --tsl-muted: #7b8492;
  --tsl-soft: #f6f7f9;
  width: 100%;
  margin: 0 0 22px;
  background: #fff;
  border: 1px solid var(--tsl-line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 26px rgba(18, 24, 31, .06);
  color: #20242a;
  font-size: 13px;
}
.tsl-track-module * { box-sizing: border-box; }
.tsl-mod-head {
  position: relative;
  display: flex;
  min-height: 82px;
  background: linear-gradient(120deg, var(--tsl-dark) 0%, var(--tsl-dark-2) 100%);
  color: #fff;
}
.tsl-mod-head__accent { width: 5px; flex: 0 0 5px; background: var(--tsl-red); }
.tsl-mod-head__content { min-width: 0; padding: 14px 16px 13px; }
.tsl-mod-eyebrow {
  margin-bottom: 5px;
  color: #aeb6c2;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  line-height: 1.2;
}
.tsl-mod-title {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tsl-mod-meta { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 7px; color: #c7cdd5; font-size: 10px; font-weight: 600; }
.tsl-mod-meta span + span::before { content: '•'; margin-right: 7px; color: var(--tsl-red); }
.tsl-mod-table-wrap { width: 100%; overflow-x: auto; }
.tsl-track-module .tsl-mod-table { width: 100%; margin: 0; border: 0; border-collapse: collapse; background: #fff; }
.tsl-track-module .tsl-mod-table thead th {
  padding: 10px 8px;
  border: 0;
  border-bottom: 1px solid var(--tsl-line);
  background: #f5f6f8;
  color: #737c89;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .07em;
  text-align: left;
  white-space: nowrap;
}
.tsl-track-module .tsl-mod-table tbody td {
  padding: 8px 8px;
  border: 0;
  border-bottom: 1px solid #edf0f3;
  background: #fff;
  vertical-align: middle;
  line-height: 1.25;
}
.tsl-track-module .tsl-mod-table tbody tr:last-child td { border-bottom: 0; }
.tsl-track-module .tsl-mod-table tbody tr:hover td { background: #fafbfc; }
.tsl-col-pos { width: 42px; text-align: center !important; }
.tsl-col-team { width: 54px; text-align: center !important; }
.tsl-col-num { width: 44px; text-align: right !important; }
.tsl-col-perf { width: 72px; text-align: right !important; }
.tsl-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 27px;
  height: 27px;
  padding: 0 6px;
  border-radius: 8px;
  background: #f0f2f5;
  color: #3b424c;
  font-weight: 800;
  font-size: 11px;
}
.tsl-rank--1 { background: #f4bf23; color: #1e1b10; }
.tsl-rank--2 { background: #cbd0d6; color: #20252b; }
.tsl-rank--3 { background: #b9783e; color: #fff; }
.tsl-driver-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #22272d !important;
  font-weight: 700;
  text-decoration: none !important;
}
.tsl-driver-link:hover { color: var(--tsl-red) !important; }
.tsl-driver-link span { overflow: hidden; text-overflow: ellipsis; }
.tsl-mod-flag { width: 20px; height: 13px; object-fit: cover; flex: 0 0 auto; border: 1px solid rgba(0,0,0,.08); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.tsl-team-pill {
  display: inline-block;
  min-width: 34px;
  padding: 4px 6px;
  border-radius: 7px;
  background: #f0f2f5;
  color: #555e69 !important;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  text-decoration: none !important;
}
.tsl-team-pill:hover { background: #e6e8eb; color: #20242a !important; }
.tsl-gap { color: #59616b; font-weight: 700; white-space: nowrap; }
.tsl-mod-empty { padding: 16px; color: var(--tsl-muted); background: #fafbfc; text-align: center; }
.tsl-mod-more {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  border-top: 1px solid var(--tsl-line);
  background: #fff;
  color: #252a31 !important;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  text-decoration: none !important;
  text-transform: uppercase;
}
.tsl-mod-more:hover { background: #f7f8fa; color: var(--tsl-red) !important; }
.tsl-mod-more span:last-child { font-size: 16px; line-height: 1; color: var(--tsl-red); }

/* Neutralize old Tracks module rules and Helix table styling */
.tsl-track-module table tr, .tsl-track-module table td, .tsl-track-module table th { box-shadow: none !important; }
.tsl-track-module .project-name, .tsl-track-module .fulltablelink,
.tsl-track-module .mod_tracks_latest_results__roundname,
.tsl-track-module .mod_tracks_latest_results__eventtype,
.tsl-track-module .mod_tracksresults__roundname,
.tsl-track-module .mod_tracksresults__eventtype { display: none !important; }

@media (max-width: 430px) {
  .tsl-track-module { border-radius: 12px; font-size: 12px; }
  .tsl-mod-head { min-height: 74px; }
  .tsl-mod-head__content { padding: 12px 12px 11px; }
  .tsl-mod-title { font-size: 16px; }
  .tsl-track-module .tsl-mod-table thead th { padding: 8px 6px; font-size: 8px; }
  .tsl-track-module .tsl-mod-table tbody td { padding: 7px 6px; }
  .tsl-col-pos { width: 36px; }
  .tsl-col-team { width: 48px; }
  .tsl-col-num { width: 38px; }
  .tsl-col-perf { width: 62px; }
  .tsl-rank { min-width: 24px; height: 24px; border-radius: 7px; font-size: 10px; }
  .tsl-mod-flag { width: 18px; height: 12px; }
  .tsl-driver-link { gap: 5px; }
  .tsl-team-pill { min-width: 30px; padding: 3px 5px; font-size: 9px; }
}

/* Phase 8 v0.3 - team identity / No Team fallback */
.tsl-track-module .tsl-mod-team-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 24px;
  flex: 0 0 30px;
}
.tsl-track-module .tsl-mod-team-logo {
  display: block;
  width: auto;
  max-width: 29px;
  height: auto;
  max-height: 23px;
  object-fit: contain;
}
.tsl-track-module .tsl-mod-team-logo-wrap--empty {
  border: 1px dashed #cbd1d8;
  border-radius: 7px;
  background: #f1f3f5;
  color: #8a929c;
  font-size: 12px;
  font-weight: 900;
}
.tsl-track-module .tsl-team-standing-link { gap: 9px; }
.tsl-track-module .tsl-team-none {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #838b95;
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}
.tsl-track-module .tsl-team-none__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border: 1px dashed #c8ced6;
  border-radius: 7px;
  background: #f2f4f6;
  color: #8b939d;
  font-size: 12px;
  font-weight: 900;
}
@media (max-width: 430px) {
  .tsl-track-module .tsl-team-none__text { display: none; }
  .tsl-track-module .tsl-mod-team-logo-wrap { width: 26px; height: 22px; flex-basis: 26px; }
  .tsl-track-module .tsl-mod-team-logo { max-width: 25px; max-height: 21px; }
}
