/* Dedicated record pages: independent of the sidebar-based stats layout. */
.records-page {
    --record-ink: #102647;
    --record-muted: #68768a;
    --record-line: #e5eaf1;
    max-width: 1240px;
    margin: 0 auto 3rem;
    color: var(--record-ink);
}
.records-page *, .records-page *::before, .records-page *::after { box-sizing: border-box; }
.records-heading { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem 0 1.5rem; border-bottom: 1px solid var(--record-line); }
.records-eyebrow { margin: 0 0 .6rem; color: #bb2444; font-size: .7rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.records-heading h1 { margin: 0; color: var(--record-ink); font-size: clamp(1.8rem, 3.2vw, 2.6rem); font-weight: 800; line-height: 1.15; letter-spacing: -.04em; }
.records-description { margin: .7rem 0 0; color: var(--record-muted); font-size: .95rem; line-height: 1.6; }
.records-edition { flex-shrink: 0; border: 1px solid #dbe4f0; border-radius: 100px; background: #f1f5fb; color: #31517b; font-size: .78rem; font-weight: 650; padding: .55rem .9rem; }
.records-links { display: flex; flex-wrap: wrap; gap: .65rem 1.4rem; margin: 1.1rem 0 1.8rem; }
.records-links a { display: inline-flex; gap: .5rem; align-items: center; color: #425876; font-size: .82rem; font-weight: 600; text-decoration: none; padding: .2rem 0; }
.records-links a span { color: #97a5b8; }
.records-links a:hover { color: #003893; text-decoration: underline; text-underline-offset: 4px; }
.records-leader { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1.5rem; margin-bottom: 1.5rem; padding: 1.5rem 1.8rem; background: #f1f5fb; border: 1px solid #e1e8f2; border-radius: 12px; }
.records-leader-player { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.records-leader-photo { width: 64px; height: 64px; object-fit: cover; object-position: center top; border-radius: 50%; border: 3px solid white; background: #e4ebf5; }
.records-leader .records-eyebrow { color: #647895; margin-bottom: .35rem; font-size: .65rem; }
.records-leader-player a { font-weight: 750; font-size: 1.2rem; line-height: 1.3; color: var(--record-ink); text-decoration: none; }
.records-leader-country { display: block; font-size: .8rem; color: var(--record-muted); margin-top: .25rem; }
.records-leader-stats { display: flex; gap: 2.5rem; margin: 0; }
.records-leader-stats div { display: flex; flex-direction: column; gap: .3rem; }
.records-leader-stats dt { font-size: .73rem; color: var(--record-muted); }
.records-leader-stats dd { font-size: 1.75rem; line-height: 1.1; font-weight: 800; font-variant-numeric: tabular-nums; color: #003893; margin: 0; }
.records-panel { background: #fff; border: 1px solid var(--record-line); border-radius: 12px; overflow: hidden; box-shadow: 0 5px 18px rgba(16, 38, 71, .035); }
.records-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; padding: 1.3rem 1.5rem; }
.records-toolbar h2 { margin: 0; font-size: 1rem; font-weight: 750; color: var(--record-ink); }
.records-toolbar p { margin: .3rem 0 0; color: var(--record-muted); font-size: .77rem; }
.records-filter { display: flex; align-items: center; gap: .5rem; margin: 0; }
.records-filter label { color: var(--record-muted); font-size: .78rem; margin-right: .25rem; }
.records-filter select, .records-filter button { border: 1px solid #d8e1ec; border-radius: 6px; padding: .55rem .75rem; font: inherit; font-size: .8rem; min-height: 38px; background: #fff; color: var(--record-ink); }
.records-filter select { min-width: 125px; }
.records-filter button { background: #003893; border-color: #003893; color: white; font-weight: 650; cursor: pointer; }
.records-filter button:hover { background: #002b72; }
.records-season-tabs { display: flex; gap: .2rem; padding: .25rem; background: #f2f5f9; border-radius: 8px; flex-wrap: wrap; }
.records-season-tabs a { padding: .45rem .8rem; border-radius: 5px; color: #66768b; text-decoration: none; font-size: .8rem; font-weight: 650; }
.records-season-tabs a[aria-current="page"] { background: white; color: #003893; box-shadow: 0 1px 4px #142e5115; }
.records-table-wrap { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
.records-table { width: 100%; min-width: 820px; margin: 0; border-collapse: separate; border-spacing: 0; font-size: .88rem; font-variant-numeric: tabular-nums; }
.records-table th, .records-table td { padding: 1rem .85rem; border: 0; border-bottom: 1px solid #edf0f5; text-align: right; vertical-align: middle; color: #4a5a70; white-space: nowrap; }
.records-table thead th { background: #f7f9fc; border-top: 1px solid var(--record-line); border-bottom: 1px solid var(--record-line); color: #6a7890; font-size: .68rem; font-weight: 700; letter-spacing: .035em; text-transform: uppercase; }
.records-table tbody th { background: white; font-weight: 600; }
.records-table th.records-identity-cell { text-align: left; width: 35%; min-width: 240px; white-space: normal; }
.records-table .records-rank-cell { width: 60px; min-width: 60px; text-align: center; padding-left: 1.3rem; padding-right: .55rem; }
.records-rank { display: inline-flex; width: 27px; height: 27px; border-radius: 50%; align-items: center; justify-content: center; font-size: .75rem; color: #8090a5; }
.records-rank-1 { color: #926a10; background: #fff2cc; font-weight: 750; }
.records-rank-2 { color: #627289; background: #edf1f7; font-weight: 750; }
.records-rank-3 { color: #a35f36; background: #faeee6; font-weight: 750; }
.records-table .records-featured { color: #003893; background: #f5f8fd; }
.records-table td.records-featured strong { font-size: 1.1rem; font-weight: 800; }
.records-table tbody tr:hover td, .records-table tbody tr:hover th { background-color: #f3f6fb; }
.records-table tbody tr:last-child td, .records-table tbody tr:last-child th { border-bottom: 0; }
.records-table th:last-child, .records-table td:last-child { padding-right: 1.5rem; }
.record-identity { display: flex; align-items: center; gap: .75rem; color: var(--record-ink); text-decoration: none; min-width: 0; line-height: 1.35; }
.record-identity > div, .record-identity > span:last-child { min-width: 0; }
.record-identity a { color: var(--record-ink); font-weight: 650; text-decoration: none; }
.record-identity:hover, .record-identity a:hover { color: #003893; }
.record-player-photo, .record-initial { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; background: #eef3fa; color: #7185a3; object-fit: cover; object-position: center top; }
.record-initial { font-size: .85rem; font-weight: 600; }
.record-team-name { display: block; color: #7e8b9c; margin-top: .25rem; font-size: .7rem; font-weight: 400; }
.record-team-name .flag-icon { width: 13px; height: 10px; display: inline-block; }
.record-team-logo { width: 42px; height: 42px; flex: 0 0 42px; display: inline-flex; align-items: center; justify-content: center; background: #f8fafc; border: 1px solid #edf0f5; border-radius: 8px; color: #7185a3; }
.record-team-logo img { display: block; width: 34px; height: 34px; object-fit: contain; }
.records-table .record-wins { color: #16805a; font-weight: 650; }
.record-nrr { font-size: .82rem; }
.records-table abbr { text-decoration: none; cursor: help; }
.record-percentage { display: flex; flex-direction: column; align-items: flex-end; gap: .3rem; font-size: .8rem; }
.record-percentage meter { display: block; width: 70px; height: 5px; border: 0; border-radius: 4px; background: #e9eef5; appearance: none; }
.record-percentage meter::-webkit-meter-bar { border: 0; border-radius: 4px; background: #e9eef5; }
.record-percentage meter::-webkit-meter-optimum-value { border-radius: 4px; background: #5b83bd; }
.record-percentage meter::-moz-meter-bar { border-radius: 4px; background: #5b83bd; }
.records-table-note { border-top: 1px solid var(--record-line); padding: 1rem 1.5rem; margin: 0; color: #8390a2; font-size: .72rem; line-height: 1.6; background: #fcfdff; }
.records-table .records-empty { padding: 3rem 1rem; text-align: center; color: var(--record-muted); white-space: normal; }
.records-page a:focus-visible, .records-page select:focus-visible, .records-page button:focus-visible, .records-table-wrap:focus-visible { outline: 3px solid #dc143c; outline-offset: -3px; }
@media (max-width: 760px) {
    .records-heading { align-items: flex-start; gap: 1rem; }
    .records-description { font-size: .85rem; }
    .records-edition { font-size: .7rem; padding: .4rem .65rem; }
    .records-leader { padding: 1.1rem; }
    .records-leader-player a { font-size: 1.05rem; }
    .records-leader-stats { gap: 2rem; }
    .records-toolbar { padding: 1rem; }
    .records-table th, .records-table td { padding: .9rem .7rem; }
    .records-table .records-secondary { display: none; }
    .boundary-table { min-width: 640px; }
    .points-table { min-width: 640px; }
    .records-table th.records-identity-cell { min-width: 205px; }
    .records-table .records-rank-cell { display: none; }
    .records-table .records-identity-cell { position: sticky; left: 0; z-index: 1; background: white; border-right: 1px solid #edf0f5; }
    .records-table thead .records-identity-cell { background: #f7f9fc; z-index: 2; }
    .records-links { gap: .65rem 1rem; margin-bottom: 1.25rem; }
    .records-table-note { padding: .85rem 1rem; }
}
@media (max-width: 480px) {
    .records-heading { flex-direction: column-reverse; gap: .8rem; }
    .records-heading h1 { font-size: 1.8rem; }
    .records-leader { gap: 1.25rem; }
    .records-leader-stats { width: 100%; justify-content: space-between; border-top: 1px solid #dfe6f0; padding-top: 1rem; gap: 1rem; }
    .records-leader-stats dd { font-size: 1.5rem; }
    .records-filter { width: 100%; }
    .records-filter select { flex: 1; min-width: 0; }
    .records-table th.records-identity-cell { min-width: 175px; max-width: 190px; }
    .record-identity { gap: .5rem; font-size: .8rem; }
    .record-player-photo, .record-initial { width: 32px; height: 32px; flex-basis: 32px; }
    .record-team-logo { width: 34px; height: 34px; flex-basis: 34px; }
    .record-team-logo img { width: 28px; height: 28px; }
}

.records-mobile-hint { display: none; }
@media (max-width: 760px) { .records-mobile-hint { display: block; margin: 0; padding: 0 1rem .7rem; color: #7e8b9c; font-size: .68rem; } }

@media (max-width: 760px) {
    .records-table { table-layout: fixed; }
    .records-table th.records-identity-cell { width: 175px; min-width: 175px; max-width: 175px; }
    .records-table thead .records-featured { white-space: normal; }
}

/* Boundary records use the established StatsNPL blue and red palette. */
.boundary-records-page { --record-ink: #003893; }
.boundary-records-page .records-heading h1, .boundary-records-page .records-leader-player a { color: #003893; }
.boundary-records-page .records-eyebrow { color: #dc143c; }
.boundary-records-page .records-table thead th { background: #003893; color: white; border-bottom-color: #dc143c; }
.boundary-records-page .records-table thead .records-featured { background: #003893; color: white; }
.boundary-records-page .records-table td.records-featured { color: #dc143c; background: #fff5f7; }
.boundary-records-page .records-leader-stats dd { color: #dc143c; }
.boundary-records-page .records-filter button { background: #dc143c; border-color: #dc143c; }
.boundary-records-page .records-filter button:hover { background: #b01030; }
.boundary-records-page .record-percentage meter::-webkit-meter-optimum-value { background: #003893; }
.boundary-records-page .record-percentage meter::-moz-meter-bar { background: #003893; }
@media (max-width: 760px) { .boundary-records-page .records-table thead .records-identity-cell { background: #003893; } }

/* The requested batting pages share one full-width records presentation. */
.records-page.boundary-records-page { max-width: 1680px; margin: 2rem auto 3rem; padding: 0 1rem; }
.batting-stats-records-page { grid-template-columns: 280px minmax(0,1fr); }
.batting-stats-records-page > .records-heading { grid-column: 1 / -1; grid-row: 1; margin-bottom: 1.25rem; }
.batting-stats-records-page > .stats-kpi-row { grid-column: 1 / -1; grid-row: 2; }
.batting-stats-records-page > .records-links { grid-column: 1 / -1; grid-row: 3; }
.batting-stats-records-page > .filters-section { grid-column: 1; grid-row: 4 / span 2; }
.batting-stats-records-page > .batting-leaderboard { grid-column: 2; grid-row: 4; min-width: 0; margin-left: 1.5rem; }
.batting-stats-records-page > .pagination { grid-column: 2; grid-row: 5; margin-left: 1.5rem; }
.batting-stats-records-page .table-toolbar { margin: 0; border: 0; border-radius: 0; box-shadow: none; padding: 1.1rem; }
.batting-stats-records-page .table-controls { justify-content: flex-start; }
.batting-stats-records-page .records-table .records-identity-cell { width: 25%; }
.records-table.batting-records-table { min-width: 1080px; }
.records-table.batting-records-table thead a { color: white; text-decoration: none; display: inline-flex; gap: .25rem; align-items: center; }
.records-table.batting-records-table thead a:hover { color: #ffe19a; }
.records-table.batting-records-table tbody a { color: #003893; }
.records-table.batting-records-table .records-rank-cell { min-width: 50px; width: 50px; }
@media (max-width: 1024px) {
    .batting-stats-records-page { grid-template-columns: minmax(0,1fr); }
    .batting-stats-records-page > .records-heading,
    .batting-stats-records-page > .stats-kpi-row,
    .batting-stats-records-page > .records-links,
    .batting-stats-records-page > .filters-section,
    .batting-stats-records-page > .batting-leaderboard,
    .batting-stats-records-page > .pagination { grid-column: 1; grid-row: auto; min-width: 0; margin-left: 0; margin-right: 0; }
    .batting-stats-records-page > .filters-section { position: static; margin-bottom: 1rem; }
}
@media (max-width: 760px) {
    .records-table.batting-records-table { min-width: 1080px; }
    .batting-stats-records-page .records-table th.records-identity-cell { width: 175px; min-width: 175px; max-width: 175px; }
    .batting-stats-records-page .table-controls { min-width: 0; }
    .batting-stats-records-page .toolbar-search { flex-basis: 100%; min-width: 0; }
    .batting-stats-records-page .sort-group { min-width: 0; flex: 1; }
    .batting-stats-records-page .per-page-group { width: 75px; }
    .batting-stats-records-page .records-table-wrap { width: 100%; }
}

.batting-stats-records-page .records-table.batting-records-table { min-width: 1000px; }
