/* Phone-only presentation. Desktop and access-control logic stay unchanged. */
.mobile-menu-toggle, .mobile-bottom-nav { display: none; }
.mobile-filter-group > summary { display: none; }
.mobile-filter-group, .mobile-table-scroll { display: contents; }
.supporting-factors-headshot { display: none; }
@media (max-width: 768px) {
  html { scroll-padding-bottom: 100px; }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .topbar { display: flex !important; flex-direction: row !important; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px !important; }
  .topbar .brand { margin: 0; width: auto !important; min-width: 0 !important; }
  .topbar .brand a { font-size: 23px; }
  .mobile-web-ready .mobile-menu-toggle { display: block; min-height: 44px; padding: 8px 16px; border: 1px solid #ccd7dd; border-radius: 12px; background: #fff; color: #17242d; font: inherit; font-weight: 700; }
  .topbar .header-actions { width: 100%; flex-direction: column; align-items: stretch; gap: 14px; }
  .mobile-web-ready .topbar .header-actions { display: none !important; }
  .mobile-web-ready .topbar .header-actions.is-open { display: flex !important; }
  .topbar .header-actions nav { display: grid !important; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
  .topbar .header-actions nav a { padding: 12px; min-height: 44px; margin: 0; }
  .topbar .header-account-links { flex-wrap: wrap; justify-content: flex-start; }
  .mobile-bottom-nav { position: fixed; z-index: 100; left: 0; right: 0; bottom: 0; display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 7px 5px calc(7px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid #ccd7dd; box-shadow: 0 -3px 18px #17242d0a; }
  .mobile-bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 52px; margin: 0; padding: 5px 1px; border-radius: 10px; color: #5e7180; text-decoration: none; font-size: 10px; font-weight: 700; white-space: nowrap; }
  .mobile-bottom-nav svg { width: 21px; height: 21px; }
  .mobile-bottom-nav a[aria-current="page"] { color: #087f65; background: #e9f4ef; }
  .mobile-menu-toggle:focus-visible, .mobile-bottom-nav a:focus-visible, .mobile-filter-group summary:focus-visible { outline: 3px solid #087f65; outline-offset: 2px; }
  body main.page, body main.public-page, body:has(.game-lab-hero) main { width: calc(100% - 28px) !important; max-width: 100% !important; margin: 0 auto !important; padding: 18px 0 !important; min-width: 0; }
  main *, .game-card, .lab-card, .game-lab-card { box-sizing: border-box; }
  main > *, .research-page-layout > *, .board-team-copy { min-width: 0; }
  .hero, .board-hero, .compact-streak-hero { padding: 8px 0 12px !important; margin-bottom: 12px; }
  .hero h1, .streak-hero h1 { font-size: clamp(26px, 7.5vw, 32px) !important; line-height: 1.15; }
  .hero p, .streak-hero p { font-size: 14px; line-height: 1.55; }
  .board-hero > div > p:last-child { display: none; }
  .board-stats { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; margin-bottom: 12px; }
  .board-stats .stat-card { padding: 12px 9px !important; border-radius: 12px; }
  .board-stats .stat-card span { font-size: 11px; line-height: 1.3; }
  .board-stats .stat-card strong { font-size: 24px; }
  .board-stats .stat-card:nth-child(2) span { font-size: 0; }
  .board-stats .stat-card:nth-child(2) span::after { content: 'Players'; font-size: 11px; }
  .data-note { font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
  .board-filter { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; margin: 14px 0 20px; }
  .board-filter label { grid-column: 1 / -1; }
  .board-filter select, .board-filter button { width: auto; min-width: 0; min-height: 44px; }
  .game-grid, .team-player-grid, .lab-card-grid, .game-lab-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }
  .lab-summary-grid, .game-lab-summary-grid, .streak-summary-grid { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .lab-summary-grid article, .game-lab-summary-grid article, .streak-summary-grid article { padding: 12px !important; }
  .game-card { padding: 15px !important; border-radius: 16px !important; }
  .game-card .matchup { display: grid !important; grid-template-columns: minmax(0, 1fr) 16px minmax(0, 1fr); align-items: center; gap: 6px; padding: 12px 0; }
  .game-card .board-team-row { flex-direction: column; text-align: center; gap: 6px; }
  .game-card .board-team-logo-wrap { width: 44px !important; height: 44px !important; min-width: 44px !important; }
  .game-card .board-team-logo { width: 40px !important; height: 40px !important; }
  .game-card .board-team-copy strong { font-size: 14px !important; line-height: 1.3; overflow-wrap: anywhere; }
  .game-card .team-role { font-size: 9px; }
  .game-card .matchup-divider { margin: 0 !important; }
  .game-card-footer { gap: 6px; font-size: 11px; flex-wrap: wrap; }
  .section-heading { gap: 8px; }
  .section-heading h2 { font-size: 21px; }
  .section-heading > span { font-size: 12px; white-space: nowrap; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; min-height: 44px; max-width: 100%; }
  button, .player-market-tab, .chart-tab { min-height: 44px; }
  .filters, .lab-filter-panel, .game-lab-filters { grid-template-columns: minmax(0, 1fr) !important; flex-wrap: wrap; width: 100%; }
  .filters > *, .lab-filter-panel > *, .game-lab-filters > * { min-width: 0; max-width: 100%; }
  .mobile-filter-group { display: block; margin: 14px 0; border: 1px solid #ccd7dd; border-radius: 12px; background: #fff; padding: 0 12px; }
  .mobile-filter-group > summary { display: list-item; cursor: pointer; min-height: 48px; padding: 14px 0; font-size: 14px; font-weight: 700; color: #17242d; }
  .mobile-filter-group form { margin-top: 0; }
  .research-page-layout { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; }
  .research-sidebar { position: static !important; width: 100% !important; max-width: none !important; }
  .compact-research-header { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 8px !important; padding: 14px !important; }
  .compact-player-info, .compact-header-matchup { grid-column: 1 / -1; min-width: 0 !important; width: 100% !important; }
  .compact-player-info h1 { font-size: 26px !important; }
  .compact-header-matchup { display: flex !important; justify-content: center !important; gap: 8px !important; }
  .compact-header-player-group { min-width: 0 !important; gap: 8px !important; }
  .compact-header-player-headshot { width: 56px !important; height: 72px !important; object-fit: contain; }
  .compact-header-team { width: 72px !important; min-width: 0 !important; }
  .compact-header-team-logo { width: 40px !important; height: 40px !important; }
  .compact-header-team small { font-size: 10px !important; white-space: normal; }
  .compact-line-info, .compact-price-card { min-width: 0 !important; width: auto !important; padding: 9px !important; }
  .compact-line-info strong, .compact-price-card strong { font-size: 21px !important; }
  .compact-line-info span, .compact-price-card span, .compact-price-card small { font-size: 10px !important; overflow-wrap: anywhere; }
  .player-market-tabs, .chart-tabs, .lab-mode-tabs, .game-lab-tabs { display: flex; flex-wrap: nowrap !important; overflow-x: auto; max-width: 100%; gap: 8px; padding-bottom: 6px; }
  .player-market-tabs > *, .chart-tabs > *, .lab-mode-tabs > *, .game-lab-tabs > * { flex: 0 0 auto; }
  .chart-filter-toolbar { flex-wrap: wrap; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-filter-field { min-width: 0; flex: 1 1 130px; }
  .table-wrap, .mobile-table-scroll { display: block; max-width: 100%; overflow-x: auto; }
  .availability-grid, .matchup-overview-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .matchup-metrics-grid, .locked-matchup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .site-footer { padding: 22px 16px !important; gap: 16px; }
  .site-footer, .footer-link-groups { flex-wrap: wrap; }
  .footer-links { flex-wrap: wrap; gap: 12px; }
  .access-banner { margin: 8px 14px; font-size: 12px; }
  /* Reset legacy desktop offsets rather than hiding overflowing content. */
  .compact-research-header .compact-header-matchup { padding: 8px 0 !important; min-height: 88px !important; }
  .compact-research-header .compact-header-matchup::before,
  .compact-research-header .compact-header-matchup::after { display: none; }
  .compact-research-header .compact-header-player-headshot { position: static !important; inset: auto !important; transform: none !important; margin: 0 !important; width: 56px !important; height: 72px !important; }
  .compact-research-header .compact-header-player-group { gap: 8px !important; }
  .compact-research-header .compact-header-team-logo { width: 40px !important; height: 40px !important; }
  .compact-research-header .compact-line-info,
  .compact-research-header .compact-price-card { grid-column: auto !important; grid-row: auto !important; transform: none !important; margin: 0 !important; align-self: stretch; }
  .compact-line-info::after { font-size: 8px !important; }
  .streak-detail-hero { display: grid !important; grid-template-columns: minmax(0, 1fr) !important; width: 100% !important; max-width: 100% !important; padding: 16px !important; gap: 14px !important; }
  .streak-detail-hero > div:first-child { width: 100% !important; min-width: 0 !important; }
  .streak-detail-hero .streak-player-brand-row { display: grid !important; grid-template-columns: minmax(0, 1fr) 64px 44px !important; width: 100% !important; min-width: 0 !important; gap: 8px !important; align-items: center; }
  .streak-detail-hero .streak-player-brand-row h1 { font-size: 26px !important; line-height: 1.15 !important; min-width: 0 !important; white-space: normal !important; overflow-wrap: anywhere; }
  .streak-detail-hero .streak-player-headshot { position: static !important; width: 64px !important; height: 76px !important; margin: 0 !important; transform: none !important; }
  .streak-detail-hero .streak-player-team-logo { position: static !important; width: 44px !important; height: 44px !important; margin: 0 !important; transform: none !important; }
  .streak-detail-hero p { font-size: 13px !important; white-space: normal !important; overflow-wrap: anywhere; }
  .streak-detail-hero .streak-line-card { width: 100% !important; min-width: 0 !important; transform: none !important; padding: 14px !important; }
  .streak-detail-hero .streak-line-card strong { font-size: 28px !important; }
  .supporting-factors-panel { position: relative; margin-bottom: 18px; min-width: 0; }
  .supporting-factors-panel .supporting-factors-headshot { display: block; position: absolute; top: 12px; right: 12px; width: 112px; height: 120px; object-fit: contain; object-position: center bottom; }
  .supporting-factors-panel:has(.supporting-factors-headshot) .sidebar-score.matchup-lean-box { min-width: 0 !important; max-width: calc(100% - 124px) !important; min-height: 112px; padding: 8px 12px !important; background: transparent !important; border: 0 !important; justify-content: flex-start !important; }
  .supporting-factors-panel:has(.supporting-factors-headshot):not(:has(.matchup-lean-box)) { padding-top: 144px !important; }
  .supporting-factors-panel:has(.supporting-factors-headshot) .sidebar-score.matchup-lean-box strong { font-size: 18px !important; overflow-wrap: anywhere; }
  .supporting-factors-panel .factor-summary-row, .supporting-factors-panel .supporting-factor-summary { display: flex !important; }
}
