/* Ghostae Text V2 - Main Stylesheet */

/* Inter variable font (latin, SIL OFL 1.1) - one file covers every weight */
@font-face {
    font-family: 'Inter';
    src: url('../fonts/Inter-Variable-latin.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Universal Focus & Selection Reset - Eliminates annoying white borders / focus rings */
*, *:focus, *:focus-visible, *:active {
    outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
}

button:focus, button:focus-visible, 
input:focus, input:focus-visible, 
select:focus, select:focus-visible, 
div:focus, div:focus-visible, 
a:focus, a:focus-visible {
    outline: none !important;
}

body,
body.font-sans {
    font-family: 'Hind Siliguri Light', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    font-weight: 300;
    user-select: none;
    -webkit-user-select: none;
    background: #141722 !important;
    color: #e2e8f0;
}

.font-bangla {
    font-family: 'Hind Siliguri Light', 'Hind Siliguri', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 300;
}

button, input, select, textarea {
    font-family: inherit;
}

/* Adobe Dark Scrollbar */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: #11141c;
}

::-webkit-scrollbar-thumb {
    background: #252e42;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #38bdf8;
}

/* Active category item highlight */
.nav-item-active {
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.22) 0%, rgba(14, 165, 233, 0.05) 100%) !important;
    color: #38bdf8 !important;
    border-left: 3px solid #38bdf8 !important;
    box-shadow: inset 3px 0 8px rgba(14, 165, 233, 0.25) !important;
    font-weight: 600;
}

/* Card zoom & hover video preview - High Performance & Crisp Rendering */
.fx-card {
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0.18s ease;
    position: relative;
    background: transparent !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.fx-card:hover {
    z-index: 40;
    transform: translateY(-3px) scale(1.02);
}

/* Enhanced Emoji Pop-Up Animation on Hover */
.emoji-card {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0.2s ease !important;
    will-change: transform;
}

.emoji-card:hover {
    z-index: 50 !important;
    transform: translateY(-5px) scale(1.08) !important;
}

/* ===== THUMB CONTAINER — High-Contrast Elevated Card Frame ===== */
.thumb-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #1a2230 !important;
    border: 1px solid #28354c !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    /* Default aspect ratio: 16/10 for presets & templates */
    aspect-ratio: 16 / 10;
    min-height: 80px; /* Fallback for very old CEF without aspect-ratio */
}

/* Fallback for older AE/CEF without aspect-ratio support */
@supports not (aspect-ratio: 16 / 10) {
    .thumb-container {
        padding-top: 62.5%; /* 16:10 */
        height: 0;
        display: block; /* Overrides flex to allow absolute children to position correctly */
    }
    .thumb-container.thumb-aspect-emoji {
        padding-top: 75%; /* 4:3 */
    }
    .thumb-img, .preview-video, .emoji-media-wrap {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}

.thumb-container.thumb-aspect-emoji {
    aspect-ratio: 4 / 3;
}

.fx-card:hover .thumb-container {
    border-color: #38bdf8 !important;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.9), 0 0 14px rgba(56, 189, 248, 0.35);
}

.emoji-card .thumb-container {
    background: radial-gradient(circle at center, #131926 0%, #080b12 100%) !important;
    border-color: #1b2436 !important;
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.emoji-card:hover .thumb-container {
    border-color: #38bdf8 !important;
    box-shadow: 0 12px 28px -4px rgba(0, 0, 0, 0.95), 0 0 18px rgba(56, 189, 248, 0.4) !important;
}

/* Hover name pill — static replacement for group-hover Tailwind utilities */
.hover-name-pill {
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 6px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(0,0,0,0.9);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 9px;
    color: #dedede;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 20;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.fx-card:hover .hover-name-pill {
    opacity: 1;
}

/* Pro Locked Item Badge */
.pro-lock-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 5px;
    border-radius: 4px;
    background: rgba(8, 12, 22, 0.92);
    border: 1px solid rgba(56, 189, 248, 0.45);
    backdrop-filter: blur(4px);
    font-size: 8px;
    font-weight: 800;
    color: #38bdf8;
    display: flex;
    align-items: center;
    gap: 2.5px;
    z-index: 20;
    letter-spacing: 0.04em;
    pointer-events: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Fav & Customize/Edit buttons */
.preset-fav-btn {
    pointer-events: auto;
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 4px;
    border-radius: 4px;
    background: rgba(0,0,0,0.6);
    z-index: 20;
    transition: all 0.15s ease;
    cursor: pointer;
    color: #888888;
    opacity: 0;
}

.fx-card:hover .preset-fav-btn,
.preset-fav-btn.fav-active {
    opacity: 1;
}

.preset-fav-btn:hover {
    background: rgba(0,0,0,0.85);
    color: #f59e0b;
}

.preset-fav-btn.fav-active {
    color: #f59e0b;
}

.preset-customize-btn {
    pointer-events: none;
    position: absolute;
    top: 32px;
    right: 6px;
    padding: 4px;
    border-radius: 4px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #cbd5e1;
    z-index: 20;
    transition: all 0.15s ease;
    cursor: pointer;
    opacity: 0;
}

.fx-card:hover .preset-customize-btn {
    opacity: 1;
    pointer-events: auto;
}

.preset-customize-btn:hover {
    background: #38bdf8;
    color: #000000;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

.template-edit-btn {
    pointer-events: none;
    position: absolute;
    top: 32px;
    right: 6px;
    padding: 4px;
    border-radius: 4px;
    background: rgba(10, 15, 26, 0.75);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    z-index: 20;
    transition: all 0.15s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.fx-card:hover .template-edit-btn {
    opacity: 1;
    pointer-events: auto;
}

.template-edit-btn:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}

.preset-sequence-btn {
    pointer-events: none;
    position: absolute;
    top: 58px;
    right: 6px;
    padding: 4px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.12);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(56, 189, 248, 0.38);
    color: #7dd3fc;
    z-index: 20;
    transition: all 0.15s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.fx-card:hover .preset-sequence-btn {
    opacity: 1;
    pointer-events: auto;
}

.preset-sequence-btn:hover {
    background: #0ea5e9;
    color: #fff;
    border-color: #7dd3fc;
    box-shadow: 0 0 10px rgba(14, 165, 233, 0.45);
}

.super-batch-apply-btn {
    pointer-events: none;
    position: absolute;
    top: 58px;
    right: 6px;
    padding: 4px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(16, 185, 129, 0.45);
    color: #34d399;
    z-index: 20;
    transition: all 0.15s ease;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.fx-card:hover .super-batch-apply-btn {
    opacity: 1;
    pointer-events: auto;
}

.super-batch-apply-btn:hover {
    background: #10b981;
    color: #000000;
    border-color: #10b981;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.65);
}

.thumb-img, .preview-video {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    background: transparent;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* Emoji media inner wrapper — replaces dynamic Tailwind flex/padding classes */
.emoji-media-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    background: transparent;
    position: relative;
    overflow: hidden;
}

/* Emoji image — static replacements for drop-shadow-[...], max-w-[94%], etc. */
.emoji-thumb-img {
    object-fit: contain;
    pointer-events: none;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

.emoji-img-flat {
    width: 128px;
    height: 128px;
    max-width: 94%;
    max-height: 94%;
}

.emoji-img-animated {
    width: 80px;
    height: 80px;
    max-width: 80%;
    max-height: 80%;
}

/* Emoji name label beneath the emoji image — smooth hover reveal */
.emoji-label {
    position: absolute;
    bottom: 5px;
    left: 6px;
    right: 6px;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(10, 15, 26, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    font-size: 8.5px;
    color: #cbd5e1;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
    pointer-events: none;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.18s cubic-bezier(0.16, 1, 0.3, 1), transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 15;
}

.emoji-card:hover .emoji-label {
    opacity: 1;
    transform: translateY(0);
    color: #ffffff;
}


#fx-grid, #sfx-sound-grid {
    background: transparent;
}

/* ===== FX GRID LAYOUT — Static CSS (NOT Tailwind dynamic classes) =====
 * CEP Chromium JIT cannot resolve Tailwind class names injected at runtime via JS.
 * Grid column count is controlled via data-grid-cols attribute set by app.js.
 */
.fx-grid-base {
    display: grid;
    gap: 10px;
    padding-bottom: 80px;
    background: transparent;
    /* Default: 2 columns */
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fx-grid-base[data-grid-cols="1"] {
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 12px;
}

.fx-grid-base[data-grid-cols="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.fx-grid-base[data-grid-cols="3"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.fx-grid-base[data-grid-cols="4"] {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
}

.fx-grid-base[data-grid-cols="5"] {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

/* Sleek bottom zoom slider */
.grid-zoom-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 64px;
    height: 4px;
    background: #1e283d;
    border-radius: 9999px;
    outline: none;
    cursor: pointer;
    transition: background 0.2s ease;
    vertical-align: middle;
}

.grid-zoom-slider:hover {
    background: #2a3754;
}

.grid-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

.grid-zoom-slider::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    background: #7dd3fc;
}

.grid-zoom-slider::-webkit-slider-thumb:active {
    transform: scale(1.35);
    background: #ffffff;
}

.grid-zoom-slider::-moz-range-thumb {
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #38bdf8;
    border: none;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.6);
    cursor: pointer;
}


/* Fast & smooth scrolling container */
main, #fx-grid-container {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

/* Background continuous gradient */
@keyframes animatedGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.continuous-gradient-bg {
    background: linear-gradient(135deg, #0d1527, #13243d, #0b1a2b, #152b45, #0d1527);
    background-size: 300% 300%;
    animation: animatedGradient 8s ease infinite;
}

/* Waveform visualizer dancing animation */
@keyframes waveDance {
    0%, 100% { height: 4px; }
    50% { height: 18px; }
}

.sfx-card-box:hover .wave-bar-1 { animation: waveDance 0.35s ease-in-out infinite; }
.sfx-card-box:hover .wave-bar-2 { animation: waveDance 0.5s ease-in-out infinite 0.1s; }
.sfx-card-box:hover .wave-bar-3 { animation: waveDance 0.3s ease-in-out infinite 0.2s; }
.sfx-card-box:hover .wave-bar-4 { animation: waveDance 0.55s ease-in-out infinite 0.15s; }
.sfx-card-box:hover .wave-bar-5 { animation: waveDance 0.4s ease-in-out infinite 0.05s; }

/* Selected SFX Box Card */
.sfx-card-selected {
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.24) 0%, rgba(18, 28, 43, 0.95) 100%) !important;
    border-color: rgba(56, 189, 248, 0.85) !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.25), inset 0 0 12px rgba(56, 189, 248, 0.12) !important;
    transform: translateY(-2px);
}

.sfx-card-box {
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    transform: translateZ(0);
}

.sfx-card-box:hover {
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

/* Sidebar collapse transition and sleek modern dark slate */
#sidebar-panel {
    background: #0e111a !important;
    border-right: 1px solid #1e2638 !important;
    transition: width 0.24s cubic-bezier(0.4, 0, 0.2, 1), padding 0.24s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

#sidebar-panel.sidebar-collapsed {
    width: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    opacity: 0;
    pointer-events: none;
    border-right-width: 0px !important;
}

/* Category Group & Header */
.category-group {
    display: flex;
    flex-direction: column;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    border-radius: 8px;
    color: #8c9bb4;
    transition: all 0.15s ease;
    user-select: none;
}

.category-header:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.04);
}

.category-header-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-header-icon {
    width: 14px;
    height: 14px;
    color: #38bdf8;
    flex-shrink: 0;
}

.category-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    color: #64748b;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.category-header:hover .category-toggle-btn {
    color: #cbd5e1;
}

/* Submenu Accordion & Navigation Buttons */
.category-submenu {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px 0 4px 6px;
    transition: max-height 0.22s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

.submenu-collapsed {
    max-height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    padding: 0 !important;
}

.submenu-expanded {
    max-height: 420px;
    opacity: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.category-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 5px 8px 5px 12px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 500;
    color: #94a3b8;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.category-btn.nav-item-active {
    color: #ffffff !important;
    font-weight: 600 !important;
    background: #141c2c !important;
    border-color: rgba(56, 189, 248, 0.3) !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.category-btn.nav-item-active .nav-active-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.8);
    flex-shrink: 0;
}

.chevron-icon {
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chevron-collapsed {
    transform: rotate(-90deg);
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* SFX Red Hover Pop-up with Bangla Font */
#sfx-hover-popup {
    font-family: 'Hind Siliguri Light', 'Hind Siliguri', 'Inter', -apple-system, sans-serif !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999 !important;
}

/* ============================================================== */
/* CAPTIONS STUDIO - ULTRA-COMPACT & EXPANDED PREVIEW PANEL        */
/* ============================================================== */
.captions-panel {
    width: 100%;
    max-width: 680px;
    height: 100%;
    background: #0d1017;
    border: 1px solid #1c2536;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 0 auto;
    overflow: hidden;
}

.captions-panel .captions-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #131822;
    border: 1px solid #202a3a;
    border-radius: 8px;
    padding: 6px 8px;
    flex-shrink: 0;
}

.captions-panel .import-strip-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    background: #182030;
    border: 1px solid #28364f;
    transition: all 0.15s;
    flex-shrink: 0;
}

.captions-panel .import-strip-compact:hover {
    border-color: #38bdf8;
    background: #1e283d;
}

.captions-panel .btn-browse-compact {
    background: #202b3e;
    border: 1px solid #314261;
    color: #38bdf8;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.captions-panel .btn-browse-compact:hover {
    background: #0284c7;
    color: #ffffff;
    border-color: #38bdf8;
}

.captions-panel .search-box-compact {
    flex: 1;
    min-width: 80px;
    max-width: 170px;
    display: flex;
    align-items: center;
    background: #0c0f16;
    border: 1px solid #1c2434;
    border-radius: 6px;
    padding: 0 8px;
    height: 28px;
    gap: 6px;
    color: #7f7f7f;
}

.captions-panel .search-box-compact:focus-within {
    border-color: #38bdf8;
    color: #38bdf8;
}

.captions-panel .search-input-compact {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #ededed;
    font-size: 0.75rem;
}

.captions-panel .tab-pills-compact {
    display: flex;
    background: #0c0f16;
    border: 1px solid #1c2434;
    border-radius: 6px;
    padding: 2px;
    gap: 2px;
    flex-shrink: 0;
}

.captions-panel .pill-compact {
    background: transparent;
    border: none;
    color: #8c9bb4;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
}

.captions-panel .pill-compact.active {
    background: #1a2538;
    color: #38bdf8;
}

/* Big Expanded Theme Grid (Clean Preview Only) */
.captions-panel .preview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 2px;
}

.captions-panel .preview-tile {
    height: 108px;
    background: #080a0f;
    border: 1px solid #1a2332;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

.captions-panel .preview-tile:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.75);
}

.captions-panel .preview-tile.selected {
    border-color: #38bdf8 !important;
    background: #0f1624;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}

.captions-panel .preview-tile-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    pointer-events: none;
    transition: transform 0.25s ease;
}

.captions-panel .preview-tile:hover .preview-tile-media {
    transform: scale(1.04);
}

/* Tools Bar Combined with Apply Button - Sticky Docked Bottom */
.captions-panel .tools-bar-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    background: #131822;
    border: 1px solid #202a3a;
    border-radius: 8px;
    padding: 4px 8px;
    flex-shrink: 0;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.captions-panel .tools-controls-compact {
    display: flex;
    align-items: center;
    gap: 5px;
}

.captions-panel .tool-group-compact {
    display: flex;
    align-items: center;
    background: #0c0f16;
    border: 1px solid #1c2434;
    border-radius: 5px;
    padding: 1px;
    gap: 1px;
}

.captions-panel .tool-btn-compact {
    background: transparent;
    border: 1px solid transparent;
    color: #8c9bb4;
    width: 23px;
    height: 23px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    transition: all 0.15s;
}

.captions-panel .tool-btn-compact:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.captions-panel .tool-btn-compact.active {
    background: #1a2538;
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.35);
}

.captions-panel .btn-apply-compact {
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    border: none;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
    transition: all 0.15s;
}

.captions-panel .btn-apply-compact:hover {
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
    transform: translateY(-1px);
}

.captions-panel .btn-apply-compact:active {
    transform: scale(0.98);
}

/* ============================================================== */
/* MINIMALIST MONOCHROMATIC EDITOR MODAL STYLES                   */
/* ============================================================== */
.minimal-modal-card {
    width: 100%;
    max-width: 440px;
    background: #111111;
    border: 1px solid #2b2b2b;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.95);
    color: #f0f0f0;
}

.minimal-modal-card .header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #1e1e1e;
}

.minimal-modal-card .icon-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #3d3d3d;
}

.minimal-modal-card .header-title {
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #7a7a7a;
}

.minimal-modal-card .btn-close {
    background: transparent;
    border: none;
    color: #7a7a7a;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s;
}

.minimal-modal-card .btn-close:hover {
    color: #f0f0f0;
}

.minimal-modal-card .fields-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.minimal-modal-card .input-row {
    position: relative;
    display: flex;
    align-items: center;
    background: #1e1e1e;
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    padding: 4px 12px;
    transition: border-color 0.2s, background 0.2s;
}

.minimal-modal-card .input-row:focus-within {
    border-color: #525252;
    background: #222222;
}

.minimal-modal-card .row-index {
    font-size: 0.75rem;
    font-weight: 600;
    color: #404040;
    user-select: none;
    padding-right: 12px;
    border-right: 1px solid #2b2b2b;
    font-family: monospace;
}

.minimal-modal-card .clean-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    padding: 10px 12px;
    color: #f0f0f0;
    font-size: 0.95rem;
    font-weight: 500;
    letter-spacing: -0.01em;
}

.minimal-modal-card .clean-input::placeholder {
    color: #404040;
}

.minimal-modal-card .btn-font {
    background: transparent;
    border: 1px solid transparent;
    color: #7a7a7a;
    padding: 6px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

/* Without an explicit size the icon renders 300px wide and pushes the button out of the row */
.minimal-modal-card .btn-font svg {
    width: 14px;
    height: 14px;
}

.minimal-modal-card .input-row .clean-input {
    flex: 1;
    min-width: 0;
}

.minimal-modal-card .btn-font:hover,
.minimal-modal-card .btn-font.font-active {
    background: #2b2b2b;
    color: #f0f0f0;
    border-color: #3d3d3d;
}

.minimal-modal-card .action-btn {
    width: 100%;
    background: #3d3d3d;
    color: #f0f0f0;
    border: 1px solid #525252;
    border-radius: 9px;
    padding: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.minimal-modal-card .action-btn:hover {
    background: #525252;
    border-color: #6b6b6b;
    transform: translateY(-1px);
}

.minimal-modal-card .action-btn:active {
    transform: translateY(0);
}

/* Re-edit bar above the gallery (one placed template layer selected in AE) */
.tc-edit-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex-shrink: 0;
    margin-bottom: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: #1e283d;
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #f1f5f9;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.tc-edit-bar[hidden] { display: none; }
.tc-edit-bar:hover { background: #25314a; }
.tc-edit-bar:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
.tc-edit-icon { width: 14px; height: 14px; color: #38bdf8; flex-shrink: 0; }
.tc-edit-kicker { font-size: 11px; color: #94a3b8; flex-shrink: 0; }
.tc-edit-name { font-size: 12px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-edit-cta { font-size: 11px; font-weight: 600; color: #38bdf8; flex-shrink: 0; }

/* Template preview inside the editor modal */
.minimal-modal-card .tc-preview {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: contain;
    background: #000;
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    margin-bottom: 14px;
}
.minimal-modal-card .tc-preview[hidden] { display: none; }
.minimal-modal-card .tc-preview { max-height: 30vh; }
/* Keep Apply on screen in short panels when the preview takes space */
.minimal-modal-card .tc-preview:not([hidden]) + .fields-stack { max-height: 36vh; }

/* Template controller rows (manifest editor): Bengali UI uses the shared Light face. */

.minimal-modal-card.tc-mode,
.minimal-modal-card .tc-bn {
    font-family: "Hind Siliguri Light", "Hind Siliguri", "Inter", sans-serif;
}

.minimal-modal-card .tc-section-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 6px;
    font-family: "Hind Siliguri Light", "Hind Siliguri", sans-serif;
    font-size: 1.15rem;
    line-height: 1.2;
    color: #e8e3d6;
}
.minimal-modal-card .tc-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, #3a3a3a, transparent);
    transform: translateY(-4px);
}
.minimal-modal-card .tc-count {
    font-family: "Hind Siliguri Light", "Hind Siliguri", sans-serif;
    font-size: 0.7rem;
    color: #8a8a8a;
    background: #1e1e1e;
    border: 1px solid #2b2b2b;
    border-radius: 999px;
    padding: 0 7px;
}

.minimal-modal-card .tc-warn {
    font-size: 0.8rem;
    color: #f0b75a;
    background: #2a2110;
    border: 1px solid #4a3a17;
    border-radius: 8px;
    padding: 8px 10px;
}

.minimal-modal-card .tc-hint {
    font-size: 0.75rem;
    line-height: 1.5;
    color: #9a9a9a;
    margin-top: -4px;
}

.minimal-modal-card .tc-text {
    font-family: "Hind Siliguri Light", "Hind Siliguri", "Inter", sans-serif;
    font-size: 1rem;
}

.minimal-modal-card .tc-label {
    flex: 1;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: #d6d6d6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Colours: compact two-column swatch grid */
.minimal-modal-card .tc-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
}
.minimal-modal-card .tc-swatch {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 7px 9px;
    background: #1a1a1a;
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.minimal-modal-card .tc-swatch:hover { border-color: #454545; background: #202020; }
.minimal-modal-card .tc-swatch:focus-within { border-color: #6b6b6b; }
.minimal-modal-card .tc-color {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 1px solid #4a4a4a;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
}
.minimal-modal-card .tc-color::-webkit-color-swatch-wrapper { padding: 0; }
.minimal-modal-card .tc-color::-webkit-color-swatch { border: none; border-radius: 50%; }

/* Sliders: label and value on top, full-width track below */
.minimal-modal-card .tc-slider {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 9px 12px 11px;
    background: #1a1a1a;
    border: 1px solid #2b2b2b;
    border-radius: 10px;
}
.minimal-modal-card .tc-slider-head { display: flex; align-items: center; gap: 10px; }
.minimal-modal-card .tc-range { width: 100%; accent-color: #d4cbb3; cursor: pointer; }
.minimal-modal-card .tc-number {
    width: 64px;
    background: #111111;
    border: 1px solid #2b2b2b;
    border-radius: 6px;
    color: #f0f0f0;
    font-size: 0.8rem;
    padding: 2px 6px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.minimal-modal-card .tc-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: #1a1a1a;
    border: 1px solid #2b2b2b;
    border-radius: 10px;
    cursor: pointer;
}
.minimal-modal-card .tc-check { width: 16px; height: 16px; accent-color: #d4cbb3; }

.minimal-modal-card .tc-reset {
    align-self: flex-end;
    background: none;
    border: none;
    padding: 2px 0;
    color: #8a8a8a;
    font-family: "Hind Siliguri Light", "Hind Siliguri", sans-serif;
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.minimal-modal-card .tc-reset:hover { color: #e8e3d6; }
.minimal-modal-card .tc-reset:focus-visible,
.minimal-modal-card .tc-swatch:focus-visible { outline: 2px solid #8a8a8a; outline-offset: 2px; }

/* Font Picker Popover */
.font-picker-popover {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 60;
    background: #141414;
    border: 1px solid #333333;
    border-radius: 10px;
    padding: 8px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.font-picker-search-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #1f1f1f;
    border: 1px solid #2d2d2d;
    border-radius: 6px;
    padding: 4px 8px;
}

.font-picker-search-input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: #f0f0f0;
    font-size: 11px;
}

.font-picker-list {
    max-height: 140px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.font-picker-item {
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 11px;
    color: #a0a0a0;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.font-picker-item:hover, .font-picker-item.selected-font {
    background: #2b2b2b;
    color: #ffffff;
}

/* Video Copilot Style FX Console Spotlight (Rich Previews & Instant Apply) */
.fx-filter-chip {
    transition: all 0.15s ease;
}
.fx-filter-chip.active {
    background: #0284c7 !important;
    color: #ffffff !important;
    border-color: transparent !important;
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
}

.fx-console-grp-header {
    padding: 4px 10px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    background: #0c0f16;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
    border-bottom: 1px solid #1a2233;
    border-top: 1px solid #1a2233;
    position: sticky;
    top: 0;
    z-index: 10;
}

.fx-console-grp-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
}

.fx-console-item-row {
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.08s ease, color 0.08s ease;
    user-select: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.fx-console-item-row:hover {
    background: #182030;
    color: #ffffff;
}

.fx-console-item-row.fx-console-active {
    background: #0284c7 !important;
    color: #ffffff !important;
}

.fx-console-item-row.fx-console-active .fx-row-title {
    color: #ffffff !important;
    font-weight: 700 !important;
}

.fx-console-item-row.fx-console-active .fx-row-sub {
    color: rgba(255, 255, 255, 0.8) !important;
}

.fx-console-item-row.fx-console-active .fx-row-type-badge {
    background: rgba(0, 0, 0, 0.35) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.35) !important;
}

.fx-console-thumb-box {
    width: 42px;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
    background: #07090e;
    border: 1px solid #243044;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fx-console-thumb-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- Caption studio: AI card + editable subtitle list ---- */
.gt-cap-card { background: #1c2130; border: 1px solid #262f45; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.gt-cap-card.hidden { display: none; }
.gt-cap-card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.gt-cap-card-title { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 700; color: #fff; min-width: 0; }
.gt-cap-spark { color: #fbbf24; }
.gt-cap-chip { font-size: 9px; font-weight: 600; color: #94a3b8; background: #232b3e; border: 1px solid #2c3650; border-radius: 999px; padding: 1px 7px; white-space: nowrap; }
.gt-cap-count { font-size: 9.5px; font-weight: 700; color: #34d399; background: rgba(16,185,129,.1); border: 1px solid rgba(16,185,129,.3); border-radius: 999px; padding: 1px 8px; font-family: ui-monospace, Consolas, monospace; }
.gt-cap-link { font-size: 10px; color: #38bdf8; text-decoration: none; white-space: nowrap; }
.gt-cap-link:hover { text-decoration: underline; }
.gt-cap-head-actions { display: flex; gap: 4px; }
.gt-cap-key-row { display: flex; gap: 4px; align-items: center; }
.gt-cap-key-input { flex: 1; min-width: 0; background: #151a26; border: 1px solid #2a3550; color: #fff; font-size: 10.5px; border-radius: 7px; padding: 6px 8px; outline: none; font-family: ui-monospace, Consolas, monospace; }
.gt-cap-key-input:focus { border-color: #38bdf8; }
.gt-cap-btn { background: #232b3e; border: 1px solid #2c3650; color: #e2e8f0; font-size: 10px; font-weight: 600; border-radius: 7px; padding: 5px 9px; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.gt-cap-btn:hover { background: #2b3550; border-color: #38506f; }
.gt-cap-btn.is-primary { background: #0284c7; border-color: #0284c7; color: #fff; }
.gt-cap-btn.is-primary:hover { background: #0369a1; }
.gt-cap-icon-btn { background: #232b3e; border: 1px solid #2c3650; border-radius: 7px; width: 28px; height: 27px; cursor: pointer; font-size: 12px; color: #cbd5e1; }
.gt-cap-icon-btn:hover { background: #2b3550; }
.gt-cap-primary { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 10px; border: 0; border-radius: 8px; cursor: pointer; color: #fff; font-size: 11px; font-weight: 700; background: linear-gradient(90deg, #d97706, #f59e0b); box-shadow: 0 2px 8px rgba(245,158,11,.25); transition: filter .15s, transform .1s; }
.gt-cap-primary:hover { filter: brightness(1.08); }
.gt-cap-primary:active { transform: scale(.99); }
.gt-cap-primary:disabled, .gt-cap-primary.is-busy { opacity: .6; cursor: progress; }
.gt-cap-hint { font-size: 9.5px; color: #7b8496; text-align: center; line-height: 1.4; }
.gt-cap-hint.is-busy { color: #fbbf24; }
.gt-cap-hint.is-ok { color: #34d399; }
.gt-cap-hint.is-error { color: #f87171; }

.gt-cap-list { max-height: 260px; overflow-y: auto; background: #151a26; border: 1px solid #232d42; border-radius: 8px; padding: 3px; }
.gt-cap-empty { font-size: 10px; color: #6b7280; text-align: center; padding: 14px 6px; }
.gt-cap-row { position: relative; display: flex; align-items: flex-start; gap: 8px; padding: 6px 6px; border-radius: 6px; border-bottom: 1px solid #1d2435; }
.gt-cap-row:last-child { border-bottom: 0; }
.gt-cap-row:hover { background: #1b2233; }
.gt-cap-row.is-editing { background: #18243a; border: 1px solid #2f4a6e; }
.gt-cap-idx { flex: 0 0 22px; font-size: 9.5px; font-weight: 700; color: #38bdf8; text-align: right; padding-top: 1px; font-family: ui-monospace, Consolas, monospace; }
.gt-cap-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gt-cap-text { font-size: 11px; color: #e5e9f0; line-height: 1.35; word-break: break-word; }
.gt-cap-text.is-empty { color: #6b7280; font-style: italic; }
.gt-cap-time { font-size: 9px; color: #6b7a90; font-family: ui-monospace, Consolas, monospace; }
.gt-cap-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.gt-cap-row:hover .gt-cap-actions { opacity: 1; }
.gt-cap-act { width: 22px; height: 22px; border: 1px solid #2c3650; background: #202839; color: #cbd5e1; border-radius: 5px; font-size: 11px; cursor: pointer; padding: 0; line-height: 1; }
.gt-cap-act:hover { background: #2b3550; color: #fff; }
.gt-cap-act.is-danger:hover { background: #7f1d1d; border-color: #991b1b; }
.gt-cap-textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 38px; background: #10151f; border: 1px solid #2f4a6e; color: #fff; font-size: 11px; line-height: 1.35; border-radius: 6px; padding: 5px 7px; outline: none; font-family: inherit; }
.gt-cap-textarea:focus { border-color: #38bdf8; }
.gt-cap-edit-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gt-cap-edit-row label { font-size: 9.5px; color: #94a3b8; display: flex; align-items: center; gap: 4px; }
.gt-cap-time-input { width: 58px; background: #10151f; border: 1px solid #2a3550; color: #fff; font-size: 10px; border-radius: 5px; padding: 3px 5px; outline: none; font-family: ui-monospace, Consolas, monospace; }
.gt-cap-time-input:focus { border-color: #38bdf8; }
.gt-cap-spacer { flex: 1; }
.gt-cap-key-row.hidden, .gt-cap-key-saved.hidden { display: none; }
.gt-cap-key-saved { display: flex; align-items: center; gap: 6px; font-size: 10.5px; color: #cbd5e1; background: #151a26; border: 1px solid #232d42; border-radius: 7px; padding: 4px 4px 4px 9px; }
.gt-cap-key-ok { color: #34d399; font-weight: 700; }
.gt-cap-key-mask { color: #64748b; font-family: ui-monospace, Consolas, monospace; font-size: 10px; flex: 1; }
.gt-cap-opts { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; padding: 8px; background: #202533; border: 1px solid #232d42; border-radius: 12px; }
.gt-cap-opts label { display: flex; flex-direction: column; gap: 2px; font-size: 9px; font-weight: 700; color: #7b8496; text-transform: uppercase; letter-spacing: .04em; min-width: 0; }
.gt-cap-opts select { background: #181e2b; border: 1px solid #2c3650; color: #e2e8f0; font-size: 10.5px; border-radius: 6px; padding: 3px 4px; min-width: 0; text-transform: none; letter-spacing: 0; font-weight: 500; }
.gt-cap-opts .gt-cap-opts-check { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 6px; text-transform: none; letter-spacing: 0; font-size: 10px; font-weight: 500; color: #a0aec0; }


/* ======================================================== */
/* DRAG & DROP ORGANIZER & REORDER STYLES                   */
/* ======================================================== */
.fx-card.is-dragging {
    opacity: 0.35 !important;
    transform: scale(0.95) !important;
    border: 2px dashed #38bdf8 !important;
    border-radius: 8px !important;
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.3) !important;
}

.fx-card.drop-target-before {
    position: relative;
}
.fx-card.drop-target-before::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: -4px;
    width: 4px;
    background: #38bdf8;
    border-radius: 2px;
    box-shadow: 0 0 10px #38bdf8;
    z-index: 50;
    pointer-events: none;
}

.fx-card.drop-target-after {
    position: relative;
}
.fx-card.drop-target-after::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    right: -4px;
    width: 4px;
    background: #38bdf8;
    border-radius: 2px;
    box-shadow: 0 0 10px #38bdf8;
    z-index: 50;
    pointer-events: none;
}

/* Sidebar Drop Zone Highlights */
.category-btn.sidebar-drop-hover {
    background: linear-gradient(90deg, rgba(56, 189, 248, 0.35) 0%, rgba(14, 165, 233, 0.15) 100%) !important;
    color: #38bdf8 !important;
    border: 1px solid #38bdf8 !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.5) !important;
    transform: scale(1.03) !important;
    transition: all 0.15s ease !important;
}

.category-group.sidebar-group-dragover {
    border-left: 2px solid #38bdf8 !important;
}

.reorder-active-badge {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
/* Section guide: keep the existing card design readable in wide AE panels. */
#section-guide-popup {
    max-width: 430px;
    padding: 20px;
}

#guide-popup-icon {
    font-size: 20px;
    line-height: 28px;
}

#guide-popup-title {
    font-size: 15px;
}

#guide-popup-close-btn svg {
    width: 16px;
    height: 16px;
}

#guide-popup-typewriter {
    min-height: 68px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 13.5px;
}

#guide-popup-dont-show-cb {
    width: 16px;
    height: 16px;
}

#guide-popup-ok-btn {
    padding: 6px 18px;
    font-size: 13px;
}

/* Tester license countdown chip (header, always visible while a time-limited license is active) */
.tester-chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 8px; border-radius: 8px; white-space: nowrap;
    background: rgba(245, 158, 11, .12); border: 1px solid rgba(245, 158, 11, .45); color: #fbbf24; font-family: 'Hind Siliguri Light', 'Hind Siliguri', 'Inter', sans-serif; }
.tester-chip[hidden] { display: none; }
.tester-chip-label { font-size: 10px; font-weight: 600; }
.tester-chip-time { font-family: ui-monospace, Consolas, monospace; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }

/* Compact header + responsive SFX workspace */
.sfx-toolbar { min-width: 0; }
.sfx-category-strip { scrollbar-width: none; }
.sfx-controls-row { min-width: 158px; }
.sfx-search-wrap { flex: 1 1 110px; min-width: 76px; }
.sfx-volume-control { flex: 0 0 auto; }
#sfx-volume-slider { width: 58px; min-width: 42px; }
.sfx-sound-grid-responsive {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
    gap: 8px;
    align-content: start;
    min-height: 0;
}

@media (max-width: 620px) {
    .sfx-toolbar { flex-wrap: wrap; padding: 7px 8px; }
    .sfx-category-strip { order: 1; flex: 1 1 calc(100% - 34px); }
    .sfx-controls-row { order: 2; flex: 1 1 100%; width: 100%; }
    .sfx-search-wrap { width: auto !important; }
    .sfx-volume-control { margin-left: auto; }
    #sfx-volume-slider { width: 72px; }
    .sfx-sound-grid-responsive { grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); padding: 8px; }
}

@media (max-width: 390px) {
    .sfx-sound-grid-responsive { grid-template-columns: 1fr 1fr; gap: 6px; }
    .sfx-bottom-bar { flex-wrap: wrap; gap: 7px; padding: 7px 9px; }
    .sfx-bottom-bar > button { max-width: none !important; width: 100%; }
}

/* Quick Launcher setup */
.quick-launcher-settings-card {
    width: min(430px, 94vw); padding: 18px; border-radius: 16px;
    border: 1px solid #273248; background: #0d1119; color: #e5e7eb;
    box-shadow: 0 24px 70px rgba(0,0,0,.8); transition: transform .15s ease;
    font-family: 'Hind Siliguri Light', 'Inter', sans-serif;
}
.quick-launcher-settings-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 13px; border-bottom: 1px solid #20293a; }
.quick-launcher-settings-head h3 { margin: 0; color: #fff; font-size: 17px; font-weight: 700; }
.quick-launcher-settings-head p { margin: 2px 0 0; color: #8290a6; font-size: 12px; }
.quick-launcher-close { width: 28px; height: 28px; border-radius: 7px; color: #8b98aa; background: #151b27; font-size: 19px; line-height: 1; }
.quick-launcher-close:hover { color: #fff; background: #20293a; }
.quick-launcher-enable-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px; border: 1px solid #263044; border-radius: 11px; background: #121824; cursor: pointer; }
.quick-launcher-enable-row > span:first-child { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.quick-launcher-enable-row strong { color: #f8fafc; font-size: 13px; font-weight: 700; }
.quick-launcher-enable-row small { color: #748198; font-size: 10.5px; line-height: 1.4; }
.quick-launcher-enable-row input { position: absolute; opacity: 0; pointer-events: none; }
.quick-launcher-switch { position: relative; flex: 0 0 36px; width: 36px; height: 20px; border-radius: 999px; background: #334155; transition: background .15s; }
.quick-launcher-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .15s; }
.quick-launcher-enable-row input:checked + .quick-launcher-switch { background: #0284c7; }
.quick-launcher-enable-row input:checked + .quick-launcher-switch::after { transform: translateX(16px); }
.quick-launcher-shortcut-block { margin-top: 13px; }
.quick-launcher-shortcut-block > label { display: block; margin-bottom: 5px; color: #aab5c6; font-size: 11px; }
.quick-launcher-shortcut-row { display: flex; gap: 7px; }
.quick-launcher-shortcut-row input { flex: 1 1 auto; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid #2d3a51; border-radius: 8px; background: #080c13; color: #7dd3fc; font-family: ui-monospace, Consolas, monospace; font-size: 12px; }
.quick-launcher-shortcut-row button { flex: 0 0 auto; padding: 0 11px; border: 1px solid #33435d; border-radius: 8px; background: #1a2333; color: #e2e8f0; font-size: 11px; }
.quick-launcher-shortcut-row button.is-capturing { border-color: #38bdf8; color: #38bdf8; background: rgba(2,132,199,.12); }
#quick-launcher-capture-hint { margin: 6px 0 0; color: #66758b; font-size: 10.5px; }
.quick-launcher-runtime-status { margin-top: 12px; padding: 7px 9px; border-radius: 7px; background: #0b1018; color: #8492a7; font-size: 11px; }
.quick-launcher-runtime-status.is-on { color: #34d399; background: rgba(16,185,129,.08); }
.quick-launcher-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.quick-launcher-actions button { padding: 8px 14px; border-radius: 8px; font-size: 11.5px; font-weight: 700; }
.quick-launcher-secondary { color: #cbd5e1; background: #1a2230; }
.quick-launcher-primary { color: #fff; background: linear-gradient(90deg,#0284c7,#38bdf8); }

/* Advanced Script: static classes avoid missing runtime Tailwind utilities in CEP. */
.advanced-modal-card { gap: 12px !important; }
.advanced-modal-body { min-height: 0; padding-right: 5px; }
#ghostae-advanced-preset-picker {
    position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(0,0,0,.78); backdrop-filter: blur(5px);
}
.advanced-preset-picker-card { width: min(560px, 96vw); max-height: min(560px, 86vh); overflow: hidden; display: flex; flex-direction: column; border: 1px solid #2a354b; border-radius: 14px; background: #0f141e; box-shadow: 0 24px 70px rgba(0,0,0,.85); }
.advanced-preset-picker-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid #252f43; }
.advanced-preset-picker-head strong { color: #fff; font-size: 13px; }
.advanced-preset-picker-close { width: 27px; height: 27px; border-radius: 7px; color: #94a3b8; background: #182131; font-size: 18px; }
.advanced-preset-search { margin: 10px 12px 0; height: 32px; padding: 0 10px; border: 1px solid #2b3950; border-radius: 8px; background: #080c13; color: #fff; font-size: 11.5px; }
.advanced-preset-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(150px,1fr)); gap: 7px; overflow-y: auto; padding: 12px; min-height: 0; }
.advanced-preset-option { display: grid; grid-template-columns: 46px minmax(0,1fr); align-items: center; gap: 8px; min-height: 52px; padding: 6px; border: 1px solid #253047; border-radius: 9px; background: #141a25; color: #d8dee9; text-align: left; }
.advanced-preset-option:hover, .advanced-preset-option.is-selected { border-color: #38bdf8; background: rgba(2,132,199,.12); }
.advanced-preset-option img { width: 46px; height: 36px; border-radius: 5px; object-fit: cover; background: #080b11; }
.advanced-preset-option span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; }
.advanced-preset-empty { grid-column: 1/-1; padding: 28px 10px; text-align: center; color: #77859a; font-size: 11px; }
.tester-chip.is-urgent { background: rgba(239, 68, 68, .14); border-color: rgba(239, 68, 68, .6); color: #f87171; animation: tester-pulse 1.2s ease-in-out infinite; }
@keyframes tester-pulse { 50% { opacity: .6; } }
@media (max-width: 430px) { .tester-chip-label { display: none; } }
