/* Listnbox on phones: the logo and the account button on top, tabs along the bottom (Home, Search,
   Track ID, My Listnbox, Library) with the player just above them, a tab strip at the top of the browse
   pages, a Music | B Side switch, and big cards to swipe. Plus the Track ID screen (every size). */

/* pieces that only exist on phones */
.brand-m, .top-menu-m, .side-me, .side-sounds-m, .tabbar, .ptabs, .pseg, .ph-only { display: none; }

@media (max-width: 860px) {
  :root { --tab-h: 58px; --player-h: 64px; }

  /* the shell: page, player, tabs */
  body.shell { grid-template-rows: minmax(0, 1fr) var(--player-h) calc(var(--tab-h) + env(safe-area-inset-bottom)); grid-template-areas: "stage" "player" "tabs"; }
  /* nothing playing yet: no empty player bar (it appears with the first track) */
  body.shell:has(.player.is-empty) { grid-template-rows: minmax(0, 1fr) 0 calc(var(--tab-h) + env(safe-area-inset-bottom)); }
  body.shell:has(.player.is-empty) .player { visibility: hidden; border: 0; overflow: hidden; }
  .queue { bottom: calc(var(--player-h) + var(--tab-h) + env(safe-area-inset-bottom)); }
  .toasts { left: 12px; right: 12px; justify-items: center; bottom: calc(var(--player-h) + var(--tab-h) + env(safe-area-inset-bottom) + 10px); }
  body.shell:has(.player.is-empty) .toasts { bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 10px); }
  /* search suggestions stop above the player and the tabs */
  .top .suggest { max-height: calc(100dvh - var(--top-h) - 56px - var(--player-h) - var(--tab-h) - env(safe-area-inset-bottom) - 12px); }

  /* the tabs along the bottom */
  .tabbar { grid-area: tabs; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch; padding: 0 2px env(safe-area-inset-bottom); background: var(--base); border-top: 1px solid var(--line); z-index: 45; }
  .tabbar > a, .tabbar > button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 0 2px; color: var(--text-3); font: 500 10.5px/1.1 var(--sans); letter-spacing: .01em; -webkit-tap-highlight-color: transparent; }
  .tabbar > a span, .tabbar > button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar svg.i { width: 23px; height: 23px; stroke-width: 1.7; }
  .tabbar .is-active { color: var(--accent); }
  .tabbar .is-active svg.i { stroke-width: 2; }
  .tabbar > a:active, .tabbar > button:active { opacity: .7; }

  /* the player sits on the tabs like a mini player */
  .player { border-top: 0; box-shadow: 0 -1px 0 var(--line); }
  .np-art { width: 44px; height: 44px; }

  /* top bar: logo left, cart and account right; search drops in under it */
  .top { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .top-l { grid-column: 1; grid-row: 1; }
  .top-r { grid-column: 2; grid-row: 1; gap: 4px; }
  .top .search { display: none; }
  body.search-open .top .search, body[data-page=search] .top .search { display: flex; grid-column: 1 / -1; grid-row: 2; }
  body.search-open .top, body[data-page=search] .top { height: auto; min-height: var(--top-h); padding-bottom: 10px; row-gap: 6px; background: rgba(12, 12, 12, .96); }
  .top .brand-m { display: inline-flex !important; align-items: center; min-width: 0; height: 40px; color: var(--text); }
  .brand-m img { max-height: var(--logo-h, 26px); width: auto; }
  .brand-m { overflow: hidden; }
  .brand-m .wordmark { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-side { display: none !important; } /* the B Side is in the Music | B Side switch and the menu */
  .top-menu-m { display: inline-grid !important; }
  .top-menu-m.avatar { width: 34px; height: 34px; }
  .top-cta { height: 32px; }
  .top-credits .w { display: none; }

  /* the menu panel comes in from the right, under the account button */
  .side { left: auto; right: 0; width: min(300px, 86vw); transform: translateX(100%); }
  .side .brand { display: none; }
  .side-scroll { padding-top: calc(10px + env(safe-area-inset-top)); }
  .side-me { display: block; margin: 0 0 8px; padding: 6px 0 10px; border-bottom: 1px solid var(--line); }
  .side-me-head { display: flex; align-items: center; gap: 12px; padding: 8px 12px 12px; }
  .side-me-head .avatar { width: 42px; height: 42px; font-size: 14px; }
  .side-me-name { display: grid; min-width: 0; font-weight: 600; font-size: 14px; }
  .side-me-name small { color: var(--text-3); font-weight: 400; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side .nav-item { width: 100%; height: 42px; font-size: 14.5px; text-align: left; }
  .side-sounds-m { display: flex !important; }

  /* the tab strip at the top of browse, My Listnbox and Library pages */
  .ptabs { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)) 16px; padding: 0 var(--gutter); border-bottom: 1px solid var(--line); scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); }
  .ptabs::-webkit-scrollbar { display: none; }
  .ptabs a { flex: none; padding: 9px 0 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); font-size: 15.5px; font-weight: 500; white-space: nowrap; scroll-snap-align: start; }
  .ptabs a.is-active { color: var(--accent); border-bottom-color: var(--accent); }
  .ptabs a:active { opacity: .7; }

  /* Music | B Side */
  .pseg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; margin: 0 0 22px; background: var(--raised); }
  .pseg a { display: grid; place-items: center; height: 42px; color: var(--text); font-size: 14.5px; font-weight: 500; }
  .pseg a.is-active { background: #fff; color: #0b0b0b; }

  /* sections: a stronger title with View all beside it */
  .section { margin-bottom: 34px; }
  .section-head { margin-bottom: 12px; }
  .section-head h2 { font-size: 19px; font-weight: 600; letter-spacing: -.005em; }
  .section-head .see-more { display: inline-grid; place-items: center; height: 30px; padding: 0 12px; border: 1px solid var(--line-2); color: var(--text); font-size: 12.5px; }
  .section-head .see-more:active { background: var(--raised); }

  /* the phone parts of the home page */
  .ph-only { display: block; }
  .rail.ph-only { display: grid; }
  .rail { --cols: 2.25; gap: 12px; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); scroll-padding: 0 var(--gutter); }
  .rail.rail-big { --cols: 1.4; gap: 14px; }
  .rail .card .t { font-size: 14.5px; font-weight: 600; }
  .rail .card .s { font-size: 13px; }
  .rail.rail-big .card .meta { margin-top: 12px; }
  .rail.rail-big .card .t { font-size: 17px; }
  .rail.rail-big .card .s { font-size: 13.5px; margin-top: 2px; }
  .hero-sec.no-slides > .section-head { display: none; }
  .hero-sec .cat-mosaic { display: none; }
  .hero-sec .cat-hero { grid-template-columns: minmax(0, 1fr); }
  .ph-promos { --cols: 1.12; margin-bottom: 20px; }
  .ph-promos .cat-mo { aspect-ratio: 4 / 3.3; }
  .ph-promos .cat-mo-text { padding: 16px 18px; }
  .ph-promos .cat-mo-title { font-size: 26px; }
  .ph-promos .cat-mo-btn { display: none; }

  /* genre tiles: bigger pictures with the name on them */
  .cat-home-tiles .tile, .tiles .tile { height: 88px; font-size: 15px; font-weight: 600; }
  .tile img { opacity: .6; mix-blend-mode: normal; }
}

/* ---------------- Track ID (every screen size) ---------------- */
.tid { position: fixed; inset: 0; z-index: 140; display: grid; place-items: center; background: rgba(0, 0, 0, .72); }
.tid-panel { position: relative; display: flex; flex-direction: column; width: min(460px, 100%); height: min(720px, 100%); overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.tid-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 0 18px; flex: none; }
.tid-top h2 { font: 500 13px/1 var(--sans); letter-spacing: .14em; text-transform: uppercase; }
.tid-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 22px 28px; }
.tid-listen { display: grid; justify-items: center; gap: 10px; padding: 28px 0 22px; text-align: center; }
.tid-orb { position: relative; display: grid; place-items: center; width: 190px; height: 190px; border-radius: 50%; color: var(--accent-ink); -webkit-tap-highlight-color: transparent; }
.tid-orb::before { content: ""; position: absolute; inset: 22px; border-radius: 50%; background: var(--accent); transition: transform .2s; }
.tid-orb:active::before { transform: scale(.96); }
.tid-orb svg.i { position: relative; width: 58px; height: 58px; stroke-width: 1.6; }
.tid-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; }
.tid.is-listening .tid-ring { animation: tid-pulse 2.4s ease-out infinite; }
.tid.is-listening .tid-ring:nth-child(2) { animation-delay: .8s; }
.tid.is-listening .tid-ring:nth-child(3) { animation-delay: 1.6s; }
@keyframes tid-pulse { 0% { transform: scale(.72); opacity: .8; } 100% { transform: scale(1.18); opacity: 0; } }
.tid-progress { position: absolute; inset: 14px; width: calc(100% - 28px); height: calc(100% - 28px); transform: rotate(-90deg); pointer-events: none; }
.tid-progress circle { fill: none; stroke: var(--text); stroke-width: 3; stroke-dasharray: 100; stroke-dashoffset: 100; opacity: 0; transition: stroke-dashoffset .25s linear; }
.tid.is-listening .tid-progress circle { opacity: .9; }
.tid.is-searching .tid-orb::before { animation: tid-think 1.1s ease-in-out infinite alternate; }
@keyframes tid-think { from { transform: scale(.94); } to { transform: scale(1.02); } }
.tid-state { margin: 6px 0 0; font-size: 19px; font-weight: 600; }
.tid-hint { margin: 0; color: var(--text-2); font-size: 13.5px; max-width: 30ch; }
.tid-result { display: grid; gap: 14px; padding: 6px 0 4px; }
.tid-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 14px; align-items: center; }
.tid-art { width: 96px; height: 96px; border-radius: var(--r); background: var(--raised); display: grid; place-items: center; color: var(--text-3); overflow: hidden; }
.tid-art img { width: 100%; height: 100%; object-fit: cover; }
.tid-art svg.i { width: 34px; height: 34px; }
.tid-kicker { color: var(--accent); font-size: 11.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.tid-title { margin: 3px 0 2px; font-size: 18px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.tid-title .v { color: var(--text-3); font-weight: 400; }
.tid-sub { color: var(--text-2); font-size: 13.5px; overflow-wrap: anywhere; }
.tid-sub + .tid-sub { color: var(--text-3); font-size: 12.5px; }
.tid-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tid-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.tid-actions .btn { flex: 1 1 auto; }
.tid-actions .buy { height: 38px; padding: 0 16px; font-size: 13.5px; flex: 1 1 auto; justify-content: center; }
/* a sign in box or a message opened from the Track ID screen shows on top of it */
body.tid-open .scrim, body.tid-open .toasts { z-index: 150; }
.tid-note { margin: 0; color: var(--text-2); font-size: 13.5px; }
.tid-again { justify-self: center; }
.tid-hist { margin-top: 26px; border-top: 1px solid var(--line); padding-top: 16px; }
.tid-hist h3 { margin: 0 0 8px; font: 600 14px/1.3 var(--sans); }
.tid-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 7px 0; }
.tid-row .tid-art { width: 44px; height: 44px; }
.tid-row .tid-art svg.i { width: 18px; height: 18px; }
.tid-row .t { display: block; font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tid-row .s { display: block; color: var(--text-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tid-row .s b { color: var(--accent); font-weight: 500; }
.tid-row a:hover .t { text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 860px) {
  /* phones: the whole screen, in the store's accent colour while it listens */
  .tid { background: var(--surface); }
  .tid-panel { width: 100%; height: 100%; box-shadow: none; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .tid.is-listening .tid-panel, .tid.is-searching .tid-panel { background: var(--accent); color: var(--accent-ink); }
  .tid.is-listening .tid-orb::before, .tid.is-searching .tid-orb::before { background: var(--accent-ink); }
  .tid.is-listening .tid-orb, .tid.is-searching .tid-orb { color: var(--accent); }
  .tid.is-listening .tid-ring { border-color: var(--accent-ink); }
  .tid.is-listening .tid-progress circle { stroke: var(--accent); }
  .tid.is-listening .tid-hint, .tid.is-searching .tid-hint, .tid.is-listening .tid-top h2, .tid.is-searching .tid-top h2 { color: var(--accent-ink); opacity: .8; }
  .tid.is-listening .tid-top .icon-btn, .tid.is-searching .tid-top .icon-btn { color: var(--accent-ink); }
  .tid.is-listening .tid-hist, .tid.is-searching .tid-hist { display: none; }
  .tid-listen { padding-top: 12vh; }
  .tid-orb { width: min(64vw, 260px); height: min(64vw, 260px); }
  .tid-orb svg.i { width: 70px; height: 70px; }
}
.tid-title a { color: inherit; text-decoration: none; }
.tid-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
