/* Spotify Pulse — mobil UX (≤899px) */

@media (max-width: 899px) {
  .page--spotify {
    --sp-mobile-pad: max(0.85rem, env(safe-area-inset-left, 0px));
  }

  .page--spotify .page__content,
  .page--spotify .dash-app {
    padding-inline: max(0.75rem, env(safe-area-inset-left, 0px))
      max(0.75rem, env(safe-area-inset-right, 0px));
    padding-bottom: max(5.5rem, calc(4.25rem + env(safe-area-inset-bottom, 0px)));
  }

  .page--spotify .dash-app__feed {
    display: flex;
    flex-direction: column;
    gap: 0.95rem;
  }

  .page--spotify .dash-section {
    padding: 0.85rem 0.9rem;
    border-radius: 1rem;
  }

  .page--spotify .dash-section__head {
    margin-bottom: 0.65rem;
  }

  .page--spotify .dash-section__title {
    font-size: 1rem;
  }

  /* —— Profil —— */
  .page--spotify .dash-profile {
    width: 100%;
    max-width: none;
    justify-content: flex-start;
  }

  .page--spotify .dash-avlu-links {
    display: none !important;
  }

  /* —— Now playing —— */
  .page--spotify .dashboard-now,
  .page--spotify .dashboard-now--stage {
    padding: 0.85rem;
    border-radius: 1.1rem;
  }

  .page--spotify .dashboard-now__layout,
  .page--spotify .dashboard-now__stage-grid {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
  }

  .page--spotify .dashboard-now__art-wrap,
  .page--spotify .dashboard-now__cover {
    width: min(72vw, 16.5rem);
    max-width: 100%;
    margin-inline: auto;
  }

  .page--spotify .dashboard-now__title {
    font-size: clamp(1.2rem, 5.8vw, 1.45rem);
    text-align: center;
  }

  .page--spotify .dashboard-now__artists,
  .page--spotify .dashboard-now__meta,
  .page--spotify .dashboard-now__album {
    text-align: center;
    justify-content: center;
  }

  .page--spotify .dashboard-now__listened {
    text-align: center;
    font-size: 0.68rem;
  }

  .page--spotify .dash-progress {
    margin-top: 0.35rem;
  }

  .page--spotify .dash-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
  }

  .page--spotify .dashboard-now__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .page--spotify .dashboard-now__actions .btn--spotify {
    width: 100%;
    justify-content: center;
  }

  .page--spotify .dashboard-now__actions .btn--ghost,
  .page--spotify .dashboard-now__actions .dash-like-btn {
    width: 100%;
    justify-content: center;
  }

  /* Kapalı sözler / boş kuyruk yer kaplamasın */
  .page--spotify .dash-lyrics[hidden],
  .page--spotify #lyricsPanel[hidden],
  .page--spotify #queueSection[hidden],
  .page--spotify .dash-section--queue[hidden] {
    display: none !important;
  }

  .page--spotify .dash-lyrics:not([hidden]) {
    margin-top: 0.65rem;
    max-height: 40vh;
  }

  .page--spotify .dash-remote {
    margin-top: 0.5rem;
  }

  /* —— Playlist —— */
  .page--spotify .dash-playlists-rail {
    margin-inline: -0.35rem;
  }

  .page--spotify .dash-playlists--scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.15rem 0.35rem 0.45rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .page--spotify .dash-playlists--scroll::-webkit-scrollbar {
    display: none;
  }

  .page--spotify .dash-playlist {
    flex: 0 0 min(68vw, 11.5rem);
    scroll-snap-align: start;
  }

  .page--spotify .dash-playlist__art,
  .page--spotify .dash-playlist__cover {
    aspect-ratio: 1;
  }

  /* —— Stats toggle / history —— */
  .page--spotify .dash-stats-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.4rem;
    width: 100%;
  }

  .page--spotify .dash-stats-toggle-btn {
    justify-content: center;
    min-height: 2.6rem;
  }

  .page--spotify .dash-history-toolbar,
  .page--spotify .dash-listening-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .page--spotify .dash-history-total,
  .page--spotify .dash-listening-total {
    text-align: center;
    font-size: clamp(1.35rem, 6vw, 1.7rem);
  }

  .page--spotify .dash-history-range,
  .page--spotify .dash-range-tabs,
  .page--spotify .dash-top-range {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.3rem;
    width: 100%;
  }

  .page--spotify .dash-history-range button,
  .page--spotify .dash-range-tabs button,
  .page--spotify .dash-top-range button {
    min-height: 2.35rem;
    padding-inline: 0.25rem;
    font-size: 0.68rem;
  }

  .page--spotify .dash-history-list .dash-track,
  .page--spotify .dash-track-list .dash-track {
    gap: 0.55rem;
    padding-block: 0.55rem;
  }

  .page--spotify .dash-track__art {
    width: 3rem;
    height: 3rem;
  }

  .page--spotify .dash-track__title {
    font-size: 0.9rem;
  }

  .page--spotify .dash-artists--modal,
  .page--spotify .dash-artists {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .page--spotify .dash-artist--modal-card,
  .page--spotify .dash-artist--top {
    width: 100%;
  }

  .page--spotify .dash-top-artist__avatar,
  .page--spotify .dash-artist img {
    width: 2.75rem !important;
    height: 2.75rem !important;
  }

  /* —— Mini player —— */
  .page--spotify .dash-mini {
    padding-bottom: max(0.55rem, env(safe-area-inset-bottom, 0px));
  }

  .page--spotify .dash-modal__panel {
    width: 100%;
    max-width: none;
    border-radius: 1.1rem 1.1rem 0 0;
    max-height: min(94dvh, 100%);
  }
}

@media (max-width: 639px) {
  .page--spotify .dashboard-now__art-wrap,
  .page--spotify .dashboard-now__cover {
    width: min(78vw, 15rem);
  }

  .page--spotify .dash-playlist {
    flex-basis: min(72vw, 10.75rem);
  }

  .page--spotify .dash-artists--modal,
  .page--spotify .dash-artists {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
