/* Tables fit their container; narrow screens retain every value without sideways scrolling. */
body table {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100%;
    table-layout: fixed !important;
    box-sizing: border-box;
}
body table :is(th, td) {
    min-width: 0 !important;
    max-width: none !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}
body table :is(a, button, input, select) { max-width: 100%; min-width: 0; }
body table :is(a, button, small, strong, span) { white-space: normal; overflow-wrap: anywhere; }
body :is(.ev-summary-table-wrapper, .ev-table-wrap, .profile-table-scroll, .plans-comparison,
    .ref-directory__scroll, .users-content, .users-table-container) { min-width: 0; max-width: 100%; }
body .ev-summary-table :is(th, td) {
    padding: 8px 4px !important;
    font-size: .72rem !important;
    letter-spacing: 0 !important;
    line-height: 1.3;
    width: auto;
}
body .ev-summary-table :is(th, td):first-child { width: 24%; position: static !important; }
body .ev-summary-table :is(th, td):nth-child(2) { width: 14%; }
body .ev-summary-table .prop-market-link { font-size: inherit; padding-inline: 0; white-space: normal; }
body .ev-summary-table .ev-cell { font-variant-numeric: tabular-nums; }
body .ev-summary-table .prop-locked-placeholder { min-width: 0; max-width: 100%; }
body .matchup-ev-table :is(th, td) { padding: 8px 4px; white-space: normal; }
body .ev-table :is(th, td) { padding: 8px 5px; }
body .ev-table .ev-number { padding: 9px 2px; font-size: .75rem; white-space: normal; }
body .ev-table .ev-number small { margin-right: 2px; }
body .ev-table :is(.player-info-cell, .ev-matchup-name) { min-width: 0; flex-wrap: wrap; gap: 4px; }
body .ev-table .ev-placeholder { min-width: 0; }
body .users-table :is(input, select, button) { min-width: 0; max-width: 100%; box-sizing: border-box; white-space: normal; }
@media (max-width: 650px) {
    body table :is(th, td) { padding: 7px 3px !important; font-size: .68rem; letter-spacing: 0 !important; }
    body .ev-summary-table :is(th, td) { padding: 8px 3px !important; font-size: .67rem !important; }
    body .ev-table :is(th, td) { position: static !important; width: auto; font-size: .65rem; }
    body .ev-table :is(th, td):nth-child(2) { width: 29%; }
    body #propsTable :is(th, td):nth-child(4) { width: 19%; }
    body .ev-table:not(#propsTable) :is(th, td):nth-child(3) { width: 19%; }
    body .ev-table :is(.ev-number, .line-value, .ev-name-button, .player-name-text) { font-size: .67rem; }
    body .ev-table .ev-number { min-height: 40px; padding: 8px 0; }
    body .ev-table .ev-number small { display: block; font-size: .6rem; margin: 0 0 2px; }
    body .ev-table .team-mark { width: 20px; height: 20px; }
    body #refereeTable :is(th, td) { padding: 8px 3px !important; font-size: .65rem !important; }
    body #refereeTable :is(th, td):first-child { width: 27%; position: static !important; }
    body .plans-comparison :is(th, td) { padding: 8px 3px !important; font-size: .68rem !important; width: auto; }
    body .plans-comparison :is(th, td):first-child { width: 32%; position: static !important; }
    body .pp-recent-form .pp-season-table :is(th, td):first-child { width: 24%; }
    body .pp-recent-form .pp-season-table :is(th, td):nth-child(2) { width: 10%; }
    /* Wide game logs and season lines wrap into compact labeled rows, keeping all stats. */
    body .fit-stacked, body .fit-stacked tbody { display: block; }
    body .fit-stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    body .fit-stacked tbody tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--border-color, #383838); }
    body .fit-stacked tbody :is(th, td) { display: block; width: auto !important; padding: 8px 5px !important; text-align: left !important; position: static !important; font-size: .75rem !important; }
    body .fit-stacked tbody :is(th, td)::before { content: attr(data-column); display: block; font-size: .6rem; color: var(--text-secondary); margin-bottom: 3px; }
    body .profile-table-scroll .fit-stacked tbody :is(th, td):nth-child(-n+2) { grid-column: span 2; }
    body .profile-table-scroll .fit-stacked tbody :is(th, td):nth-child(3) { grid-column: 1 / -1; }
    body .pp-season-table.fit-stacked tbody th { grid-column: 1 / -1; }
}
@media (max-width: 1000px) {
    body .users-table, body .users-table tbody { display: block; }
    body .users-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    body .users-table tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--border-color, #383838); }
    body .users-table tbody td { display: block; width: auto !important; padding: 10px !important; text-align: left; }
    body .users-table tbody td::before { content: attr(data-column); display: block; font-size: .7rem; color: var(--text-secondary); margin-bottom: 5px; }
}
body .ev-table :is(.line-value, .ev-odds) { white-space: normal !important; overflow-wrap: anywhere; }
@media (max-width: 650px) {
    .ev-controls--organized .ev-segments { min-width: 0; }
    .ev-controls--organized .ev-segments button { min-width: 0; flex: 1 1 0; white-space: normal; padding-inline: 4px; }
}
/* Invisible custom tooltips must not widen the homepage containing its tables. */
.home-page .info-icon:not(:hover)::before,
.home-page .info-icon:not(:hover)::after { display: none; }
@media (max-width: 1000px) {
    .admin-dashboard { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; padding: 16px; }
    .admin-dashboard .dashboard-header, .admin-dashboard .action-buttons, .admin-dashboard .stats-summary { flex-wrap: wrap; }
    .admin-dashboard .stats-summary .stat-card { min-width: 0; flex: 1 1 120px; }
    .admin-dashboard .users-table-container { padding: 8px; box-sizing: border-box; }
}
