/* The compact bar's max-width:220px must not constrain expanded metadata. */
@media (max-width: 767.98px), (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) {
        display: block;
        box-sizing: border-box;
        width: calc(100% - max(10px, env(safe-area-inset-left)) - max(10px, env(safe-area-inset-right)));
        min-height: 68px;
        height: 68px;
        padding: 0;
        bottom: max(10px, env(safe-area-inset-bottom));
        border-radius: 20px;
        border: 1px solid rgba(255,255,255,.18);
        box-shadow: 0 8px 28px rgba(17,30,75,.25);
        background: var(--vibe-player-gradient);
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) .vibe-player-artwork-wrap {
        position: absolute;
        top: 50%;
        left: 10px;
        width: 38px;
        height: 38px;
        border-radius: 10px;
        transform: translateY(-50%);
        overflow: hidden;
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) .vibe-player-artwork {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) .vibe-player-copy {
        position: absolute;
        top: 50%;
        left: 56px;
        width: calc(50% - 88px);
        max-width: none;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding: 0;
        margin: 0;
        text-align: left;
        transform: translateY(-50%);
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) :is(.vibe-player-live,.vibe-player-brand-logo,.vibe-player-equalizer) {
        display: none !important;
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) :is(.vibe-player-title,.vibe-player-artist) {
        display: block;
        width: 100%;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.25;
        letter-spacing: -.01em;
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) .vibe-player-artist {
        order: 0;
        color: #fff;
        font-size: 13px;
        font-weight: 700;
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) .vibe-player-title {
        order: 1;
        color: rgba(255,255,255,.8);
        font-size: 12px;
        font-weight: 450;
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) .vibe-player-play {
        position: absolute;
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: #fff;
        color: #5061ca;
        box-shadow: 0 3px 10px rgba(24,32,91,.12);
        transform: translate(-50%,-50%);
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) .vibe-player-play:active {
        transform: translate(-50%,-50%) scale(.94);
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) .vibe-player-play svg {
        width: 21px;
        height: 21px;
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) .vibe-player-actions {
        position: absolute;
        top: 50%;
        right: 6px;
        left: auto;
        bottom: auto;
        display: flex;
        width: 40px;
        height: 44px;
        gap: 0;
        margin: 0;
        padding: 0;
        transform: translateY(-50%);
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) .vibe-player-actions > :not(.vibe-player-collapse) {
        display: none !important;
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) .vibe-player-collapse,
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) > .vibe-player-expand {
        display: grid;
        place-items: center;
        width: 40px;
        height: 44px;
        min-width: 40px;
        min-height: 44px;
        padding: 0;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: rgba(255,255,255,.94);
        box-shadow: none;
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) > .vibe-player-expand {
        position: absolute;
        top: 50%;
        right: 48px;
        bottom: auto;
        left: auto;
        transform: translateY(-50%);
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) :is(.vibe-player-collapse,.vibe-player-expand) svg {
        width: 20px;
        height: 20px;
    }
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) .vibe-player-icon::after {
        display: none;
    }
}
body.vibe-site .vibe-floating-player.is-mobile-expanded { overflow: clip !important; }
/* Mobile expanded menu: five evenly spaced actions, without the sound control. */
body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-actions .vibe-player-volume {
    display: none !important;
}
body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-actions {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-copy {
    width: auto;
    max-width: none;
    min-width: 0;
    padding-inline: 0;
    margin-inline: 0;
    text-align: center;
}
body.vibe-site .vibe-floating-player.is-mobile-expanded :is(.vibe-player-title,.vibe-player-artist) {
    display: -webkit-box;
    width: 100%;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-align: center;
    text-wrap: balance;
}
body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-live { justify-content: center; }
@media (max-width: 767.98px) {
    body.vibe-site .vibe-floating-player:not(.is-mobile-expanded) { max-width: calc(100% - max(10px,env(safe-area-inset-left)) - max(10px,env(safe-area-inset-right))); min-width: 0; }
}
@media (orientation: portrait), (min-height: 501px) {
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-copy {
        left: max(24px,env(safe-area-inset-left));
        right: max(24px,env(safe-area-inset-right));
        transform: none;
    }
}
@media (max-height: 600px) {
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-title { font-size: 16px; line-height: 1.2; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-artist { font-size: 20px; line-height: 1.2; }
}

/* Voting belongs to the expanded mobile menu; compact and desktop stay unchanged. */
body.vibe-site .vibe-floating-player .vibe-player-vote { display: none !important; }
@media (max-width: 767.98px) {
  body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-vote { display: inline-flex !important; min-width: 0; min-height: 48px; }
  body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-favorite { display: none !important; }
  body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-stations-toggle { order: -1; }
  body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-actions { grid-template-columns: repeat(5, minmax(0, 1fr)); column-gap: 0; }
  body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-vote:disabled { opacity: .45; }
  body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-vote:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
}

/* Played tracks have their own panel, separate from the personal library. */
body.vibe-site .vibe-player-played-history {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(410px, calc(100vw - 28px));
    max-height: min(510px, calc(100dvh - 140px));
    padding: 0;
    overflow: hidden;
    text-align: left;
    border-radius: 24px;
    background: #f8faff;
    animation: vibe-library-enter .18s ease-out;
}
body.vibe-site .vibe-player-played-history[hidden] { display: none !important; }
body.vibe-site .vibe-player-played-history .vibe-player-history-list {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding: 6px 16px 12px;
    gap: 0;
    scrollbar-width: thin;
}
body.vibe-site .vibe-player-played-history .vibe-player-history-item {
    padding: 11px 0;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    border-radius: 0;
    border-bottom: 1px solid #e6eaf2;
    background: transparent;
}
body.vibe-site .vibe-player-played-history .vibe-player-history-item:last-child { border-bottom: 0; }
body.vibe-site .vibe-player-played-history .vibe-player-history-item img { width: 44px; height: 44px; border-radius: 10px; }
body.vibe-site .vibe-player-played-history .vibe-player-history-item strong { font: 700 14px/1.4 system-ui, sans-serif; color: #293247; }
body.vibe-site .vibe-player-played-history .vibe-player-history-item small { font: 400 13px/1.4 system-ui, sans-serif; color: #647086; }
body.vibe-site .vibe-player-played-history .vibe-player-history-item > i { font-size: 9px; white-space: nowrap; }
body.vibe-site .vibe-player-played-history .vibe-library-hint { padding: 15px 0; margin: 0; }
body.vibe-site .vibe-player-played-history .vibe-stroke-icon { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
body.vibe-site .vibe-player-played-history :focus-visible { outline: 2px solid #5267cc; outline-offset: -2px; }
@media (max-width: 767.98px), (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-actions { grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 0; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-stations-toggle { order: 0; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-vote { order: 1; display: flex !important; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-history-toggle { order: 2; display: flex !important; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-library-toggle { order: 3; display: flex !important; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-share { order: 4; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-collapse { order: 5; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-favorite { display: none !important; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-played-history {
        position: absolute;
        left: max(12px, env(safe-area-inset-left));
        right: max(12px, env(safe-area-inset-right));
        bottom: calc(100px + env(safe-area-inset-bottom));
        width: auto;
        max-height: calc(100dvh - 164px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        overflow: hidden;
        z-index: 20;
    }
}
@media (prefers-reduced-motion: reduce) { body.vibe-site .vibe-player-played-history { animation: none; } }

/* Short landscape: artwork on the left, metadata and Play on the right. */
@media (orientation: landscape) and (max-height: 500px) {
    body.vibe-site .vibe-floating-player.is-mobile-expanded :is(.vibe-player-brand-logo,.vibe-player-equalizer) { display: none !important; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-artwork-wrap {
        position: absolute !important; left: max(24px,env(safe-area-inset-left)) !important;
        top: 18px !important; width: min(32vw, calc(100dvh - 132px)) !important;
        height: min(32vw, calc(100dvh - 132px)) !important;
        min-width: 0 !important; min-height: 0 !important; margin: 0 !important;
        transform: none !important; border-radius: 20px !important;
    }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-artwork { width: 100% !important; height: 100% !important; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-copy {
        position: absolute !important; left: 40% !important; right: max(52px,env(safe-area-inset-right)) !important;
        top: 18px !important; bottom: auto !important; width: auto !important;
        max-height: calc(100dvh - 220px); padding: 0 !important; margin: 0 !important;
        transform: none !important; overflow: auto; text-align: center !important;
    }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-live { display: none !important; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-artist { font-size: 18px !important; line-height: 1.2 !important; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-title { font-size: 14px !important; line-height: 1.3 !important; }
    body.vibe-site .vibe-floating-player.is-mobile-expanded .vibe-player-play {
        top: auto !important; bottom: calc(110px + env(safe-area-inset-bottom)) !important;
        left: calc(70% - 26px) !important; right: auto !important;
        width: 56px !important; height: 56px !important; min-width: 56px !important; min-height: 56px !important;
        transform: translateX(-50%) !important;
    }
}
/* Tablet live block: give metadata its own row above the played tracks. */
@media (min-width: 768px) and (max-width: 1100px) {
    body.vibe-site.page-home .home-now-playing .ctr {
        display: grid !important; grid-template-columns: 150px minmax(0,1fr) !important;
        gap: 24px !important; align-items: center !important; padding: 0 !important;
    }
    body.vibe-site.page-home .home-now-playing .artwork { width: 150px !important; height: 150px !important; min-width: 0 !important; }
    body.vibe-site.page-home .home-now-playing .metadata { padding: 0 !important; width: auto !important; min-width: 0 !important; max-width: none !important; }
    body.vibe-site.page-home .home-now-playing .home-top-played {
        position: relative !important; inset: auto !important; transform: none !important;
        grid-column: 1 / -1; width: 100% !important; min-width: 0 !important; max-width: none !important;
    }
    body.vibe-site.page-home .home-now-playing .vibe-live-schedule { width: 100%; max-width: none; margin: 12px 0 0; }
    body.vibe-site.page-home .home-now-playing .vibe-live-programs { grid-template-columns: minmax(0,1fr); gap: 10px; }
    body.vibe-site.page-home .home-now-playing .vibe-live-program { border: 0; padding: 0; }
    body.vibe-site.page-home .home-now-playing .vibe-live-program-label { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.5; }
    body.vibe-site.page-home .home-now-playing .vibe-live-program-title { white-space: normal; -webkit-line-clamp: unset; }
    body.vibe-site.page-home .home-now-playing .vibe-live-actions { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 8px 20px; width: 100%; max-width: none; }
    body.vibe-site.page-home .home-now-playing .vibe-live-action { flex: 0 1 auto; min-width: 0; min-height: 44px; padding: 4px 0; white-space: normal; }
    body.vibe-site.page-home .home-now-playing .vibe-live-action span { white-space: normal; overflow: visible; }
}
body.vibe-site .vibe-empty-state { padding: clamp(28px,5vw,52px) 24px; margin: 16px auto 40px; width: min(100%,760px); text-align: center; border-radius: 24px; background: #f1f4fc; color: #283247; }
body.vibe-site .vibe-empty-state h2 { margin: 0 0 12px; font: 700 clamp(19px,3vw,25px)/1.3 system-ui,sans-serif; color: inherit; }
body.vibe-site .vibe-empty-state p { margin: 0 auto; max-width: 550px; font-size: 15px; line-height: 1.65; color: inherit; }
body.vibe-site .vibe-empty-state a { display: inline-flex; align-items: center; min-height: 44px; margin-top: 14px; color: #485dcc; text-decoration: underline; text-underline-offset: 4px; }
html[data-vibe-mode="dark"] body.vibe-site .vibe-empty-state { background: #192338; color: #e4eafb; }
html[data-vibe-mode="dark"] body.vibe-site .vibe-empty-state a { color: #aec4ff; }

/* Mobile ranking: vote counts and actions stay inside their own song card. */
@media (max-width: 767.98px) {
    body.vibe-site #main #votes .songs-list {
        display: grid !important;
        grid-template-columns: 56px minmax(0,1fr) 82px;
        grid-template-rows: auto minmax(44px,auto);
        align-items: center; column-gap: 12px; row-gap: 4px;
        width: 100%; min-width: 0; margin: 0 0 12px; padding: 12px;
        border: 1px solid var(--vibe-page-line, #e2e7f2); border-radius: 20px;
        background: var(--vibe-page-surface, #fff);
        box-shadow: 0 6px 20px rgba(31,48,94,.055);
    }
    body.vibe-site #main #votes .songs-list .details-wpr {
        display: contents !important;
    }
    body.vibe-site #main #votes .songs-list .img-wpr {
        grid-column: 1; grid-row: 1 / 3; align-self: center;
        width: 56px; height: 56px; min-width: 0; min-height: 0;
        margin: 0; padding: 0; border-radius: 12px;
    }
    body.vibe-site #main #votes .songs-list .details {
        grid-column: 2 / 4; grid-row: 1;
        width: auto; min-width: 0; max-width: none; margin: 0; padding: 0;
    }
    body.vibe-site #main #votes .songs-list :is(.title,.artist) {
        white-space: normal; overflow-wrap: anywhere;
    }
    body.vibe-site #main #votes .songs-list .title { font-size: 15px; line-height: 1.35; margin-bottom: 3px; }
    body.vibe-site #main #votes .songs-list .artist { font-size: 13px; line-height: 1.4; }
    body.vibe-site #main #votes .songs-list .time-wpr {
        grid-column: 2; grid-row: 2;
        position: static; inset: auto; transform: none; z-index: auto;
        display: flex; align-items: center; justify-content: flex-start;
        width: auto; min-width: 0; height: auto; min-height: 0;
        margin: 0; padding: 0; flex: none;
    }
    body.vibe-site #main #votes .songs-list .time {
        position: static; inset: auto; transform: none;
        width: auto; height: auto; min-height: 0; margin: 0; padding: 0;
        border: 0; border-radius: 0; background: transparent; box-shadow: none;
        color: var(--vibe-page-muted, #68758b);
        font-size: 12px; font-weight: 650; line-height: 1.4;
        font-variant-numeric: tabular-nums; white-space: normal; overflow-wrap: anywhere;
    }
    body.vibe-site #main #votes .songs-list .actions {
        grid-column: 3; grid-row: 2; justify-self: end;
        position: static !important; inset: auto !important; transform: none !important;
        display: flex; align-items: center; justify-content: flex-end;
        width: auto; height: auto; margin: 0; padding: 0; gap: 0;
    }
    body.vibe-site #main #votes .songs-list .vibe-song-vote {
        display: inline-flex; align-items: center; justify-content: center;
        width: 82px; min-width: 44px; min-height: 44px; padding: 8px;
        border: 1px solid var(--vibe-page-line, #e2e7f2); border-radius: 12px;
        background: var(--vibe-page-surface-soft, #f1f4fc);
        color: var(--vibe-page-blue-dark, #4560bd);
        gap: 6px; font-size: 13px; line-height: 1.3;
        white-space: nowrap; text-decoration: none; touch-action: manipulation;
    }
    body.vibe-site #main #votes .songs-list .vibe-song-vote-status {
        max-width: 100%; white-space: normal; overflow-wrap: anywhere;
    }
}
