.hex-audio-bar {
    --hex-audio-red: #EB5A4A;
    --hex-audio-red-dark: #d44e3f;
    --hex-audio-track: #e8e6e4;
    --hex-audio-text: #1a1a1a;
    --hex-audio-muted: #6b6b6b;
    --hex-audio-height: 65px;
    position: relative;
    width: 100%;
    height: var(--hex-audio-height);
    display: flex;
    align-items: center;
    background: #fff;
    border-top: 1px solid #eceae8;
    border-bottom: 1px solid #eceae8;
    box-sizing: border-box;
    font-family: 'Poppins', 'Raleway', sans-serif;
    z-index: 1040;
}

#hex-audio-inline {
    margin-top: -140px;
    margin-bottom: 160px;
}

.hex-audio-bar--sticky {
    width: 100%;
    border-top: 1px solid #ddd;
    border-bottom: none;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

.hex-audio-pending-restore .hex-audio-bar--sticky {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.hex-audio-bar--sticky.is-visible {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.hex-audio-bar__anchor {
    flex: 0 0 8px;
    align-self: stretch;
    background: var(--hex-audio-red);
}

.hex-audio-bar__inner {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 20px 0 18px;
    min-width: 0;
    height: 100%;
}

.hex-audio-bar__play {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--hex-audio-red);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, transform 0.15s ease;
}

.hex-audio-bar__play:hover {
    background: var(--hex-audio-red-dark);
}

.hex-audio-bar__play:active {
    transform: scale(0.95);
}

.hex-audio-bar__play svg {
    width: 14px;
    height: 14px;
    display: block;
}

.hex-audio-bar__play .hex-audio-icon-pause {
    display: none;
}

.hex-audio-bar.is-playing .hex-audio-bar__play .hex-audio-icon-play {
    display: none;
}

.hex-audio-bar.is-playing .hex-audio-bar__play .hex-audio-icon-pause {
    display: block;
}

.hex-audio-bar__waveform-wrap {
    flex: 0 1 180px;
    min-width: 80px;
    max-width: 220px;
    height: 36px;
    display: flex;
    align-items: center;
}

.hex-audio-bar__waveform {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2px;
    width: 100%;
    height: 100%;
    cursor: default;
}

.hex-audio-bar.is-active .hex-audio-bar__waveform {
    cursor: pointer;
}

.hex-audio-bar__wave-bar {
    flex: 1;
    max-width: 4px;
    border-radius: 2px;
    background: var(--hex-audio-track);
    transition: background 0.1s linear;
}

.hex-audio-bar__text {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 14px;
    line-height: 1.35;
    color: var(--hex-audio-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hex-audio-bar__controls {
    display: none;
    align-items: center;
    gap: 12px;
    flex: 1 1 200px;
    min-width: 120px;
    max-width: 360px;
}

.hex-audio-bar.is-active .hex-audio-bar__controls {
    display: flex;
}

.hex-audio-bar.is-active .hex-audio-bar__waveform-wrap {
    display: none;
}

.hex-audio-bar__seek {
    flex: 1;
    position: relative;
    height: 32px;
    display: flex;
    align-items: center;
    min-width: 80px;
}

.hex-audio-bar__seek-track {
    position: absolute;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--hex-audio-track);
    border-radius: 2px;
    pointer-events: none;
}

.hex-audio-bar__seek-fill {
    position: absolute;
    left: 0;
    height: 4px;
    width: 0;
    background: var(--hex-audio-red);
    border-radius: 2px;
    pointer-events: none;
}

.hex-audio-bar__seek-input {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    z-index: 3;
    width: 100%;
    height: 32px;
    margin: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    touch-action: none;
    transform: translateY(-50%);
    accent-color: #EB5A4A;
}

.hex-audio-bar__seek-input:focus {
    outline: none;
}

.hex-audio-bar__seek-input:focus-visible {
    outline: 2px solid rgba(235, 90, 74, 0.45);
    outline-offset: 2px;
    border-radius: 4px;
}

.hex-audio-bar__seek-input::-webkit-slider-runnable-track {
    height: 4px;
    background: transparent;
    border: none;
    border-radius: 2px;
}

.hex-audio-bar__seek-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border-radius: 50%;
    background: var(--hex-audio-red);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    cursor: grab;
}

.hex-audio-bar__seek-input:active::-webkit-slider-thumb {
    cursor: grabbing;
    transform: scale(1.12);
}

.hex-audio-bar__seek-input::-moz-range-track {
    height: 4px;
    background: transparent;
    border: none;
    border-radius: 2px;
}

.hex-audio-bar__seek-input::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--hex-audio-red);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    cursor: grab;
}

.hex-audio-bar__seek.is-dragging .hex-audio-bar__seek-input::-webkit-slider-thumb,
.hex-audio-bar__seek.is-dragging .hex-audio-bar__seek-input::-moz-range-thumb {
    cursor: grabbing;
    transform: scale(1.12);
}

.hex-audio-bar__time {
    flex: 0 0 auto;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: var(--hex-audio-muted);
    white-space: nowrap;
}

.hex-audio-bar__close {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--hex-audio-muted);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s ease, color 0.2s ease;
}

.hex-audio-bar.is-active .hex-audio-bar__close {
    display: flex;
}

.hex-audio-bar__close:hover {
    background: #f0eeec;
    color: var(--hex-audio-text);
}

.hex-audio-bar__close svg {
    width: 14px;
    height: 14px;
}

.hex-audio-bar--popup {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    border-top: 1px solid #ddd;
    border-bottom: none;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
}

#hex-audio-shell {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10050;
    pointer-events: none;
}

#hex-audio-shell .hex-audio-bar {
    pointer-events: auto;
}

body.hex-audio-sticky-active,
html.hex-audio-pending-restore body {
    padding-bottom: var(--hex-audio-height);
}

@media (max-width: 767px) {
    .hex-audio-bar {
        --hex-audio-height: 60px;
    }

    .hex-audio-bar__inner {
        gap: 10px;
        padding: 0 12px 0 14px;
    }

    .hex-audio-bar__play {
        flex: 0 0 36px;
        width: 36px;
        height: 36px;
    }

    .hex-audio-bar__waveform-wrap {
        flex: 0 1 100px;
        min-width: 60px;
    }

    .hex-audio-bar__text {
        font-size: 12px;
    }

    .hex-audio-bar__controls {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        gap: 8px;
    }

    .hex-audio-bar__seek {
        min-width: 64px;
    }

    .hex-audio-bar.is-active .hex-audio-bar__text {
        display: none;
    }
}

@media (max-width: 480px) {
    .hex-audio-bar:not(.is-active) .hex-audio-bar__waveform-wrap {
        display: none;
    }
}
