/* Mobile WebView overrides. Kept as a direct stylesheet so WeChat cannot
   reuse an older nested @import from the main design bundle. */
@media (max-width:760px) {
  html {
    -webkit-text-size-adjust:100%;
    text-size-adjust:100%;
  }

  /* WebKit resolves a bare `1fr` track against the desktop match row's
     min-content width. On iPhone that made a 410px container allocate a
     1144px results column and clipped every team beyond the viewport. */
  .schedule-layout {
    grid-template-columns:minmax(0,1fr) !important;
    min-width:0 !important;
  }

  .schedule-layout > *,
  .schedule-results,
  [data-match-list],
  .schedule-league-group,
  .schedule-league-rows {
    min-width:0 !important;
    max-width:100% !important;
  }

  .site-nav .site-links {
    display:none;
    position:absolute;
    top:66px;
    left:14px;
    right:14px;
    width:auto;
    max-height:calc(100vh - 80px);
    max-height:calc(100dvh - 80px);
    padding:8px;
    overflow-x:hidden;
    overflow-y:auto;
    flex-direction:column;
    align-items:stretch;
    justify-content:flex-start;
    gap:0;
  }

  .site-nav .site-links.open {
    display:flex;
  }

  .site-nav .site-links > a,
  .site-nav .site-links > a.mobile-nav-account {
    display:flex;
    flex:0 0 44px;
    width:100%;
    height:44px;
    min-height:44px;
    padding:0 14px;
    align-items:center;
    line-height:1.2;
  }

  .schedule-league-group,
  .schedule-league-rows,
  .schedule-compact-row {
    content-visibility:visible !important;
    contain:none !important;
    contain-intrinsic-size:none !important;
  }

  .schedule-league-rows {
    display:block !important;
  }

  .schedule-compact-row,
  [data-match-list][data-density="compact"] .schedule-compact-row {
    display:flex !important;
    flex-flow:row nowrap !important;
    align-items:center !important;
    gap:6px !important;
    box-sizing:border-box !important;
    width:100% !important;
    height:auto !important;
    min-height:78px !important;
    padding:9px 10px !important;
    overflow:hidden !important;
  }

  .schedule-compact-row > .compact-status,
  .schedule-compact-row > .compact-team,
  .schedule-compact-row > .compact-score,
  .schedule-compact-row > .compact-arrow {
    position:relative !important;
    inset:auto !important;
    grid-area:auto !important;
    visibility:visible !important;
    opacity:1 !important;
    transform:none !important;
  }

  .schedule-compact-row > .compact-status {
    order:1 !important;
    display:flex !important;
    flex:0 0 46px !important;
    width:46px !important;
    min-width:46px !important;
    height:auto !important;
    flex-direction:column !important;
    align-items:flex-start !important;
    gap:3px !important;
  }

  .schedule-compact-row > .compact-status b,
  .schedule-compact-row > .compact-status small {
    display:inline !important;
    white-space:nowrap !important;
  }

  .schedule-compact-row > .compact-team.left {
    order:2 !important;
  }

  .schedule-compact-row > .compact-score {
    order:3 !important;
    display:block !important;
    flex:0 0 30px !important;
    width:30px !important;
    min-width:30px !important;
    height:auto !important;
    text-align:center !important;
  }

  .schedule-compact-row > .compact-team:not(.left) {
    order:4 !important;
  }

  .schedule-compact-row > .compact-team,
  .schedule-compact-row > .compact-team.home,
  .schedule-compact-row > .compact-team.left {
    display:flex !important;
    flex:1 1 0 !important;
    min-width:0 !important;
    width:0 !important;
    height:auto !important;
    flex-direction:row !important;
    align-items:center !important;
    gap:5px !important;
    color:inherit !important;
    overflow:visible !important;
  }

  .schedule-compact-row > .compact-team.left {
    justify-content:flex-end !important;
    text-align:right !important;
  }

  .schedule-compact-row > .compact-team:not(.left) {
    justify-content:flex-start !important;
    text-align:left !important;
  }

  .schedule-compact-row > .compact-team > span:not(.team-mark-fallback) {
    display:block !important;
    flex:1 1 auto !important;
    min-width:0 !important;
    max-width:100% !important;
  }

  .schedule-compact-row .compact-team img,
  .schedule-compact-row .compact-team .team-mark-fallback {
    display:block !important;
    flex:0 0 24px !important;
    width:24px !important;
    height:24px !important;
    min-width:24px !important;
    min-height:24px !important;
  }

  .schedule-compact-row .compact-team .team-mark-fallback {
    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;
  }

  .schedule-compact-row .compact-team .team-mark-fallback[hidden] {
    display:none !important;
  }

  .schedule-compact-row .compact-team img[hidden] {
    display:none !important;
  }

  .schedule-compact-row .compact-team b {
    display:block !important;
    max-width:100% !important;
    overflow:hidden !important;
    color:inherit !important;
    font-size:10px !important;
    line-height:1.25 !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;
  }

  .schedule-compact-row .compact-team small,
  .schedule-compact-row > .compact-score small,
  .schedule-compact-row > .compact-data,
  .schedule-compact-row > .compact-arrow {
    display:none !important;
  }

  .schedule-compact-row > .compact-score b {
    display:block !important;
    font-size:12px !important;
    line-height:1.2 !important;
    white-space:nowrap !important;
  }

  @media (max-width:360px) {
    .schedule-compact-row,
    [data-match-list][data-density="compact"] .schedule-compact-row {
      gap:4px !important;
      padding-inline:8px !important;
    }

    .schedule-compact-row > .compact-status {
      flex-basis:42px !important;
      width:42px !important;
      min-width:42px !important;
    }

    .schedule-compact-row > .compact-score {
      flex-basis:28px !important;
      width:28px !important;
      min-width:28px !important;
    }

    .schedule-compact-row .compact-team img,
    .schedule-compact-row .compact-team .team-mark-fallback {
      flex-basis:22px !important;
      width:22px !important;
      height:22px !important;
      min-width:22px !important;
      min-height:22px !important;
    }

    .schedule-compact-row .compact-team b {
      font-size:9px !important;
    }
  }
}

/* Tablet and landscape phones must not keep the desktop sidebar beside a
   six-column match row. That combination narrows the row below its minimum. */
@media (min-width:761px) and (max-width:1120px) {
  .schedule-layout {
    grid-template-columns:minmax(0,1fr) !important;
  }

  .schedule-sidebar {
    position:static !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }

  .schedule-compact-row,
  [data-match-list][data-density="compact"] .schedule-compact-row {
    grid-template-columns:68px minmax(0,1fr) 60px minmax(0,1fr) 26px !important;
  }

  .schedule-compact-row > .compact-data {
    display:none !important;
  }
}
