/* ============================================================================
   Ramen Music Lounge v3 — Clean Native Mobile & Desktop UX + Avatar Music Halos
   ============================================================================ */

/* ── Global Avatar Reactive Halo & Live EQ Micro-Badge ───────────────────── */
.rm-avatar-frame.rm-music-live {
    position: relative !important;
    overflow: visible !important;
}
.rm-avatar-frame > img {
    border-radius: 50% !important;
}
.rm-avatar-frame.rm-music-live::after {
    opacity: 0 !important;
    animation: none !important;
}
.rm-music-ring-canvas {
    position: absolute;
    pointer-events: none;
    z-index: 5;
    display: block;
}

.rm-music-eq-badge {
    position: absolute;
    left: -3px;
    bottom: -3px;
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: 1.5px solid rgba(14, 17, 26, 0.92);
    background: linear-gradient(135deg, #0f172a, #1e1b4b);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.16) inset;
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    padding: 4px 3.5px;
    z-index: 8;
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.rm-music-eq-badge:hover {
    transform: scale(1.14);
    box-shadow: 0 3px 12px rgba(167, 139, 250, 0.65);
}
.rm-music-eq-badge i {
    display: block;
    width: 2px;
    height: 35%;
    border-radius: 999px;
    background: linear-gradient(180deg, #67e8f9 0%, #c084fc 55%, #f472b6 100%);
    transition: height 0.06s linear;
}
.rm-avatar-frame:not(.rm-avatar-frame--sm) > .rm-music-eq-badge {
    width: 28px;
    height: 28px;
    left: 2px;
    bottom: 2px;
    gap: 2.5px;
    padding: 6px 5px;
    border-width: 2px;
}
.rm-avatar-frame:not(.rm-avatar-frame--sm) > .rm-music-eq-badge i { width: 3px; }
body.theme-light .rm-music-eq-badge {
    border-color: #ffffff;
    background: linear-gradient(135deg, #1e293b, #312e81);
}

/* ── Subtle Live Music Pill in Chat Header & Profile Poster ─────────────── */
.rm-header-music-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 240px;
    margin-left: 8px;
    padding: 3px 9px 3px 7px;
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, 0.34);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(168, 85, 247, 0.16));
    color: #e0f2fe;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rm-header-music-pill .rm-hmp-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #38bdf8; box-shadow: 0 0 8px #38bdf8; flex-shrink: 0;
}
.rm-header-music-pill .rm-hmp-text { overflow: hidden; text-overflow: ellipsis; }
body.theme-light .rm-header-music-pill {
    color: #312e81;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(168, 85, 247, 0.14));
    border-color: rgba(99, 102, 241, 0.28);
}

.rm-poster-music-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 10px;
    padding: 7px 13px 7px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(12, 16, 28, 0.56);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #f8fafc;
    font-size: 12.5px;
    cursor: pointer;
    max-width: min(320px, 86vw);
}
.rm-poster-music-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.rm-poster-music-chip .rm-pmc-copy { display: flex; flex-direction: column; min-width: 0; text-align: left; line-height: 1.2; }
.rm-poster-music-chip .rm-pmc-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-poster-music-chip .rm-pmc-sub { font-size: 11px; color: rgba(226, 232, 240, 0.72); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Watch Party Music Tile Styling ──────────────────────────────────────── */
.cinema-btn[data-action="wp-select-music"] {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.16), rgba(168, 85, 247, 0.22), rgba(244, 114, 182, 0.16)) !important;
    border: 1px solid rgba(167, 139, 250, 0.34) !important;
    box-shadow: 0 10px 26px rgba(99, 102, 241, 0.22) !important;
}
body.theme-light .cinema-btn[data-action="wp-select-music"] {
    color: #1e1b4b !important;
}

/* ── Hide admin shield FAB during fullscreen Watch Party so it never collides ── */
body.watch-party-active:not(.player-minimized) #zx-fab,
body.rm-music-lounge-open #zx-fab {
    display: none !important;
}

/* ── Watch Party Music Lounge v3 (#watch-party-music-view) ──────────────── */
#watch-party-music-view {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0b0d14;
    color: #f8fafc;
    font-family: inherit;
    isolation: isolate;
    --wm-kick: 0;
    --wm-bass: 0;
}
#watch-party-music-view.hidden { display: none !important; }

.wm-ambient-backdrop {
    position: absolute;
    inset: -50px;
    background-size: cover;
    background-position: center;
    filter: blur(64px) saturate(1.4) brightness(0.62);
    opacity: 0.48;
    transform: scale(calc(1.12 + var(--wm-bass, 0) * 0.05));
    transition: background-image 0.7s ease, opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}
.wm-ambient-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(11, 13, 20, 0.55) 0%, rgba(11, 13, 20, 0.88) 100%);
    pointer-events: none;
    z-index: 1;
}

/* ── Single Clean Topbar (zero duplicate stacked headers!) ──────────────── */
.wm-topbar {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(11, 13, 20, 0.44);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    flex-shrink: 0;
}
.wm-topbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.wm-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(241, 245, 249, 0.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, transform 0.12s ease, color 0.15s ease;
}
.wm-icon-btn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.wm-icon-btn:active { transform: scale(0.92); }
.wm-icon-btn.is-active { background: rgba(129, 140, 248, 0.24); color: #c7d2fe; }
.wm-icon-btn.is-loved { color: #fb7185; background: rgba(251, 113, 133, 0.14); }
.wm-icon-btn--ghost { background: transparent; width: 38px; height: 38px; }
.wm-icon-btn--ghost:hover { background: rgba(255, 255, 255, 0.09); }

.wm-brand-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 14.5px;
    letter-spacing: -0.01em;
    white-space: nowrap;
}
.wm-mode-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.07);
    color: rgba(226, 232, 240, 0.85);
    white-space: nowrap;
}
.wm-mode-pill[data-mode="live-fft"],
.wm-mode-pill[data-mode="live-tab"] {
    background: rgba(16, 185, 129, 0.16);
    color: #6ee7b7;
}
.wm-mode-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor;
}
.wm-topbar-actions { display: flex; align-items: center; gap: 6px; }
.wm-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(241, 245, 249, 0.9);
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.wm-pill-btn:hover { background: rgba(255, 255, 255, 0.13); }
.wm-pill-btn.is-active {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(52, 211, 153, 0.45);
    color: #a7f3d0;
}
.wm-pill-btn[hidden] { display: none !important; }
.wm-mobile-close-btn { display: none; }

/* Mobile 3-way segmented control: Плеер | Медиатека | Чат */
.wm-mobile-tabs {
    position: relative;
    z-index: 3;
    display: none;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin: 8px 14px 4px;
    padding: 3px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.wm-mobile-tab {
    padding: 7px 8px;
    border-radius: 9px;
    border: none;
    background: transparent;
    color: rgba(203, 213, 225, 0.72);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.wm-mobile-tab.is-active {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

/* ── Main 2-Column Desktop Body ─────────────────────────────────────────── */
.wm-body {
    position: relative;
    z-index: 2;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(300px, 0.98fr);
    overflow: hidden;
}

/* ── Left: Clean Apple-Music / Spotify Stage ────────────────────────────── */
.wm-stage-pane {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 28px 22px;
    gap: 14px;
    min-height: 0;
    overflow-y: auto;
    position: relative;
}

/* Spotify-Connect style banner when active on your other device */
.wm-device-banner {
    width: 100%;
    max-width: 360px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px 8px 12px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.13);
    border: 1px solid rgba(56, 189, 248, 0.34);
    font-size: 12px;
    color: #e0f2fe;
}
.wm-device-banner[hidden] { display: none !important; }
.wm-device-takeover-btn {
    padding: 5px 11px;
    border-radius: 999px;
    border: none;
    background: #38bdf8;
    color: #070a13;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
}

/* Generous Rounded-Square Artwork Card */
.wm-art-card {
    position: relative;
    width: min(244px, 42vh, 66vw);
    height: min(244px, 42vh, 66vw);
    min-width: 170px;
    min-height: 170px;
    border-radius: 22px;
    overflow: hidden;
    background: linear-gradient(145deg, #171c2c 0%, #232042 58%, #111524 100%);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.56),
        0 0 0 1px rgba(255, 255, 255, 0.11);
    transform: scale(calc(1 + var(--wm-kick, 0) * 0.032));
    transition: transform 0.07s linear, box-shadow 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wm-art-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wm-art-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: rgba(203, 213, 225, 0.55);
}

/* Sleek horizontal silk waveform bar right below artwork */
.wm-wave-wrap {
    width: 100%;
    max-width: 340px;
    height: 30px;
    flex-shrink: 0;
}
.wm-stage-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* Hidden/toggleable YouTube clip box */
.wm-yt-host {
    position: absolute;
    width: 224px;
    height: 126px;
    right: 12px;
    top: 12px;
    border-radius: 13px;
    overflow: hidden;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.16);
    z-index: 6;
    transition: opacity 0.22s ease, transform 0.22s ease;
}
.wm-yt-host.is-audio-only {
    opacity: 0.006;
    pointer-events: none;
    transform: scale(0.92);
}
.wm-yt-host iframe { width: 100% !important; height: 100% !important; border: 0; }

/* Spotify/Apple Music Title + Heart Row */
.wm-meta-row {
    width: 100%;
    max-width: 360px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.wm-track-meta {
    min-width: 0;
    flex: 1;
    text-align: left;
}
.wm-track-title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #ffffff;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wm-track-artist {
    margin: 3px 0 0;
    font-size: 13.5px;
    color: rgba(203, 213, 225, 0.72);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Sleek Custom Glass Sliders */
.wm-progress-wrap {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wm-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(
        90deg,
        #ffffff 0%,
        #ffffff var(--wm-fill, 0%),
        rgba(255, 255, 255, 0.18) var(--wm-fill, 0%)
    );
    outline: none;
    cursor: pointer;
    transition: height 0.14s ease;
}
.wm-range:hover { height: 6px; }
.wm-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.wm-range::-moz-range-thumb {
    width: 12px; height: 12px; border: none; border-radius: 50%; background: #ffffff;
}
.wm-time-row {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
    color: rgba(148, 163, 184, 0.82);
}

/* Spacious Centered Transport */
.wm-transport {
    width: 100%;
    max-width: 360px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 8px;
}
.wm-play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: #0b0d14;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
    transition: transform 0.14s ease, opacity 0.14s ease;
}
.wm-play-btn:hover { transform: scale(1.05); }
.wm-play-btn:active { transform: scale(0.94); }

.wm-sub-controls {
    width: 100%;
    max-width: 360px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.wm-vol-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(203, 213, 225, 0.72);
    width: 128px;
}
.wm-rhythm-nudge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
}
.wm-rhythm-nudge[hidden] { display: none !important; }
.wm-nudge-btn {
    border: none;
    background: transparent;
    color: rgba(226, 232, 240, 0.84);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 999px;
    cursor: pointer;
}
.wm-nudge-btn:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }

/* ── Right: 4-Tab Library (Поиск | Плейлисты | Диск | Очередь) ───────────── */
.wm-library-pane {
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.07);
    background: rgba(11, 13, 20, 0.56);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    min-height: 0;
    overflow: hidden;
}
.wm-nav-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px;
    padding: 10px 12px 8px;
    flex-shrink: 0;
}
.wm-nav-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 7px 6px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(203, 213, 225, 0.72);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.wm-nav-tab.is-active {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}
.wm-badge-count {
    font-size: 10px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(129, 140, 248, 0.35);
    color: #e0e7ff;
    line-height: 1.5;
}

.wm-subbar { display: flex; align-items: center; gap: 6px; padding: 0 12px 8px; flex-shrink: 0; }
.wm-source-pill {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 8px;
    border-radius: 9px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(203, 213, 225, 0.74);
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}
.wm-source-pill.is-active { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.24); color: #fff; }
.wm-fft-tag {
    font-size: 9px; padding: 1px 5px; border-radius: 999px;
    background: rgba(16, 185, 129, 0.2); color: #6ee7b7; font-weight: 800;
}

.wm-search-form { display: flex; gap: 6px; padding: 0 12px 8px; flex-shrink: 0; }
.wm-search-input {
    flex: 1; min-width: 0; padding: 9px 12px; border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.06);
    color: #f8fafc; font-size: 13px; outline: none;
}
.wm-search-input:focus { border-color: rgba(255, 255, 255, 0.28); background: rgba(255, 255, 255, 0.09); }
.wm-search-submit {
    padding: 0 14px; border-radius: 10px; border: none;
    background: #ffffff; color: #0b0d14; font-weight: 800; font-size: 12px; cursor: pointer; flex-shrink: 0;
}
.wm-search-submit:disabled { opacity: 0.5; cursor: default; }

.wm-genre-strip {
    display: flex; gap: 6px; overflow-x: auto; padding: 0 12px 8px; flex-shrink: 0;
    scrollbar-width: none;
}
.wm-genre-strip::-webkit-scrollbar { display: none; }
.wm-vibe-chip {
    padding: 5px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05); color: rgba(226, 232, 240, 0.88);
    font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.wm-vibe-chip:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }

.wm-results-scroll {
    flex: 1; min-height: 0; overflow-y: auto; padding: 0 12px 14px;
    display: flex; flex-direction: column; gap: 6px;
}

.wm-track-row {
    display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px;
    border: 1px solid transparent; background: rgba(255, 255, 255, 0.03);
    cursor: pointer; transition: background 0.15s ease;
}
.wm-track-row:hover { background: rgba(255, 255, 255, 0.08); }
.wm-track-row.is-current { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.18); }
.wm-track-thumb {
    width: 44px; height: 44px; border-radius: 9px; object-fit: cover;
    background: rgba(255, 255, 255, 0.07); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; color: #94a3b8;
}
.wm-track-info { flex: 1; min-width: 0; }
.wm-track-row-title { font-size: 13px; font-weight: 700; color: #f8fafc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wm-track-row-sub { font-size: 11.5px; color: rgba(148, 163, 184, 0.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.wm-row-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.wm-track-qbtn {
    width: 28px; height: 28px; border-radius: 8px; border: none;
    background: rgba(255, 255, 255, 0.06); color: #cbd5e1;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.wm-track-qbtn:hover { background: rgba(255, 255, 255, 0.16); color: #fff; }
.wm-track-qbtn.is-loved { color: #fb7185; background: rgba(251, 113, 133, 0.16); }

.wm-panel-card {
    padding: 11px 12px; border-radius: 13px; border: 1px solid rgba(255, 255, 255, 0.09);
    background: rgba(255, 255, 255, 0.04); display: flex; flex-direction: column; gap: 7px; margin-bottom: 6px;
}
.wm-panel-card-title { font-size: 12px; font-weight: 800; color: #f1f5f9; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.wm-panel-card-hint { font-size: 11.5px; color: rgba(148, 163, 184, 0.88); line-height: 1.38; }
.wm-inline-form { display: flex; gap: 6px; }

.wm-drive-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; padding: 0 12px 8px; flex-shrink: 0; }
.wm-breadcrumbs { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: rgba(203, 213, 225, 0.8); overflow-x: auto; white-space: nowrap; padding: 0 12px 6px; flex-shrink: 0; }
.wm-crumb { border: none; background: rgba(255, 255, 255, 0.06); color: #cbd5e1; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; cursor: pointer; }
.wm-crumb.is-last { background: rgba(245, 158, 11, 0.2); color: #fde68a; }
.wm-playlist-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.05); margin-bottom: 6px; }
.wm-empty { padding: 26px 14px; text-align: center; font-size: 12.5px; color: rgba(148, 163, 184, 0.85); line-height: 1.5; }

/* ── Smart Floating Mini-Bar (ZERO overlap on Desktop, Mobile Hub, or Mobile Chat!) ── */
#rm-music-mini-bar {
    position: fixed;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    transform: translateX(-50%);
    z-index: 4500;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px 7px 8px;
    border-radius: 999px;
    background: rgba(16, 19, 30, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #f8fafc;
    max-width: min(410px, calc(100vw - 24px));
    cursor: pointer;
}
#rm-music-mini-bar.hidden { display: none !important; }
.rm-mmb-cover {
    width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
}
.rm-mmb-meta { min-width: 0; flex: 1; line-height: 1.25; }
.rm-mmb-title { font-size: 12.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-mmb-sub { font-size: 11px; color: rgba(148, 163, 184, 0.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-mmb-btn {
    width: 32px; height: 32px; border-radius: 50%; border: none;
    background: rgba(255, 255, 255, 0.08); color: #f8fafc;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
}
.rm-mmb-btn:hover { background: rgba(255, 255, 255, 0.18); }

/* Mobile mini-bar docking: cleanly ABOVE #mobile-bottom-nav on hub/settings/list, OR below #chat-header inside open chats! */
@media (max-width: 768px) {
    #rm-music-mini-bar {
        left: 10px;
        right: 10px;
        width: auto;
        max-width: none;
        transform: none;
        border-radius: 14px;
        padding: 7px 9px;
        bottom: calc(var(--bottom-nav-height, 64px) + var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)) + 8px);
    }
    /* Lift admin shield FAB above the mini-bar so nothing ever overlaps! */
    body.rm-music-minibar-open:not(.chat-open) #zx-fab {
        bottom: calc(var(--bottom-nav-height, 64px) + var(--safe-area-bottom, env(safe-area-inset-bottom, 0px)) + 68px) !important;
    }
    /* Inside an open chat (where keyboard & composer sit at the bottom), dock slim Telegram-style under #chat-header! */
    body.chat-open #rm-music-mini-bar {
        top: calc(env(safe-area-inset-top, 0px) + 58px);
        bottom: auto;
        left: 10px;
        right: 10px;
        border-radius: 12px;
        padding: 5px 8px;
    }
    body.chat-open #rm-music-mini-bar .rm-mmb-cover { width: 30px; height: 30px; }
}

/* ── Friend "Now Listening" Popover ("Слушать вместе") ───────────────────── */
#rm-music-popover {
    position: fixed;
    z-index: 2147483640;
    width: min(304px, calc(100vw - 24px));
    border-radius: 18px;
    padding: 14px;
    background: rgba(14, 17, 28, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.56);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.rm-mpop-head { display: flex; align-items: center; gap: 11px; }
.rm-mpop-cover { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: #1e293b; flex-shrink: 0; }
.rm-mpop-info { min-width: 0; flex: 1; }
.rm-mpop-kicker { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #7dd3fc; margin-bottom: 2px; }
.rm-mpop-title { font-size: 14px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-mpop-artist { font-size: 12px; color: rgba(203, 213, 225, 0.78); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rm-mpop-cta {
    width: 100%; padding: 9px 14px; border-radius: 11px; border: none;
    background: #ffffff; color: #0b0d14; font-weight: 800; font-size: 13px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}

/* ── Light Theme ────────────────────────────────────────────────────────── */
body.theme-light #watch-party-music-view { background: #f8fafc; color: #0f172a; }
body.theme-light .wm-ambient-scrim { background: linear-gradient(180deg, rgba(248, 250, 252, 0.76) 0%, rgba(241, 245, 249, 0.94) 100%); }
body.theme-light .wm-topbar, body.theme-light .wm-library-pane { background: rgba(255, 255, 255, 0.82); border-color: rgba(15, 23, 42, 0.08); }
body.theme-light .wm-track-title, body.theme-light .wm-track-row-title, body.theme-light .wm-panel-card-title { color: #0f172a; }
body.theme-light .wm-track-artist, body.theme-light .wm-track-row-sub, body.theme-light .wm-panel-card-hint { color: #475569; }
body.theme-light .wm-icon-btn, body.theme-light .wm-pill-btn, body.theme-light .wm-nav-tab, body.theme-light .wm-source-pill,
body.theme-light .wm-track-row, body.theme-light .wm-search-input, body.theme-light .wm-crumb, body.theme-light .wm-vibe-chip, body.theme-light .wm-mobile-tabs {
    background: rgba(15, 23, 42, 0.06); border-color: rgba(15, 23, 42, 0.1); color: #0f172a;
}
body.theme-light .wm-mobile-tab.is-active, body.theme-light .wm-nav-tab.is-active { background: #ffffff; color: #0f172a; box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08); }
body.theme-light .wm-play-btn, body.theme-light .wm-search-submit, body.theme-light .rm-mpop-cta { background: #0f172a; color: #ffffff; }
body.theme-light .wm-range {
    background: linear-gradient(90deg, #0f172a 0%, #0f172a var(--wm-fill, 0%), rgba(15, 23, 42, 0.15) var(--wm-fill, 0%));
}
body.theme-light #rm-music-mini-bar, body.theme-light #rm-music-popover {
    background: rgba(255, 255, 255, 0.96); color: #0f172a; border-color: rgba(15, 23, 42, 0.1); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
}
body.theme-light .rm-mmb-btn { background: rgba(15, 23, 42, 0.07); color: #0f172a; }

/* ── Mobile Full-Screen Clean Music Lounge (zero double headers, chat as clean 3rd tab!) ── */
@media (max-width: 880px) {
    /* High-specificity full-viewport lock: beats runtime-injected body.video-is-playing 56.25vw strip! */
    html body.rm-music-lounge-open #player-modal,
    html body.rm-music-lounge-open.video-is-playing #player-modal {
        position: fixed !important;
        inset: 0 !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        resize: none !important;
        border-radius: 0 !important;
    }
    html body.rm-music-lounge-open #player-resizer-handle {
        display: none !important;
    }
    /* Eliminate the redundant outer Watch Party header while Music Lounge is open! */
    html body.rm-music-lounge-open #player-modal .player-modal__header {
        display: none !important;
    }
    body.rm-music-lounge-open .watch-party-content-wrapper {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
    }
    body.rm-music-lounge-open #watch-party-main {
        flex: 1 1 auto !important;
        height: 100% !important;
        max-height: none !important;
        min-height: 0 !important;
    }
    /* Hide the Watch Party chat/options sidebar unless the user tapped the "Чат" tab! */
    body.rm-music-lounge-open:not(.rm-music-chat-tab) #watch-party-sidebar {
        display: none !important;
    }
    body.rm-music-lounge-open.rm-music-chat-tab #watch-party-main {
        flex: 0 0 auto !important;
        height: auto !important;
    }
    body.rm-music-lounge-open.rm-music-chat-tab #watch-party-music-view {
        height: auto !important;
    }
    body.rm-music-lounge-open.rm-music-chat-tab #watch-party-music-view .wm-body {
        display: none !important;
    }
    body.rm-music-lounge-open.rm-music-chat-tab #watch-party-sidebar {
        display: flex !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: auto !important;
    }

    .wm-topbar {
        padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
    }
    .wm-mobile-close-btn { display: inline-flex; }
    .wm-mobile-tabs { display: grid; }
    .wm-body { grid-template-columns: 1fr; }
    .wm-library-pane { border-left: none; }
    #watch-party-music-view[data-mobile-tab="stage"] .wm-library-pane { display: none; }
    #watch-party-music-view[data-mobile-tab="browse"] .wm-stage-pane { display: none; }

    .wm-stage-pane {
        padding: 14px 20px calc(env(safe-area-inset-bottom, 0px) + 20px);
        gap: 14px;
    }
    /* Phones use hardware volume keys — hide redundant desktop volume slider */
    .wm-vol-group { display: none !important; }
    .wm-sub-controls { justify-content: center; }
    .wm-brand-title span:first-child { display: none; }
}
