/* ═══════════════════════════════════════════════════════════════════
   Spotify Pulse — Responsive system
   Breakpoints: ≤379 · ≤639 · 640–899 · ≥900 · ≥1100
   ═══════════════════════════════════════════════════════════════════ */

.dash-app {
    width: 100%;
    margin-inline: auto;
    box-sizing: border-box;
    min-width: 0;
}

.page--spotify,
.page--spotify .dash-app,
.page--spotify .dash-app__layout,
.page--spotify .dash-app__feed {
    min-width: 0;
    max-width: 100%;
}

.page--spotify {
    overflow-x: clip;
}

/* ── Extra-small phones (≤379px) ── */
@media (max-width: 379px) {
    .dash-app {
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
    }

    .page--spotify .dashboard-now__title {
        font-size: clamp(1.1rem, 6.2vw, 1.35rem);
    }

    .page--spotify .dashboard-now__artist {
        font-size: 0.9rem;
    }

    .page--spotify .dash-now__cover .dashboard-hero__art-wrap {
        width: min(100%, 16.5rem);
    }

    .page--spotify .dash-ctrl-btn--aux {
        width: 2.5rem;
        height: 2.5rem;
    }

    .page--spotify .dash-ctrl-btn--play {
        width: 3.35rem;
        height: 3.35rem;
        margin-inline: 0.25rem;
    }

    .page--spotify .dashboard-controls {
        gap: 0.35rem;
    }

    .page--spotify .dash-stats-toggle-btn {
        font-size: 0.7rem;
        padding: 0.55rem 0.4rem;
        gap: 0.3rem;
    }

    .page--spotify .dash-stats-toggle-btn__full {
        display: none;
    }

    .page--spotify .dash-stats-toggle-btn__short {
        display: inline;
    }

    .page--spotify .dash-playlist {
        flex-basis: 6.75rem;
    }

    .page--spotify .dashboard-now__actions {
        gap: 0.35rem;
    }

    .page--spotify .dashboard-now__actions .btn {
        font-size: 0.72rem;
        padding-inline: 0.75rem;
    }
}

/* ── Mobile (≤639px) ── */
@media (max-width: 639px) {
    .dash-app {
        max-width: 100%;
        padding-top: max(0.55rem, env(safe-area-inset-top));
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        padding-bottom: max(1.75rem, env(safe-area-inset-bottom));
    }

    body.dash-has-mini-player[data-module="dashboard"] .dash-app {
        padding-bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
    }

    body.dash-has-mini-player[data-module="dashboard"] .page-footer {
        padding-bottom: calc(6.25rem + env(safe-area-inset-bottom, 0px));
    }

    .dash-app__top {
        margin-bottom: 0.85rem;
    }

    .dash-app__layout,
    .dash-app__feed {
        display: flex;
        flex-direction: column;
        gap: 0;
        width: 100%;
    }

    .sp-profile-hero__accent {
        display: none;
    }

    .page--spotify .sp-profile-hero {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0.55rem 0.7rem 0.55rem 0.55rem;
        gap: 0.7rem;
        border-radius: 999px;
        border-color: rgba(30, 215, 96, 0.38);
        box-shadow:
            0 0.35rem 1.1rem rgba(30, 215, 96, 0.14),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .page--spotify .sp-profile-hero:hover,
    .page--spotify .sp-profile-hero:focus-visible {
        transform: none;
        border-color: rgba(30, 215, 96, 0.55);
    }

    .sp-profile-hero__avatar-wrap {
        width: 2.4rem;
        height: 2.4rem;
    }

    .sp-profile-hero__title {
        font-size: 0.92rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .sp-profile-hero__go {
        width: 1.85rem;
        height: 1.85rem;
        flex-shrink: 0;
    }

    .page--spotify .dash-now {
        gap: 1rem;
        margin: 0 0 0.35rem;
        width: 100%;
    }

    .page--spotify .dash-now__cover {
        display: flex;
        justify-content: center;
        padding: 0;
        width: 100%;
    }

    .page--spotify .dash-now__cover .dashboard-hero__art-wrap {
        width: min(100%, 18.5rem, 78vw);
        margin: 0 auto;
    }

    .page--spotify .dash-now__cover .dashboard-hero__art {
        width: 100%;
        aspect-ratio: 1;
        height: auto;
        max-height: none;
        border-radius: 1rem;
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow:
            0 1.15rem 2.5rem rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    }

    .page--spotify .dash-now__cover .dashboard-hero__glow {
        inset: 4%;
        filter: blur(2.5rem);
        opacity: 0.55;
    }

    .page--spotify .dash-now__cover .dashboard-hero__art img,
    .page--spotify .dash-now__cover .dashboard-now__art-layer {
        border-radius: inherit;
    }

    .page--spotify .dash-now__panel {
        padding-top: 0.25rem;
        width: 100%;
    }

    .page--spotify .dash-now__panel.dashboard-hero__body {
        gap: 0.85rem;
        align-items: center;
    }

    .page--spotify .dashboard-hero__head,
    .page--spotify .dashboard-hero__titles,
    .page--spotify .dashboard-badges,
    .page--spotify .dashboard-now__actions,
    .page--spotify .dashboard-controls {
        text-align: center;
        justify-content: center;
        width: 100%;
    }

    .page--spotify .dashboard-now__state {
        justify-content: center;
        font-size: 0.64rem;
    }

    .page--spotify .dashboard-now__title {
        font-size: clamp(1.2rem, 5.8vw, 1.5rem);
        line-height: 1.2;
        padding-inline: 0.15rem;
    }

    .page--spotify .dashboard-now__artist {
        font-size: 0.95rem;
    }

    .page--spotify .dashboard-now__album {
        font-size: 0.78rem;
        max-width: 100%;
    }

    .page--spotify .dashboard-now__progress {
        width: 100%;
        max-width: 100%;
        padding-inline: 0.1rem;
    }

    .page--spotify .dashboard-now__bar {
        height: 5px;
        position: relative;
    }

    .page--spotify .dashboard-now__bar::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 50%;
        height: 2.75rem;
        transform: translateY(-50%);
    }

    .page--spotify .dashboard-controls-wrap {
        margin-top: 0.15rem;
        width: 100%;
        justify-content: center;
    }

    .page--spotify .dashboard-controls {
        gap: 0.55rem;
        flex-wrap: nowrap;
        max-width: 100%;
        justify-content: center;
    }

    .page--spotify .dash-ctrl-btn--aux {
        width: 2.75rem;
        height: 2.75rem;
        min-width: 2.75rem;
        min-height: 2.75rem;
    }

    .page--spotify .dash-ctrl-btn--play {
        width: 3.6rem;
        height: 3.6rem;
        min-width: 3.6rem;
        min-height: 3.6rem;
        margin-inline: 0.35rem;
    }

    .page--spotify .dashboard-now__actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem;
        margin-top: 0.15rem;
        padding-bottom: 0.15rem;
        justify-content: center;
    }

    .page--spotify .dashboard-now__actions .btn {
        flex: 1 1 auto;
        min-height: 2.75rem;
        min-width: min(100%, 8.5rem);
        justify-content: center;
    }

    .page--spotify .dashboard-now__actions .btn--spotify {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .dash-remote--enabled {
        width: 100%;
        padding: 0.65rem 0.7rem 0.7rem;
        margin-top: 0.15rem;
    }

    .dash-remote--enabled .dash-remote__input,
    .dash-remote__input {
        min-height: 2.75rem;
        font-size: 16px;
        padding: 0.55rem 0.7rem;
    }

    .dash-remote__results {
        z-index: 60;
        max-height: min(12rem, 36dvh);
        border-radius: 0.65rem;
    }

    .dash-remote__results .dash-row--remote {
        padding: 0.55rem;
        gap: 0.55rem;
    }

    .dash-remote__results .btn {
        min-height: 2.5rem;
        min-width: 2.5rem;
    }

    .page--spotify .dash-app__feed {
        margin-top: 0.35rem;
        gap: 0;
        width: 100%;
    }

    .page--spotify .dash-section {
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
        padding: 1.35rem 0 0.15rem;
        width: 100%;
        box-sizing: border-box;
    }

    .page--spotify .dash-app__feed > .dash-section:first-of-type {
        padding-top: 1.15rem;
    }

    .page--spotify .dash-section__title {
        font-size: 1.05rem;
        margin-bottom: 0.65rem;
    }

    .page--spotify .dash-section__hint {
        font-size: 0.7rem;
        margin-bottom: 0.75rem;
    }

    .page--spotify .dash-row,
    .page--spotify .dash-track-list li,
    .page--spotify .dash-stat-list li {
        padding: 0.7rem 0.15rem;
        min-height: 3.15rem;
        gap: 0.65rem;
    }

    .page--spotify .dash-row--track:hover,
    .page--spotify .dash-row--top:hover,
    .page--spotify .dash-row--queue:hover {
        margin-left: 0;
        margin-right: 0;
        padding-left: 0.35rem;
        padding-right: 0.35rem;
        transform: none;
    }

    .page--spotify .dash-track-list__art,
    .page--spotify .dash-track-art,
    .page--spotify .pulse-art-ph.dash-top-art-ph,
    .page--spotify .pulse-art-ph.dash-queue-art-ph,
    .page--spotify .pulse-art-ph.dash-history-art-ph {
        width: 3rem;
        height: 3rem;
    }

    .page--spotify .dash-playlists-rail {
        --dash-pad-x: max(1rem, env(safe-area-inset-left));
        --dash-pad-r: max(1rem, env(safe-area-inset-right));
        margin-left: calc(-1 * var(--dash-pad-x));
        margin-right: calc(-1 * var(--dash-pad-r));
        width: auto;
        max-width: none;
    }

    .page--spotify .dash-playlists--scroll {
        margin: 0;
        padding: 0.15rem var(--dash-pad-r, 1rem) 0.65rem var(--dash-pad-x, 1rem);
        gap: 1.25rem;
        scroll-padding-inline: var(--dash-pad-x, 1rem);
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .page--spotify .dash-playlists--scroll .dash-playlist {
        flex: 0 0 7.25rem;
    }

    .page--spotify .dash-tab {
        flex-shrink: 0;
        min-height: 2.5rem;
        padding: 0.45rem 0.85rem;
        font-size: 0.68rem;
    }

    .page--spotify .dash-tabs--scroll {
        margin-inline: 0;
        padding-bottom: 0.25rem;
        gap: 0.4rem;
    }

    .page--spotify .dash-stats-toggle {
        margin: 1rem 0 0.25rem;
        width: 100%;
        border-radius: 999px;
        padding: 0.25rem;
        position: relative;
        top: auto;
        z-index: 5;
        backdrop-filter: blur(14px) saturate(1.15);
        -webkit-backdrop-filter: blur(14px) saturate(1.15);
        background: rgba(12, 12, 12, 0.82);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .page--spotify .dash-stats-toggle-btn {
        min-height: 2.75rem;
        font-size: 0.74rem;
        padding: 0.55rem 0.5rem;
        border-radius: 999px;
        gap: 0.4rem;
    }

    .page--spotify .dash-stats-toggle-btn__short {
        display: none;
    }

    .page--spotify .dash-listening-panel {
        padding: 0.75rem 0.7rem 0.7rem;
        border-radius: 0.75rem;
    }

    .page--spotify .dash-listening-panel--chart .dash-chart__bars {
        height: 4.75rem;
        gap: 0.3rem;
    }

    .page--spotify .dash-heatmap__grid {
        gap: 0.22rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.15rem;
    }

    .page--spotify .dash-history__stack,
    .page--spotify .dash-top-stack {
        display: flex;
        flex-direction: column;
        gap: 1.15rem;
    }

    .dash-mini-player__body {
        padding: 0.55rem 0.8rem 0.65rem;
        gap: 0.55rem;
    }

    .dash-mini-player__art-wrap {
        width: 2.65rem;
        height: 2.65rem;
    }

    .dash-mini-player__spotify {
        width: 2.75rem;
        height: 2.75rem;
        min-width: 2.75rem;
        min-height: 2.75rem;
    }

    .dash-modal {
        align-items: flex-end;
        padding: 0;
    }

    .dash-modal__panel {
        width: 100%;
        max-width: 100%;
        max-height: min(92dvh, 100%);
        border-radius: 1.15rem 1.15rem 0 0;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .dash-modal__close,
    .dash-modal__back {
        min-width: 2.75rem;
        min-height: 2.75rem;
    }

    .avlu-now--rich {
        grid-template-columns: auto 2.5rem 1fr;
    }

    .avlu-now__art {
        width: 2.5rem;
        height: 2.5rem;
    }

    .dash-app__bar {
        margin-left: calc(-1 * max(1rem, env(safe-area-inset-left, 0px)));
        margin-right: calc(-1 * max(1rem, env(safe-area-inset-right, 0px)));
        margin-top: calc(-1 * max(0.55rem, env(safe-area-inset-top, 0px)));
        padding:
            max(0.55rem, env(safe-area-inset-top, 0px))
            max(1rem, env(safe-area-inset-right, 0px))
            0.5rem
            max(1rem, env(safe-area-inset-left, 0px));
        margin-bottom: 0.95rem;
    }

    body[data-module="dashboard"] .page--spotify.page--minimal {
        padding-top: 0;
    }
}

@media (max-width: 639px) and (max-height: 720px) {
    .page--spotify .dash-now {
        gap: 0.75rem;
    }

    .page--spotify .dash-now__cover .dashboard-hero__art-wrap {
        width: min(100%, 14.5rem, 52vh);
    }

    .page--spotify .dash-now__panel.dashboard-hero__body {
        gap: 0.65rem;
    }

    .page--spotify .dashboard-now__title {
        font-size: clamp(1.1rem, 5vw, 1.35rem);
    }

    .page--spotify .dash-ctrl-btn--play {
        width: 3.25rem;
        height: 3.25rem;
        min-width: 3.25rem;
        min-height: 3.25rem;
    }

    .page--spotify .sp-profile-hero {
        padding: 0.45rem 0.6rem 0.45rem 0.45rem;
    }
}

@media (max-width: 639px) and (max-height: 600px) {
    .page--spotify .dash-now__cover .dashboard-hero__art-wrap {
        width: min(100%, 11.5rem, 42vh);
    }

    .page--spotify .dashboard-now__album {
        display: none;
    }

    .page--spotify .dash-vibe-chip {
        display: none;
    }
}

/* ── Tablet (640–899) ── */
@media (min-width: 640px) and (max-width: 899px) {
    .dash-app {
        max-width: 36rem;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-bottom: 2rem;
    }

    body.dash-has-mini-player[data-module="dashboard"] .dash-app {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
    }

    .page--spotify .dash-app__feed {
        gap: 0;
    }

    .sp-profile-hero__accent {
        display: none;
    }

    .page--spotify .sp-profile-hero {
        width: 100%;
        padding: 0.6rem 0.85rem 0.6rem 0.6rem;
        border-color: rgba(30, 215, 96, 0.4);
    }

    .page--spotify .dash-now__cover .dashboard-hero__art-wrap {
        width: min(100%, 22rem);
        margin: 0 auto;
    }

    .page--spotify .dash-now {
        gap: 1.35rem;
    }

    .page--spotify .dashboard-now__title {
        font-size: clamp(1.4rem, 3.5vw, 1.65rem);
    }

    .page--spotify .dashboard-now__actions .btn {
        flex: 0 1 auto;
        min-height: 2.75rem;
    }

    .page--spotify .dash-history__stack,
    .page--spotify .dash-top-stack {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1.25rem;
    }

    .page--spotify .dash-stats-toggle {
        margin: 1.25rem 0 0.5rem;
    }

    .page--spotify .dash-stats-toggle-btn__short {
        display: none;
    }

    .page--spotify .dash-playlists--scroll .dash-playlist {
        flex: 0 0 8rem;
    }

    .dash-modal {
        align-items: center;
        padding: 1.25rem;
    }

    .dash-modal__panel {
        max-width: 28rem;
        border-radius: 1.1rem;
        max-height: min(88dvh, 100%);
    }
}

/* ── Desktop (≥900) ── */
@media (min-width: 900px) {
    .dash-app {
        max-width: 76rem;
        padding:
            max(1.5rem, env(safe-area-inset-top))
            2.5rem
            2.5rem
            2.5rem;
    }

    .dash-app__bar {
        margin-bottom: 1.5rem;
        margin-top: 0;
        padding-top: 0.25rem;
    }

    .dash-app__brand--live .dash-app__brand__text {
        font-size: 0.78rem;
    }

    .sp-profile-hero {
        width: auto;
        max-width: 20rem;
        margin-left: auto;
        padding: 0.5rem 0.85rem 0.5rem 0.5rem;
        gap: 0.75rem;
        border-radius: 2rem;
    }

    .sp-profile-hero__accent {
        display: none;
    }

    .sp-profile-hero__avatar-wrap {
        width: 2.5rem;
        height: 2.5rem;
        padding: 0.12rem;
    }

    .sp-profile-hero__title {
        font-size: 0.92rem;
    }

    .sp-profile-hero__go {
        width: 1.75rem;
        height: 1.75rem;
        background: transparent;
        color: rgba(255, 255, 255, 0.45);
    }

    .sp-profile-hero:hover .sp-profile-hero__go,
    .sp-profile-hero:focus-visible .sp-profile-hero__go {
        background: rgba(30, 215, 96, 0.15);
        transform: none;
    }

    .dash-app__top {
        justify-content: flex-end;
        min-height: 3.25rem;
        margin-bottom: 1.25rem;
    }

    .dash-app__layout {
        display: grid;
        grid-template-columns: minmax(280px, 22rem) minmax(0, 1fr);
        gap: 3rem;
        align-items: start;
        min-width: 0;
        width: 100%;
    }

    .dash-app__feed {
        padding-left: 2.5rem;
        border-left: 1px solid var(--sp-line);
        min-height: 12rem;
        min-width: 0;
    }

    .page--spotify .dash-playlists--scroll {
        mask-image: none;
        -webkit-mask-image: none;
    }

    .page--spotify .dash-now {
        position: sticky;
        top: 1.5rem;
        margin: 0;
        gap: 1.65rem;
    }

    .page--spotify .dash-now__cover .dashboard-hero__art {
        border-radius: 1.15rem;
    }

    .page--spotify .dashboard-now__title {
        font-size: 1.75rem;
    }

    .page--spotify .dashboard-now__actions .btn {
        flex: 0 1 auto;
    }

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

    .page--spotify .dash-app__feed > .dash-section:first-child {
        padding-top: 1.4rem;
    }

    .page--spotify .dash-playlists-rail .dash-playlists--scroll {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
        gap: 1.35rem;
        overflow: visible;
        margin: 0;
        padding: 1rem;
        scroll-snap-type: none;
    }

    .page--spotify .dash-playlists--scroll .dash-playlist {
        flex: unset;
        scroll-snap-align: unset;
    }

    .page--spotify .dash-artists--scroll {
        flex-wrap: wrap;
        overflow: visible;
        gap: 0.65rem;
    }

    .page--spotify .dash-artists--scroll .dash-artist {
        max-width: none;
    }

    .page--spotify .dash-tabs--scroll {
        flex-wrap: wrap;
        overflow: visible;
    }

    .page--spotify .dash-tabs--scroll .dash-tab {
        flex-shrink: unset;
    }

    .page--spotify .dash-history__stack {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }

    .page--spotify .dash-top-stack {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(220px, 17rem);
        gap: 2.5rem;
        align-items: start;
    }

    .page--spotify .dash-track-list--top-panel .dash-track-art,
    .page--spotify .dash-track-list--top-panel .dash-top-art-ph {
        width: 3.15rem;
        height: 3.15rem;
    }

    .page--spotify .dash-chart__bars {
        height: 5.5rem;
    }

    .page--spotify .dash-stats-toggle-btn__short {
        display: none;
    }

    .dash-modal {
        align-items: center;
        padding: 2rem;
    }

    .dash-modal__panel {
        max-width: 32rem;
        border-radius: 1rem;
    }

    .dash-mini-player {
        display: none !important;
    }
}

@media (min-width: 1100px) {
    .dash-app__layout {
        grid-template-columns: minmax(300px, 24rem) minmax(0, 1fr);
        gap: 3.25rem;
    }
}

.dashboard-last-played {
    font-family: "DM Mono", monospace;
    font-size: 0.68rem;
    text-align: center;
    margin: 0;
    line-height: 1.45;
}

.dash-profile-btn {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    border: 1px solid rgba(30, 215, 96, 0.22);
    background: linear-gradient(135deg, rgba(30, 215, 96, 0.14), rgba(30, 215, 96, 0.04));
    color: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    box-shadow: 0 0.35rem 1.2rem rgba(30, 215, 96, 0.08);
    -webkit-tap-highlight-color: transparent;
}

.dash-profile-btn:hover,
.dash-profile-btn:focus-visible {
    transform: translateY(-1px);
    border-color: rgba(30, 215, 96, 0.45);
    box-shadow: 0 0.5rem 1.5rem rgba(30, 215, 96, 0.14);
}

.dash-profile-btn__avatar,
.dash-profile-btn__icon {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    background: rgba(12, 11, 16, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
}

.dash-profile-btn__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    text-align: left;
}

.dash-profile-btn__label {
    font-family: "DM Mono", monospace;
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1ed760;
}

.dash-profile-btn__name {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-profile-btn__arrow {
    font-size: 1.2rem;
    color: #1ed760;
    flex-shrink: 0;
}

.dash-profile-btn--solo {
    max-width: 24rem;
    margin: 0 auto;
}

.dash-open-card { text-align: center; }
.dash-profile-link { border-color: rgba(30, 215, 96, 0.18); }

@media (min-width: 640px) {
    .dashboard-last-played,
    .dash-profile-btn {
        text-align: left;
    }
}
