/* Opt-in styles for public pages that display tables. Home and editorial pages do not opt in. */
.table-page {
    --table-ink: #003893;
    --table-muted: #68768a;
    --table-line: #e5eaf1;
}
.table-page main { min-width: 0; }
.table-page main > :is(.stats-container,.team-container,.player-container,.guide-shell,.leaderboard-container,.season-container) { max-width: 1680px; width: 100%; padding: 0 1rem; min-width: 0; }
.table-page main > .records-page { max-width: 1680px; width: 100%; margin: 2rem auto 3rem; padding: 0 1rem; }
/* Shared title and introduction treatment, with existing wording intact. */
.table-page main :is(.stats-hero,.seo-stat-hero,.guide-hero,.team-header,.player-header,.leaderboard-header,.season-hero,.records-heading) {
    background: transparent; border: 0; border-bottom: 1px solid var(--table-line); border-radius: 0; box-shadow: none; color: var(--table-ink); padding: 1rem 0 1.5rem; margin: 0 0 1.25rem; text-align: left;
}
.table-page main :is(.stats-hero,.seo-stat-hero,.guide-hero,.team-header,.player-header,.leaderboard-header,.season-hero,.records-heading) h1 {
    margin: 0 0 .6rem; color: #003893; font-size: clamp(1.8rem,3.2vw,2.6rem); font-weight: 800; line-height: 1.15; letter-spacing: -.04em; text-shadow: none; background: none; -webkit-text-fill-color: initial;
}
.table-page main :is(.stats-hero,.seo-stat-hero,.guide-hero,.team-header,.player-header,.leaderboard-header,.season-hero,.records-heading) p {
    color: #68768a !important; font-size: .95rem; line-height: 1.6; opacity: 1;
}
.table-page main :is(.stats-hero,.seo-stat-hero,.guide-hero,.records-heading) :is(.eyebrow,.guide-eyebrow,.records-eyebrow) { color: #dc143c !important; font-size: .7rem; letter-spacing: .1em; font-weight: 750; text-transform: uppercase; }
.table-page .guide-update { color: #68768a; background: #f1f5fb; border: 1px solid #e1e8f2; }
.table-page :is(.favorite-community,.favorite-community .fav-count,.teams-label,.team-meta .meta-label,.team-meta .meta-value) { color: #68768a; }
.table-page .team-badge { background: white; border: 1px solid var(--table-line); color: #425876; }
.table-page .team-badge a { color: #003893; }
.table-page .season-tag { color: #718097; background: #f1f5fb; }
/* White table panels, consistent row spacing and a solid brand header. */
.table-page main :is(.table-wrapper,.table-scroll,.standings-table,.leaderboard-table) {
    max-width: 100%; min-width: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; background: white; border: 1px solid var(--table-line); border-radius: 12px; box-shadow: 0 5px 18px rgba(16,38,71,.035);
}
.table-page main table { width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; font-size: .88rem; font-variant-numeric: tabular-nums; }
.table-page main table thead { background: #003893; }
.table-page main table thead th {
    padding: 1rem .85rem; background: #003893 !important; color: white !important; border: 0; border-bottom: 1px solid #dc143c; font-size: .68rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; line-height: 1.5; vertical-align: middle; text-align: right;
}
.table-page main table thead th a { color: white; text-decoration: none; }
.table-page main table thead th a:hover { color: #ffe19a; }
.table-page main table tbody :is(td,th) { padding: 1rem .85rem; border: 0; border-bottom: 1px solid #edf0f5; color: #4a5a70; background: white; vertical-align: middle; text-align: right; }
.table-page main table tbody th { text-align: left; color: #003893; }
.table-page main table tbody tr:last-child :is(td,th) { border-bottom: 0; }
.table-page main table tbody tr:hover :is(td,th) { background: #f3f6fb; }
.table-page main table :is(th,td):first-child { text-align: left; }
.table-page main :is(.records-table,.stats-table,.standings-table,.performers-table,.squad-table,.trivia-score-table) :is(th,td):nth-child(2) { text-align: left; }
.table-page main .records-table :is(th,td).records-rank-cell { text-align: center; }
.table-page main .records-table th.records-identity-cell { text-align: left; }
.table-page main .records-table td.records-featured { color: #dc143c; background: #fff5f7; }
.table-page main .records-table td.records-featured strong { font-size: 1.1rem; font-weight: 800; }
.table-page main .records-table thead th.records-featured { color: white; background: #003893; }
.table-page main table a { color: #003893; text-decoration: none; }
.table-page main table a:hover { text-decoration: underline; }
.table-page main .records-table .records-featured a { color: inherit; }
.table-page main :is(.sorted-value,.record-total) { color: #dc143c !important; background: #fff5f7; border-radius: 4px; font-weight: 800; }
.table-page .stats-box { background: none; border: 0; padding: 0; box-shadow: none; text-align: right; }
.table-page .stats-box .value { font-size: .88rem; }
.table-page main .rank { display: inline-flex; align-items: center; justify-content: center; min-width: 27px; height: 27px; padding: .2rem .4rem; border-radius: 50%; background: #f0f4fa; color: #718097; font-size: .75rem; }
.table-page .extended-records-table { min-width: 1050px; }
.table-page .extended-records-table th.records-identity-cell { width: 25%; min-width: 220px; }
.table-page .extended-records-table .record-identity { min-width: 190px; }
.table-page .record-identity a { font-weight: 650; }
.table-page .records-table .record-team-name { color: #7e8b9c; font-weight: 400; font-size: .7rem; }
.table-page .record-player-photo { object-fit: cover; object-position: center top; }
/* Same typography and lightweight links above all stats tables. */
.table-page .stats-page-links { display: flex; flex-wrap: wrap; gap: .65rem 1.4rem; }
.table-page .stats-page-links a { background: none; border: 0; padding: .2rem 0; color: #425876; font-size: .82rem; font-weight: 600; text-decoration: none; }
.table-page .stats-page-links a:hover { color: #003893; text-decoration: underline; }
.table-page .stats-page-links a[aria-current="page"] { background: none; color: #003893; border-bottom: 2px solid #003893; }
/* Keep search an accessible submit button; the icon follows the label color. */
.table-page .search-box { min-width: 0; }
.table-page .search-input { min-width: 0; border-radius: 6px 0 0 6px; border-color: #d8e1ec; background: white; }
.table-page .search-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem; flex-shrink: 0; background: #003893; color: white; border: 1px solid #003893; border-radius: 0 6px 6px 0; padding: .65rem .95rem; font: inherit; font-size: .85rem; font-weight: 650; white-space: nowrap; box-shadow: none; transform: none; cursor: pointer;
}
.table-page .search-btn::before { content: none; }
.table-page .search-btn:hover { background: #002b72; border-color: #002b72; box-shadow: none; transform: none; }
.table-page .search-btn:active { background: #00245f; transform: none; }
.table-page .search-icon { display: block; width: 16px; height: 16px; flex: 0 0 16px; }
.table-page .search-btn:focus-visible { outline: 3px solid #dc143c; outline-offset: 3px; }
/* Explicit grid positions keep filters, summary cards and the table separate. */
.table-page .bowling-stats-records-page { grid-template-columns: 280px minmax(0,1fr); }
.table-page .bowling-stats-records-page > .stats-hero { grid-column: 1 / -1; grid-row: 1; }
.table-page .bowling-stats-records-page > .stats-kpi-row { grid-column: 1 / -1; grid-row: 2; }
.table-page .bowling-stats-records-page > .stats-page-links { grid-column: 1 / -1; grid-row: 3; margin: 1.1rem 0 1.8rem; }
.table-page .bowling-stats-records-page > .filters-section { grid-column: 1; grid-row: 4 / span 3; }
.table-page .bowling-stats-records-page > .table-toolbar { grid-column: 2; grid-row: 4; }
.table-page .bowling-stats-records-page > .table-wrapper { grid-column: 2; grid-row: 5; }
.table-page .bowling-stats-records-page > .pagination { grid-column: 2; grid-row: 6; }
.table-page .record-table-page .filters-section { grid-row: 2 / span 2; }
.table-page .record-table-page .table-wrapper { grid-row: 2; }
.table-page .record-table-page .pagination { grid-row: 3; }
.table-page .season-records-page .table-wrapper { margin: 0; }
/* Table children must scroll locally instead of widening a profile or scorecard. */
.table-page :is(.guide-shell,.team-container,.player-container) > *,
.table-page :is(.scorecard-list,.leader-grid,.current-season-performers-grid) > * { min-width: 0; }
.table-page .scorecard-list { grid-template-columns: minmax(0,1fr); min-width: 0; }
.table-page .current-season-performers-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
.table-page .season-player-content { min-width: 0; flex: 1; }
.table-page .team-container :is(.tabs-container,.tab-content) { min-width: 0; max-width: 100%; }
.table-page .team-container .tabs-navigation { flex-wrap: wrap; }
.table-page .policy-container table { display: block; overflow-x: auto; }
@media (max-width: 1024px) {
    .table-page .bowling-stats-records-page { grid-template-columns: minmax(0,1fr); }
    .table-page .bowling-stats-records-page > :is(.stats-hero,.stats-kpi-row,.stats-page-links,.filters-section,.table-toolbar,.table-wrapper,.pagination),
    .table-page .record-table-page > :is(.stats-hero,.filters-section,.table-wrapper,.pagination) { grid-column: 1; grid-row: auto; min-width: 0; margin-left: 0; margin-right: 0; }
    .table-page .record-table-page { grid-template-columns: minmax(0,1fr); }
    .table-page .bowling-stats-records-page > .filters-section { position: static; margin-bottom: 1rem; }
    .table-page .current-season-performers-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 760px) {
    .table-page main table thead th, .table-page main table tbody :is(th,td) { padding: .9rem .7rem; }
    .table-page .extended-records-table th.records-identity-cell { width: 175px; min-width: 175px; max-width: 175px; }
    .table-page .extended-records-table .records-identity-cell { position: sticky; left: 0; z-index: 1; background: white; border-right: 1px solid var(--table-line); }
    .table-page .extended-records-table thead .records-identity-cell { background: #003893; z-index: 2; }
    .table-page .extended-records-table .record-identity { min-width: 0; }
    .table-page .extended-records-table .records-rank-cell { display: none; }
    .table-page .current-season-performers-grid { grid-template-columns: minmax(0,1fr); }
    .table-page .performer-card-compact .player-name-season { white-space: normal; overflow-wrap: anywhere; }
    .table-page .guide-shell .source-panel { flex-wrap: wrap; }
    .table-page .guide-shell .source-panel ul { min-width: 0; }
}

.table-page .records-table td.records-featured .value { color: #dc143c; font-size: 1.1rem; font-weight: 800; }
.table-page .records-table td.records-featured .sorted-value { background: none; padding: 0; }
.table-page .policy-container .table-scroll table { min-width: 550px; }
.table-page .policy-container .table-scroll :is(th,td) { text-align: left; white-space: normal; }

/* Text-heavy record columns align to their headings rather than numeric edges. */
.table-page main .match-records-page table :is(th,td):nth-child(n+3) { text-align: left; }
.table-page main .match-records-page table :is(th,td):nth-child(-n+2) { text-align: center; }
.table-page .match-records-page .record-date { white-space: nowrap; }
.table-page .match-records-page .record-venue { white-space: normal; max-width: 230px; line-height: 1.6; }
.table-page main .points-table :is(th,td):nth-child(2) { text-align: left; }
/* Restore distinct colored identity headers for player and team profiles. */
.table-page main .player-container > .player-header,
.table-page main .team-container > .team-header { background: linear-gradient(135deg,#003893 0%,#001f4d 100%); color: white; border: 0; border-radius: 12px; padding: 2rem; margin-bottom: 2rem; box-shadow: 0 8px 24px rgba(0,40,100,.12); }
.table-page main .player-container > .player-header h1,
.table-page main .team-container > .team-header h1 { color: white; -webkit-text-fill-color: white; }
.table-page main .player-container > .player-header p,
.table-page main .team-container > .team-header p { color: rgba(255,255,255,.85) !important; }
.table-page .player-header :is(.favorite-community,.favorite-community .fav-count,.teams-label),
.table-page .team-header :is(.favorite-community,.favorite-community .fav-count,.meta-label,.meta-value) { color: rgba(255,255,255,.9); }
.table-page .team-header .meta-item { background: rgba(255,255,255,.09); border-left-color: #dc143c; }
.table-page .player-header .player-profile-photo { width: 104px; height: 104px; object-fit: cover; object-position: center top; background: white; border: 3px solid rgba(255,255,255,.9); border-radius: 50%; flex: 0 0 104px; box-shadow: 0 4px 16px rgba(0,0,0,.15); }
.table-page .team-header .team-profile-logo { width: 104px; height: 104px; object-fit: contain; background: white; padding: .5rem; border: 1px solid white; border-radius: 12px; flex: 0 0 104px; }
.table-page .player-header .header-top { align-items: center; }
.table-page .player-header .teams-section { border-top-color: rgba(255,255,255,.2); }
/* Featured player, matching the Boundary Hitters reference panel. */
.player-spotlight { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.5rem 1.8rem; margin: 0 0 1.5rem; background: #f1f5fb; border: 1px solid #e1e8f2; border-radius: 12px; min-width: 0; }
.player-spotlight-identity { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.player-spotlight-photo { display: block; width: 64px; height: 64px; flex: 0 0 64px; object-fit: cover; object-position: center top; background: #e4ebf5; border: 3px solid white; border-radius: 50%; }
.player-spotlight-label { margin: 0 0 .35rem; color: #dc143c; font-size: .65rem; font-weight: 750; letter-spacing: .1em; line-height: 1.5; text-transform: uppercase; }
.player-spotlight-identity a { color: #003893; font-size: 1.2rem; line-height: 1.3; font-weight: 750; text-decoration: none; }
.player-spotlight-country { display: block; color: #68768a; margin-top: .25rem; font-size: .8rem; }
.player-spotlight-metrics { display: flex; gap: 2.5rem; margin: 0; }
.player-spotlight-metrics div { display: flex; flex-direction: column; gap: .3rem; }
.player-spotlight-metrics dt { color: #68768a; font-size: .73rem; white-space: nowrap; }
.player-spotlight-metrics dd { color: #dc143c; font-size: 1.75rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; margin: 0; }
.table-page .batting-stats-records-page > .player-spotlight,
.table-page .bowling-stats-records-page > .player-spotlight { grid-column: 1 / -1; grid-row: 4; }
.table-page .batting-stats-records-page > .filters-section { grid-row: 5 / span 2; }
.table-page .batting-stats-records-page > .batting-leaderboard { grid-row: 5; }
.table-page .batting-stats-records-page > .pagination { grid-row: 6; }
.table-page .bowling-stats-records-page > .filters-section { grid-row: 5 / span 3; }
.table-page .bowling-stats-records-page > .table-toolbar { grid-row: 5; }
.table-page .bowling-stats-records-page > .table-wrapper { grid-row: 6; }
.table-page .bowling-stats-records-page > .pagination { grid-row: 7; }
.table-page .record-table-page > .player-spotlight { grid-column: 1 / -1; grid-row: 2; }
.table-page .record-table-page .filters-section { grid-row: 3 / span 2; }
.table-page .record-table-page .table-wrapper { grid-row: 3; }
.table-page .record-table-page .pagination { grid-row: 4; }
.table-page .seo-stats-container > .player-spotlight { grid-column: 1 / -1; grid-row: 2; }
.table-page .seo-stats-container > .seo-table-wrapper,
.table-page .seo-stats-container > .record-link-panel { grid-row: 3; }
@media (max-width: 1024px) {
    .table-page .batting-stats-records-page > :is(.player-spotlight,.filters-section,.batting-leaderboard,.pagination),
    .table-page .bowling-stats-records-page > :is(.player-spotlight,.filters-section,.table-toolbar,.table-wrapper,.pagination),
    .table-page .record-table-page > :is(.player-spotlight,.filters-section,.table-wrapper,.pagination) { grid-column: 1; grid-row: auto; }
}
@media (max-width: 760px) {
    .table-page .seo-stats-container > :is(.player-spotlight,.seo-table-wrapper,.record-link-panel) { grid-column: 1; grid-row: auto; }
    .player-spotlight { padding: 1.1rem; }
    .player-spotlight-identity a { font-size: 1.05rem; }
    .player-spotlight-metrics { gap: 2rem; }
    .table-page main .player-container > .player-header,
    .table-page main .team-container > .team-header { padding: 1.25rem; }
    .table-page .player-header .header-top { flex-wrap: wrap; gap: .85rem; }
    .table-page .player-header .player-profile-photo { width: 80px; height: 80px; flex-basis: 80px; }
    .table-page .team-header .team-profile-logo { width: 80px; height: 80px; flex-basis: 80px; }
}
@media (max-width: 480px) {
    .player-spotlight-metrics { width: 100%; gap: .75rem; justify-content: space-between; padding-top: 1rem; border-top: 1px solid #dfe6f0; }
    .player-spotlight-metrics dd { font-size: 1.5rem; }
}

@media (max-width:700px) {
    .table-page .filters-section .search-box { display: flex; flex-direction: column; gap: .5rem; }
    .table-page .filters-section .search-input, .table-page .filters-section .search-btn { width:100%; border-radius:6px; }
}
