/* =========================================================================
   THÁNH LỒNG TIẾNG AI — CLOUD STUDIO DESKTOP-SYNC THEME (thanhlongtiengai.com/studio)
   Đồng bộ 100% màu sắc & giao diện từ bản Desktop App (v3.1.3 - style.css):
   - Cyberpunk Deep Navy (#03050a / #0A0F1E) với lưới Ambient Grid công nghệ
   - Kính mờ cao cấp Glassmorphism: rgba(13, 20, 38, 0.85) viền Neon Cyan (rgba(56, 189, 248, 0.35))
   - Logo thương hiệu: "Thánh" Trắng, "Lồng" Cyan (#00D4FF), "Tiếng" Tím (#7A5CFF), "AI" Xanh Neon (#00FFA3)
   - Tab chế độ: BẬT LÊN dùng Tím Neon rực rỡ (linear-gradient(135deg, rgba(176,38,255,0.45), rgba(147,51,234,0.3)), viền #c084fc)
   - Nút hành động chính: Phong cách nút "Xử lý tất cả" (#c084fc / #b026ff glow)
   - Nút công cụ & Nạp Point: Phong cách nút "Thêm video" Cyan (#00D4FF / #38bdf8 glow)
   ========================================================================= */

:root {
    color-scheme: dark !important;
}

.studio-ui {
    color-scheme: dark !important;
    --primary-blue: #00D4FF;
    --primary-purple: #7A5CFF;
    --primary-green: #00FFA3;
    --primary: var(--primary-green);
    --primary-hover: #49ffc0;
    --bg-dark: #03050a;
    --card-bg: rgba(13, 20, 38, 0.82);
    --border-color: rgba(56, 189, 248, 0.28);
    --text-main: #FFFFFF;
    --text-muted: #94A3B8;
    --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.15);

    background-color: #03050a;
    background-image: 
        linear-gradient(rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 20% 25%, rgba(122, 92, 255, 0.12) 0%, transparent 45%),
        radial-gradient(circle at 80% 75%, rgba(0, 212, 255, 0.12) 0%, transparent 45%);
    background-size: 40px 40px, 40px 40px, 100% 100%, 100% 100%;
    color: var(--text-main);
    font-family: 'Be Vietnam Pro', 'Inter', system-ui, -apple-system, sans-serif;
    font-size: 13px;
    line-height: 1.6;
}

.studio-ui *, .studio-ui *:before, .studio-ui *:after {
    box-sizing: border-box;
}

.studio-ui ::selection {
    background: rgba(0, 212, 255, 0.35);
    color: #FFFFFF;
}

.studio-ui button, .studio-ui a, .studio-ui input, .studio-ui select {
    touch-action: manipulation;
}

.studio-ui button:focus-visible, .studio-ui a:focus-visible, .studio-ui input:focus-visible, .studio-ui select:focus-visible, .studio-ui [tabindex]:focus-visible {
    outline: 2px solid #00D4FF;
    outline-offset: 3px;
}

.studio-ui button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

.studio-ui .glass-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 212, 255, 0.06);
    border-radius: 16px;
    backdrop-filter: blur(16px);
}

.studio-ui .neon-border {
    border-color: rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.15);
}

/* -------------------------------------------------------------------------
   TOP NAVIGATION (Đồng bộ Thanh Tiêu Đề Desktop v3.1.3)
   ------------------------------------------------------------------------- */
.studio-ui .studio-header {
    background: rgba(6, 11, 25, 0.94);
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
    backdrop-filter: blur(16px);
}

.studio-ui .studio-header > div {
    max-width: 1648px;
    min-height: 72px;
    height: auto;
    padding: 12px 24px;
    overflow: visible;
    gap: 20px;
}

.studio-ui .studio-header > div > div:first-child {
    min-width: 0;
    flex-shrink: 0;
}

.studio-ui .studio-header a.group {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.studio-ui .studio-header a.group > img {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1.5px solid rgba(56, 189, 248, 0.5);
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.35);
    flex-shrink: 0;
}

.studio-ui .studio-header a.group > div {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-width: 0;
}

.studio-ui .studio-header a.group > div > div:first-child {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.25;
    flex-wrap: nowrap;
}

.studio-ui .studio-header a.group > div > div > span:first-child {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .02em;
    background: linear-gradient(135deg, #FFFFFF 0%, #00D4FF 50%, #7A5CFF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
    white-space: nowrap;
}

.studio-ui .studio-header a.group > div > div > span:last-child {
    background: rgba(0, 255, 163, 0.12);
    color: #00FFA3;
    border: 1px solid #00FFA3;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 8px;
    letter-spacing: .05em;
    text-shadow: 0 0 8px rgba(0, 255, 163, 0.5);
    white-space: nowrap;
}

.studio-ui .studio-header a.group p {
    color: #94a3b8;
    font-size: 11px;
    margin: 2px 0 0;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 380px;
}

.studio-ui .studio-header a.group p span.text-sky-300,
.studio-ui .studio-header a.group p b {
    color: #00D4FF;
    font-weight: 700;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

.studio-ui .studio-header > div > div:last-child {
    gap: 10px;
    min-width: 0;
}

.studio-ui .studio-header a[href="/"]:not(.group) {
    color: #cbd5e1;
    font-weight: 600;
    font-size: 12px;
    padding: 7px 12px;
    border-radius: 8px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    background: rgba(15, 23, 42, 0.6);
    transition: all .15s ease;
}

.studio-ui .studio-header a[href="/"]:not(.group):hover {
    color: #00D4FF;
    border-color: rgba(56, 189, 248, 0.6);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.25);
}

@media(max-width: 1279px) {
    .studio-ui .studio-header a.group > div > div > span:last-child {
        display: none !important;
    }
    .studio-ui .studio-header a[href="/downloads/"] {
        display: none !important;
    }
    .studio-ui .studio-header a.group p {
        max-width: 260px;
    }
}

@media(max-width: 1023px) {
    .studio-ui .studio-header a.group p {
        display: none !important;
    }
}

/* Point Wallet Badge (Phong cách Widget Desktop) */
.studio-ui .studio-header [class*="bg-slate-"] {
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
    border-radius: 12px;
}

.studio-ui .studio-header :is([class*="text-slate-"], [class*="text-sky-"]) {
    color: #7dd3fc;
}

.studio-ui .studio-header #headerPointsVal {
    color: #00FFA3;
    font-size: 14px;
    font-weight: 800;
    text-shadow: 0 0 8px rgba(0, 255, 163, 0.6);
}

.studio-ui .studio-header [onclick="openTopupModal()"] {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.85) 0%, rgba(0, 150, 255, 0.95) 100%) !important;
    color: #ffffff !important;
    border: 1px solid #38bdf8 !important;
    border-radius: 9px;
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.5) !important;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
    font-weight: 800;
    padding: 6px 12px;
    transition: all .2s ease;
}

.studio-ui .studio-header [onclick="openTopupModal()"]:hover {
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.8) !important;
    transform: translateY(-1px);
}

.studio-ui .studio-header #authGuestArea {
    gap: 8px;
}

.studio-ui .studio-header #authGuestArea > a {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #ffffff;
    color: #0f172a;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: all .15s ease;
}

.studio-ui .studio-header #authGuestArea > a:hover {
    background: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.4);
}

.studio-ui .studio-header [onclick="openAuthModal('login')"] {
    background: rgba(15, 23, 42, 0.85);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.45);
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.15);
    transition: all .15s ease;
}

.studio-ui .studio-header [onclick="openAuthModal('login')"]:hover {
    background: rgba(14, 165, 233, 0.2);
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}

.studio-ui .studio-header #authUserArea [onclick="openHistoryModal()"] {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #cbd5e1;
    font-weight: 600;
    border-radius: 10px;
    transition: all .15s ease;
}

.studio-ui .studio-header #authUserArea [onclick="openHistoryModal()"]:hover {
    color: #00D4FF;
    border-color: #38bdf8;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

.studio-ui .studio-header #authUserArea > div {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 10px;
}

.studio-ui .studio-header #authUserArea #userNameTxt {
    color: #e2e8f0;
    font-weight: 700;
    max-width: 100px;
}

.studio-ui .studio-header #authUserArea [onclick="logoutWebUser()"] {
    color: #94a3b8;
    transition: color .15s ease;
}

.studio-ui .studio-header #authUserArea [onclick="logoutWebUser()"]:hover {
    color: #ff4b4b;
    text-shadow: 0 0 8px rgba(255, 75, 75, 0.6);
}

/* -------------------------------------------------------------------------
   WORKSPACE HEADING & PROCESS STEPS
   ------------------------------------------------------------------------- */
.studio-ui .studio-workspace {
    max-width: 1648px;
    padding: 22px 24px 50px;
}

.studio-workspace-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.studio-eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
    color: #00D4FF;
    font-weight: 800;
    text-transform: uppercase;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.studio-workspace-heading h1 {
    font-size: 24px;
    letter-spacing: -.4px;
    line-height: 1.35;
    font-weight: 800;
    color: #FFFFFF;
    margin: 4px 0;
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.2);
}

.studio-workspace-heading p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

.studio-help-link {
    font-size: 12px;
    color: #00D4FF;
    font-weight: 700;
    white-space: nowrap;
    display: flex;
    gap: 15px;
    align-items: center;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
    transition: all .15s ease;
}

.studio-help-link:hover {
    color: #7dd3fc;
    transform: translateX(2px);
}

.studio-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 23px;
    margin: 0 0 20px;
    padding: 12px 20px;
    background: rgba(13, 20, 38, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 14px;
    box-shadow: 0 0 18px rgba(0, 212, 255, 0.08);
}

.studio-steps button {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    text-align: left;
    transition: all .15s ease;
}

.studio-steps button span {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    background: rgba(15, 23, 42, 0.9);
    color: #38bdf8;
    transition: all .15s ease;
}

.studio-steps button b {
    font-weight: 600;
}

.studio-steps button:hover {
    color: #ffffff;
}

.studio-steps button:hover span {
    border-color: #00D4FF;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.studio-steps button:first-child span, .studio-steps button.is-complete span {
    background: linear-gradient(135deg, #00D4FF 0%, #7A5CFF 100%);
    color: #ffffff;
    border-color: #38bdf8;
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.6);
}

.studio-steps i {
    width: 54px;
    height: 1px;
    background: rgba(56, 189, 248, 0.25);
    flex-shrink: 1;
}

/* -------------------------------------------------------------------------
   WORKSPACE LAYOUT
   ------------------------------------------------------------------------- */
.studio-ui .studio-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.studio-ui .studio-preview-column, .studio-ui .studio-control-column {
    grid-column: auto;
    min-width: 0;
}

/* -------------------------------------------------------------------------
   LEFT COLUMN: SÂN KHẤU XEM TRƯỚC (PREVIEW)
   ------------------------------------------------------------------------- */
.studio-ui #studioPreviewCard {
    padding: 20px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 212, 255, 0.06);
}

.studio-ui #studioPreviewCard > div:first-child {
    flex-wrap: wrap;
    row-gap: 10px;
}

.studio-ui #studioPreviewCard h2, .studio-panel-title {
    font-weight: 800;
    letter-spacing: .02em;
    text-transform: uppercase;
    font-size: 14px;
    color: #FFFFFF;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    margin: 0;
}

.studio-ui #studioPreviewCard > div:first-child button {
    font-weight: 600;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.1);
    transition: all .15s ease;
}

.studio-ui #studioPreviewCard > div:first-child button:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.studio-ui #aspectBadge {
    background: rgba(0, 212, 255, 0.14);
    color: #00D4FF;
    border: 1px solid rgba(0, 212, 255, 0.4);
    font-weight: 750;
    font-size: 11px;
    border-radius: 6px;
    padding: 3px 8px;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* Sân khấu video Canvas */
.studio-ui #videoStage {
    height: clamp(270px, 42vh, 450px);
    background: #020408;
    border: 1.5px solid rgba(56, 189, 248, 0.35);
    border-radius: 12px;
    box-shadow: inset 0 0 25px rgba(0, 0, 0, 0.85), 0 0 15px rgba(0, 212, 255, 0.08);
}

.studio-ui #videoFrameStage {
    max-height: 100%;
    max-width: 100%;
}

.studio-ui #editingOverlaysContainer {
    visibility: visible !important;
}

.studio-ui #studioVideo {
    max-height: clamp(270px, 42vh, 450px);
    max-width: 100%;
    border-radius: 0;
}

.studio-ui #uploadDropzone {
    padding: 28px 20px;
    min-height: 100%;
}

.studio-ui #uploadDropzone > div {
    background: rgba(0, 212, 255, 0.12);
    border: 1.5px solid rgba(0, 212, 255, 0.45);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.25);
    color: #00D4FF;
}

.studio-ui #uploadDropzone > p:first-of-type {
    font-size: 14px;
    font-weight: 750;
    max-width: 350px;
    line-height: 1.7;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.studio-ui #uploadDropzone > p:nth-of-type(2) {
    font-size: 11px;
    line-height: 1.8;
    max-width: 310px;
    color: #94a3b8;
}

.studio-ui #uploadDropzone > span {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.9) 0%, rgba(0, 130, 255, 0.85) 100%);
    border: 1px solid #38bdf8;
    color: #ffffff;
    font-weight: 750;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.55);
    padding: 10px 20px;
    border-radius: 9px;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.4);
    transition: all .2s ease;
}

.studio-ui #uploadDropzone > span:hover {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.8);
    transform: translateY(-1px);
}

/* Thanh điều khiển video dưới khung preview */
.studio-ui #studioPreviewCard > div:last-child {
    background: rgba(10, 15, 30, 0.95);
    border-top: 1px solid rgba(56, 189, 248, 0.25);
    padding: 12px 14px;
    border-radius: 0 0 12px 12px;
}

.studio-ui #studioPreviewCard > div:last-child > div:last-child {
    overflow: visible;
    flex-wrap: wrap;
    row-gap: 10px;
}

.studio-ui #studioPreviewCard > div:last-child button {
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.1);
    font-weight: 600;
    font-size: 11.5px;
    min-height: 32px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #e2e8f0;
    border-radius: 8px;
    transition: all .15s ease;
}

.studio-ui #studioPreviewCard > div:last-child button:hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: #38bdf8;
    color: #00D4FF;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.studio-ui #btnPlayerPlayPause {
    background: linear-gradient(135deg, #7A5CFF 0%, #a855f7 100%) !important;
    color: #ffffff !important;
    border: 1px solid #c084fc !important;
    box-shadow: 0 0 18px rgba(168, 85, 247, 0.6) !important;
}

.studio-ui #btnPlayerPlayPause:hover {
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.85) !important;
}

.studio-ui #playerTimeTxt {
    color: #00D4FF;
    font-weight: 750;
    font-family: monospace, sans-serif;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.studio-ui #studioPreviewCard > div:last-child > div:last-child > div:last-child {
    flex-basis: 100%;
    justify-content: space-between;
}

.studio-ui #videoMetaInfo {
    max-width: 45%;
    color: #94a3b8;
    font-weight: 550;
}

.studio-ui #blurBoxLabelTxt {
    font-size: 10px;
    max-width: 55%;
    font-weight: 500;
    color: #fbbf24;
}

/* -------------------------------------------------------------------------
   LEFT COLUMN: BẢNG KỊCH BẢN & PHÂN ĐOẠN THEO THỜI GIAN
   ------------------------------------------------------------------------- */
.studio-ui #studioScriptPanel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    border-radius: 16px;
    padding: 20px;
    margin-top: 18px;
}

.studio-ui #studioScriptPanel h3 {
    font-size: 13.5px;
    color: #FFFFFF;
    letter-spacing: .02em;
    text-transform: uppercase;
    font-weight: 750;
}

.studio-ui #studioScriptPanel > div:first-child {
    gap: 12px;
    align-items: flex-start;
}

.studio-ui #studioScriptPanel > div:first-child > div {
    flex-wrap: wrap;
    gap: 6px;
}

.studio-ui #studioScriptPanel #segCountBadge {
    background: rgba(122, 92, 255, 0.2);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.45);
    font-weight: 750;
    border-radius: 6px;
    padding: 2px 8px;
    text-shadow: 0 0 8px rgba(192, 132, 252, 0.5);
}

.studio-ui #studioScriptPanel #btnAnalyzeSub {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.85) 0%, rgba(0, 150, 255, 0.95) 100%) !important;
    border: 1px solid #38bdf8 !important;
    color: #ffffff !important;
    font-weight: 750 !important;
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.45) !important;
    border-radius: 8px;
    transition: all .2s ease;
}

.studio-ui #studioScriptPanel #btnAnalyzeSub:hover {
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.75) !important;
}

.studio-ui #studioScriptPanel button:not(#btnAnalyzeSub) {
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.1);
    min-height: 32px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #cbd5e1;
    border-radius: 8px;
    transition: all .15s ease;
}

.studio-ui #studioScriptPanel button:not(#btnAnalyzeSub):hover {
    background: rgba(14, 165, 233, 0.2);
    border-color: #38bdf8;
    color: #ffffff;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.35);
}

.studio-ui #segmentsContainer {
    max-height: 230px;
    padding-right: 4px;
}

.studio-ui #segmentsContainer > .seg-row {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 9px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    gap: 7px;
    padding: 8px;
    transition: all .15s ease;
}

.studio-ui #segmentsContainer > .seg-row:hover {
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.18);
}

.studio-ui #segmentsContainer input {
    background: rgba(10, 15, 30, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-size: 11.5px;
    font-weight: 600;
    color: #00D4FF;
    border-radius: 6px;
    min-width: 0;
    font-family: monospace;
}

.studio-ui #segmentsContainer .seg-text {
    background: rgba(10, 15, 30, 0.95);
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 500;
    font-family: inherit;
    border-color: rgba(56, 189, 248, 0.3);
}

.studio-ui #segmentsContainer .seg-text:focus {
    border-color: #00D4FF;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.35);
}

.studio-ui #segmentsContainer > div:not(.seg-row) {
    font-size: 11.5px;
    padding: 24px 18px;
    background: rgba(15, 23, 42, 0.7);
    color: #94a3b8;
    line-height: 1.9;
    border: 1.5px dashed rgba(56, 189, 248, 0.3);
    border-radius: 10px;
}

/* Lịch sử công việc gần đây (Recent Jobs Panel) */
.studio-ui #studioRecentPanel {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
    border-radius: 16px;
    padding: 20px;
}

.studio-ui #studioRecentPanel h3 {
    font-size: 13px;
    font-weight: 750;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #FFFFFF;
}

.studio-ui #studioRecentPanel #recentJobsList > div {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 10px;
}

.studio-ui #studioRecentPanel :is([class*="text-slate-"], .text-white) {
    color: #e2e8f0;
}

/* -------------------------------------------------------------------------
   RIGHT COLUMN: BỘ ĐIỀU PHỐI AI (ĐỒNG BỘ 100% CỘT CÀI ĐẶT BẢN DESKTOP)
   ------------------------------------------------------------------------- */
.studio-ui #rightControlGlassCard {
    padding: 22px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 212, 255, 0.06);
}

.studio-ui #rightControlGlassCard > div, .studio-ui #rightControlGlassCard > section {
    margin-top: 16px;
}

/* Tab Chế Độ Dịch & Lồng Tiếng (Bản sao nguyên vẹn .workflow-tabs từ style.css Desktop) */
.studio-ui #rightControlGlassCard > div[class*="bg-slate-950"] {
    background: rgba(10, 15, 30, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 5px;
    border-radius: 12px;
}

.studio-ui #wfTab_dub, .studio-ui #wfTab_narrate {
    font-size: 13px;
    padding: 10px 12px;
    font-weight: 600;
    border-radius: 9px;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: none;
    transition: all .2s ease;
}

.studio-ui #wfTab_dub:hover, .studio-ui #wfTab_narrate:hover {
    color: #f1f5f9;
    border-color: rgba(192, 132, 252, 0.45);
    background: rgba(176, 38, 255, 0.09);
    box-shadow: 0 0 12px rgba(176, 38, 255, 0.3);
}

/* Trạng thái BẬT LÊN: Tím Neon rực rỡ chuẩn Desktop style.css line 707 */
.studio-ui #wfTab_dub[aria-pressed=true], .studio-ui #wfTab_narrate[aria-pressed=true] {
    background: linear-gradient(135deg, rgba(176, 38, 255, 0.45), rgba(147, 51, 234, 0.3)) !important;
    border: 1.5px solid #c084fc !important;
    color: #ffffff !important;
    font-weight: 750 !important;
    box-shadow: 0 0 20px rgba(176, 38, 255, 0.75), inset 0 0 10px rgba(176, 38, 255, 0.25) !important;
    text-shadow: 0 0 10px rgba(192, 132, 252, 0.95) !important;
}

.studio-ui #workflowDescBanner {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.3);
    padding: 10px 14px;
    color: #93c5fd;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.6;
    border-radius: 10px;
    min-height: 0;
}

.studio-ui #rightControlGlassCard > div[class*="bg-slate-900"] {
    background: transparent;
    border: 0;
    padding: 0;
}

/* Các trường chọn Dropdown & Input (Chuẩn Desktop style.css line 582 & 603) */
.studio-ui #rightControlGlassCard select, .studio-ui #rightControlGlassCard input[type=text], .studio-ui #rightControlGlassCard input[type=number] {
    background: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    border: 1.5px solid rgba(56, 189, 248, 0.45);
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.15), inset 0 0 4px rgba(56, 189, 248, 0.06);
    font-weight: 600;
    border-radius: 10px;
    font-size: 13px;
    min-width: 0;
    transition: all .2s ease;
}

.studio-ui #rightControlGlassCard select {
    min-height: 42px;
    padding: 9px 12px;
}

.studio-ui #rightControlGlassCard select:hover, .studio-ui #rightControlGlassCard input[type=text]:hover, .studio-ui #rightControlGlassCard input[type=number]:hover {
    border-color: rgba(56, 189, 248, 0.75);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25), inset 0 0 6px rgba(56, 189, 248, 0.1);
}

.studio-ui #rightControlGlassCard :is(select, input):focus-visible {
    border-color: #38bdf8 !important;
    outline: none !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.4), 0 0 0 2px rgba(56, 189, 248, 0.2) !important;
}

.studio-ui #rightControlGlassCard label {
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.6;
    color: #38bdf8;
    text-shadow: 0 0 6px rgba(56, 189, 248, 0.35);
}

.studio-ui #rightControlGlassCard :is([class*="text-sky-"], [class*="text-cyan-"], [class*="text-indigo-"], [class*="text-purple-"]) {
    color: #38bdf8;
}

.studio-ui #rightControlGlassCard [class*="text-amber-"] {
    color: #fbbf24;
}

.studio-ui #rightControlGlassCard [class*="text-emerald-"] {
    color: #00FFA3;
    text-shadow: 0 0 8px rgba(0, 255, 163, 0.5);
}

.studio-ui #rightControlGlassCard [class*="text-slate-400"] {
    color: #94a3b8;
}

.studio-ui #rightControlGlassCard [class*="text-slate-300"] {
    color: #cbd5e1;
}

.studio-ui #rightControlGlassCard .text-white {
    color: #ffffff;
}

.studio-ui #rightControlGlassCard [class*="bg-sky-500/20"]:not([id^=wfTab]) {
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid rgba(0, 212, 255, 0.4);
    color: #00D4FF;
}

.studio-ui #rightControlGlassCard button {
    box-shadow: none;
    font-weight: 600;
}

.studio-ui #btnPlayVoiceSample, .studio-ui #btnPreviewBgm, .studio-ui #btnPreviewCustomBgm {
    background: rgba(14, 165, 233, 0.18) !important;
    border: 1px solid #38bdf8 !important;
    color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.3) !important;
    font-weight: 750;
    border-radius: 9px;
    transition: all .2s ease;
}

.studio-ui #btnPlayVoiceSample:hover, .studio-ui #btnPreviewBgm:hover, .studio-ui #btnPreviewCustomBgm:hover {
    background: rgba(14, 165, 233, 0.35) !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.55) !important;
}

.studio-ui #voiceSelectDropdown {
    font-size: 12.5px;
}

.studio-ui #voiceSelectDropdown:empty {
    background: rgba(15, 23, 42, 0.85);
}

/* Nút Clone Giọng Nói (Đồng bộ nút Tím Cyberpunk trên Desktop) */
.studio-ui #rightControlGlassCard [onclick="toggleCloneDrawer()"] {
    background: linear-gradient(135deg, rgba(176, 38, 255, 0.45), rgba(147, 51, 234, 0.3)) !important;
    border: 1.5px solid #c084fc !important;
    color: #ffffff !important;
    font-size: 12.5px;
    font-weight: 750 !important;
    justify-content: flex-start;
    padding: 10px 14px;
    border-radius: 10px;
    box-shadow: 0 0 18px rgba(176, 38, 255, 0.6) !important;
    text-shadow: 0 0 10px rgba(192, 132, 252, 0.8) !important;
    transition: all .2s ease;
}

.studio-ui #rightControlGlassCard [onclick="toggleCloneDrawer()"]:after {
    content: '⌄';
    margin-left: auto;
    font-size: 14px;
}

.studio-ui #rightControlGlassCard [onclick="toggleCloneDrawer()"]:hover {
    box-shadow: 0 0 28px rgba(176, 38, 255, 0.9) !important;
    transform: translateY(-1px);
}

.studio-ui #inlineCloneDrawer {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(192, 132, 252, 0.4);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 0 20px rgba(176, 38, 255, 0.2);
}

.studio-ui #inlineCloneDrawer > div:first-child {
    background: rgba(176, 38, 255, 0.15);
    border: 1px solid rgba(192, 132, 252, 0.4);
    color: #e9d5ff;
    font-weight: 550;
    border-radius: 9px;
}

.studio-ui #inlineCloneDrawer input, .studio-ui #inlineCloneDrawer select {
    background: rgba(10, 15, 30, 0.95);
    border: 1.5px solid rgba(56, 189, 248, 0.45);
    color: #ffffff;
}

.studio-ui #inlineCloneDrawer label {
    color: #38bdf8;
    font-weight: 650;
}

@media (min-width: 640px) {
    .studio-ui #rightControlGlassCard [class*="sm:col-span-7"] {
        grid-column: span 8 / span 8 !important;
        width: 100% !important;
    }
    .studio-ui #rightControlGlassCard [class*="sm:col-span-5"] {
        grid-column: span 4 / span 4 !important;
        width: 100% !important;
    }
}

@media (max-width: 639px) {
    .studio-ui #rightControlGlassCard [class*="sm:grid-cols-12"] {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    .studio-ui #rightControlGlassCard [class*="sm:col-span-7"],
    .studio-ui #rightControlGlassCard [class*="sm:col-span-5"] {
        grid-column: 1 / -1 !important;
        width: 100% !important;
    }
}

.studio-ui #rightControlGlassCard [class*="sm:col-span-7"] label {
    flex-wrap: wrap !important;
    gap: 6px !important;
}

.studio-ui #rightControlGlassCard [class*="sm:col-span-5"] > div:last-child {
    border: 1.5px solid rgba(56, 189, 248, 0.45);
    background: rgba(15, 23, 42, 0.85);
    border-radius: 10px;
}

.studio-ui #speedVal {
    color: #00FFA3;
    font-weight: 800;
    font-family: monospace;
    text-shadow: 0 0 8px rgba(0, 255, 163, 0.6);
}

/* Thanh trượt và Checkbox */
.studio-ui input[type=range] {
    accent-color: #00D4FF;
    min-width: 0;
    max-width: 100%;
}

.studio-ui input[type=checkbox] {
    accent-color: #00D4FF;
}

/* Tùy chọn xử lý âm thanh & Kháng bản quyền */
.studio-ui #studioProcessingOptions {
    padding-top: 16px;
    border-top: 1px solid rgba(56, 189, 248, 0.25);
}

.studio-ui #studioProcessingOptions > div {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 13px;
}

.studio-ui #studioProcessingOptions > div:first-child .flex-1 > div {
    flex-wrap: wrap;
    gap: 5px;
}

.studio-ui #studioProcessingOptions > div:first-child .flex-1 > div > span:first-child {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.studio-ui #studioProcessingOptions > div:first-child p {
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.7;
}

.studio-ui #studioProcessingOptions > div:last-child > label span {
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
}

.studio-ui #antiCopyrightOptionsGrid {
    padding-left: 0;
    font-size: 12px;
    gap: 12px;
    margin-top: 12px;
    color: #cbd5e1;
}

.studio-ui #antiCopyrightOptionsGrid label {
    color: #e2e8f0;
    font-weight: 550;
}

.studio-ui #antiCopyrightOptionsGrid input[type=checkbox] {
    accent-color: #fbbf24;
}

.studio-ui #reupZoomVal {
    background: rgba(10, 15, 30, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #00FFA3;
    font-weight: 700;
    font-family: monospace;
}

/* Cài đặt chi tiết (BGM, Phụ đề, Watermark) */
.studio-ui #studioDetailSettings {
    padding: 18px 0 0;
    border-top: 1px solid rgba(56, 189, 248, 0.25);
}

.studio-ui #studioDetailSettings #studioSettingsTabBar {
    background: rgba(10, 15, 30, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 4px;
    border-radius: 12px;
    gap: 4px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.studio-ui #studioDetailSettings .tab-btn {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    min-height: 38px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all .2s ease;
}

.studio-ui #studioDetailSettings .tab-btn:hover {
    color: #ffffff;
    background: rgba(56, 189, 248, 0.12);
}

/* Tab cài đặt được chọn: Cyan Neon chuẩn Desktop */
.studio-ui #studioDetailSettings .tab-btn.active {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.4), rgba(0, 150, 255, 0.25)) !important;
    border: 1.5px solid #38bdf8 !important;
    color: #ffffff !important;
    font-weight: 750 !important;
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.5) !important;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.6) !important;
}

.studio-ui #studioDetailSettings [id^=settingsPane_] {
    background: transparent;
    border: 0;
    padding: 14px 0 0;
}

.studio-ui #studioDetailSettings :is([class*="bg-slate-950"], [class*="bg-slate-900"]) {
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
}

.studio-ui #studioDetailSettings [class*="bg-slate-800"] {
    background: rgba(10, 15, 30, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.studio-ui #studioDetailSettings .text-white {
    color: #ffffff;
}

.studio-ui #studioDetailSettings [class*="border-slate-"] {
    border-color: rgba(56, 189, 248, 0.25);
}

.studio-ui #studioDetailSettings [class*="text-[11px]"] {
    line-height: 1.7;
}

.studio-ui #studioDetailSettings [class*="font-extrabold"] {
    font-weight: 700;
}

.studio-ui #studioDetailSettings [class*="uppercase"] {
    text-transform: none;
    letter-spacing: 0;
}

.studio-ui #studioDetailSettings button {
    font-size: 11px;
    min-height: 32px;
}

.studio-ui #studioDetailSettings input[type=number] {
    padding-inline: 4px;
    font-size: 11.5px;
}

.studio-ui #rightControlGlassCard #btnAutoDetectSub {
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid #38bdf8;
    color: #00D4FF;
    font-weight: 750;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.25);
    border-radius: 8px;
    transition: all .2s ease;
}

.studio-ui #rightControlGlassCard #btnAutoDetectSub:hover {
    background: rgba(0, 212, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    color: #ffffff;
}

.studio-ui #settingsPane_watermark > .grid {
    grid-template-columns: 1fr;
}

.studio-ui #settingsPane_watermark > div:first-child {
    background: rgba(176, 38, 255, 0.15);
    border: 1px solid rgba(192, 132, 252, 0.4);
    color: #e9d5ff;
    font-size: 11px;
    font-weight: 550;
    border-radius: 9px;
}

.studio-ui #settingsPane_watermark .flex-wrap button {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #cbd5e1;
    font-weight: 650;
    border-radius: 8px;
    transition: all .15s ease;
}

.studio-ui #settingsPane_watermark .flex-wrap button:hover {
    background: rgba(14, 165, 233, 0.25);
    border-color: #38bdf8;
    color: #00D4FF;
}

.studio-ui #settingsPane_watermark .flex-wrap button.active {
    background: rgba(0, 212, 255, 0.3);
    border-color: #38bdf8;
    color: #00D4FF;
    font-weight: 800;
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.45);
}

.studio-ui #settingsPane_bgm > .grid:first-child {
    gap: 8px;
}

.studio-ui #settingsPane_bgm .grid.grid-cols-1.sm\:grid-cols-2 {
    grid-template-columns: minmax(0, 1fr);
}

.studio-ui #settingsPane_bgm > *,
.studio-ui #settingsPane_bgm .grid > *,
.studio-ui #bgmBrowserPanel,
.studio-ui #bgmCategoryPillsRow,
.studio-ui #bgmTracksGridList {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.studio-ui #bgmCategoryPillsRow {
    flex-wrap: wrap !important;
    overflow-x: hidden !important;
    row-gap: 6px !important;
}

.studio-ui #customBgmDropdownRow {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
}

.studio-ui #customBgmTrackSelect,
.studio-ui #bgmTrackSelect {
    flex: 1 1 0% !important;
    min-width: 0 !important;
    width: 0 !important;
}

.studio-ui #settingsPane_bgm select {
    font-size: 12px;
}

.studio-ui #bgmCategoryFilterSelect {
    max-width: 160px;
}

.studio-ui #bgmNowPlayingTxt {
    min-width: 0;
    flex: 1;
}

.studio-ui #customBgmFileLabel {
    min-width: 0;
}

/* -------------------------------------------------------------------------
   BOTTOM ACTION BAR (CTA) — ĐỒNG BỘ NÚT HÀNH ĐỘNG DƯỚI ĐÁY DESKTOP
   ------------------------------------------------------------------------- */
.studio-ui #primaryCtaBarWrap {
    position: static !important;
    inset: auto !important;
    margin-top: 18px !important;
    padding: 14px 16px !important;
    border: 1.5px solid rgba(56, 189, 248, 0.35) !important;
    background: rgba(10, 16, 32, 0.95) !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 212, 255, 0.1) !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.studio-ui #antiCopyrightOptionsGrid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px 14px !important;
    align-items: center;
}

.studio-ui #antiCopyrightOptionsGrid label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.studio-ui #primaryCtaBarWrap > div:first-child {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none;
    border-radius: 12px;
    padding: 0;
    gap: 14px;
    flex-direction: column;
    align-items: stretch;
}

.studio-ui #ctaCostInfoBox {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.studio-ui #ctaCostInfoBox > div:first-child {
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
    border-radius: 10px;
    padding: 6px 14px;
}

.studio-ui #ctaCostInfoBox > div:first-child > div:first-child {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .05em;
    font-weight: 750;
    color: #7dd3fc;
}

.studio-ui #ctaCostInfoBox > div:last-child {
    font-size: 10px;
    line-height: 1.8;
    max-width: 210px;
    color: #94a3b8;
}

.studio-ui #ctaCostInfoBox > div:last-child .text-sky-300 {
    color: #00D4FF;
    font-weight: 700;
}

.studio-ui #ctaCostInfoBox > div:last-child .text-emerald-400 {
    color: #00FFA3;
    font-weight: 750;
}

.studio-ui #estimatedPointsTxt {
    font-weight: 850;
    font-size: 16px;
    color: #00FFA3;
    font-family: monospace;
    text-shadow: 0 0 10px rgba(0, 255, 163, 0.6);
}

.studio-ui[data-studio-source=empty] #estimatedPointsTxt {
    display: none;
}

.studio-ui #studioEmptyCostNotice {
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    white-space: normal;
}

.studio-ui #studioEmptyCostNotice[hidden] {
    display: none;
}

.studio-ui #primaryCtaBarWrap > div:first-child > div:last-child {
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
    gap: 8px;
}

/* NÚT TẠO VIDEO CLOUD (Bản sao hoàn hảo của nút '▷ Xử lý tất cả' Desktop) */
.studio-ui #btnCreateVideoMain {
    width: 100%;
    flex: 1;
    min-height: 48px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .03em;
    padding: 12px 20px;
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(176, 38, 255, 0.55), rgba(147, 51, 234, 0.4)) !important;
    border: 1.5px solid #c084fc !important;
    color: #ffffff !important;
    box-shadow: 0 0 25px rgba(176, 38, 255, 0.8), inset 0 0 10px rgba(176, 38, 255, 0.3) !important;
    text-shadow: 0 0 10px rgba(192, 132, 252, 0.95) !important;
    transition: all .2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.studio-ui #btnCreateVideoMain:hover {
    box-shadow: 0 0 35px rgba(176, 38, 255, 1), inset 0 0 15px rgba(176, 38, 255, 0.45) !important;
    transform: translateY(-1px) !important;
}

.studio-ui #btnCreateVideoMain.btn-watch-cta {
    background: linear-gradient(135deg, rgba(0, 255, 163, 0.45), rgba(5, 150, 105, 0.35)) !important;
    border: 1.5px solid #00FFA3 !important;
    color: #ffffff !important;
    box-shadow: 0 0 25px rgba(0, 255, 163, 0.75), inset 0 0 10px rgba(0, 255, 163, 0.3) !important;
    text-shadow: 0 0 10px rgba(0, 255, 163, 0.9) !important;
}

.studio-ui #btnQuickDownloadMp4 {
    min-height: 46px;
    font-size: 12px;
    font-weight: 750;
    padding: 10px 16px;
    background: rgba(0, 255, 163, 0.16) !important;
    border: 1px solid #00FFA3 !important;
    color: #00FFA3 !important;
    border-radius: 10px;
    box-shadow: 0 0 14px rgba(0, 255, 163, 0.35) !important;
    text-shadow: 0 0 8px rgba(0, 255, 163, 0.5);
    transition: all .2s ease;
}

.studio-ui #btnQuickDownloadMp4:hover {
    background: rgba(0, 255, 163, 0.3) !important;
    box-shadow: 0 0 22px rgba(0, 255, 163, 0.6) !important;
}

.studio-ui #btnReRenderVideo {
    min-height: 46px;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 16px;
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    color: #38bdf8 !important;
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
    transition: all .2s ease;
}

.studio-ui #btnReRenderVideo:hover {
    background: rgba(14, 165, 233, 0.25) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.45) !important;
}

/* Banner tiến trình kết xuất video */
.studio-ui #inlineRenderStatusBanner {
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1.5px solid #38bdf8 !important;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.3) !important;
    border-radius: 14px;
}

.studio-ui #inlineRenderStep {
    color: #38bdf8 !important;
    font-weight: 750 !important;
}

.studio-ui #inlineRenderPct {
    background: rgba(0, 212, 255, 0.2) !important;
    color: #00D4FF !important;
    border: 1px solid #38bdf8 !important;
    font-weight: 800 !important;
    border-radius: 6px;
    padding: 2px 8px;
    font-family: monospace;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.6);
}

.studio-ui #inlineRenderBar {
    background: linear-gradient(90deg, #00D4FF, #7A5CFF) !important;
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.6) !important;
}

.studio-ui #inlineRenderSpinner {
    border-color: #00D4FF !important;
    border-top-color: transparent !important;
}

/* -------------------------------------------------------------------------
   MODALS: LOGIN, NẠP POINT, LỊCH SỬ (CYBERPUNK GLASS)
   ------------------------------------------------------------------------- */
.studio-ui :is(#authModal, #topupModal, #historyModal) .glass-card {
    background: rgba(13, 20, 38, 0.96) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.4) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(0, 212, 255, 0.15) !important;
    border-radius: 20px;
}

.studio-ui :is(#authModal, #topupModal, #historyModal) h3 {
    color: #FFFFFF !important;
    font-weight: 800 !important;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.25);
}

.studio-ui :is(#authModal, #topupModal, #historyModal) p {
    color: #94a3b8 !important;
}

.studio-ui :is(#authModal, #topupModal, #historyModal) input {
    background: rgba(10, 15, 30, 0.95) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.4) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    border-radius: 10px;
}

.studio-ui :is(#authModal, #topupModal, #historyModal) input:focus {
    border-color: #00D4FF !important;
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.4) !important;
}

.studio-ui :is(#authModal, #topupModal, #historyModal) :is([class*="bg-slate-900"], [class*="bg-slate-950"]) {
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    border-radius: 12px;
}

.studio-ui :is(#authModal, #topupModal, #historyModal) :is([class*="text-slate-300"], [class*="text-slate-400"]) {
    color: #cbd5e1 !important;
}

.studio-ui :is(#authModal, #topupModal, #historyModal) .text-white {
    color: #ffffff !important;
}

.studio-ui :is(#authModal, #topupModal, #historyModal) button.text-slate-400 {
    color: #94a3b8 !important;
}

.studio-ui :is(#authModal, #topupModal, #historyModal) button.text-slate-400:hover {
    color: #ffffff !important;
}

.studio-ui #authTabLogin,
.studio-ui #authTabRegister {
    font-weight: 750 !important;
    border-radius: 8px !important;
    transition: all .15s ease !important;
}

.studio-ui #authTabLogin:not(.text-slate-400),
.studio-ui #authTabRegister:not(.text-slate-400) {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.85), rgba(0, 150, 255, 0.95)) !important;
    color: #ffffff !important;
    box-shadow: 0 0 14px rgba(0, 212, 255, 0.5) !important;
}

.studio-ui #authSubmitBtn {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.85), rgba(0, 150, 255, 0.95)) !important;
    color: #ffffff !important;
    border: 1px solid #38bdf8 !important;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5) !important;
    font-weight: 800 !important;
    border-radius: 12px !important;
    transition: all .2s ease !important;
}

.studio-ui #authSubmitBtn:hover {
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.8) !important;
    transform: translateY(-1px);
}

.studio-ui #topupModal button[onclick*="manualCheckTopupOrder"] {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.85), rgba(0, 150, 255, 0.95)) !important;
    color: #ffffff !important;
    border: 1px solid #38bdf8 !important;
    font-weight: 800 !important;
    box-shadow: 0 0 16px rgba(0, 212, 255, 0.45) !important;
    border-radius: 10px !important;
}

.studio-ui #topupModal button[onclick*="manualCheckTopupOrder"]:hover {
    box-shadow: 0 0 25px rgba(0, 212, 255, 0.75) !important;
}

.studio-ui #topupModal [onclick*="selectTopupPack"] {
    transition: all .15s ease !important;
    border: 1.5px solid rgba(56, 189, 248, 0.25) !important;
    background: rgba(15, 23, 42, 0.85) !important;
}

.studio-ui #topupModal [onclick*="selectTopupPack"]:hover {
    border-color: #38bdf8 !important;
    background: rgba(14, 165, 233, 0.15) !important;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.3) !important;
}

/* -------------------------------------------------------------------------
   SCROLLBARS & ICON UTILITIES (ĐỒNG BỘ DESKTOP)
   ------------------------------------------------------------------------- */
.studio-ui .custom-scroll::-webkit-scrollbar {
    width: 6px;
}

.studio-ui .custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.3);
    border-radius: 10px;
}

.studio-ui .custom-scroll::-webkit-scrollbar-thumb:hover {
    background: #00D4FF;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.6);
}

.studio-ui .custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.studio-ui #studioWorkspace [id] {
    scroll-margin-top: 92px;
}

.studio-ui .studio-icon-label {
    column-gap: 7px;
}

.studio-ui svg[data-studio-icon] {
    display: inline-block;
    width: 15px;
    height: 15px;
    vertical-align: -2px;
    flex-shrink: 0;
    pointer-events: none;
    stroke: #38bdf8;
    filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.4));
}

.studio-ui .studio-icon-label:not(.flex):not(.inline-flex) > svg[data-studio-icon] {
    margin-right: 6px;
}

.studio-ui #uploadDropzone > div > svg[data-studio-icon] {
    width: 26px;
    height: 26px;
    margin: 0;
    stroke: #00D4FF;
    filter: drop-shadow(0 0 8px rgba(0, 212, 255, 0.6));
}

.studio-ui .studio-selection-detail {
    margin: 6px 0 0;
    font-size: 11.5px;
    line-height: 1.7;
    color: #94a3b8;
}

.studio-ui .studio-selection-detail[hidden] {
    display: none;
}

@media(min-width: 650px) {
    .studio-ui .studio-selection-detail {
        display: none;
    }
}

/* -------------------------------------------------------------------------
   RESPONSIVE DESIGN: DESKTOP & MOBILE MEDIA QUERIES
   ------------------------------------------------------------------------- */
@media(min-width: 1024px) {
    .studio-ui .studio-workspace {
        padding-top: 20px;
        padding-bottom: 50px;
    }
    .studio-ui .studio-header > div {
        min-height: 64px;
        padding-block: 10px;
    }
    .studio-workspace-heading {
        margin-bottom: 14px;
    }
    .studio-workspace-heading .studio-eyebrow, .studio-workspace-heading p {
        display: none;
    }
    .studio-workspace-heading h1 {
        font-size: 22px;
        margin: 0;
    }
    .studio-steps {
        margin-bottom: 16px;
        padding-block: 10px;
    }
    .studio-ui #primaryCtaBarWrap {
        position: static !important;
        inset: auto !important;
        background: rgba(10, 16, 32, 0.95) !important;
        border: 1.5px solid rgba(56, 189, 248, 0.35) !important;
        padding: 14px 18px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 212, 255, 0.1) !important;
    }
    .studio-ui #primaryCtaBarWrap > div:first-child {
        max-width: 1600px;
        margin: 0 auto;
        flex-direction: row;
        align-items: center;
        padding: 0;
        background: transparent !important;
        border: 0 !important;
        gap: 24px;
    }
    .studio-ui #primaryCtaBarWrap > div:first-child > div:last-child {
        width: auto;
        flex: 1;
        flex-wrap: nowrap;
        margin-left: auto;
        gap: 9px;
    }
    .studio-ui #ctaCostInfoBox {
        gap: 26px;
        flex-shrink: 0;
    }
    .studio-ui #ctaCostInfoBox > div:last-child {
        max-width: none;
        font-size: 10.5px;
    }
    .studio-ui #btnCreateVideoMain {
        width: auto;
        flex: initial;
        min-width: 195px;
    }
    .studio-ui #inlineRenderStatusBanner {
        max-width: 1600px;
        margin: 8px auto 0;
    }
    .studio-ui #settingsPane_bgm > .grid:first-child {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .studio-ui #settingsPane_bgm > .grid:first-child > div:last-child {
        grid-column: 1/-1;
    }
}

@media(min-width: 1024px) and (min-height: 850px) {
    .studio-ui .studio-preview-column {
        position: sticky;
        top: 90px;
        display: flex;
        flex-direction: column;
        max-height: calc(100dvh - 180px);
    }
    .studio-ui #studioPreviewCard {
        flex-shrink: 0;
    }
    .studio-ui #videoStage {
        height: clamp(270px, 36vh, 420px);
    }
    .studio-ui #studioVideo {
        max-height: clamp(270px, 36vh, 420px);
    }
    .studio-ui #studioScriptPanel {
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .studio-ui #studioScriptPanel #segmentsContainer {
        min-height: 65px;
        max-height: clamp(120px, 19vh, 220px);
        overflow-y: auto;
    }
}

@media(min-width: 1024px) and (max-height: 849px) {
    .studio-ui #videoStage {
        height: clamp(240px, 36vh, 340px);
    }
    .studio-ui #studioVideo {
        max-height: clamp(240px, 36vh, 340px);
    }
}

@media(min-width: 1600px) {
    .studio-ui .studio-layout {
        grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    }
    .studio-ui #videoStage {
        height: clamp(360px, 45vh, 530px);
    }
    .studio-ui #studioVideo {
        max-height: clamp(360px, 45vh, 530px);
    }
}

@media(max-width: 1200px) {
    .studio-ui .studio-header > div {
        gap: 10px;
    }
    .studio-ui .studio-layout {
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        gap: 16px;
    }
    .studio-ui #rightControlGlassCard {
        padding: 16px;
    }
    .studio-ui #rightControlGlassCard > .grid.grid-cols-1 {
        grid-template-columns: 1fr;
    }
    .studio-ui #studioDetailSettings .sm\:grid-cols-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .studio-ui #studioDetailSettings .sm\:grid-cols-3 > div:last-child {
        grid-column: 1/-1;
    }
    .studio-ui #studioScriptPanel h3 {
        font-size: 13px;
    }
    .studio-ui #studioScriptPanel #btnAnalyzeSub {
        font-size: 10px;
    }
}

@media(max-width: 1023px) {
    .studio-ui .studio-workspace {
        padding: 24px 20px 110px;
    }
    .studio-ui .studio-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .studio-ui .studio-preview-column {
        position: static;
    }
    .studio-ui #videoStage {
        height: 320px;
    }
    .studio-ui #studioVideo {
        max-height: 320px;
    }
    .studio-ui #primaryCtaBarWrap {
        position: static !important;
        inset: auto !important;
        background: rgba(10, 16, 32, 0.95) !important;
        border: 1.5px solid rgba(56, 189, 248, 0.35) !important;
        border-radius: 14px !important;
        padding: 12px 14px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 25px rgba(0, 212, 255, 0.1) !important;
    }
    .studio-ui #primaryCtaBarWrap > div:first-child {
        max-width: 900px;
        margin: 0 auto;
        border: 0 !important;
        padding: 0;
        flex-direction: row;
        align-items: center;
        gap: 15px;
        background: transparent !important;
    }
    .studio-ui #primaryCtaBarWrap > div:first-child > div:last-child {
        width: auto;
        flex: 1;
        flex-wrap: nowrap;
    }
    .studio-ui #ctaCostInfoBox {
        max-width: 200px;
        flex-shrink: 1;
    }
    .studio-ui #ctaCostInfoBox > div:last-child {
        display: none;
    }
    .studio-ui #primaryCtaBarWrap #btnCreateVideoMain {
        font-size: 12.5px;
        min-height: 44px;
        padding: 10px 14px;
    }
    .studio-ui #studioScriptPanel {
        padding: 17px;
    }
    .studio-ui #rightControlGlassCard {
        padding: 20px;
    }
    .studio-ui #rightControlGlassCard > .grid.grid-cols-1 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .studio-ui #studioDetailSettings > div:first-child > span {
        font-size: 11.5px;
        font-weight: 600;
        color: #94a3b8;
    }
    .studio-steps {
        gap: 15px;
        padding: 13px;
    }
    .studio-steps i {
        width: 35px;
    }
    .studio-steps button {
        font-size: 11.5px;
    }
    .studio-ui #studioWorkspace [id] {
        scroll-margin-top: 110px;
    }
}

@media(max-width: 767px) {
    .studio-ui .studio-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 50 !important;
    }
    .studio-ui .studio-header > div {
        padding: 6px 10px !important;
        flex-wrap: nowrap !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 6px !important;
        min-height: 52px !important;
        height: 52px !important;
        overflow: hidden !important;
    }
    .studio-ui .studio-header > div > div:first-child {
        flex: 0 0 auto !important;
        min-width: 32px !important;
    }
    .studio-ui .studio-header a.group {
        display: inline-flex !important;
        align-items: center !important;
        gap: 0 !important;
    }
    .studio-ui .studio-header a.group > img {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        border-radius: 8px !important;
        flex-shrink: 0 !important;
    }
    /* Trên mobile: Ẩn phần chữ logo thương hiệu TLT AI / Thánh Lồng Tiếng AI để nhường toàn bộ không gian cho các công cụ */
    .studio-ui .studio-header a.group > div {
        display: none !important;
    }
    .studio-ui .studio-header > div > div:last-child {
        flex: 0 1 auto !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
        align-items: center !important;
        gap: 5px !important;
        min-width: 0 !important;
    }
    /* Ví Point trên mobile: siêu gọn gàng, không tràn */
    .studio-ui .studio-header [class*="bg-slate-"] {
        padding: 2px 4px 2px 7px !important;
        gap: 4px !important;
        border-radius: 9px !important;
    }
    .studio-ui .studio-header #headerPointsVal {
        font-size: 12px !important;
    }
    .studio-ui .studio-header [onclick="openTopupModal()"] {
        font-size: 10.5px !important;
        padding: 4px 8px !important;
        min-height: 28px !important;
        border-radius: 7px !important;
    }
    /* Nút Theme và Bell gọn gàng 30x30 */
    .studio-ui #studioThemeToggleBtn,
    .studio-ui .studio-header-bell-btn {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        max-width: 30px !important;
        padding: 0 !important;
        border-radius: 8px !important;
        font-size: 13px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    .studio-ui .studio-header #authGuestArea {
        gap: 5px !important;
    }
    .studio-ui .studio-header #authGuestArea a, .studio-ui .studio-header #authGuestArea button {
        font-size: 10px !important;
        padding: 5px 8px !important;
        border-radius: 7px !important;
    }
    /* Tài khoản User trên mobile: CHỈ HIỆN ICON AVATAR ĐỂ KHÔNG CHIẾM CHỖ (theo đúng yêu cầu của User) */
    .studio-ui .studio-header #authUserArea {
        gap: 4px !important;
    }
    .studio-ui .studio-header #authUserArea > div {
        padding: 2px 5px !important;
        gap: 4px !important;
        border-radius: 8px !important;
    }
    .studio-ui .studio-header #authUserArea #userAvatarImg {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        border-radius: 9999px !important;
    }
    .studio-ui .studio-header #authUserArea #userNameTxt {
        display: none !important; /* Ẩn hẳn tên user để nhường chỗ */
    }
    .studio-ui .studio-header #authUserArea [onclick="logoutWebUser()"] {
        font-size: 11px !important;
        padding: 2px !important;
        line-height: 1 !important;
    }
    .studio-ui .studio-workspace {
        padding: 22px 16px 120px;
    }
    .studio-workspace-heading {
        margin-bottom: 19px;
        gap: 12px;
        align-items: flex-start;
    }
    .studio-workspace-heading h1 {
        font-size: 21px;
    }
    .studio-workspace-heading p {
        font-size: 11.5px;
        max-width: 250px;
    }
    .studio-eyebrow {
        font-size: 9px;
    }
    .studio-help-link {
        font-size: 10.5px;
        gap: 7px;
        margin-top: 22px;
    }
    .studio-steps {
        justify-content: space-between;
        gap: 6px;
        padding: 11px;
        margin-bottom: 19px;
    }
    .studio-steps button {
        flex-direction: column;
        gap: 6px;
        font-size: 9.5px;
        text-align: center;
        white-space: normal;
        flex: 1;
    }
    .studio-steps button span {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
    .studio-steps i {
        width: 15px;
        align-self: flex-start;
        margin-top: 12px;
    }
    .studio-ui #studioPreviewCard {
        padding: 14px;
    }
    .studio-ui #studioPreviewCard h2 {
        font-size: 13.5px;
    }
    .studio-ui #studioPreviewCard > div:first-child > div:last-child {
        flex-wrap: wrap;
        justify-content: flex-end;
    }
    .studio-ui #studioPreviewCard > div:first-child button {
        font-size: 10.5px;
        padding: 6px 9px;
    }
    .studio-ui #videoStage {
        height: 330px;
    }
    .studio-ui #studioVideo {
        max-height: 330px;
    }
    .studio-ui #studioPreviewCard > div:last-child > div:last-child > div:first-child {
        flex: 1;
        flex-wrap: wrap;
    }
    .studio-ui #studioPreviewCard > div:last-child button {
        width: auto;
        flex: 1;
        padding: 6px 8px;
        min-height: 34px;
        font-size: 10.5px;
    }
    .studio-ui #rightControlGlassCard {
        padding: 16px;
    }
    .studio-ui #rightControlGlassCard > .grid.grid-cols-1 {
        grid-template-columns: 1fr;
    }
    /* sm:col-span handled by responsive rules */
    .studio-ui #rightControlGlassCard input[type=range] {
        min-height: 20px;
    }
    .studio-ui #rightControlGlassCard label {
        font-size: 12px;
    }
    .studio-ui #studioDetailSettings .sm\:grid-cols-3 {
        grid-template-columns: 1fr;
    }
    .studio-ui #studioDetailSettings .sm\:grid-cols-3 > div:last-child {
        grid-column: auto;
    }
    .studio-ui #studioDetailSettings [id^=settingsPane_] {
        padding: 12px;
    }
    .studio-ui #studioDetailSettings .tab-btn {
        font-size: 11px;
        padding: 7px 4px;
        column-gap: 5px;
    }
    .studio-ui #studioDetailSettings .tab-btn > svg {
        width: 13px;
        height: 13px;
    }
    .studio-ui #studioDetailSettings button.active {
        font-size: 11px;
    }
    .studio-ui #studioDetailSettings #studioSettingsTabBar .tab-btn {
        font-size: 10px;
        white-space: normal;
    }
    .studio-ui .studio-bgm-library-heading {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .studio-ui #bgmCategoryFilterSelect, .studio-ui #studioDetailSettings #bgmCategoryFilterSelect {
        max-width: 100%;
        width: 100%;
    }
    .studio-ui #settingsPane_bgm > .grid:first-child {
        grid-template-columns: 1fr;
    }
    .studio-ui #settingsPane_bgm .grid.grid-cols-3 {
        grid-template-columns: 1fr;
    }
    .studio-ui #studioScriptPanel h3 {
        font-size: 13px;
    }
    .studio-ui #studioScriptPanel > div:first-child > div {
        width: 100%;
    }
    .studio-ui #studioScriptPanel #btnAnalyzeSub {
        font-size: 10.5px;
    }
    .studio-ui #studioScriptPanel button {
        font-size: 10.5px;
    }
    .studio-ui #segmentsContainer > .seg-row {
        flex-wrap: wrap;
    }
    .studio-ui #segmentsContainer .seg-text {
        flex-basis: calc(100% - 35px);
        order: 3;
        min-height: 35px;
    }
    .studio-ui #segmentsContainer .seg-row > button:last-child {
        order: 4;
    }
    .studio-ui #primaryCtaBarWrap {
        padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    }
    .studio-ui #primaryCtaBarWrap > div:first-child {
        gap: 10px;
    }
    .studio-ui #ctaCostInfoBox {
        max-width: 125px;
    }
    .studio-ui #estimatedPointsTxt {
        font-size: 13px;
    }
    .studio-ui #studioEmptyCostNotice {
        font-size: 10.5px;
    }
    .studio-ui #btnQuickDownloadMp4, .studio-ui #btnReRenderVideo {
        font-size: 10.5px;
        padding: 8px;
        min-height: 38px;
    }
    .studio-ui #primaryCtaBarWrap > div:first-child > div:last-child {
        flex-wrap: wrap;
        gap: 5px;
    }
    .studio-ui #primaryCtaBarWrap #btnCreateVideoMain {
        font-size: 12px;
        min-height: 40px;
    }
    .studio-ui #primaryCtaBarWrap #inlineRenderStatusBanner {
        max-height: none !important;
        overflow: visible !important;
    }
}

@media(max-width: 450px) {
    .studio-ui .studio-header > div > div:last-child {
        gap: 4px !important;
    }
    .studio-ui #videoStage {
        height: 300px;
    }
    .studio-ui #studioVideo {
        max-height: 300px;
    }
    .studio-ui #studioWorkspace [id] {
        scroll-margin-top: 140px;
    }
    .studio-help-link {
        font-size: 0;
    }
    .studio-help-link span {
        font-size: 16px;
    }
    .studio-ui #studioDetailSettings .grid.grid-cols-3 {
        grid-template-columns: 1fr;
    }
    .studio-ui #studioDetailSettings .grid.grid-cols-3 > div {
        width: 100%;
    }
    .studio-ui #studioDetailSettings #bgmCategoryFilterSelect {
        max-width: 155px;
    }
    .studio-ui #antiCopyrightOptionsGrid {
        grid-template-columns: 1fr;
    }
    .studio-ui #studioScriptPanel #segmentsContainer .seg-row .seg-start, .studio-ui #studioScriptPanel #segmentsContainer .seg-row .seg-end {
        width: 68px;
    }
}

@media(prefers-reduced-motion: reduce) {
    .studio-ui * {
        scroll-behavior: auto !important;
    }
    .studio-ui button {
        transition: none !important;
    }
}

/* =========================================================================
   STUDIO LIGHT THEME (Giao diện Sáng - Tinh tế, Sắc nét, Chuẩn Studio Chuyên nghiệp)
   100% chữ sắc nét vector, triệt tiêu hoàn toàn mờ neon, tương phản cao WCAG AAA
   ========================================================================= */
html[data-theme="light"],
html[data-theme="light"] :root {
    color-scheme: light !important;
}

html[data-theme="light"] body,
html[data-theme="light"] body.studio-ui {
    color-scheme: light !important;
    --primary-blue: #0284c7;
    --primary-purple: #7c3aed;
    --primary-green: #047857;
    --primary: var(--primary-green);
    --primary-hover: #065f46;
    --bg-dark: #f8fafc;
    --card-bg: #ffffff;
    --border-color: rgba(148, 163, 184, 0.4);
    --text-main: #0f172a;
    --text-muted: #334155;
    --shadow-glow: 0 2px 10px rgba(15, 23, 42, 0.05);

    background-color: #f8fafc !important;
    background-image: 
        linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px),
        radial-gradient(circle at 20% 25%, rgba(124, 58, 237, 0.03) 0%, transparent 45%),
        radial-gradient(circle at 80% 75%, rgba(2, 132, 199, 0.03) 0%, transparent 45%) !important;
    background-size: 32px 32px, 32px 32px, 100% 100%, 100% 100% !important;
    color: #0f172a !important;
}

/* 1. TRIỆT TIÊU HOÀN TOÀN MỌI TEXT-SHADOW TRONG GIAO DIỆN SÁNG (GIẢI QUYẾT TRIỆT ĐỂ CHỮ MỜ/NHÒE) */
html[data-theme="light"] .studio-ui,
html[data-theme="light"] .studio-ui * {
    text-shadow: none !important;
}

html[data-theme="light"] ::selection {
    background: rgba(2, 132, 199, 0.25) !important;
    color: #0f172a !important;
}

/* 2. HỆ THỐNG MÀU CHỮ SẮC NÉT (WCAG AAA) TRÊN NỀN SÁNG */
html[data-theme="light"] .studio-ui :is(
    .text-slate-100, .text-slate-200, .text-slate-300,
    [class*="text-slate-100"], [class*="text-slate-200"], [class*="text-slate-300"]
) {
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui :is(
    .text-slate-400, [class*="text-slate-400"]
) {
    color: #334155 !important;
}

html[data-theme="light"] .studio-ui :is(
    .text-slate-500, [class*="text-slate-500"]
) {
    color: #475569 !important;
}

html[data-theme="light"] .studio-ui :is(
    .text-sky-200, .text-sky-300, .text-sky-400,
    [class*="text-sky-200"], [class*="text-sky-300"], [class*="text-sky-400"],
    .text-cyan-200, .text-cyan-300, .text-cyan-400,
    [class*="text-cyan-200"], [class*="text-cyan-300"], [class*="text-cyan-400"]
) {
    color: #0284c7 !important;
}

html[data-theme="light"] .studio-ui :is(
    .text-amber-200, .text-amber-300, .text-amber-400,
    [class*="text-amber-200"], [class*="text-amber-300"], [class*="text-amber-400"],
    .text-yellow-200, .text-yellow-300, .text-yellow-400,
    [class*="text-yellow-200"], [class*="text-yellow-300"], [class*="text-yellow-400"]
) {
    color: #b45309 !important;
}

html[data-theme="light"] .studio-ui :is(
    .text-emerald-200, .text-emerald-300, .text-emerald-400,
    [class*="text-emerald-200"], [class*="text-emerald-300"], [class*="text-emerald-400"],
    .text-green-200, .text-green-300, .text-green-400,
    [class*="text-green-200"], [class*="text-green-300"], [class*="text-green-400"]
) {
    color: #047857 !important;
}

html[data-theme="light"] .studio-ui :is(
    .text-purple-200, .text-purple-300, .text-purple-400,
    [class*="text-purple-200"], [class*="text-purple-300"], [class*="text-purple-400"],
    .text-fuchsia-200, .text-fuchsia-300, .text-fuchsia-400,
    [class*="text-fuchsia-200"], [class*="text-fuchsia-300"], [class*="text-fuchsia-400"],
    .text-indigo-200, .text-indigo-300, .text-indigo-400,
    [class*="text-indigo-200"], [class*="text-indigo-300"], [class*="text-indigo-400"]
) {
    color: #7c3aed !important;
}

html[data-theme="light"] .studio-ui :is(
    .text-rose-200, .text-rose-300, .text-rose-400,
    [class*="text-rose-200"], [class*="text-rose-300"], [class*="text-rose-400"],
    .text-red-200, .text-red-300, .text-red-400,
    [class*="text-red-200"], [class*="text-red-300"], [class*="text-red-400"]
) {
    color: #e11d48 !important;
}

html[data-theme="light"] .studio-ui .text-white:not(button):not(.preserve-white) {
    color: #0f172a !important;
}

/* 3. KHUNG THẺ TRẮNG & CÁC HỘP ĐIỀU KHIỂN */
html[data-theme="light"] .studio-ui :is(
    [class*="bg-slate-950"], [class*="bg-slate-900"], [class*="bg-sky-950"], [class*="bg-purple-950"]
):not(#videoStage):not(#videoFrameStage):not(#studioVideo):not(#videoPlayerWrap):not(.video-stage):not(#btnCreateVideoMain):not([onclick="toggleCloneDrawer()"]):not(#btnPlayerPlayPause) {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03) !important;
}

html[data-theme="light"] .studio-ui :is(
    [class*="bg-slate-800"]
):not(#btnCreateVideoMain):not(#btnPlayerPlayPause) {
    background: #f1f5f9 !important;
    border-color: rgba(148, 163, 184, 0.45) !important;
    color: #0f172a !important;
}

/* 4. FORM CONTROLS: INPUT, SELECT, TEXTAREA */
html[data-theme="light"] .studio-ui :is(
    input[type="text"], input[type="number"], input[type="email"], input[type="password"],
    select, textarea
) {
    background: #ffffff !important;
    border: 1.5px solid rgba(148, 163, 184, 0.45) !important;
    color: #0f172a !important;
    font-weight: 650 !important;
    box-shadow: none !important;
}

html[data-theme="light"] .studio-ui :is(
    input[type="text"]:focus, input[type="number"]:focus, input[type="email"]:focus, input[type="password"]:focus,
    select:focus, textarea:focus
) {
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
    outline: none !important;
}

html[data-theme="light"] .studio-ui option {
    background: #ffffff !important;
    color: #0f172a !important;
}

/* 5. HEADER BAR & NAVIGATION */
html[data-theme="light"] .studio-ui .studio-header {
    background: rgba(255, 255, 255, 0.98) !important;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35) !important;
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .studio-ui .brand-title,
html[data-theme="light"] .studio-ui .brand-title b {
    color: #0f172a !important;
    font-weight: 850 !important;
}

html[data-theme="light"] .studio-ui .brand-title b.text-sky-400,
html[data-theme="light"] .studio-ui .brand-title b:nth-child(2) {
    color: #0284c7 !important;
}

html[data-theme="light"] .studio-ui .brand-sub {
    color: #475569 !important;
    font-weight: 500 !important;
}

/* Nút Nạp Point ở Header: Cam - Hổ phách sắc nét, triệt tiêu bóng neon */
html[data-theme="light"] .studio-ui #userPointsBadgeContainer button,
html[data-theme="light"] .studio-ui .studio-header [onclick="openTopupModal()"] {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
    border: 1px solid #d97706 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.25) !important;
}
html[data-theme="light"] .studio-ui #userPointsBadgeContainer button * {
    color: #ffffff !important;
}

html[data-theme="light"] .studio-ui #headerPointsVal {
    color: #b45309 !important;
    font-weight: 850 !important;
}

html[data-theme="light"] .studio-ui #userPointsBadgeContainer {
    background: #f1f5f9 !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    box-shadow: none !important;
}

html[data-theme="light"] .studio-ui #studioThemeToggleBtn {
    background: #f1f5f9 !important;
    border: 1px solid rgba(148, 163, 184, 0.5) !important;
    color: #d97706 !important;
    box-shadow: none !important;
}
html[data-theme="light"] .studio-ui #studioThemeToggleBtn:hover {
    background: #ffffff !important;
    border-color: #d97706 !important;
}

html[data-theme="light"] .studio-ui #authGuestArea button {
    background: #ffffff !important;
    border: 1.5px solid rgba(148, 163, 184, 0.45) !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="light"] .studio-ui #authGuestArea button:hover {
    background: #f8fafc !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
}

/* 6. QUY TRÌNH 4 BƯỚC (STEPS) */
html[data-theme="light"] .studio-ui .studio-steps {
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .studio-ui .studio-steps button {
    color: #475569 !important;
    font-weight: 600 !important;
}
html[data-theme="light"] .studio-ui .studio-steps button b {
    color: #0f172a !important;
    font-weight: 700 !important;
}
html[data-theme="light"] .studio-ui .studio-steps button span {
    background: #f1f5f9 !important;
    border: 1px solid rgba(148, 163, 184, 0.5) !important;
    color: #0284c7 !important;
    font-weight: 800 !important;
    box-shadow: none !important;
}
html[data-theme="light"] .studio-ui .studio-steps button:first-child span,
html[data-theme="light"] .studio-ui .studio-steps button.is-complete span {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%) !important;
    color: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25) !important;
}

/* 7. BẢN XEM TRƯỚC (LEFT COLUMN - PREVIEW CARD & VIDEO CANVAS) */
html[data-theme="light"] .studio-ui #studioPreviewCard {
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] .studio-ui #studioPreviewCard h2,
html[data-theme="light"] .studio-ui #previewStageHeaderTitle {
    color: #0f172a !important;
    font-weight: 800 !important;
}

.studio-ui #previewStageHeaderTitle {
    text-transform: none !important;
    letter-spacing: normal !important;
    font-size: 12.5px !important;
    font-weight: 700 !important;
}

@media (max-width: 640px) {
    .studio-ui #previewStageHeaderTitle {
        font-size: 11px !important;
        line-height: 1.3 !important;
    }
}

/* MÀN HÌNH VIDEO CANVAS BẮT BUỘC ĐEN TUYỆT ĐỐI */
html[data-theme="light"] #videoStage,
html[data-theme="light"] #videoFrameStage,
html[data-theme="light"] #studioVideo,
html[data-theme="light"] .video-stage {
    background: #000000 !important;
}

/* KHẮC PHỤC TRIỆT ĐỂ THANH ĐIỀU KHIỂN VIDEO & NÚT PLAY */
html[data-theme="light"] .studio-ui #studioPreviewCard > div:last-child {
    background: #f8fafc !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    box-shadow: none !important;
}

html[data-theme="light"] .studio-ui #playerSeekSlider {
    accent-color: #0284c7 !important;
    margin-bottom: 2px !important;
}

html[data-theme="light"] .studio-ui #playerTimeTxt {
    color: #0284c7 !important;
    font-weight: 800 !important;
}

/* Nút Play/Pause chính (#btnPlayerPlayPause): Màu xanh dương đậm, chữ TRẮNG, KHÔNG bóng tím */
html[data-theme="light"] .studio-ui #studioPreviewCard #btnPlayerPlayPause,
html[data-theme="light"] .studio-ui #btnPlayerPlayPause {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%) !important;
    border: 1px solid #0284c7 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3) !important;
}
html[data-theme="light"] .studio-ui #studioPreviewCard #btnPlayerPlayPause:hover,
html[data-theme="light"] .studio-ui #btnPlayerPlayPause:hover {
    background: linear-gradient(135deg, #0369a1 0%, #1d4ed8 100%) !important;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.4) !important;
}
html[data-theme="light"] .studio-ui #studioPreviewCard #btnPlayerPlayPause *,
html[data-theme="light"] .studio-ui #btnPlayerPlayPause * {
    color: #ffffff !important;
    fill: #ffffff !important;
}
html[data-theme="light"] .studio-ui #studioPreviewCard #btnPlayerPlayPause svg[data-studio-icon],
html[data-theme="light"] .studio-ui #btnPlayerPlayPause svg[data-studio-icon] {
    stroke: #ffffff !important;
}

/* Các nút phụ trong thanh phát video */
html[data-theme="light"] .studio-ui #studioPreviewCard > div:last-child button:not(#btnPlayerPlayPause) {
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.45) !important;
    color: #0f172a !important;
    font-weight: 700 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}
html[data-theme="light"] .studio-ui #studioPreviewCard > div:last-child button:not(#btnPlayerPlayPause):hover {
    background: #f1f5f9 !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
}

html[data-theme="light"] .studio-ui #btnTogglePreviewSub {
    background: #fffbeb !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    color: #b45309 !important;
    font-weight: 700 !important;
}
html[data-theme="light"] .studio-ui #btnTogglePreviewSub * {
    color: #b45309 !important;
}

html[data-theme="light"] .studio-ui #videoMetaInfo {
    color: #475569 !important;
    font-weight: 600 !important;
}

html[data-theme="light"] .studio-ui #blurBoxLabelTxt {
    color: #b45309 !important;
    font-weight: 700 !important;
}

/* 8. BẢNG PHỤ ĐỀ & KỊCH BẢN (SCRIPT PANEL) */
html[data-theme="light"] .studio-ui #studioScriptPanel {
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

html[data-theme="light"] .studio-ui #studioScriptPanel h3 {
    color: #0f172a !important;
    font-weight: 800 !important;
}

html[data-theme="light"] .studio-ui #segCountBadge {
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    color: #0284c7 !important;
    font-weight: 800 !important;
}

/* Nút AI Nghe & Dịch Trước: Màu tím trang nhã, không nhòe sáng */
html[data-theme="light"] .studio-ui #btnAnalyzeSub {
    background: #f5f3ff !important;
    border: 1.5px solid #c4b5fd !important;
    color: #6d28d9 !important;
    font-weight: 800 !important;
    box-shadow: 0 1px 3px rgba(109, 40, 217, 0.08) !important;
}
html[data-theme="light"] .studio-ui #btnAnalyzeSub * {
    color: #6d28d9 !important;
}
html[data-theme="light"] .studio-ui #btnAnalyzeSub:hover {
    background: #ede9fe !important;
    color: #5b21b6 !important;
}

/* 9. 3 TAB TINH CHỈNH (NHẠC NỀN, PHỤ ĐỀ, LOGO & CHỮ) */
html[data-theme="light"] .studio-ui #studioDetailSettings {
    border-top: 1px solid rgba(148, 163, 184, 0.35) !important;
}

html[data-theme="light"] .studio-ui #studioDetailSettings > div:first-child > span {
    color: #0f172a !important;
    font-weight: 800 !important;
}

html[data-theme="light"] .studio-ui #studioDetailSettings .grid-cols-3,
html[data-theme="light"] .studio-ui #studioDetailSettings #studioSettingsTabBar {
    background: #f1f5f9 !important;
    border: 1px solid rgba(148, 163, 184, 0.4) !important;
}

html[data-theme="light"] .studio-ui #studioDetailSettings .tab-btn {
    color: #334155 !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    font-weight: 750 !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings .tab-btn span {
    color: inherit !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings .tab-btn:hover {
    color: #0f172a !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings .tab-btn.active {
    background: #ffffff !important;
    border: 1.5px solid rgba(2, 132, 199, 0.45) !important;
    color: #0284c7 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
    font-weight: 800 !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings .tab-btn.active span {
    color: #0284c7 !important;
}

/* 10. THIẾT LẬP VIDEO (RIGHT COLUMN - WORKFLOW & CONTROLS) */
html[data-theme="light"] .studio-ui #rightControlGlassCard {
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05) !important;
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui #rightControlGlassCard > div[class*="bg-slate-950"]:first-child,
html[data-theme="light"] .studio-ui #rightControlGlassCard .grid-cols-2:has(#wfTab_dub) {
    background: #f1f5f9 !important;
    border: 1px solid rgba(148, 163, 184, 0.4) !important;
    padding: 4px !important;
}

html[data-theme="light"] .studio-ui #wfTab_dub,
html[data-theme="light"] .studio-ui #wfTab_narrate {
    color: #334155 !important;
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    font-weight: 750 !important;
}
html[data-theme="light"] .studio-ui #wfTab_dub:hover,
html[data-theme="light"] .studio-ui #wfTab_narrate:hover {
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui #wfTab_dub[aria-pressed=true],
html[data-theme="light"] .studio-ui #wfTab_narrate[aria-pressed=true],
html[data-theme="light"] .studio-ui #wfTab_dub.bg-sky-500\/20,
html[data-theme="light"] .studio-ui #wfTab_narrate.bg-sky-500\/20 {
    background: #ffffff !important;
    border: 1.5px solid rgba(2, 132, 199, 0.45) !important;
    color: #0284c7 !important;
    font-weight: 800 !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .studio-ui #workflowDescBanner {
    background: #f0f9ff !important;
    border: 1px solid rgba(2, 132, 199, 0.3) !important;
    color: #0369a1 !important;
    font-weight: 600 !important;
}

html[data-theme="light"] .studio-ui #rightControlGlassCard label {
    color: #0f172a !important;
    font-weight: 750 !important;
}

html[data-theme="light"] .studio-ui #dubStyleLabelTxt {
    color: #b45309 !important;
    font-weight: 800 !important;
}

html[data-theme="light"] .studio-ui #dubStyleSelect {
    border-color: rgba(245, 158, 11, 0.45) !important;
    color: #92400e !important;
    font-weight: 700 !important;
}

/* AI Voice Dropdown & Speed */
html[data-theme="light"] .studio-ui #speedVal {
    color: #0284c7 !important;
    font-weight: 850 !important;
}

html[data-theme="light"] .studio-ui #voiceSelectDropdown {
    background: #ffffff !important;
    border: 1.5px solid rgba(148, 163, 184, 0.45) !important;
    color: #0f172a !important;
    font-weight: 700 !important;
}

html[data-theme="light"] .studio-ui #btnPlayVoiceSample {
    background: #0284c7 !important;
    border: 1px solid #0284c7 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25) !important;
}
html[data-theme="light"] .studio-ui #btnPlayVoiceSample:hover {
    background: #0369a1 !important;
    border-color: #0369a1 !important;
}
html[data-theme="light"] .studio-ui #btnPlayVoiceSample * {
    color: #ffffff !important;
}

/* Nút Nhân bản giọng nói: Tím hoàng gia, chữ trắng, không bóng mờ */
html[data-theme="light"] .studio-ui #rightControlGlassCard [onclick="toggleCloneDrawer()"] {
    background: linear-gradient(135deg, #7c3aed 0%, #9333ea 100%) !important;
    border: 1px solid #7c3aed !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    box-shadow: 0 3px 10px rgba(124, 58, 237, 0.25) !important;
}
html[data-theme="light"] .studio-ui #rightControlGlassCard [onclick="toggleCloneDrawer()"] * {
    color: #ffffff !important;
}

/* 11. BỘ TÙY CHỌN ANTI-COPYRIGHT & CHECKBOXES */
html[data-theme="light"] .studio-ui #studioProcessingOptions > div {
    background: #f8fafc !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

html[data-theme="light"] .studio-ui #studioProcessingOptions > div:first-child {
    background: #f8fafc !important;
    border: 1.5px solid rgba(2, 132, 199, 0.3) !important;
}
html[data-theme="light"] .studio-ui #studioProcessingOptions > div:first-child .flex-1 > div > span:first-child {
    color: #0284c7 !important;
    font-weight: 800 !important;
}
html[data-theme="light"] .studio-ui #studioProcessingOptions > div:first-child p {
    color: #334155 !important;
    font-weight: 500 !important;
}

html[data-theme="light"] .studio-ui #studioProcessingOptions > div:last-child {
    background: #fffbeb !important;
    border: 1.5px solid rgba(245, 158, 11, 0.35) !important;
}
html[data-theme="light"] .studio-ui #studioProcessingOptions > div:last-child > label span {
    color: #b45309 !important;
    font-weight: 800 !important;
}

/* Grid Anti-Copyright: 1 cột thoáng đãng khi hẹp, không bao giờ đè chữ */
html[data-theme="light"] .studio-ui #antiCopyrightOptionsGrid {
    color: #0f172a !important;
}
@media (max-width: 640px) {
    html[data-theme="light"] .studio-ui #antiCopyrightOptionsGrid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
}
html[data-theme="light"] .studio-ui #antiCopyrightOptionsGrid label {
    color: #0f172a !important;
    font-weight: 700 !important;
}
html[data-theme="light"] .studio-ui #antiCopyrightOptionsGrid span {
    color: #0f172a !important;
    font-weight: 700 !important;
}
html[data-theme="light"] .studio-ui #antiCopyrightOptionsGrid span[class*="text-slate-"] {
    color: #334155 !important;
    font-weight: 800 !important;
}
html[data-theme="light"] .studio-ui #antiCopyrightOptionsGrid input[type=checkbox] {
    accent-color: #0284c7 !important;
}

/* Ô nhập Zoom % (#reupZoomVal): Chữ ĐEN rõ ràng, không bị ẩn số */
html[data-theme="light"] .studio-ui #reupZoomVal {
    background: #ffffff !important;
    border: 1.5px solid rgba(148, 163, 184, 0.5) !important;
    color: #0f172a !important;
    font-weight: 800 !important;
}

/* 12. THANH CTA CHÍNH ("BẮT ĐẦU TẠO") */
html[data-theme="light"] .studio-ui #primaryCtaBarWrap,
html[data-theme="light"] #primaryCtaBarWrap {
    background: #f8fafc !important;
    border: 1.5px solid rgba(148, 163, 184, 0.35) !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] .studio-ui #primaryCtaBarWrap > div:first-child {
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
}

html[data-theme="light"] .studio-ui #ctaCostInfoBox > div:first-child {
    background: #f8fafc !important;
    border: 1.5px solid rgba(148, 163, 184, 0.4) !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}
html[data-theme="light"] .studio-ui #ctaCostInfoBox > div:first-child > div:first-child {
    color: #475569 !important;
    font-weight: 750 !important;
}

html[data-theme="light"] .studio-ui #estimatedPointsTxt {
    color: #b45309 !important;
    font-weight: 850 !important;
}

/* NÚT BẮT ĐẦU TẠO: Cam Gradient nổi bật, chữ trắng, triệt tiêu viền nhòe */
html[data-theme="light"] .studio-ui #btnCreateVideoMain,
html[data-theme="light"] .studio-ui #primaryCtaBarWrap #btnCreateVideoMain {
    background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
    border: 1px solid #d97706 !important;
    color: #ffffff !important;
    font-weight: 850 !important;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35) !important;
}
html[data-theme="light"] .studio-ui #btnCreateVideoMain:hover,
html[data-theme="light"] .studio-ui #primaryCtaBarWrap #btnCreateVideoMain:hover {
    background: linear-gradient(135deg, #d97706 0%, #c2410c 100%) !important;
    box-shadow: 0 6px 20px rgba(234, 88, 12, 0.45) !important;
}
html[data-theme="light"] .studio-ui #btnCreateVideoMain * {
    color: #ffffff !important;
}
html[data-theme="light"] .studio-ui #btnCreateVideoMain svg[data-studio-icon] {
    stroke: #ffffff !important;
}

html[data-theme="light"] .studio-ui #btnCreateVideoMain.btn-watch-cta,
html[data-theme="light"] .studio-ui #primaryCtaBarWrap #btnCreateVideoMain.btn-watch-cta {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    border: 1px solid #047857 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35) !important;
}

/* 13. TIẾN TRÌNH GẦN ĐÂY (RECENT JOBS) */
html[data-theme="light"] .studio-ui #studioRecentPanel {
    background: #ffffff !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05) !important;
}
html[data-theme="light"] .studio-ui #studioRecentPanel h3 {
    color: #0f172a !important;
    font-weight: 800 !important;
}
html[data-theme="light"] .studio-ui #studioRecentPanel button {
    color: #0284c7 !important;
    font-weight: 700 !important;
}
html[data-theme="light"] .studio-ui #recentJobsList {
    background: #f8fafc !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
}
html[data-theme="light"] .studio-ui #recentJobsList p {
    color: #475569 !important;
    font-weight: 600 !important;
}

/* 14. HỆ THỐNG BADGES */
html[data-theme="light"] .studio-ui [class*="bg-emerald-500/20"] {
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #047857 !important;
    font-weight: 800 !important;
}

html[data-theme="light"] .studio-ui [class*="bg-sky-500/20"]:not([id^=wfTab]) {
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    color: #0284c7 !important;
    font-weight: 800 !important;
}

html[data-theme="light"] .studio-ui [class*="bg-amber-500/20"] {
    background: #fffbeb !important;
    border: 1px solid #fde68a !important;
    color: #b45309 !important;
    font-weight: 800 !important;
}

html[data-theme="light"] .studio-ui :is([class*="bg-purple-500/20"], [class*="bg-purple-950/30"]) {
    background: #faf5ff !important;
    border: 1px solid #e9d5ff !important;
    color: #7c3aed !important;
    font-weight: 800 !important;
}

/* 15. SVG ICONS CHUẨN XÁC THEO NGỮ CẢNH */
html[data-theme="light"] .studio-ui svg[data-studio-icon] {
    stroke: #0284c7;
    filter: none !important;
}
html[data-theme="light"] .studio-ui .tab-btn:not(.active) svg[data-studio-icon] {
    stroke: #475569 !important;
}

/* 16. FINAL VISUAL POLISH - ZERO FAINT TEXT */
html[data-theme="light"] .studio-ui .studio-workspace-heading h1,
html[data-theme="light"] .studio-workspace-heading h1 {
    color: #0f172a !important;
    text-shadow: none !important;
}

html[data-theme="light"] .studio-ui .studio-workspace-heading p {
    color: #475569 !important;
}

html[data-theme="light"] .studio-ui .studio-header a.group,
html[data-theme="light"] .studio-ui .brand-title,
html[data-theme="light"] .studio-ui .brand-title span,
html[data-theme="light"] .studio-ui .brand-title b {
    color: #0f172a !important;
    text-shadow: none !important;
}

html[data-theme="light"] .studio-ui #btnAnalyzeSub {
    background: #f5f3ff !important;
    border: 1.5px solid #c4b5fd !important;
    color: #6d28d9 !important;
    box-shadow: 0 1px 3px rgba(109, 40, 217, 0.08) !important;
}
html[data-theme="light"] .studio-ui #btnAnalyzeSub * {
    color: #6d28d9 !important;
    stroke: #6d28d9 !important;
}

html[data-theme="light"] .studio-ui input[type="range"]::-webkit-slider-runnable-track {
    background: #e2e8f0 !important;
}
html[data-theme="light"] .studio-ui input[type="range"]::-moz-range-track {
    background: #e2e8f0 !important;
}
html[data-theme="light"] .studio-ui [class*="bg-slate-950"]:has(#speedSlider) {
    background: #ffffff !important;
    border-color: rgba(148, 163, 184, 0.4) !important;
}


/* =========================================================================
   AUTH MODAL STYLING (CHUẨN AITUDONGHOA.VN - CĂN GIỮA TUYỆT ĐỐI & TINH TẾ)
   ========================================================================= */

.studio-ui .studio-header [onclick="openAuthModal('login')"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

/* Dark Mode (Default) */
.studio-ui #authModal .glass-card {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(10, 15, 29, 0.99) 100%) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 28px 65px -12px rgba(0, 0, 0, 0.95), 0 0 45px rgba(6, 182, 212, 0.18) !important;
    border-radius: 24px !important;
    max-width: 430px !important;
    padding: 28px 26px 24px !important;
}

.studio-ui #authModal #authModalTitle {
    font-size: 21px !important;
    font-weight: 850 !important;
    letter-spacing: -0.02em !important;
    color: #ffffff !important;
    text-align: center !important;
    margin-bottom: 6px !important;
}

.studio-ui #authModal #authModalSubtitle {
    font-size: 12.5px !important;
    line-height: 1.5 !important;
    color: #94a3b8 !important;
    text-align: center !important;
    max-width: 330px !important;
    margin: 0 auto !important;
    text-wrap: balance !important;
}

/* Hộp chuyển tab Đăng Nhập / Đăng Ký: Bỏ icon góc, chữ căn giữa tuyệt đối */
.studio-ui #authModal .grid-cols-2 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    padding: 5px !important;
    border-radius: 14px !important;
    background: rgba(9, 14, 26, 0.95) !important;
    border: 1px solid rgba(51, 65, 85, 0.85) !important;
    margin-bottom: 16px !important;
}

.studio-ui #authModal #authTabLogin,
.studio-ui #authModal #authTabRegister {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    min-height: 40px !important;
    padding: 8px 14px !important;
    border-radius: 10px !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    color: #94a3b8 !important;
    border: 1.5px solid transparent !important;
    background: transparent !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
}

.studio-ui #authModal #authTabLogin svg,
.studio-ui #authModal #authTabRegister svg {
    display: none !important;
}

.studio-ui #authModal #authTabLogin span,
.studio-ui #authModal #authTabRegister span {
    display: inline-block !important;
    text-align: center !important;
    margin: 0 auto !important;
}

.studio-ui #authModal #authTabLogin:hover:not(.active),
.studio-ui #authModal #authTabRegister:hover:not(.active) {
    color: #e2e8f0 !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

.studio-ui #authModal #authTabLogin.active,
.studio-ui #authModal #authTabRegister.active {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(14, 165, 233, 0.2) 100%) !important;
    color: #38bdf8 !important;
    border: 1.5px solid #00e5ff !important;
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

/* Nút Google 1-Click */
.studio-ui #authModal #authGoogleBtn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 10px 16px !important;
    border-radius: 12px !important;
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1.5px solid rgba(51, 65, 85, 0.9) !important;
    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 750 !important;
    text-align: center !important;
}

.studio-ui #authModal #authGoogleBtn:hover {
    background: rgba(30, 41, 59, 0.95) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.2) !important;
}

/* Ô nhập liệu Email / Mật khẩu / Họ tên (Khử triệt để nền xanh xám của Chrome Autofill) */
.studio-ui #authModal input {
    height: 44px !important;
    padding: 10px 40px 10px 40px !important;
    background: rgba(9, 14, 26, 0.95) !important;
    border: 1.5px solid rgba(51, 65, 85, 0.9) !important;
    color: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4) !important;
}

.studio-ui #authModal input::placeholder {
    color: #64748b !important;
    font-weight: 500 !important;
}

.studio-ui #authModal input:focus {
    background: rgba(9, 14, 26, 1) !important;
    border-color: #00e5ff !important;
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18) !important;
}

.studio-ui #authModal input:-webkit-autofill,
.studio-ui #authModal input:-webkit-autofill:hover,
.studio-ui #authModal input:-webkit-autofill:focus,
.studio-ui #authModal input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #090e1a inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    border: 1.5px solid rgba(56, 189, 248, 0.55) !important;
    transition: background-color 9999s ease-in-out 0s;
}

.studio-ui #authModal .relative > span.absolute {
    left: 13px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #64748b !important;
    pointer-events: none !important;
    z-index: 2 !important;
}

.studio-ui #authModal #authEyeBtn {
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #94a3b8 !important;
    background: transparent !important;
    border: none !important;
    z-index: 2 !important;
}

.studio-ui #authModal #authEyeBtn:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

/* Nút Submit chính: Căn giữa chữ tuyệt đối */
.studio-ui #authModal #authSubmitBtn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    width: 100% !important;
    min-height: 46px !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    font-size: 13.5px !important;
    font-weight: 850 !important;
    letter-spacing: 0.02em !important;
    background: linear-gradient(135deg, #06b6d4 0%, #0284c7 55%, #2563eb 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.6) !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.4) !important;
}

.studio-ui #authModal #authSubmitBtn:hover {
    background: linear-gradient(135deg, #22d3ee 0%, #0284c7 55%, #3b82f6 100%) !important;
    box-shadow: 0 8px 26px rgba(6, 182, 212, 0.55) !important;
    transform: translateY(-1px) !important;
}

.studio-ui #authModal .relative.my-4 span {
    background: #0c1222 !important;
    color: #94a3b8 !important;
}

.studio-ui #authModal [onclick="closeAuthModal()"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 9999px !important;
    color: #94a3b8 !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

.studio-ui #authModal [onclick="closeAuthModal()"]:hover {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.12) !important;
}

/* Light Mode Overrides for Auth Modal */
html[data-theme="light"] .studio-ui #authModal {
    background: rgba(15, 23, 42, 0.55) !important;
    backdrop-filter: blur(12px) !important;
}

html[data-theme="light"] .studio-ui #authModal .glass-card {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.22), 0 0 35px rgba(2, 132, 199, 0.1) !important;
}

html[data-theme="light"] .studio-ui #authModal .relative.my-4 span {
    background: #ffffff !important;
    color: #64748b !important;
}

html[data-theme="light"] .studio-ui #authModal h3,
html[data-theme="light"] .studio-ui #authModal #authModalTitle {
    color: #0f172a !important;
    text-shadow: none !important;
}

html[data-theme="light"] .studio-ui #authModal #authModalSubtitle,
html[data-theme="light"] .studio-ui #authModal #authSwitchPrompt {
    color: #64748b !important;
}

html[data-theme="light"] .studio-ui #authModal :is(label, .font-sans.uppercase) {
    color: #334155 !important;
}

html[data-theme="light"] .studio-ui #authModal .grid-cols-2 {
    background: #f1f5f9 !important;
    border: 1.5px solid #e2e8f0 !important;
}

html[data-theme="light"] .studio-ui #authModal #authTabLogin,
html[data-theme="light"] .studio-ui #authModal #authTabRegister {
    color: #64748b !important;
    border: 1.5px solid transparent !important;
    background: transparent !important;
}

html[data-theme="light"] .studio-ui #authModal #authTabLogin:hover:not(.active),
html[data-theme="light"] .studio-ui #authModal #authTabRegister:hover:not(.active) {
    color: #0f172a !important;
    background: rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .studio-ui #authModal #authTabLogin.active,
html[data-theme="light"] .studio-ui #authModal #authTabRegister.active {
    background: #ffffff !important;
    color: #0284c7 !important;
    border: 1.5px solid #0284c7 !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.15) !important;
}

html[data-theme="light"] .studio-ui #authModal #authGoogleBtn {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) !important;
}

html[data-theme="light"] .studio-ui #authModal #authGoogleBtn:hover {
    background: #f8fafc !important;
    border-color: #0284c7 !important;
}

html[data-theme="light"] .studio-ui #authModal input {
    background: #f8fafc !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    box-shadow: none !important;
}

html[data-theme="light"] .studio-ui #authModal input::placeholder {
    color: #94a3b8 !important;
}

html[data-theme="light"] .studio-ui #authModal input:focus {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15) !important;
}

html[data-theme="light"] .studio-ui #authModal input:-webkit-autofill,
html[data-theme="light"] .studio-ui #authModal input:-webkit-autofill:hover,
html[data-theme="light"] .studio-ui #authModal input:-webkit-autofill:focus,
html[data-theme="light"] .studio-ui #authModal input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 1000px #f8fafc inset !important;
    -webkit-text-fill-color: #0f172a !important;
    caret-color: #0f172a !important;
    border: 1.5px solid #cbd5e1 !important;
}

html[data-theme="light"] .studio-ui #authModal :is(#authEyeBtn, .relative > span.absolute) {
    color: #64748b !important;
}

html[data-theme="light"] .studio-ui #authModal #authEyeBtn:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

html[data-theme="light"] .studio-ui #authModal [onclick="closeAuthModal()"] {
    color: #64748b !important;
}

html[data-theme="light"] .studio-ui #authModal [onclick="closeAuthModal()"]:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
}

html[data-theme="light"] .studio-ui #authModal :is(.border-slate-800, .border-slate-700) {
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .studio-ui #authModal .text-slate-500 {
    color: #64748b !important;
}



/* =========================================================================
   MOBILE RESPONSIVENESS & ACTION BUTTON HARMONY (XEM VIDEO, TẢI MP4, TẠO LẠI)
   ========================================================================= */

/* 1. TRIỆT TIÊU HOÀN TOÀN VUỐT NGANG VÀ THÒ THỤT TRÊN MOBILE */
html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
    touch-action: pan-y !important;
    overscroll-behavior-x: none !important;
}

.studio-ui {
    max-width: 100vw !important;
    overflow-x: hidden !important;
}

#studioWorkspace,
.studio-container,
#rightControlGlassCard,
#studioPreviewColumn,
#studioScriptPanel,
#studioDetailSettings {
    max-width: 100% !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

/* 2. CÂN ĐỐI HÀI HÒA BỘ 3 NÚT HÀNH ĐỘNG (#btnCreateVideoMain, #btnQuickDownloadMp4, #btnReRenderVideo) */
.studio-ui #primaryCtaBarWrap > div:first-child > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    width: auto !important;
    min-width: 0 !important;
}

/* Nút Xem ngay / Xem video */
.studio-ui #btnCreateVideoMain {
    min-height: 44px !important;
    border-radius: 12px !important;
    font-weight: 800 !important;
    font-size: 13px !important;
    padding: 10px 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.studio-ui #btnCreateVideoMain.btn-watch-cta {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(5, 150, 105, 0.95)) !important;
    border: 1.5px solid #10b981 !important;
    color: #ffffff !important;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.45) !important;
    flex: 1.5 1 auto !important;
    min-width: 130px !important;
}

.studio-ui #btnCreateVideoMain.btn-watch-cta:hover {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.75) !important;
    transform: translateY(-1px) !important;
}

/* Nút Tải MP4 */
.studio-ui #btnQuickDownloadMp4:not(.hidden) {
    min-height: 44px !important;
    border-radius: 12px !important;
    font-weight: 750 !important;
    font-size: 13px !important;
    padding: 10px 16px !important;
    background: rgba(16, 185, 129, 0.16) !important;
    border: 1.5px solid rgba(16, 185, 129, 0.7) !important;
    color: #34d399 !important;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.2) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    flex: 1.2 1 auto !important;
    min-width: 110px !important;
    transition: all 0.2s ease !important;
}

.studio-ui #btnQuickDownloadMp4:not(.hidden):hover {
    background: rgba(16, 185, 129, 0.3) !important;
    color: #ffffff !important;
    box-shadow: 0 0 22px rgba(16, 185, 129, 0.5) !important;
    transform: translateY(-1px) !important;
}

/* Nút Tạo lại */
.studio-ui #btnReRenderVideo:not(.hidden) {
    min-height: 44px !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 12.5px !important;
    padding: 10px 14px !important;
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.4) !important;
    color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.15) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    flex: 1 1 auto !important;
    min-width: 95px !important;
    transition: all 0.2s ease !important;
}

.studio-ui #btnReRenderVideo:not(.hidden):hover {
    background: rgba(14, 165, 233, 0.25) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.4) !important;
    transform: translateY(-1px) !important;
}

/* 3. RESPONSIVE CHO 3 NÚT TRÊN MOBILE (< 640px) */
@media (max-width: 640px) {
    .studio-ui #primaryCtaBarWrap > div:first-child {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .studio-ui #primaryCtaBarWrap #ctaCostInfoBox {
        width: 100% !important;
        justify-content: space-between !important;
    }

    .studio-ui #primaryCtaBarWrap > div:first-child > div:last-child {
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        gap: 6px !important;
    }

    /* Khi chỉ có 1 nút Bắt đầu tạo / Đang tạo... (X%) */
    .studio-ui #btnCreateVideoMain {
        min-width: 0 !important;
        width: 100% !important;
        flex: 1 1 auto !important;
        min-height: 44px !important;
        font-size: 12.5px !important;
        padding: 8px 12px !important;
        border-radius: 10px !important;
        white-space: nowrap !important;
    }

    /* Khi hoàn thành video và hiện đủ 3 nút hành động */
    .studio-ui #btnCreateVideoMain.btn-watch-cta {
        flex: 1.35 1 0px !important;
        min-width: 0 !important;
        width: auto !important;
        font-size: 11.5px !important;
        padding: 8px 6px !important;
    }

    .studio-ui #btnQuickDownloadMp4:not(.hidden) {
        flex: 1.15 1 0px !important;
        min-width: 0 !important;
        width: auto !important;
        min-height: 44px !important;
        font-size: 11px !important;
        padding: 8px 6px !important;
        border-radius: 10px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }

    .studio-ui #btnReRenderVideo:not(.hidden) {
        flex: 0.95 1 0px !important;
        min-width: 0 !important;
        width: auto !important;
        min-height: 44px !important;
        font-size: 11px !important;
        padding: 8px 6px !important;
        border-radius: 10px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }
}

/* 4. FIX ANTI-COPYRIGHT & BGM OVERFLOW TRÊN MOBILE */
.studio-ui #antiCopyrightOptionsGrid {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.studio-ui #antiCopyrightOptionsGrid label {
    white-space: normal !important;
    word-break: break-word !important;
    font-size: 11.5px !important;
}

@media (max-width: 640px) {
    .studio-ui #antiCopyrightOptionsGrid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
        padding-left: 0 !important;
    }

    .studio-ui #settingsPane_bgm {
        max-width: 100% !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }

    .studio-ui #bgmCategoryFilterSelect {
        max-width: 100% !important;
        width: 100% !important;
    }

    .studio-ui #bgmTrackSelect,
    .studio-ui #customBgmTrackSelect {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        width: 0 !important;
        max-width: 100% !important;
    }

    .studio-ui #settingsPane_bgm div[class*="flex items-center justify-between"] {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }

    .studio-ui #settingsPane_bgm div:has(> #bgmNowPlayingTxt) {
        flex-wrap: nowrap !important;
        align-items: center !important;
    }

    .studio-ui #customBgmFileLabel {
        max-width: 160px !important;
    }

    .studio-ui #bgmNowPlayingTxt {
        flex: 1 1 0% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .studio-ui #btnToggleBgmList {
        margin-left: 6px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }
}

/* 5. LIGHT MODE OVERRIDES FOR ACTION BUTTONS & PROGRESS BANNER */
html[data-theme="light"] .studio-ui #btnCreateVideoMain.btn-watch-cta {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    border: 1px solid #047857 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35) !important;
}

html[data-theme="light"] .studio-ui #btnQuickDownloadMp4:not(.hidden) {
    background: #ecfdf5 !important;
    border: 1.5px solid #059669 !important;
    color: #047857 !important;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.15) !important;
}

html[data-theme="light"] .studio-ui #btnReRenderVideo:not(.hidden) {
    background: #f1f5f9 !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0284c7 !important;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.1) !important;
}

html[data-theme="light"] .studio-ui #inlineRenderStatusBanner {
    background: #ffffff !important;
    border: 1.5px solid #0284c7 !important;
    box-shadow: 0 4px 18px rgba(2, 132, 199, 0.12) !important;
}

html[data-theme="light"] .studio-ui #inlineRenderStep {
    color: #0369a1 !important;
}

html[data-theme="light"] .studio-ui #inlineRenderPct {
    background: rgba(2, 132, 199, 0.12) !important;
    border-color: rgba(2, 132, 199, 0.35) !important;
    color: #0284c7 !important;
}

html[data-theme="light"] .studio-ui #inlineRenderSpinner {
    border-color: #0284c7 !important;
    border-top-color: transparent !important;
}

html[data-theme="light"] .studio-ui #inlineRenderStatusBanner .bg-slate-900 {
    background: #e2e8f0 !important;
}

/* =========================================================================
   6. REAL-TIME OVERLAYS VISUAL CLARITY (DẢI CHE MÀU, Ô XÓA SUB, PHỤ ĐỀ)
   ========================================================================= */
.studio-ui #colorBandTopRect,
.studio-ui #colorBandBottomRect {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-image: repeating-linear-gradient(
        -45deg,
        rgba(251, 191, 36, 0.08),
        rgba(251, 191, 36, 0.08) 8px,
        transparent 8px,
        transparent 16px
    );
    transition: height 0.08s ease-out, background-color 0.1s ease;
}

.studio-ui #colorBandTopRect.hidden,
.studio-ui #colorBandBottomRect.hidden {
    display: none !important;
}

.studio-ui #colorBandTopRect {
    border-bottom: 2px dashed rgba(251, 191, 36, 0.9) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.studio-ui #colorBandBottomRect {
    border-top: 2px dashed rgba(251, 191, 36, 0.9) !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
}

.studio-colorband-badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fef08a !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(251, 191, 36, 0.55) !important;
    white-space: nowrap;
    pointer-events: none;
    user-select: none;
}

/* Giữ khu vực chọn file gọn gàng ở giữa để không che khuất Dải che trên & Phụ đề/Ô vàng bên dưới */
.studio-ui[data-studio-source="empty"] #uploadDropzone {
    padding: 12px 16px !important;
}

.studio-ui[data-studio-source="empty"] #uploadDropzone > div {
    width: 42px !important;
    height: 42px !important;
    margin-bottom: 6px !important;
}

.studio-ui[data-studio-source="empty"] #uploadDropzone > p:first-of-type {
    font-size: 12.5px !important;
    line-height: 1.4 !important;
    margin-bottom: 2px !important;
}

.studio-ui[data-studio-source="empty"] #uploadDropzone > p:nth-of-type(2) {
    font-size: 10.5px !important;
    line-height: 1.35 !important;
    margin-bottom: 8px !important;
}

.studio-ui[data-studio-source="empty"] #uploadDropzone > span {
    padding: 7px 14px !important;
    font-size: 11.5px !important;
}

/* =========================================================================
   7. DESKTOP LOCKED VIEWPORT & INDEPENDENT SETTINGS SCROLLBAR (>= 1024px)
   Bỏ thanh cuộn tổng, thêm thanh cuộn riêng cho ô Thiết lập video,
   giữ màn hình Xem trước luôn hiển thị cố định 100% thời gian.
   ========================================================================= */
.studio-pip-size-btn {
    display: none;
}

@media (min-width: 1024px) {
    html:has(body.studio-ui),
    body.studio-ui {
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .studio-ui .studio-header {
        flex: 0 0 auto !important;
    }

    .studio-ui .studio-header > div {
        min-height: 56px !important;
        padding-block: 6px !important;
    }

    .studio-ui #studioWorkspace {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: calc(100dvh - 58px) !important;
        max-height: calc(100dvh - 58px) !important;
        width: 100% !important;
        padding: 8px 20px 12px !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .studio-ui .studio-workspace-heading {
        flex: 0 0 auto !important;
        margin-bottom: 6px !important;
    }

    .studio-ui .studio-workspace-heading h1 {
        font-size: 18px !important;
    }

    .studio-ui .studio-steps {
        flex: 0 0 auto !important;
        margin-bottom: 8px !important;
        padding-block: 6px !important;
    }

    .studio-ui #studioLayout {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow: hidden !important;
        align-items: stretch !important;
        gap: 16px !important;
    }

    /* Cột Trái: Màn hình Xem Trước cố định + Kịch bản cuộn nội bộ bên dưới */
    .studio-ui #studioPreviewColumn {
        position: relative !important;
        top: auto !important;
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        overflow: hidden !important;
    }

    .studio-ui #studioPreviewCard {
        flex: 0 0 auto !important;
        padding: 12px 14px !important;
    }

    .studio-ui #videoStage {
        height: clamp(230px, 38dvh, 390px) !important;
    }

    .studio-ui #studioVideo {
        max-height: clamp(230px, 38dvh, 390px) !important;
    }

    .studio-ui #studioScriptPanel {
        flex: 1 1 0 !important;
        min-height: 95px !important;
        margin-top: 0 !important;
        padding: 10px 14px !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .studio-ui #studioScriptPanel #segmentsContainer {
        flex: 1 1 0 !important;
        min-height: 55px !important;
        max-height: none !important;
        overflow-y: auto !important;
    }

    /* Cột Phải: Ô Thiết Lập Video có thanh cuộn độc lập mượt mà */
    .studio-ui #studioControlColumn {
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .studio-ui #rightControlGlassCard {
        flex: 1 1 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 16px 18px !important;
        scrollbar-width: thin;
        scrollbar-color: rgba(56, 189, 248, 0.55) rgba(15, 23, 42, 0.5);
    }

    .studio-ui #rightControlGlassCard::-webkit-scrollbar {
        width: 7px;
    }

    .studio-ui #rightControlGlassCard::-webkit-scrollbar-track {
        background: rgba(15, 23, 42, 0.45);
        border-radius: 999px;
        margin-block: 10px;
    }

    .studio-ui #rightControlGlassCard::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, rgba(56, 189, 248, 0.75), rgba(168, 85, 247, 0.75));
        border-radius: 999px;
    }

    .studio-ui #rightControlGlassCard::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, #38bdf8, #a855f7);
    }

    html[data-theme="light"] .studio-ui #rightControlGlassCard {
        scrollbar-color: #94a3b8 #f1f5f9;
    }

    html[data-theme="light"] .studio-ui #rightControlGlassCard::-webkit-scrollbar-track {
        background: #f1f5f9;
    }

    html[data-theme="light"] .studio-ui #rightControlGlassCard::-webkit-scrollbar-thumb {
        background: #94a3b8;
    }

    html[data-theme="light"] .studio-ui #rightControlGlassCard::-webkit-scrollbar-thumb:hover {
        background: #0284c7;
    }

    /* Thanh nút Bắt đầu tạo / Xem ngay nằm đúng thứ tự phía trên khu vực Caption/Thumbnail & Tiến trình gần đây */
    .studio-ui #primaryCtaBarWrap {
        position: relative !important;
        bottom: auto !important;
        z-index: 25 !important;
        margin-inline: 0 !important;
        padding: 12px 14px !important;
        border-radius: 14px !important;
        backdrop-filter: blur(16px) !important;
    }

    .studio-ui #studioRecentPanel {
        margin-top: 14px !important;
    }
}

/* =========================================================================
   8. MOBILE FLOATING PREVIEW POPUP (PiP) FOLLOWING USER ON SCROLL (< 1024px)
   Khi người dùng vuốt xuống dưới trên Mobile, màn hình Preview tự động biến
   thành Popup nổi đi theo để xem trực tiếp mọi thay đổi Real-time & Play video.
   ========================================================================= */
@media (max-width: 1023px) {
    .studio-ui #studioPreviewCard {
        transform-origin: top left !important;
        will-change: transform;
        transition: box-shadow 0.25s ease, border-color 0.25s ease !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) {
        position: fixed !important;
        top: 6px !important;
        left: auto !important;
        right: 8px !important;
        width: clamp(146px, 39vw, 168px) !important;
        max-width: 168px !important;
        z-index: 47 !important;
        margin: 0 !important;
        padding: 4px 5px !important;
        border-radius: 12px !important;
        background: rgba(7, 11, 24, 0.96) !important;
        border: 1.5px solid rgba(56, 189, 248, 0.75) !important;
        box-shadow: 0 14px 36px rgba(0, 0, 0, 0.85), 0 0 22px rgba(14, 165, 233, 0.28) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        transform-origin: top right !important;
        will-change: transform, opacity;
        transition: box-shadow 0.25s ease, border-color 0.25s ease !important;
    }

    html[data-theme="light"] .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) {
        background: rgba(255, 255, 255, 0.97) !important;
        border: 1.5px solid #0284c7 !important;
        box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(2, 132, 199, 0.15) !important;
    }

    /* Thanh tiêu đề gọn 1 hàng duy nhất trong chế độ Popup nổi cố định */
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) > div:first-child {
        min-height: 22px !important;
        margin-bottom: 3px !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 4px !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) > div:first-child > div:first-child,
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #previewStageHeaderTitle,
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #previewResultModeBadge,
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) .studio-pip-size-btn,
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #videoResolutionBadge,
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #downmaxUrlImportBar,
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #downmaxTrafficBanner {
        display: none !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) > div:first-child > div:last-child {
        width: 100% !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 4px !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) > div:first-child button {
        min-height: 22px !important;
        height: 22px !important;
        padding: 0 5px !important;
        font-size: 9.5px !important;
        border-radius: 6px !important;
        gap: 3px !important;
        white-space: nowrap !important;
        flex: 1 1 0 !important;
        justify-content: center !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) > div:first-child button#btnBackToEditPreview {
        flex: 0 0 22px !important;
        width: 22px !important;
        min-width: 22px !important;
        height: 22px !important;
        padding: 0 !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) > div:first-child button svg {
        width: 11px !important;
        height: 11px !important;
        flex-shrink: 0 !important;
    }

    /* Khung video chuẩn kích thước thu gọn cố định (218px cho dọc, gọn cho ngang - không dùng dvh để chống thò thụt) */
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #videoStage {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: var(--studio-video-aspect, 9 / 16) !important;
        max-height: 218px !important;
        margin-top: 0 !important;
        margin-inline: auto !important;
        border-radius: 8px !important;
        background: #000 !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup.is-landscape-video:not(.is-preview-fullscreen) {
        left: 8px !important;
        right: 8px !important;
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
        padding: 6px 8px !important;
        border-radius: 13px !important;
        transform-origin: top center !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup.is-landscape-video:not(.is-preview-fullscreen) > div:first-child > div:first-child,
    .studio-ui #studioPreviewCard.is-mobile-floating-popup.is-landscape-video:not(.is-preview-fullscreen) #previewStageHeaderTitle {
        display: inline-flex !important;
        align-items: center !important;
        font-size: 11px !important;
        white-space: nowrap !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup.is-landscape-video:not(.is-preview-fullscreen) > div:first-child > div:last-child {
        width: auto !important;
        justify-content: flex-end !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup.is-landscape-video:not(.is-preview-fullscreen) > div:first-child button {
        flex: 0 0 auto !important;
        height: 24px !important;
        min-height: 24px !important;
        padding: 0 9px !important;
        font-size: 10.5px !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup.is-landscape-video:not(.is-preview-fullscreen) #videoStage {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: var(--studio-video-aspect, 16 / 9) !important;
        min-height: 155px !important;
        max-height: 192px !important;
        border-radius: 9px !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup.is-landscape-video:not(.is-preview-fullscreen) #studioVideo {
        object-fit: contain !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup.is-landscape-video:not(.is-preview-fullscreen) [onclick="restartStudioVideo()"],
    .studio-ui #studioPreviewCard.is-mobile-floating-popup.is-landscape-video:not(.is-preview-fullscreen) #btnTogglePreviewSub {
        display: inline-flex !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup.is-landscape-video:not(.is-preview-fullscreen) > div:last-child button {
        height: 26px !important;
        min-height: 26px !important;
        font-size: 10.5px !important;
        padding: 0 6px !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #videoPlayerWrap {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #videoFrameStage {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        overflow: visible !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #studioVideo {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        object-fit: contain !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup.is-portrait-video:not(.is-preview-fullscreen) #studioVideo {
        object-fit: cover !important;
    }

    /* Thu gọn Dropzone khi chưa tải video trong Popup nổi */
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #uploadDropzone {
        padding: 6px 8px !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #uploadDropzone > div,
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #uploadDropzone > p:nth-of-type(2) {
        display: none !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #uploadDropzone > p:first-of-type {
        font-size: 10px !important;
        margin-bottom: 4px !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #uploadDropzone > span {
        padding: 3px 8px !important;
        font-size: 9.5px !important;
    }

    /* Thanh điều khiển Play / Pause / Tiếng tối ưu chiều ngang gọn gàng trong Popup nổi */
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) > div:last-child {
        padding: 4px 5px !important;
        margin-top: 3px !important;
        border-radius: 8px !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) > div:last-child > div:first-child {
        gap: 4px !important;
        margin-bottom: 3px !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #playerSeekSlider {
        height: 4px !important;
        min-width: 0 !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #playerTimeTxt {
        font-size: 9px !important;
        line-height: 1 !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) > div:last-child > div:last-child {
        min-height: 22px !important;
        gap: 0 !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) > div:last-child > div:last-child > div:first-child {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 4px !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) [onclick="restartStudioVideo()"],
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #btnTogglePreviewSub {
        display: none !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) > div:last-child button {
        flex: 1 1 0 !important;
        width: auto !important;
        min-width: 0 !important;
        min-height: 22px !important;
        height: 22px !important;
        padding: 0 4px !important;
        font-size: 9.5px !important;
        gap: 3px !important;
        border-radius: 5px !important;
        justify-content: center !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) > div:last-child button svg {
        width: 11px !important;
        height: 11px !important;
        flex-shrink: 0 !important;
    }

    /* Khi ở đầu trang Mobile (Docked Preview): Khóa cứng chiều cao bằng px cho Dropzone, và ôm sát tỉ lệ thật cho Video Ngang/Dọc để không có viền đen thừa */
    .studio-ui #studioPreviewCard:not(.is-portrait-video):not(.is-landscape-video):not(.is-mobile-floating-popup):not(.is-preview-fullscreen) #videoStage {
        height: 280px !important;
        min-height: 280px !important;
        max-height: 280px !important;
    }

    .studio-ui #studioPreviewCard.is-landscape-video:not(.is-mobile-floating-popup):not(.is-preview-fullscreen) #videoStage:not(.is-reframed-916) {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: 280px !important;
        aspect-ratio: var(--studio-video-aspect, 16 / 9) !important;
        margin-inline: auto !important;
        background: #000 !important;
    }

    .studio-ui #studioPreviewCard:not(.is-portrait-video):not(.is-mobile-floating-popup):not(.is-preview-fullscreen) #studioVideo {
        max-height: 280px !important;
    }

    .studio-ui #studioPreviewCard.is-portrait-video:not(.is-mobile-floating-popup):not(.is-preview-fullscreen) #videoStage {
        width: auto !important;
        max-width: 100% !important;
        height: 356px !important;
        min-height: 356px !important;
        max-height: 356px !important;
        aspect-ratio: var(--studio-video-aspect, 9 / 16) !important;
        margin-inline: auto !important;
        background: #000 !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45) !important;
    }

    .studio-ui #studioPreviewCard.is-portrait-video:not(.is-mobile-floating-popup):not(.is-preview-fullscreen) #videoPlayerWrap,
    .studio-ui #studioPreviewCard.is-portrait-video:not(.is-mobile-floating-popup):not(.is-preview-fullscreen) #videoFrameStage,
    .studio-ui #studioPreviewCard.is-portrait-video:not(.is-mobile-floating-popup):not(.is-preview-fullscreen) #studioVideo {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        object-fit: cover !important;
    }
}

.studio-ui #btnBackToEditPreview.studio-icon-only-reset {
    flex: 0 0 auto !important;
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
}

.studio-ui #btnBackToEditPreview.studio-icon-only-reset svg {
    width: 15px !important;
    height: 15px !important;
    margin: 0 !important;
}

/* =========================================================================
   NÚT PHÓNG TOÀN MÀN HÌNH PREVIEW & CHẾ ĐỘ FULLSCREEN PREVIEW (MOBILE + PC)
   Hiển thị toàn màn hình cả Video + Phụ đề + Dải che + Logo + Thanh điều khiển
   ========================================================================= */
.studio-ui .studio-stage-fullscreen-btn {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    z-index: 42 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 5px 10px !important;
    min-height: 28px !important;
    border-radius: 999px !important;
    background: rgba(15, 23, 42, 0.82) !important;
    border: 1px solid rgba(56, 189, 248, 0.55) !important;
    color: #f8fafc !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.55) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    cursor: pointer !important;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease !important;
}

.studio-ui .studio-stage-fullscreen-btn:hover {
    background: rgba(14, 165, 233, 0.9) !important;
    border-color: #bae6fd !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.studio-ui .studio-stage-fullscreen-btn.is-active {
    background: linear-gradient(135deg, #0284c7, #2563eb) !important;
    border-color: #7dd3fc !important;
    color: #ffffff !important;
}

@media (max-width: 1023px) {
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) .studio-stage-fullscreen-btn {
        top: 5px !important;
        right: 5px !important;
        padding: 0 !important;
        width: 24px !important;
        height: 24px !important;
        min-height: 24px !important;
        border-radius: 6px !important;
        justify-content: center !important;
    }

    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) .studio-stage-fullscreen-btn span {
        display: none !important;
    }
}

body.has-preview-fullscreen {
    overflow: hidden !important;
}

.studio-ui #studioPreviewCard.is-preview-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    z-index: 9999 !important;
    margin: 0 !important;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)) !important;
    border-radius: 0 !important;
    border: none !important;
    background: rgba(4, 7, 17, 0.98) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    box-shadow: none !important;
}

html[data-theme="light"] .studio-ui #studioPreviewCard.is-preview-fullscreen {
    background: rgba(9, 13, 26, 0.98) !important;
    color: #f8fafc !important;
}

.studio-ui #studioPreviewCard.is-preview-fullscreen #studioDetailSettings,
.studio-ui #studioPreviewCard.is-preview-fullscreen .studio-pip-size-btn {
    display: none !important;
}

.studio-ui #studioPreviewCard.is-preview-fullscreen > div:first-child {
    flex: 0 0 auto !important;
    margin-bottom: 8px !important;
}

.studio-ui #studioPreviewCard.is-preview-fullscreen #previewStageHeaderTitle {
    display: inline-flex !important;
    color: #f8fafc !important;
    font-size: 13px !important;
}

.studio-ui #studioPreviewCard.is-preview-fullscreen #videoStage {
    flex: 1 1 0 !important;
    min-height: 0 !important;
    width: 100% !important;
    height: auto !important;
    max-height: calc(100dvh - 120px) !important;
    margin: auto !important;
    border-radius: 12px !important;
    background: #000 !important;
}

.studio-ui #studioPreviewCard.is-preview-fullscreen.is-portrait-video #videoStage {
    width: auto !important;
    max-width: 100% !important;
    height: calc(100dvh - 120px) !important;
    aspect-ratio: var(--studio-video-aspect, 9 / 16) !important;
}

.studio-ui #studioPreviewCard.is-preview-fullscreen #videoPlayerWrap {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: calc(100dvh - 120px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.studio-ui #studioPreviewCard.is-preview-fullscreen #videoFrameStage {
    max-width: 100% !important;
    max-height: 100% !important;
    margin: auto !important;
    overflow: visible !important;
}

.studio-ui #studioPreviewCard.is-preview-fullscreen #studioVideo {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

.studio-ui #studioPreviewCard.is-preview-fullscreen.is-portrait-video #studioVideo {
    object-fit: contain !important;
}

.studio-ui #studioPreviewCard.is-preview-fullscreen > div:last-child {
    flex: 0 0 auto !important;
    margin-top: 8px !important;
    padding: 8px 12px !important;
    background: rgba(15, 23, 42, 0.92) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
}

/* =========================================================================
   PHÂN BIỆT 3 MÀU RIÊNG BIỆT CHO 3 TAB: NHẠC NỀN • PHỤ ĐỀ • LOGO & CHỮ
   - Tab 1 (#setTabBtn_bgm - Nhạc nền): Xanh Ngọc Lục Bảo (Emerald)
   - Tab 2 (#setTabBtn_subtitles - Phụ đề): Xanh Dương Sáng (Sky Blue)
   - Tab 3 (#setTabBtn_watermark - Logo & chữ): Cam Hổ Phách (Amber Orange)
   ========================================================================= */

/* --- DARK MODE --- */
.studio-ui #studioDetailSettings #setTabBtn_bgm,
.studio-ui #studioDetailSettings #setTabBtn_bgm span {
    color: #34d399 !important;
    font-weight: 750 !important;
}
.studio-ui #studioDetailSettings #setTabBtn_bgm svg[data-studio-icon] {
    stroke: #34d399 !important;
}
.studio-ui #studioDetailSettings #setTabBtn_bgm:hover {
    background: rgba(16, 185, 129, 0.14) !important;
    border-color: rgba(52, 211, 153, 0.4) !important;
}
.studio-ui #studioDetailSettings #setTabBtn_bgm.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.34), rgba(5, 150, 105, 0.2)) !important;
    border: 1.5px solid #34d399 !important;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.38) !important;
    text-shadow: 0 0 8px rgba(16, 185, 129, 0.45) !important;
}
.studio-ui #studioDetailSettings #setTabBtn_bgm.active,
.studio-ui #studioDetailSettings #setTabBtn_bgm.active span {
    color: #6ee7b7 !important;
}
.studio-ui #studioDetailSettings #setTabBtn_bgm.active svg[data-studio-icon] {
    stroke: #6ee7b7 !important;
}

.studio-ui #studioDetailSettings #setTabBtn_subtitles,
.studio-ui #studioDetailSettings #setTabBtn_subtitles span {
    color: #38bdf8 !important;
    font-weight: 750 !important;
}
.studio-ui #studioDetailSettings #setTabBtn_subtitles svg[data-studio-icon] {
    stroke: #38bdf8 !important;
}
.studio-ui #studioDetailSettings #setTabBtn_subtitles:hover {
    background: rgba(56, 189, 248, 0.14) !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
}
.studio-ui #studioDetailSettings #setTabBtn_subtitles.active {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.36), rgba(2, 132, 199, 0.22)) !important;
    border: 1.5px solid #38bdf8 !important;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.42) !important;
    text-shadow: 0 0 8px rgba(56, 189, 248, 0.45) !important;
}
.studio-ui #studioDetailSettings #setTabBtn_subtitles.active,
.studio-ui #studioDetailSettings #setTabBtn_subtitles.active span {
    color: #7dd3fc !important;
}
.studio-ui #studioDetailSettings #setTabBtn_subtitles.active svg[data-studio-icon] {
    stroke: #7dd3fc !important;
}

.studio-ui #studioDetailSettings #setTabBtn_watermark,
.studio-ui #studioDetailSettings #setTabBtn_watermark span {
    color: #fb923c !important;
    font-weight: 750 !important;
}
.studio-ui #studioDetailSettings #setTabBtn_watermark svg[data-studio-icon] {
    stroke: #fb923c !important;
}
.studio-ui #studioDetailSettings #setTabBtn_watermark:hover {
    background: rgba(249, 115, 22, 0.14) !important;
    border-color: rgba(251, 146, 60, 0.4) !important;
}
.studio-ui #studioDetailSettings #setTabBtn_watermark.active {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.34), rgba(217, 119, 6, 0.2)) !important;
    border: 1.5px solid #fb923c !important;
    box-shadow: 0 0 14px rgba(249, 115, 22, 0.38) !important;
    text-shadow: 0 0 8px rgba(249, 115, 22, 0.45) !important;
}
.studio-ui #studioDetailSettings #setTabBtn_watermark.active,
.studio-ui #studioDetailSettings #setTabBtn_watermark.active span {
    color: #fdba74 !important;
}
.studio-ui #studioDetailSettings #setTabBtn_watermark.active svg[data-studio-icon] {
    stroke: #fdba74 !important;
}

/* --- LIGHT MODE --- */
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_bgm,
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_bgm span {
    color: #059669 !important;
    font-weight: 800 !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_bgm svg[data-studio-icon] {
    stroke: #059669 !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_bgm:hover {
    background: rgba(16, 185, 129, 0.1) !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_bgm.active {
    background: #ecfdf5 !important;
    border: 1.5px solid #10b981 !important;
    box-shadow: 0 2px 10px rgba(16, 185, 129, 0.18) !important;
    text-shadow: none !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_bgm.active,
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_bgm.active span {
    color: #047857 !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_bgm.active svg[data-studio-icon] {
    stroke: #047857 !important;
}

html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_subtitles,
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_subtitles span {
    color: #0284c7 !important;
    font-weight: 800 !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_subtitles svg[data-studio-icon] {
    stroke: #0284c7 !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_subtitles:hover {
    background: rgba(2, 132, 199, 0.1) !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_subtitles.active {
    background: #f0f9ff !important;
    border: 1.5px solid #0ea5e9 !important;
    box-shadow: 0 2px 10px rgba(14, 165, 233, 0.18) !important;
    text-shadow: none !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_subtitles.active,
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_subtitles.active span {
    color: #0369a1 !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_subtitles.active svg[data-studio-icon] {
    stroke: #0369a1 !important;
}

html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_watermark,
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_watermark span {
    color: #ea580c !important;
    font-weight: 800 !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_watermark svg[data-studio-icon] {
    stroke: #ea580c !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_watermark:hover {
    background: rgba(234, 88, 12, 0.1) !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_watermark.active {
    background: #fff7ed !important;
    border: 1.5px solid #f97316 !important;
    box-shadow: 0 2px 10px rgba(249, 115, 22, 0.18) !important;
    text-shadow: none !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_watermark.active,
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_watermark.active span {
    color: #c2410c !important;
}
html[data-theme="light"] .studio-ui #studioDetailSettings #setTabBtn_watermark.active svg[data-studio-icon] {
    stroke: #c2410c !important;
}

/* =========================================================================
   Ô CHỨA SUB REAL-TIME KÉO THẢ (#liveSubOverlay)
   ========================================================================= */
.studio-ui #liveSubOverlay .live-sub-resize-pill {
    display: none;
}

.studio-ui #liveSubOverlay.is-standalone-sub-box {
    pointer-events: auto !important;
    cursor: grab !important;
    border: 2px dashed #38bdf8 !important;
    border-radius: 10px !important;
    padding: 6px 12px !important;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.75), 0 6px 20px rgba(0, 0, 0, 0.5) !important;
}

.studio-ui #liveSubOverlay.is-standalone-sub-box:active {
    cursor: grabbing !important;
    border-color: #7dd3fc !important;
}

.studio-ui #liveSubOverlay .live-sub-drag-badge {
    display: inline-flex !important;
    align-items: center !important;
    position: absolute !important;
    bottom: calc(100% + 6px) !important;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 2px 6px 2px 8px !important;
    border-radius: 999px !important;
    background: rgba(15, 23, 42, 0.94) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.75) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    pointer-events: auto !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    touch-action: manipulation !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), 0 0 14px rgba(56, 189, 248, 0.35) !important;
    z-index: 40 !important;
    max-width: calc(100% - 6px) !important;
    box-sizing: border-box !important;
}

.studio-ui #liveSubOverlay .live-sub-drag-handle-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    color: #7dd3fc !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    cursor: grab !important;
    touch-action: none !important;
    padding-right: 6px !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.studio-ui #liveSubOverlay .live-sub-font-controls {
    display: inline-flex !important;
    align-items: center !important;
    gap: 2px !important;
    margin-left: 3px !important;
    pointer-events: auto !important;
}

.studio-ui #liveSubOverlay .live-sub-size-indicator {
    display: inline-block !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #fef08a !important;
    font-variant-numeric: tabular-nums !important;
    min-width: 24px !important;
    text-align: center !important;
    padding: 0 2px !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.studio-ui #liveSubOverlay.is-standalone-sub-box .live-sub-resize-pill {
    display: block !important;
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    width: 7px !important;
    height: 22px !important;
    border-radius: 999px !important;
    background: #38bdf8 !important;
    border: 1.5px solid #0f172a !important;
    cursor: ew-resize !important;
    pointer-events: auto !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

.studio-ui #liveSubOverlay.is-standalone-sub-box .live-sub-resize-pill.is-left {
    left: -5px !important;
}

.studio-ui #liveSubOverlay.is-standalone-sub-box .live-sub-resize-pill.is-right {
    right: -5px !important;
}

@media (max-width: 1023px) {
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #liveSubOverlay .live-sub-drag-badge {
        font-size: 9.5px !important;
        padding: 2px 4px !important;
        bottom: calc(100% + 4px) !important;
        top: auto !important;
        max-width: 96% !important;
        gap: 2px !important;
    }
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) .live-sub-drag-handle-label {
        display: none !important;
    }
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) .live-sub-step-btn {
        min-width: 20px !important;
        width: 20px !important;
        height: 18px !important;
        font-size: 9.5px !important;
        border-radius: 4px !important;
        padding: 0 !important;
    }
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) #liveSubOverlay .live-sub-size-indicator {
        font-size: 9.5px !important;
        min-width: 24px !important;
        padding: 0 2px !important;
    }
}

/* =========================================================================
   BỘ CHỌN FONT CHỮ TRỰC QUAN (HIỂN THỊ ĐÚNG HÌNH DẠNG TỪNG FONT CHỮ)
   ========================================================================= */
.studio-ui select.studio-sr-only-select {
    display: none !important;
}

.studio-ui .studio-font-picker-btn {
    width: 100% !important;
    min-height: 40px !important;
    padding: 6px 11px !important;
    border-radius: 10px !important;
    background: rgba(10, 15, 30, 0.95) !important;
    border: 1px solid rgba(56, 189, 248, 0.42) !important;
    color: #f8fafc !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    text-align: left !important;
    cursor: pointer !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.studio-ui .studio-font-picker-btn:hover {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25) !important;
}

.studio-ui .studio-font-btn-left {
    display: flex !important;
    align-items: baseline !important;
    gap: 8px !important;
    min-width: 0 !important;
    overflow: hidden !important;
}

.studio-ui .studio-font-btn-name {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    white-space: nowrap !important;
}

.studio-ui .studio-font-btn-sample {
    font-size: 11.5px !important;
    color: #7dd3fc !important;
    opacity: 0.9 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.studio-ui .studio-font-btn-chevron {
    font-size: 13px !important;
    color: #38bdf8 !important;
    flex-shrink: 0 !important;
}

html[data-theme="light"] .studio-ui .studio-font-picker-btn {
    background: #ffffff !important;
    border: 1px solid rgba(2, 132, 199, 0.45) !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .studio-ui .studio-font-btn-name {
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui .studio-font-btn-sample {
    color: #0284c7 !important;
}

/* Modal / Sheet danh sách 26 Font chữ */
.studio-font-modal-backdrop {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10020 !important;
    background: rgba(2, 6, 23, 0.72) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 14px !important;
}

.studio-font-modal-backdrop.hidden {
    display: none !important;
}

.studio-font-modal-sheet {
    width: 100% !important;
    max-width: 430px !important;
    max-height: min(82dvh, 660px) !important;
    background: #0b1120 !important;
    border: 1.5px solid rgba(56, 189, 248, 0.5) !important;
    border-radius: 18px !important;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75) !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

html[data-theme="light"] .studio-font-modal-sheet {
    background: #ffffff !important;
    border: 1.5px solid rgba(148, 163, 184, 0.45) !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25) !important;
}

.studio-font-modal-header {
    padding: 12px 16px !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    background: rgba(15, 23, 42, 0.9) !important;
}

html[data-theme="light"] .studio-font-modal-header {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

.studio-font-modal-title {
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #f8fafc !important;
}

html[data-theme="light"] .studio-font-modal-title {
    color: #0f172a !important;
}

.studio-font-modal-subtitle {
    font-size: 11px !important;
    color: #94a3b8 !important;
    margin-top: 2px !important;
}

html[data-theme="light"] .studio-font-modal-subtitle {
    color: #475569 !important;
}

.studio-font-modal-close {
    width: 30px !important;
    height: 30px !important;
    border-radius: 999px !important;
    background: rgba(51, 65, 85, 0.6) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    color: #f8fafc !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}

html[data-theme="light"] .studio-font-modal-close {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

.studio-font-modal-list {
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    divide-y: 1px solid rgba(51, 65, 85, 0.4) !important;
}

.studio-font-option-row {
    width: 100% !important;
    padding: 11px 16px !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid rgba(51, 65, 85, 0.45) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    text-align: left !important;
    cursor: pointer !important;
    transition: background 0.12s ease !important;
}

html[data-theme="light"] .studio-font-option-row {
    border-bottom: 1px solid #e2e8f0 !important;
}

.studio-font-option-row:hover {
    background: rgba(56, 189, 248, 0.1) !important;
}

.studio-font-option-row.is-selected {
    background: rgba(16, 185, 129, 0.12) !important;
}

html[data-theme="light"] .studio-font-option-row.is-selected {
    background: #ecfdf5 !important;
}

.studio-font-option-main {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
}

.studio-font-option-title {
    font-size: 17px !important;
    line-height: 1.25 !important;
    color: #f8fafc !important;
    font-weight: 700 !important;
}

html[data-theme="light"] .studio-font-option-title {
    color: #0f172a !important;
}

.studio-font-option-sample {
    font-size: 12.5px !important;
    line-height: 1.3 !important;
    color: #94a3b8 !important;
}

html[data-theme="light"] .studio-font-option-sample {
    color: #475569 !important;
}

.studio-font-option-radio {
    width: 20px !important;
    height: 20px !important;
    border-radius: 999px !important;
    border: 2px solid #64748b !important;
    flex-shrink: 0 !important;
    position: relative !important;
}

.studio-font-option-row.is-selected .studio-font-option-radio {
    border-color: #10b981 !important;
}

.studio-font-option-row.is-selected .studio-font-option-radio::after {
    content: "" !important;
    position: absolute !important;
    inset: 3px !important;
    border-radius: 999px !important;
    background: #10b981 !important;
}

/* Ẩn ô "Tăng giảm viền khung vàng (ô xóa sub)" & ô "Trộn âm nhanh" vì đã kéo trực tiếp */
.studio-ui #settingsPane_subtitles > div:has(#padTopVal),
.studio-ui #settingsPane_bgm > div:has([onclick*="applyAudioMixPreset"]) {
    display: none !important;
}

/* =========================================================================
   KÉO THẢ & TĂNG GIẢM TRỰC TIẾP "CHE DẢI MÀU" (#colorBandTopRect, #colorBandBottomRect)
   Tối ưu cho Mobile (vùng chạm 28px, nút -/+ nhanh, không đè nút Toàn màn)
   ========================================================================= */
.studio-ui .studio-interactive-cband {
    pointer-events: auto !important;
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    cursor: grab !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 2px 8px !important;
    min-height: 22px !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

.studio-ui .studio-interactive-cband.hidden {
    display: none !important;
}

.studio-ui .studio-interactive-cband:active {
    cursor: grabbing !important;
}

.studio-ui #colorBandTopRect.studio-interactive-cband {
    border-bottom: 2px dashed #fbbf24 !important;
    padding-right: 92px !important; /* Tránh tuyệt đối nút Toàn màn ở góc trên phải */
}

.studio-ui #colorBandBottomRect.studio-interactive-cband {
    border-top: 2px dashed #fbbf24 !important;
    justify-content: center !important;
}

.studio-ui .studio-cband-toolbar {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 2px 6px !important;
    border-radius: 999px !important;
    background: rgba(15, 23, 42, 0.88) !important;
    border: 1px solid rgba(251, 191, 36, 0.65) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55) !important;
    z-index: 3 !important;
    max-width: 100% !important;
}

.studio-ui .studio-cband-drag-label {
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #fde68a !important;
    white-space: nowrap !important;
    letter-spacing: 0.01em !important;
}

.studio-ui .studio-cband-quick-btns {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
}

.studio-ui .studio-cband-step-btn,
.studio-ui .studio-cband-close-btn {
    width: 19px !important;
    height: 19px !important;
    min-height: 19px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: transform 0.12s ease, background 0.12s ease !important;
}

.studio-ui .studio-cband-step-btn {
    background: rgba(245, 158, 11, 0.22) !important;
    border: 1px solid rgba(251, 191, 36, 0.6) !important;
    color: #fef08a !important;
}

.studio-ui .studio-cband-step-btn:hover,
.studio-ui .studio-cband-step-btn:active {
    background: #f59e0b !important;
    color: #0f172a !important;
    transform: scale(1.08);
}

.studio-ui .studio-cband-close-btn {
    background: rgba(244, 63, 94, 0.22) !important;
    border: 1px solid rgba(251, 113, 133, 0.55) !important;
    color: #fda4af !important;
    font-size: 9.5px !important;
}

.studio-ui .studio-cband-close-btn:hover,
.studio-ui .studio-cband-close-btn:active {
    background: #e11d48 !important;
    color: #ffffff !important;
}

/* Thanh nắm kéo tăng/giảm độ dày dải che (vùng chạm cảm ứng 26px cho ngón tay Mobile) */
.studio-ui .studio-cband-resize-bar {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: ns-resize !important;
    z-index: 4 !important;
    pointer-events: auto !important;
    touch-action: none !important;
}

.studio-ui .studio-cband-resize-bar.is-bottom-edge {
    bottom: -12px !important;
}

.studio-ui .studio-cband-resize-bar.is-top-edge {
    top: -12px !important;
}

.studio-ui .studio-cband-resize-pill {
    padding: 1.5px 8px !important;
    border-radius: 999px !important;
    background: #f59e0b !important;
    border: 1.5px solid #0f172a !important;
    color: #0f172a !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55) !important;
    white-space: nowrap !important;
    pointer-events: none !important;
}

/* =========================================================================
   KÉO THẢ & TĂNG GIẢM 8 HƯỚNG "THÊM VÙNG NHÒA" (#customBlurOverlay)
   ========================================================================= */
.studio-ui #customBlurOverlay.studio-enhanced-cblur {
    pointer-events: auto !important;
    touch-action: none !important;
    cursor: grab !important;
    border: 2px dashed #22d3ee !important;
    background: rgba(6, 182, 212, 0.22) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border-radius: 10px !important;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.65), 0 6px 20px rgba(0, 0, 0, 0.45) !important;
}

.studio-ui #customBlurOverlay.studio-enhanced-cblur.hidden {
    display: none !important;
}

.studio-ui #customBlurOverlay.studio-enhanced-cblur:active {
    cursor: grabbing !important;
    border-color: #67e8f9 !important;
}

.studio-ui .studio-cblur-toolbar {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    background: rgba(8, 51, 68, 0.9) !important;
    border: 1px solid rgba(34, 211, 238, 0.65) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5) !important;
    max-width: calc(100% - 12px) !important;
    z-index: 2 !important;
}

.studio-ui .studio-cblur-badge {
    font-size: 9.5px !important;
    font-weight: 800 !important;
    color: #cffafe !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    pointer-events: none !important;
}

.studio-ui .studio-cblur-close-btn {
    width: 17px !important;
    height: 17px !important;
    min-height: 17px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    background: rgba(244, 63, 94, 0.28) !important;
    border: 1px solid rgba(251, 113, 133, 0.6) !important;
    color: #ffe4e6 !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

.studio-ui .studio-cblur-close-btn:hover {
    background: #e11d48 !important;
    color: #ffffff !important;
}

/* 8 điểm chạm kéo chỉnh kích thước Vùng nhòa (4 cạnh + 4 góc, vùng chạm rộng 26px cho Mobile) */
.studio-ui .studio-cblur-handle {
    position: absolute !important;
    z-index: 5 !important;
    pointer-events: auto !important;
    touch-action: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.studio-ui .studio-cblur-handle.is-edge.is-n {
    top: -12px !important;
    left: 18px !important;
    right: 18px !important;
    height: 24px !important;
    cursor: ns-resize !important;
}
.studio-ui .studio-cblur-handle.is-edge.is-s {
    bottom: -12px !important;
    left: 18px !important;
    right: 18px !important;
    height: 24px !important;
    cursor: ns-resize !important;
}
.studio-ui .studio-cblur-handle.is-edge.is-w {
    left: -12px !important;
    top: 14px !important;
    bottom: 14px !important;
    width: 24px !important;
    cursor: ew-resize !important;
}
.studio-ui .studio-cblur-handle.is-edge.is-e {
    right: -12px !important;
    top: 14px !important;
    bottom: 14px !important;
    width: 24px !important;
    cursor: ew-resize !important;
}

.studio-ui .studio-cblur-handle.is-edge > span {
    display: block !important;
    border-radius: 999px !important;
    background: #22d3ee !important;
    border: 1.5px solid #083344 !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55) !important;
}
.studio-ui .studio-cblur-handle.is-edge.is-n > span,
.studio-ui .studio-cblur-handle.is-edge.is-s > span {
    width: 26px !important;
    height: 6px !important;
}
.studio-ui .studio-cblur-handle.is-edge.is-w > span,
.studio-ui .studio-cblur-handle.is-edge.is-e > span {
    width: 6px !important;
    height: 22px !important;
}

.studio-ui .studio-cblur-handle.is-corner {
    width: 26px !important;
    height: 26px !important;
}
.studio-ui .studio-cblur-handle.is-corner::after {
    content: "" !important;
    width: 11px !important;
    height: 11px !important;
    border-radius: 999px !important;
    background: #67e8f9 !important;
    border: 2px solid #083344 !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.6) !important;
}
.studio-ui .studio-cblur-handle.is-nw { top: -13px !important; left: -13px !important; cursor: nwse-resize !important; }
.studio-ui .studio-cblur-handle.is-ne { top: -13px !important; right: -13px !important; cursor: nesw-resize !important; }
.studio-ui .studio-cblur-handle.is-sw { bottom: -13px !important; left: -13px !important; cursor: nesw-resize !important; }
.studio-ui .studio-cblur-handle.is-br { bottom: -13px !important; right: -13px !important; cursor: nwse-resize !important; }

/* Thu gọn nhãn trong chế độ Popup nổi thu góc trên Mobile */
@media (max-width: 1023px) {
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) .studio-cband-toolbar {
        padding: 1px 5px !important;
        gap: 3px !important;
    }
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) .studio-cband-drag-label,
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) .studio-cblur-badge {
        font-size: 8.5px !important;
    }
    .studio-ui #studioPreviewCard.is-mobile-floating-popup:not(.is-preview-fullscreen) .studio-cband-resize-pill {
        font-size: 7.5px !important;
        padding: 1px 5px !important;
    }
}

/* =========================================================================
   NÚT CHUÔNG THÔNG BÁO (🔔) & TRUNG TÂM THÔNG BÁO (DARK MODE + LIGHT MODE)
   Khắc phục triệt để lỗi chữ trắng trên nền trắng ở Giao diện Sáng (Ảnh 2)
   ========================================================================= */
.studio-ui .studio-header-bell-btn {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    min-height: 36px !important;
    padding: 6px 11px !important;
    border-radius: 11px !important;
    background: rgba(15, 23, 42, 0.9) !important;
    border: 1px solid rgba(56, 189, 248, 0.38) !important;
    color: #e2e8f0 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: all 0.18s ease !important;
}

.studio-ui .studio-header-bell-btn:hover {
    background: rgba(14, 165, 233, 0.18) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
    transform: translateY(-1px);
}

.studio-ui .studio-header-bell-btn svg[data-studio-icon="bell"] {
    width: 16px !important;
    height: 16px !important;
    stroke: #fbbf24 !important;
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.45));
}

.studio-ui .studio-notif-badge {
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    min-width: 18px !important;
    height: 18px !important;
    padding: 0 5px !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #f43f5e, #e11d48) !important;
    border: 2px solid #0b1120 !important;
    color: #ffffff !important;
    font-size: 10px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(244, 63, 94, 0.6) !important;
}

.studio-ui .studio-notif-badge.hidden {
    display: none !important;
}

html[data-theme="light"] .studio-ui .studio-header-bell-btn {
    background: #f8fafc !important;
    border: 1.5px solid rgba(148, 163, 184, 0.5) !important;
    color: #0f172a !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] .studio-ui .studio-header-bell-btn:hover {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
}

html[data-theme="light"] .studio-ui .studio-header-bell-btn svg[data-studio-icon="bell"] {
    stroke: #d97706 !important;
    filter: none !important;
}

html[data-theme="light"] .studio-ui .studio-notif-badge {
    border-color: #ffffff !important;
    color: #ffffff !important;
}

/* --- MODAL TRUNG TÂM THÔNG BÁO (#historyModal) --- */
.studio-ui #historyModal .studio-notif-modal-card {
    max-width: 580px !important;
    width: 100% !important;
    padding: 20px 22px !important;
    border-radius: 22px !important;
    background: #0d1426 !important;
    border: 1.5px solid rgba(56, 189, 248, 0.42) !important;
    box-shadow: 0 25px 65px rgba(0, 0, 0, 0.88), 0 0 35px rgba(14, 165, 233, 0.16) !important;
}

.studio-ui #historyModal .studio-notif-modal-title {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    font-size: 17px !important;
    font-weight: 850 !important;
    color: #f8fafc !important;
    margin: 0 0 12px 0 !important;
    padding-right: 36px !important;
}

.studio-ui #historyModal .studio-notif-title-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
    background: rgba(245, 158, 11, 0.16) !important;
    border: 1px solid rgba(251, 191, 36, 0.45) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.studio-ui #historyModal .studio-notif-title-icon svg {
    width: 17px !important;
    height: 17px !important;
    stroke: #fbbf24 !important;
}

.studio-ui #historyModal .studio-notif-close-btn {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 999px !important;
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    color: #cbd5e1 !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
}

.studio-ui #historyModal .studio-notif-close-btn:hover {
    background: rgba(244, 63, 94, 0.2) !important;
    border-color: #fb7185 !important;
    color: #ffffff !important;
}

.studio-ui #historyModal .studio-notif-header-controls {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    margin-bottom: 12px !important;
}

.studio-ui #historyModal .studio-notif-summary-bar {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    background: rgba(15, 23, 42, 0.92) !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    font-size: 12px !important;
    color: #e2e8f0 !important;
}

.studio-ui #historyModal .studio-notif-wallet-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
}

.studio-ui #historyModal .studio-notif-wallet-pill b {
    color: #fbbf24 !important;
    font-weight: 850 !important;
}

.studio-ui #historyModal .studio-notif-topup-link {
    padding: 3px 9px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #f59e0b, #ea580c) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    border: none !important;
    cursor: pointer !important;
}

.studio-ui #historyModal .studio-notif-actions-right {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.studio-ui #historyModal .studio-notif-action-btn {
    padding: 4px 9px !important;
    border-radius: 8px !important;
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(148, 163, 184, 0.3) !important;
    color: #93c5fd !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
}

.studio-ui #historyModal .studio-notif-action-btn:hover {
    border-color: #38bdf8 !important;
    color: #ffffff !important;
}

.studio-ui #historyModal .studio-notif-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 5px !important;
    padding: 4px !important;
    border-radius: 12px !important;
    background: rgba(9, 14, 26, 0.95) !important;
    border: 1px solid rgba(51, 65, 85, 0.85) !important;
}

.studio-ui #historyModal .studio-notif-tab {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    min-height: 34px !important;
    padding: 5px 8px !important;
    border-radius: 9px !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: #94a3b8 !important;
    font-size: 11.5px !important;
    font-weight: 750 !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.studio-ui #historyModal .studio-notif-tab.active {
    background: rgba(14, 165, 233, 0.22) !important;
    border-color: #38bdf8 !important;
    color: #ffffff !important;
}

.studio-ui #historyModal .studio-notif-tab-count {
    padding: 1px 6px !important;
    border-radius: 999px !important;
    background: rgba(30, 41, 59, 0.9) !important;
    color: #7dd3fc !important;
    font-size: 10px !important;
    font-weight: 800 !important;
}

.studio-ui #historyModal #pointHistoryList {
    max-height: min(58dvh, 410px) !important;
    overflow-y: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding-right: 4px !important;
}

.studio-ui #historyModal .studio-notif-item {
    display: flex !important;
    align-items: flex-start !important;
    gap: 11px !important;
    padding: 12px 13px !important;
    border-radius: 14px !important;
    background: rgba(15, 23, 42, 0.92) !important;
    border: 1px solid rgba(51, 65, 85, 0.85) !important;
    transition: border-color 0.15s ease !important;
}

.studio-ui #historyModal .studio-notif-item.is-unread {
    border-left: 3.5px solid #38bdf8 !important;
    background: rgba(14, 165, 233, 0.1) !important;
}

.studio-ui #historyModal .studio-notif-icon {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(148, 163, 184, 0.25) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 16px !important;
    flex-shrink: 0 !important;
}

.studio-ui #historyModal .studio-notif-body {
    flex: 1 1 0 !important;
    min-width: 0 !important;
}

.studio-ui #historyModal .studio-notif-row-top {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 8px !important;
    margin-bottom: 3px !important;
}

.studio-ui #historyModal .studio-notif-item-title {
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #f8fafc !important;
    line-height: 1.35 !important;
}

.studio-ui #historyModal .studio-notif-item-sub {
    font-size: 11.5px !important;
    color: #cbd5e1 !important;
    line-height: 1.4 !important;
}

.studio-ui #historyModal .studio-notif-item-meta {
    font-size: 10.5px !important;
    color: #94a3b8 !important;
    margin-top: 3px !important;
}

.studio-ui #historyModal .studio-notif-pill {
    padding: 3px 8px !important;
    border-radius: 999px !important;
    font-size: 11.5px !important;
    font-weight: 850 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.studio-ui #historyModal .studio-notif-pill.is-plus {
    background: rgba(16, 185, 129, 0.18) !important;
    border: 1px solid rgba(52, 211, 153, 0.45) !important;
    color: #34d399 !important;
}

.studio-ui #historyModal .studio-notif-pill.is-minus {
    background: rgba(245, 158, 11, 0.18) !important;
    border: 1px solid rgba(251, 191, 36, 0.45) !important;
    color: #fbbf24 !important;
}

.studio-ui #historyModal .studio-notif-pill.is-info {
    background: rgba(14, 165, 233, 0.18) !important;
    border: 1px solid rgba(56, 189, 248, 0.45) !important;
    color: #38bdf8 !important;
}

.studio-ui #historyModal .studio-notif-pill.is-error {
    background: rgba(244, 63, 94, 0.18) !important;
    border: 1px solid rgba(251, 113, 133, 0.45) !important;
    color: #fb7185 !important;
}

.studio-ui #historyModal .studio-notif-item-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 8px !important;
}

.studio-ui #historyModal .studio-notif-mini-btn {
    padding: 5px 10px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    cursor: pointer !important;
}

.studio-ui #historyModal .studio-notif-mini-btn.is-primary {
    background: rgba(14, 165, 233, 0.22) !important;
    border: 1px solid #38bdf8 !important;
    color: #7dd3fc !important;
}

.studio-ui #historyModal .studio-notif-mini-btn.is-success {
    background: rgba(16, 185, 129, 0.22) !important;
    border: 1px solid #34d399 !important;
    color: #6ee7b7 !important;
}

.studio-ui #historyModal .studio-notif-empty {
    text-align: center !important;
    padding: 28px 16px !important;
    border-radius: 14px !important;
    background: rgba(15, 23, 42, 0.6) !important;
    border: 1px dashed rgba(100, 116, 139, 0.4) !important;
    color: #94a3b8 !important;
    font-size: 12.5px !important;
    font-weight: 600 !important;
}

/* --- GIAO DIỆN SÁNG (LIGHT MODE) CHO #historyModal & #topupModal --- */
html[data-theme="light"] .studio-ui :is(#historyModal, #topupModal) {
    background: rgba(15, 23, 42, 0.5) !important;
    backdrop-filter: blur(8px) !important;
}

html[data-theme="light"] .studio-ui #historyModal .glass-card,
html[data-theme="light"] .studio-ui #historyModal .studio-notif-modal-card,
html[data-theme="light"] .studio-ui #topupModal .glass-card {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22) !important;
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-modal-title,
html[data-theme="light"] .studio-ui #topupModal h3 {
    color: #0f172a !important;
    text-shadow: none !important;
}

html[data-theme="light"] .studio-ui #topupModal p {
    color: #475569 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-title-icon {
    background: #fffbeb !important;
    border-color: #fcd34d !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-title-icon svg {
    stroke: #d97706 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-close-btn,
html[data-theme="light"] .studio-ui #topupModal button[onclick="closeTopupModal()"] {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #334155 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-close-btn:hover {
    background: #ffe4e6 !important;
    border-color: #fb7185 !important;
    color: #be123c !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-summary-bar {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-wallet-pill b {
    color: #b45309 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-action-btn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #0284c7 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-action-btn:hover {
    background: #f0f9ff !important;
    border-color: #0284c7 !important;
    color: #0369a1 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-tabs {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-tab {
    color: #475569 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-tab.active {
    background: #ffffff !important;
    border-color: #0284c7 !important;
    color: #0284c7 !important;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-tab-count {
    background: #e2e8f0 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-tab.active .studio-notif-tab-count {
    background: #e0f2fe !important;
    color: #0369a1 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-item {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-item.is-unread {
    background: #f0f9ff !important;
    border-color: #bae6fd !important;
    border-left: 3.5px solid #0284c7 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-icon {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-item-title,
html[data-theme="light"] .studio-ui #historyModal .text-white {
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-item-sub {
    color: #334155 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-item-meta {
    color: #64748b !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-pill.is-plus {
    background: #ecfdf5 !important;
    border: 1px solid #6ee7b7 !important;
    color: #047857 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-pill.is-minus {
    background: #fffbeb !important;
    border: 1px solid #fcd34d !important;
    color: #b45309 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-pill.is-info {
    background: #f0f9ff !important;
    border: 1px solid #7dd3fc !important;
    color: #0369a1 !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-pill.is-error {
    background: #fff1f2 !important;
    border: 1px solid #fda4af !important;
    color: #be123c !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-mini-btn.is-primary {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-mini-btn.is-success {
    background: #059669 !important;
    border-color: #059669 !important;
    color: #ffffff !important;
}

html[data-theme="light"] .studio-ui #historyModal .studio-notif-empty {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #475569 !important;
}

@media (max-width: 639px) {
    .studio-ui #historyModal .studio-notif-modal-card {
        padding: 16px 14px !important;
        border-radius: 18px !important;
    }
    .studio-ui #historyModal .studio-notif-tab {
        font-size: 10.5px !important;
        padding: 4px 4px !important;
    }
    .studio-ui #historyModal .studio-notif-row-top {
        flex-direction: column !important;
        gap: 4px !important;
    }
}

/* =========================================================================
   HỆ THỐNG BÁO SÁNG KHI CHẠM / KÉO THẢ / THU PHÓNG TRÊN PREVIEW (#videoStage)
   & TỐI ƯU KÉO THẢ + THU PHÓNG LOGO (#wmLogoOverlay) & CHỮ (#wmTextOverlay)
   ========================================================================= */

/* 1. Thanh HUD báo trạng thái đang kéo/thu phóng theo thời gian thực ở đỉnh giữa Preview */
.studio-ui .studio-stage-active-hud {
    position: absolute !important;
    top: 8px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    z-index: 65 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 11px !important;
    border-radius: 999px !important;
    background: rgba(2, 6, 23, 0.92) !important;
    border: 1.5px solid #34d399 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.25), 0 6px 20px rgba(0, 0, 0, 0.75) !important;
    color: #ecfdf5 !important;
    font-size: 10.5px !important;
    font-weight: 800 !important;
    letter-spacing: 0.01em !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    transition: opacity 0.16s ease, transform 0.16s ease !important;
}

.studio-ui .studio-stage-active-hud.hidden {
    display: none !important;
}

.studio-ui .studio-hud-dot {
    width: 7px !important;
    height: 7px !important;
    border-radius: 999px !important;
    background: #10b981 !important;
    box-shadow: 0 0 8px #34d399, 0 0 14px #10b981 !important;
    flex-shrink: 0 !important;
}

/* 2. Khi đang chạm giữ / kéo 1 ô bất kỳ: làm dịu nhẹ các ô còn lại để ô đang kéo nổi bật 100% */
.studio-ui #editingOverlaysContainer.has-active-overlay-drag > :not(.is-overlay-dragging):not(#sourcePatchOverlay) {
    opacity: 0.42 !important;
    transition: opacity 0.12s ease !important;
}

.studio-ui #editingOverlaysContainer > .is-overlay-dragging {
    opacity: 1 !important;
    z-index: 48 !important;
}

/* 3. Hiệu ứng PHÁT SÁNG RỰC RỠ (Active Glow) riêng biệt cho từng loại ô khi chạm/kéo */

/* 3a. Ô vàng xóa sub gốc (#blurBoxOverlay) phát sáng vàng kim rực rỡ + bung 8 tay nắm */
.studio-ui #blurBoxOverlay.is-overlay-selected {
    border-color: #fde047 !important;
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.35), 0 0 16px rgba(251, 191, 36, 0.55) !important;
}

.studio-ui #blurBoxOverlay.is-overlay-dragging {
    border: 2.5px solid #fef08a !important;
    background-color: rgba(250, 204, 21, 0.24) !important;
    box-shadow: 0 0 0 4px rgba(250, 204, 21, 0.45), 0 0 28px rgba(245, 158, 11, 0.95), inset 0 0 16px rgba(254, 240, 138, 0.25) !important;
}

.studio-ui #blurBoxOverlay.is-overlay-selected [data-blur-pill],
.studio-ui #blurBoxOverlay.is-overlay-dragging [data-blur-pill] {
    opacity: 1 !important;
    transform: scale(1.18);
    background: #fde047 !important;
    box-shadow: 0 0 8px rgba(250, 204, 21, 0.95) !important;
}

/* 3b. Ô phụ đề mới (#liveSubOverlay) phát sáng xanh ngọc / lam sáng khi chạm kéo */
.studio-ui #liveSubOverlay .live-sub-drag-badge {
    pointer-events: auto !important;
}

.studio-ui .live-sub-step-btn {
    min-width: 24px !important;
    width: 24px !important;
    height: 22px !important;
    padding: 0 !important;
    border-radius: 6px !important;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98)) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.8) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
    transition: transform 0.1s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.studio-ui .live-sub-step-btn:hover {
    background: linear-gradient(135deg, #0284c7, #0369a1) !important;
    border-color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.7) !important;
}

.studio-ui .live-sub-step-btn:active {
    transform: scale(0.9) !important;
    background: #facc15 !important;
    color: #0f172a !important;
    border-color: #eab308 !important;
    box-shadow: 0 0 16px rgba(250, 204, 21, 0.85) !important;
}

.studio-ui #liveSubOverlay.is-overlay-selected.is-standalone-sub-box {
    border-color: #34d399 !important;
    box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.35), 0 0 18px rgba(16, 185, 129, 0.6) !important;
}

.studio-ui #liveSubOverlay.is-overlay-dragging {
    border: 2.5px solid #6ee7b7 !important;
    background-color: rgba(16, 185, 129, 0.26) !important;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.45), 0 0 28px rgba(16, 185, 129, 0.95), inset 0 0 14px rgba(110, 231, 183, 0.25) !important;
    border-radius: 10px !important;
}

.studio-ui #liveSubOverlay.is-overlay-dragging .live-sub-drag-badge {
    background: #10b981 !important;
    border-color: #ecfdf5 !important;
    color: #022c22 !important;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.95) !important;
}

.studio-ui #liveSubOverlay.is-overlay-dragging .live-sub-resize-pill {
    background: #6ee7b7 !important;
    transform: translateY(-50%) scale(1.25) !important;
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.95) !important;
}

/* 3c. Dải màu che trên / dưới (#colorBandTopRect, #colorBandBottomRect) phát sáng cam vàng khi kéo */
.studio-ui .studio-interactive-cband.is-overlay-selected {
    box-shadow: 0 0 0 2px rgba(251, 191, 36, 0.45), 0 0 16px rgba(245, 158, 11, 0.55) !important;
}

.studio-ui .studio-interactive-cband.is-overlay-dragging {
    border-color: #fef08a !important;
    box-shadow: 0 0 0 3px rgba(254, 240, 138, 0.65), 0 0 28px rgba(245, 158, 11, 0.95), inset 0 0 22px rgba(251, 191, 36, 0.38) !important;
}

.studio-ui .studio-interactive-cband.is-overlay-dragging .studio-cband-toolbar {
    background: rgba(120, 53, 15, 0.95) !important;
    border-color: #fef08a !important;
    box-shadow: 0 0 14px rgba(251, 191, 36, 0.85) !important;
}

.studio-ui .studio-interactive-cband.is-overlay-dragging .studio-cband-resize-pill {
    background: #fef08a !important;
    color: #0f172a !important;
    transform: scale(1.12);
    box-shadow: 0 0 12px rgba(254, 240, 138, 0.95) !important;
}

/* 3d. Ô vùng nhòa thêm (#customBlurOverlay) phát sáng xanh điện quang khi kéo */
.studio-ui #customBlurOverlay.studio-enhanced-cblur.is-overlay-selected {
    border-color: #67e8f9 !important;
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.4), 0 0 18px rgba(6, 182, 212, 0.65) !important;
}

.studio-ui #customBlurOverlay.studio-enhanced-cblur.is-overlay-dragging {
    border: 2.5px solid #cffafe !important;
    background: rgba(6, 182, 212, 0.36) !important;
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.5), 0 0 30px rgba(6, 182, 212, 0.98), inset 0 0 18px rgba(165, 243, 252, 0.32) !important;
}

.studio-ui #customBlurOverlay.studio-enhanced-cblur.is-overlay-dragging .studio-cblur-toolbar {
    background: #0891b2 !important;
    border-color: #ecfeff !important;
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.9) !important;
}

.studio-ui #customBlurOverlay.studio-enhanced-cblur.is-overlay-dragging .studio-cblur-handle.is-corner {
    transform: scale(1.22);
    background: #ffffff !important;
    box-shadow: 0 0 10px #22d3ee !important;
}

/* =========================================================================
   4. THIẾT KẾ LOGO (#wmLogoOverlay) & CHỮ CHÈN (#wmTextOverlay) KÉO THẢ + THU PHÓNG
   ========================================================================= */
.studio-ui .studio-enhanced-wm-item {
    overflow: visible !important;
    touch-action: none !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    cursor: grab !important;
    border-radius: 8px !important;
    transition: box-shadow 0.14s ease, border-color 0.14s ease, background-color 0.14s ease !important;
}

.studio-ui .studio-enhanced-wm-item.hidden {
    display: none !important;
}

.studio-ui .studio-enhanced-wm-item:active {
    cursor: grabbing !important;
}

/* Khung mặc định & phát sáng khi chạm của Logo (#wmLogoOverlay) */
.studio-ui #wmLogoOverlay.studio-enhanced-wm-logo {
    min-width: 34px !important;
    min-height: 28px !important;
    padding: 3px !important;
    border: 1.5px dashed rgba(56, 189, 248, 0.85) !important;
    background: rgba(14, 165, 233, 0.08) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45) !important;
}

.studio-ui #wmLogoOverlay.studio-enhanced-wm-logo.is-overlay-selected,
.studio-ui #wmLogoOverlay.studio-enhanced-wm-logo:hover {
    border: 2px solid #38bdf8 !important;
    background: rgba(14, 165, 233, 0.16) !important;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.32), 0 0 18px rgba(14, 165, 233, 0.7) !important;
}

.studio-ui #wmLogoOverlay.studio-enhanced-wm-logo.is-overlay-dragging {
    border: 2.5px solid #bae6fd !important;
    background: rgba(14, 165, 233, 0.28) !important;
    box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.55), 0 0 28px rgba(14, 165, 233, 0.98), inset 0 0 14px rgba(186, 230, 253, 0.32) !important;
}

/* Khung mặc định & phát sáng khi chạm của Chữ chèn (#wmTextOverlay) */
.studio-ui #wmTextOverlay.studio-enhanced-wm-text {
    min-width: 44px !important;
    min-height: 26px !important;
    padding: 3px 9px !important;
    border: 1.5px dashed rgba(251, 191, 36, 0.85) !important;
    background: rgba(15, 23, 42, 0.32) !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.studio-ui #wmTextOverlay.studio-enhanced-wm-text.hidden {
    display: none !important;
}

.studio-ui #wmTextOverlay.studio-enhanced-wm-text.is-overlay-selected,
.studio-ui #wmTextOverlay.studio-enhanced-wm-text:hover {
    border: 2px solid #fbbf24 !important;
    background: rgba(245, 158, 11, 0.18) !important;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.34), 0 0 18px rgba(245, 158, 11, 0.75) !important;
}

.studio-ui #wmTextOverlay.studio-enhanced-wm-text.is-overlay-dragging {
    border: 2.5px solid #fef08a !important;
    background: rgba(245, 158, 11, 0.32) !important;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.55), 0 0 28px rgba(245, 158, 11, 0.98), inset 0 0 14px rgba(254, 240, 138, 0.3) !important;
}

.studio-ui .studio-wm-text-content {
    pointer-events: none !important;
    display: inline-block !important;
    line-height: 1.2 !important;
}

.studio-ui .studio-wm-ui-layer {
    position: absolute !important;
    inset: 0 !important;
    pointer-events: none !important;
    overflow: visible !important;
}

/* Thanh công cụ nổi (Floating Pill: Cỡ + Nút - / + / ✕) trên Logo & Chữ */
.studio-ui .studio-wm-toolbar {
    position: absolute !important;
    bottom: calc(100% + 6px) !important;
    left: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 2px 6px !important;
    border-radius: 999px !important;
    background: rgba(2, 6, 23, 0.92) !important;
    border: 1px solid rgba(56, 189, 248, 0.75) !important;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.65) !important;
    white-space: nowrap !important;
    pointer-events: auto !important;
    z-index: 12 !important;
    opacity: 0 !important;
    transform: translateY(3px) scale(0.95) !important;
    transition: opacity 0.14s ease, transform 0.14s ease !important;
    /* Reset font-size & text-shadow để không bị kế thừa từ #wmTextOverlay */
    font-family: 'Be Vietnam Pro', system-ui, sans-serif !important;
    font-size: 9.5px !important;
    font-weight: 800 !important;
    text-shadow: none !important;
    color: #f8fafc !important;
}

.studio-ui #wmTextOverlay .studio-wm-toolbar {
    border-color: rgba(251, 191, 36, 0.8) !important;
}

/* Tự động lật thanh công cụ xuống dưới nếu Logo/Chữ nằm sát mép trên, hoặc căn phải nếu sát mép phải */
.studio-ui .studio-enhanced-wm-item.is-toolbar-bottom .studio-wm-toolbar {
    bottom: auto !important;
    top: calc(100% + 6px) !important;
}

.studio-ui .studio-enhanced-wm-item.is-toolbar-right .studio-wm-toolbar {
    left: auto !important;
    right: 0 !important;
}

/* Hiển thị thanh công cụ khi chạm chọn (is-overlay-selected), đang kéo (is-overlay-dragging) hoặc hover trên PC */
.studio-ui .studio-enhanced-wm-item.is-overlay-selected .studio-wm-toolbar,
.studio-ui .studio-enhanced-wm-item.is-overlay-dragging .studio-wm-toolbar,
.studio-ui .studio-enhanced-wm-item:hover .studio-wm-toolbar {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

.studio-ui .studio-wm-badge {
    font-size: 9.5px !important;
    font-weight: 800 !important;
    color: #e0f2fe !important;
    letter-spacing: 0.01em !important;
}

.studio-ui #wmTextOverlay .studio-wm-badge {
    color: #fef3c7 !important;
}

.studio-ui .studio-wm-quick-btns {
    display: inline-flex !important;
    align-items: center !important;
    gap: 2.5px !important;
}

.studio-ui .studio-wm-step-btn,
.studio-ui .studio-wm-close-btn {
    width: 18px !important;
    height: 18px !important;
    min-height: 18px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    text-shadow: none !important;
}

.studio-ui .studio-wm-step-btn {
    background: rgba(56, 189, 248, 0.22) !important;
    border: 1px solid rgba(125, 211, 252, 0.65) !important;
    color: #e0f2fe !important;
}

.studio-ui #wmTextOverlay .studio-wm-step-btn {
    background: rgba(245, 158, 11, 0.24) !important;
    border: 1px solid rgba(252, 211, 77, 0.7) !important;
    color: #fef3c7 !important;
}

.studio-ui .studio-wm-step-btn:hover,
.studio-ui .studio-wm-step-btn:active {
    background: #38bdf8 !important;
    color: #0f172a !important;
}

.studio-ui #wmTextOverlay .studio-wm-step-btn:hover,
.studio-ui #wmTextOverlay .studio-wm-step-btn:active {
    background: #fbbf24 !important;
    color: #0f172a !important;
}

.studio-ui .studio-wm-close-btn {
    background: rgba(244, 63, 94, 0.25) !important;
    border: 1px solid rgba(251, 113, 133, 0.65) !important;
    color: #fda4af !important;
    font-size: 9px !important;
}

.studio-ui .studio-wm-close-btn:hover,
.studio-ui .studio-wm-close-btn:active {
    background: #e11d48 !important;
    color: #ffffff !important;
}

/* 4 Tay nắm ở 4 góc của Logo & Chữ (Vùng chạm cảm ứng mở rộng 24px cho ngón tay Mobile) */
.studio-ui .studio-wm-handle.is-corner {
    position: absolute !important;
    width: 11px !important;
    height: 11px !important;
    border-radius: 999px !important;
    background: #38bdf8 !important;
    border: 2px solid #0f172a !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.65) !important;
    pointer-events: auto !important;
    touch-action: none !important;
    z-index: 10 !important;
    opacity: 0 !important;
    transition: opacity 0.14s ease, transform 0.14s ease !important;
}

/* Mở rộng vùng nhận cảm ứng ngón tay lên 26x26px xung quanh mỗi góc */
.studio-ui .studio-wm-handle.is-corner::before {
    content: "" !important;
    position: absolute !important;
    inset: -8px !important;
}

.studio-ui #wmTextOverlay .studio-wm-handle.is-corner {
    background: #fbbf24 !important;
}

/* Tay nắm chính ở góc dưới-phải (↘) luôn hiển thị để người dùng thấy ngay có thể kéo phóng to/thu nhỏ */
.studio-ui .studio-wm-handle.is-corner.is-primary-scale {
    opacity: 1 !important;
    width: 15px !important;
    height: 15px !important;
    right: -7px !important;
    bottom: -7px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: system-ui, sans-serif !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    color: #0f172a !important;
    text-shadow: none !important;
    cursor: nwse-resize !important;
}

.studio-ui .studio-wm-handle.is-corner.is-primary-scale span {
    pointer-events: none !important;
}

.studio-ui .studio-enhanced-wm-item.is-overlay-selected .studio-wm-handle.is-corner,
.studio-ui .studio-enhanced-wm-item.is-overlay-dragging .studio-wm-handle.is-corner,
.studio-ui .studio-enhanced-wm-item:hover .studio-wm-handle.is-corner {
    opacity: 1 !important;
}

.studio-ui .studio-enhanced-wm-item.is-overlay-dragging .studio-wm-handle.is-corner {
    transform: scale(1.2) !important;
    background: #ffffff !important;
    box-shadow: 0 0 10px #38bdf8 !important;
}

.studio-ui #wmTextOverlay.is-overlay-dragging .studio-wm-handle.is-corner {
    box-shadow: 0 0 10px #fbbf24 !important;
}

.studio-ui .studio-wm-handle.is-nw {
    top: -5px !important;
    left: -5px !important;
    cursor: nwse-resize !important;
}

.studio-ui .studio-wm-handle.is-ne {
    top: -5px !important;
    right: -5px !important;
    cursor: nesw-resize !important;
}

.studio-ui .studio-wm-handle.is-sw {
    bottom: -5px !important;
    left: -5px !important;
    cursor: nesw-resize !important;
}

/* =========================================================================
   SMART STUDIO UPGRADES SUITE (DOWNMAX TRAFFIC BANNER, CHANNEL PRESETS, 9:16 REFRAME,
   COLOR BAND LIVE HOOK TITLE, AI CAPTION CARD, SMART BGM & SUBTITLE AI PILLS)
   ========================================================================= */

/* 1. DownMax Traffic Funnel Banner (Directing traffic to downmax.io.vn) */
.studio-ui .studio-downmax-traffic-banner {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-bottom: 6px !important;
    animation: studioDmFadeIn 0.22s ease-out !important;
}

.studio-ui .studio-dm-traffic-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px !important;
    padding: 8px 12px 8px 10px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, rgba(20, 26, 46, 0.92) 0%, rgba(10, 16, 32, 0.96) 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.28) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
    position: relative !important;
}

.studio-ui .studio-dm-traffic-left {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.studio-ui .studio-dm-traffic-icon-box {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 8px !important;
    background: rgba(56, 189, 248, 0.12) !important;
    color: #38bdf8 !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
}

.studio-ui .studio-dm-traffic-text {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
}

.studio-ui .studio-dm-traffic-title-line {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
}

.studio-ui .studio-dm-traffic-title {
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #f8fafc !important;
    letter-spacing: -0.01em !important;
}

.studio-ui .studio-dm-traffic-tag {
    display: inline-flex !important;
    align-items: center !important;
    padding: 1px 6px !important;
    border-radius: 999px !important;
    font-size: 9.5px !important;
    font-weight: 800 !important;
    background: rgba(249, 115, 22, 0.18) !important;
    color: #fb923c !important;
    border: 0.8px solid rgba(249, 115, 22, 0.35) !important;
    white-space: nowrap !important;
}

.studio-ui .studio-dm-traffic-desc {
    margin: 0 !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    color: #94a3b8 !important;
}

.studio-ui .studio-dm-highlight-link {
    color: #38bdf8 !important;
    font-weight: 700 !important;
    text-decoration: underline !important;
    text-underline-offset: 2px !important;
    transition: color 0.14s ease !important;
}

.studio-ui .studio-dm-highlight-link:hover {
    color: #7dd3fc !important;
}

.studio-ui .studio-dm-traffic-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

.studio-ui .studio-dm-traffic-cta-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 6px 12px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
    color: #ffffff !important;
    font-size: 11.5px !important;
    font-weight: 850 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.28) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    transition: transform 0.14s ease, filter 0.14s ease, box-shadow 0.14s ease !important;
}

.studio-ui .studio-dm-traffic-cta-btn:hover {
    filter: brightness(1.08) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4) !important;
}

.studio-ui .studio-dm-traffic-cta-btn:active {
    transform: translateY(0) scale(0.98) !important;
}

.studio-ui .studio-dm-dismiss-btn {
    width: 22px !important;
    height: 22px !important;
    border-radius: 6px !important;
    background: rgba(148, 163, 184, 0.12) !important;
    border: none !important;
    color: #94a3b8 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    line-height: 1 !important;
    opacity: 0.65 !important;
    flex-shrink: 0 !important;
    transition: opacity 0.14s ease, background 0.14s ease, color 0.14s ease !important;
}

.studio-ui .studio-dm-dismiss-btn:hover {
    opacity: 1 !important;
    background: rgba(239, 68, 68, 0.2) !important;
    color: #f87171 !important;
}

@media (max-width: 640px) {
    .studio-ui .studio-dm-traffic-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 7px !important;
        padding: 9px 10px !important;
    }
    .studio-ui .studio-dm-traffic-right {
        width: 100% !important;
        justify-content: space-between !important;
    }
    .studio-ui .studio-dm-traffic-cta-btn {
        flex: 1 1 auto !important;
        padding: 7px 12px !important;
        font-size: 11.5px !important;
    }
    .studio-ui .studio-dm-traffic-desc {
        font-size: 10.5px !important;
    }
}

/* Legacy DownMax Smart URL Import Bar (Kept for compatibility) */
.studio-ui .studio-downmax-bar {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 9px 10px !important;
    border-radius: 14px !important;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.92) 0%, rgba(9, 13, 24, 0.96) 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.studio-ui .studio-downmax-input-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: rgba(4, 7, 17, 0.9) !important;
    border: 1.5px solid rgba(71, 85, 105, 0.65) !important;
    border-radius: 11px !important;
    padding: 4px 5px 4px 9px !important;
    transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}

.studio-ui .studio-downmax-input-row:focus-within {
    border-color: #f97316 !important;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.18) !important;
}

.studio-ui .studio-downmax-link-icon {
    font-size: 13px !important;
    opacity: 0.85 !important;
    flex-shrink: 0 !important;
}

.studio-ui .studio-downmax-input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    color: #f8fafc !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    padding: 4px 2px !important;
}

.studio-ui .studio-downmax-input::placeholder {
    color: #64748b !important;
    font-weight: 500 !important;
}

.studio-ui .studio-downmax-paste-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 6px 9px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #f59e0b 0%, #eab308 100%) !important;
    color: #0f172a !important;
    font-size: 11px !important;
    font-weight: 850 !important;
    border: none !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3) !important;
    transition: transform 0.14s ease, filter 0.14s ease !important;
}

.studio-ui .studio-downmax-paste-btn small {
    background: rgba(15, 23, 42, 0.18) !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
    font-size: 9px !important;
    font-weight: 900 !important;
}

.studio-ui .studio-downmax-paste-btn:hover {
    filter: brightness(1.07) !important;
}

.studio-ui .studio-downmax-paste-btn:active {
    transform: scale(0.96) !important;
}

.studio-ui .studio-downmax-submit-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 6px 11px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #fe2c55 0%, #ff5722 60%, #ff8a00 100%) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 850 !important;
    border: none !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    box-shadow: 0 3px 10px rgba(254, 44, 85, 0.35) !important;
    transition: transform 0.14s ease, filter 0.14s ease !important;
}

.studio-ui .studio-downmax-submit-btn:hover {
    filter: brightness(1.08) !important;
}

.studio-ui .studio-downmax-submit-btn:disabled {
    opacity: 0.65 !important;
    cursor: wait !important;
}

.studio-ui .studio-downmax-platforms-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    padding-bottom: 1px !important;
}

.studio-ui .studio-downmax-platforms-row::-webkit-scrollbar {
    display: none !important;
}

.studio-ui .studio-downmax-platforms-label {
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.studio-ui .studio-downmax-chips {
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.studio-ui .studio-dm-chip {
    display: inline-flex !important;
    align-items: center !important;
    padding: 2px 7px !important;
    border-radius: 999px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    background: rgba(30, 41, 59, 0.75) !important;
    border: 1px solid rgba(71, 85, 105, 0.5) !important;
    color: #cbd5e1 !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.studio-ui .studio-dm-chip.is-active {
    background: rgba(254, 44, 85, 0.22) !important;
    border-color: #fe2c55 !important;
    color: #fda4af !important;
    box-shadow: 0 0 10px rgba(254, 44, 85, 0.35) !important;
}

/* 1b. DownMax Scanning State Box (Matching DownMax Red Circular Glow Animation) */
.studio-ui .studio-dm-scan-box {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 16px 14px !important;
    border-radius: 12px !important;
    background: linear-gradient(180deg, rgba(20, 24, 39, 0.96) 0%, rgba(9, 13, 25, 0.98) 100%) !important;
    border: 1.5px solid rgba(254, 44, 85, 0.35) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 20px rgba(254, 44, 85, 0.12) !important;
    animation: studioDmFadeIn 0.2s ease-out !important;
    text-align: center !important;
}

.studio-ui .studio-dm-scan-box.hidden,
.studio-ui .studio-dm-media-card.hidden {
    display: none !important;
}

.studio-ui .studio-dm-spinner {
    width: 34px !important;
    height: 34px !important;
    border: 3px solid rgba(254, 44, 85, 0.18) !important;
    border-top-color: #fe2c55 !important;
    border-right-color: #ff5722 !important;
    border-radius: 50% !important;
    animation: studioDmSpin 0.75s linear infinite !important;
    margin-bottom: 9px !important;
    box-shadow: 0 0 14px rgba(254, 44, 85, 0.35) !important;
}

@keyframes studioDmSpin {
    to { transform: rotate(360deg); }
}

@keyframes studioDmFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.studio-ui .studio-dm-scan-title {
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #f8fafc !important;
    letter-spacing: -0.01em !important;
}

.studio-ui .studio-dm-scan-sub {
    font-size: 11px !important;
    font-weight: 500 !important;
    color: #94a3b8 !important;
    margin-top: 4px !important;
    line-height: 1.45 !important;
    max-width: 420px !important;
}

/* 1c. DownMax Scanned Media Preview Card (Preview, Title, Author & 2 Primary Action Buttons) */
.studio-ui .studio-dm-media-card {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 12px !important;
    border-radius: 13px !important;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(8, 12, 24, 0.98) 100%) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.38) !important;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    animation: studioDmFadeIn 0.22s ease-out !important;
}

.studio-ui .studio-dm-card-top {
    display: flex !important;
    align-items: flex-start !important;
    gap: 12px !important;
}

.studio-ui .studio-dm-thumb-wrap {
    position: relative !important;
    width: 116px !important;
    min-width: 116px !important;
    height: 76px !important;
    border-radius: 9px !important;
    overflow: hidden !important;
    background: #020617 !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    flex-shrink: 0 !important;
}

.studio-ui .studio-dm-thumb-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.studio-ui .studio-dm-platform-badge {
    position: absolute !important;
    top: 4px !important;
    left: 4px !important;
    padding: 1px 5px !important;
    border-radius: 5px !important;
    font-size: 8.5px !important;
    font-weight: 850 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 0.8px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    text-transform: uppercase !important;
    letter-spacing: 0.03em !important;
    backdrop-filter: blur(4px) !important;
    z-index: 2 !important;
}

.studio-ui .studio-dm-duration-badge {
    position: absolute !important;
    bottom: 4px !important;
    right: 4px !important;
    padding: 1px 5px !important;
    border-radius: 5px !important;
    font-size: 9px !important;
    font-weight: 800 !important;
    background: rgba(0, 0, 0, 0.85) !important;
    color: #38bdf8 !important;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
    z-index: 2 !important;
}

.studio-ui .studio-dm-preview-play-btn {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.7) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding-left: 2px !important;
    transition: transform 0.15s ease, background 0.15s ease !important;
    z-index: 3 !important;
}

.studio-ui .studio-dm-preview-play-btn:hover {
    transform: translate(-50%, -50%) scale(1.1) !important;
    background: rgba(254, 44, 85, 0.9) !important;
    border-color: #fe2c55 !important;
}

.studio-ui .studio-dm-inline-video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    z-index: 4 !important;
    background: #000 !important;
}

.studio-ui .studio-dm-info-wrap {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 3px !important;
}

.studio-ui .studio-dm-author-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.studio-ui .studio-dm-author-txt {
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.studio-ui .studio-dm-title-txt {
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #f1f5f9 !important;
    line-height: 1.35 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    word-break: break-word !important;
    cursor: pointer !important;
    transition: color 0.14s ease !important;
}

.studio-ui .studio-dm-title-txt:hover {
    color: #38bdf8 !important;
}

.studio-ui .studio-dm-meta-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 2px !important;
}

.studio-ui .studio-dm-copy-btn,
.studio-ui .studio-dm-close-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
    padding: 2px 7px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    background: rgba(30, 41, 59, 0.7) !important;
    border: 1px solid rgba(71, 85, 105, 0.5) !important;
    color: #cbd5e1 !important;
    cursor: pointer !important;
    transition: all 0.14s ease !important;
}

.studio-ui .studio-dm-copy-btn:hover {
    background: rgba(56, 189, 248, 0.18) !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}

.studio-ui .studio-dm-close-btn {
    margin-left: auto !important;
    color: #94a3b8 !important;
}

.studio-ui .studio-dm-close-btn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    border-color: #ef4444 !important;
    color: #f87171 !important;
}

/* Actions Row with Single Primary Action: [🎬 Tải & Thêm Vào Studio] */
.studio-ui .studio-dm-actions-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    margin-top: 6px !important;
    width: 100% !important;
}

.studio-ui .studio-dm-btn-add-studio {
    width: 100% !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    padding: 0 16px !important;
    border-radius: 10px !important;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%) !important;
    color: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 850 !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4) !important;
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease !important;
}
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4) !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    transition: transform 0.12s ease, filter 0.12s ease !important;
}

.studio-ui .studio-dm-btn-add-studio:hover {
    filter: brightness(1.1) !important;
    transform: translateY(-1px) !important;
}

.studio-ui .studio-dm-btn-add-studio:disabled {
    opacity: 0.65 !important;
    cursor: wait !important;
}

@media (max-width: 480px) {
    .studio-ui .studio-dm-card-top {
        gap: 9px !important;
    }
    .studio-ui .studio-dm-thumb-wrap {
        width: 96px !important;
        min-width: 96px !important;
        height: 64px !important;
    }
    .studio-ui .studio-dm-title-txt {
        font-size: 11px !important;
    }
    .studio-ui .studio-dm-actions-row {
        grid-template-columns: 1fr !important;
        gap: 7px !important;
        margin-top: 4px !important;
    }
    .studio-ui .studio-dm-btn-add-studio {
        width: 100% !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
        font-size: 13px !important;
    }
}

/* 2. Smart 16:9 -> 9:16 Vertical Reframe Banner & Stage */
.studio-ui .studio-reframe-banner {
    margin-top: 2px !important;
    padding: 5px 8px !important;
    border-radius: 9px !important;
    background: rgba(56, 189, 248, 0.12) !important;
    border: 1px dashed rgba(56, 189, 248, 0.45) !important;
}

.studio-ui .studio-reframe-toggle-label {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    cursor: pointer !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #bae6fd !important;
}

.studio-ui .studio-reframe-badge {
    padding: 1.5px 6px !important;
    border-radius: 5px !important;
    background: #0284c7 !important;
    color: #ffffff !important;
    font-size: 9.5px !important;
    font-weight: 850 !important;
    white-space: nowrap !important;
}

.studio-ui #videoStage.is-reframed-916 #videoFrameStage {
    aspect-ratio: 9 / 16 !important;
    height: 100% !important;
    width: auto !important;
    background: radial-gradient(circle at center, #1e293b 0%, #090d16 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.studio-ui #videoStage.is-reframed-916 #studioVideo {
    width: 100% !important;
    height: auto !important;
    max-height: 62% !important;
    object-fit: contain !important;
}

/* 3. Multi-Channel Presets Bar */
.studio-ui .studio-channel-presets-bar {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 8px 10px !important;
    margin-bottom: 10px !important;
    border-radius: 13px !important;
    background: rgba(15, 23, 42, 0.78) !important;
    border: 1px solid rgba(139, 92, 246, 0.28) !important;
}

.studio-ui .studio-channel-header-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.studio-ui .studio-channel-label-group {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.studio-ui .studio-channel-title {
    font-size: 11px !important;
    font-weight: 800 !important;
    color: #c4b5fd !important;
    white-space: nowrap !important;
}

.studio-ui .studio-channel-pills-list {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-wrap: wrap !important;
}

.studio-ui .studio-channel-pill-wrap {
    display: inline-flex !important;
    align-items: center !important;
    border-radius: 999px !important;
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(71, 85, 105, 0.65) !important;
    overflow: hidden !important;
}

.studio-ui .studio-channel-pill-wrap.is-active {
    border-color: #8b5cf6 !important;
    background: rgba(139, 92, 246, 0.22) !important;
}

.studio-ui .studio-channel-pill {
    padding: 3px 9px !important;
    border-radius: 999px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #cbd5e1 !important;
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(71, 85, 105, 0.65) !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.studio-ui .studio-channel-pill-wrap .studio-channel-pill {
    border: none !important;
    background: transparent !important;
    padding-right: 5px !important;
}

.studio-ui .studio-channel-pill.is-active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.32), rgba(56, 189, 248, 0.24)) !important;
    border-color: #a78bfa !important;
    color: #ffffff !important;
}

.studio-ui .studio-channel-del-btn {
    padding: 2px 6px 2px 3px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
}

.studio-ui .studio-channel-del-btn:hover {
    color: #fb7185 !important;
}

.studio-ui .studio-channel-add-btn {
    padding: 4px 9px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    background: rgba(56, 189, 248, 0.16) !important;
    border: 1px solid rgba(56, 189, 248, 0.4) !important;
    color: #7dd3fc !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.studio-ui .studio-channel-save-drawer {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding-top: 4px !important;
}

.studio-ui .studio-channel-save-drawer.hidden {
    display: none !important;
}

.studio-ui .studio-channel-name-input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 5px 9px !important;
    border-radius: 8px !important;
    background: rgba(4, 7, 17, 0.9) !important;
    border: 1px solid rgba(139, 92, 246, 0.5) !important;
    color: #ffffff !important;
    font-size: 11.5px !important;
    outline: none !important;
}

.studio-ui .studio-channel-confirm-btn {
    padding: 5px 10px !important;
    border-radius: 8px !important;
    background: #8b5cf6 !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    border: none !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.studio-ui .studio-channel-cancel-btn {
    padding: 5px 8px !important;
    border-radius: 8px !important;
    background: rgba(51, 65, 85, 0.7) !important;
    color: #cbd5e1 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    border: none !important;
    cursor: pointer !important;
}

/* 4. Color Band Live Hook Title & Input Row */
.studio-ui .studio-cband-hook-row {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    margin-top: 6px !important;
    width: 100% !important;
}

.studio-ui .studio-cband-hook-input {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    padding: 5px 9px !important;
    border-radius: 8px !important;
    background: rgba(9, 14, 26, 0.92) !important;
    border: 1px solid rgba(251, 191, 36, 0.4) !important;
    color: #fde047 !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    outline: none !important;
}

.studio-ui .studio-cband-hook-ai-btn {
    padding: 5px 9px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(234, 88, 12, 0.25)) !important;
    border: 1px solid rgba(251, 191, 36, 0.55) !important;
    color: #fde047 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.studio-ui .studio-cband-live-title {
    position: absolute !important;
    inset: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 2px 10px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    color: #fde047 !important;
    text-shadow: -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000 !important;
    pointer-events: none !important;
    z-index: 3 !important;
    overflow: hidden !important;
}

/* 5. AI Caption & Hashtag Card */
.studio-ui .studio-ai-caption-card {
    margin-top: 10px !important;
    padding: 10px 12px !important;
    border-radius: 14px !important;
    background: rgba(15, 23, 42, 0.82) !important;
    border: 1px solid rgba(56, 189, 248, 0.24) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

.studio-ui .studio-ai-caption-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.studio-ui .studio-ai-caption-title {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    color: #7dd3fc !important;
}

.studio-ui .studio-ai-caption-actions {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.studio-ui .studio-ai-cap-btn {
    padding: 4px 9px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    border: 1px solid transparent !important;
}

.studio-ui .studio-ai-cap-btn.is-gen {
    background: rgba(139, 92, 246, 0.2) !important;
    border-color: rgba(167, 139, 250, 0.45) !important;
    color: #ddd6fe !important;
}

.studio-ui .studio-ai-cap-btn.is-copy {
    background: rgba(16, 185, 129, 0.2) !important;
    border-color: rgba(52, 211, 153, 0.45) !important;
    color: #6ee7b7 !important;
}

.studio-ui .studio-ai-caption-textarea {
    width: 100% !important;
    padding: 6px 9px !important;
    border-radius: 9px !important;
    background: rgba(4, 7, 17, 0.85) !important;
    border: 1px solid rgba(51, 65, 85, 0.7) !important;
    color: #e2e8f0 !important;
    font-size: 11.5px !important;
    line-height: 1.45 !important;
    resize: vertical !important;
    outline: none !important;
}

/* 6. Smart Audio Bar (Auto-BGM & Auto-Ducking) */
.studio-ui .studio-smart-audio-bar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
    padding: 7px 10px !important;
    border-radius: 11px !important;
    background: rgba(56, 189, 248, 0.1) !important;
    border: 1px solid rgba(56, 189, 248, 0.28) !important;
}

.studio-ui .studio-auto-bgm-btn {
    padding: 5px 10px !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #0284c7, #6366f1) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    border: none !important;
    cursor: pointer !important;
}

.studio-ui .studio-autoduck-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #bae6fd !important;
    cursor: pointer !important;
}

/* 7. Subtitle Row AI Quick-Edit Pills */
.studio-ui .studio-seg-ai-tools {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-shrink: 0 !important;
}

.studio-ui .studio-seg-ai-btn {
    padding: 3px 6px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    border: 1px solid rgba(71, 85, 105, 0.6) !important;
    background: rgba(30, 41, 59, 0.85) !important;
    color: #cbd5e1 !important;
}

.studio-ui .studio-seg-ai-btn.is-hook {
    background: rgba(249, 115, 22, 0.18) !important;
    border-color: rgba(251, 146, 60, 0.5) !important;
    color: #fdba74 !important;
}

.studio-ui .studio-seg-ai-btn.is-shorten.is-dense-warn {
    background: rgba(245, 158, 11, 0.22) !important;
    border-color: #fbbf24 !important;
    color: #fde047 !important;
}

/* Light Mode Support for All Smart Upgrades */
html[data-theme="light"] .studio-ui .studio-dm-traffic-card {
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 100%) !important;
    border-color: #bae6fd !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] .studio-ui .studio-dm-traffic-icon-box {
    background: rgba(2, 132, 199, 0.08) !important;
    color: #0284c7 !important;
    border-color: rgba(2, 132, 199, 0.22) !important;
}

html[data-theme="light"] .studio-ui .studio-dm-traffic-title {
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui .studio-dm-traffic-tag {
    background: rgba(249, 115, 22, 0.12) !important;
    color: #c2410c !important;
    border-color: rgba(249, 115, 22, 0.28) !important;
}

html[data-theme="light"] .studio-ui .studio-dm-traffic-desc {
    color: #475569 !important;
}

html[data-theme="light"] .studio-ui .studio-dm-highlight-link {
    color: #0284c7 !important;
}

html[data-theme="light"] .studio-ui .studio-dm-dismiss-btn {
    background: rgba(148, 163, 184, 0.16) !important;
    color: #64748b !important;
}

html[data-theme="light"] .studio-ui .studio-downmax-bar,
html[data-theme="light"] .studio-ui .studio-channel-presets-bar,
html[data-theme="light"] .studio-ui .studio-ai-caption-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .studio-ui .studio-downmax-input-row,
html[data-theme="light"] .studio-ui .studio-ai-caption-textarea,
html[data-theme="light"] .studio-ui .studio-channel-name-input,
html[data-theme="light"] .studio-ui .studio-cband-hook-input {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui .studio-downmax-input {
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui .studio-dm-chip,
html[data-theme="light"] .studio-ui .studio-channel-pill {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

html[data-theme="light"] .studio-ui .studio-channel-title,
html[data-theme="light"] .studio-ui .studio-ai-caption-title,
html[data-theme="light"] .studio-ui .studio-autoduck-label {
    color: #1e293b !important;
}

/* =========================================================================
   8. AI THUMBNAIL & COVER GENERATOR STUDIO (#studioAiThumbnailCard)
   ========================================================================= */
.studio-ui .studio-thumb-intro-toggle-wrap {
    margin-top: 12px !important;
    margin-bottom: 12px !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(24, 20, 50, 0.88)) !important;
    border: 1.5px solid rgba(251, 191, 36, 0.4) !important;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.5) !important;
    overflow: hidden !important;
    transition: all 0.25s ease !important;
}

.studio-ui .studio-thumb-intro-toggle-wrap.is-expanded {
    border-color: rgba(251, 191, 36, 0.75) !important;
    box-shadow: 0 8px 30px rgba(245, 158, 11, 0.22) !important;
}

.studio-ui .studio-thumb-intro-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 11px 14px !important;
    user-select: none !important;
    flex-wrap: wrap !important;
    background: rgba(15, 23, 42, 0.65) !important;
    cursor: pointer !important;
}

.studio-ui .studio-thumb-intro-label {
    display: inline-flex !important;
    align-items: center !important;
    gap: 11px !important;
    cursor: pointer !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    margin: 0 !important;
}

.studio-ui .studio-thumb-intro-checkbox {
    width: 20px !important;
    height: 20px !important;
    accent-color: #f59e0b !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

.studio-ui .studio-thumb-intro-texts {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    min-width: 0 !important;
}

.studio-ui .studio-thumb-intro-title-line {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.studio-ui .studio-thumb-intro-title {
    font-size: 13px !important;
    font-weight: 800 !important;
    color: #fef08a !important;
    letter-spacing: -0.2px !important;
}

.studio-ui .studio-thumb-intro-pill {
    padding: 2px 7px !important;
    border-radius: 999px !important;
    background: rgba(245, 158, 11, 0.2) !important;
    border: 1px solid rgba(251, 191, 36, 0.5) !important;
    color: #fde047 !important;
    font-size: 10px !important;
    font-weight: 800 !important;
}

.studio-ui .studio-thumb-intro-sub {
    font-size: 11px !important;
    color: #94a3b8 !important;
    line-height: 1.3 !important;
}

.studio-ui .studio-thumb-dur-control {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: rgba(9, 13, 24, 0.88) !important;
    padding: 3px 8px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(251, 191, 36, 0.45) !important;
}

.studio-ui .studio-thumb-dur-label {
    font-size: 11px !important;
    color: #cbd5e1 !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

.studio-ui .studio-thumb-dur-select {
    background: #0f172a !important;
    color: #fde047 !important;
    border: 1px solid rgba(251, 191, 36, 0.35) !important;
    border-radius: 6px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    padding: 3px 6px !important;
    outline: none !important;
    cursor: pointer !important;
}

.studio-ui .studio-thumb-intro-drawer {
    padding: 0 12px 12px 12px !important;
    border-top: 1px solid rgba(251, 191, 36, 0.25) !important;
    background: rgba(10, 15, 30, 0.55) !important;
}

.studio-ui .studio-thumb-intro-drawer.hidden {
    display: none !important;
}

.studio-ui .studio-thumb-intro-drawer .studio-ai-thumb-card {
    margin-top: 10px !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.studio-ui .studio-ai-thumb-card {
    margin-top: 10px !important;
    padding: 12px 13px !important;
    border-radius: 14px !important;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(30, 27, 75, 0.55)) !important;
    border: 1px solid rgba(251, 191, 36, 0.34) !important;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.38) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.studio-ui .studio-ai-thumb-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.studio-ui .studio-ai-thumb-title {
    display: inline-flex !important;
    align-items: center !important;
    gap: 7px !important;
    flex-wrap: wrap !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #fde047 !important;
}

.studio-ui .studio-ai-thumb-free-pill {
    padding: 2px 7px !important;
    border-radius: 999px !important;
    background: rgba(16, 185, 129, 0.2) !important;
    border: 1px solid rgba(52, 211, 153, 0.45) !important;
    color: #6ee7b7 !important;
    font-size: 10px !important;
    font-weight: 800 !important;
}

.studio-ui .studio-ai-thumb-aspect-tabs {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    background: rgba(9, 13, 24, 0.85) !important;
    padding: 3px !important;
    border-radius: 9px !important;
    border: 1px solid rgba(71, 85, 105, 0.55) !important;
}

.studio-ui .studio-thumb-aspect-btn {
    padding: 4px 9px !important;
    border-radius: 7px !important;
    font-size: 10.5px !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.studio-ui .studio-thumb-aspect-btn.is-active {
    background: linear-gradient(135deg, #f59e0b, #ea580c) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35) !important;
}

.studio-ui .studio-ai-thumb-body {
    display: grid !important;
    grid-template-columns: minmax(125px, 162px) 1fr !important;
    gap: 12px !important;
    align-items: start !important;
}

@media (max-width: 640px) {
    .studio-ui .studio-ai-thumb-body {
        grid-template-columns: 118px 1fr !important;
        gap: 9px !important;
    }
}

.studio-ui .studio-ai-thumb-stage-wrap {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

.studio-ui .studio-ai-thumb-canvas-box {
    position: relative !important;
    width: 100% !important;
    border-radius: 10px !important;
    overflow: hidden !important;
    border: 1.5px solid rgba(251, 191, 36, 0.55) !important;
    background: #050811 !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55) !important;
    cursor: ns-resize !important;
    touch-action: none !important;
}

.studio-ui .studio-ai-thumb-canvas-box.is-portrait {
    aspect-ratio: 9 / 16 !important;
    max-height: 255px !important;
}

.studio-ui .studio-ai-thumb-canvas-box.is-landscape {
    aspect-ratio: 16 / 9 !important;
}

.studio-ui #studioThumbCanvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: contain !important;
}

.studio-ui .studio-thumb-drag-hint {
    position: absolute !important;
    bottom: 4px !important;
    left: 4px !important;
    right: 4px !important;
    text-align: center !important;
    font-size: 9px !important;
    font-weight: 700 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    background: rgba(2, 6, 23, 0.72) !important;
    padding: 2px 4px !important;
    border-radius: 5px !important;
    pointer-events: none !important;
}

.studio-ui .studio-ai-thumb-controls {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    min-width: 0 !important;
}

.studio-ui .studio-thumb-action-grid {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

.studio-ui .studio-thumb-act-btn {
    padding: 6px 10px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    border: 1px solid rgba(148, 163, 184, 0.35) !important;
    background: rgba(15, 23, 42, 0.9) !important;
    color: #e2e8f0 !important;
    transition: transform 0.12s ease, filter 0.12s ease !important;
}

.studio-ui .studio-thumb-act-btn.is-primary {
    flex: 1 1 100% !important;
    background: linear-gradient(135deg, #f59e0b, #dc2626) !important;
    border-color: rgba(253, 224, 71, 0.65) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.28) !important;
}

.studio-ui .studio-thumb-act-btn.is-frame {
    flex: 1 1 46% !important;
    background: rgba(14, 165, 233, 0.18) !important;
    border-color: rgba(56, 189, 248, 0.45) !important;
    color: #7dd3fc !important;
}

.studio-ui .studio-thumb-act-btn.is-aiart {
    flex: 1 1 46% !important;
    background: rgba(139, 92, 246, 0.22) !important;
    border-color: rgba(167, 139, 250, 0.5) !important;
    color: #ddd6fe !important;
}

.studio-ui .studio-thumb-theme-row {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-wrap: wrap !important;
}

.studio-ui .studio-thumb-theme-chip {
    padding: 3px 8px !important;
    border-radius: 999px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(71, 85, 105, 0.55) !important;
    color: #cbd5e1 !important;
    cursor: pointer !important;
}

.studio-ui .studio-thumb-theme-chip.is-active {
    background: rgba(251, 191, 36, 0.22) !important;
    border-color: #fde047 !important;
    color: #fde047 !important;
}

.studio-ui .studio-thumb-inputs-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
}

.studio-ui .studio-thumb-field {
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

.studio-ui .studio-thumb-field label {
    font-size: 10px !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
}

.studio-ui .studio-thumb-field input[type="text"] {
    width: 100% !important;
    padding: 5px 8px !important;
    border-radius: 7px !important;
    background: rgba(4, 7, 17, 0.9) !important;
    border: 1px solid rgba(71, 85, 105, 0.65) !important;
    color: #f8fafc !important;
    font-size: 11.5px !important;
    font-weight: 800 !important;
    outline: none !important;
}

.studio-ui .studio-thumb-field.is-badge-row {
    flex-direction: row !important;
    align-items: flex-end !important;
    justify-content: space-between !important;
    gap: 8px !important;
}

.studio-ui .studio-thumb-field.is-badge-row > div {
    flex: 1 1 auto !important;
}

.studio-ui .studio-thumb-logo-chk {
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    padding-bottom: 5px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    color: #cbd5e1 !important;
    cursor: pointer !important;
    white-space: nowrap !important;
}

.studio-ui .studio-thumb-download-btn {
    width: 100% !important;
    padding: 7px 12px !important;
    border-radius: 9px !important;
    background: linear-gradient(135deg, #10b981, #059669) !important;
    border: 1px solid rgba(110, 231, 183, 0.5) !important;
    color: #ffffff !important;
    font-size: 11.5px !important;
    font-weight: 900 !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25) !important;
}

/* Stage Toolbar (Nổi bật 3D & Vùng An Toàn HUD) */
.studio-ui .studio-thumb-stage-toolbar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    margin-bottom: 6px !important;
    width: 100% !important;
}

.studio-ui .studio-thumb-stage-tool {
    padding: 3px 8px !important;
    border-radius: 999px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(71, 85, 105, 0.55) !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
    user-select: none !important;
}

.studio-ui .studio-thumb-stage-tool.is-active {
    background: rgba(56, 189, 248, 0.2) !important;
    border-color: #38bdf8 !important;
    color: #7dd3fc !important;
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.3) !important;
}

/* Style Context Bar inside Thumbnail AI Card */
.studio-ui .studio-thumb-style-context {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    padding: 5px 10px !important;
    border-radius: 8px !important;
    background: linear-gradient(90deg, rgba(14, 165, 233, 0.14) 0%, rgba(139, 92, 246, 0.14) 100%) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    font-size: 10.5px !important;
    line-height: 1.35 !important;
}

.studio-ui .studio-thumb-style-ctx-label {
    font-weight: 700 !important;
    color: #94a3b8 !important;
    white-space: nowrap !important;
}

.studio-ui .studio-thumb-style-ctx-val {
    font-weight: 800 !important;
    color: #38bdf8 !important;
    word-break: break-word !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-style-context {
    background: linear-gradient(90deg, rgba(2, 132, 199, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%) !important;
    border-color: rgba(2, 132, 199, 0.3) !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-style-ctx-label {
    color: #475569 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-style-ctx-val {
    color: #0369a1 !important;
}

/* Feature 1: Golden Keyframes Carousel */
.studio-ui .studio-thumb-frames-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
}

.studio-ui .studio-thumb-section-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
}

.studio-ui .studio-thumb-sec-title {
    font-size: 10.5px !important;
    font-weight: 800 !important;
    color: #cbd5e1 !important;
}

.studio-ui .studio-thumb-rescan-btn {
    background: transparent !important;
    border: none !important;
    color: #38bdf8 !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    padding: 1px 4px !important;
    text-decoration: underline !important;
}

.studio-ui .studio-thumb-frames-strip {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    overflow-x: auto !important;
    padding: 3px 2px 6px 2px !important;
    scrollbar-width: thin !important;
}

.studio-ui .studio-thumb-frames-strip::-webkit-scrollbar {
    height: 4px !important;
}

.studio-ui .studio-thumb-frames-strip::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.3) !important;
    border-radius: 4px !important;
}

.studio-ui .studio-thumb-frames-empty,
.studio-ui .studio-thumb-frames-loading {
    font-size: 10.5px !important;
    color: #64748b !important;
    padding: 6px 4px !important;
    font-style: italic !important;
}

.studio-ui .studio-thumb-frame-item {
    position: relative !important;
    border-radius: 7px !important;
    overflow: hidden !important;
    border: 2px solid transparent !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    background: #000000 !important;
    padding: 0 !important;
    line-height: 0 !important;
    transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease !important;
}

.studio-ui .studio-thumb-frame-item:hover {
    transform: translateY(-2px) !important;
}

.studio-ui .studio-thumb-frame-item.is-active {
    border-color: #38bdf8 !important;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.5) !important;
}

.studio-ui .studio-thumb-frame-thumb {
    display: block !important;
    height: 52px !important;
    object-fit: cover !important;
}

.studio-ui .studio-thumb-frame-thumb.is-portrait {
    width: 32px !important;
}

.studio-ui .studio-thumb-frame-thumb.is-landscape {
    width: 72px !important;
}

.studio-ui .studio-thumb-frame-badge {
    position: absolute !important;
    bottom: 2px !important;
    left: 2px !important;
    right: 2px !important;
    font-size: 8.5px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    background: rgba(0, 0, 0, 0.75) !important;
    border-radius: 3px !important;
    text-align: center !important;
    line-height: 1.2 !important;
    padding: 1px 0 !important;
}

.studio-ui .studio-thumb-frame-check {
    position: absolute !important;
    top: 2px !important;
    right: 2px !important;
    width: 14px !important;
    height: 14px !important;
    border-radius: 50% !important;
    background: #0284c7 !important;
    color: #ffffff !important;
    font-size: 9px !important;
    font-weight: 900 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

/* Feature 2: A/B Test Variations */
.studio-ui .studio-thumb-variations-section {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.studio-ui .studio-thumb-variations-bar {
    display: flex !important;
    flex-direction: column !important;
    gap: 4px !important;
}

.studio-ui .studio-thumb-var-chip {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 4px 8px !important;
    border-radius: 7px !important;
    background: rgba(15, 23, 42, 0.8) !important;
    border: 1px solid rgba(71, 85, 105, 0.45) !important;
    color: #cbd5e1 !important;
    cursor: pointer !important;
    text-align: left !important;
    transition: all 0.12s ease !important;
}

.studio-ui .studio-thumb-var-chip:hover {
    background: rgba(30, 41, 59, 0.9) !important;
    border-color: rgba(148, 163, 184, 0.6) !important;
}

.studio-ui .studio-thumb-var-chip.is-active {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: #f59e0b !important;
    color: #fef08a !important;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.25) !important;
}

.studio-ui .studio-thumb-var-icon {
    font-size: 10px !important;
    font-weight: 800 !important;
    flex-shrink: 0 !important;
}

.studio-ui .studio-thumb-var-text {
    font-size: 10.5px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Feature 3: Attention Stickers */
.studio-ui .studio-thumb-stickers-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
    padding-top: 2px !important;
}

.studio-ui .studio-thumb-stickers-label {
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
}

.studio-ui .studio-thumb-stickers-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
}

.studio-ui .studio-thumb-sticker-btn {
    padding: 3px 8px !important;
    border-radius: 999px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    color: #94a3b8 !important;
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(71, 85, 105, 0.5) !important;
    cursor: pointer !important;
    transition: all 0.14s ease !important;
}

.studio-ui .studio-thumb-sticker-btn.is-active {
    background: rgba(239, 68, 68, 0.22) !important;
    border-color: #ef4444 !important;
    color: #fca5a5 !important;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.3) !important;
}

/* Sticker Interactive Panel (Di chuyển & Đổi hướng) */
.studio-ui .studio-thumb-sticker-panel {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px !important;
    padding: 7px 9px !important;
    border-radius: 9px !important;
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 4px 14px rgba(2, 6, 23, 0.4) !important;
    margin-top: 4px !important;
}

.studio-ui .studio-thumb-stk-panel-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
}

.studio-ui .studio-thumb-stk-panel-title {
    font-size: 11px !important;
    color: #e2e8f0 !important;
}

.studio-ui .studio-thumb-stk-panel-title b {
    color: #38bdf8 !important;
}

.studio-ui .studio-thumb-stk-hint-inline {
    font-size: 9.5px !important;
    color: #94a3b8 !important;
    font-style: italic !important;
}

.studio-ui .studio-thumb-stk-panel-row {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
}

.studio-ui .studio-thumb-stk-pos-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 3px !important;
}

.studio-ui .studio-thumb-stk-sublabel {
    font-size: 9.5px !important;
    font-weight: 700 !important;
    color: #94a3b8 !important;
    margin-right: 2px !important;
}

.studio-ui .studio-thumb-stk-pos-btn {
    width: 24px !important;
    height: 24px !important;
    border-radius: 6px !important;
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(71, 85, 105, 0.6) !important;
    color: #cbd5e1 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    padding: 0 !important;
    transition: all 0.12s ease !important;
}

.studio-ui .studio-thumb-stk-pos-btn:hover {
    background: rgba(56, 189, 248, 0.25) !important;
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}

.studio-ui .studio-thumb-stk-dyn-group {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    flex-wrap: wrap !important;
}

.studio-ui .studio-thumb-stk-tool-btn {
    padding: 3px 8px !important;
    border-radius: 6px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(71, 85, 105, 0.6) !important;
    color: #e2e8f0 !important;
    cursor: pointer !important;
    transition: all 0.12s ease !important;
}

.studio-ui .studio-thumb-stk-tool-btn:hover {
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}

.studio-ui .studio-thumb-stk-tool-btn.is-delete {
    color: #f87171 !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.studio-ui .studio-thumb-stk-tool-btn.is-delete:hover {
    background: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-intro-toggle-wrap {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-intro-toggle-wrap.is-expanded {
    border-color: #f59e0b !important;
    box-shadow: 0 6px 24px rgba(245, 158, 11, 0.16) !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-intro-header {
    background: #f8fafc !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-intro-title {
    color: #0f172a !important;
    font-weight: 850 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-intro-pill {
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    color: #1d4ed8 !important;
    font-weight: 850 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-intro-sub {
    color: #334155 !important;
    font-weight: 500 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-dur-control {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-dur-label {
    color: #0f172a !important;
    font-weight: 700 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-dur-select {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1.5px solid #94a3b8 !important;
    font-weight: 800 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-intro-drawer {
    background: #ffffff !important;
    border-top: 1px solid #e2e8f0 !important;
}

html[data-theme="light"] .studio-ui .studio-ai-thumb-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
}

html[data-theme="light"] .studio-ui .studio-ai-thumb-title {
    color: #0f172a !important;
    font-weight: 850 !important;
}

html[data-theme="light"] .studio-ui .studio-ai-thumb-free-pill {
    background: #ecfdf5 !important;
    border: 1px solid #a7f3d0 !important;
    color: #065f46 !important;
    font-weight: 850 !important;
}

html[data-theme="light"] .studio-ui .studio-ai-thumb-aspect-tabs {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-aspect-btn {
    color: #475569 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-aspect-btn.is-active {
    background: #0f172a !important;
    color: #ffffff !important;
    font-weight: 850 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-act-btn.is-frame {
    background: #f0f9ff !important;
    border: 1.5px solid #0284c7 !important;
    color: #0369a1 !important;
    font-weight: 800 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-act-btn.is-aiart {
    background: #faf5ff !important;
    border: 1.5px solid #9333ea !important;
    color: #7e22ce !important;
    font-weight: 800 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-theme-chip {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0f172a !important;
    font-weight: 700 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-theme-chip.is-active {
    background: #fef3c7 !important;
    border-color: #d97706 !important;
    color: #78350f !important;
    font-weight: 850 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-field label {
    color: #0f172a !important;
    font-weight: 750 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-field input[type="text"] {
    background: #ffffff !important;
    border: 1.5px solid #94a3b8 !important;
    color: #0f172a !important;
    font-weight: 750 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-field input[type="text"]:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-stage-tool {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-stage-tool.is-active {
    background: #e0f2fe !important;
    border-color: #0284c7 !important;
    color: #0369a1 !important;
    font-weight: 850 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-sec-title {
    color: #334155 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-var-chip {
    background: #f8fafc !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-var-chip:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-var-chip.is-active {
    background: #fffbeb !important;
    border-color: #d97706 !important;
    color: #b45309 !important;
    font-weight: 800 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-sticker-btn {
    background: #f1f5f9 !important;
    border: 1px solid #cbd5e1 !important;
    color: #475569 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-sticker-btn.is-active {
    background: #fef2f2 !important;
    border-color: #dc2626 !important;
    color: #b91c1c !important;
    font-weight: 850 !important;
}

html[data-theme="light"] .studio-ui .studio-ai-cap-btn.is-gen {
    background: #ede9fe !important;
    border-color: #8b5cf6 !important;
    color: #5b21b6 !important;
}

html[data-theme="light"] .studio-ui .studio-ai-cap-btn.is-copy {
    background: #d1fae5 !important;
    border-color: #10b981 !important;
    color: #065f46 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-act-btn.is-frame {
    background: #e0f2fe !important;
    border-color: #0284c7 !important;
    color: #0369a1 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-act-btn.is-aiart {
    background: #f3e8ff !important;
    border-color: #9333ea !important;
    color: #6b21a8 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-sticker-panel {
    background: #f8fafc !important;
    border-color: #93c5fd !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-stk-panel-title {
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-stk-panel-title b {
    color: #0284c7 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-stk-pos-btn {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-stk-pos-btn:hover {
    background: #e0f2fe !important;
    border-color: #0284c7 !important;
    color: #0369a1 !important;
}

html[data-theme="light"] .studio-ui .studio-thumb-stk-tool-btn {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #1e293b !important;
}

/* =========================================================================
   9. CHẾ ĐỘ PHÁT VIDEO KẾT QUẢ TRÊN MÀN HÌNH PREVIEW:
      - Ẩn tuyệt đối 100% các lớp phủ thiết kế (#editingOverlaysContainer)
      - Đổi nút Play/Pause (#btnPlayerPlayPause) sang màu XANH LÁ CÂY đồng bộ
        với nút "▶️ Xem ngay" để user nhận biết ngay đang phát video kết quả!
   ========================================================================= */
.studio-ui #editingOverlaysContainer.hidden,
.studio-ui #studioPreviewCard.is-playing-output-video #editingOverlaysContainer,
.studio-ui #videoStage.is-playing-output-video #editingOverlaysContainer,
.studio-ui #studioPreviewCard.is-playing-output-video #stageActiveDragHud {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.studio-ui #studioPreviewCard.is-playing-output-video #btnPlayerPlayPause,
.studio-ui #btnPlayerPlayPause.is-output-ready-green,
html[data-theme="light"] .studio-ui #studioPreviewCard.is-playing-output-video #btnPlayerPlayPause,
html[data-theme="light"] .studio-ui #studioPreviewCard #btnPlayerPlayPause.is-output-ready-green,
html[data-theme="light"] .studio-ui #btnPlayerPlayPause.is-output-ready-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    border: 1px solid #059669 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
    box-shadow: 0 3px 12px rgba(16, 185, 129, 0.42) !important;
}

.studio-ui #studioPreviewCard.is-playing-output-video #btnPlayerPlayPause:hover,
.studio-ui #btnPlayerPlayPause.is-output-ready-green:hover,
html[data-theme="light"] .studio-ui #studioPreviewCard.is-playing-output-video #btnPlayerPlayPause:hover,
html[data-theme="light"] .studio-ui #studioPreviewCard #btnPlayerPlayPause.is-output-ready-green:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
    box-shadow: 0 5px 16px rgba(16, 185, 129, 0.52) !important;
}

.studio-ui #studioPreviewCard.is-playing-output-video #btnPlayerPlayPause *,
.studio-ui #btnPlayerPlayPause.is-output-ready-green *,
html[data-theme="light"] .studio-ui #studioPreviewCard.is-playing-output-video #btnPlayerPlayPause *,
html[data-theme="light"] .studio-ui #btnPlayerPlayPause.is-output-ready-green * {
    color: #ffffff !important;
}

.studio-ui #studioPreviewCard.is-playing-output-video #btnPlayerPlayPause svg[data-studio-icon],
.studio-ui #btnPlayerPlayPause.is-output-ready-green svg[data-studio-icon],
html[data-theme="light"] .studio-ui #studioPreviewCard.is-playing-output-video #btnPlayerPlayPause svg[data-studio-icon],
html[data-theme="light"] .studio-ui #btnPlayerPlayPause.is-output-ready-green svg[data-studio-icon] {
    stroke: #ffffff !important;
}

/* =========================================================================
   10. BỎ THU GỌN 3 TAB CÀI ĐẶT + VIỀN KHUNG SÁNG CÙNG MÀU NÚT TAB +
       KHẮC PHỤC TRIỆT ĐỂ THANH TRƯỢT & TEXT TRÀN KHỎI Ô (#colorBandControlsBox)
   ========================================================================= */

/* 10.1. Bỏ nút "▲ Thu gọn / ▼ Mở chi tiết" và luôn hiển thị nội dung Tab đang chọn */
.studio-ui #studioDetailSettings > div:first-child:has(#btnToggleMobileSettings),
.studio-ui #btnToggleMobileSettings {
    display: none !important;
}

.studio-ui #studioDetailSettings #mobileSettingsDrawerBody {
    display: block !important;
}

/* 10.2. Khung bao toàn bộ thiết lập của từng Tab sáng lên cùng màu với nút Tab đó */
.studio-ui #studioDetailSettings #settingsPane_bgm,
.studio-ui #studioDetailSettings #settingsPane_subtitles,
.studio-ui #studioDetailSettings #settingsPane_watermark {
    padding: 12px !important;
    margin-top: 8px !important;
    border-radius: 14px !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow: hidden !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease !important;
}

/* Dark Mode:
   - Tab 1 (Nhạc nền): Xanh Ngọc Lục Bảo (#34d399)
   - Tab 2 (Phụ đề): Xanh Dương Sáng (#38bdf8)
   - Tab 3 (Logo & Chữ): Cam Hổ Phách (#fb923c) */
.studio-ui #studioDetailSettings #settingsPane_bgm {
    background: rgba(8, 20, 32, 0.82) !important;
    border: 1.5px solid #34d399 !important;
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.34), inset 0 0 14px rgba(16, 185, 129, 0.08) !important;
}

.studio-ui #studioDetailSettings #settingsPane_subtitles {
    background: rgba(8, 18, 34, 0.82) !important;
    border: 1.5px solid #38bdf8 !important;
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.36), inset 0 0 14px rgba(56, 189, 248, 0.08) !important;
}

.studio-ui #studioDetailSettings #settingsPane_watermark {
    background: rgba(18, 15, 28, 0.82) !important;
    border: 1.5px solid #fb923c !important;
    box-shadow: 0 0 18px rgba(249, 115, 22, 0.35), inset 0 0 14px rgba(249, 115, 22, 0.08) !important;
}

/* Light Mode: Khung viền sáng sắc nét đồng bộ màu 3 nút Tab */
html[data-theme="light"] .studio-ui #studioDetailSettings #settingsPane_bgm {
    background: rgba(236, 253, 245, 0.55) !important;
    border: 1.5px solid #10b981 !important;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2), 0 0 0 1px rgba(16, 185, 129, 0.14) !important;
}

html[data-theme="light"] .studio-ui #studioDetailSettings #settingsPane_subtitles {
    background: rgba(240, 249, 255, 0.55) !important;
    border: 1.5px solid #0ea5e9 !important;
    box-shadow: 0 4px 16px rgba(14, 165, 233, 0.2), 0 0 0 1px rgba(14, 165, 233, 0.14) !important;
}

html[data-theme="light"] .studio-ui #studioDetailSettings #settingsPane_watermark {
    background: rgba(255, 247, 237, 0.6) !important;
    border: 1.5px solid #f97316 !important;
    box-shadow: 0 4px 16px rgba(249, 115, 22, 0.2), 0 0 0 1px rgba(249, 115, 22, 0.14) !important;
}

/* 10.3. Khắc phục triệt để thanh trượt, ô chọn màu và chữ tràn ra ngoài ô (#colorBandControlsBox & các ô con) */
.studio-ui #studioDetailSettings #colorBandControlsBox {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 10px !important;
}

.studio-ui #studioDetailSettings #colorBandControlsBox > * {
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.studio-ui #studioDetailSettings #colorBandControlsBox > div:first-child {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
}

.studio-ui #studioDetailSettings #colorBandControlsBox input[type="range"] {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 4px 0 0 !important;
    box-sizing: border-box !important;
}

.studio-ui #studioDetailSettings #colorBandControlsBox .studio-cband-hook-row,
.studio-ui #studioDetailSettings #colorBandControlsBox #colorBandMobileHintBar {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
}

.studio-ui #studioDetailSettings #colorBandControlsBox .studio-cband-hook-row {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 6px !important;
}

.studio-ui #studioDetailSettings #colorBandControlsBox #colorBandTitleInput {
    flex: 1 1 160px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.studio-ui #studioDetailSettings #colorBandControlsBox #btnAiGenerateBandHook {
    flex: 0 0 auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.studio-ui #studioDetailSettings #colorBandControlsBox #colorBandMobileHintBar span {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    line-height: 1.45 !important;
}

@media (max-width: 640px) {
    .studio-ui #studioDetailSettings #colorBandControlsBox {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 8px !important;
    }
    .studio-ui #studioDetailSettings #colorBandControlsBox > * {
        grid-column: 1 / -1 !important;
        width: 100% !important;
    }
    .studio-ui #studioDetailSettings #colorBandControlsBox #btnAiGenerateBandHook {
        width: 100% !important;
        justify-content: center !important;
    }
    .studio-ui #studioDetailSettings #colorBandControlsBox #colorBandMobileHintBar button {
        width: 100% !important;
        text-align: center !important;
    }
}

/* =========================================================================
   FRIENDLY SHORTAGE & 2-STEP COMPACT TOP-UP MODAL (#topupModal)
   Fits 100% inside 1 mobile/desktop viewport without vertical overflow
   ========================================================================= */
.studio-ui #topupModal {
    padding: 10px !important;
    overflow: hidden !important;
    overscroll-behavior: contain !important;
    align-items: center !important;
    justify-content: center !important;
}

.studio-ui #topupModal .glass-card.studio-topup-modal-card {
    margin: 0 !important;
    max-width: 520px !important;
    width: 100% !important;
    max-height: calc(100dvh - 20px) !important;
    padding: 14px 15px !important;
    border-radius: 20px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    overscroll-behavior: contain !important;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(9, 14, 28, 0.99)) !important;
    border: 1.5px solid rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 24px 64px rgba(2, 6, 23, 0.85), 0 0 28px rgba(14, 165, 233, 0.16) !important;
}

.studio-ui #topupModal .studio-topup-header {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid rgba(51, 65, 85, 0.65) !important;
    flex-shrink: 0 !important;
}

.studio-ui #topupModal .studio-topup-title-wrap {
    min-width: 0 !important;
    flex: 1 1 auto !important;
}

.studio-ui #topupModal .studio-topup-header h3 {
    font-size: 15px !important;
    line-height: 1.3 !important;
    font-weight: 800 !important;
    color: #f8fafc !important;
    margin: 0 0 3px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

.studio-ui #topupModal .studio-topup-header p {
    font-size: 11.5px !important;
    line-height: 1.35 !important;
    color: #94a3b8 !important;
    margin: 0 !important;
}

.studio-ui #topupModal .studio-topup-header-right {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

.studio-ui #topupModal .studio-topup-wallet-chip {
    padding: 4px 9px !important;
    border-radius: 999px !important;
    background: rgba(245, 158, 11, 0.14) !important;
    border: 1px solid rgba(251, 191, 36, 0.4) !important;
    color: #fde68a !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
}

.studio-ui #topupModal button[onclick="closeTopupModal()"] {
    position: static !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 9px !important;
    background: rgba(30, 41, 59, 0.85) !important;
    border: 1px solid rgba(100, 116, 139, 0.35) !important;
    color: #cbd5e1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: all 0.15s ease !important;
}

.studio-ui #topupModal button[onclick="closeTopupModal()"]:hover {
    background: rgba(244, 63, 94, 0.2) !important;
    border-color: #fb7185 !important;
    color: #fda4af !important;
}

.studio-ui #topupModal .studio-topup-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    padding-top: 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

/* Friendly Shortage Banner */
.studio-ui #topupModal .studio-shortage-banner {
    padding: 10px 12px !important;
    border-radius: 14px !important;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(14, 165, 233, 0.1)) !important;
    border: 1px solid rgba(251, 191, 36, 0.45) !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
}

.studio-ui #topupModal .studio-shortage-head {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #fef3c7 !important;
    line-height: 1.35 !important;
}

.studio-ui #topupModal .studio-shortage-metrics {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
}

.studio-ui #topupModal .studio-shortage-metric {
    padding: 6px 8px !important;
    border-radius: 10px !important;
    background: rgba(15, 23, 42, 0.78) !important;
    border: 1px solid rgba(71, 85, 105, 0.45) !important;
    text-align: center !important;
}

.studio-ui #topupModal .studio-shortage-metric span {
    display: block !important;
    font-size: 10px !important;
    color: #94a3b8 !important;
    font-weight: 600 !important;
}

.studio-ui #topupModal .studio-shortage-metric b {
    display: block !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
    color: #f8fafc !important;
    margin-top: 1px !important;
}

.studio-ui #topupModal .studio-shortage-metric.is-missing {
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(251, 191, 36, 0.55) !important;
}

.studio-ui #topupModal .studio-shortage-metric.is-missing b {
    color: #fbbf24 !important;
}

.studio-ui #topupModal .studio-shortage-tip-btn {
    width: 100% !important;
    padding: 7px 10px !important;
    border-radius: 10px !important;
    background: rgba(16, 185, 129, 0.16) !important;
    border: 1px solid rgba(52, 211, 153, 0.5) !important;
    color: #6ee7b7 !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    text-align: left !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    cursor: pointer !important;
    transition: all 0.15s ease !important;
}

.studio-ui #topupModal .studio-shortage-tip-btn:hover {
    background: rgba(16, 185, 129, 0.25) !important;
}

/* Compact 2x2 Package Selection Grid */
.studio-ui #topupModal #topupPackagesGrid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
    margin: 0 !important;
}

.studio-ui #topupModal .studio-pkg-card {
    padding: 10px 11px !important;
    border-radius: 14px !important;
    background: rgba(15, 23, 42, 0.82) !important;
    border: 1.5px solid rgba(51, 65, 85, 0.75) !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    gap: 6px !important;
    cursor: pointer !important;
    transition: all 0.16s ease !important;
    position: relative !important;
    overflow: hidden !important;
}

.studio-ui #topupModal .studio-pkg-card:hover {
    border-color: #38bdf8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 20px rgba(14, 165, 233, 0.18) !important;
}

.studio-ui #topupModal .studio-pkg-card.is-recommended {
    background: linear-gradient(145deg, rgba(245, 158, 11, 0.15), rgba(14, 165, 233, 0.12)) !important;
    border-color: #fbbf24 !important;
    box-shadow: 0 0 18px rgba(251, 191, 36, 0.18) !important;
}

.studio-ui #topupModal .studio-pkg-top {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
}

.studio-ui #topupModal .studio-pkg-name {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    color: #f8fafc !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.studio-ui #topupModal .studio-pkg-badge {
    padding: 2px 6px !important;
    border-radius: 999px !important;
    font-size: 9.5px !important;
    font-weight: 800 !important;
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fcd34d !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.studio-ui #topupModal .studio-pkg-price {
    font-size: 16px !important;
    font-weight: 900 !important;
    color: #fbbf24 !important;
    line-height: 1.15 !important;
}

.studio-ui #topupModal .studio-pkg-points {
    font-size: 11.5px !important;
    font-weight: 800 !important;
    color: #38bdf8 !important;
}

.studio-ui #topupModal .studio-pkg-minutes {
    font-size: 10px !important;
    color: #94a3b8 !important;
    line-height: 1.25 !important;
}

.studio-ui #topupModal .studio-pkg-cta {
    margin-top: 2px !important;
    width: 100% !important;
    padding: 6px 8px !important;
    border-radius: 9px !important;
    background: linear-gradient(135deg, #0ea5e9, #2563eb) !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-align: center !important;
    display: block !important;
}

.studio-ui #topupModal .studio-pkg-card.is-recommended .studio-pkg-cta {
    background: linear-gradient(135deg, #f59e0b, #ea580c) !important;
    color: #ffffff !important;
}

.studio-ui #topupModal .studio-topup-footer-note {
    font-size: 10.5px !important;
    color: #94a3b8 !important;
    text-align: center !important;
    padding: 4px 6px 0 !important;
}

/* Step 2: Dedicated Compact QR Checkout Box */
.studio-ui #topupModal #topupQrBox {
    padding: 12px !important;
    border-radius: 16px !important;
    background: rgba(9, 14, 28, 0.95) !important;
    border: 1.5px solid rgba(16, 185, 129, 0.45) !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
}

.studio-ui #topupModal .studio-qr-topbar {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
}

.studio-ui #topupModal .studio-qr-back-btn {
    padding: 5px 10px !important;
    border-radius: 9px !important;
    background: rgba(30, 41, 59, 0.9) !important;
    border: 1px solid rgba(100, 116, 139, 0.4) !important;
    color: #e2e8f0 !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
}

.studio-ui #topupModal .studio-qr-back-btn:hover {
    border-color: #38bdf8 !important;
    color: #38bdf8 !important;
}

.studio-ui #topupModal .studio-qr-main-grid {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
}

@media (max-width: 480px) {
    .studio-ui #topupModal .studio-qr-main-grid {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .studio-ui #topupModal #topupQrImg {
        width: 148px !important;
        height: 148px !important;
    }
}

/* Light Mode Support for Upgraded #topupModal */
html[data-theme="light"] .studio-ui #topupModal .glass-card.studio-topup-modal-card {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22) !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-topup-header {
    border-bottom-color: #e2e8f0 !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-topup-header h3 {
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-topup-header p {
    color: #475569 !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-topup-wallet-chip {
    background: #fffbeb !important;
    border-color: #fcd34d !important;
    color: #b45309 !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-shortage-banner {
    background: #fffbeb !important;
    border-color: #fcd34d !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-shortage-head {
    color: #92400e !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-shortage-metric {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-shortage-metric b {
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-shortage-metric.is-missing {
    background: #fef3c7 !important;
    border-color: #f59e0b !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-shortage-metric.is-missing b {
    color: #b45309 !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-shortage-tip-btn {
    background: #ecfdf5 !important;
    border-color: #6ee7b7 !important;
    color: #047857 !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-pkg-card {
    background: #f8fafc !important;
    border-color: #cbd5e1 !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-pkg-card.is-recommended {
    background: #fffbeb !important;
    border-color: #f59e0b !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-pkg-name {
    color: #0f172a !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-pkg-badge {
    background: #fef3c7 !important;
    color: #b45309 !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-pkg-price {
    color: #d97706 !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-pkg-points {
    color: #0284c7 !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-pkg-minutes {
    color: #64748b !important;
}

html[data-theme="light"] .studio-ui #topupModal #topupQrBox {
    background: #f8fafc !important;
    border-color: #6ee7b7 !important;
}

html[data-theme="light"] .studio-ui #topupModal .studio-qr-back-btn {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
    color: #334155 !important;
}

/* 8. Studio Active Job Cancel & Instant Point Refund Row */
.studio-ui #inlineRenderStatusBanner,
.studio-ui #primaryCtaBarWrap #inlineRenderStatusBanner {
    max-height: none !important;
    overflow: visible !important;
}

.studio-ui .studio-job-cancel-row {
    margin-top: 8px !important;
    padding-top: 7px !important;
    border-top: 1px dashed rgba(56, 189, 248, 0.2) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.studio-ui .studio-job-live-tip {
    font-size: 11px !important;
    color: #94a3b8 !important;
    flex: 1 1 100% !important;
    line-height: 1.4 !important;
}

.studio-ui .studio-job-live-tip span {
    color: #cbd5e1 !important;
}

.studio-ui .studio-job-guarantee-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    color: #38bdf8 !important;
    background: rgba(14, 165, 233, 0.1) !important;
    border: 1px solid rgba(56, 189, 248, 0.28) !important;
    padding: 5px 10px !important;
    border-radius: 7px !important;
    letter-spacing: -0.01em !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

.studio-ui .studio-job-refunded-badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    color: #34d399 !important;
    background: rgba(16, 185, 129, 0.12) !important;
    border: 1px solid rgba(52, 211, 153, 0.35) !important;
    padding: 5px 10px !important;
    border-radius: 7px !important;
    letter-spacing: -0.01em !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .studio-ui .studio-job-guarantee-badge {
    color: #0369a1 !important;
    background: rgba(14, 165, 233, 0.08) !important;
    border-color: rgba(2, 132, 199, 0.3) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .studio-ui .studio-job-refunded-badge {
    color: #047857 !important;
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

.studio-ui .studio-btn-cancel-job {
    background: rgba(239, 68, 68, 0.12) !important;
    border: 1px solid rgba(239, 68, 68, 0.35) !important;
    color: #f87171 !important;
    font-size: 11.5px !important;
    font-weight: 700 !important;
    padding: 5px 12px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    min-height: 32px !important;
    white-space: nowrap !important;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease !important;
    flex-shrink: 0 !important;
}

.studio-ui .studio-btn-cancel-job[style*="display:none"],
.studio-ui .studio-btn-cancel-job[style*="display: none"] {
    display: none !important;
}

.studio-ui .studio-btn-cancel-job:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    transform: translateY(-1px) !important;
}

.studio-ui .studio-btn-cancel-job:disabled {
    opacity: 0.6 !important;
    cursor: wait !important;
    transform: none !important;
}

@media (max-width: 480px) {
    .studio-ui .studio-job-cancel-row {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }
    .studio-ui .studio-btn-cancel-job {
        width: 100% !important;
        height: 34px !important;
    }
}

/* =========================================================================
   THANH TRƯỢT THUMB-ONLY (CHỈ KÉO ĐƯỢC KHI BẤM TRỰC TIẾP VÀO CHẤM TRÒN)
   Ngăn 100% lỗi vuốt cuộn trang vô tình chạm vào thanh trượt làm nhảy giá trị
   ========================================================================= */
.studio-ui input[type="range"] {
    touch-action: pan-y !important;
    -webkit-tap-highlight-color: transparent !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    cursor: default !important;
}

.studio-ui input[type="range"][data-temp-locked="1"]:disabled {
    opacity: 1 !important;
    filter: none !important;
    pointer-events: none !important;
}

.studio-ui input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    cursor: grab !important;
    transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.15s ease;
}

.studio-ui input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    cursor: grab !important;
    transition: transform 0.15s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.15s ease;
}

.studio-ui input[type="range"].is-thumb-dragging,
.studio-ui input[type="range"].is-thumb-dragging::-webkit-slider-thumb {
    cursor: grabbing !important;
}

.studio-ui input[type="range"].is-thumb-dragging::-webkit-slider-thumb {
    transform: scale(1.22);
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.28), 0 0 12px rgba(56, 189, 248, 0.65);
}

.studio-ui input[type="range"].is-thumb-dragging::-moz-range-thumb {
    transform: scale(1.22);
    box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.28), 0 0 12px rgba(56, 189, 248, 0.65);
}

/* =========================================================================
   BỘ CHỌN GIỌNG ĐỌC AI CHUẨN DESKTOP APP (TÌM KIẾM + TAB NAM/NỮ/CLONE/YÊU THÍCH)
   Tối ưu đa nền tảng cho cả PC & Điện thoại di động
   ========================================================================= */
.studio-ui .studio-voice-picker-btn {
    flex: 1 1 0%;
    min-width: 0;
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.55);
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45);
}

.studio-ui .studio-voice-picker-btn:hover,
.studio-ui .studio-voice-picker-btn.is-open {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2), 0 4px 14px rgba(0, 0, 0, 0.35);
}

.studio-ui .studio-voice-btn-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.studio-ui .studio-voice-btn-name {
    font-size: 13px;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.studio-ui .studio-voice-btn-chevron {
    flex-shrink: 0;
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, color 0.15s ease;
}

.studio-ui .studio-voice-picker-btn.is-open .studio-voice-btn-chevron {
    transform: rotate(180deg);
    color: #38bdf8;
}

.custom-voice-search-dropdown {
    position: fixed !important;
    z-index: 999990 !important;
    background: #0d1629;
    border: 1.5px solid rgba(56, 189, 248, 0.55);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.78), 0 0 20px rgba(56, 189, 248, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: inherit;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.custom-voice-search-dropdown .vsearch-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(15, 23, 42, 0.96);
    border-bottom: 1px solid rgba(56, 189, 248, 0.24);
}

.custom-voice-search-dropdown .vsearch-icon {
    font-size: 0.88rem;
    opacity: 0.85;
    flex-shrink: 0;
}

.custom-voice-search-dropdown .vsearch-input {
    flex: 1;
    min-width: 0;
    background: rgba(2, 6, 23, 0.82);
    border: 1px solid rgba(56, 189, 248, 0.42);
    border-radius: 7px;
    padding: 6px 10px;
    color: #f8fafc;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.custom-voice-search-dropdown .vsearch-input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.22);
}

.custom-voice-search-dropdown .vsearch-input::placeholder {
    color: #94a3b8;
}

.custom-voice-search-dropdown .vsearch-clear {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #cbd5e1;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.custom-voice-search-dropdown .vsearch-clear:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.custom-voice-search-dropdown .vsearch-tabs-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(10, 16, 31, 0.96);
    border-bottom: 1px solid rgba(56, 189, 248, 0.16);
}

.custom-voice-search-dropdown .vsearch-tabs-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-voice-search-dropdown .vsearch-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 8px;
    min-height: 30px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
    line-height: 1;
}

.custom-voice-search-dropdown .vsearch-tab:hover {
    color: #f1f5f9;
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.28);
}

.custom-voice-search-dropdown .vsearch-tab.is-active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.18);
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.22);
}

.custom-voice-search-dropdown .vsearch-tab[data-tab="starred"].is-active {
    color: #facc15;
    background: rgba(250, 204, 21, 0.16);
    border-color: rgba(250, 204, 21, 0.5);
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.22);
}

.custom-voice-search-dropdown .vsearch-tab-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09);
    color: #94a3b8;
    margin-left: 2px;
}

.custom-voice-search-dropdown .vsearch-tab.is-active .vsearch-tab-badge {
    background: rgba(56, 189, 248, 0.26);
    color: #38bdf8;
}

.custom-voice-search-dropdown .vsearch-tab[data-tab="starred"].is-active .vsearch-tab-badge {
    background: rgba(250, 204, 21, 0.25);
    color: #facc15;
}

.custom-voice-search-dropdown .vsearch-list {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    max-height: 290px;
    padding: 4px 0;
}

.custom-voice-search-dropdown .vsearch-group-header {
    padding: 6px 12px 5px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #38bdf8;
    background: rgba(15, 23, 42, 0.92);
    position: sticky;
    top: 0;
    z-index: 2;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.custom-voice-search-dropdown .vsearch-group.is-user-group .vsearch-group-header {
    color: #facc15;
    background: rgba(30, 27, 18, 0.94);
}

.custom-voice-search-dropdown .vsearch-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 12px;
    min-height: 36px;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
    -webkit-user-select: none;
}

.custom-voice-search-dropdown .vsearch-option.hidden,
.custom-voice-search-dropdown .vsearch-group.hidden,
.custom-voice-search-dropdown .vsearch-clear.hidden,
.custom-voice-search-dropdown .vsearch-empty.hidden {
    display: none !important;
}

.custom-voice-search-dropdown .vsearch-option:hover,
.custom-voice-search-dropdown .vsearch-option.is-active {
    background: rgba(56, 189, 248, 0.15);
    color: #ffffff;
}

.custom-voice-search-dropdown .vsearch-option.is-selected {
    background: rgba(56, 189, 248, 0.24);
    color: #38bdf8;
    font-weight: 700;
}

.custom-voice-search-dropdown .vsearch-opt-main {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    flex: 1;
}

.vsearch-gender-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.vsearch-gender-icon.is-female {
    color: #f472b6;
}

.vsearch-gender-icon.is-male {
    color: #38bdf8;
}

.vsearch-gender-icon.is-user {
    color: #c084fc;
}

.custom-voice-search-dropdown .vsearch-opt-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-voice-search-dropdown .vsearch-play-btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    padding: 0;
    margin-left: auto;
    margin-right: 2px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.14);
    border: 1px solid rgba(16, 185, 129, 0.42);
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #34d399;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    flex-shrink: 0;
}

.custom-voice-search-dropdown .vsearch-play-btn:hover {
    transform: scale(1.1);
    background: rgba(16, 185, 129, 0.28);
    border-color: #10b981;
    color: #6ee7b7;
}

.custom-voice-search-dropdown .vsearch-play-btn:active {
    transform: scale(0.95);
}

.custom-voice-search-dropdown .vsearch-play-btn.is-playing {
    background: rgba(245, 158, 11, 0.24);
    border-color: #f59e0b;
    color: #fbbf24;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.38);
}

.custom-voice-search-dropdown .vsearch-star-btn {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 5px;
    margin-left: 0;
    margin-right: 2px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.32);
    transition: transform 0.15s ease, color 0.15s ease, filter 0.15s ease;
    flex-shrink: 0;
}

.custom-voice-search-dropdown .vsearch-star-btn:hover {
    transform: scale(1.2);
    color: #facc15;
}

.custom-voice-search-dropdown .vsearch-star-btn.is-starred {
    color: #facc15;
    filter: drop-shadow(0 0 5px rgba(250, 204, 21, 0.8));
    transform: scale(1.1);
}

.custom-voice-search-dropdown .vsearch-check {
    color: #38bdf8;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
    min-width: 14px;
    text-align: right;
}

.custom-voice-search-dropdown .vsearch-empty {
    padding: 20px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 12.5px;
    line-height: 1.45;
}

/* Light Mode cho Bộ chọn giọng đọc */
html[data-theme="light"] .studio-ui .studio-voice-picker-btn {
    background: #ffffff;
    border-color: rgba(2, 132, 199, 0.45);
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

html[data-theme="light"] .studio-ui .studio-voice-btn-name {
    color: #0f172a;
}

html[data-theme="light"] .custom-voice-search-dropdown {
    background: #ffffff;
    border-color: rgba(2, 132, 199, 0.55);
    box-shadow: 0 14px 36px rgba(15, 23, 42, 0.22);
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-input {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-tabs-container {
    background: #f1f5f9;
    border-bottom-color: #e2e8f0;
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-tab {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #475569;
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-tab.is-active {
    background: #e0f2fe;
    border-color: #0284c7;
    color: #0284c7;
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-tab[data-tab="starred"].is-active {
    background: #fef9c3;
    border-color: #ca8a04;
    color: #a16207;
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-group-header {
    background: #f1f5f9;
    color: #0284c7;
    border-top-color: #e2e8f0;
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-option {
    color: #1e293b;
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-option:hover,
html[data-theme="light"] .custom-voice-search-dropdown .vsearch-option.is-active {
    background: #e0f2fe;
    color: #0369a1;
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-option.is-selected {
    background: #bae6fd;
    color: #0284c7;
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-play-btn {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(5, 150, 105, 0.4);
    color: #059669;
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-play-btn:hover {
    background: rgba(16, 185, 129, 0.22);
    border-color: #059669;
    color: #047857;
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-play-btn.is-playing {
    background: rgba(245, 158, 11, 0.2);
    border-color: #d97706;
    color: #b45309;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.28);
}

html[data-theme="light"] .custom-voice-search-dropdown .vsearch-star-btn {
    color: rgba(15, 23, 42, 0.3);
}





