/* ===================================================================
   3SRB — Offline Audio Player & Practice Music Styles
   Aesthetic: Warm Brand Default with Optional Dark Studio Mode,
   Sticky Search Header, Visible Play Buttons, and Full Offline Support.
   =================================================================== */

html {
    scroll-behavior: smooth;
}

body.audio-player-page {
    overflow-x: hidden;
}

/* ========== DARK THEME OVERRIDES (OPTIONAL MODE) ========== */
body.theme-dark {
    --bg: #121214;
    --card: #1C1C22;
    --primary: #D8A23E;
    --secondary: #B8860B;
    --accent: #E5A93C;
    --text: #F0F0F5;
    --muted: #A0A0B0;
    --border-light: rgba(255, 255, 255, 0.08);
    background-color: var(--bg);
    color: var(--text);
}

body.theme-dark::before {
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(216, 162, 62, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(92, 35, 35, 0.15) 0%, transparent 50%);
}

body.theme-dark .intro-note,
body.theme-dark .search-wrapper,
body.theme-dark .audio-track,
body.theme-dark .audio-player-bar {
    background: var(--card);
    border-color: var(--border-light);
    color: var(--text);
}

body.theme-dark .audio-track .track-name {
    color: var(--text);
}

body.theme-dark .group-header h2 {
    color: #FFFFFF;
}

body.theme-dark .sticky-player-header {
    background: rgba(18, 18, 20, 0.95);
}

/* ========== OFFLINE BANNER ========== */
.offline-banner {
    background: linear-gradient(90deg, var(--primary) 0%, #3D1616 100%);
    color: #FFFFFF;
    text-align: center;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: sticky;
    top: var(--nav-height);
    z-index: 101;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.offline-icon {
    font-size: 1rem;
}

/* ========== DECORATIVE CIRCLE ========== */
.deco-circle--audio {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    border: 1px solid rgba(92, 35, 35, 0.04);
    position: absolute;
    bottom: -120px;
    right: -120px;
    pointer-events: none;
    z-index: 0;
}

/* ========== PAGE HERO ========== */
.page-hero {
    min-height: 30vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: calc(var(--nav-height) + 30px) 20px 24px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero .hero-badge {
    display: inline-block;
    font-family: var(--font-button);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(184, 134, 11, 0.08);
    border: 1px solid rgba(184, 134, 11, 0.25);
    padding: 6px 18px;
    border-radius: 100px;
    margin-bottom: 1rem;
}

.page-hero h1 {
    margin-bottom: 0.4rem;
}

.page-hero .subtitle {
    max-width: 650px;
    margin: 0 auto 1.2rem;
    color: var(--muted);
    font-size: 1.05rem;
}

/* ========== PLAYER TOOLBAR ========== */
.player-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 0.5rem;
}

.toolbar-btn {
    font-family: var(--font-button);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border-light);
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.25s ease;
}

.toolbar-btn:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.15);
}

.toolbar-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
}

.toolbar-btn .badge-count {
    background: var(--accent);
    color: #FFFFFF;
    font-size: 0.7rem;
    padding: 2px 7px;
    border-radius: 10px;
    font-weight: 600;
}

.storage-info {
    font-size: 0.8rem;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
}

.storage-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
}

/* ========== STICKY PLAYER HEADER (SEARCH & CATEGORY BAR) ========== */
/* ========== STICKY PLAYER CONTROL HEADER ========== */
.sticky-player-header {
    position: sticky;
    top: var(--nav-height, 60px);
    background: rgba(250, 247, 240, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-light);
    padding: 10px 16px 8px;
    box-shadow: 0 4px 20px rgba(92, 35, 35, 0.05);
    z-index: 100;
    transition: background 0.3s ease;
}


.sticky-player-header,
.playlists-scroll,
.audio-category-nav,
.playlists-row,
.category-chips-row {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.sticky-player-header::-webkit-scrollbar,
.playlists-scroll::-webkit-scrollbar,
.audio-category-nav::-webkit-scrollbar,
.playlists-row::-webkit-scrollbar,
.category-chips-row::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

/* Purge browser focus outlines */
.playlist-chip,
.playlist-chip:focus,
.playlist-chip:active,
.category-chip,
.category-chip:focus,
.category-chip:active,
.cat-browse-btn:focus {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

/* Single 1-Row Control Toolbar */
.audio-single-toolbar {
    max-width: 950px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.toolbar-item {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

/* Search Toggle Button */
.search-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    background: #FFFFFF;
    border: 1.5px solid rgba(92, 35, 35, 0.18);
    border-radius: 50%;
    color: var(--text);
    font-size: 0.92rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(92, 35, 35, 0.04);
}

.search-toggle-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(92, 35, 35, 0.05);
}


.search-wrapper {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: 1.5px solid rgba(92, 35, 35, 0.18);
    border-radius: 50px;
    padding: 8px 18px;
    box-shadow: 0 2px 10px rgba(92, 35, 35, 0.04);
    transition: all 0.25s ease;
}


.search-wrapper input#audioSearch {
    width: 100%;
    border: none !important;
    background: transparent !important;
    outline: none !important;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.92rem;
    padding: 0 8px;
}

.search-wrapper input#audioSearch::placeholder {
    color: var(--muted);
    opacity: 0.75;
}

.search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 4px 18px rgba(92, 35, 35, 0.12);
}

/* Hero Info Toggle Button */
.hero-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(92, 35, 35, 0.08);
    border: 1.5px solid rgba(92, 35, 35, 0.16);
    color: var(--primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.hero-toggle-btn:hover,
.hero-toggle-btn.active {
    background: var(--primary);
    color: #FFFFFF;
}

.header-nav-tier {
    max-width: 950px;
    margin: 4px auto 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

.header-right-tools {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}



/* Segmented View Switch: Categories vs Playlists */
.nav-segmented-toggle {
    display: inline-flex;
    align-items: center;
    background: rgba(92, 35, 35, 0.08);
    border-radius: 20px;
    padding: 3px;
    border: 1px solid rgba(92, 35, 35, 0.14);
    flex-shrink: 0;
}

.segmented-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    border-radius: 16px;
    background: transparent;
    border: none;
    color: var(--text);
    font-family: var(--font-button);
    font-size: 0.76rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.segmented-btn:hover {
    color: var(--primary);
}

.segmented-btn.active {
    background: #D8A23E;
    color: #FFFFFF;
    box-shadow: 0 2px 8px rgba(216, 162, 62, 0.35);
}


/* Categories Browse Button */
.cat-browse-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    border-radius: 20px;
    font-family: var(--font-button);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(92, 35, 35, 0.25);
    flex-shrink: 0;
}

.cat-browse-btn:hover {
    background: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(184, 134, 11, 0.35);
}

.cat-browse-btn .cat-count-badge {
    background: rgba(255, 255, 255, 0.22);
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
}

/* View Mode Toggle */
.view-toggle-wrapper {
    display: flex;
    align-items: center;
    background: #FFFFFF;
    border: 1.5px solid rgba(92, 35, 35, 0.18);
    border-radius: 20px;
    padding: 2px;
    flex-shrink: 0;
}

.view-toggle-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-family: var(--font-button);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.view-toggle-btn.active {
    background: var(--primary);
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(92, 35, 35, 0.2);
}

/* Middle Tier: Category Scroll Chips Bar */
.category-chips-row {
    max-width: 950px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

.cat-scroll-container {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.scroll-fade-right {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 32px;
    background: linear-gradient(to right, rgba(250, 247, 240, 0), rgba(250, 247, 240, 0.95) 75%);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    pointer-events: none;
    padding-right: 2px;
    transition: opacity 0.25s ease;
    z-index: 2;
}

.audio-category-nav,
.playlists-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    flex: 1;
    min-width: 0;
    padding: 2px 2px 4px;
    margin: 0;
}

.category-chip,
.playlist-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 18px;
    background: #FFFFFF;
    border: 1.5px solid rgba(92, 35, 35, 0.14);
    color: var(--text);
    font-family: var(--font-button);
    font-size: 0.78rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(92, 35, 35, 0.04);
}

.category-chip.active,
.playlist-chip.active {
    background: #D8A23E;
    color: #FFFFFF;
    border-color: #D8A23E;
    font-weight: 700;
    box-shadow: 0 3px 10px rgba(216, 162, 62, 0.35);
    transform: translateY(-1px);
}

.category-chip:hover,
.playlist-chip:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #FAF7F0;
    transform: translateY(-1px);
}

.chip-icon {
    font-size: 0.95rem;
    line-height: 1;
}

/* Category Drawer Popover Modal */
.category-drawer-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 680px;
    background: #FAF7F0;
    border: 2px solid var(--primary);
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow: 0 16px 50px rgba(92, 35, 35, 0.35);
    z-index: 10001;
    animation: popUpDrawer 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popUpDrawer {
    from { opacity: 0; transform: translate(-50%, -40%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px dashed rgba(92, 35, 35, 0.2);
}

.drawer-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.drawer-close-btn {
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--muted);
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.drawer-close-btn:hover {
    color: var(--primary);
}

.drawer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    max-height: 380px;
    overflow-y: auto;
    padding-right: 4px;
}

.drawer-card {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #FFFFFF;
    border: 1.5px solid rgba(92, 35, 35, 0.14);
    border-radius: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: var(--text);
    font-family: var(--font-button);
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(92, 35, 35, 0.04);
}

.drawer-card:hover,
.drawer-card.active {
    background: var(--primary);
    color: #FFFFFF;
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(92, 35, 35, 0.25);
}

.drawer-card .d-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.drawer-card .d-txt {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

}


/* 100% Circular Category & Playlist Buttons */
.playlist-chip,
.sticky-player-header nav.audio-category-nav a {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    flex-shrink: 0;
}

.cat-circle,
.chip-circle {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background: #FAF7F0;
    border: 1.5px solid rgba(92, 35, 35, 0.18);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 2px 6px rgba(92, 35, 35, 0.05);
}

.cat-icon {
    font-size: 1.15rem;
    line-height: 1;
}

.cat-label,
.chip-label {
    font-family: var(--font-button);
    font-size: 0.64rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    text-align: center;
    line-height: 1.2;
    transition: all 0.2s ease;
}

/* Soft Warm Active Highlight */
.sticky-player-header nav.audio-category-nav a.active .cat-circle,
.playlist-chip.active .chip-circle {
    background: #D8A23E;
    color: #FFFFFF;
    border-color: #D8A23E;
    transform: none;
    box-shadow: 0 3px 10px rgba(216, 162, 62, 0.3);
}

.sticky-player-header nav.audio-category-nav a.active .cat-label,
.playlist-chip.active .chip-label {
    color: var(--accent);
    font-weight: 700;
}

.sticky-player-header nav.audio-category-nav a:hover .cat-circle,
.playlist-chip:hover .chip-circle {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 6px 16px rgba(92, 35, 35, 0.25);
    border-color: var(--primary);
    background: var(--primary);
    color: #FFFFFF;
}

.sticky-player-header nav.audio-category-nav a:hover .cat-label,
.playlist-chip:hover .chip-label {
    color: var(--primary);
    font-weight: 700;
}

.chip-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: #FFFFFF;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    line-height: 1;
    border: 1px solid #FFFFFF;
}












/* ========== PLAYLIST ACTIVE MODE: HIDE CATEGORY HEADERS ========== */
.content-section.playlist-mode-active .group-header {
    display: none !important;
}

.content-section.playlist-mode-active .audio-group {
    margin-bottom: 0 !important;
    border-bottom: none !important;
}


/* ========== COMPACT 2-COLUMN GRID VIEW ========== */
.content-section.grid-view .audio-group {

    display: block;
}

/* Display audio tracks in a compact 2-column grid on desktop */
@media (min-width: 768px) {
    .content-section.grid-view .audio-group {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 16px;
    }

    .content-section.grid-view .audio-group .group-header {
        grid-column: 1 / -1;
        margin-bottom: 0.5rem;
    }
}


/* ========== CONTENT ========== */
.content-section {
    padding: 30px 40px 140px;
    max-width: var(--section-max);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ========== AUDIO CATEGORY GROUPS ========== */
.audio-group {
    margin-bottom: 3.5rem;
    transition: opacity 0.3s;
}

.audio-group.group-hidden {
    display: none;
}

.audio-group:last-child { margin-bottom: 0; }

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 1.2rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--secondary);
}

.group-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.group-header .group-icon {
    font-size: 1.6rem;
}

.group-header h2 {
    margin-bottom: 0;
    font-size: clamp(1.4rem, 2.5vw, 1.8rem);
}

.group-save-all-btn {
    font-family: var(--font-button);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--primary);
    background: transparent;
    border: 1px solid rgba(92, 35, 35, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.group-save-all-btn:hover {
    background: var(--primary);
    color: #FFFFFF;
}

/* ========== TRACK ITEM ERGONOMICS WITH VISIBLE PLAY BUTTON ========== */
.audio-track {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: var(--card);
    padding: 14px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border-light);
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    user-select: none;
    cursor: pointer;
}

.audio-track.track-hidden {
    display: none !important;
}

.audio-track:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.06);
    border-color: rgba(184, 134, 11, 0.3);
    transform: translateY(-1px);
}

.audio-track.active-track {
    background: var(--card);
    border-left: 4px solid var(--accent);
    box-shadow: 0 4px 20px rgba(184, 134, 11, 0.12);
}

.audio-track.active-track .track-name {
    color: var(--accent);
    font-weight: 600;
}

/* Visible Play Action Button */
.track-index-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(92, 35, 35, 0.25);
    transition: all 0.2s ease;
}

.track-index-btn:hover {
    background: var(--accent);
    transform: scale(1.08);
}

.track-index-btn .play-icon {
    width: 20px;
    height: 20px;
    display: block;
    margin-left: 2px;
}

.track-index-btn .pause-icon {
    width: 20px;
    height: 20px;
}

.track-index-btn .track-num {
    display: none;
}

/* Playing Waveform Visualizer */
.playing-waveform {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 18px;
}

.playing-waveform span {
    width: 3px;
    background: #FFFFFF;
    border-radius: 2px;
    animation: soundWave 1.2s ease-in-out infinite alternate;
}

.playing-waveform span:nth-child(1) { height: 60%; animation-delay: 0s; }
.playing-waveform span:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.playing-waveform span:nth-child(3) { height: 40%; animation-delay: 0.4s; }

@keyframes soundWave {
    0% { height: 30%; }
    100% { height: 100%; }
}

/* Track Information */
.audio-track .track-info {
    flex: 1;
    min-width: 0;
}

.audio-track .track-name {
    font-weight: 500;
    font-size: 1rem;
    color: var(--text);
    line-height: 1.35;
    margin-bottom: 2px;
}

.audio-track .track-desc {
    font-size: 0.82rem;
    color: var(--muted);
}

/* Duration & Actions Right Column */
.track-actions-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.audio-track .track-duration {
    font-size: 0.8rem;
    color: var(--muted);
    white-space: nowrap;
    font-family: var(--font-button);
    background: rgba(0,0,0,0.03);
    padding: 4px 10px;
    border-radius: 6px;
}

/* Save Offline Button & Badge */
.save-offline-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--muted);
    padding: 5px 12px;
    border-radius: 20px;
    font-family: var(--font-button);
    font-size: 0.75rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.save-offline-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(184, 134, 11, 0.05);
}

.save-offline-btn.is-saved {
    background: rgba(143, 168, 138, 0.15);
    color: #4A7045;
    border-color: rgba(143, 168, 138, 0.4);
}

/* Subtle Download Icon Button */
.download-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.download-icon-btn:hover {
    background: var(--accent);
    color: #FFFFFF;
    border-color: var(--accent);
    transform: scale(1.1);
}

/* ========== PERSISTENT FLOATING PLAYER BAR ========== */
.audio-player-bar {
    position: fixed;
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 1100px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 10px 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 999;
    transition: bottom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.audio-player-bar.show {
    bottom: 20px;
}

.player-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Left Thumbnail & Info */
.player-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 200px;
    cursor: pointer;
}

.player-thumb {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.player-thumb .thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-track-details {
    overflow: hidden;
}

.player-track-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.player-track-category {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

/* Center Controls & Progress Bar */
.player-center {
    flex: 1;
    max-width: 540px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.player-primary-btns {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ctrl-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.ctrl-btn:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.ctrl-btn.active {
    color: var(--accent);
}

.player-play-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #FFFFFF;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(92, 35, 35, 0.3);
    transition: all 0.25s ease;
}

.player-play-btn:hover {
    transform: scale(1.08);
    background: var(--accent);
}

.player-play-btn svg {
    width: 20px;
    height: 20px;
}

.player-progress-row {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-time {
    font-family: var(--font-button);
    font-size: 0.72rem;
    color: var(--muted);
    min-width: 32px;
    text-align: center;
}

.player-progress-container {
    flex: 1;
    position: relative;
    height: 6px;
    display: flex;
    align-items: center;
}

.player-progress-bar {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(0,0,0,0.08);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.player-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.15s ease;
}

.player-progress-bar::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

.player-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    pointer-events: none;
    z-index: 1;
    width: 0%;
}

/* Right Controls (Sleep, Volume & Expand) */
.player-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-pill-btn {
    font-family: var(--font-button);
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(0,0,0,0.05);
    border: 1px solid var(--border-light);
    color: var(--text);
    padding: 4px 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-pill-btn:hover {
    background: var(--primary);
    color: #FFFFFF;
}

.player-volume-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
}

.player-volume-btn {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 4px;
}

.volume-slider {
    width: 65px;
    height: 4px;
    accent-color: var(--primary);
    cursor: pointer;
}

.player-expand-btn {
    background: rgba(184, 134, 11, 0.12);
    border: none;
    color: var(--accent);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-expand-btn:hover {
    background: var(--accent);
    color: #FFFFFF;
}

.player-close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: var(--muted);
    cursor: pointer;
    padding: 0 4px;
}

/* ========== FULLSCREEN AUDIO PLAYER DECK (MODAL) ========== */
.full-player-deck {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(100%);
}

.full-player-deck.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.deck-backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(92, 35, 35, 0.95) 0%, rgba(20, 10, 10, 0.98) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 0;
}

.deck-content {
    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px 24px 40px;
    max-width: 540px;
    margin: 0 auto;
    color: #FFFFFF;
}

/* Deck Header */
.deck-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.deck-collapse-btn,
.deck-save-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #FFFFFF;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.deck-collapse-btn:hover,
.deck-save-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.08);
}

.deck-header-info {
    text-align: center;
}

.deck-badge {
    font-family: var(--font-button);
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--secondary);
    display: block;
}

.deck-subtitle {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Static Artwork (No Rotation) */
.deck-visualizer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

.deck-vinyl-wrapper {
    width: 240px;
    height: 240px;
    border-radius: 24px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(216, 162, 62, 0.2);
    border: 4px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.deck-art-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.deck-soundwave {
    display: flex;
    gap: 4px;
    height: 24px;
    align-items: flex-end;
    margin-top: 20px;
}

.deck-soundwave span {
    width: 4px;
    background: var(--secondary);
    border-radius: 3px;
}

.full-player-deck.is-playing .deck-soundwave span {
    animation: soundWave 1s ease-in-out infinite alternate;
}

.deck-soundwave span:nth-child(1) { height: 40%; animation-delay: 0.1s; }
.deck-soundwave span:nth-child(2) { height: 70%; animation-delay: 0.3s; }
.deck-soundwave span:nth-child(3) { height: 100%; animation-delay: 0.5s; }
.deck-soundwave span:nth-child(4) { height: 50%; animation-delay: 0.2s; }
.deck-soundwave span:nth-child(5) { height: 85%; animation-delay: 0.4s; }
.deck-soundwave span:nth-child(6) { height: 35%; animation-delay: 0.6s; }

/* Deck Track Metadata */
.deck-track-meta {
    text-align: center;
}

.deck-track-title {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: #FFFFFF;
    margin-bottom: 4px;
}

.deck-track-desc {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Scrubber */
.deck-scrubber-wrapper {
    margin: 15px 0;
}

.deck-progress-container {
    position: relative;
    height: 8px;
    display: flex;
    align-items: center;
}

.deck-progress-bar {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.deck-progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--secondary);
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.deck-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--secondary);
    border-radius: 10px;
    pointer-events: none;
    z-index: 1;
    width: 0%;
}

.deck-time-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-button);
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
}

/* Deck Controls */
.deck-controls {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
}

.deck-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 10px;
    transition: all 0.2s ease;
}

.deck-btn:hover {
    color: #FFFFFF;
    transform: scale(1.1);
}

.deck-play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--secondary);
    color: #111;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(216, 162, 62, 0.4);
    transition: all 0.25s ease;
}

.deck-play-btn:hover {
    transform: scale(1.08);
    background: #FFFFFF;
}

.deck-play-btn svg {
    width: 28px;
    height: 28px;
}

/* Options Chips Row */
.deck-options-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
}

.deck-opt-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.deck-opt-chip {
    font-family: var(--font-button);
    font-size: 0.75rem;
    font-weight: 600;
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.deck-opt-chip:hover {
    background: var(--secondary);
    color: #111;
}

/* ========== RESPONSIVE DESIGN ========== */
.mobile-vertical-cat-rail {
    display: none !important;
}

@media (max-width: 768px) {
    /* Mobile Expandable Search Bar */
    .search-wrapper {
        display: none !important;
    }

    .search-wrapper.expanded {
        display: flex !important;
        position: absolute;
        left: 12px;
        right: 12px;
        top: 6px;
        z-index: 110;
        background: #FFFFFF;
        box-shadow: 0 6px 25px rgba(92, 35, 35, 0.22);
    }

    /* Full Screen Audio View by Default on Mobile: Hide Page Hero Completely to Free 100% Space */
    .page-hero {
        display: none !important;
    }


    .page-hero.expanded {
        display: block !important;
        padding: calc(var(--nav-height) + 12px) 14px 14px;
        text-align: center;
    }

    .page-hero h1 {
        font-size: 1.4rem;
        margin-bottom: 6px;
    }

    .page-hero p {
        font-size: 0.84rem;
        margin-bottom: 10px;
        padding: 0 8px;
    }

    .player-toolbar {
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
    }

    .toolbar-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .storage-info {
        font-size: 0.75rem;
    }



    /* On Mobile: Hide Desktop Horizontal Category & Playlist Bars (Mobile uses sticky left rail) */
    .category-chips-row,
    .playlists-row,
    .cat-browse-btn {
        display: none !important;
    }



    .sticky-player-header {
        position: sticky;
        top: var(--nav-height, 60px);
        z-index: 100;
        padding: 8px 12px;
        margin-bottom: 4px;
    }

    .audio-main-layout {
        display: flex;
        align-items: flex-start;
        gap: 6px;
        width: 100%;
        padding: 0 4px;
        box-sizing: border-box;
        position: relative;
    }

    .mobile-vertical-cat-rail {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        position: sticky;
        top: calc(var(--nav-height, 60px) + 62px);
        max-height: calc(100vh - var(--nav-height, 60px) - 130px);
        overflow-y: auto;
        overflow-x: hidden;
        width: 48px;
        flex-shrink: 0;
        padding: 8px 4px;
        box-sizing: border-box;
        background: rgba(250, 247, 240, 0.96);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1.5px solid rgba(92, 35, 35, 0.18);
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(92, 35, 35, 0.08);
        z-index: 90;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding 0.25s ease;
    }


    .mobile-vertical-cat-rail.expanded {
        width: 155px;
        align-items: stretch;
        padding: 10px 8px;
        border-radius: 18px;
        box-shadow: 0 10px 35px rgba(92, 35, 35, 0.3);
    }

    .v-rail-group {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        width: 100%;
    }

    .mobile-vertical-cat-rail.expanded .v-rail-group {
        align-items: stretch;
    }


    .mobile-vertical-cat-rail::-webkit-scrollbar {
        display: none !important;
    }

    .v-rail-toggle-btn {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        display: flex !important;
        align-items: center;
        justify-content: center;
        background: rgba(92, 35, 35, 0.08);
        border: 1.5px solid rgba(92, 35, 35, 0.2);
        color: var(--primary);
        font-size: 0.85rem;
        font-weight: 700;
        cursor: pointer;
        transition: all 0.25s ease;
        margin-bottom: 4px;
        flex-shrink: 0;
        align-self: center;
    }


    .v-rail-toggle-btn:hover {
        background: var(--primary);
        color: #FFFFFF;
    }

    .mobile-vertical-cat-rail.expanded .v-rail-toggle-btn {
        transform: rotate(180deg);
        width: 100%;
        border-radius: 10px;
    }

    .v-cat-btn {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: #FFFFFF;
        border: 1.5px solid rgba(92, 35, 35, 0.14);
        text-decoration: none;
        font-size: 1.05rem;
        flex-shrink: 0;
        transition: all 0.2s ease;
        box-shadow: 0 1px 4px rgba(92, 35, 35, 0.05);
        color: var(--text);
    }

    .v-cat-btn .v-txt {
        display: none;
    }

    .mobile-vertical-cat-rail.expanded .v-cat-btn {
        width: 100%;
        border-radius: 12px;
        justify-content: flex-start;
        padding: 6px 10px;
        gap: 8px;
        box-sizing: border-box;
    }

    .mobile-vertical-cat-rail.expanded .v-cat-btn .v-txt {
        display: inline-block;
        font-family: var(--font-button);
        font-size: 0.76rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .v-cat-btn.active {
        background: #D8A23E;
        color: #FFFFFF;
        border-color: #D8A23E;
        box-shadow: 0 3px 10px rgba(216, 162, 62, 0.4);
    }

    .v-rail-dots-btn {
        width: 38px;
        height: 38px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: var(--primary);
        color: #FFFFFF;
        border: none;
        font-size: 0.9rem;
        font-weight: 700;
        cursor: pointer;
        flex-shrink: 0;
        margin-top: 4px;
        box-shadow: 0 2px 8px rgba(92, 35, 35, 0.3);
        transition: all 0.2s ease;
        align-self: center;
    }

    .mobile-vertical-cat-rail.expanded .v-rail-dots-btn {
        width: 100%;
        border-radius: 12px;
    }

    .content-section {
        flex: 1;
        min-width: 0;
        padding: 0 2px 140px;
    }

    .group-header {
        margin-bottom: 1rem;
        padding-bottom: 0.6rem;
    }

    .group-header h2 {
        font-size: 1.25rem;
    }

    .group-save-all-btn {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    /* Floating Player Bar */
    .audio-player-bar {
        width: calc(100% - 16px);
        padding: 8px 12px;
        border-radius: 16px;
    }

    .player-container {
        gap: 10px;
    }

    .player-left {
        min-width: auto;
        max-width: 140px;
        gap: 8px;
    }

    .player-thumb {
        width: 38px;
        height: 38px;
        border-radius: 8px;
    }

    .player-track-name {
        font-size: 0.82rem;
        max-width: 110px;
    }

    .player-track-category {
        font-size: 0.7rem;
    }

    .player-center {
        max-width: 100%;
        gap: 2px;
    }

    .player-primary-btns {
        gap: 8px;
    }

    .ctrl-btn {
        padding: 4px;
    }

    .player-play-btn {
        width: 36px;
        height: 36px;
    }

    .player-play-btn svg {
        width: 18px;
        height: 18px;
    }

    .player-progress-row {
        gap: 6px;
    }

    .player-time {
        font-size: 0.68rem;
        min-width: 28px;
    }

    .player-right .player-volume-wrapper {
        display: none;
    }

    /* Category Drawer Modal on Mobile */
    .category-drawer-modal {
        position: fixed;
        top: auto;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 24px);
        max-width: 500px;
        padding: 16px 14px;
    }

    .drawer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
        max-height: 340px;
    }
}

@media (max-width: 600px) {
    /* Responsive Audio Track Card with 100% Top Title & Compact Bottom Action Bar */
    .audio-track {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-start;
        padding: 10px 12px;
        gap: 6px 0;
        border-radius: 12px;
        box-sizing: border-box;
    }

    /* Top Row: Track Title & Description takes 100% top width */
    .audio-track .track-info {
        order: 1;
        width: 100%;
        flex: 1 1 100%;
        min-width: 0;
        padding-bottom: 8px;
        border-bottom: 1px dashed rgba(92, 35, 35, 0.12);
        box-sizing: border-box;
    }

    .audio-track .track-name {
        font-size: 0.88rem;
        line-height: 1.35;
        font-weight: 600;
        color: var(--text);
        word-break: break-word;
    }

    .audio-track .track-desc {
        font-size: 0.76rem;
        margin-top: 2px;
    }

    /* Bottom Row Left: Play Button */
    .audio-track .track-index-btn {
        order: 2;
        margin: 6px 8px 0 0 !important;
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        border-radius: 50% !important;
        flex-shrink: 0;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        background: var(--primary) !important;
        color: #FFFFFF !important;
        box-shadow: 0 2px 6px rgba(92, 35, 35, 0.2);
    }

    .audio-track .track-index-btn svg {
        width: 14px;
        height: 14px;
        fill: currentColor;
    }

    /* Bottom Row Actions Group: Duration + Save + Download with clean 8px gap */
    .track-actions-right {
        order: 3;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 8px !important;
        margin: 6px 0 0 0 !important;
        padding: 0 !important;
        border: none !important;
        width: auto !important;
        flex-shrink: 0;
    }

    .track-actions-right .track-duration {
        font-family: var(--font-button);
        font-size: 0.72rem;
        color: var(--muted);
        padding: 3px 8px;
        background: rgba(92, 35, 35, 0.06);
        border-radius: 8px;
        white-space: nowrap;
        margin: 0 !important;
    }

    /* Icon-Only Save Button on Mobile Track Cards */
    .save-offline-btn {
        padding: 0 !important;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        font-size: 0.85rem;
        flex-shrink: 0;
        border: 1px solid rgba(92, 35, 35, 0.2) !important;
        background: #FFFFFF !important;
        color: var(--text) !important;
        margin: 0 !important;
    }

    .save-offline-btn .btn-text {
        display: none !important;
    }


    /* Compact Download Icon Button */
    .download-icon-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        padding: 0 !important;
        border-radius: 50% !important;
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        background: #FFFFFF !important;
        border: 1px solid rgba(92, 35, 35, 0.2) !important;
        color: var(--text) !important;
        margin: 0 !important;
    }

    .download-icon-btn svg {
        width: 14px;
        height: 14px;
    }
}





}

@media (max-width: 600px) {
    /* 2-Tier Responsive Audio Track Card */
    .audio-track {
        flex-wrap: wrap;
        padding: 12px 14px;
        gap: 10px 12px;
        border-radius: 10px;
    }

    .audio-track .track-info {
        flex: 1 1 calc(100% - 110px);
        min-width: 0;
    }

    .audio-track .track-name {
        font-size: 0.88rem;
        line-height: 1.35;
        word-break: break-word;
    }

    .audio-track .track-desc {
        font-size: 0.78rem;
    }

    .track-actions-right {
        width: 100%;
        justify-content: flex-end;
        padding-top: 6px;
        margin-top: 2px;
        border-top: 1px dashed rgba(92, 35, 35, 0.08);
    }
}

@media (max-width: 480px) {
    /* Extra Small Screen Adaptations */
    .page-hero h1 {
        font-size: 1.5rem;
    }

    .cat-grid-modal {
        width: calc(100% - 20px);
        padding: 14px 12px;
    }

    .cat-modal-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }

    .modal-cat-card {
        padding: 6px 2px;
    }

    .modal-cat-card .m-icon {
        font-size: 1.1rem;
    }

    .modal-cat-card .m-txt {
        font-size: 0.6rem;
    }

    .ctrl-btn.repeat-btn,
    .ctrl-btn.shuffle-btn {
        display: none;
    }

    .toast-container {
        right: 12px;
        left: 12px;
        width: auto;
    }

    .toast-message {
        max-width: 100%;
        font-size: 0.82rem;
        padding: 10px 14px;
    }
}



/* ========== VISUAL TOAST NOTIFICATIONS & SPINNER ========== */
.toast-container {
    position: fixed;
    top: calc(var(--nav-height) + 16px);
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-message {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--accent);
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: slideInToast 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), fadeOutToast 0.35s ease 3.6s forwards;
    max-width: 380px;
}

.toast-message.toast-success {
    border-left: 4px solid var(--accent);
}

.toast-message.toast-removed {
    border-left: 4px solid #D32F2F;
}

@keyframes slideInToast {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeOutToast {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Save Offline Saving Spinner State */
.save-offline-btn.is-saving {
    background: rgba(184, 134, 11, 0.12);
    color: var(--accent);
    border-color: var(--accent);
    cursor: wait;
}

.save-offline-btn.is-saving::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid var(--accent);
    border-top-color: transparent;
    border-radius: 50%;
    display: inline-block;
    animation: saveSpin 0.8s linear infinite;
    margin-left: 4px;
}

@keyframes saveSpin {
    to { transform: rotate(360deg); }
}

