/* =========================================================
   SHARPMODELS GENERIC TABLE SYSTEM
   ========================================================= */

:root {
  --sm-table-bg: var(--color-surface, #ffffff);
  --sm-table-bg-soft: #f8fafc;
  --sm-table-border: #d7e0eb;
  --sm-table-border-strong: #c2cddb;
  --sm-table-text: var(--color-text, #13233a);
  --sm-table-text-soft: #67778f;
  --sm-table-head-bg: #e7edf5;
  --sm-table-hover: #f8fbfe;
  --sm-table-col-alt: rgba(19, 35, 58, 0.015);

  --sm-table-link: #133f78;
  --sm-table-link-hover: #0f315d;

  --sm-table-sort: #6b7c93;
  --sm-table-sort-active: #163f78;

  --sm-table-pos-bg: #eef8f1;
  --sm-table-pos-text: #1b653d;

  --sm-table-neg-bg: #fdf1ef;
  --sm-table-neg-text: #a2332e;

  --sm-table-neutral-bg: #f3f6fa;
  --sm-table-neutral-text: #41536d;

  --sm-table-shadow: 0 8px 20px rgba(16, 24, 40, 0.05);
  --sm-table-radius: 12px;

  --sm-table-font-body: var(--font-body, "Open Sans", Arial, sans-serif);
  --sm-table-font-heading: var(--font-heading, "Oswald", Arial, sans-serif);

  --sm-table-pad-x: 13px;
  --sm-table-pad-y: 10px;
  --sm-table-toolbar-pad: 14px 16px;
  --sm-table-head-size: 0.79rem;
  --sm-table-body-size: 0.94rem;
  --sm-table-line-height: 1.3;
  --sm-table-min-width: 680px;
}

/* density modes */
.sm-table-wrap[data-sm-density="compact"] {
  --sm-table-pad-x: 12px;
  --sm-table-pad-y: 8px;
  --sm-table-body-size: 0.9rem;
}

.sm-table-wrap[data-sm-density="dense"] {
  --sm-table-pad-x: 10px;
  --sm-table-pad-y: 6px;
  --sm-table-body-size: 0.87rem;
}

/* narrower mode for simple matchup tables */
.sm-table-wrap[data-sm-layout="matchup"] {
  --sm-table-min-width: 460px;
}

/* wrapper */
.sm-table-wrap {
  margin: 0 0 22px 0;
  color: var(--sm-table-text);
  font-family: var(--sm-table-font-body);
}

.sm-table-card {
  background: var(--sm-table-bg);
  border: 1px solid var(--sm-table-border);
  border-radius: var(--sm-table-radius);
  box-shadow: var(--sm-table-shadow);
  overflow: hidden;
}

.sm-table-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: var(--sm-table-toolbar-pad);
  border-bottom: 1px solid var(--sm-table-border);
  background: #ffffff;
}

.sm-table-toolbar__title {
  margin: 0;
  font-family: var(--sm-table-font-heading);
  font-size: 1.4rem;
  line-height: 1;
  letter-spacing: 0.01em;
  color: var(--sm-table-text);
}

.sm-table-toolbar__meta {
  margin-top: 5px;
  color: var(--sm-table-text-soft);
  font-size: 0.86rem;
  line-height: 1.35;
}

.sm-table-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* scroll container */
.sm-table-scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--sm-table-bg);
}

.sm-table-scroll::-webkit-scrollbar {
  height: 9px;
}

.sm-table-scroll::-webkit-scrollbar-thumb {
  background: #cbd6e3;
  border-radius: 999px;
}

.sm-table-scroll::-webkit-scrollbar-track {
  background: #edf2f7;
}

/* table */
.sm-table {
  width: 100%;
  min-width: var(--sm-table-min-width);
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--sm-table-body-size);
  line-height: var(--sm-table-line-height);
  color: var(--sm-table-text);
  font-variant-numeric: tabular-nums;
}

.sm-table th,
.sm-table td {
  padding: var(--sm-table-pad-y) var(--sm-table-pad-x);
  border-bottom: 1px solid var(--sm-table-border);
  vertical-align: middle;
  background: transparent;
}

.sm-table tbody tr:last-child td {
  border-bottom: 0;
}

.sm-table thead th {
  position: relative;
  background: var(--sm-table-head-bg);
  color: #4f627f;
  font-size: var(--sm-table-head-size);
  text-transform: uppercase;
  letter-spacing: 0.055em;
  font-weight: 800;
  white-space: nowrap;
  border-bottom: 1px solid var(--sm-table-border-strong);
}

.sm-table tbody tr:hover td {
  background: var(--sm-table-hover);
}

/* optional alternate columns */
.sm-table-wrap[data-sm-striped-cols] .sm-table th:nth-child(even),
.sm-table-wrap[data-sm-striped-cols] .sm-table td:nth-child(even) {
  background-color: var(--sm-table-col-alt);
}

/* alignment helpers */
.sm-table__cell--num {
  text-align: right;
}

.sm-table__cell--center {
  text-align: center;
}

.sm-table__cell--nowrap {
  white-space: nowrap;
}

/* sticky header */
.sm-table-wrap[data-sm-sticky-head] .sm-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
}

/* sticky first column */
.sm-table-wrap[data-sm-sticky-first] .sm-table th:first-child,
.sm-table-wrap[data-sm-sticky-first] .sm-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 3;
  background: inherit;
  box-shadow: 1px 0 0 0 var(--sm-table-border);
}

.sm-table-wrap[data-sm-sticky-first] .sm-table thead th:first-child {
  z-index: 5;
}

/* sort buttons */
.sm-table th[data-sm-sortable] {
  cursor: pointer;
  user-select: none;
  padding-right: 30px;
}

.sm-table th[data-sm-sortable]::after {
  content: "▲▼";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-54%);
  color: var(--sm-table-sort);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -1px;
  opacity: 1;
}

.sm-table th[data-sm-sort-dir="asc"]::after {
  content: "▲";
  color: var(--sm-table-sort-active);
  font-size: 0.78rem;
  letter-spacing: 0;
}

.sm-table th[data-sm-sort-dir="desc"]::after {
  content: "▼";
  color: var(--sm-table-sort-active);
  font-size: 0.78rem;
  letter-spacing: 0;
}

/* status cells */
.sm-table__highlight--positive,
.sm-table__highlight--negative,
.sm-table__highlight--neutral {
  font-weight: 700;
  border-radius: 6px;
}

.sm-table__highlight--positive {
  background: var(--sm-table-pos-bg);
  color: var(--sm-table-pos-text);
}

.sm-table__highlight--negative {
  background: var(--sm-table-neg-bg);
  color: var(--sm-table-neg-text);
}

.sm-table__highlight--neutral {
  background: var(--sm-table-neutral-bg);
  color: var(--sm-table-neutral-text);
}

/* row labels */
.sm-table__label--positive {
  color: var(--sm-table-pos-text);
  font-weight: 700;
}

.sm-table__label--negative {
  color: var(--sm-table-neg-text);
  font-weight: 700;
}

.sm-table__label--neutral {
  color: var(--sm-table-neutral-text);
  font-weight: 700;
}

/* delta values */
.sm-table__delta--up {
  color: var(--sm-table-pos-text);
  font-weight: 700;
}

.sm-table__delta--down {
  color: var(--sm-table-neg-text);
  font-weight: 700;
}

.sm-table__delta--flat {
  color: var(--sm-table-text-soft);
  font-weight: 700;
}

/* links */
.sm-table__team-link,
.sm-table__entity-link {
  color: var(--sm-table-link);
  text-decoration: none;
  font-weight: 700;
}

.sm-table__team-link:hover,
.sm-table__entity-link:hover {
  color: var(--sm-table-link-hover);
  text-decoration: underline;
}

.sm-table__team-sub {
  display: block;
  margin-top: 2px;
  color: var(--sm-table-text-soft);
  font-size: 0.81em;
  font-weight: 400;
}

/* buttons */
.sm-table__link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid #163f78;
  background: #163f78;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.sm-table__link-btn:hover {
  background: #12345f;
  border-color: #12345f;
}

.sm-table__link-btn--ghost {
  background: #ffffff;
  color: #163f78;
}

.sm-table__link-btn--ghost:hover {
  background: #f5f8fc;
  color: #12345f;
  border-color: #12345f;
}

.sm-table__link-btn--dark {
  background: #13233a;
  border-color: #13233a;
  color: #ffffff;
}

.sm-table__link-btn--dark:hover {
  background: #0f1a2a;
  border-color: #0f1a2a;
}

/* footer / notes */
.sm-table-footer {
  padding: 11px 16px 13px 16px;
  color: #7a8aa1;
  font-size: 0.84rem;
  border-top: 1px solid var(--sm-table-border);
  background: #fbfdff;
}

.sm-table__scroll-hint {
  display: none;
  margin-top: 6px;
  color: #7a8aa1;
  font-size: 0.83rem;
}

/* plain/minimal table */
.sm-table-wrap.sm-table-wrap--plain .sm-table-card {
  border-radius: 10px;
  box-shadow: none;
  border: 1px solid var(--sm-table-border);
  background: #ffffff;
}

.sm-table-wrap.sm-table-wrap--plain .sm-table thead th {
  background: #f4f7fa;
}

.sm-table-wrap.sm-table-wrap--plain .sm-table td,
.sm-table-wrap.sm-table-wrap--plain .sm-table th {
  border-bottom-color: #dee6ef;
}

/* mobile */
@media (max-width: 800px) {
  .sm-table-toolbar {
    gap: 10px;
    padding: 12px 12px;
  }

  .sm-table-toolbar__title {
    font-size: 1.1rem;
  }

  .sm-table-toolbar__meta {
    font-size: 0.8rem;
    margin-top: 4px;
  }

  .sm-table-toolbar__actions {
    width: 100%;
    justify-content: flex-start;
  }

  .sm-table__link-btn {
    min-height: 28px;
    padding: 0 10px;
    font-size: 0.78rem;
  }

  .sm-table-wrap {
    margin-bottom: 18px;
  }

  .sm-table-wrap[data-sm-layout="matchup"] {
    --sm-table-pad-x: 9px;
    --sm-table-pad-y: 7px;
    --sm-table-body-size: 0.84rem;
    --sm-table-head-size: 0.72rem;
    --sm-table-min-width: 360px;
  }

  .sm-table-wrap:not([data-sm-layout="matchup"]) .sm-table {
    min-width: 620px;
  }

  .sm-table__scroll-hint {
    display: block;
  }
}

.sm-table-toolbar__main {
  min-width: 0;
  flex: 1 1 auto;
}

@media (max-width: 800px) {
  .sm-table-wrap[data-sm-layout="matchup"] .sm-table-toolbar {
    display: block;
  }

  .sm-table-wrap[data-sm-layout="matchup"] .sm-table-toolbar__actions {
    display: block;
    width: auto;
    margin-top: 10px;
  }

  .sm-table-wrap[data-sm-layout="matchup"] .sm-table__link-btn {
    display: inline-flex;
  }
}

.sm-table-wrap[data-sm-layout="matchup"] .sm-table th:first-child,
.sm-table-wrap[data-sm-layout="matchup"] .sm-table td:first-child {
  white-space: nowrap;
}

.sm-table-wrap[data-sm-layout="matchup"] .sm-table th:not(:first-child),
.sm-table-wrap[data-sm-layout="matchup"] .sm-table td:not(:first-child) {
  text-align: right;
}

.sm-table-wrap[data-sm-layout="matchup"] .sm-table {
  table-layout: fixed;
}

.sm-table-wrap[data-sm-layout="matchup"] .sm-table th:first-child,
.sm-table-wrap[data-sm-layout="matchup"] .sm-table td:first-child {
  width: 46%;
}

.sm-table-wrap[data-sm-layout="matchup"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="matchup"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="matchup"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="matchup"] .sm-table td:nth-child(3) {
  width: 27%;
}

.sm-table-wrap[data-sm-layout="matchup"] .sm-table th:first-child,
.sm-table-wrap[data-sm-layout="matchup"] .sm-table td:first-child {
  width: 44%;
}

.sm-table-wrap[data-sm-layout="matchup"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="matchup"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="matchup"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="matchup"] .sm-table td:nth-child(3) {
  width: 28%;
}
/* =========================================================
   SHARPMODELS TABLE SYSTEM V3
   Applies to all generated SharpModels tables.
   Keeps original filenames: sharpmodels-table.css/js.
   ========================================================= */

:root {
  --sm-table-card-pad-x: 18px;
  --sm-table-team-icon: 28px;
  --sm-table-team-gap: 10px;
}

.sm-table-card {
  position: relative;
  overflow: hidden;
}

.sm-table {
  table-layout: fixed;
}

.sm-table th,
.sm-table td {
  box-sizing: border-box;
  height: 48px;
  padding-top: 9px;
  padding-bottom: 9px;
}

.sm-table th:first-child,
.sm-table td:first-child {
  padding-left: var(--sm-table-card-pad-x);
}

.sm-table th:last-child,
.sm-table td:last-child {
  padding-right: var(--sm-table-card-pad-x);
}

.sm-table thead th {
  vertical-align: middle;
}

.sm-table__cell--num,
.sm-table td.sm-table__cell--num,
.sm-table th.sm-table__cell--num {
  text-align: right;
  white-space: nowrap;
}

.sm-table__cell--center,
.sm-table td.sm-table__cell--center,
.sm-table th.sm-table__cell--center {
  text-align: center;
}

.sm-standard-team,
.sm-teams-team {
  display: inline-grid;
  grid-template-columns: var(--sm-table-team-icon) minmax(0, 1fr);
  align-items: center;
  column-gap: var(--sm-table-team-gap);
  max-width: 100%;
  min-width: 0;
  text-decoration: none;
  vertical-align: middle;
}

.sm-standard-team__helmet,
.sm-teams-team__helmet {
  width: var(--sm-table-team-icon);
  height: var(--sm-table-team-icon);
  display: flex;
  align-items: center;
  justify-content: center;
}

.sm-standard-team__svg,
.sm-teams-team__helmet svg {
  width: var(--sm-table-team-icon);
  height: var(--sm-table-team-icon);
  display: block;
}

.sm-standard-team__name,
.sm-teams-team__name {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

.sm-table td:has(.sm-standard-team),
.sm-table td:has(.sm-teams-team) {
  overflow: hidden;
}

.sm-table th[data-sm-sortable] {
  padding-right: 28px;
}

.sm-table th[data-sm-sortable]::after {
  right: 10px;
  opacity: 0.72;
}

.sm-table th[data-sm-sort-dir="asc"]::after,
.sm-table th[data-sm-sort-dir="desc"]::after {
  opacity: 1;
}

/* Layout-specific column maps */
.sm-table-wrap[data-sm-layout="teams"] { --sm-table-min-width: 620px; }
.sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(1) { width: 38%; }
.sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(2) { width: 22%; }
.sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(3) { width: 40%; }

.sm-table-wrap[data-sm-layout="ratings"] { --sm-table-min-width: 560px; }
.sm-table-wrap[data-sm-layout="ratings"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="ratings"] .sm-table td:nth-child(1) { width: 76px; }
.sm-table-wrap[data-sm-layout="ratings"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="ratings"] .sm-table td:nth-child(2) { width: auto; }
.sm-table-wrap[data-sm-layout="ratings"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="ratings"] .sm-table td:nth-child(3),
.sm-table-wrap[data-sm-layout="ratings"] .sm-table th:nth-child(4),
.sm-table-wrap[data-sm-layout="ratings"] .sm-table td:nth-child(4) { width: 104px; }

.sm-table-wrap[data-sm-layout="standings"] { --sm-table-min-width: 780px; }
.sm-table-wrap[data-sm-layout="standings"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="standings"] .sm-table td:nth-child(1) { width: 70px; }
.sm-table-wrap[data-sm-layout="standings"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="standings"] .sm-table td:nth-child(2) { width: 230px; }
.sm-table-wrap[data-sm-layout="standings"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="standings"] .sm-table td:nth-child(3) { width: 150px; }
.sm-table-wrap[data-sm-layout="standings"] .sm-table th:nth-child(n+4),
.sm-table-wrap[data-sm-layout="standings"] .sm-table td:nth-child(n+4) { width: 74px; }

.sm-table-wrap[data-sm-layout="archive"],
.sm-table-wrap[data-sm-layout="season-archive"] { --sm-table-min-width: 920px; }
.sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(1),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table td:nth-child(1) { width: 102px !important; }
.sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(3),
.sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(4),
.sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(4),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table td:nth-child(3) { width: 190px; }
.sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(5),
.sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(5),
.sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(6),
.sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(6),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table th:nth-child(n+4),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table td:nth-child(n+4) { width: 108px; }

.sm-table-wrap[data-sm-layout="playoff"] { --sm-table-min-width: 780px; }
.sm-table-wrap[data-sm-layout="playoff"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="playoff"] .sm-table td:nth-child(1) { width: 230px; }
.sm-table-wrap[data-sm-layout="playoff"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="playoff"] .sm-table td:nth-child(2) { width: 140px; }
.sm-table-wrap[data-sm-layout="playoff"] .sm-table th:nth-child(n+3),
.sm-table-wrap[data-sm-layout="playoff"] .sm-table td:nth-child(n+3) { width: 95px; }

.sm-table-wrap[data-sm-layout="recent-results"],
.sm-table-wrap[data-sm-layout="results"],
.sm-table-wrap[data-sm-layout="schedule"] { --sm-table-min-width: 820px; }
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table td:nth-child(1),
.sm-table-wrap[data-sm-layout="results"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="results"] .sm-table td:nth-child(1),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table td:nth-child(1) { width: 126px; }
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="results"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="results"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table td:nth-child(2) { width: 280px; }
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table th:nth-child(n+3),
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table td:nth-child(n+3),
.sm-table-wrap[data-sm-layout="results"] .sm-table th:nth-child(n+3),
.sm-table-wrap[data-sm-layout="results"] .sm-table td:nth-child(n+3),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table th:nth-child(n+3),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table td:nth-child(n+3) { width: 130px; }

.sm-table-wrap[data-sm-layout="h2h-index"] { --sm-table-min-width: 760px; }
.sm-table-wrap[data-sm-layout="h2h-index"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="h2h-index"] .sm-table td:nth-child(1) { width: 330px; }
.sm-table-wrap[data-sm-layout="h2h-index"] .sm-table th:nth-child(n+2),
.sm-table-wrap[data-sm-layout="h2h-index"] .sm-table td:nth-child(n+2) { width: 108px; }

.sm-table-wrap[data-sm-layout="h2h-opponents"] { --sm-table-min-width: 760px; }
.sm-table-wrap[data-sm-layout="h2h-opponents"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="h2h-opponents"] .sm-table td:nth-child(1) { width: 250px; }
.sm-table-wrap[data-sm-layout="h2h-opponents"] .sm-table th:nth-child(n+2),
.sm-table-wrap[data-sm-layout="h2h-opponents"] .sm-table td:nth-child(n+2) { width: 110px; }

.sm-table-wrap[data-sm-layout="matchup"],
.sm-table-wrap[data-sm-layout="h2h-summary"],
.sm-table-wrap[data-sm-layout="season-impact"] { --sm-table-min-width: 520px; }

/* Mobile scroll affordance */
.sm-table__scroll-hint {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 9px 14px 11px;
  border-top: 1px solid var(--sm-table-border);
  background: #fbfdff;
  color: #64758e;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.sm-table__scroll-hint::before {
  content: "↔";
  color: var(--sm-table-link);
  font-size: 1rem;
  line-height: 1;
}

@media (max-width: 800px) {
  .sm-table-card::before,
  .sm-table-card::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 50px;
    z-index: 20;
    pointer-events: none;
    opacity: 0;
    transition: opacity 160ms ease;
  }

  .sm-table-card::before {
    left: 0;
    background: linear-gradient(90deg, #ffffff 0%, rgba(255,255,255,0.96) 22%, rgba(255,255,255,0.72) 56%, rgba(255,255,255,0) 100%);
  }

  .sm-table-card::after {
    right: 0;
    background: linear-gradient(270deg, #ffffff 0%, rgba(255,255,255,0.96) 22%, rgba(255,255,255,0.72) 56%, rgba(255,255,255,0) 100%);
  }

  .sm-table-wrap.has-horizontal-scroll:not(.is-scroll-start) .sm-table-card::before,
  .sm-table-wrap.has-horizontal-scroll:not(.is-scroll-end) .sm-table-card::after {
    opacity: 1;
  }

  .sm-table-wrap.has-horizontal-scroll .sm-table__scroll-hint {
    display: flex;
  }

  .sm-table-toolbar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .sm-table th,
  .sm-table td {
    height: 46px;
  }

  .sm-table th:first-child,
  .sm-table td:first-child {
    padding-left: 14px;
  }

  .sm-table th:last-child,
  .sm-table td:last-child {
    padding-right: 14px;
  }

  .sm-table-wrap[data-sm-layout="archive"],
  .sm-table-wrap[data-sm-layout="season-archive"] { --sm-table-min-width: 860px; }

  .sm-table-wrap[data-sm-layout="teams"] { --sm-table-min-width: 560px; }

  .sm-table-wrap[data-sm-layout="ratings"] { --sm-table-min-width: 520px; }

  .sm-table-wrap[data-sm-layout="standings"],
  .sm-table-wrap[data-sm-layout="playoff"],
  .sm-table-wrap[data-sm-layout="recent-results"],
  .sm-table-wrap[data-sm-layout="results"],
  .sm-table-wrap[data-sm-layout="schedule"],
  .sm-table-wrap[data-sm-layout="h2h-index"],
  .sm-table-wrap[data-sm-layout="h2h-opponents"] { --sm-table-min-width: 740px; }

  :root {
    --sm-table-card-pad-x: 14px;
    --sm-table-team-icon: 26px;
    --sm-table-team-gap: 8px;
  }
}

@media (max-width: 520px) {
  .sm-table-wrap[data-sm-layout="archive"],
  .sm-table-wrap[data-sm-layout="season-archive"] { --sm-table-min-width: 820px; }

  .sm-table-wrap[data-sm-layout="teams"] { --sm-table-min-width: 540px; }

  .sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(1),
  .sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(1) { width: 255px; }
  .sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(2),
  .sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(2) { width: 92px; }
  .sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(3),
  .sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(3) { width: 193px; }

  .sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(1),
  .sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(1),
  .sm-table-wrap[data-sm-layout="season-archive"] .sm-table th:nth-child(1),
  .sm-table-wrap[data-sm-layout="season-archive"] .sm-table td:nth-child(1) { width: 86px !important; }
  .sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(2),
  .sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(2),
  .sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(3),
  .sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(3),
  .sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(4),
  .sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(4) { width: 170px; }

  .sm-table-card::after {
    width: 64px;
  }
}

/* =========================================================
   SHARPMODELS TABLE SYSTEM V4 - STRONGER VISUAL PASS
   Original filename retained: sharpmodels-table.css
   ========================================================= */

:root {
  --sm-table-inset-desktop: 24px;
  --sm-table-inset-mobile: 16px;
  --sm-table-row-height: 50px;
  --sm-table-mobile-row-height: 46px;
  --sm-table-icon-size: 30px;
  --sm-table-mobile-icon-size: 26px;
}

.sm-table-card {
  position: relative;
  overflow: hidden;
}

.sm-table-scroll {
  position: relative;
  isolation: isolate;
}

.sm-table {
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
}

.sm-table th,
.sm-table td {
  height: var(--sm-table-row-height);
  padding: 9px 16px;
  box-sizing: border-box;
  vertical-align: middle;
}

.sm-table th:first-child,
.sm-table td:first-child {
  padding-left: var(--sm-table-inset-desktop) !important;
}

.sm-table th:last-child,
.sm-table td:last-child {
  padding-right: var(--sm-table-inset-desktop) !important;
}

.sm-table thead th {
  height: 36px;
  padding-top: 7px;
  padding-bottom: 7px;
}

.sm-table th[data-sm-sortable] {
  padding-right: 32px !important;
}

.sm-table th[data-sm-sortable]::after {
  right: 12px;
  letter-spacing: 0;
  opacity: 0.55;
}

.sm-table th[data-sm-sort-dir="asc"]::after,
.sm-table th[data-sm-sort-dir="desc"]::after {
  opacity: 1;
}

/* Team/entity cells: make every linked team look like one aligned component. */
.sm-table__team-cell,
.sm-table__cell--compact-team,
.sm-table__cell--compact-2 {
  overflow: hidden;
}

.sm-standard-team,
.sm-teams-team,
.sm-table__team-cell > a,
.sm-table__cell--compact-team > a,
.sm-table__cell--compact-2 > a {
  display: inline-grid !important;
  grid-template-columns: var(--sm-table-icon-size) minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 10px;
  max-width: 100%;
  min-width: 0;
  vertical-align: middle;
  text-decoration: none;
}

.sm-standard-team__helmet,
.sm-teams-team__helmet,
.sm-standard-team__svg,
.sm-teams-team svg,
.sm-table__team-cell svg,
.sm-table__cell--compact-team svg,
.sm-table__cell--compact-2 svg {
  width: var(--sm-table-icon-size) !important;
  height: var(--sm-table-icon-size) !important;
  display: block;
  flex: 0 0 var(--sm-table-icon-size);
}

.sm-standard-team__name,
.sm-teams-team__name,
.sm-table__team-link,
.sm-table__entity-link {
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

.sm-standard-team::after,
.sm-teams-team::after,
.sm-table__team-cell > a::after,
.sm-table__cell--compact-team > a::after,
.sm-table__cell--compact-2 > a::after {
  content: "\00a0→";
  font-weight: 900;
  color: var(--sm-table-link);
  line-height: 1;
}

.sm-standard-team .btn-arrow-after::after,
.sm-teams-team .btn-arrow-after::after {
  content: "";
}

/* Stop old arrow styles making rows visually ragged. */
.sm-table .btn-arrow-after::after {
  margin-left: 8px;
  white-space: nowrap;
}

.sm-table__cell--num,
.sm-table td.sm-table__cell--num,
.sm-table th.sm-table__cell--num {
  text-align: right !important;
  white-space: nowrap;
}

.sm-table__cell--center,
.sm-table td.sm-table__cell--center,
.sm-table th.sm-table__cell--center {
  text-align: center !important;
}

/* Column maps: explicit widths for all generated table layouts. */
.sm-table-wrap[data-sm-layout="teams"] { --sm-table-min-width: 660px; }
.sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(1) { width: 310px; }
.sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(2) { width: 130px; }
.sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(3) { width: 220px; }

.sm-table-wrap[data-sm-layout="archive"] { --sm-table-min-width: 980px; }
.sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(1) { width: 112px !important; }
.sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(3),
.sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(4),
.sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(4) { width: 210px; }
.sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(5),
.sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(5),
.sm-table-wrap[data-sm-layout="archive"] .sm-table th:nth-child(6),
.sm-table-wrap[data-sm-layout="archive"] .sm-table td:nth-child(6) { width: 119px; }

.sm-table-wrap[data-sm-layout="ratings"] { --sm-table-min-width: 620px; }
.sm-table-wrap[data-sm-layout="ratings"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="ratings"] .sm-table td:nth-child(1) { width: 82px; }
.sm-table-wrap[data-sm-layout="ratings"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="ratings"] .sm-table td:nth-child(2) { width: 330px; }
.sm-table-wrap[data-sm-layout="ratings"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="ratings"] .sm-table td:nth-child(3),
.sm-table-wrap[data-sm-layout="ratings"] .sm-table th:nth-child(4),
.sm-table-wrap[data-sm-layout="ratings"] .sm-table td:nth-child(4) { width: 104px; }

.sm-table-wrap[data-sm-layout="standings"] { --sm-table-min-width: 860px; }
.sm-table-wrap[data-sm-layout="standings"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="standings"] .sm-table td:nth-child(1) { width: 78px; }
.sm-table-wrap[data-sm-layout="standings"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="standings"] .sm-table td:nth-child(2) { width: 270px; }
.sm-table-wrap[data-sm-layout="standings"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="standings"] .sm-table td:nth-child(3) { width: 150px; }
.sm-table-wrap[data-sm-layout="standings"] .sm-table th:nth-child(n+4),
.sm-table-wrap[data-sm-layout="standings"] .sm-table td:nth-child(n+4) { width: 72px; }

.sm-table-wrap[data-sm-layout="playoff"] { --sm-table-min-width: 840px; }
.sm-table-wrap[data-sm-layout="playoff"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="playoff"] .sm-table td:nth-child(1) { width: 290px; }
.sm-table-wrap[data-sm-layout="playoff"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="playoff"] .sm-table td:nth-child(2) { width: 135px; }
.sm-table-wrap[data-sm-layout="playoff"] .sm-table th:nth-child(n+3),
.sm-table-wrap[data-sm-layout="playoff"] .sm-table td:nth-child(n+3) { width: 103px; }

.sm-table-wrap[data-sm-layout="recent-results"],
.sm-table-wrap[data-sm-layout="results"],
.sm-table-wrap[data-sm-layout="schedule"] { --sm-table-min-width: 900px; }
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table td:nth-child(1),
.sm-table-wrap[data-sm-layout="results"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="results"] .sm-table td:nth-child(1),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table td:nth-child(1) { width: 132px; }
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="results"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="results"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table td:nth-child(2) { width: 340px; }
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table th:nth-child(n+3),
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table td:nth-child(n+3),
.sm-table-wrap[data-sm-layout="results"] .sm-table th:nth-child(n+3),
.sm-table-wrap[data-sm-layout="results"] .sm-table td:nth-child(n+3),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table th:nth-child(n+3),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table td:nth-child(n+3) { width: 132px; }

.sm-table-wrap[data-sm-layout="h2h-index"] { --sm-table-min-width: 840px; }
.sm-table-wrap[data-sm-layout="h2h-index"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="h2h-index"] .sm-table td:nth-child(1) { width: 390px; }
.sm-table-wrap[data-sm-layout="h2h-index"] .sm-table th:nth-child(n+2),
.sm-table-wrap[data-sm-layout="h2h-index"] .sm-table td:nth-child(n+2) { width: 112px; }

.sm-table-wrap[data-sm-layout="h2h-opponents"] { --sm-table-min-width: 830px; }
.sm-table-wrap[data-sm-layout="h2h-opponents"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="h2h-opponents"] .sm-table td:nth-child(1) { width: 320px; }
.sm-table-wrap[data-sm-layout="h2h-opponents"] .sm-table th:nth-child(n+2),
.sm-table-wrap[data-sm-layout="h2h-opponents"] .sm-table td:nth-child(n+2) { width: 102px; }

.sm-table-wrap[data-sm-layout="season-archive"] { --sm-table-min-width: 720px; }
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table td:nth-child(1) { width: 110px !important; }
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table td:nth-child(3) { width: 210px; }
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table th:nth-child(n+4),
.sm-table-wrap[data-sm-layout="season-archive"] .sm-table td:nth-child(n+4) { width: 95px; }

/* Make the mobile scroll cue obvious even if JS is cached or not loaded. */
@media (max-width: 800px) {
  :root {
    --sm-table-icon-size: var(--sm-table-mobile-icon-size);
  }

  .sm-table th,
  .sm-table td {
    height: var(--sm-table-mobile-row-height);
    padding: 8px 13px;
  }

  .sm-table th:first-child,
  .sm-table td:first-child {
    padding-left: var(--sm-table-inset-mobile) !important;
  }

  .sm-table th:last-child,
  .sm-table td:last-child {
    padding-right: var(--sm-table-inset-mobile) !important;
  }

  .sm-table-toolbar {
    padding-left: var(--sm-table-inset-mobile) !important;
    padding-right: var(--sm-table-inset-mobile) !important;
  }

  .sm-table-card::before,
  .sm-table-card::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 74px;
    z-index: 30;
    pointer-events: none;
    opacity: 1;
  }

  .sm-table-card::before {
    left: 0;
    background: linear-gradient(90deg, #ffffff 0%, rgba(255,255,255,0.96) 26%, rgba(255,255,255,0.68) 58%, rgba(255,255,255,0) 100%);
    opacity: 0;
  }

  .sm-table-card::after {
    right: 0;
    background: linear-gradient(270deg, #ffffff 0%, rgba(255,255,255,0.98) 20%, rgba(255,255,255,0.82) 48%, rgba(255,255,255,0.18) 82%, rgba(255,255,255,0) 100%);
  }

  .sm-table-wrap.is-scroll-left .sm-table-card::before,
  .sm-table-wrap:not(.is-scroll-start) .sm-table-card::before {
    opacity: 1;
  }

  .sm-table-wrap.is-scroll-end .sm-table-card::after,
  .sm-table-wrap:not(.has-horizontal-scroll) .sm-table-card::after {
    opacity: 0;
  }

  .sm-table__scroll-hint {
    display: flex !important;
    position: sticky;
    left: 0;
    z-index: 35;
    align-items: center;
    gap: 8px;
    padding: 9px var(--sm-table-inset-mobile) 10px;
    border-top: 1px solid var(--sm-table-border);
    background: #fbfdff;
    color: #163f78;
    font-size: 0.78rem;
    font-weight: 900;
  }

  .sm-table__scroll-hint::before {
    content: "↔";
    font-size: 1rem;
  }

  .sm-table-wrap[data-sm-layout="archive"] { --sm-table-min-width: 940px; }
  .sm-table-wrap[data-sm-layout="teams"] { --sm-table-min-width: 620px; }
  .sm-table-wrap[data-sm-layout="ratings"] { --sm-table-min-width: 600px; }
  .sm-table-wrap[data-sm-layout="standings"] { --sm-table-min-width: 830px; }
  .sm-table-wrap[data-sm-layout="playoff"] { --sm-table-min-width: 820px; }
  .sm-table-wrap[data-sm-layout="recent-results"],
  .sm-table-wrap[data-sm-layout="results"],
  .sm-table-wrap[data-sm-layout="schedule"] { --sm-table-min-width: 860px; }
  .sm-table-wrap[data-sm-layout="h2h-index"],
  .sm-table-wrap[data-sm-layout="h2h-opponents"] { --sm-table-min-width: 800px; }
}

/* =========================================================
   SHARPMODELS TABLE ALIGNMENT + MOBILE SCROLL AFFORDANCE V5
   Fixes: left-aligned text headers/cells, consistent numeric alignment,
   better balanced generated table column maps, and stronger mobile fades.
   ========================================================= */

/* Default table alignment: text reads from the left; numbers use helpers. */
.sm-table th,
.sm-table td {
  text-align: left;
}

.sm-table thead th {
  text-align: left;
}

.sm-table__cell--num,
.sm-table td.sm-table__cell--num,
.sm-table th.sm-table__cell--num {
  text-align: right !important;
}

.sm-table__cell--center,
.sm-table td.sm-table__cell--center,
.sm-table th.sm-table__cell--center {
  text-align: center !important;
}

/* Sort arrows should sit close to the header label, not make the label look centred. */
.sm-table th[data-sm-sortable] {
  padding-right: 34px !important;
}

.sm-table th[data-sm-sortable]::after {
  right: 13px;
}

/* Team directory: keep Conference and Division visually balanced on desktop. */
.sm-table-wrap[data-sm-layout="teams"] { --sm-table-min-width: 720px; }
.sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(1) { width: 40%; }
.sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(2) { width: 20%; text-align: left; }
.sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(3) { width: 40%; text-align: left; }

/* Ratings: rank/rating columns numeric; team column left. */
.sm-table-wrap[data-sm-layout="ratings"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="ratings"] .sm-table td:nth-child(2) { text-align: left; }

/* Standings: rank numeric, team/division left, stats right. */
.sm-table-wrap[data-sm-layout="standings"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="standings"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="standings"] .sm-table th:nth-child(3),
.sm-table-wrap[data-sm-layout="standings"] .sm-table td:nth-child(3) { text-align: left; }

/* Results/schedule: date left, matchup left, result columns keep their helper alignment. */
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table td:nth-child(1),
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="recent-results"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="results"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="results"] .sm-table td:nth-child(1),
.sm-table-wrap[data-sm-layout="results"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="results"] .sm-table td:nth-child(2),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table td:nth-child(1),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table th:nth-child(2),
.sm-table-wrap[data-sm-layout="schedule"] .sm-table td:nth-child(2) { text-align: left; }

/* H2H: matchup/opponent left, metrics right/centre via existing helper classes. */
.sm-table-wrap[data-sm-layout="h2h-index"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="h2h-index"] .sm-table td:nth-child(1),
.sm-table-wrap[data-sm-layout="h2h-opponents"] .sm-table th:nth-child(1),
.sm-table-wrap[data-sm-layout="h2h-opponents"] .sm-table td:nth-child(1) { text-align: left; }

/* Mobile: force a useful overflow width and make the swipe affordance obvious. */
@media (max-width: 800px) {
  .sm-table-card {
    position: relative;
  }

  .sm-table-scroll {
    position: relative;
  }

  .sm-table-wrap[data-sm-layout="teams"] { --sm-table-min-width: 640px; }
  .sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(1),
  .sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(1) { width: 285px; }
  .sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(2),
  .sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(2) { width: 120px; }
  .sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(3),
  .sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(3) { width: 235px; }

  .sm-table-card::before,
  .sm-table-card::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 72px;
    z-index: 30;
    pointer-events: none;
    opacity: 0;
    transition: opacity 160ms ease;
  }

  .sm-table-card::before {
    left: 0;
    background: linear-gradient(90deg, #ffffff 0%, rgba(255,255,255,0.96) 28%, rgba(255,255,255,0.64) 62%, rgba(255,255,255,0) 100%);
  }

  .sm-table-card::after {
    right: 0;
    background: linear-gradient(270deg, #ffffff 0%, rgba(255,255,255,0.96) 28%, rgba(255,255,255,0.64) 62%, rgba(255,255,255,0) 100%);
  }

  .sm-table-wrap.has-horizontal-scroll:not(.is-scroll-start) .sm-table-card::before {
    opacity: 1;
  }

  .sm-table-wrap.has-horizontal-scroll:not(.is-scroll-end) .sm-table-card::after {
    opacity: 1;
  }

  .sm-table__scroll-hint {
    display: none !important;
  }

  .sm-table-wrap.has-horizontal-scroll .sm-table__scroll-hint {
    display: flex !important;
    position: sticky;
    left: 0;
    z-index: 35;
    align-items: center;
    gap: 8px;
    padding: 9px var(--sm-table-inset-mobile) 10px;
    border-top: 1px solid var(--sm-table-border);
    background: #fbfdff;
    color: #163f78;
    font-size: 0.78rem;
    font-weight: 900;
  }

  .sm-table-wrap.has-horizontal-scroll .sm-table__scroll-hint::before {
    content: "↔";
    font-size: 1rem;
  }
}

@media (max-width: 520px) {
  .sm-table-wrap[data-sm-layout="teams"] { --sm-table-min-width: 620px; }
  .sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(1),
  .sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(1) { width: 270px; }
  .sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(2),
  .sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(2) { width: 110px; }
  .sm-table-wrap[data-sm-layout="teams"] .sm-table th:nth-child(3),
  .sm-table-wrap[data-sm-layout="teams"] .sm-table td:nth-child(3) { width: 240px; }
}

/* =========================================================
   FINAL TABLE-ONLY MOBILE FADES
   The fade belongs to .sm-table-scroll, not .sm-table-card.
   It uses position: sticky so the fade stays pinned to the visible
   left/right edge while the table scrolls horizontally.
   ========================================================= */

@media (max-width: 800px) {

  /* Kill any old whole-card fades */
  .sm-table-wrap .sm-table-card::before,
  .sm-table-wrap .sm-table-card::after {
    content: none !important;
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    background: none !important;
  }

  .sm-table-wrap .sm-table-scroll {
    position: relative !important;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .sm-table-wrap .sm-table-scroll::before,
  .sm-table-wrap .sm-table-scroll::after {
    content: "" !important;
    display: block !important;
    position: sticky;
    top: 0;
    bottom: 0;
    width: 28px;
    min-width: 28px;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.18s ease;
  }

  .sm-table-wrap .sm-table-scroll::before {
    left: 0;
    float: left;
    margin-right: -28px;
    background: linear-gradient(
      to right,
      rgba(255,255,255,0.96) 0%,
      rgba(255,255,255,0.72) 45%,
      rgba(255,255,255,0) 100%
    );
  }

  .sm-table-wrap .sm-table-scroll::after {
    right: 0;
    float: right;
    margin-left: -28px;
    background: linear-gradient(
      to left,
      rgba(255,255,255,0.96) 0%,
      rgba(255,255,255,0.72) 45%,
      rgba(255,255,255,0) 100%
    );
  }

  .sm-table-wrap.has-horizontal-scroll:not(.is-scroll-start) .sm-table-scroll::before {
    opacity: 1;
  }

  .sm-table-wrap.has-horizontal-scroll:not(.is-scroll-end) .sm-table-scroll::after {
    opacity: 1;
  }
}

/* =========================================================
   TABLE-ONLY MOBILE FADES - JS POSITIONED OVERLAYS
   These overlays are placed over the scrollable table area only,
   never over the table/card title.
   ========================================================= */

/* Disable every previous pseudo-element fade attempt */
.sm-table-card::before,
.sm-table-card::after,
.sm-table-scroll::before,
.sm-table-scroll::after {
  content: none !important;
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  background: none !important;
}

/* The card is the positioning context for the fade overlays */
.sm-table-card {
  position: relative;
}

.sm-table-fade-left,
.sm-table-fade-right {
  display: none;
}

@media (max-width: 800px) {
  .sm-table-fade-left,
  .sm-table-fade-right {
    display: block;
    position: absolute;
    width: 34px;
    pointer-events: none;
    z-index: 30;
    opacity: 0;
    transition: opacity 0.18s ease;
  }

  .sm-table-fade-left {
    left: 0;
    background: linear-gradient(
      to right,
      rgba(255,255,255,0.98) 0%,
      rgba(255,255,255,0.82) 40%,
      rgba(255,255,255,0) 100%
    );
  }

  .sm-table-fade-right {
    right: 0;
    background: linear-gradient(
      to left,
      rgba(255,255,255,0.98) 0%,
      rgba(255,255,255,0.82) 40%,
      rgba(255,255,255,0) 100%
    );
  }

  .sm-table-wrap.has-horizontal-scroll:not(.is-scroll-start) .sm-table-fade-left {
    opacity: 1;
  }

  .sm-table-wrap.has-horizontal-scroll:not(.is-scroll-end) .sm-table-fade-right {
    opacity: 1;
  }
}

/* =========================================================
   MOBILE POWER RATINGS TABLE TIGHTENING
   Aim: Rank + Team + Rating visible without horizontal scroll.
   ========================================================= */

@media (max-width: 800px) {

  /* Power ratings tables */
  .sm-table-wrap[data-sm-layout="ratings"],
  .sm-table-wrap[data-sm-table-type="ratings"],
  .sm-table-wrap.sm-ratings-table {
    --sm-table-min-width: 0;
    --sm-table-pad-x: 8px;
    --sm-table-pad-y: 9px;
  }

  .sm-table-wrap[data-sm-layout="ratings"] .sm-table,
  .sm-table-wrap[data-sm-table-type="ratings"] .sm-table,
  .sm-table-wrap.sm-ratings-table .sm-table {
    min-width: 0 !important;
    table-layout: fixed;
  }

  /* Remove sort arrows from the Rank column only */
  .sm-table-wrap[data-sm-layout="ratings"] .sm-table th:first-child::after,
  .sm-table-wrap[data-sm-table-type="ratings"] .sm-table th:first-child::after,
  .sm-table-wrap.sm-ratings-table .sm-table th:first-child::after {
    content: none !important;
    display: none !important;
  }

  .sm-table-wrap[data-sm-layout="ratings"] .sm-table th:first-child,
  .sm-table-wrap[data-sm-table-type="ratings"] .sm-table th:first-child,
  .sm-table-wrap.sm-ratings-table .sm-table th:first-child {
    padding-right: 8px !important;
    width: 42px;
  }

  .sm-table-wrap[data-sm-layout="ratings"] .sm-table th:nth-child(2),
  .sm-table-wrap[data-sm-layout="ratings"] .sm-table td:nth-child(2),
  .sm-table-wrap[data-sm-table-type="ratings"] .sm-table th:nth-child(2),
  .sm-table-wrap[data-sm-table-type="ratings"] .sm-table td:nth-child(2),
  .sm-table-wrap.sm-ratings-table .sm-table th:nth-child(2),
  .sm-table-wrap.sm-ratings-table .sm-table td:nth-child(2) {
    width: auto;
  }

  .sm-table-wrap[data-sm-layout="ratings"] .sm-table th:last-child,
  .sm-table-wrap[data-sm-layout="ratings"] .sm-table td:last-child,
  .sm-table-wrap[data-sm-table-type="ratings"] .sm-table th:last-child,
  .sm-table-wrap[data-sm-table-type="ratings"] .sm-table td:last-child,
  .sm-table-wrap.sm-ratings-table .sm-table th:last-child,
  .sm-table-wrap.sm-ratings-table .sm-table td:last-child {
    width: 74px;
    text-align: right;
  }

  .sm-table-wrap[data-sm-layout="ratings"] .sm-table__team-link,
  .sm-table-wrap[data-sm-table-type="ratings"] .sm-table__team-link,
  .sm-table-wrap.sm-ratings-table .sm-table__team-link {
    white-space: nowrap;
  }
}


@media (max-width: 800px) {

  .sm-ratings-page .sm-table-wrap,
  .sm-ratings-page__card .sm-table-wrap {
    --sm-table-min-width: 0;
    --sm-table-pad-x: 8px;
    --sm-table-pad-y: 9px;
  }

  .sm-ratings-page .sm-table,
  .sm-ratings-page__card .sm-table {
    min-width: 0 !important;
    table-layout: fixed;
  }

  .sm-ratings-page .sm-table th:first-child::after,
  .sm-ratings-page__card .sm-table th:first-child::after {
    content: none !important;
    display: none !important;
  }

  .sm-ratings-page .sm-table th:first-child,
  .sm-ratings-page__card .sm-table th:first-child {
    padding-right: 8px !important;
    width: 42px;
  }

  .sm-ratings-page .sm-table th:last-child,
  .sm-ratings-page .sm-table td:last-child,
  .sm-ratings-page__card .sm-table th:last-child,
  .sm-ratings-page__card .sm-table td:last-child {
    width: 74px;
    text-align: right;
  }
}
