html,
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    width: 100%;
    height: 500px;
    box-sizing: border-box;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Applied only in iframe mode - ensures full player visibility */
body.embedded {
    overflow-y: auto;
    height: 100%;
    min-height: 100%;
}

body.embedded html {
    height: 100%;
}

/* Prevent scrollbars in iframe */
iframe {
    overflow: hidden;
    border: none;
    display: block;
}

/* Player Wrapper - Contains both player and playlist */
.toa-player-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    height: 500px;
}

/* No Playlist Mode - Reduced height when 2 or fewer audio files */
html.no-playlist,
body.no-playlist {
    height: auto !important;
    min-height: unset !important;
    overflow: hidden !important;
    background: transparent !important;
}

body.no-playlist .toa-player-wrapper {
    height: auto !important;
    min-height: unset !important;
    max-height: fit-content !important;
}

body.no-playlist .toa-playlist-section {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Embedded mode: Expand to fill available iframe height */
body.embedded .toa-player-wrapper {
    height: 100%;
    min-height: 500px;
}


.toa-player-content {
    width: 100%;
    max-width: 100%;
    background: linear-gradient(135deg, #00a862 0%, #008e54 100%);
    color: white;
    padding: 12px 32px;
    box-sizing: border-box;
    border-bottom-left-radius: 20px;
    border-top-right-radius: 20px;
    overflow: visible;
    flex-shrink: 0;
}

/* Playlist Section (Below the player) */
.toa-playlist-section {
    width: 100%;
    padding: 1px 2px;
    background: #f8f9fa;
    box-sizing: border-box;
    flex: 1;
    /* Take remaining space of 500px */
    overflow-y: auto;
    /* Enable internal scrolling */
    min-height: 0;
    /* Allow flex shrinking if needed */
    scrollbar-width: thin;
    /* Firefox - thin scrollbar */
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    /* Firefox - thumb and track colors */
}

.toa-playlist-section::-webkit-scrollbar {
    width: 4px;
    /* Small scrollbar width */
}

.toa-playlist-section::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 2px;
}

.toa-playlist-section::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
}

.toa-playlist-section::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* Track Header */
.toa-track-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 5px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.toa-track-header .toa-download-btn {
    margin-left: auto;
    flex-shrink: 0;
}

.toa-track-header>.fa-music {
    font-size: 20px;
    opacity: 0.9;
}

.toa-music-icon-container {
    position: relative;
    margin-right: 12px;
}

.toa-music-icon-square {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toa-music-icon {
    width: 24px;
    height: 24px;
}

.toa-music-icon-fa {
    font-size: 20px;
    color: #00a862;
    display: block;
}

/* Now Playing Section */
.toa-now-playing {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
}

.toa-now-playing-content {
    display: flex;
    flex-direction: column;
}

.toa-track-header>.toa-up-next-label {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
}

.toa-track-title-container {
    flex: 1;
    overflow: hidden;
}

.toa-track-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    color: white;
    /* Truncation removed from desktop to keep it mobile-only */
}


.toa-menu-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s;
}

.toa-menu-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Download Button */
.toa-download-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    padding: 8px 16px;
    border-radius: 0;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.toa-download-btn i {
    font-size: 14px;
}

.toa-download-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.02);
}

/* Controls Wrapper */
.toa-controls-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 0;
}

/* Controls Row - New single row layout for Speed, Progress, Playback, Volume */
.toa-controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    margin-top: 8px;
}

/* Speed Control in controls row */
.toa-speed-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Volume Control in controls row */
.toa-volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    overflow: visible;
}

/* Left Controls */
.toa-left-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 140px;
}

.toa-label {
    font-size: 16px;
    color: white;
    font-weight: 400;
    /* padding-bottom: 20px; */
    /* opacity: 0.95; */
}

.toa-speed {
    padding: 12px 12px;
    border-radius: 8px;
    border: none;
    background-color: rgba(0, 0, 0, 0.2);
    background-color: #06482e;
    color: #ffffff;
    font-weight: 500;
    cursor: pointer;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
    min-width: 70px;
}

.toa-speed option {
    background-color: #06482e;
    color: #ffffff;
    padding: 8px;
}

/* Center Controls */
.toa-center-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-shrink: 0;
}

.toa-control-btn {
    width: 48px;
    height: 48px;
    background: white;
    border: 1px solid white;
    border-radius: 50%;
    color: black;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s ease-in-out;
    position: relative;
}

.toa-control-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

.toa-control-btn:active {
    transform: scale(0.95);
}

.toa-control-btn i {
    font-size: 30px;
    color: black;
}

.toa-skip-icon {
    width: 30px;
    height: 30px;
    color: black;
}

.toa-skip-icon.reverse {
    transform: rotate(360deg);
}

.toa-play-icon {
    width: 30px;
    height: 30px;
    color: white;
}

.toa-skip-text {
    font-size: 9px;
    font-weight: 700;
    color: black;
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.toa-play-btn {
    width: 48px;
    height: 48px;
    background: #1a532e;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); */
    /* transition: all 0.2s ease-in-out; */
}

.toa-play-btn:hover {
    transform: scale(1.05);
    /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); */
    background: #1a532e;
}

.toa-play-btn:active {
    transform: scale(0.98);
}

/* Speed and Volume Row */
.toa-speed-volume-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 16px;
    position: relative;
}

/* Right Controls */
.toa-right-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 180px;
    justify-content: flex-end;
    flex-shrink: 0;
    margin-left: auto;
}

/* Ensure download button and volume control align to same right edge for desktop/tablet */
/* This applies to all screen sizes above mobile (769px and above) */
@media (min-width: 769px) {
    /* Both download button and volume control should align to the same right edge */
    /* The container (.toa-player-content) has padding: 12px 32px, so both align to inner right edge */

    .toa-track-header {
        align-items: center;
        width: 100%;
        box-sizing: border-box;
    }

    .toa-track-header .toa-download-btn {
        margin-left: auto;
        margin-right: 0;
        flex-shrink: 0;
        order: 999;
        white-space: nowrap;
    }

    .toa-speed-volume-row {
        align-items: center;
        width: 100%;
        display: flex;
        justify-content: space-between;
        box-sizing: border-box;
        gap: 16px;
    }

    .toa-right-controls {
        margin-left: auto;
        margin-right: 0;
        flex-shrink: 0;
        justify-content: flex-end;
        align-items: center;
        display: flex;
        min-width: auto;
        gap: 12px;
    }

    /* Ensure volume slider aligns properly - thumb should align with download button right edge */
    .toa-volume {
        flex-shrink: 0;
        width: 120px;
    }

    /* Prevent left controls from pushing alignment */
    .toa-left-controls {
        flex-shrink: 1;
        min-width: auto;
    }

    /* Ensure consistent gap handling */
    .toa-track-header {
        gap: 16px;
    }
}

/* Maintain alignment for smaller desktop sizes */
@media (min-width: 769px) and (max-width: 1200px) {
    .toa-right-controls {
        min-width: auto;
        gap: 8px;
    }

    .toa-volume-control {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        overflow: visible;
    }

    .toa-volume {
        width: 100px;
        flex-shrink: 0;
    }

    .toa-left-controls {
        min-width: auto;
        flex-shrink: 1;
    }
}

/* Maintain alignment for tablet sizes */
@media (min-width: 769px) and (max-width: 900px) {
    .toa-right-controls {
        gap: 6px;
    }

    .toa-volume-control {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
        overflow: visible;
    }

    .toa-volume {
        width: 80px;
        flex-shrink: 0;
    }

    .toa-track-header .toa-download-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

.toa-volume-icon {
    width: 20px;
    height: 20px;
    display: block;
    filter: brightness(0) invert(1);
    /* Make icon white */
    transition: opacity 0.2s ease;
}

.toa-icon-btn {
    background: transparent;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background 0.2s, transform 0.2s;
}

.toa-icon-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

.toa-volume {
    width: 120px;
    height: 30px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.toa-volume::-webkit-slider-runnable-track {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(to right,
            #ffffff 0%,
            #ffffff var(--volume-progress, 100%),
            rgba(255, 255, 255, 0.3) var(--volume-progress, 100%),
            rgba(255, 255, 255, 0.3) 100%);
}

.toa-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    border: 1px solid #008e54;
    margin-top: -5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.toa-volume::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

.toa-volume::-moz-range-track {
    height: 12px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(to right,
            #ffffff 0%,
            #ffffff var(--volume-progress, 100%),
            rgba(255, 255, 255, 0.3) var(--volume-progress, 100%),
            rgba(255, 255, 255, 0.3) 100%);
}

.toa-volume::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.toa-volume::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

/* Progress Bar Row */
.toa-progress-wrapper {
    flex: 2.5;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 29px;
    min-width: 45%;
    overflow: visible;
    /* margin: 0 16px;   */
}

/* Adjust for 1150px width resolution */
@media (max-width: 1150px) and (min-width: 981px) {
    .toa-progress-wrapper {
        min-width: 25%;
    }
}

/* Reduce progress wrapper min-width for smaller screens below 998px */
@media (max-width: 998px) and (min-width: 769px) {
    .toa-progress-wrapper {
        min-width: 25%;
    }
}

.toa-progress {
    width: 100%;
}

.toa-track-title-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.toa-track-title {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.95;
    color: white;
}

.toa-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.toa-time {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.95;
    color: white;
}

.toa-progress {
    height: 6px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    margin: 0;
}

.toa-progress::-webkit-slider-runnable-track {
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(to right,
            #ffffff 0%,
            #ffffff var(--progress, 0%),
            rgba(255, 255, 255, 0.3) var(--progress, 0%),
            rgba(255, 255, 255, 0.3) 100%);
}

.toa-progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 1px solid #008e54;
    margin-top: -3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.toa-progress::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

.toa-progress::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(to right,
            #ffffff 0%,
            #ffffff var(--progress, 0%),
            rgba(255, 255, 255, 0.3) var(--progress, 0%),
            rgba(255, 255, 255, 0.3) 100%);
}

.toa-progress::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: white;
    border: 1px solid #008e54;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.toa-progress::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}


/* Playlist Section (Below the player) */
.toa-playlist-section {
    width: 100%;
    min-height: 280px;
    max-height: 280px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 1px 2px;
    background: #f8f9fa;
    box-sizing: border-box;
    flex-shrink: 0;
}

.toa-playlist-header {
    padding: 16px 20px;
    font-weight: 700;
    font-size: 16px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toa-playlist-close {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 20px;
    transition: all 0.2s;
}

.toa-playlist-close:hover {
    background: #e9ecef;
    color: #212529;
}

.toa-playlist-list {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Playlist Item Container */
.toa-playlist-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-radius: 10px;
    background: #d5eee4;
    /* Light grayish-green background */
    border: none;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    min-height: 60px;
}

.toa-playlist-item:hover {
    background: #f7f7f7;
}

.toa-playlist-item.active {
    background: #f1f1f1;
    /* White background for active/now playing */
}

/* Left Section: Icon + Text */
.toa-playlist-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    /* Required for text-overflow: ellipsis to work in flex children */
}

/* Icon Box */
.toa-playlist-icon-box {
    width: 36px;
    height: 36px;
    background: #00a862;
    /* Brand Green */
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toa-playlist-icon-box i {
    color: white;
    font-size: 18px;
}

/* Text Details */
.toa-playlist-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow: hidden;
    flex: 1;
}

.toa-playlist-title-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 2px;
    width: 100%;
}

.toa-now-playing-label {
    display: none;
    /* Hidden on desktop as requested */
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1;
}

.toa-playlist-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
    word-break: break-word;
}

.toa-playlist-now-playing {
    font-size: 10px;
    font-weight: 500;
    color: #889e94;
    /* Subtle gray-green from image */
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 30%;
    /* Pushed to the right */
}

.toa-playlist-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toa-playlist-duration {
    font-size: 12px;
    color: #666;
}


/* Play/Pause Button on Right */
.toa-playlist-action {
    margin-left: 16px;
    flex-shrink: 0;
}

.toa-playlist-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #00a862;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: transform 0.2s;
}

.toa-playlist-play-btn:hover {
    transform: scale(1.1);
    background: #008e54;
}

.toa-playlist-play-btn i {
    font-size: 14px;
}

/* Hide original elements if needed */
.toa-idx,
.toa-title {
    display: none;
}


/* Download Button */
.toa-download-btn {
    background: #06482e;
    border: none;
    padding: 10px 16px;
    border-radius: 0;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.2s, transform 0.2s;
    flex-shrink: 0;
    white-space: nowrap;
}

.toa-download-btn:hover {
    background: #164428;
    transform: scale(1.02);
}

.toa-download-btn:active {
    transform: scale(0.98);
}

.toa-download-btn i {
    font-size: 14px;
}

/* Bottom Player iframe support */
.toa-bottom-player {
    position: fixed;
    bottom: 0;
    left: 0;
    padding: 15px;
    width: 100%;
    height: 160px;
    border: 0;
    z-index: 9999;
    overflow: hidden;
}

/* Embedded player iframe styles - prevents scrollbars */
.toa-embedded-player {
    overflow: hidden !important;
    border: none !important;
    display: block;
    width: 100%;
    max-width: 100%;
}

/* LEFT SIDE - Legacy support */
.toa-left {
    flex: 1;
    margin-bottom: 10px;
}

/* ROW wrapper - Legacy support */
.toa-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* CENTER SECTION - Legacy support */
.toa-center {
    flex: 1.5;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
}

.toa-controls-row {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
}

/* Skip buttons - Legacy support */
.toa-skip-btn {
    background: rgba(255, 255, 255, 0.25);
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    color: white;
    cursor: pointer;
}

.toa-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.toa-ss {
    font-size: 11px;
    margin-left: 6px;
}

/* RIGHT SIDE - Legacy support */
.toa-right {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.toa-speed-label {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.95;
}

/* Mobile UI - 3 Row Layout (ONLY on mobile, desktop unchanged) */
@media (max-width: 768px) {

    /* Allow scrolling on mobile if needed - Default state */
    html,
    body {
        overflow: hidden !important;
        width: 100%;
        height: 100% !important;
    }

    /* No Playlist Mode for Mobile - MUST COME AFTER DEFAULT to override height */
    html.no-playlist,
    body.no-playlist {
        height: auto !important;
        min-height: unset !important;
        overflow: hidden !important;
        background: transparent !important;
    }

    body.no-playlist .toa-player-wrapper {
        height: auto !important;
        min-height: unset !important;
        max-height: fit-content !important;
    }

    body.no-playlist .toa-playlist-section {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Container: Stack rows vertically */
    .toa-player-content {
        display: flex;
        flex-direction: column;
        padding: 12px 16px !important;
        background: linear-gradient(135deg, #00a862 0%, #008e54 100%);
        overflow: hidden;
        min-height: auto;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Row 1: Music Icon + Title (Left) | Download Icon (Right) */
    .toa-track-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        margin: 0;
        padding: 0;
        order: 1;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    .toa-download-btn {
        height: 36px;
        padding: 0 12px;
        font-size: 11px;
        gap: 6px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }

    .toa-download-btn span {
        display: inline;
    }

    .toa-now-playing {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .toa-music-icon-square {
        width: 36px;
        height: 36px;
        background: white;
        border-radius: 5px;
        flex-shrink: 0;
    }

    .toa-music-icon-fa {
        color: #00a862;
        font-size: 16px;
    }

    .toa-download-btn i {
        font-size: 16px;
    }

    .toa-track-title-container {
        flex: 1;
        min-width: 0;
    }

    .toa-track-title {
        font-size: 14px;
        font-weight: 600;
        color: white !important;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        visibility: visible;
    }

    .toa-download-btn {
        background: #06482e;
        border: none;
        border-radius: 5px;
        color: white;
        flex-shrink: 0;
    }


    .toa-download-btn:hover {
        background: #164428;
    }

    .toa-download-btn span {
        display: inline;
        font-size: 11px;
    }

    .toa-download-btn i {
        font-size: 12px;
    }

    /* Controls Container - Splits into Row 2 (Progress) and Row 3 (Speed/Playback) */
    .toa-controls-row {
        display: flex;
        flex-wrap: wrap;
        /* Allows wrapping into rows */
        align-items: center;
        justify-content: space-between;
        gap: 0px;
        order: 2;
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* Row 2: Progress Section - Enforce Full Width */
    .toa-progress-wrapper {
        order: 1;
        /* First row after header */
        flex: 1 0 100%;
        /* Force take full width of container */
        display: flex;
        flex-direction: column;
        justify-content: center;
        margin: 8px 0;
        padding: 0;
        box-sizing: border-box;
        overflow: visible;
        min-width: 0;
    }

    .toa-progress {
        width: 100%;
        height: 36px;
        /* Match other controls height */
        background: transparent;
        margin: 0;
        cursor: pointer;
    }

    /* Thicker pill track for Progress Bar */
    .toa-progress::-webkit-slider-runnable-track {
        height: 12px;
        border-radius: 999px;
        background: linear-gradient(to right,
                #ffffff 0%,
                #ffffff var(--progress, 0%),
                rgba(255, 255, 255, 0.3) var(--progress, 0%),
                rgba(255, 255, 255, 0.3) 100%);
    }

    .toa-progress::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: white;
        border: 2px solid #008e54;
        margin-top: -4px;
        /* Center in 12px track */
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
        cursor: pointer;
    }

    .toa-time-row {
        display: flex;
        justify-content: space-between;
        width: 100%;
        margin-top: -8px;
        /* Pull times closer to bar */
        pointer-events: none;
    }

    .toa-time {
        font-size: 10px;
        font-weight: 500;
        color: white;
        opacity: 0.9;
        white-space: nowrap;
    }

    /* Row 3: Controls (Speed and Playback) */
    .toa-speed-control {
        order: 2;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .toa-center-controls {
        order: 3;
        display: flex;
        align-items: center;
        gap: 10px;
        margin-left: auto;
        /* Push playback controls to the right */
        flex-shrink: 0;
    }

    /* Speed and Volume Row - Mobile */
    .toa-speed-volume-row {
        grid-row: 2;
        grid-column: 1;
        display: flex;
        align-items: center;
        gap: 4px;
        justify-self: start;
        flex-shrink: 0;
        overflow: hidden;
        max-width: 100%;
    }

    /* Left Controls - Speed */
    .toa-left-controls {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }

    /* Row 3: Volume (Right) - Hidden on mobile */
    .toa-right-controls,
    .toa-volume-control {
        display: none !important;
    }

    .toa-label {
        font-size: 12px;
        font-weight: 500;
        color: white;
        white-space: nowrap;
        flex-shrink: 0;
        display: inline-block;
    }

    .toa-speed {
        padding: 0 24px 0 8px;
        /* Removed vertical padding, use height */
        height: 36px;
        border-radius: 6px;
        border: 1px solid rgba(255, 255, 255, 0.3);
        background-color: #06482e;
        color: white;
        font-size: 13px;
        font-weight: 500;
        min-width: 60px;
        flex-shrink: 0;
        appearance: none;
        box-sizing: border-box;
        background-image: url("data:image/svg+xml,%3Csvg width='8' height='5' viewBox='0 0 8 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L4 4L7 1' stroke='%23ffffff' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 8px center;
        background-size: 8px 5px;
    }

    .toa-speed option {
        background-color: #06482e;
        color: black;
        padding: 8px;
    }

    .toa-skip-text {
        font-size: 7px;
        color: black;
    }

    /* Right: Volume Control */
    .toa-right-controls {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .toa-icon-btn {
        width: 36px;
        height: 36px;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 8px;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .toa-volume-icon {
        width: 16px;
        height: 16px;
        filter: brightness(0) invert(1);
        display: block;
    }

    .toa-volume {
        width: 80px;
        height: 6px;
        flex-shrink: 0;
        min-width: 60px;
        max-width: 100px;
    }

    /* Playlist Drawer */
    .toa-playlist-drawer {
        right: 12px;
        left: 12px;
        width: auto;
    }

    /* Mobile specific playlist refinements */
    .toa-playlist-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 1;
        min-width: 0;
    }

    .toa-playlist-now-playing {
        margin-left: auto;
    }

    .toa-playlist-now-playing::after {
        content: "......";
    }
}

/* Extra small devices (320px - 430px) */
@media (max-width: 430px) {

    html,
    body {
        overflow: hidden !important;
    }

    .toa-player-content {
        padding: 10px 12px !important;
        /* gap: 6px; */
        overflow: hidden;
        max-width: 100%;
    }

    .toa-track-header {
        gap: 6px;
    }

    .toa-now-playing {
        gap: 6px;
    }

    .toa-music-icon-square {
        width: 32px;
        height: 32px;
        background: white;
    }

    .toa-music-icon-fa {
        font-size: 14px;
        color: #00a862;
    }

    .toa-download-btn i {
        font-size: 14px;
    }

    .toa-now-playing-label {
        display: block;
        /* Visible on mobile */
        font-size: 9px;
        color: rgba(255, 255, 255, 0.8);
    }

    .toa-track-title {
        font-size: 13px;
    }

    .toa-download-btn {
        background: #06482e;
        padding: 5px 8px;
        font-size: 10px;
        gap: 4px;
    }

    .toa-download-btn:hover {
        background: #164428;
    }

    .toa-download-btn span {
        display: inline;
        font-size: 10px;
    }

    .toa-download-btn i {
        font-size: 14px;
    }

    .toa-controls-wrapper {
        gap: 0px;
    }

    .toa-controls-row {
        flex-wrap: wrap;
        /* Keep Row 2 and Row 3 wrapped */
        gap: 0px;
    }

    .toa-control-btn {
        width: 40px;
        height: 40px;
        background: white;
        border: none;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

    .toa-control-btn i {
        font-size: 24px;
        color: black;
    }

    .toa-play-btn {
        width: 52px;
        height: 52px;
        background: #1a532e;
        border: none;
        border-radius: 50%;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .toa-play-icon {
        width: 28px;
        height: 28px;
        color: white;
    }

    .toa-skip-icon {
        width: 30px;
        height: 30px;
        color: black;
    }

    .toa-skip-text {
        color: black;
    }

    .toa-skip-icon {
        width: 30px;
        height: 30px;
    }

    .toa-label {
        font-size: 12px;
        color: white;
    }

    .toa-speed {
        height: 32px;
        padding: 0 20px 0 6px;
        font-size: 11px;
        min-width: 50px;
        background-color: #06482e;
    }

    .toa-left-controls {
        gap: 4px;
    }

    .toa-right-controls {
        gap: 4px;
    }

    .toa-icon-btn {
        width: 32px;
        height: 32px;
    }

    .toa-volume {
        width: 60px;
        min-width: 50px;
        max-width: 80px;
    }

    .toa-time {
        font-size: 11px;
    }
}

/* Medium mobile devices (540px) */
@media (max-width: 540px) {

    html,
    body {
        overflow: hidden !important;
    }

    .toa-player-content {
        padding: 10px 12px !important;
        /* gap: 8px; */
        overflow: hidden;
        max-width: 100%;
        display: flex;
        flex-direction: column;
    }

    /* Row 1: Track Header (Icon, Title, Download) on Top */
    .toa-track-header {
        order: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
    }

    .toa-music-icon-square {
        width: 34px;
        height: 34px;
        border-radius: 5px;
    }

    .toa-download-btn {
        padding: 6px;
        width: 34px;
        height: 34px;
        border-radius: 5px;
        gap: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .toa-download-btn span {
        display: none;
    }

    /* Row 2: Progress & Row 3: Controls */
    .toa-controls-row {
        order: 2;
        display: flex;
        flex-wrap: wrap;
        /* Group Progress (Row 2) and Controls (Row 3) */
        align-items: center;
        width: 100%;
        gap: 0px;
        margin-top: 3px;
    }

    /* Hide volume control on mobile */
    .toa-volume-control {
        display: none;
    }

    /* Playlist section mobile styles */
    .toa-playlist-section {
        min-height: 200px;
        max-height: 200px;
        padding: 1px 2px;
    }

    .toa-playlist-list {
        gap: 0px;
    }

    .toa-playlist-item {
        padding: 8px 10px;
        gap: 8px;
    }

    .toa-playlist-icon-box {
        width: 32px;
        height: 32px;
        min-width: 32px;
    }

    .toa-playlist-icon-box i {
        font-size: 12px;
    }

    .toa-playlist-details {
        overflow: hidden;
    }

    .toa-playlist-title {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .toa-playlist-meta {
        font-size: 10px;
    }

    .toa-playlist-duration {
        font-size: 10px;
    }

    .toa-playlist-play-btn {
        width: 28px;
        height: 28px;
    }

    .toa-controls-wrapper {
        gap: 0px;
    }

    .toa-left-controls {
        gap: 4px;
    }

    .toa-center-controls {
        gap: 5px;
    }

    .toa-speed-control {
        margin-right: 2px;
    }

    .toa-speed {
        height: 32px;
        padding: 0 4px;
        font-size: 11px;
        min-width: 40px;
        background-color: #06482e;
        max-width: 60px;
    }

    /* Row 2 Styling for 540px - Enforce Full Width */
    .toa-progress-wrapper {
        flex: 1 0 100%;
        margin: 8px 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        order: 1;
    }

    .toa-progress {
        height: 5px;
        width: 100%;
    }

    .toa-time-row {
        margin-top: 1px;
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    .toa-time {
        font-size: 9px;
    }

    /* Row 3 Styling for 540px */
    .toa-speed-control {
        order: 2;
        /* Row 3 Left */
    }

    .toa-center-controls {
        order: 3;
        /* Row 3 Right */
        margin-left: auto;
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .toa-control-btn {
        width: 40px;
        height: 40px;
    }

    .toa-play-btn {
        width: 52px;
        height: 52px;
    }

    .toa-play-icon {
        width: 28px;
        height: 28px;
    }

    .toa-skip-icon {
        width: 30px;
        height: 30px;
    }

    /* Compact Download Button for Mobile - Hide text, keep icon */
    .toa-download-btn {
        padding: 6px;
        width: 36px;
        height: 36px;
        border-radius: 5px;
        gap: 0;
    }

    .toa-download-btn span {
        display: none !important;
    }

    .toa-download-btn i {
        font-size: 14px;
        margin: 0;
    }

}

/* Small mobile devices (320px) */
@media (max-width: 320px) {
    .toa-player-content {
        padding: 4px 6px !important;
    }

    .toa-track-title {
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .toa-speed {
        font-size: 9px;
        min-width: 40px;
    }

    .toa-time {
        font-size: 8px;
    }

    .toa-center-controls {
        gap: 4px;
    }

    .toa-control-btn {
        width: 24px;
        height: 24px;
    }

    .toa-play-btn {
        width: 32px;
        height: 32px;
    }

    .toa-play-icon {
        width: 14px;
        height: 14px;
    }

    .toa-skip-icon {
        width: 20px;
        height: 20px;
    }

    /* Smaller playlist font for very small screens */
    .toa-playlist-title {
        font-size: 10px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}