
html { -webkit-text-size-adjust: 100%; }
input, select, textarea { font-size: 16px !important; }

@media (max-width: 860px) {
  html, body { overflow-x: hidden; }
  .shell {
    display: block !important;
    grid-template-columns: 1fr !important;
    height: auto !important;
    min-height: 100dvh;
  }
  .side {
    position: fixed; z-index: 90; inset: 0 auto 0 0;
    width: min(82vw, 300px);
    transform: translateX(-105%);
    transition: transform .22s ease;
    box-shadow: none;
  }
  body.nav-open .side { transform: none; box-shadow: 12px 0 40px rgba(0,0,0,.4); }
  .nav-scrim {
    display: none; position: fixed; inset: 0; z-index: 85;
    background: rgba(0,0,0,.45);
  }
  body.nav-open .nav-scrim { display: block; }

  .top {
    position: sticky; top: 0; z-index: 40;
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px 8px 8px;
    padding-top: max(8px, env(safe-area-inset-top));
    background: #121822;
  }
  .top .hist-btn:nth-of-type(1),
  .top .hist-btn:nth-of-type(2) { display: none; }
  .search-wrap { flex: 1; min-width: 0; }
  .search { width: 100%; }
  .guest-auth { gap: 6px; margin-left: 0; }
  .guest-signup, .guest-login {
    height: 34px; padding: 0 10px; font-size: 11px;
  }
  .account-name, .account .chev { display: none; }

  .main {
    padding: 12px 14px 140px !important;
    max-width: 100%;
  }
  .main h1 { font-size: 28px; margin: 8px 0 18px; }

  .station-row,
  .genre-grid-5,
  .genre-strip + .station-row {
    display: flex !important;
    gap: 12px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 6px;
    grid-template-columns: none !important;
  }
  .station, .genre-tile {
    flex: 0 0 42vw;
    max-width: 180px;
    scroll-snap-align: start;
  }
  .genre-tile { min-height: 64px !important; font-size: 14px; }
  .home-row { margin: 28px 0 36px !important; }
  .viewall { font-size: 11px; }

  .player {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  body.is-guest .player { display: none !important; }

  .guest-trial {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    text-align: left;
  }
  .guest-trial p { font-size: 13px; max-width: none; }
  .guest-trial a { width: 100%; height: 44px; }

  #banner.trial {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    font-size: 13px;
  }

  .m-wrap, .m-box, #sycfPay .m-box, .pay-box {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 92dvh;
  }
  #sycfPay, .m-back {
    align-items: flex-end !important;
  }
  .plans, .m-plans, .m-grid {
    grid-template-columns: 1fr !important;
  }

  .sub-row, .sub-cols {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .dash-card { min-width: 0; }

  .mob-bar {
    display: flex !important;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: #161d28;
    border-top: 1px solid #2a3648;
    justify-content: space-around; align-items: center;
  }
  body.is-guest .mob-bar { bottom: auto; display: flex !important; }
  .mob-bar a {
    color: #9aa3b5; text-decoration: none; font-size: 10px;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    min-width: 56px; font-weight: 700;
  }
  .mob-bar a.is-on { color: #C9A227; }
  body:not(.is-guest) .main { padding-bottom: 168px !important; }

  .menu-btn {
    display: grid !important;
    width: 40px; height: 40px; place-items: center;
    border: 0; border-radius: 10px;
    background: #1b2433; color: #fff; font-size: 20px;
  }
}

@media (min-width: 861px) {
  .menu-btn, .mob-bar, .nav-scrim { display: none !important; }
}
