/* ============================================================
   LineageCare Elementor Pack — Video Playlist Pro
   Light-theme default, fully customisable via Style tab.
   ============================================================ */

/* ── Reset ──────────────────────────────────────────────── */
.lceap-vpl-wrap *,
.lceap-vpl-wrap *::before,
.lceap-vpl-wrap *::after {
    box-sizing: border-box;
}

/* ── Widget Shell ────────────────────────────────────────── */
.lceap-vpl-wrap {
    /* ── Customisable design tokens (overridden by Elementor Style controls) ──
       Every color used anywhere inside the widget has a variable here.
       Defaults produce the light theme; every token is overridable from
       the Elementor Style tab so no color is ever "stuck". */

    /* Backgrounds */
    --lceap-vpl-wrapper-bg:       #ffffff;
    --lceap-vpl-featured-bg:      #f4f6fb;
    --lceap-vpl-sidebar-bg:       #ffffff;
    --lceap-vpl-mini-bg:          #1a1a2e;
    --lceap-vpl-item-bg:          #f7f8fc;
    --lceap-vpl-active-bg:        #4a90e2;
    --lceap-vpl-item-hover-bg:    #eef2fb;

    /* Accent / brand */
    --lceap-vpl-accent:           #4a90e2;
    --lceap-vpl-accent-hover:     #2f78d4;
    --lceap-vpl-like-active:      #ff6b8a;

    /* Structural */
    --lceap-vpl-radius:           20px;
    --lceap-vpl-shadow:           0 8px 40px rgba(0,0,0,0.10);
    --lceap-vpl-border-color:     #f0f2f8;
    --lceap-vpl-scrollbar:        #e0e3f0;

    /* Featured area text */
    --lceap-vpl-heading-text:     #1a1a2e;
    --lceap-vpl-body-text:        #666885;
    --lceap-vpl-desc-text:        #7a7d98;
    --lceap-vpl-meta-text:        #888aab;
    --lceap-vpl-dot-text:         #c0c2d5;

    /* Playlist item text */
    --lceap-vpl-item-title-text:  #1a1a2e;
    --lceap-vpl-item-sub-text:    #888aab;
    --lceap-vpl-duration-text:    #aab0cc;

    /* Active item text */
    --lceap-vpl-active-text:      #ffffff;
    --lceap-vpl-active-text-dim:  rgba(255,255,255,0.75);
    --lceap-vpl-active-text-faint:rgba(255,255,255,0.65);

    /* Item icon area */
    --lceap-vpl-icon-bg:          rgba(74,144,226,0.12);
    --lceap-vpl-icon-bg-hover:    rgba(74,144,226,0.22);
    --lceap-vpl-icon-bg-active:   rgba(255,255,255,0.20);

    /* Wave bars */
    --lceap-vpl-wave-color:       #ffffff;
    --lceap-vpl-wave-overlay:     rgba(0,0,0,0.30);

    /* Button text (play-now, badge, play-main icon) */
    --lceap-vpl-btn-text:         #ffffff;

    /* Mini player */
    --lceap-vpl-mini-text:        #ffffff;
    --lceap-vpl-mini-subtitle:    rgba(255,255,255,0.55);
    --lceap-vpl-mini-icon:        #ffffff;
    --lceap-vpl-mini-hover-bg:    rgba(255,255,255,0.12);

    /* Progress */
    --lceap-vpl-progress-track-bg:rgba(255,255,255,0.20);

    /* Active item card shadow (tablet card mode) */
    --lceap-vpl-active-shadow:    rgba(74,144,226,0.30);

    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background-color: var(--lceap-vpl-wrapper-bg);
    border-radius: var(--lceap-vpl-radius);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-shadow: var(--lceap-vpl-shadow);
}

/* ── Body (featured + sidebar) ───────────────────────────── */
.lceap-vpl-body {
    display: flex;
    flex: 1;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

/* ── Sidebar left variant ────────────────────────────────── */
.lceap-vpl-side-left .lceap-vpl-body {
    flex-direction: row-reverse;
}

/* ─────────────────────────────────────────────────────────── */
/* FEATURED AREA                                               */
/* ─────────────────────────────────────────────────────────── */
.lceap-vpl-featured {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--lceap-vpl-featured-bg);
    padding: 28px 28px 24px;
    position: relative;
    min-width: 0;
    box-sizing: border-box;
}

.lceap-vpl-feat-top-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.lceap-vpl-user-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--lceap-vpl-meta-text);
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.lceap-vpl-featured-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--lceap-vpl-heading-text);
    line-height: 1.2;
    margin: 0 0 4px;
    letter-spacing: -0.5px;
    /* Prevent long titles from expanding the widget horizontally */
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.lceap-vpl-featured-subtitle {
    font-size: 14px;
    font-weight: 500;
    color: var(--lceap-vpl-body-text);
    margin: 0 0 8px;
    overflow-wrap: break-word;
    word-break: break-word;
    min-width: 0;
}

.lceap-vpl-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.lceap-vpl-meta-item {
    font-size: 12px;
    color: var(--lceap-vpl-meta-text);
    font-weight: 500;
}

.lceap-vpl-meta-dot {
    color: var(--lceap-vpl-dot-text);
    font-size: 12px;
}

.lceap-vpl-featured-desc {
    font-size: 13px;
    line-height: 1.6;
    color: var(--lceap-vpl-desc-text);
    margin: 0 0 16px;
    max-width: 380px;
}

/* ── Featured Media (thumbnail / iframe) ─────────────────── */
/* ── Featured media wrapper — always 16:9, never portrait ── */
.lceap-vpl-feat-media {
    position: relative;
    /* aspect-ratio locks the player to 16:9 at every viewport width.
       flex:none prevents the flex parent from stretching it taller. */
    flex: none;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
    max-height: none;
    margin-bottom: 20px;
}

.lceap-vpl-feat-thumb-wrap {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.lceap-vpl-feat-thumb {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.lceap-vpl-feat-thumb:hover {
    transform: scale(1.01);
}

.lceap-vpl-feat-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,0.12) 0%, rgba(0,0,0,0.35) 100%);
    border-radius: inherit;
    transition: background 0.3s ease;
    pointer-events: none; /* Never intercept clicks — play button and thumb-screen handle them */
}

.lceap-vpl-feat-thumb:hover .lceap-vpl-feat-overlay {
    background: linear-gradient(135deg, rgba(0,0,0,0.18) 0%, rgba(0,0,0,0.45) 100%);
}

.lceap-vpl-play-main {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: var(--lceap-vpl-accent);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 24px rgba(74,144,226,0.55);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lceap-vpl-play-main:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 8px 32px rgba(74,144,226,0.70);
}

.lceap-vpl-play-main svg {
    width: 26px;
    height: 26px;
    fill: var(--lceap-vpl-btn-text);
    margin-left: 3px;
}

/* iframe container — fills the 16:9 box absolutely */
.lceap-vpl-iframe-wrap {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    overflow: hidden;
    z-index: 5;
    width: 100%;
    height: 100%;
}

.lceap-vpl-iframe-wrap iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ── Play Now Button ─────────────────────────────────────── */
.lceap-vpl-play-now-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background-color: var(--lceap-vpl-accent);
    color: var(--lceap-vpl-btn-text);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    align-self: flex-start;
    max-width: 100%;
    box-sizing: border-box;
    transition: background-color 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 16px rgba(74,144,226,0.35);
}

.lceap-vpl-play-now-btn:hover {
    background-color: var(--lceap-vpl-accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(74,144,226,0.45);
}

/* ─────────────────────────────────────────────────────────── */
/* SIDEBAR / PLAYLIST                                          */
/* ─────────────────────────────────────────────────────────── */
.lceap-vpl-sidebar {
    flex: 0 0 36%;
    max-width: 36%;
    background-color: var(--lceap-vpl-sidebar-bg);
    display: flex;
    flex-direction: column;
    padding: 24px 16px 16px;
    border-left: 1px solid var(--lceap-vpl-border-color);
    min-width: 0;
    box-sizing: border-box;
}

.lceap-vpl-side-left .lceap-vpl-sidebar {
    border-left: none;
    border-right: 1px solid var(--lceap-vpl-border-color);
}

.lceap-vpl-sidebar-heading {
    font-size: 14px;
    font-weight: 700;
    color: var(--lceap-vpl-heading-text);
    margin: 0 0 14px;
    letter-spacing: 0.2px;
    padding: 0 4px;
}

/* ── Scrollable list ─────────────────────────────────────── */
.lceap-vpl-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: 420px;
    scrollbar-width: thin;
    scrollbar-color: var(--lceap-vpl-scrollbar) transparent;
    padding-right: 2px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.lceap-vpl-list::-webkit-scrollbar {
    width: 4px;
}

.lceap-vpl-list::-webkit-scrollbar-thumb {
    background: var(--lceap-vpl-scrollbar);
    border-radius: 4px;
}

/* ── Playlist Item ───────────────────────────────────────── */
.lceap-vpl-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background-color: var(--lceap-vpl-item-bg);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    transition: background-color 0.2s ease, transform 0.15s ease;
    position: relative;
}

.lceap-vpl-item:not(.is-active):hover {
    background-color: var(--lceap-vpl-item-hover-bg);
    transform: translateX(2px);
}

.lceap-vpl-item.is-active {
    background-color: var(--lceap-vpl-active-bg);
}

/* item number */
.lceap-vpl-item-num {
    font-size: 11px;
    font-weight: 700;
    color: var(--lceap-vpl-meta-text);
    min-width: 22px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.5px;
}

.lceap-vpl-item.is-active .lceap-vpl-item-num {
    color: var(--lceap-vpl-active-text-faint);
}

/* item thumbnail */
.lceap-vpl-item-thumb {
    width: 52px;
    height: 52px;
    min-width: 52px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

/* badge on thumbnail */
.lceap-vpl-badge {
    position: absolute;
    top: 3px;
    left: 3px;
    background-color: var(--lceap-vpl-accent);
    color: var(--lceap-vpl-btn-text);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1;
}

/* ── Wave bars animation (active track) ─────────────────── */
.lceap-vpl-wave-bars {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    padding-bottom: 6px;
    background: var(--lceap-vpl-wave-overlay);
}

.lceap-vpl-wave-bars span {
    display: block;
    width: 3px;
    border-radius: 2px;
    background: var(--lceap-vpl-wave-color);
    animation: lceap-vpl-wave 0.9s ease-in-out infinite;
}

.lceap-vpl-wave-bars span:nth-child(1) { animation-delay: 0s;    height: 8px; }
.lceap-vpl-wave-bars span:nth-child(2) { animation-delay: 0.15s; height: 14px; }
.lceap-vpl-wave-bars span:nth-child(3) { animation-delay: 0.3s;  height: 10px; }
.lceap-vpl-wave-bars span:nth-child(4) { animation-delay: 0.45s; height: 6px; }

@keyframes lceap-vpl-wave {
    0%, 100% { transform: scaleY(1); }
    50%       { transform: scaleY(1.8); }
}

/* item info */
.lceap-vpl-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.lceap-vpl-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--lceap-vpl-item-title-text);
    /* Wrap into at most 2 lines then truncate — no horizontal overflow */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    line-height: 1.3;
    max-height: calc(1.3em * 2);
    transition: color 0.2s ease;
}

.lceap-vpl-item-subtitle {
    font-size: 11px;
    color: var(--lceap-vpl-item-sub-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    line-height: 1.3;
    transition: color 0.2s ease;
}

.lceap-vpl-item.is-active .lceap-vpl-item-title {
    color: var(--lceap-vpl-active-text);
}

.lceap-vpl-item.is-active .lceap-vpl-item-subtitle {
    color: var(--lceap-vpl-active-text-dim);
}

/* item right-side controls */
.lceap-vpl-item-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.lceap-vpl-item-duration {
    font-size: 10px;
    color: var(--lceap-vpl-duration-text);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.lceap-vpl-item.is-active .lceap-vpl-item-duration {
    color: var(--lceap-vpl-active-text-faint);
}

.lceap-vpl-item-play-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--lceap-vpl-icon-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.lceap-vpl-item.is-active .lceap-vpl-item-play-icon {
    background: var(--lceap-vpl-icon-bg-active);
}

.lceap-vpl-item:not(.is-active):hover .lceap-vpl-item-play-icon {
    background: var(--lceap-vpl-icon-bg-hover);
}

.lceap-vpl-item-play-icon svg {
    width: 14px;
    height: 14px;
    fill: var(--lceap-vpl-accent);
    display: block;
}

.lceap-vpl-item.is-active .lceap-vpl-item-play-icon svg {
    fill: var(--lceap-vpl-active-text);
}

/* ─────────────────────────────────────────────────────────── */
/* MINI PLAYER BAR                                             */
/* ─────────────────────────────────────────────────────────── */
.lceap-vpl-mini {
    background-color: var(--lceap-vpl-mini-bg);
    border-radius: 0 0 20px 20px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.lceap-vpl-mini-left {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Allow shrinking so it never pushes the row wider than the container */
    flex: 1 1 auto;
    min-width: 0;
    max-width: 50%;
    overflow: hidden;
}

.lceap-vpl-mini-thumb {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.lceap-vpl-mini-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    overflow: hidden;
    flex: 1;
}

.lceap-vpl-mini-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--lceap-vpl-mini-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Use 100% so it fills its parent (mini-info) and never overflows it */
    max-width: 100%;
    width: 100%;
    display: block;
}

.lceap-vpl-mini-subtitle {
    font-size: 11px;
    color: var(--lceap-vpl-mini-subtitle);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.lceap-vpl-mini-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    justify-content: center;
    min-width: 0;
    flex-shrink: 1;
}

.lceap-vpl-mini-btn {
    background: none;
    border: none;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.15s ease;
    color: var(--lceap-vpl-mini-icon);
    padding: 0;
}

.lceap-vpl-mini-btn:hover {
    background: var(--lceap-vpl-mini-hover-bg);
    transform: scale(1.1);
}

.lceap-vpl-mini-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--lceap-vpl-mini-icon);
    display: block;
}

.lceap-vpl-playpause {
    width: 40px;
    height: 40px;
    background: var(--lceap-vpl-mini-hover-bg) !important;
}

.lceap-vpl-like svg {
    fill: var(--lceap-vpl-mini-subtitle);
    transition: fill 0.2s ease;
}

.lceap-vpl-like.liked svg,
.lceap-vpl-like:hover svg {
    fill: var(--lceap-vpl-like-active);
}

.lceap-vpl-mini-progress {
    flex: 1 1 auto;
    min-width: 60px;
    max-width: 100%;
}

.lceap-vpl-progress-track {
    width: 100%;
    height: 3px;
    background-color: var(--lceap-vpl-progress-track-bg);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
}

.lceap-vpl-progress-fill {
    height: 100%;
    background-color: var(--lceap-vpl-accent);
    border-radius: 3px;
    transition: width 0.15s linear;
}

/* ─────────────────────────────────────────────────────────── */
/* RESPONSIVE                                                   */
/* ─────────────────────────────────────────────────────────── */

/* ── Tablet (≤ 900px): body stacks, sidebar becomes full-width strip ── */
@media (max-width: 900px) {

    /* Stack featured above, sidebar below */
    .lceap-vpl-body {
        flex-direction: column !important;
    }

    .lceap-vpl-side-left .lceap-vpl-body {
        flex-direction: column !important;
    }

    /* Sidebar becomes full-width horizontal strip */
    .lceap-vpl-sidebar {
        flex: none !important;
        max-width: 100% !important;
        width: 100% !important;
        border-left: none !important;
        border-right: none !important;
        border-top: 1px solid var(--lceap-vpl-border-color);
        padding: 22px 16px 20px;
        box-sizing: border-box !important;
    }

    .lceap-vpl-side-left .lceap-vpl-sidebar {
        border-right: none !important;
        border-top: 1px solid var(--lceap-vpl-border-color);
    }

    /* List: auto height (no scroll clipping), overflow-x clipped for card grid.
       clip instead of visible: preserves box-shadows on cards without causing
       horizontal page scroll. No !important so the 600px rule can override. */
    .lceap-vpl-list {
        overflow-y: visible;
        overflow-x: clip;
        max-height: none;
        padding-right: 0;
        gap: 12px;
        width: 100%;
        min-width: 0;
        /* grid-template-columns is controlled by Elementor responsive control */
    }

    /* ── Card layout for each playlist item in grid mode ── */
    .lceap-vpl-item {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        border-radius: 12px;
        overflow: hidden;
        gap: 0;
        background-color: var(--lceap-vpl-item-bg);
        box-shadow: 0 2px 16px rgba(0,0,0,0.08);
        border: 1px solid rgba(0,0,0,0.06);
        transition: transform 0.22s ease, box-shadow 0.22s ease;
    }

    .lceap-vpl-item:not(.is-active):hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 28px rgba(0,0,0,0.13);
        background-color: var(--lceap-vpl-item-bg);
    }

    .lceap-vpl-item.is-active {
        background-color: var(--lceap-vpl-active-bg);
        box-shadow: 0 6px 24px var(--lceap-vpl-active-shadow);
    }

    /* Hide number in card mode */
    .lceap-vpl-item-num {
        display: none;
    }

    /* Thumbnail → 16:9 full-width banner */
    .lceap-vpl-item-thumb {
        width: 100% !important;
        height: auto !important;
        min-width: unset !important;
        aspect-ratio: 16 / 9;
        border-radius: 0;
        flex-shrink: 0;
    }

    /* Info block */
    .lceap-vpl-item-info {
        padding: 10px 12px 4px;
        flex: 1;
    }

    .lceap-vpl-item-title {
        white-space: normal;
        font-size: 13px;
        line-height: 1.35;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .lceap-vpl-item-subtitle {
        white-space: normal;
        font-size: 11px;
        margin-top: 2px;
    }

    /* Controls row */
    .lceap-vpl-item-controls {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 4px 12px 10px;
        gap: 6px;
    }

    .lceap-vpl-item-duration { font-size: 11px; }
    .lceap-vpl-item-play-icon { width: 28px; height: 28px; }
}

/* ── Mobile (≤ 600px): 1-column compact row layout ───────── */
@media (max-width: 600px) {

    /* Body: remove fixed min-height — the player's aspect-ratio drives height */
    .lceap-vpl-body {
        min-height: 0;
        width: 100%;
        min-width: 0;
    }

    .lceap-vpl-featured {
        flex: none;
        padding: 16px 14px 14px;
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .lceap-vpl-featured-title {
        font-size: 18px;
    }

    /* Player: enforce 16:9 on mobile — overrides any Elementor min-height injection.
       aspect-ratio + height:auto is the only reliable way to keep landscape ratio
       regardless of what Elementor's responsive control injects. */
    .lceap-vpl-feat-media {
        flex: none !important;
        width: 100% !important;
        aspect-ratio: 16 / 9 !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        padding-top: 0 !important;
        position: relative !important;
        margin-bottom: 16px;
    }

    .lceap-vpl-feat-thumb-wrap {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    /* Sidebar: full-width, no fixed sizes */
    .lceap-vpl-sidebar {
        padding: 16px 12px 14px;
        min-width: 0;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
    }

    /* List: hard-clip overflow so cards never exceed sidebar width */
    .lceap-vpl-list {
        gap: 6px;
        overflow-x: clip;
        overflow-y: visible;
        max-height: none;
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Item: compact horizontal row, clipped, full width of list */
    .lceap-vpl-item {
        flex-direction: row;
        align-items: center;
        padding: 10px 12px;
        border-radius: 10px;
        gap: 10px;
        box-shadow: none;
        border: none;
        background-color: var(--lceap-vpl-item-bg);
        overflow: hidden;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .lceap-vpl-item:not(.is-active):hover {
        transform: none;
        box-shadow: none;
        background-color: var(--lceap-vpl-item-hover-bg);
    }

    .lceap-vpl-item.is-active {
        box-shadow: none;
    }

    .lceap-vpl-item-num {
        display: block;
    }

    /* Thumb: fixed square, never flex-grows */
    .lceap-vpl-item-thumb {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        max-width: 52px;
        aspect-ratio: unset !important;
        border-radius: 8px;
        flex-shrink: 0;
        flex-grow: 0;
    }

    /* Info: takes remaining space, clips text */
    .lceap-vpl-item-info {
        padding: 0;
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .lceap-vpl-item-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        -webkit-line-clamp: unset;
        display: block;
        font-size: 13px;
        max-width: 100%;
    }

    .lceap-vpl-item-subtitle {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    /* Controls: shrink, never grow */
    .lceap-vpl-item-controls {
        flex-direction: column;
        align-items: flex-end;
        padding: 0;
        gap: 3px;
        flex-shrink: 0;
        flex-grow: 0;
    }

    /* Mini player: full width, tight padding, no bleed */
    .lceap-vpl-mini {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 10px 12px;
        gap: 10px;
        overflow: hidden;
    }

    /* Mini left: shrinks, clips text */
    .lceap-vpl-mini-left {
        flex: 1 1 0%;
        min-width: 0;
        max-width: calc(100% - 180px); /* leave room for controls */
        overflow: hidden;
    }

    /* Mini title: clips to available width */
    .lceap-vpl-mini-title {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Mini subtitle: same treatment */
    .lceap-vpl-mini-subtitle {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Progress: fills remaining space on the same row */
    .lceap-vpl-mini-progress {
        flex: 1 1 auto;
        min-width: 40px;
        max-width: 100%;
    }

    /* Featured desc: uncap the desktop max-width */
    .lceap-vpl-featured-desc {
        max-width: 100%;
    }

    /* Iframe: always fills the absolute-positioned player */
    .lceap-vpl-iframe-wrap iframe {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ─────────────────────────────────────────────────────────── */
/* ELEMENTOR EDITOR PREVIEW                                    */
/* ─────────────────────────────────────────────────────────── */
.elementor-editor-active .lceap-vpl-feat-media {
    /* In the editor, aspect-ratio may not compute correctly if the container
       has no width yet. min-height provides a visible floor. */
    min-height: 200px;
}
/* Body height is driven by content — no forced min-height in editor */

/* ─────────────────────────────────────────────────────────── */
/* MOBILE OVERFLOW CONTAINMENT                                 */
/* ─────────────────────────────────────────────────────────── */

/* ── Root containment: widget never wider than viewport ──── */
@media (max-width: 600px) {
    .lceap-vpl-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        overflow-x: hidden;
        border-radius: 14px;
    }
}

/* ── 360px: tightest real-world viewport ─────────────────── */
@media (max-width: 360px) {
    .lceap-vpl-featured {
        padding: 10px 10px 8px;
    }
    .lceap-vpl-featured-title {
        font-size: 15px;
    }
    .lceap-vpl-sidebar {
        padding: 10px 10px 10px;
    }
    .lceap-vpl-item {
        gap: 8px;
        padding: 8px 10px;
    }
    .lceap-vpl-item-thumb {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        max-width: 44px;
    }
    .lceap-vpl-item-play-icon {
        width: 24px;
        height: 24px;
    }
    .lceap-vpl-mini {
        padding: 8px 10px;
        gap: 8px;
    }
    .lceap-vpl-mini-left {
        max-width: calc(100% - 160px);
    }
}

/* ── 480px ───────────────────────────────────────────────── */
@media (max-width: 480px) {
    .lceap-vpl-featured-title { font-size: 16px; }
    .lceap-vpl-featured       { padding: 12px 12px 10px; }
    .lceap-vpl-sidebar        { padding: 12px 10px 10px; }
}
