.team-profile-card .card-body { padding: 1rem 1.25rem; }
.team-profile-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px;
  grid-template-areas: "identity actions" "form actions";
  align-items: start;
  gap: .75rem 1.5rem;
}
.team-profile-banner { height: 80px; min-height: 80px; }
.team-profile-header {
  grid-area: identity;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.team-profile-header .profile-logo { flex: 0 0 96px; width: 96px; height: 96px; object-fit: contain; }
.team-profile-identity { flex: 1; min-width: 0; }
.team-profile-identity h1 { overflow-wrap: anywhere; }
.team-league-link { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: .75rem; color: var(--text-muted); font-size: .875rem; font-weight: 600; text-decoration: none; }
.team-league-link:hover { color: var(--primary-neon); }
.team-league-link .bi { font-size: .65rem; }
.team-league-logo { width: 26px; height: 26px; padding: 3px; object-fit: contain; background: #fff; border-radius: 6px; flex: 0 0 26px; }
.team-profile-actions { grid-area: actions; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.team-profile-actions form { margin: 0; }
.team-favorite-action,
.team-secondary-action { display: flex; align-items: center; justify-content: center; padding: 0; border: 1px solid var(--border-glass); border-radius: 12px; background: var(--bg-surface-elevated); color: var(--text-muted); text-decoration: none; }
.team-favorite-action { width: 60px; height: 60px; color: var(--accent-gold); font-size: 1.75rem; }
.team-favorite-action.is-active { background: var(--accent-gold-glow); border-color: var(--accent-gold); }
.team-secondary-action { width: 40px; height: 40px; font-size: 1rem; }
.team-secondary-action svg { width: 20px; height: 20px; }
.team-favorite-action:hover { color: var(--accent-gold); border-color: var(--accent-gold); }
.team-secondary-action:hover { color: var(--text-main); border-color: var(--border-glass-hover); }
.team-profile-actions :is(a, button):focus-visible,
.team-recent-result:focus-visible { outline: 3px solid var(--primary-neon); outline-offset: 3px; }
.team-recent-form { grid-area: form; display: flex; flex-wrap: wrap; align-items: center; padding-top: .75rem; border-top: 1px solid var(--border-glass); }
.team-recent-results { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.team-recent-result { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 8px; font-size: .8rem; font-weight: 800; text-decoration: none; }
.team-recent-result:hover { box-shadow: 0 0 0 2px var(--text-main); }
.team-recent-win, .team-recent-win:hover { color: #fff; background: #15803d; }
.team-recent-draw, .team-recent-draw:hover { color: #fff; background: #52525b; }
.team-recent-loss, .team-recent-loss:hover { color: #fff; background: #b91c1c; }
.team-details-header { display: flex; align-items: center; }
.team-details-header .team-details-tabs { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); flex: 1; min-width: 0; order: 0; overflow: visible; scrollbar-width: none; }
.team-details-header .team-details-tabs::-webkit-scrollbar { display: none; }
.team-details-header .team-details-tabs .nav-item { min-width: 0; }
.team-details-header .team-details-tabs .nav-link { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; white-space: normal; line-height: 1.35; padding-inline: .65rem; }
.team-season-picker { display: flex; align-items: center; justify-content: flex-end; gap: .75rem; padding: .875rem 1rem; order: 1; flex-shrink: 0; }
.team-season-picker .form-select { width: auto; max-width: 100%; min-width: 144px; font-size: .875rem; }
.team-kits { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border-glass); }
.team-kits .equipment-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.team-kits .equipment-image { height: 180px; max-width: 100%; }

@media (max-width: 575px) {
  .team-details-header { flex-wrap: wrap; }
  .team-season-picker { order: -1; width: 100%; border-bottom: 1px solid var(--border-glass); }
  .team-details-header .team-details-tabs { flex-basis: 100%; }
  .team-profile-card .card-body { padding: 1rem; }
  .team-profile-body { grid-template-columns: minmax(0, 1fr) 54px; gap: .75rem; }
  .team-profile-header { gap: .75rem; }
  .team-profile-header .profile-logo { width: 58px; height: 58px; flex-basis: 58px; }
  .team-profile-identity h1 { font-size: 1.25rem; }
  .team-profile-identity p { font-size: .75rem; }
  .team-league-link { font-size: .7rem; gap: .35rem; margin-bottom: .5rem; }
  .team-league-logo { width: 22px; height: 22px; flex-basis: 22px; }
  .team-favorite-action { width: 54px; height: 54px; }
  .team-kits .equipment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
  .team-kits .equipment-image { height: 130px; }
}

@media (max-width: 359px) {
  .team-profile-header { gap: .5rem; }
  .team-profile-header .profile-logo { width: 48px; height: 48px; flex-basis: 48px; }
  .team-profile-identity h1 { font-size: 1.125rem; }
}

@media (min-width: 992px) {
  .team-details-header .nav-link { font-size: .875rem; padding-inline: .875rem; }
}

/* Fixtures keep both clubs on one horizontal line around the score. */
#team-match-list .team-fixture-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) 88px minmax(0, 1fr); align-items: center; gap: 1rem; min-height: 82px; padding: 1rem; }
.team-fixture-date { color: var(--text-muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.team-fixture-team { display: flex; align-items: center; gap: .75rem; min-width: 0; color: var(--text-main); }
.team-fixture-home { justify-content: flex-end; text-align: right; }
.team-fixture-away { justify-content: flex-start; text-align: left; }
.team-fixture-team > span { min-width: 0; overflow-wrap: anywhere; }
.team-fixture-team img { width: 34px; height: 34px; flex: 0 0 34px; object-fit: contain; }
.team-fixture-score { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .25rem; text-align: center; font-variant-numeric: tabular-nums; }
.team-fixture-score strong { color: var(--text-main); white-space: nowrap; font-size: 1.2rem; font-weight: 800; }
.team-fixture-score time { color: var(--text-muted); font-size: .875rem; white-space: nowrap; }
.team-fixture-minute { color: var(--state-danger); background: rgba(239, 68, 68, .12); border-radius: 5px; padding: .1rem .4rem; font-size: .7rem; font-weight: 800; line-height: 1.4; }
.team-fixture-state { color: var(--text-muted); font-size: .7rem; }

/* A stable identity column stays visible when the stat columns are scrolled. */
.team-roster-table { min-width: 650px; table-layout: fixed; --bs-table-bg: transparent; }
.team-roster-table th, .team-roster-table td { padding: .85rem .75rem; border-color: var(--border-glass); }
.team-roster-table :is(th, td):not(:first-child) { width: 60px; text-align: center; font-variant-numeric: tabular-nums; }
.team-roster-table thead th { color: var(--text-muted); font-size: .8rem; font-weight: 600; vertical-align: middle; }
.team-roster-table thead th:first-child, .team-roster-table tbody tr:not(.team-roster-group) td:first-child { position: sticky; left: 0; z-index: 1; background: var(--bg-surface); width: 240px; min-width: 220px; }
.team-roster-table .team-roster-group th { background: var(--bg-surface-elevated); color: var(--text-main); padding: .65rem .75rem; font-size: .8rem; letter-spacing: .02em; }
.team-roster-group th > span { margin-left: .65rem; font-weight: 500; color: var(--text-muted); }
.team-roster-player { display: flex; align-items: center; gap: .7rem; min-height: 32px; }
.team-roster-player a { color: var(--text-main); font-size: .875rem; font-weight: 600; text-decoration: none; }
.team-roster-player a:hover { color: var(--primary-neon); }
.team-shirt-number { min-width: 32px; font-size: .8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.team-roster-flag { flex: 0 0 20px; width: 20px; border-radius: 2px; font-size: 1rem; }
.team-stat-icon { display: inline-block; width: 22px; height: 22px; vertical-align: middle; }
.team-stat-starts { display: inline-block; color: var(--text-main); font-size: 1rem; font-weight: 800; }
.team-card-icon { display: inline-block; width: 13px; height: 19px; border-radius: 2px; vertical-align: middle; transform: rotate(-8deg); }
.team-card-yellow { background: #facc15; }
.team-card-red { background: #ef4444; }

/* Competition-scoped analysis and compact metric leaders. */
.team-analysis [hidden], #team-match-list [hidden] { display: none !important; }
.team-competition-picker { display: flex; align-items: center; gap: .6rem; margin: 0; min-width: 0; }
.team-competition-picker label { font-size: .75rem; color: var(--text-muted); }
.team-competition-picker select { width: auto; max-width: 280px; min-width: 0; font-size: .8rem; min-height: 40px; }
.team-analysis .team-stats-toolbar { align-items: center; flex-wrap: wrap; }
.team-analysis .team-stats-switch { flex-wrap: nowrap; flex-shrink: 0; }
.team-detail-panels { scroll-margin-top: 84px; }
.team-analysis-highlights { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .75rem; margin: 0 0 1.25rem; }
.team-analysis-highlights > div { padding: .85rem 1rem; border: 1px solid var(--border-glass); border-radius: 10px; background: var(--bg-surface-elevated); }
.team-analysis-highlights dt { color: var(--text-muted); font-size: .75rem; font-weight: 500; }
.team-analysis-highlights dd { color: var(--text-main); font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.3; margin: .35rem 0 .1rem; }
.team-analysis-highlights > div > span { color: var(--text-muted); font-size: .65rem; }
.team-analysis-categories { display: flex; gap: .4rem; border-bottom: 1px solid var(--border-glass); margin: 0 0 .75rem; }
.team-analysis-categories button { padding: .65rem 1rem; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: .8rem; font-weight: 650; min-height: 44px; }
.team-analysis-categories button.active { color: var(--primary-neon); border-bottom-color: var(--primary-neon); }
.team-analysis-legend { display: flex; justify-content: space-between; gap: 1rem; font-size: .75rem; font-weight: 700; color: var(--text-main); padding-top: .3rem; }
.team-analysis-legend > :first-child::before, .team-analysis-legend > :last-child::after { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--primary-neon); margin-right: .4rem; }
.team-analysis-legend > :last-child::after { margin: 0 0 0 .4rem; background: #2dd4bf; }
.team-analysis-comparison { padding: .75rem 0; border-bottom: 1px solid var(--border-glass); }
.team-analysis-metric-label { display: flex; align-items: baseline; justify-content: center; gap: .5rem; font-size: .8rem; color: var(--text-main); }
.team-analysis-metric-label small { color: var(--text-muted); font-size: .65rem; }
.team-analysis-values { display: grid; grid-template-columns: 65px minmax(0,1fr) 65px; align-items: center; gap: 1rem; margin-top: .5rem; }
.team-analysis-values strong { color: var(--text-main); font-size: .95rem; font-variant-numeric: tabular-nums; }
.team-analysis-values strong:last-child { text-align: right; }
.team-analysis-bar { height: 5px; display: block; border-radius: 4px; overflow: hidden; background: #2dd4bf; }
.team-analysis-bar > span { height: 100%; display: block; background: var(--primary-neon); border-right: 2px solid var(--bg-surface); }
.team-analysis-bar.is-empty { background: var(--border-glass); }
.team-analysis-bar.is-empty > span { display: none; }
.team-analysis-coverage { display: block; text-align: center; font-size: .65rem; color: var(--text-muted); margin-top: .3rem; }
.team-analysis-footnote, .team-analysis-definition, .team-leader-attempts { color: var(--text-muted); font-size: .7rem; line-height: 1.6; }
.team-analysis-footnote { margin: .85rem 0 0; }
.team-analysis-definition { margin-top: .65rem; }
.team-analysis-definition summary, .team-analysis-extra summary { cursor: pointer; color: var(--text-muted); font-size: .75rem; min-height: 38px; padding-block: .5rem; }
.team-analysis-definition p { max-width: 650px; margin: .5rem 0; }
.team-leaders-controls { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: .75rem; margin-bottom: 1rem; }
.team-analysis-field { min-width: 0; }
.team-analysis-field label { display: block; color: var(--text-muted); font-size: .7rem; margin-bottom: .35rem; }
.team-analysis-field select { font-size: .8rem; min-height: 42px; }
.team-leader-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.team-leader-card { min-width: 0; align-self: start; padding: 1rem; border: 1px solid var(--border-glass); background: var(--bg-surface-elevated); border-radius: 12px; }
.team-leader-heading { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
.team-leader-heading h3 { color: var(--text-main); font-size: .85rem; font-weight: 750; margin: 0; }
.team-leader-heading > span { color: var(--text-muted); font-size: .65rem; flex-shrink: 0; }
.team-leader-list { list-style: none; padding: 0; margin: 0; }
.team-leader-list li { display: grid; grid-template-columns: 16px minmax(0,1fr) auto; gap: .6rem; align-items: center; min-height: 62px; border-bottom: 1px solid var(--border-glass); }
.team-leader-rank { color: var(--text-muted); font-size: .7rem; }
.team-leader-list a { display: flex; align-items: center; min-width: 0; gap: .65rem; color: var(--text-main); text-decoration: none; font-size: .8rem; font-weight: 600; }
.team-leader-list a:hover { color: var(--primary-neon); }
.team-leader-list a > span { min-width: 0; overflow-wrap: anywhere; }
.team-leader-list a > img { width: 30px; height: 34px; flex: 0 0 30px; object-fit: contain; }
.team-leader-list small { display: block; color: var(--text-muted); font-size: .625rem; font-weight: 400; margin-top: .1rem; }
.team-leader-list strong { color: var(--text-main); font-size: .95rem; font-variant-numeric: tabular-nums; }
.team-leader-expand { display: block; width: 100%; min-height: 40px; margin-top: .5rem; border: 0; background: none; color: var(--primary-neon); font-size: .75rem; font-weight: 600; }
.team-leader-empty { font-size: .75rem; padding: 1.5rem .25rem; margin: 0; }
.team-leader-attempts { font-size: .65rem; margin: .5rem 0 0; }
.team-analysis-extra { margin-top: .75rem; }
.team-analysis [data-player-metric="Minutes"] small { display: none; }
.team-fixture-group { border: 1px solid var(--border-glass); border-radius: 10px; overflow: hidden; margin-bottom: 1rem; }
.team-fixture-group > summary { display: flex; align-items: center; gap: .65rem; list-style: none; cursor: pointer; padding: .8rem 1rem; background: var(--bg-surface-elevated); min-height: 54px; }
.team-fixture-group > summary::-webkit-details-marker { display: none; }
.team-fixture-group > summary img { width: 26px; height: 26px; object-fit: contain; background: #fff; border-radius: 5px; padding: 2px; }
.team-fixture-group > summary h3 { color: var(--text-main); font-size: .85rem; font-weight: 750; margin: 0; min-width: 0; }
.team-fixture-group > summary > span { margin-left: auto; white-space: nowrap; font-size: .65rem; color: var(--text-muted); }
.team-fixture-group > summary > i { color: var(--text-muted); font-size: .7rem; }
.team-fixture-group[open] > summary > i { transform: rotate(180deg); }
.team-fixture-group-pager { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: .65rem; border-top: 1px solid var(--border-glass); }
.team-fixture-group-pager > span { color: var(--text-muted); font-size: .7rem; }
.team-analysis-standing-heading { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.team-analysis-standing-heading h5 { font-size: .95rem; }
.team-analysis-standing-heading small { display: block; font-size: .7rem; color: var(--text-muted); margin-top: .4rem; }
.team-competition-table { min-width: 900px; table-layout: fixed; }
.team-competition-table :is(th,td) { font-size: .8rem; font-variant-numeric: tabular-nums; }
.team-competition-table :is(th,td):not(:nth-child(2)) { text-align: center; white-space: nowrap; }
.team-competition-table tr > :first-child { position: sticky; left: 0; width: 40px; z-index: 1; background: var(--bg-surface); }
.team-competition-table tr > :nth-child(2) { position: sticky; left: 40px; width: 220px; z-index: 1; background: var(--bg-surface); }
.team-competition-table thead > tr > :is(:first-child,:nth-child(2)) { z-index: 2; }
.team-competition-table tbody > tr > :last-child { font-weight: 800; }
.team-competition-table .team-standing-active > :is(:first-child,:nth-child(2)) { background: linear-gradient(var(--primary-neon-glow),var(--primary-neon-glow)),var(--bg-surface); }
.team-standing-short { display: none; }
.team-standings-scroll:focus-visible { outline: 2px solid var(--primary-neon); outline-offset: 2px; }
.team-competition-table a { color: var(--text-main); text-decoration: none; display: flex; align-items: center; gap: .6rem; }
.team-competition-table img { width: 25px; height: 25px; object-fit: contain; }
.team-competition-table .team-standing-active > * { background: var(--primary-neon-glow); color: var(--primary-neon); font-weight: 800; }
.team-standing-active a { color: var(--primary-neon); }
.team-standing-group-title { margin: 1rem 0; }
.team-standing-empty { text-align: center; padding: 2rem 1rem; color: var(--text-muted); font-size: .8rem; }
.team-standing-empty > i { display: block; font-size: 1.8rem; margin-bottom: .75rem; }

@media (max-width: 767px) {
  .team-competition-table { min-width: 560px; }
  .team-competition-table tr > :first-child { width: 36px; }
  .team-competition-table tr > :nth-child(2) { left: 36px; width: 180px; }
  .team-standing-full { display: none; }
  .team-standing-short { display: inline; }
}

@media (max-width: 575px) {
  .team-analysis-highlights { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .5rem; margin-bottom: .75rem; }
  .team-analysis-highlights > div { padding: .65rem .75rem; }
  .team-analysis-highlights dt { font-size: .65rem; }
  .team-analysis-highlights dd { font-size: 1.25rem; margin: .25rem 0 0; }
  .team-analysis-highlights > div > span { font-size: .6rem; }
  .team-competition-picker { flex: 1 1 100%; justify-content: space-between; }
  .team-competition-picker select { max-width: 72%; font-size: .75rem; min-height: 42px; }
  .team-competition-picker label { font-size: .65rem; }
  .team-analysis-categories button { padding: .5rem .6rem; font-size: .75rem; }
  .team-analysis-values { grid-template-columns: 48px minmax(0,1fr) 48px; gap: .65rem; }
  .team-analysis-values strong { font-size: .8rem; }
  .team-analysis-metric-label { font-size: .75rem; }
  .team-analysis-metric-label small { font-size: .6rem; }
  .team-analysis-comparison { padding: .65rem 0; }
  .team-analysis-legend { font-size: .65rem; }
  .team-leaders-controls { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .6rem; }
  .team-analysis-field:first-child { grid-column: 1/-1; }
  .team-analysis-field select { font-size: .75rem; min-height: 42px; }
  .team-leader-grid { grid-template-columns: minmax(0,1fr); gap: .75rem; }
  .team-leader-card { padding: .75rem; }
  .team-leader-heading h3 { font-size: .8rem; }
  .team-leader-list li { min-height: 56px; gap: .5rem; }
  .team-leader-list a { font-size: .75rem; gap: .5rem; }
  .team-leader-list a > img { width: 25px; height: 30px; flex-basis: 25px; }
  .team-leader-list strong { font-size: .85rem; }
  .team-fixture-group > summary { padding: .6rem .65rem; gap: .5rem; }
  .team-fixture-group > summary h3 { font-size: .75rem; }
  .team-fixture-group > summary img { width: 23px; height: 23px; }
  .team-fixture-group > summary > span { font-size: .6rem; }
  .team-competition-table :is(th,td) { font-size: .7rem; padding: .65rem .35rem; }
  .team-competition-table { min-width: 520px; }
  .team-competition-table tr > :first-child { width: 32px; }
  .team-competition-table tr > :nth-child(2) { left: 32px; width: 168px; }
  .team-competition-table a { gap: .4rem; }
  .team-competition-table img { width: 22px; height: 22px; }
}

.team-transfer-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .75rem; margin-bottom: 1rem; }
.team-transfer-counts { display: flex; flex-wrap: wrap; gap: .5rem; }
.team-transfer-count { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .65rem; border: 1px solid var(--border-glass); border-radius: 8px; font-size: .75rem; color: var(--text-muted); }
.team-transfer-count strong { font-size: .9rem; font-variant-numeric: tabular-nums; }
.team-transfer-count-in strong { color: var(--state-success); }
.team-transfer-count-out strong { color: var(--accent-gold); }
.team-transfer-finances { margin-bottom: 1.5rem; padding: 1rem; background: var(--bg-surface-elevated); border-radius: 10px; }
.team-transfer-finances dl { display: flex; flex-wrap: wrap; gap: .75rem 2rem; margin: 0; }
.team-transfer-finances dl > div { display: flex; align-items: baseline; gap: .65rem; }
.team-transfer-finances dt { font-size: .75rem; color: var(--text-muted); font-weight: 500; }
.team-transfer-finances dd { margin: 0; font-size: .875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.team-transfer-finances p { margin-top: .65rem; }
.team-transfer-group + .team-transfer-group { margin-top: 1.75rem; }
.team-transfer-list { list-style: none; padding: 0; margin: 0; }
.team-transfer-row { display: grid; grid-template-columns: minmax(180px, 230px) minmax(0, 1fr) 140px; align-items: center; gap: 1.25rem; padding: 1rem 0; border-top: 1px solid var(--border-glass); }
.team-transfer-player { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.team-transfer-player > img { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; object-fit: cover; background: var(--bg-surface-elevated); }
.team-transfer-player > div { min-width: 0; }
.team-transfer-player :is(a, strong) { color: var(--text-main); font-size: .875rem; font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
.team-transfer-player time { display: block; margin-top: .2rem; color: var(--text-muted); font-size: .7rem; }
.team-transfer-path { display: grid; grid-template-columns: minmax(0, 1fr) 24px minmax(0, 1fr); align-items: center; gap: .75rem; min-width: 0; }
.team-transfer-club { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; min-width: 0; }
.team-transfer-club.is-destination { flex-direction: row-reverse; text-align: right; }
.team-transfer-club :is(img, svg) { flex: 0 0 30px; width: 30px; height: 30px; object-fit: contain; }
.team-transfer-club :is(a, span) { color: var(--text-main); min-width: 0; font-size: .8rem; text-decoration: none; overflow-wrap: anywhere; }
.team-transfer-club-placeholder { color: var(--text-muted); }
.team-transfer-arrow { color: var(--primary-neon); font-size: 1.25rem; text-align: center; }
.team-transfer-fee { display: flex; flex-direction: column; gap: .2rem; text-align: right; overflow-wrap: anywhere; }
.team-transfer-fee strong { font-size: .875rem; color: var(--text-main); font-variant-numeric: tabular-nums; }
.team-transfer-fee > span { color: var(--text-muted); font-size: .7rem; }

@media (max-width: 767px) {
  #team-match-list .team-fixture-row { grid-template-columns: 40px minmax(0, 1fr) 56px minmax(0, 1fr); gap: .4rem; min-height: 82px; padding: .75rem .25rem; }
  .team-fixture-team { gap: .35rem; font-size: .75rem; }
  .team-fixture-team img { width: 25px; height: 25px; flex-basis: 25px; }
  .team-fixture-date { font-size: .65rem; }
  .team-fixture-score strong { font-size: 1rem; }
  .team-fixture-score time { font-size: .75rem; }
  .team-transfer-row { grid-template-columns: minmax(0, 1fr) 110px; gap: .85rem; }
  .team-transfer-path { grid-column: 1 / -1; grid-row: 2; }
  .team-transfer-fee { grid-column: 2; grid-row: 1; }
  .team-transfer-club :is(img, svg) { flex-basis: 26px; width: 26px; height: 26px; }
}

@media (max-width: 359px) {
  #team-match-list .team-fixture-row { grid-template-columns: 34px minmax(0, 1fr) 48px minmax(0, 1fr); gap: .25rem; }
  .team-fixture-team { font-size: .7rem; gap: .25rem; }
  .team-fixture-team img { width: 22px; height: 22px; flex-basis: 22px; }
  .team-transfer-row { grid-template-columns: minmax(0, 1fr) 90px; }
  .team-transfer-player :is(a, strong), .team-transfer-fee strong { font-size: .75rem; }
  .team-transfer-path { gap: .4rem; }
  .team-transfer-club { gap: .4rem; }
}

.team-stats-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.team-stats-switch { display: inline-flex; padding: 4px; gap: 4px; background: var(--bg-surface-elevated); border-radius: 10px; }
.team-stats-switch .nav-link { min-height: 40px; min-width: 96px; padding: .5rem 1rem; border: 0; border-radius: 7px; color: var(--text-muted); font-size: .875rem; font-weight: 700; }
.team-stats-switch .nav-link.active { background: var(--primary-neon); color: #fff; }
.team-stats-switch .nav-link:focus-visible { outline: 3px solid var(--primary-neon); outline-offset: 3px; }
.team-stats-season, .team-stats-caption { color: var(--text-muted); font-size: .8rem; }
.team-stats-caption { margin-bottom: 1rem; }
.team-stats-empty { padding: 1rem 0; margin: 0; font-size: .875rem; }
.team-stats-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: 0 0 1.5rem; }
.team-stats-metrics > div { padding: 1rem; border: 1px solid var(--border-glass); border-radius: 10px; }
.team-stats-metrics dt { color: var(--text-muted); font-size: .75rem; font-weight: 500; }
.team-stats-metrics dd { color: var(--text-main); margin: .4rem 0 0; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.team-stats-divider { color: var(--text-muted); font-size: 1rem; font-weight: 400; }
.team-stats-metrics .team-stats-record { display: flex; gap: .65rem; }
.team-stats-record span:nth-child(1) { color: var(--state-success); }
.team-stats-record span:nth-child(2) { color: var(--text-muted); }
.team-stats-record span:nth-child(3) { color: var(--state-danger); }
.team-stats-split-table { font-size: .875rem; --bs-table-bg: transparent; }
.team-stats-split-table th, .team-stats-split-table td { padding: .8rem .6rem; border-color: var(--border-glass); }
.team-stats-split-table thead th { color: var(--text-muted); font-size: .75rem; font-weight: 500; }
.team-stats-split-table :is(th, td):not(:first-child) { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.team-stats-extras { display: flex; flex-wrap: wrap; gap: 1rem 2rem; margin: 1rem 0 0; }
.team-stats-extras dt { font-size: .75rem; font-weight: 500; color: var(--text-muted); }
.team-stats-extras dd { margin: .25rem 0 0; font-weight: 600; }
.team-player-stats-table { min-width: 760px; table-layout: fixed; --bs-table-bg: transparent; }
.team-player-stats-table th, .team-player-stats-table td { padding: .75rem .6rem; border-color: var(--border-glass); }
.team-player-stats-table thead th { font-size: .75rem; color: var(--text-muted); font-weight: 500; }
.team-player-stats-table :is(th, td):not(:first-child) { text-align: center; font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.team-player-stats-table :is(th, td):first-child { position: sticky; left: 0; z-index: 1; background: var(--bg-surface); width: 200px; min-width: 200px; }
.team-player-stats-identity { display: flex; align-items: center; gap: .6rem; color: var(--text-main); font-weight: 600; font-size: .875rem; text-decoration: none; }
.team-player-stats-identity img { width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; object-fit: cover; background: var(--bg-surface-elevated); }
.team-player-stats-identity span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-player-stats-table .team-player-minutes { color: var(--text-main); font-weight: 700; }

@media (max-width: 575px) {
  .team-profile-card.mb-4 { margin-bottom: .75rem !important; }
  .team-profile-card .card-body { padding: .75rem; }
  .team-profile-body { grid-template-columns: minmax(0, 1fr) 50px; gap: .5rem .75rem; }
  .team-profile-header { gap: .6rem; }
  .team-profile-header .profile-logo { width: 52px; height: 52px; flex-basis: 52px; }
  .team-profile-identity h1 { font-size: 1.125rem; margin-bottom: .25rem !important; }
  .team-profile-identity p { font-size: .7rem; line-height: 1.4; }
  .team-league-link { font-size: .65rem; margin-bottom: .35rem; }
  .team-league-logo { width: 20px; height: 20px; flex-basis: 20px; }
  .team-favorite-action { width: 50px; height: 50px; font-size: 1.5rem; }
  .team-secondary-action { width: 32px; height: 32px; font-size: .85rem; }
  .team-secondary-action svg { width: 17px; height: 17px; }
  .team-profile-actions { gap: 5px; }
  .team-recent-form { padding-top: .4rem; }
  .team-recent-results { gap: 4px; }
  .team-recent-result { width: 26px; height: 26px; border-radius: 6px; font-size: .65rem; }
  .team-recent-results .small { font-size: .7rem; line-height: 1.4; }
  .team-detail-panels > .team-details-header { padding: 0 !important; }
  .team-season-picker { padding: .5rem .75rem; gap: .5rem; }
  .team-season-picker label { font-size: .7rem; }
  .team-season-picker .form-select { min-width: 122px; padding-block: .35rem; font-size: .75rem; }
  .team-details-tabs .nav-link { min-block-size: 44px; padding: .65rem .75rem; font-size: .75rem; }
  .team-detail-panels > .card-body { padding: .75rem; }
  .team-detail-panels .tab-pane > :is(div, section) > h5, .team-detail-panels .tab-pane > h5 { font-size: .95rem; }
  .team-detail-panels .small { font-size: .7rem; line-height: 1.45; }
  .team-club-information > .card-header, .team-facilities > .card-header { padding: .75rem !important; }
  .team-club-information .card-title, .team-facilities .card-title { font-size: .85rem; }
  .team-club-information > .card-body, .team-facilities > .card-body { padding: .75rem; }
  .team-club-information .card-body > .d-flex, .team-facilities .card-body > .d-flex { padding-block: .4rem !important; gap: .75rem; font-size: .75rem; line-height: 1.45; }
  .team-club-information .card-body > .d-flex > span { font-size: .7rem; }
  .team-club-information .card-body > .d-flex > strong { min-width: 0; text-align: right; overflow-wrap: anywhere; }
  .team-club-information .team-description, .team-facilities .team-description { font-size: .75rem; line-height: 1.5; }
  .team-kits { margin-top: .75rem; padding-top: .75rem; }
  .team-kits h4 { font-size: .8rem; margin-bottom: .6rem !important; }
  #team-match-list .team-fixture-row { min-height: 66px; padding-block: .6rem; }
  .team-fixture-team img { width: 23px; height: 23px; flex-basis: 23px; }
  .team-fixture-score strong { font-size: .95rem; }
  .team-roster-table { min-width: 590px; }
  .team-roster-table th, .team-roster-table td { padding: .55rem .5rem; font-size: .75rem; }
  .team-roster-table thead th:first-child, .team-roster-table tbody tr:not(.team-roster-group) td:first-child { width: 190px; min-width: 190px; }
  .team-roster-player { gap: .5rem; }
  .team-roster-player a { font-size: .78rem; }
  .team-shirt-number { min-width: 28px; font-size: .7rem; }
  .team-roster-flag { flex-basis: 18px; width: 18px; }
  .team-roster-table .team-roster-group th { padding: .5rem; font-size: .72rem; }
  .team-stat-icon { width: 18px; height: 18px; }
  .team-stat-starts { font-size: .85rem; }
  .team-card-icon { width: 10px; height: 15px; }
  .team-transfer-header { gap: .6rem; margin-bottom: .75rem; }
  .team-transfer-header h5 { font-size: .95rem; }
  .team-transfer-count { padding: .25rem .5rem; font-size: .65rem; }
  .team-transfer-count strong { font-size: .8rem; }
  .team-transfer-finances { padding: .75rem; margin-bottom: 1rem; }
  .team-transfer-finances dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
  .team-transfer-finances dl > div { display: block; }
  .team-transfer-finances dt { font-size: .625rem; }
  .team-transfer-finances dd { margin-top: .25rem; font-size: .72rem; overflow-wrap: anywhere; }
  .team-transfer-finances .small { font-size: .65rem; }
  .team-transfer-group h3 { font-size: .85rem; }
  .team-transfer-row { padding-block: .75rem; }
  .team-transfer-player { gap: .55rem; }
  .team-transfer-player > img { width: 32px; height: 32px; flex-basis: 32px; }
  .team-transfer-player :is(a, strong) { font-size: .78rem; }
  .team-transfer-player time, .team-transfer-fee > span { font-size: .625rem; }
  .team-transfer-fee strong { font-size: .75rem; }
  .team-transfer-club :is(a, span) { font-size: .7rem; }
  .team-transfer-club :is(img, svg) { width: 23px; height: 23px; flex-basis: 23px; }
  .team-stats-toolbar { gap: .5rem; margin-bottom: .75rem; }
  .team-stats-switch { padding: 3px; }
  .team-stats-switch .nav-link { min-width: 76px; min-height: 40px; padding: .5rem .75rem; font-size: .75rem; }
  .team-stats-season { font-size: .7rem; }
  .team-stats-caption { margin-bottom: .75rem; font-size: .7rem; line-height: 1.45; }
  .team-stats-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
  .team-stats-metrics > div { padding: .65rem .75rem; border-radius: 8px; }
  .team-stats-metrics dt { font-size: .65rem; line-height: 1.4; }
  .team-stats-metrics dd { margin-top: .25rem; font-size: 1.15rem; }
  .team-stats-metrics .team-stats-record { gap: .5rem; }
  .team-stats-divider { font-size: .8rem; }
  .team-stats-split h3 { font-size: .8rem; }
  .team-stats-split-table { font-size: .7rem; }
  .team-stats-split-table th, .team-stats-split-table td { padding: .6rem .25rem; }
  .team-stats-split-table thead th { font-size: .625rem; }
  .team-stats-extras dt { font-size: .65rem; }
  .team-stats-extras dd { font-size: .75rem; }
  .team-player-stats-table { min-width: 650px; }
  .team-player-stats-table th, .team-player-stats-table td { padding: .55rem .5rem; }
  .team-player-stats-table :is(th, td):first-child { width: 170px; min-width: 170px; }
  .team-player-stats-table :is(th, td):not(:first-child) { font-size: .75rem; }
  .team-player-stats-identity { font-size: .78rem; }
  .team-player-stats-identity img { width: 24px; height: 24px; flex-basis: 24px; }
}

@media (max-width: 420px) {
  #team-match-list .team-fixture-row { grid-template-columns: 28px minmax(0,1fr) 42px minmax(0,1fr); gap: .35rem; min-height: 80px; padding: .6rem .4rem; }
  .team-fixture-team { flex-direction: column; justify-content: center; text-align: center; gap: .3rem; }
  .team-fixture-home { flex-direction: column-reverse; }
  .team-fixture-team > span { overflow-wrap: normal; font-size: .65rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .team-fixture-team img { flex-basis: 24px; width: 24px; height: 24px; }
  .team-fixture-date { font-size: .6rem; }
  .team-detail-panels { scroll-margin-top: 72px; }
}

/* Keep every section visible without a nested scrollbar in the navigation. */
@media (max-width: 1199px) {
  .team-details-header { flex-wrap: wrap; }
  .team-details-header .team-details-tabs { flex-basis: 100%; }
  .team-details-header .team-season-picker { order: -1; width: 100%; border-bottom: 1px solid var(--border-glass); }
}
@media (max-width: 991px) {
  .team-details-header .team-details-tabs { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .team-details-header .team-details-tabs .nav-link { min-block-size: 48px; padding: .5rem .35rem; font-size: .75rem; }
}
@media (max-width: 359px) {
  .team-details-header .team-details-tabs .nav-link { font-size: .7rem; }
}
