.svh-hidden { display: none !important; }

/* ==========================================================================
   Secure Video Hosting — Player Styles
   Custom UI with SVG controls, responsive sidebar (desktop) / bottom sheet (mobile)
   ========================================================================== */

.svh-course-player {
    /* Theme tokens — overridable via Settings page (CSS variables in <head>) */
    /* Default values — overridden by inline <style> from inject_player_css_variables() */
    /* Only set NON-settings variables here (derived colors, etc.) */
    --svh-bg-soft: #1f2530;
    --svh-bg-hover: #2a313e;
    --svh-fg-dim: #6b7280;
    --svh-accent-hover: #6a9eff;
    --svh-accent-soft: rgba(79, 140, 255, 0.18);
    --svh-success: #4caf50;
    --svh-warn: #f5a623;
    --svh-error: #ef5350;
    --svh-radius-sm: 8px;
    --svh-ctrl-h: 56px;
    /* These 7 ARE set by admin — fallback defaults only (will be overridden by inline <style>) */
    --svh-bg: #0b0d12;
    --svh-bg-alt: #151921;
    --svh-fg: #f5f6f7;
    --svh-fg-muted: #9aa0aa;
    --svh-accent: #4f8cff;
    --svh-border: #232936;
    --svh-radius: 12px;
    --svh-sidebar-w: 340px;

    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans", "PingFang SC",
                 "Hiragino Sans", sans-serif;
    color: var(--svh-fg);
    background: var(--svh-bg);
    border-radius: var(--svh-radius);
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
    margin: 24px 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* No-sidebar mode (single video — [svh_video] shortcode) */
.svh-course-player--no-sidebar .svh-layout {
    grid-template-columns: 1fr;
        min-height: inherit;
}
.svh-course-player--no-sidebar .svh-lessons { display: none; }
.svh-course-player--no-sidebar .svh-player-meta__right { display: none; }
.svh-course-player--no-sidebar .svh-player-meta { display: none; }
.svh-course-player--no-sidebar .svh-mobile-only { display: none !important; }
.svh-course-player--no-sidebar .svh-btn--prev,
.svh-course-player--no-sidebar .svh-btn--next { display: none; }
/* No-sidebar = single-video mode: hide playlist button + overlay (only one lesson) */
.svh-course-player--no-sidebar .svh-btn--playlist,
.svh-course-player--no-sidebar .svh-player-playlist-overlay,
.svh-course-player--no-sidebar.svh-course-player--sidebar-bottom .svh-mobile-only,
.svh-course-player--no-sidebar .svh-mobile-only,
.svh-course-player:fullscreen.svh-course-player--no-sidebar .svh-btn--playlist,
.svh-course-player:-webkit-full-screen.svh-course-player--no-sidebar .svh-btn--playlist,
.svh-player-frame:fullscreen.svh-course-player--no-sidebar .svh-btn--playlist,
.svh-course-player:has(.svh-player-frame:fullscreen).svh-course-player--no-sidebar .svh-btn--playlist {
    display: none !important;
}

/* Cinema mode — toggled by playlist button on desktop (non-fullscreen, sidebar visible).
   Hides the sidebar, expands video to full width. Click again to restore.
   Uses width transition on sidebar (not grid-template-columns) because CSS
   cannot smoothly animate between different numbers of grid tracks.
   The grid uses `auto 1fr` so the sidebar column auto-sizes to its width. */
.svh-layout {
    display: grid;
    grid-template-columns: auto 1fr;
    min-height: 540px;
    transition: none; /* no grid transition needed */
}

.svh-lessons {
    background: var(--svh-bg-alt);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
    width: var(--svh-sidebar-w);
    flex-shrink: 0;
    transition: width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.28s ease,
                padding 0.32s ease,
                border-width 0.32s ease;
}

/* Cinema mode ON: sidebar collapses to 0 width */
.svh-course-player--cinema .svh-lessons {
    width: 0;
    opacity: 0;
    padding-left: 0;
    padding-right: 0;
    border-left-width: 0;
    border-right-width: 0;
    pointer-events: none;
}

.svh-course-player *,
.svh-course-player *::before,
.svh-course-player *::after { box-sizing: border-box; }

.svh-course-player button { font-family: inherit; }

/* ---------- Layout: desktop sidebar / mobile bottom-sheet ----------
   NOTE: .svh-layout and .svh-lessons base styles are defined earlier
   (in the Cinema mode section) because they participate in the cinema transition.
   Here we only add sidebar position variants. */

/* Sidebar position: RIGHT (default) — video on left, playlist on right */
.svh-course-player--sidebar-right .svh-lessons { order: 2; }
.svh-course-player--sidebar-right .svh-player-wrap { order: 1; }
.svh-course-player--sidebar-right .svh-lessons {
    border-right: none;
    border-left: 1px solid var(--svh-border);
}

/* Sidebar position: LEFT — playlist on left, video on right */
.svh-course-player--sidebar-left .svh-lessons { order: 1; }
.svh-course-player--sidebar-left .svh-player-wrap { order: 2; }
.svh-course-player--sidebar-left .svh-lessons {
    border-left: none;
    border-right: 1px solid var(--svh-border);
}

/* ============== SIDEBAR (lessons) ============== */
/* Base .svh-lessons styles (background, display, width, transitions) are defined
   earlier in the Cinema mode section. Here we only add sub-component styles. */

.svh-lessons__header {
    padding: 22px 22px 16px;
    border-bottom: 1px solid var(--svh-border);
    flex-shrink: 0;
}

.svh-lessons__title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 14px;
    line-height: 1.35;
    color: var(--svh-fg);
}

.svh-lessons__progress {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--svh-fg-muted);
}

.svh-progress-bar {
    flex: 1;
    height: 5px;
    background: var(--svh-bg-soft);
    border-radius: 3px;
    overflow: hidden;
}

.svh-progress-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--svh-accent), var(--svh-accent-hover));
    transition: width 0.4s ease;
    border-radius: 3px;
}

.svh-lessons__list {
    list-style: none;
    margin: 0;
    padding: 10px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--svh-border) transparent;
}

.svh-lessons__list::-webkit-scrollbar { width: 6px; }
.svh-lessons__list::-webkit-scrollbar-track { background: transparent; }
.svh-lessons__list::-webkit-scrollbar-thumb {
    background: var(--svh-border);
    border-radius: 3px;
}
.svh-lessons__list::-webkit-scrollbar-thumb:hover { background: var(--svh-fg-dim); }

.svh-lessons__loading {
    padding: 24px;
    color: var(--svh-fg-muted);
    text-align: center;
    font-size: 13px;
}

/* Lesson item */
.svh-lesson-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--svh-radius-sm);
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease;
    margin-bottom: 4px;
    border: 1px solid transparent;
    user-select: none;
}

.svh-lesson-item:hover { background: rgba(255, 255, 255, 0.04); }

.svh-lesson-item--active {
    background: var(--svh-accent-soft);
    border-color: rgba(79, 140, 255, 0.45);
}

.svh-lesson-item__thumb {
    flex-shrink: 0;
    width: 88px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--svh-bg-soft);
    position: relative;
    border: 1px solid var(--svh-border);
}

.svh-lesson-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.svh-lesson-item__thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--svh-fg-dim);
    font-size: 16px;
    font-weight: 700;
}

.svh-lesson-item__number {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--svh-bg-soft);
    color: var(--svh-fg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.18s ease;
}

.svh-lesson-item--active .svh-lesson-item__number {
    background: var(--svh-accent);
    color: #fff;
    box-shadow: 0 0 0 4px var(--svh-accent-soft);
}

.svh-lesson-item--completed .svh-lesson-item__number {
    background: var(--svh-success);
    color: #fff;
}

.svh-lesson-item--completed.svh-lesson-item--active .svh-lesson-item__number {
    background: var(--svh-success);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.18);
}

.svh-lesson-item__body { flex: 1; min-width: 0; padding-top: 2px; }

.svh-lesson-item__title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 4px;
    color: var(--svh-fg);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.svh-lesson-item--active .svh-lesson-item__title { color: var(--svh-accent-hover); }

.svh-lesson-item__meta {
    font-size: 11px;
    color: var(--svh-fg-muted);
    display: flex;
    gap: 8px;
    align-items: center;
}

.svh-lesson-item__progress {
    height: 3px;
    background: var(--svh-bg-soft);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.svh-lesson-item__progress-fill {
    height: 100%;
    background: var(--svh-accent);
    transition: width 0.3s ease;
    border-radius: 2px;
}

.svh-lesson-item--completed .svh-lesson-item__progress-fill { background: var(--svh-success); }

/* ============== PLAYER AREA ============== */
.svh-player-wrap {
    display: flex;
    flex-direction: column;
    background: var(--svh-bg);
    min-width: 0;
}

.svh-player-frame {
    position: relative;
    background: #000;
    aspect-ratio: 16 / 9;
    width: 100%;
    overflow: hidden;
}

.svh-video {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
}

/* ---------- Big play button ---------- */
.svh-big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 4;
}

.svh-big-play:hover {
    background: var(--svh-accent);
    border-color: var(--svh-accent);
    transform: translate(-50%, -50%) scale(1.06);
}

.svh-big-play svg { transform: translateX(2px); }

.svh-big-play--hidden { display: none; }

/* ---------- Spinner ---------- */
.svh-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--svh-accent);
    z-index: 5;
    animation: svh-spin 1s linear infinite;
}

@keyframes svh-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* ---------- Overlay (errors / access) ---------- */
.svh-player-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    text-align: center;
    padding: 24px;
    z-index: 6;
}

.svh-player-overlay--hidden { display: none; }

.svh-player-overlay__msg {
    font-size: 15px;
    line-height: 1.5;
    max-width: 420px;
}

/* ============== CUSTOM CONTROL BAR ============== */
.svh-controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
    padding: 24px 14px 10px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    z-index: 3;
    pointer-events: none;
}

.svh-controls.svh-controls--visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.svh-controls.svh-controls--pinned {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* --- Video title overlay (shown in fullscreen, cinema mode, or no-sidebar) ---
   Hidden by default on desktop with sidebar (title is in sidebar already).
   Revealed when controls are visible (--visible / --pinned classes added by pinControls). */
.svh-video-title-overlay {
    position: absolute;
    top: 0px;
    left: 0px;
    right: 0px;
    z-index: 2;
    padding: 8px 14px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
    color: var(--svh-fg);
    font-size: 15px;
    font-weight: 600;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    display: none; /* hidden by default; shown via context rules below */
}

/* Show overlay element in these contexts:
   - no-sidebar mode (single video, always)
   - cinema mode (sidebar hidden, video expanded)
   - fullscreen (any kind) */
.svh-course-player--no-sidebar .svh-video-title-overlay,
.svh-course-player--cinema .svh-video-title-overlay,
.svh-course-player:fullscreen .svh-video-title-overlay,
.svh-course-player:-webkit-full-screen .svh-video-title-overlay,
.svh-player-frame:fullscreen .svh-video-title-overlay,
.svh-player-frame:-webkit-full-screen .svh-video-title-overlay,
.svh-course-player:has(.svh-player-frame:fullscreen) .svh-video-title-overlay {
    display: block;
}

/* Reveal overlay when controls are visible */
.svh-video-title-overlay.svh-controls--visible,
.svh-video-title-overlay.svh-controls--pinned {
    opacity: 1;
    transform: translateY(0);
}

/* --- Timeline --- */
.svh-controls__timeline {
    position: relative;
    height: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.svh-controls__timeline::before {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 5px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 3px;
    transition: height 0.15s ease;
}

.svh-controls__timeline:hover::before { height: 7px; }

.svh-controls__timeline-buffer {
    position: absolute;
    left: 0;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    transition: height 0.15s ease;
}

.svh-controls__timeline:hover .svh-controls__timeline-buffer { height: 7px; }

.svh-controls__timeline-fill {
    position: absolute;
    left: 0;
    height: 5px;
    background: var(--svh-accent);
    border-radius: 3px;
    transition: height 0.15s ease;
}

.svh-controls__timeline:hover .svh-controls__timeline-fill { height: 7px; }

.svh-controls__timeline-thumb {
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transform: translateX(-50%) scale(0);
    transition: transform 0.15s ease;
}

.svh-controls__timeline:hover .svh-controls__timeline-thumb,
.svh-controls__timeline--dragging .svh-controls__timeline-thumb {
    transform: translateX(-50%) scale(1);
}

/* --- Row of buttons --- */
.svh-controls__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 4px;
}

.svh-controls__left,
.svh-controls__right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.svh-btn {
    background: transparent;
    border: none;
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: var(--svh-radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease, color 0.18s ease, transform 0.05s ease;
    padding: 0;
    flex-shrink: 0;
}

.svh-btn:hover { background: rgba(255, 255, 255, 0.12); }
.svh-btn:active { transform: scale(0.94); }
.svh-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.svh-btn:disabled:hover { background: transparent; }

.svh-btn--play { width: 44px; height: 44px; }
.svh-btn--prev:hover, .svh-btn--next:hover { color: var(--svh-accent-hover); }

/* --- Volume --- */
.svh-volume { display: flex; align-items: center; gap: 2px; position: relative; }

.svh-volume__slider {
    -webkit-appearance: none;
    appearance: none;
    width: 0;
    transition: width 0.2s ease, value 0.2s ease;
    height: 4px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    cursor: pointer;
    overflow: hidden;
    transition: width 0.2s ease, background 0.15s ease;
}

.svh-volume:hover .svh-volume__slider { width: 70px; }

.svh-volume__slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    box-shadow: -100px 0 0 96px var(--svh-accent);
    cursor: pointer;
}

.svh-volume__slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* === Mobile volume popup ===
   On mobile the inline slider is hidden (no hover). Instead, tapping the volume
   button opens a vertical popup slider above the controls.
   Direction: BOTTOM = 0% (mute), TOP = 100% (max) — natural up=up mapping. */
.svh-volume__popup {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) scale(0.85);
    width: 32px;
    height: 110px;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 10px 0;
    z-index: 20;
    opacity: 0;
    transition: opacity 0.18s ease, transform 0.18s ease;
    pointer-events: none;
}

.svh-volume__popup--open {
    display: flex;
    opacity: 1;
    transform: translateX(-50%) scale(1);
    pointer-events: auto;
}

/* Vertical slider — modern approach: appearance:none + writing-mode:vertical-lr.
   DO NOT use appearance:slider-vertical — it renders the browser's NATIVE
   vertical slider widget with a default circular thumb that ignores custom
   ::-webkit-slider-thumb styling. With appearance:none we get full control.
   direction:rtl makes value 0 at bottom, value 1 at top (up = louder).
   !important flags protect against WordPress theme range input overrides. */
.svh-volume__popup-slider {
    -webkit-appearance: none !important;
    appearance: none !important;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 4px !important;
    height: 86px !important;
    /* background is set dynamically by JS (updatePopupSliderFill) —
       accent color below thumb, grey above. Do NOT set background here
       with !important, or it will override the JS gradient. */
    background: rgba(255, 255, 255, 0.25);
    border-radius: 2px;
    cursor: pointer;
    outline: none;
}

/* WebKit thumb — white pill (matches desktop inline slider style).
   Now works because parent uses appearance:none (not slider-vertical). */
.svh-volume__popup-slider::-webkit-slider-thumb {
    -webkit-appearance: none !important;
    appearance: none !important;
    width: 10px !important;
    height: 18px !important;
    background: #fff !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
}

/* Firefox thumb — same white pill */
.svh-volume__popup-slider::-moz-range-thumb {
    width: 10px !important;
    height: 18px !important;
    background: #fff !important;
    border: none !important;
    border-radius: 5px !important;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
}

/* Firefox track */
.svh-volume__popup-slider::-moz-range-track {
    width: 4px !important;
    height: 86px !important;
    background: rgba(255, 255, 255, 0.25) !important;
    border-radius: 2px;
}

/* Firefox progress fill (below thumb) — accent color */
.svh-volume__popup-slider::-moz-range-progress {
    width: 4px !important;
    background: var(--svh-accent, #4f8cff) !important;
    border-radius: 2px;
}

/* --- Time --- */
.svh-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.85);
    font-variant-numeric: tabular-nums;
    margin-left: 6px;
    white-space: nowrap;
}

.svh-time__sep { margin: 0 3px; opacity: 0.6; }

/* --- Speed --- */
.svh-speed { position: relative; }

.svh-btn--speed {
    width: auto;
    min-width: 38px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
}

.svh-speed__menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--svh-bg-alt);
    border: 1px solid var(--svh-border);
    border-radius: var(--svh-radius-sm);
    padding: 4px;
    min-width: 90px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.svh-speed__menu button {
    display: block;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--svh-fg);
    padding: 7px 12px;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    transition: background 0.15s ease;
}

.svh-speed__menu button:hover { background: var(--svh-bg-hover); }
.svh-speed__menu button.is-active { color: var(--svh-accent); font-weight: 600; }

/* --- Quality (same styling as speed) --- */
.svh-quality { position: relative; }

.svh-btn--quality {
    width: auto;
    min-width: 38px;
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    gap: 4px;
}

.svh-quality__label { font-size: 12px; font-weight: 600; }

.svh-quality__menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: var(--svh-bg-alt);
    border: 1px solid var(--svh-border);
    border-radius: var(--svh-radius-sm);
    padding: 4px;
    min-width: 110px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.svh-quality__menu button {
    display: flex;
    width: 100%;
    background: transparent;
    border: none;
    color: var(--svh-fg);
    padding: 7px 12px;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    transition: background 0.15s ease;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.svh-quality__menu button:hover { background: var(--svh-bg-hover); }
.svh-quality__menu button.is-active { color: var(--svh-accent); font-weight: 600; }

.svh-quality__menu .badge {
    font-size: 9px;
    background: var(--svh-bg-soft);
    color: var(--svh-fg-muted);
    padding: 1px 5px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.svh-quality__menu button.is-active .badge {
    background: var(--svh-accent-soft);
    color: var(--svh-accent);
}

@media (max-width: 480px) {
    .svh-quality__label { display: none; }
    .svh-btn--quality { padding: 0 6px; min-width: 38px; }
}

/* --- Fullscreen --- */
.svh-btn--fullscreen:hover { color: var(--svh-accent-hover); }

/* --- Playlist button active state (cinema mode on) --- */
.svh-btn--playlist.svh-btn--active {
    color: var(--svh-accent);
    background: var(--svh-accent-soft);
}

/* --- Mobile-only playlist toggle (hidden on desktop) --- */
.svh-mobile-only { display: none; }

/* Playlist button is always visible now:
   - Desktop with sidebar: toggles "cinema mode" (hide sidebar, expand video)
   - Fullscreen / no-sidebar: toggles in-player playlist overlay
   - Mobile non-fullscreen: toggles bottom-sheet sidebar */
/* .svh-btn--playlist { display: inline-flex !important; } */

/* ============== META BELOW PLAYER ============== */
.svh-player-meta {
    padding: 18px 24px;
    border-top: 1px solid var(--svh-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.svh-player-meta__left { flex: 1; min-width: 0; }

.svh-lesson-counter {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--svh-accent);
    margin-bottom: 6px;
}

.svh-current-lesson {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px;
    line-height: 1.3;
    color: var(--svh-fg);
}

.svh-current-lesson-meta {
    font-size: 13px;
    color: var(--svh-fg-muted);
    margin: 0;
}

.svh-player-meta__right {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.svh-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--svh-bg-soft);
    color: var(--svh-fg);
    border: 1px solid var(--svh-border);
    padding: 9px 16px;
    border-radius: var(--svh-radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.18s ease;
}

.svh-link-btn:hover:not(:disabled) {
    background: var(--svh-bg-hover);
    border-color: var(--svh-fg-dim);
}

.svh-link-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.svh-link-btn--primary {
    background: var(--svh-accent);
    color: #fff;
    border-color: var(--svh-accent);
}

.svh-link-btn--primary:hover:not(:disabled) {
    background: var(--svh-accent-hover);
    border-color: var(--svh-accent-hover);
}

/* ============== GATES (login/purchase) ============== */
.svh-gate {
    background: var(--svh-bg-alt);
    color: var(--svh-fg);
    padding: 48px 40px;
    border-radius: var(--svh-radius);
    text-align: center;
    margin: 24px 0;
}

.svh-gate h2 {
    margin-top: 0;
    margin-bottom: 14px;
    font-size: 22px;
}

.svh-gate p {
    color: var(--svh-fg-muted);
    margin-bottom: 18px;
}

.svh-gate__price {
    font-size: 26px;
    font-weight: 700;
    color: var(--svh-fg);
}

.svh-gate__btn {
    display: inline-block;
    background: var(--svh-accent);
    color: #fff !important;
    padding: 13px 30px;
    border-radius: var(--svh-radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.svh-gate__btn:hover { background: var(--svh-accent-hover); color: #fff; }

.svh-error {
    background: #2a1a1a;
    color: #ff9b9b;
    padding: 20px;
    border-radius: var(--svh-radius);
    border: 1px solid #5a2a2a;
    text-align: center;
    margin: 24px 0;
}

/* ============== RESPONSIVE ============== */

/* Tablet — narrower sidebar */
@media (max-width: 1100px) {
    .svh-course-player { --svh-sidebar-w: 280px !important; }
}

/* Mobile — stack: video on top, playlist as collapsible bottom sheet */
@media (max-width: 860px) {
    .svh-course-player {
        --svh-sidebar-w: 100% !important;
        margin: 12px 0;
        border-radius: var(--svh-radius-sm);
    }

    .svh-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        min-height: 0;
    }

    /* Video on top, fills width */
    .svh-player-wrap { order: 1; }
    .svh-player-frame { aspect-ratio: 16 / 9; }

    /* Sidebar becomes collapsible bottom sheet BELOW the video */
    .svh-lessons {
        order: 2;
        border-right: none;
        border-top: 1px solid var(--svh-border);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.32s ease;
    }

    /* When opened, expand the sheet */
    .svh-lessons.svh-lessons--mobile-open {
        max-height: 55vh;
    }

    .svh-lessons__header {
        padding: 14px 16px 12px;
        cursor: pointer;
        position: relative;
    }

    .svh-lessons__header::after {
        content: '';
        position: absolute;
        right: 16px;
        top: 50%;
        transform: translateY(-50%) rotate(0deg);
        width: 8px;
        height: 8px;
        border-right: 2px solid var(--svh-fg-muted);
        border-bottom: 2px solid var(--svh-fg-muted);
        transition: transform 0.22s ease;
    }

    .svh-lessons--mobile-open .svh-lessons__header::after {
        transform: translateY(-50%) rotate(-135deg);
    }

    .svh-lessons__list { max-height: calc(55vh - 70px); }

    /* Mobile-only button visible */
    .svh-mobile-only { display: inline-flex; }

    /* Show controls permanently on touch (no hover) */
    .svh-controls { opacity: 0; transform: translateY(0); pointer-events: auto; }

    /* Compact meta */
    .svh-player-meta { padding: 14px 16px; }
    .svh-current-lesson { font-size: 16px; }
    .svh-player-meta__right { width: 100%; justify-content: space-between; }

    /* Bigger touch targets */
    .svh-btn { width: 42px; height: 42px; }
    .svh-btn--play { width: 46px; height: 46px; }

    /* On mobile: hide inline slider (no hover), use popup slider instead */
    .svh-volume__slider { display: none; }
    /* Mobile popup is positioned by JS via .svh-volume__popup--open class */

    .svh-big-play { width: 64px; height: 64px; }
}

/* In fullscreen (any device): hide inline slider, use popup instead.
   This is because :hover doesn't work reliably in fullscreen on touch devices. */
.svh-course-player:fullscreen .svh-volume__slider,
.svh-course-player:-webkit-full-screen .svh-volume__slider,
.svh-player-frame:fullscreen .svh-volume__slider,
.svh-player-frame:-webkit-full-screen .svh-volume__slider,
.svh-course-player:has(.svh-player-frame:fullscreen) .svh-volume__slider {
    display: none;
}

/* Very small phones */
@media (max-width: 480px) {
    .svh-course-player {
        margin: 8px -8px;
        border-radius: 0;
    }
        
        .svh-carousel-modal__content .svh-course-player{
                 margin: 8px 0px;
        }

    .svh-controls { padding: 20px 8px 8px; }
    .svh-controls__left { gap: 0; }
    .svh-controls__right { gap: 0; }

    /* Hide time on very narrow screens to fit controls */
    .svh-time { display: none; }

    .svh-player-meta { padding: 12px 14px; }
    .svh-link-btn { padding: 8px 12px; font-size: 12px; flex: 1; justify-content: center; }

    .svh-lessons__header { padding: 12px 14px 10px; }
    .svh-lessons__title { font-size: 14px; }
}

/* Fullscreen mode adjustments
   NOTE: JS opens fullscreen on .svh-player-frame (not on .svh-course-player),
   so we must use BOTH selectors — :fullscreen on player-frame AND on course-player.
   The player-frame:fullscreen case is the actually-used one. */
.svh-course-player:fullscreen,
.svh-course-player:-webkit-full-screen,
.svh-player-frame:fullscreen,
.svh-player-frame:-webkit-full-screen {
    border-radius: 0;
    margin: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
}

.svh-course-player:fullscreen .svh-layout,
.svh-course-player:-webkit-full-screen .svh-layout {
    grid-template-columns: var(--svh-sidebar-w) 1fr;
    height: 100vh;
}

.svh-course-player:fullscreen .svh-lessons,
.svh-course-player:-webkit-full-screen .svh-lessons {
    display: none;
}

.svh-course-player:fullscreen .svh-player-frame,
.svh-course-player:-webkit-full-screen .svh-player-frame,
.svh-player-frame:fullscreen,
.svh-player-frame:-webkit-full-screen {
    aspect-ratio: unset;
    height: 100vh;
    width: 100vw;
}

/* When player-frame itself is the fullscreen element, hide the sidebar
   (which is outside player-frame and would otherwise still be visible). */
.svh-course-player:has(.svh-player-frame:fullscreen) .svh-lessons,
.svh-course-player:has(.svh-player-frame:-webkit-full-screen) .svh-lessons {
    display: none;
}

/* ==========================================================================
   IN-PLAYER PLAYLIST OVERLAY — toggled by playlist button (fullscreen + desktop)
   Slides in from the right as a panel over the video.
   ========================================================================== */
.svh-player-playlist-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 320px;
    max-width: 90%;
    background: rgba(15, 18, 25, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 30;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    pointer-events: none; /* lets clicks pass through when closed */
}

.svh-player-playlist-overlay--open {
    transform: translateX(0);
    pointer-events: auto;
}

.svh-player-playlist-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.svh-player-playlist-overlay__title {
    font-size: 15px;
    font-weight: 600;
    color: #f5f6f7;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 220px;
}

.svh-player-playlist-overlay__close {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
    flex-shrink: 0;
}

.svh-player-playlist-overlay__close svg {
    width: 22px;
    height: 22px;
}

.svh-player-playlist-overlay__close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.svh-player-playlist-overlay__list {
    list-style: none;
    margin: 0;
    padding: 8px;
    overflow-y: auto;
    flex: 1;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.svh-player-playlist-overlay__list::-webkit-scrollbar { width: 6px; }
.svh-player-playlist-overlay__list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.svh-player-playlist-overlay__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.16s ease;
    color: #d4d6dc;
}

.svh-player-playlist-overlay__item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.svh-player-playlist-overlay__item--active {
    background: rgba(79, 140, 255, 0.16);
    color: #fff;
}

.svh-player-playlist-overlay__item-number {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #b8bcc4;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.svh-player-playlist-overlay__item--active .svh-player-playlist-overlay__item-number {
    background: var(--svh-accent, #4f8cff);
    color: #fff;
}

.svh-player-playlist-overlay__item-body {
    flex: 1;
    min-width: 0;
}

.svh-player-playlist-overlay__item-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.svh-player-playlist-overlay__item-meta {
    font-size: 11px;
    color: #9aa0aa;
    margin-top: 2px;
}

.svh-player-playlist-overlay__item-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    margin-top: 6px;
    overflow: hidden;
}

.svh-player-playlist-overlay__item-progress-fill {
    height: 100%;
    background: var(--svh-accent, #4f8cff);
    transition: width 0.3s ease;
}

/* Completed lessons show green progress bar (matches sidebar behavior) */
.svh-player-playlist-overlay__item--completed .svh-player-playlist-overlay__item-progress-fill {
    background: var(--svh-success, #4caf50);
}

/* Completed lessons: green checkmark next to title, green number circle */
.svh-player-playlist-overlay__item--completed .svh-player-playlist-overlay__item-number {
    background: var(--svh-success, #4caf50);
    color: #fff;
}

/* In fullscreen, force playlist button visible (it normally has svh-mobile-only).
   Fullscreen can be opened on either .svh-course-player OR .svh-player-frame
   (JS uses .svh-player-frame), so we cover both cases. */
.svh-course-player:fullscreen .svh-btn--playlist,
.svh-course-player:-webkit-full-screen .svh-btn--playlist,
.svh-player-frame:fullscreen .svh-btn--playlist,
.svh-player-frame:-webkit-full-screen .svh-btn--playlist,
.svh-course-player:has(.svh-player-frame:fullscreen) .svh-btn--playlist,
.svh-course-player:has(.svh-player-frame:-webkit-full-screen) .svh-btn--playlist {
    display: inline-flex !important;
}


.svh-carousel-modal .svh-course-player:fullscreen .svh-btn--playlist,
.svh-carousel-modal .svh-course-player:-webkit-full-screen .svh-btn--playlist,
.svh-carousel-modal .svh-player-frame:fullscreen .svh-btn--playlist,
.svh-carousel-modal .svh-player-frame:-webkit-full-screen .svh-btn--playlist,
.svh-carousel-modal .svh-course-player:has(.svh-player-frame:fullscreen) .svh-btn--playlist {
    display: none !important;
}


/* On narrow screens the overlay takes the full width */
@media (max-width: 600px) {
    .svh-player-playlist-overlay {
        width: 100%;
        max-width: 100%;
    }
}

/* ==========================================================================
   VIDEO CAROUSEL — [svh_carousel] shortcode
   With scroll arrows + dot navigation
   ========================================================================== */
.svh-carousel {
    margin: 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.svh-carousel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.svh-carousel__title {
    font-size: 18px;
    font-weight: 600;
    color: inherit;
}

.svh-carousel__nav {
    display: flex;
    gap: 8px;
}

.svh-carousel__arrow {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: rgb(235 235 235);
    color: #1a1d24;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.svh-carousel__arrow:hover:not(:disabled) {
    background: var(--svh-accent, #4f8cff);
    transform: scale(1.1);
}

.svh-carousel__arrow:disabled {
    opacity: 0.2;
    cursor: default;
    display: none;
}

.svh-carousel__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin: 0 -8px;
    padding: 0 8px;
    /* Snap: every touch fling ends aligned to the nearest card-start.
       This prevents skipping cards regardless of fling velocity.
       Mandatory = always snap, even if the user scrolls slowly. */
    scroll-snap-type: x mandatory;
}

.svh-carousel__viewport::-webkit-scrollbar { display: none; }

.svh-carousel__track {
    display: flex;
    gap: 16px;
    width: max-content;
    min-width: 100%;
    padding-bottom: 4px;
}

.svh-carousel-card {
    scroll-snap-align: start;
    scroll-snap-stop: always; /* force stopping at each card, never skip */
}

.svh-carousel__dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.svh-carousel__dot {
    width: 24px;
    min-height: 4px;
    height: 4px;
    border-radius: 2px;
    border: none;
    background: rgb(153 153 153 / 20%);
    cursor: pointer;
    transition: all 0.25s ease;
    padding: 0;
}

.svh-carousel__dot:hover {
    background: rgba(255, 255, 255, 0.4);
}

.svh-carousel__dot--active {
    background: var(--svh-accent, #4f8cff);
    width: 32px;
}

/* ==========================================================================
   LAZY-LOAD MODAL TRIGGER — [svh_video_modal] shortcode
   YouTube-style: poster image + play button, video loads on click
   ========================================================================== */
.svh-video-modal-trigger {
    position: relative;
    display: block;
    cursor: pointer;
    border-radius: var(--svh-radius, 12px);
    overflow: hidden;
    background: var(--svh-bg-alt, #151921);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.svh-video-modal-trigger:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.svh-video-modal-trigger__poster {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--svh-bg-soft, #1f2530);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.svh-video-modal-trigger__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.svh-video-modal-trigger:hover .svh-video-modal-trigger__poster img {
    transform: scale(1.05);
}

.svh-video-modal-trigger__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.22s ease;
    z-index: 2;
}

.svh-video-modal-trigger:hover .svh-video-modal-trigger__play {
    background: var(--svh-accent, #4f8cff);
    border-color: var(--svh-accent, #4f8cff);
    transform: translate(-50%, -50%) scale(1.1);
}

.svh-video-modal-trigger__play svg {
    transform: translateX(2px);
}

.svh-video-modal-trigger__title {
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    color: var(--svh-fg, #f5f6f7);
}

/* ==========================================================================
   LAZY-LOAD MODAL — shared by [svh_video_modal] and [svh_carousel]
   ========================================================================== */
.svh-lazy-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: background 0.25s ease, backdrop-filter 0.25s ease;
}

.svh-lazy-modal--open {
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.svh-lazy-modal__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s ease;
    z-index: 10;
}

.svh-lazy-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.svh-lazy-modal__content {
    width: 100%;
    max-width: 900px;
    position: relative;
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}

.svh-lazy-modal--open .svh-lazy-modal__content {
    transform: scale(1);
    opacity: 1;
}

/* Mobile: fullscreen modal */
@media (max-width: 768px) {
    .svh-lazy-modal {
        padding: 0;
        align-items: stretch;
    }
    .svh-lazy-modal__content {
        max-width: 100%;
        height: 100%;
        display: flex;
        align-items: center;
    }
    .svh-lazy-modal__close {
        top: 12px;
        right: 12px;
    }
    .svh-lazy-modal__content .svh-course-player {
        margin: 0;
        border-radius: 0;
        height: 100%;
        display: flex;
        align-items: center;
    }
    .svh-lazy-modal__content .svh-player-frame {
/*         aspect-ratio: unset; */
        height: 56.25vw; /* 16:9 ratio based on viewport width */
        max-height: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .svh-video-modal-trigger__play {
        width: 56px;
        height: 56px;
    }
    .svh-carousel__arrow {
        width: 32px;
        height: 32px;
    }
}

.svh-carousel-card {
    background: var(--svh-bg-alt, #151921);
    border: 1px solid var(--svh-border, #232936);
    border-radius: var(--svh-radius-sm, 8px);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.22s ease;
    position: relative;
    flex: 0 0 calc((100% - (var(--svh-carousel-cols, 4) - 1) * 16px) / var(--svh-carousel-cols, 4));
    width: 0;
    min-width: 0;
}

.svh-carousel-card:hover {
    transform: translateY(-2px);
    box-shadow: -2px 4px 6px rgba(0, 0, 0, 0.4);
    border-color: var(--svh-accent, #4f8cff);
}

.svh-carousel-card__thumb {
    aspect-ratio: 16/9;
    background: var(--svh-bg-soft, #1f2530);
    position: relative;
    overflow: hidden;
}

.svh-carousel-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.svh-carousel-card:hover .svh-carousel-card__thumb img {
    transform: scale(1.05);
}

.svh-carousel-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.22s ease;
    z-index: 2;
}

.svh-carousel-card:hover .svh-carousel-card__play {
    background: var(--svh-accent, #4f8cff);
    border-color: var(--svh-accent, #4f8cff);
    transform: translate(-50%, -50%) scale(1.1);
}

.svh-carousel-card__play svg {
    transform: translateX(2px);
}

.svh-carousel-card__duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 2;
}

.svh-carousel-card__body {
    padding: 12px 14px;
}

.svh-carousel-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--svh-fg, #f5f6f7);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.35;
}

.svh-carousel-card__meta {
    font-size: 11px;
    color: var(--svh-fg-muted, #9aa0aa);
}

/* Carousel modal (click card → opens player) */
.svh-carousel-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.svh-carousel-modal--open {
    display: flex;
}

.svh-carousel-modal__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: background 0.18s ease;
    z-index: 10;
}

.svh-carousel-modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.svh-carousel-modal__content {
    width: 100%;
    max-width: 900px;
    position: relative;
}

@media (max-width: 600px) {
    .svh-carousel-modal__content { max-width: 100%; }
    .svh-carousel-modal { padding: 0; }
}


/* Bottom layout — sidebar below video (same as mobile) */
.svh-course-player--sidebar-bottom:not(.svh-course-player--no-sidebar) {
    max-width: 650px;
}

.svh-course-player--sidebar-bottom .svh-layout {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto;
}

.svh-course-player--sidebar-bottom .svh-player-wrap {
    order: 1;
}
.svh-course-player--sidebar-bottom .svh-mobile-only {
    display: inline-flex !important;
}

/* Bottom layout — sidebar below video (desktop only) */
@media (min-width: 890px) {
    .svh-course-player--sidebar-bottom .svh-layout {
        grid-template-columns: 1fr !important;
        grid-template-rows: auto auto;
    }
    .svh-course-player--sidebar-bottom .svh-lessons {
        order: 2;
        max-height: 400px;
        border-left: none;
        border-top: 1px solid var(--svh-border);
                width:100%;
        border-right: none;
    }
    .svh-course-player--sidebar-bottom .svh-player-wrap {
        order: 1;
    }
    .svh-course-player--sidebar-bottom .svh-mobile-only {
        display: none !important;
    }
}

 .svh-carousel-modal__content button#svh-toggle-playlist{
                display: none !important;
        }
        /*
        .svh-carousel-modal__content .svh-course-player--sidebar-bottom {
                max-width: inherit;
        }
        .svh-carousel-modal__content .svh-layout {
                min-height: inherit;
        } */

.svh-carousel-modal__content .svh-course-player.svh-course-player--no-sidebar.svh-course-player--sidebar-bottom {
     max-width: inherit; 
}


.svh-course-player.svh-course-player--no-sidebar.svh-btn--playlist{
        display:none!important;
}

/* Fix modal player-wrap flex direction */
.svh-lazy-modal--open .svh-player-wrap {
    flex-direction: unset;
}
.svh-carousel-modal--open .svh-player-wrap {
    flex-direction: unset;
}
/* Mobile: hide arrows, rely on touch scroll + dots */
@media (max-width: 768px) {
    .svh-carousel__nav { display: none !important; }
    .svh-carousel-card {
        flex: 0 0 calc((100% - (var(--svh-carousel-cols-mobile, 2) - 1) * 12px) / var(--svh-carousel-cols-mobile, 2)) !important;
    }
    .svh-carousel__track { gap: 12px; }
    .svh-carousel-card__title { font-size: 12px; }
    .svh-carousel-card__meta { font-size: 10px; }
}

/* ==========================================================================
   ProMassagist v2.18 — тема плеера (адаптация под дизайн сайта)
   Светлая боковая панель, акцент emerald-600 (#059669), радиус 14px.
   ========================================================================== */

.svh-course-player {
    --svh-bg: #ffffff;
    --svh-bg-alt: #f8fafc;
    --svh-fg: #0f172a;
    --svh-fg-muted: #64748b;
    --svh-accent: #059669;
    --svh-accent-hover: #047857;
    --svh-accent-soft: rgba(5, 150, 105, 0.12);
    --svh-border: #e2e8f0;
    --svh-radius: 14px;
    --svh-sidebar-w: 340px;
    box-shadow: 0 10px 34px rgba(15, 23, 42, 0.14);
    border: 1px solid var(--svh-border);
}

/* Боковая панель уроков — светлая */
.svh-lessons { background: var(--svh-bg-alt); border-right: 1px solid var(--svh-border); }
.svh-course-player--sidebar-right .svh-lessons { border-right: none; border-left: 1px solid var(--svh-border); }
.svh-lesson-item { border-bottom: 1px solid var(--svh-border); }
.svh-lesson-item:hover { background: #f1f5f9; }
.svh-lesson-item--active { background: var(--svh-accent-soft) !important; }
.svh-lesson-item--active .svh-lesson-item__title { color: var(--svh-accent); }

/* Панель метаданных под видео */
.svh-player-meta { background: var(--svh-bg); border-top: 1px solid var(--svh-border); }
.svh-current-lesson { color: var(--svh-fg); }
.svh-link-btn { color: var(--svh-fg-muted); }
.svh-link-btn:hover:not(:disabled) { color: var(--svh-fg); }
/* v2.24 fix: текст акцентной кнопки — БЕЛЫЙ (раньше color:var(--svh-accent)
   давал изумрудный текст на изумрудном фоне — кнопка казалась пустой). */
.svh-link-btn--primary,
.svh-link-btn--primary:hover:not(:disabled),
.svh-link-btn--primary:focus-visible {
    color: #fff;
}

/* Пункт «Пройдено» в списке уроков */
.svh-lesson-item__check { color: var(--svh-accent); }

/* Кнопка воспроизведения — акцентная */
.svh-big-play { background: var(--svh-accent) !important; }
.svh-big-play:hover { background: var(--svh-accent-hover) !important; }

/* ---------- v2.18: режим iframe (VK / RuTube) ---------- */

.svh-embed-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
    z-index: 2;
}

.svh-embed-done {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 6;
    display: none;
}

/* v2.83.3: кнопка «Отметить пройденным» над текстовым уроком */
.svh-player-frame .svh-text-lesson ~ .svh-embed-done { z-index: 40; }

.svh-embed-done__btn {
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 9px 16px;
    border-radius: 10px;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background 0.2s ease;
}
.svh-embed-done__btn:hover:not(:disabled) { background: var(--svh-accent); }
.svh-embed-done__btn:disabled { background: var(--svh-accent); border-color: var(--svh-accent); cursor: default; }

/* В iframe-режиме прячем нативные контролы и заглушки */
.svh-course-player--embed .svh-controls,
.svh-course-player--embed .svh-big-play,
.svh-course-player--embed .svh-spinner,
.svh-course-player--embed .svh-player-overlay { display: none !important; }

/* ═══════════════ v2.27: плейлисты уроков (VK / RuTube / Kinescope) ═══════════════ */

.svh-lesson-subitems {
    list-style: none;
    margin: 2px 0 8px;
    padding: 0 0 0 34px;
}
.svh-lesson-subitems__header {
    font-size: 11px;
    font-weight: 700;
    color: var(--svh-fg-muted);
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: 6px 8px 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.svh-lesson-subitems__item {
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding: 6px 8px;
    border-radius: var(--svh-radius-sm);
    cursor: pointer;
    font-size: 12.5px;
    color: var(--svh-fg);
}
.svh-lesson-subitems__item:hover { background: var(--svh-bg-hover); }
.svh-lesson-subitems__item--active {
    background: var(--svh-accent-soft);
    color: var(--svh-accent-hover);
}
.svh-lesson-subitems__item--watched .svh-lesson-subitems__title {
    text-decoration: line-through;
    opacity: .55;
}
.svh-lesson-subitems__num {
    flex: 0 0 auto;
    min-width: 18px;
    text-align: right;
    color: var(--svh-fg-muted);
    font-variant-numeric: tabular-nums;
}
.svh-lesson-subitems__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 6px;
    align-items: baseline;
    justify-content: space-between;
}
.svh-lesson-subitems__title {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.svh-lesson-subitems__meta {
    flex: 0 0 auto;
    color: var(--svh-fg-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

/* v2.27: Kinescope SDK host — iframe от SDK на весь фрейм */
.svh-kinescope-host iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==========================================================================
   v2.28: SLIDER — карусель из нескольких видео (уроки-слайдеры и витрина)
   Раскладка: N полных карточек + «выглядывание» следующей (peek).
   Свайп на тачах — нативный scroll + scroll-snap (mandatory, stop: always).
   Тёмная тема — по умолчанию (в плеере); .svh-slider--light — витрина.
   ========================================================================== */
.svh-slider {
    --sl-accent: var(--svh-accent, #4f8cff);
    --sl-card-bg: var(--svh-bg-soft, #1f2530);
    --sl-border: rgb(255 255 255 / 8%);
    --sl-fg: var(--svh-fg, #eef1f6);
    --sl-fg-muted: var(--svh-fg-muted, #93a0b4);
    --sl-gap: 16px;
    --sl-peek: 56px;
    margin-top: 12px;
    min-width: 0;
}

.svh-slider__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    /* v2.32: заголовок не прибит к левому краю — тот же горизонтальный
       отступ 10px, что и у карусели (viewport padding), строки выровнены */
    padding: 0 10px;
}

.svh-slider__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--sl-fg-muted);
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.svh-slider__nav { display: flex; gap: 8px; }

.svh-slider__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--sl-border);
    background: var(--sl-card-bg);
    color: var(--sl-fg);
    cursor: pointer;
    transition: background 0.2s ease, opacity 0.2s ease, transform 0.15s ease;
}

.svh-slider__arrow:hover:not(:disabled) { background: rgb(255 255 255 / 12%); }
.svh-slider__arrow:active:not(:disabled) { transform: scale(0.94); }
.svh-slider__arrow:disabled { opacity: 0.35; cursor: default; }

/* Тач-устройства: свайп основной, стрелки не нужны */
@media (hover: none) {
    .svh-slider__nav { display: none; }
}

.svh-slider__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x mandatory; /* каждый финг заканчивается на карточке */
    /* v2.30: слайд не врезается в край — горизонтальный отступ +
       scroll-padding, чтобы snap сохранял отступ на каждой карточке */
    padding: 2px 10px;
    margin: -2px 0;
    scroll-padding: 2px 10px;
    border-radius: 12px;
}

.svh-slider__viewport::-webkit-scrollbar { display: none; }
.svh-slider__viewport:focus-visible { outline: 2px solid var(--sl-accent); outline-offset: 2px; }

.svh-slider__track {
    display: flex;
    gap: var(--sl-gap);
    /* ВАЖНО: без width:max-content — иначе процентные flex-basis карточек
       resolve'ятся против контента, а не против ширины вьюпорта (peek ломается). */
    min-width: 100%;
    padding-bottom: 2px;
}

.svh-slider-card {
    /* Десктоп: 3 полные карточки + peek (следующая выглядывает на --sl-peek) */
    flex: 0 0 calc((100% - 2 * var(--sl-gap) - var(--sl-peek)) / 3);
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always; /* никогда не перескакиваем карточки */
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* Планшет: 2 карточки + peek */
@media (max-width: 1100px) {
    .svh-slider-card { flex-basis: calc((100% - var(--sl-gap) - var(--sl-peek)) / 2); }
}

/* Мобильный: 1 карточка + peek следующей (свайп) */
@media (max-width: 860px) {
    .svh-slider { --sl-peek: 40px; --sl-gap: 12px; }
    .svh-slider-card { flex-basis: calc(100% - var(--sl-peek)); }
}

.svh-slider-card__thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: linear-gradient(135deg, #232a36 0%, #171c26 100%);
    border: 2px solid transparent;
    transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.svh-slider-card:hover .svh-slider-card__thumb {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgb(0 0 0 / 35%);
}

.svh-slider-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.svh-slider-card:hover .svh-slider-card__img { transform: scale(1.05); }

.svh-slider-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgb(0 0 0 / 55%);
    color: #fff;
    backdrop-filter: blur(4px);
    transition: background 0.2s ease, transform 0.2s ease;
}

.svh-slider-card:hover .svh-slider-card__play {
    background: var(--sl-accent);
    transform: translate(-50%, -50%) scale(1.08);
}

.svh-slider-card__duration {
    position: absolute;
    right: 6px;
    bottom: 6px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgb(0 0 0 / 72%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
}

.svh-slider-card__num {
    position: absolute;
    left: 6px;
    top: 6px;
    padding: 1px 7px;
    border-radius: 6px;
    background: rgb(0 0 0 / 60%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.5;
}

.svh-slider-card__done {
    position: absolute;
    right: 6px;
    top: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.svh-slider-card--watched .svh-slider-card__done { opacity: 1; transform: scale(1); }
.svh-slider-card--watched .svh-slider-card__play { opacity: 0.55; }

/* Активная (играющая сейчас) карточка */
.svh-slider-card--active .svh-slider-card__thumb {
    border-color: var(--sl-accent);
    box-shadow: 0 0 0 4px rgb(79 140 255 / 18%);
}

.svh-slider-card--active .svh-slider-card__title { color: var(--sl-accent); }

.svh-slider-card__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--sl-fg-muted);
    transition: color 0.2s ease;
}

.svh-slider-card:hover .svh-slider-card__title { color: var(--sl-fg); }

.svh-slider__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.svh-slider__dot {
    width: 18px;
    height: 4px;
    border-radius: 2px;
    border: none;
    padding: 0;
    background: rgb(153 153 153 / 25%);
    cursor: pointer;
    transition: background 0.25s ease, width 0.25s ease;
}

.svh-slider__dot:hover { background: rgb(153 153 153 / 55%); }
.svh-slider__dot--active { background: var(--sl-accent); width: 30px; }

/* Длинные списки на мобильных: точки не переносим, скроллим внутри */
@media (max-width: 860px) {
    .svh-slider__dots {
        max-width: 100%;
        overflow-x: auto;
        scrollbar-width: none;
        justify-content: flex-start;
        padding: 2px;
    }
    .svh-slider__dots::-webkit-scrollbar { display: none; }
}

/* ---------- Светлая тема (витрина курса, публичный слайдер) ---------- */
.svh-slider--light {
    --sl-accent: #059669;
    --sl-card-bg: #ffffff;
    --sl-border: rgb(0 0 0 / 10%);
    --sl-fg: #111827;
    --sl-fg-muted: #6b7280;
}

.svh-slider--light .svh-slider-card__thumb {
    background: linear-gradient(135deg, #e5e7eb 0%, #f3f4f6 100%);
}

.svh-slider--light .svh-slider-card:hover .svh-slider-card__thumb {
    box-shadow: 0 10px 24px rgb(0 0 0 / 15%);
}

.svh-slider--light .svh-slider__arrow:hover:not(:disabled) { background: #f3f4f6; }

/* Сцена публичного слайдера на витрине */
.svh-slider--light .svh-slider__stage {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.svh-slider--light .svh-slider__stage iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ============================================================
   v2.29: Галерея превью (шаблон урока) + лайтбокс
   ============================================================ */

/* ---------- Режим галереи: сцена скрыта, стена постеров вместо неё ---------- */
.svh-course-player.svh-gallery-mode .svh-player-frame {
    display: none;
}

/* Карточки галереи чуть крупнее слайдера: на десктопе 2 + выглядывание */
.svh-slider--gallery {
    --sl-peek: 48px;
    --sl-gap: 14px;
}

@media (min-width: 861px) {
    .svh-slider--gallery .svh-slider-card { flex-basis: calc((100% - var(--sl-gap) * 2 - var(--sl-peek)) / 2.4); }
}

/* ---------- Лайтбокс: тёмная тема (в плеере) ---------- */
.svh-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.svh-lightbox--open { opacity: 1; }

.svh-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgb(9 9 11 / 82%);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.svh-lightbox__dialog {
    position: relative;
    width: min(1080px, 100%);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    background: #101013;
    border: 1px solid rgb(255 255 255 / 10%);
    border-radius: 16px;
    box-shadow: 0 32px 80px rgb(0 0 0 / 55%);
    overflow: hidden;
    transform: scale(0.97) translateY(8px);
    transition: transform 0.2s ease;
}

.svh-lightbox--open .svh-lightbox__dialog { transform: scale(1) translateY(0); }

.svh-lightbox__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgb(255 255 255 / 8%);
    min-width: 0;
}

.svh-lightbox__title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    color: #f4f4f5;
}

.svh-lightbox__counter {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: rgb(255 255 255 / 45%);
    font-variant-numeric: tabular-nums;
}

.svh-lightbox__close {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: rgb(255 255 255 / 8%);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.svh-lightbox__close:hover { background: rgb(255 255 255 / 16%); }
.svh-lightbox__close:active { transform: scale(0.94); }

.svh-lightbox__stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: calc(100vh - 260px);
    background: #000;
}

.svh-lightbox__frame,
.svh-lightbox__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
    object-fit: contain;
}

/* v2.33: превью-картинка курса в лайтбоксе — целиком, без обрезки (contain). */
.svh-lightbox__photo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

.svh-lightbox__host {
    position: absolute;
    inset: 0;
}

/* v2.33: завеса загрузки — постер видео + спиннер поверх iframe,
   чтобы вместо чёрного квадрата пользователь видел обложку. */
.svh-lightbox__veil {
    position: absolute;
    inset: 0;
    z-index: 3;
    overflow: hidden;
    background: #000;
}

.svh-lightbox__veil img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.92;
}

.svh-lightbox__veil::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.18);
}

.svh-lightbox__veil-spin {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    border: 4px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: svh-lb-spin 0.9s linear infinite;
    z-index: 2;
}

@keyframes svh-lb-spin {
    to { transform: rotate(360deg); }
}

.svh-lightbox__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 16px 12px;
    border-top: 1px solid rgb(255 255 255 / 8%);
}

.svh-lightbox__dots {
    display: flex;
    align-items: center;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
    min-width: 0;
    padding: 4px 2px;
}

.svh-lightbox__dots::-webkit-scrollbar { display: none; }

.svh-lightbox__dot {
    width: 8px;
    height: 8px;
    flex-shrink: 0;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: rgb(255 255 255 / 22%);
    cursor: pointer;
    transition: background 0.15s ease, width 0.15s ease;
}

.svh-lightbox__dot:hover { background: rgb(255 255 255 / 40%); }
.svh-lightbox__dot--active { background: var(--svh-accent, #10b981); width: 24px; }

.svh-lightbox__next {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border: 0;
    border-radius: 10px;
    background: var(--svh-accent, #10b981);
    color: #ffffff; /* v2.30: белый текст на зелёной кнопке (был тёмный — сливался) */
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

.svh-lightbox__next:hover { filter: brightness(1.08); }
.svh-lightbox__next:active { transform: scale(0.97); }
.svh-lightbox__next--finish { background: #34d399; }

/* ---------- Лайтбокс: адаптив ----------
   v2.32: ДВА РЕЖИМА ЛАЙТБОКСА (переключатель — SVG-кнопка рядом с крестиком):
   • svh-lightbox--fit  «По размеру» (ПО УМОЛЧАНИЮ) — диалог повторяет
     пропорции видео (16:9), ничего не обрезается и не растягивается;
   • svh-lightbox--fill «Во весь экран» — как в v2.30: диалог занимает
     100dvh, сцена растягивается между шапкой и футером.
   Выбор запоминается в localStorage (svh-lb-mode), изначально — «По размеру». */
@media (max-width: 860px) {
    .svh-lightbox { padding: 10px; }
    .svh-lightbox__dialog {
        width: 100%;
        border-radius: 12px;
        border: 0;
    }
    /* «По размеру» (по умолчанию): высота по содержимому, сцена 16:9 */
    .svh-lightbox--fit .svh-lightbox__dialog {
        height: auto;
        max-height: calc(100dvh - 20px);
    }
    .svh-lightbox--fit .svh-lightbox__stage {
        flex: 0 0 auto;
        aspect-ratio: 16 / 9;
        max-height: calc(100dvh - 150px);
    }
    /* «Во весь экран»: режим v2.30 — диалог на весь экран, сцена тянется */
    .svh-lightbox--fill { padding: 0; }
    .svh-lightbox--fill .svh-lightbox__dialog {
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }
    .svh-lightbox__head { padding: 9px 12px; }
    .svh-lightbox__title { font-size: 13px; }
    .svh-lightbox--fill .svh-lightbox__stage {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        aspect-ratio: auto;
    }
    .svh-lightbox__foot { padding: 8px 12px 10px; gap: 10px; }
    .svh-lightbox__next { padding: 8px 12px; font-size: 12px; }
}

/* «Во весь экран» на десктопе: диалог растягивается на всё окно */
@media (min-width: 861px) {
    .svh-lightbox--fill { padding: 0; }
    .svh-lightbox--fill .svh-lightbox__dialog {
        width: 100%;
        height: 100vh;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }
    .svh-lightbox--fill .svh-lightbox__stage {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        aspect-ratio: auto;
    }
}

/* ---------- Лайтбокс: кнопка режима экрана (v2.32) ----------
   Иконка SVG рядом с крестиком: стрелки наружу = перейти «во весь экран»,
   стрелки внутрь = вернуться к «По размеру». */
.svh-lightbox__fitmode {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    background: rgb(255 255 255 / 8%);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.svh-lightbox__fitmode:hover { background: rgb(255 255 255 / 16%); }
.svh-lightbox__fitmode:active { transform: scale(0.94); }
.svh-lightbox--light .svh-lightbox__fitmode {
    background: rgb(0 0 0 / 6%);
    color: #111827;
}
.svh-lightbox--light .svh-lightbox__fitmode:hover { background: rgb(0 0 0 / 12%); }

/* ---------- Лайтбокс: светлая тема (витрина курса) ----------
   (v2.32: кнопка режима .svh-lightbox__fitmode стилизована выше) */
.svh-lightbox--light .svh-lightbox__dialog {
    background: #ffffff;
    border-color: rgb(0 0 0 / 8%);
    box-shadow: 0 32px 80px rgb(0 0 0 / 30%);
}

.svh-lightbox--light .svh-lightbox__head,
.svh-lightbox--light .svh-lightbox__foot { border-color: rgb(0 0 0 / 8%); }

.svh-lightbox--light .svh-lightbox__title { color: #111827; }
.svh-lightbox--light .svh-lightbox__counter { color: rgb(0 0 0 / 45%); }

.svh-lightbox--light .svh-lightbox__close {
    background: rgb(0 0 0 / 6%);
    color: #111827;
}

.svh-lightbox--light .svh-lightbox__close:hover { background: rgb(0 0 0 / 12%); }

.svh-lightbox--light .svh-lightbox__dot { background: rgb(0 0 0 / 18%); }
.svh-lightbox--light .svh-lightbox__dot:hover { background: rgb(0 0 0 / 35%); }
.svh-lightbox--light .svh-lightbox__dot--active { background: #059669; }

/* ---------- Постер-карточка одиночного видео в лайтбоксе (витрина) ---------- */
.presale-lb-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    cursor: pointer;
    display: block;
}

.presale-lb-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.presale-lb-card:hover img { transform: scale(1.03); }

.presale-lb-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgb(0 0 0 / 0%) 55%, rgb(0 0 0 / 45%) 100%);
    pointer-events: none;
}

.presale-lb-card__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.presale-lb-card__play span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 999px;
    background: rgb(16 185 129 / 92%);
    color: #fff;
    box-shadow: 0 12px 32px rgb(0 0 0 / 35%);
    transition: transform 0.2s ease;
}

.presale-lb-card:hover .presale-lb-card__play span { transform: scale(1.08); }

/* ---------- v2.83.3: урок «Без видео (текст)» ---------- */
.svh-text-lesson {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: #0b1220;
    color: #e5e7eb;
}

.svh-text-lesson__scroll {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 24px 28px 64px;
    -webkit-overflow-scrolling: touch;
}

.svh-text-lesson__body {
    max-width: 760px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.65;
}

.svh-text-lesson__body h1,
.svh-text-lesson__body h2,
.svh-text-lesson__body h3,
.svh-text-lesson__body h4 {
    color: #ffffff;
    margin: 18px 0 8px;
    line-height: 1.3;
}

.svh-text-lesson__body h1 { font-size: 22px; }
.svh-text-lesson__body h2 { font-size: 19px; }
.svh-text-lesson__body h3 { font-size: 17px; }

.svh-text-lesson__body p { margin: 8px 0; }
.svh-text-lesson__body ul,
.svh-text-lesson__body ol { margin: 8px 0 8px 20px; }
.svh-text-lesson__body li { margin: 4px 0; }
.svh-text-lesson__body a { color: #34d399; }
.svh-text-lesson__body img { max-width: 100%; border-radius: 10px; }
.svh-text-lesson__body blockquote {
    border-left: 3px solid #10b981;
    margin: 12px 0;
    padding: 4px 12px;
    color: #9ca3af;
}

.svh-text-lesson__empty { color: #9ca3af; font-style: italic; }
