.tfdf-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tfdf-drivers-table-wrap .tfdf-table-search {
  width: 100%;
  max-width: 420px;
  padding: 10px 12px;
  margin: 0 0 12px 0;
  border: 1px solid rgba(0,0,0,0.15);
  border-radius: 8px;
}

.tfdf-sortable thead th {
  cursor: pointer;
  user-select: none;
}

.tfdf-sortable thead th[data-dir="asc"]::after { content: " ▲"; font-size: .85em; }
.tfdf-sortable thead th[data-dir="desc"]::after { content: " ▼"; font-size: .85em; }

/* =========================================================
   TFDF Driver page: header wrapping + column sizing fixes
   ========================================================= */

/* Stop headers breaking into "Typ e", "Val ue", "Fini sh", etc */
.tfdf-driver-penalties .tfdf-table th,
.tfdf-driver-recent-results .tfdf-table th,
.tfdf-driver-positions-gained .tfdf-table th,
.tfdf-driver-vehicles-used .tfdf-table th,
.tfdf-driver-team-history .tfdf-table th {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

/* Make Session column narrower so other columns have room (desktop) */
@media (min-width: 900px) {
  /* Penalties: Date | Session | Type | Value | Reason */
  .tfdf-driver-penalties .tfdf-table th:nth-child(2),
  .tfdf-driver-penalties .tfdf-table td:nth-child(2) {
    width: 38%;
  }

  /* Recent results: Date | Session | Circuit | Finish | Points */
  .tfdf-driver-recent-results .tfdf-table th:nth-child(2),
  .tfdf-driver-recent-results .tfdf-table td:nth-child(2) {
    width: 40%;
  }

  /* Give small columns a sensible minimum width */
  .tfdf-driver-penalties .tfdf-table th:nth-child(3),
  .tfdf-driver-penalties .tfdf-table td:nth-child(3),
  .tfdf-driver-penalties .tfdf-table th:nth-child(4),
  .tfdf-driver-penalties .tfdf-table td:nth-child(4),
  .tfdf-driver-recent-results .tfdf-table th:nth-child(4),
  .tfdf-driver-recent-results .tfdf-table td:nth-child(4),
  .tfdf-driver-recent-results .tfdf-table th:nth-child(5),
  .tfdf-driver-recent-results .tfdf-table td:nth-child(5) {
    min-width: 72px;
  }

  /* Circuit column gets a bit more breathing room */
  .tfdf-driver-recent-results .tfdf-table th:nth-child(3),
  .tfdf-driver-recent-results .tfdf-table td:nth-child(3) {
    width: 30%;
  }
}
/* =========================================================
   TFDF Driver page: header wrapping + column sizing fixes
   ========================================================= */

/* Stop headers breaking into "Typ e", "Val ue", "Fini sh", etc */
.tfdf-driver-penalties .tfdf-table th,
.tfdf-driver-recent-results .tfdf-table th,
.tfdf-driver-positions-gained .tfdf-table th,
.tfdf-driver-vehicles-used .tfdf-table th,
.tfdf-driver-team-history .tfdf-table th {
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
}

/* Make Session column narrower so other columns have room (desktop) */
@media (min-width: 900px) {
  /* Penalties: Date | Session | Type | Value | Reason */
  .tfdf-driver-penalties .tfdf-table th:nth-child(2),
  .tfdf-driver-penalties .tfdf-table td:nth-child(2) {
    width: 38%;
  }

  /* Recent results: Date | Session | Circuit | Finish | Points */
  .tfdf-driver-recent-results .tfdf-table th:nth-child(2),
  .tfdf-driver-recent-results .tfdf-table td:nth-child(2) {
    width: 40%;
  }

  /* Give small columns a sensible minimum width */
  .tfdf-driver-penalties .tfdf-table th:nth-child(3),
  .tfdf-driver-penalties .tfdf-table td:nth-child(3),
  .tfdf-driver-penalties .tfdf-table th:nth-child(4),
  .tfdf-driver-penalties .tfdf-table td:nth-child(4),
  .tfdf-driver-recent-results .tfdf-table th:nth-child(4),
  .tfdf-driver-recent-results .tfdf-table td:nth-child(4),
  .tfdf-driver-recent-results .tfdf-table th:nth-child(5),
  .tfdf-driver-recent-results .tfdf-table td:nth-child(5) {
    min-width: 72px;
  }

  /* Circuit column gets a bit more breathing room */
  .tfdf-driver-recent-results .tfdf-table th:nth-child(3),
  .tfdf-driver-recent-results .tfdf-table td:nth-child(3) {
    width: 30%;
  }
}

