/* === COMPACT MUSIC WINDOW === */
.left-rail {
    position: sticky;
    top: 1.5rem;
    align-self: flex-start;
    display: flex;
    flex: 0 0 200px;
    flex-direction: column;
    gap: 1rem;
    min-width: 200px;
}

/* The rail handles the sticky position for both small windows. */
.left-rail .sidebar {
    position: relative;
    top: auto;
    width: 100%;
    min-width: 0;
}

.audio-player {
    position: relative;
    width: 100%;
    padding: 7px;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid #8c7b9f;
    border-radius: 3px;
    background: linear-gradient(145deg, #fffaff, #e6daf2);
    box-shadow: inset 1px 1px #fff, inset -1px -1px #b6a5c9,
                3px 3px 0 #a899bd, 0 12px 28px rgba(64, 42, 89, 0.15);
}

.audio-player::before {
    content: '';
    position: absolute;
    inset: 43px 7px 7px;
    background: url('imgs/coplandOS.png') center 58% / cover no-repeat;
    filter: grayscale(1);
    mix-blend-mode: multiply;
    opacity: 0.14;
    pointer-events: none;
    z-index: 0;
}

.audio-player .sidebar-title {
    margin-bottom: 9px;
}

.audio-player-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 7px;
    border: 1px solid #fff;
    border-top-color: #b8a6ca;
    border-left-color: #b8a6ca;
    background: linear-gradient(110deg, rgba(255, 252, 255, 0.82), rgba(246, 235, 255, 0.42));
}

.audio-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid #766183;
    border-radius: 1px;
    background: #eee4f7;
    box-shadow: inset 1px 1px #fff, inset -1px -1px #b6a5c9;
    color: #63477f;
    font-size: 1rem;
    cursor: pointer;
}

.audio-toggle:hover {
    background: #f8f1ff;
}

.audio-toggle:active,
.audio-player.is-playing .audio-toggle {
    background: #d9c7eb;
    box-shadow: inset 1px 1px #a899bd, inset -1px -1px #fff;
}

.audio-toggle:focus-visible {
    outline: 2px dotted #63477f;
    outline-offset: 2px;
}

.audio-track {
    min-width: 0;
    color: #483357;
    text-align: left;
}

.audio-track-name {
    display: block;
    font-size: 0.82rem;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.audio-status {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.3rem;
    color: #745a8b;
    font-size: 0.72rem;
}

.audio-status::before {
    content: '';
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border: 1px solid #7b648f;
    background: #eee4f7;
    box-shadow: inset 1px 1px #fff;
}

.audio-player.is-playing .audio-status::before {
    background: #a98aca;
}

@media (prefers-reduced-motion: reduce) {
    .audio-toggle {
        transition: none;
    }
}

@media (max-width: 500px) {
    /* Turn the music window into one low, horizontal control bar. */
    .audio-player {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        align-items: stretch;
        gap: 5px;
        padding: 5px;
    }

    .audio-player::before {
        inset: 5px;
    }

    .audio-player .sidebar-title {
        justify-content: center;
        min-height: 42px;
        margin: 0;
        padding: 3px 6px;
        font-size: 0.9rem;
    }

    .audio-player .window-controls {
        display: none;
    }

    .audio-player-content {
        min-width: 0;
        gap: 0.45rem;
        padding: 4px;
    }

    .audio-toggle {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
        font-size: 0.85rem;
    }

    .audio-track {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 0.15rem 0.45rem;
    }

    .audio-track-name {
        font-size: 0.76rem;
    }

    .audio-status {
        margin-top: 0;
        font-size: 0.68rem;
    }
}
