/* =============================== */
/* 🎬 Timeline Root */
/* =============================== */

#timeline-root
{
    position: relative;
    width: 100%;

    display: flex;
    flex-direction: column;

    overflow: visible;

    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}


/* =============================== */
/* 📏 Ruler */
/* =============================== */


#timeline-ruler
{
    position: sticky;
    top: 0;
    left: 0;

    height: 30px;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;

    background: #111;
    border-bottom: 1px solid #444;

    z-index: 2000;

    will-change: transform;
}
/* =============================== */
/* 🎬 Timeline Viewport (Scroll Layer) */
/* =============================== */




#timeline-viewport
{
    position: relative;

    width: 100%;
    min-height: 180px;
    max-height: none;

    overflow: auto;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;

    border-top: 1px solid #222;
    border-bottom: 1px solid #222;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;

    background:
        repeating-linear-gradient(
            to right,
            rgba(141, 97, 255, 0.08) 0px,
            rgba(141, 97, 255, 0.08) 1px,
            transparent 1px,
            transparent 100px
        ),
        #111;
}


/* =============================== */
/* 📦 Timeline Content (Width grows via JS) */
/* =============================== */

#timeline-content
{
    position: relative;
    min-height: calc(100% - 30px);
    min-width: 100%;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}




/* =============================== */
/* 🎵 Tracks */
/* =============================== */

.timeline-track
{
    position: relative;
    height: var(--track-height);

    border-bottom: 1px solid #222;

    background:
        repeating-linear-gradient(
            to right,
            rgba(255,255,255,0.03) 0px,
            rgba(255,255,255,0.03) 1px,
            transparent 1px,
            transparent 100px
        );
        flex-shrink: 0;
}


/* =============================== */
/* 🎞 Clips */
/* =============================== */

.timeline-clip
{
    position: absolute;

    height: calc(var(--track-height) - 20px);
    top: 10px;

    border-radius: 4px;

    cursor: text;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;

    overflow: hidden;

    background: rgba(141, 97, 255, 0.72);
    touch-action: none;
}

#timeline-root *,
#timeline-context-menu,
#timeline-context-menu *
{
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

#timeline-root input,
#timeline-root textarea,
#timeline-root select,
#timeline-track-label-editor,
#timeline-context-menu input,
#timeline-context-menu textarea,
#timeline-context-menu select,
#ai-effect-dialog textarea,
#ai-effect-dialog input,
#ai-effect-dialog select,
#ai-vision-effect-dialog textarea,
#ai-vision-effect-dialog input,
#ai-vision-effect-dialog select,
#speech-clip-dialog textarea,
#speech-clip-dialog input,
#speech-clip-dialog select,
#speech-clip-dialog button,
#preferences-dialog input,
#preferences-dialog button,
#privacy-policy-dialog button,
#profile-billing-dialog input,
#profile-billing-dialog select,
#profile-billing-dialog button,
#shader-clip-editor textarea,
#shader-clip-editor input,
#shader-clip-editor select,
#wrap-effect-editor input,
#wrap-effect-editor select
{
    user-select: text;
    -webkit-user-select: text;
    -webkit-touch-callout: default;
}

.timeline-track-label-editor
{
    position: fixed;
    z-index: 20000;
    display: none;
    box-sizing: border-box;
    border: 1px solid rgba(141, 97, 255, 0.68);
    border-radius: 5px;
    outline: none;
    background: rgba(17, 23, 34, 0.98) !important;
    color: #d7dbea !important;
    -webkit-text-fill-color: #d7dbea !important;
    caret-color: var(--mobile-purple) !important;
    font: 600 clamp(11px, calc(var(--track-height) / 7), 18px)/1.1 Inter, "Segoe UI", Arial, sans-serif;
    letter-spacing: 0;
    text-align: center;
    padding: 0 5px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.05),
        0 8px 18px rgba(0, 0, 0, 0.32),
        0 0 10px rgba(141, 97, 255, 0.22);
}

.timeline-track-label-editor::selection
{
    background: rgba(141, 97, 255, 0.72) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.timeline-clip.dragging
{
    cursor: grabbing;
}

.timeline-clip.resize
{
    cursor: ew-resize;
}

.timeline-clip.multi-selected
{
    outline: 2px solid rgba(141, 97, 255, 0.88);
    box-shadow:
        0 0 10px rgba(141, 97, 255, 0.72),
        inset 0 0 0 1px rgba(0, 0, 0, 0.7);
}

.timeline-clip.selected-clip
{
    outline: 2px solid rgba(141, 97, 255, 0.98);
    outline-offset: 1px;
    box-shadow:
        0 0 0 2px rgba(210, 214, 228, 0.34),
        0 0 14px rgba(141, 97, 255, 0.9),
        inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.timeline-clip.selected-clip.multi-selected
{
    outline-color: rgba(141, 97, 255, 0.98);
    box-shadow:
        0 0 0 2px rgba(210, 214, 228, 0.38),
        0 0 14px rgba(141, 97, 255, 0.82),
        inset 0 0 0 1px rgba(0, 0, 0, 0.7);
}

.timeline-clip.hidden-compositor-clip
{
    opacity: 0.48;
    filter: saturate(0.55);
}

.timeline-clip.hidden-compositor-clip::after
{
    content: "hidden";
    position: absolute;
    right: 6px;
    top: 5px;
    z-index: 12;
    padding: 3px 5px;
    border: 1px solid rgba(170, 144, 255, 0.48);
    border-radius: 4px;
    background: rgba(10, 12, 20, 0.72);
    color: rgba(235, 238, 255, 0.86);
    font-size: 10px;
    line-height: 1;
    pointer-events: none;
}

.timeline-clip.audio-clip.selected-clip
{
    outline-color: rgba(141, 97, 255, 0.78);
    box-shadow:
        0 0 0 1px rgba(210, 214, 228, 0.28),
        0 0 10px rgba(141, 97, 255, 0.42),
        inset 0 0 0 1px rgba(210, 214, 228, 0.18);
}

.timeline-clip.clip-reversed::after
{
    content: "REV";
    position: absolute;
    right: 4px;
    top: 3px;
    z-index: 12;
    padding: 1px 4px;
    border: 1px solid rgba(255, 208, 64, 0.9);
    background: rgba(0, 0, 0, 0.76);
    color: #ffd040;
    font: bold 9px monospace;
    pointer-events: none;
}

.timeline-clip .av-sync-ghost
{
    position: absolute;
    top: 5px;
    bottom: 5px;
    z-index: 8;
    box-sizing: border-box;
    border: 1px solid rgba(113, 232, 188, 0.96);
    background:
        repeating-linear-gradient(
            135deg,
            rgba(113, 232, 188, 0.22) 0,
            rgba(113, 232, 188, 0.22) 8px,
            rgba(8, 20, 27, 0.2) 8px,
            rgba(8, 20, 27, 0.2) 16px
        );
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.22),
        0 0 10px rgba(113, 232, 188, 0.26);
    cursor: ew-resize;
    pointer-events: auto;
}

.timeline-clip .av-sync-ghost::before
{
    content: attr(data-label);
    position: absolute;
    left: 5px;
    top: 4px;
    padding: 1px 4px;
    border-radius: 3px;
    background: rgba(6, 17, 24, 0.82);
    color: rgba(220, 255, 242, 0.98);
    font: 700 10px/1.2 Inter, "Segoe UI", Arial, sans-serif;
    white-space: nowrap;
    pointer-events: none;
}

#timeline-marquee-selection
{
    position: absolute;
    display: none;
    pointer-events: none;
    z-index: 950;
    border: 1px solid rgba(141, 97, 255, 0.9);
    background: rgba(141, 97, 255, 0.14);
    box-shadow: 0 0 10px rgba(141, 97, 255, 0.5);
}

#timeline-range-selection
{
    position: absolute;
    top: 0;
    display: none;
    pointer-events: none;
    z-index: 2;
    background: rgba(141, 97, 255, 0.11);
    border-left: 2px solid rgba(210, 214, 228, 0.88);
    border-right: 2px solid rgba(210, 214, 228, 0.88);
    box-shadow:
        inset 0 0 0 1px rgba(141, 97, 255, 0.34),
        0 0 12px rgba(141, 97, 255, 0.24);
}

.clip-resize-handle
{
    position: absolute;
    top: 0;
    width: 6px;
    height: 100%;
    z-index: 8;
    cursor: ew-resize;
    background: rgba(210, 214, 228, 0.14);
    box-shadow: inset 0 0 0 1px rgba(141, 97, 255, 0.18);
    pointer-events: none;
}

.clip-resize-handle-left
{
    left: 0;
    border-right: 1px solid rgba(210, 214, 228, 0.56);
}

.clip-resize-handle-right
{
    right: 0;
    border-left: 1px solid rgba(210, 214, 228, 0.56);
}

.clip-selection-region,
.clip-selection-marker,
.clip-fade-region,
.clip-transform-keyframe-marker
{
    position: absolute;
    top: 0;
    height: 100%;
    pointer-events: none;
    z-index: 4;
}

.clip-selection-region
{
    background: rgba(141, 97, 255, 0.16);
    border-left: 1px solid rgba(210, 214, 228, 0.72);
    border-right: 1px solid rgba(210, 214, 228, 0.72);
}

.clip-selection-marker
{
    z-index: 5;
    background: rgba(210, 214, 228, 0.96);
    box-shadow:
        0 0 0 1px rgba(141, 97, 255, 0.72),
        0 0 7px rgba(141, 97, 255, 0.75);
}

.clip-fade-region
{
    z-index: 3;
    background: linear-gradient(
        90deg,
        rgba(141, 97, 255, 0.34),
        rgba(141, 97, 255, 0.04)
    );
}

.clip-fade-out
{
    background: linear-gradient(
        90deg,
        rgba(141, 97, 255, 0.04),
        rgba(141, 97, 255, 0.34)
    );
}

.clip-transform-keyframe-marker
{
    z-index: 6;
    width: 2px;
    background: rgba(210, 214, 228, 0.95);
    box-shadow: 0 0 7px rgba(141, 97, 255, 0.78);
}

.clip-transform-keyframe-marker::before
{
    content: "";
    position: absolute;
    left: -4px;
    top: 8px;
    width: 8px;
    height: 8px;
    border: 1px solid rgba(141, 97, 255, 0.95);
    background: rgba(0, 0, 0, 0.82);
    transform: rotate(45deg);
}

.clip-pose-keyframe-marker
{
    width: 2px;
    background: rgba(177, 97, 255, 0.98);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.22),
        0 0 9px rgba(141, 97, 255, 0.9);
}

.clip-pose-keyframe-marker::before
{
    left: -5px;
    top: 6px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 9px solid rgba(255, 255, 255, 0.96);
    background: transparent;
    transform: none;
}

.clip-pose-keyframe-marker::after
{
    content: "";
    position: absolute;
    left: -3px;
    top: 15px;
    width: 8px;
    height: 12px;
    background: rgba(255, 255, 255, 0.92);
    clip-path: polygon(50% 100%, 0 55%, 34% 55%, 34% 0, 66% 0, 66% 55%, 100% 55%);
}

.shader-clip-label
{
    position: absolute;
    left: 12px;
    top: 10px;
    right: 12px;
    z-index: 6;
    color: #f3f1ff;
    font: 12px monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.shader-clip-code-preview
{
    top: 30px;
    color: rgba(205, 211, 230, 0.74);
    font-size: 10px;
}


/* =============================== */
/* 🧭 Scrollbar Styling */
/* =============================== */

#timeline-viewport::-webkit-scrollbar
{
    width: 16px;
    height: 16px;
}

#timeline-viewport:not(.timeline-overflow-y)::-webkit-scrollbar:vertical
{
    width: 0;
}

#timeline-viewport:not(.timeline-overflow-x)::-webkit-scrollbar:horizontal
{
    height: 0;
}

#timeline-viewport::-webkit-scrollbar-corner
{
    background: transparent;
}

#timeline-viewport::-webkit-scrollbar-track
{
    background: #111;
}

#timeline-viewport::-webkit-scrollbar-thumb
{
    background: rgba(141, 97, 255, 0.44);
    border-radius: 6px;
}

#timeline-viewport::-webkit-scrollbar-thumb:hover
{
    background: rgba(171, 139, 255, 0.68);
}

#timeline-playhead
{
    position: absolute;
    top: 0;

    width: 32px;
    margin-left: -16px;
    background: transparent;

    z-index: 10000;
}

#timeline-playhead::before
{
    content: "";

    position: absolute;
    left: 15px;
    top: 0;

    width: 2px;
    height: 100%;

    background: #ff4040;
    box-shadow:
        0 0 8px rgba(255,80,80,0.9),
        0 0 16px rgba(255,80,80,0.5);

    pointer-events: none;
}


/* =============================== */
/* ✂ Timeline Tools */
/* =============================== */

#timeline-tools
{
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 8px;
    padding: 6px 8px;

    background:
        linear-gradient(180deg, rgba(17, 23, 34, 0.96), rgba(7, 11, 17, 0.92));
    border-top: 1px solid rgba(151, 161, 184, 0.16);
    border-bottom: 1px solid rgba(151, 161, 184, 0.24);

    position: sticky;

    top: 24px; /* below ruler */
    z-index: 1500;
    overflow-x: hidden;
    overflow-y: visible;
    scrollbar-width: thin;
    scrollbar-color: rgba(141, 97, 255, 0.55) rgba(7, 11, 17, 0.8);
}

#timeline-tools::-webkit-scrollbar
{
    height: 8px;
}

#timeline-tools::-webkit-scrollbar-track
{
    background: rgba(0, 0, 0, 0.45);
}

#timeline-tools::-webkit-scrollbar-thumb
{
    background: rgba(141, 97, 255, 0.52);
    border-radius: 999px;
}

button[onclick="loadAlignmentFromFile(createSpeechToTextClip)"]
{
    display: none !important;
}





.timeline-tool
{
    min-height: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: rgba(18, 24, 34, 0.88);
    color: #d9dced;

    border: 1px solid rgba(151, 161, 184, 0.26);
    border-radius: 4px;

    padding: 4px 10px;
    cursor: pointer;

    font-family: monospace;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;

    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.timeline-tool:hover
{
    background: rgba(141, 97, 255, 0.16);
    border-color: rgba(141, 97, 255, 0.58);
    color: #ffffff;
}

.timeline-record-tool:hover
{
    color: #ffffff;
    border-color: rgba(255, 132, 132, 0.9);
    background: rgba(126, 32, 42, 0.62);
    box-shadow:
        0 0 9px rgba(255, 115, 115, 0.76),
        0 0 18px rgba(255, 82, 82, 0.34),
        inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.timeline-tool.active
{
    background: rgba(141, 97, 255, 0.24);
    border-color: rgba(171, 139, 255, 0.64);
    color: #f4f1ff;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.055),
        0 0 14px rgba(141, 97, 255, 0.28);
}

.timeline-record-tool.recording
{
    color: #ffffff;
    border-color: rgba(255, 82, 82, 0.82);
    background: rgba(116, 24, 34, 0.58);
    box-shadow:
        0 0 8px rgba(255, 82, 82, 0.58),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12);
    animation: recordingPulse 1.15s ease-in-out infinite;
}

.timeline-record-status
{
    min-width: 48px;
    color: rgba(255, 255, 255, 0.76);
    font-family: monospace;
    font-size: 12px;
    font-weight: 700;
    text-align: left;
}

.timeline-record-status.recording
{
    color: #ff9a9a;
}

.timeline-tool-group
{
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    flex: 0 1 auto;
    padding: 3px;
    border: 1px solid rgba(151, 161, 184, 0.14);
    background: rgba(255, 255, 255, 0.035);
}

.primary-tools
{
    position: static;
    z-index: 2;
    background: rgba(12, 17, 26, 0.98);
}

.timeline-tool-menu
{
    position: relative;
    flex: 0 0 auto;
}

.timeline-tool-menu > summary
{
    height: 30px;
    list-style: none;
    line-height: 1;
}

.timeline-tool-menu > summary::-webkit-details-marker
{
    display: none;
}

.menu-summary::after
{
    content: "";
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 8px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    transform: translateY(1px);
}

.timeline-tool-menu[open] > .menu-summary
{
    background: rgba(141, 97, 255, 0.24);
    border-color: rgba(171, 139, 255, 0.64);
    box-shadow: 0 0 14px rgba(141, 97, 255, 0.28);
}

.timeline-menu-panel
{
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    padding: 4px;
    background: rgba(12, 17, 26, 0.98);
    border: 1px solid rgba(141, 97, 255, 0.34);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5), 0 0 18px rgba(141, 97, 255, 0.14);
}

.timeline-recording-mode-menu button
{
    appearance: none;
    -webkit-appearance: none;
}

.timeline-recording-mode-menu button:not(:disabled):is(:hover, :focus-visible)
{
    border-color: var(--ui-hover-line, rgba(171, 139, 255, 0.62)) !important;
    background:
        linear-gradient(180deg, var(--ui-hover-bg-strong, rgba(141, 97, 255, 0.24)), rgba(141, 97, 255, 0.08)) !important;
    color: #ffffff !important;
    outline: none;
}

.timeline-recording-mode-menu button:disabled
{
    opacity: 0.52;
}

.clip-type-grid
{
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    grid-template-rows: repeat(2, 30px);
}

.clip-type-tool
{
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    height: 30px;
    padding: 4px 9px;
    white-space: nowrap;
    line-height: 1;
}

.tool-glyph
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 18px;
    padding: 0 3px;
    border: 1px solid rgba(151, 161, 184, 0.3);
    color: #ffffff;
    background: rgba(141, 97, 255, 0.14);
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", monospace;
    font-size: 11px;
    line-height: 1;
}

.export-menu-panel
{
    flex-wrap: wrap;
    min-width: min(520px, calc(100vw - 24px));
}


#project-size-controls,
#export-size-controls
{
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #aeb4c4;
    font: 12px monospace;
}

#project-size-controls input,
#export-size-controls input,
#export-size-controls select
{
    width: 72px;
    background: #050505;
    color: #d9dced;
    border: 1px solid rgba(151, 161, 184, 0.28);
    border-radius: 4px;
    padding: 4px 6px;
    font: 12px monospace;
}

#export-size-controls select
{
    width: auto;
}

.export-pro-notice
{
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(141, 97, 255, 0.42);
    border-radius: 7px;
    background: rgba(141, 97, 255, 0.1);
    color: #d9d2ff;
    font-size: 11px;
}

.export-pro-notice[hidden]
{
    display: none !important;
}

.export-pro-notice span
{
    display: grid;
    gap: 2px;
}

.export-pro-notice strong
{
    color: #bda9ff;
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.export-pro-notice button
{
    flex: 0 0 auto;
    color: #fff;
    border-color: rgba(171, 139, 255, 0.55);
    background: linear-gradient(135deg, #8d61ff, #6f4be4);
}

.pro-export-locked
{
    border-color: rgba(141, 97, 255, 0.72) !important;
    box-shadow: 0 0 0 1px rgba(141, 97, 255, 0.18);
}

#timeline-stream-panel
{
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    align-items: stretch;
    padding: 8px;
    background: rgba(0, 0, 0, 0.72);
    border-bottom: 1px solid rgba(151, 161, 184, 0.22);
}

#timeline-stream-panel.collapsed
{
    display: none;
}

#timeline-camera-panel,
#timeline-audio-device-panel
{
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 8px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.74);
    border-bottom: 1px solid rgba(151, 161, 184, 0.22);
    color: #b8bdcc;
    font: 12px monospace;
}

#timeline-camera-panel.collapsed,
#timeline-audio-device-panel.collapsed
{
    display: none;
}

.timeline-camera-header,
.timeline-camera-body,
.timeline-audio-device-header,
.timeline-audio-device-body
{
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-wrap: wrap;
}

#timeline-camera-status,
#timeline-audio-device-status
{
    color: rgba(255,255,255,0.75);
    align-self: center;
}

#timeline-camera-sources,
#timeline-audio-device-sources
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
    flex: 1;
    min-width: min(420px, 100%);
}

.timeline-camera-source,
.timeline-audio-device-source
{
    min-height: 58px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px;
    align-items: center;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid rgba(141, 97, 255, 0.36);
    border-radius: 4px;
    background: rgba(141, 97, 255, 0.10);
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    color: inherit;
    font: inherit;
    text-align: left;
}

.timeline-camera-source:active
{
    cursor: grabbing;
}

.timeline-camera-source.touch-drag-ready
{
    outline: 2px solid #ffffff;
    box-shadow: 0 0 12px rgba(141, 97, 255, 0.72);
}

.timeline-camera-source-drag-ghost
{
    position: fixed;
    left: 0;
    top: 0;
    width: min(230px, calc(100vw - 24px));
    z-index: 20000;
    opacity: 0.88;
    pointer-events: none;
    transform: translate(-9999px, -9999px);
    translate: -50% -50%;
    box-shadow: 0 0 18px rgba(141, 97, 255,0.85);
}

.timeline-tool.touch-drag-ready,
[data-mobile-tool].touch-drag-ready
{
    outline: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 0 14px rgba(132,88,255,0.75);
}

.timeline-tool-drag-ghost
{
    position: fixed;
    left: 0;
    top: 0;
    min-width: 112px;
    max-width: min(220px, calc(100vw - 24px));
    padding: 10px 12px;
    border: 1px solid rgba(171,136,255,0.82);
    border-radius: 4px;
    background: rgba(18,22,34,0.94);
    color: #ffffff;
    font: inherit;
    font-weight: 700;
    text-align: center;
    z-index: 20000;
    opacity: 0.9;
    pointer-events: none;
    transform: translate(-9999px, -9999px);
    translate: -50% -50%;
    box-shadow: 0 0 18px rgba(132,88,255,0.85);
    user-select: none;
    -webkit-user-select: none;
}

.timeline-camera-source-title,
.timeline-audio-device-source-title
{
    color: #ffffff;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-camera-source-meta,
.timeline-audio-device-source-meta
{
    color: rgba(184, 189, 204, 0.74);
    font-size: 10px;
}

.timeline-camera-source-kind,
.timeline-audio-device-source-kind
{
    padding: 2px 5px;
    border: 1px solid rgba(141, 97, 255, 0.35);
    border-radius: 3px;
    color: #d9dced;
    background: rgba(0,0,0,0.45);
    font-size: 10px;
}

#timeline-phone-camera-invite
{
    width: min(250px, 100%);
    display: grid;
    gap: 6px;
}

.timeline-remote-stream-mode,
.phone-camera-mode-toggle
{
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.phone-camera-mode-toggle
{
    justify-content: stretch;
}

.timeline-remote-stream-mode label,
.phone-camera-mode-toggle label
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 28px;
    padding: 4px 8px;
    box-sizing: border-box;
    border: 1px solid rgba(151, 161, 184, 0.28);
    background: rgba(11, 15, 24, 0.92);
    color: #d9dced;
    white-space: nowrap;
}

.phone-camera-mode-toggle label
{
    flex: 1 1 0;
}

.timeline-remote-stream-mode input,
.phone-camera-mode-toggle input
{
    margin: 0;
    accent-color: #8b5cf6;
}

#timeline-phone-camera-qr
{
    min-height: 148px;
    display: grid;
    place-items: center;
    background: #ffffff;
    border: 1px solid rgba(141, 97, 255, 0.36);
}

#timeline-phone-camera-qr:empty
{
    display: none;
}

#timeline-phone-camera-qr .timeline-phone-camera-qr-bitmap
{
    display: block;
    width: min(196px, 100%);
    height: min(196px, 100vw - 40px);
    background: #ffffff;
}

#timeline-phone-camera-link,
#timeline-phone-camera-code
{
    width: 100%;
    box-sizing: border-box;
    background: #050505;
    color: #d9dced;
    border: 1px solid rgba(151, 161, 184, 0.28);
    padding: 6px 8px;
    font: 11px monospace;
}

#timeline-phone-camera-code
{
    min-height: 54px;
    resize: vertical;
}

#phone-camera-panel
{
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: grid;
    grid-template-rows: auto 1fr auto auto auto auto auto auto;
    gap: 10px;
    padding: 12px;
    box-sizing: border-box;
    background: #050505;
    color: #d9dced;
    font: 14px monospace;
}

#phone-camera-titlebar
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

#phone-camera-title
{
    color: #ffffff;
    font-weight: bold;
}

#phone-camera-close
{
    background: #090909;
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 4px;
    padding: 7px 10px;
    font: 13px monospace;
}

#phone-camera-preview
{
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: contain;
    background: #000000;
    border: 1px solid rgba(151, 161, 184, 0.26);
    border-radius: 4px;
}

#phone-camera-scanner
{
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000000;
    border: 1px solid rgba(141, 97, 255, 0.46);
    border-radius: 4px;
    overflow: hidden;
}

#phone-camera-scanner.hidden
{
    display: none;
}

#phone-camera-scan-video
{
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

#phone-camera-scan-guide
{
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(58%, 260px);
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border: 2px dashed #ffffff;
    box-sizing: border-box;
    pointer-events: none;
}

#phone-camera-select
{
    width: 100%;
    min-width: 0;
    background: #050505;
    color: #d9dced;
    border: 1px solid rgba(151, 161, 184, 0.28);
    border-radius: 4px;
    padding: 9px 10px;
    font: 14px monospace;
}

#phone-camera-invite-code
{
    width: 100%;
    min-height: 58px;
    box-sizing: border-box;
    resize: vertical;
    background: #050505;
    color: #d9dced;
    border: 1px solid rgba(151, 161, 184, 0.28);
    padding: 7px 9px;
    font: 12px/1.3 monospace;
}

#phone-camera-zoom
{
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    color: rgba(217, 220, 237, 0.9);
}

#phone-camera-zoom.hidden
{
    display: none;
}

#phone-camera-zoom label
{
    white-space: nowrap;
    font: 13px monospace;
}

#phone-camera-zoom-slider
{
    width: 100%;
    min-width: 0;
    accent-color: #8d61ff;
}

#phone-camera-buttons
{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

#phone-camera-buttons button,
#phone-camera-connect-code
{
    background: #090909;
    color: #d9dced;
    border: 1px solid rgba(151, 161, 184, 0.28);
    border-radius: 4px;
    padding: 10px;
    font: 13px monospace;
}

#phone-camera-status
{
    min-height: 20px;
    color: rgba(184, 189, 204, 0.78);
}

.timeline-stream-controls
{
    display: flex;
    flex-wrap: wrap;
    min-width: 0;
    gap: 8px;
    align-items: center;
    color: #b8bdcc;
    font: 12px monospace;
}

.timeline-stream-destinations
{
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
}

.timeline-stream-destination
{
    display: grid;
    grid-template-columns: 22px 112px 112px 72px minmax(180px, 1fr) minmax(160px, 1fr) auto auto auto;
    gap: 6px;
    align-items: center;
    width: 100%;
}

.timeline-stream-destination .stream-chat-clip-tool
{
    cursor: grab;
}

.timeline-stream-destination .stream-chat-clip-tool:active
{
    cursor: grabbing;
}

.timeline-stream-destination .stream-chat-settings
{
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) auto minmax(150px, auto);
    gap: 8px;
    align-items: center;
    padding: 6px 8px;
    border: 1px solid rgba(151, 161, 184, 0.16);
    border-radius: 7px;
    background: rgba(8, 12, 19, 0.58);
}

.timeline-stream-destination .stream-chat-settings:not([open])
{
    display: block;
}

.timeline-stream-destination .stream-chat-settings > summary
{
    grid-column: 1 / -1;
    cursor: pointer;
    color: #b9c0d4;
    font: 700 12px/1.4 Inter, "Segoe UI", Arial, sans-serif;
    user-select: none;
}

.timeline-stream-destination .stream-chat-settings[open] > summary
{
    margin-bottom: 2px;
}

.timeline-stream-destination .stream-chat-source
{
    min-width: 0;
}

.timeline-stream-destination .stream-chat-credential
{
    min-width: 0;
}

.timeline-stream-destination .stream-chat-status
{
    overflow: hidden;
    color: #9ea7bb;
    font: 12px/1.35 Inter, "Segoe UI", Arial, sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-stream-destination .stream-chat-status.connected
{
    color: #6ce0a8;
}

.timeline-stream-destination .stream-chat-status.error
{
    color: #ff8a96;
}

.timeline-stream-destination .stream-chat-privacy
{
    grid-column: 1 / -1;
    color: #7f899f;
    font: 11px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

.timeline-stream-controls label
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.timeline-stream-controls input,
.timeline-stream-controls select
{
    min-width: 160px;
    background: #050505;
    color: #d9dced;
    border: 1px solid rgba(151, 161, 184, 0.28);
    border-radius: 4px;
    padding: 4px 6px;
    font: 12px monospace;
}

.timeline-stream-destination input[type="checkbox"]
{
    min-width: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--mobile-purple);
}

.timeline-stream-destination select
{
    min-width: 0;
    width: 112px;
}

.timeline-stream-destination select[title="Fit keeps everything visible; Fill crops to cover"]
{
    width: 72px;
}

#timeline-stream-status
{
    color: rgba(255,255,255,0.75);
}

#timeline-stream-status.active
{
    color: #9cffbd;
}

#timeline-stream-preview
{
    width: min(640px, 100%);
    min-height: 120px;
    max-height: 220px;
    justify-self: start;
    background: #000;
    border: 1px solid rgba(151, 161, 184, 0.24);
    border-radius: 4px;
}

.timeline-clip.streaming-clip
{
    background: linear-gradient(
        90deg,
        rgba(255, 40, 40, 0.45),
        rgba(255, 255, 255, 0.16)
    );
    border-color: rgba(255, 72, 72, 0.95);
}

.streaming-clip-label
{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font: bold 12px monospace;
    text-shadow: 0 1px 3px #000;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
    box-sizing: border-box;
}

.timeline-clip.share-tab-clip
{
    background: linear-gradient(
        90deg,
        rgba(40, 160, 255, 0.42),
        rgba(80, 255, 205, 0.18)
    );
    border-color: rgba(80, 205, 255, 0.95);
}

.share-tab-clip-label
{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font: bold 12px monospace;
    text-shadow: 0 1px 3px #000;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
    box-sizing: border-box;
}

.timeline-clip.camera-clip
{
    background: linear-gradient(
        90deg,
        rgba(70, 235, 125, 0.42),
        rgba(255, 255, 255, 0.16)
    );
    border-color: rgba(120, 255, 165, 0.95);
}

.timeline-clip.live-audio-clip
{
    background:
        linear-gradient(90deg, rgba(70, 203, 185, 0.72), rgba(67, 116, 232, 0.64));
    border: 1px solid rgba(153, 236, 224, 0.55);
}

.timeline-clip.live-audio-muted
{
    filter: saturate(0.72);
}

.timeline-clip.live-audio-muted::after
{
    content: "Muted";
    position: absolute;
    right: 8px;
    top: 6px;
    color: #ffd7d7;
    font: 700 10px/1 Inter, "Segoe UI", Arial, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0;
    pointer-events: none;
}

.live-audio-clip-label
{
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0 8px;
    color: #ecfffb;
    font: 700 12px/1.15 monospace;
    text-align: center;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    pointer-events: none;
}

.camera-clip-label
{
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font: bold 12px monospace;
    text-shadow: 0 1px 3px #000;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 8px;
    box-sizing: border-box;
}

.timeline-clip.live-chat-clip
{
    background:
        linear-gradient(90deg, rgba(255, 47, 143, 0.48), rgba(75, 214, 255, 0.22));
    border-color: rgba(255, 93, 178, 0.96);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 14px rgba(255, 47, 143, 0.18);
}

.timeline-clip.emoji-effect-clip
{
    background:
        linear-gradient(90deg, rgba(255, 193, 69, 0.42), rgba(255, 47, 143, 0.34)),
        repeating-linear-gradient(
            135deg,
            rgba(255, 255, 255, 0.12) 0,
            rgba(255, 255, 255, 0.12) 8px,
            transparent 8px,
            transparent 16px
        );
    border-color: rgba(255, 205, 96, 0.95);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 14px rgba(255, 193, 69, 0.18);
}

.live-chat-clip-label,
.emoji-effect-clip-label
{
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0 8px;
    color: #ffffff;
    font: 700 12px/1.15 monospace;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.84);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

@media (max-width: 760px)
{
    #timeline-stream-panel
    {
        grid-template-columns: 1fr;
    }

    .timeline-stream-destination
    {
        grid-template-columns: 22px minmax(120px, 1fr) minmax(104px, 1fr) 72px auto auto auto;
    }

    .timeline-stream-destination input[type="text"],
    .timeline-stream-destination input[type="password"]
    {
        grid-column: 1 / -1;
        width: 100%;
    }
}

#canvas-wrapper
{
    position: relative;
    align-items: center;
}

#canvas-wrapper:fullscreen,
#canvas-wrapper.output-fullscreen-active
{
    width: 100vw;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#canvas-wrapper.output-fullscreen-fallback
{
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    width: 100vw;
    height: var(--output-fullscreen-height, 100dvh);
    max-width: none;
    max-height: none;
    margin: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
    box-sizing: border-box;
    overflow: hidden;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

#canvas-wrapper.output-fullscreen-fallback canvas
{
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: var(--output-fullscreen-height, 100dvh);
    object-fit: contain;
}

body.output-fullscreen-fallback-active
{
    overflow: hidden;
    padding-top: 0;
}

body.output-fullscreen-fallback-active #timeline-viewport,
body.output-fullscreen-fallback-active #logContainer,
body.output-fullscreen-fallback-active .timeline-toolbar,
body.output-fullscreen-fallback-active #main-controls,
body.output-fullscreen-fallback-active #project-panel
{
    pointer-events: none;
}

#fullscreen-playback-controls
{
    position: absolute;
    left: 50%;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
    z-index: 2147483001;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: translateX(-50%);
    pointer-events: auto;
}

#canvas-wrapper.output-fullscreen-active #fullscreen-playback-controls,
#canvas-wrapper.output-fullscreen-fallback #fullscreen-playback-controls,
#canvas-wrapper.compositor-focus-active #fullscreen-playback-controls,
#canvas-wrapper:fullscreen #fullscreen-playback-controls
{
    display: flex;
}

.fullscreen-playback-btn
{
    min-width: 44px;
    height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(151, 161, 184, 0.28);
    border-radius: 6px;
    background: transparent;
    color: var(--mobile-text);
    font: 700 12px Inter, "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}

.fullscreen-playback-btn:hover
{
    color: #ffffff;
    border-color: rgba(141, 97, 255, 0.64);
    background: rgba(141, 97, 255, 0.18);
}

.fullscreen-only
{
    display: none;
}

#canvas-wrapper.output-fullscreen-active .fullscreen-only,
#canvas-wrapper.output-fullscreen-fallback .fullscreen-only,
#canvas-wrapper.compositor-focus-active .fullscreen-only,
#canvas-wrapper:fullscreen .fullscreen-only
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

#canvas-wrapper.compositor-focus-active:not(.output-fullscreen-active):not(.output-fullscreen-fallback):not(:fullscreen) #fullscreen-restart-btn,
#canvas-wrapper.compositor-focus-active:not(.output-fullscreen-active):not(.output-fullscreen-fallback):not(:fullscreen) #fullscreen-play-btn
{
    display: none;
}

.output-fullscreen-entry
{
    min-width: 96px;
}

@media (max-width: 520px)
{
    #fullscreen-playback-controls
    {
        bottom: 10px;
        gap: 6px;
    }

    .fullscreen-playback-btn
    {
        padding: 0 8px;
        font-size: 11px;
    }
}




#face-overlay
{
position:absolute;
left:0;
top:0;
width:100%;
height:100%;
pointer-events:none;
background: rgba(128, 0, 255, 0.25); /* violet 25% transparent */
}


#text-overlay
{
position:absolute;
left:0;
top:0;
width:100%;
height:100%;
pointer-events:none;
background: rgba(0, 0, 0, 0);
}

#clip-transform-overlay.hidden
{
    display: none;
}

#wrap-effect-preview-overlay.hidden
{
    display: none;
}

#wrap-effect-preview-overlay
{
    position: absolute;
    z-index: 1300;
    pointer-events: auto;
    overflow: visible;
    touch-action: none;
}

#wrap-effect-preview-line
{
    position: absolute;
    left: 0;
    top: 0;
    height: 2px;
    transform-origin: 0 50%;
    background: rgba(190, 166, 255, 0.96);
    box-shadow:
        0 0 0 1px rgba(22, 14, 48, 0.76),
        0 0 14px rgba(141, 97, 255, 0.72);
    pointer-events: none;
    display: none;
}

#wrap-effect-preview-circle
{
    position: absolute;
    left: 0;
    top: 0;
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    border-radius: 50%;
    border: 2px solid rgba(190, 166, 255, 0.95);
    background:
        radial-gradient(circle, rgba(141, 97, 255, 0.16) 0, rgba(141, 97, 255, 0.08) 58%, rgba(141, 97, 255, 0.02) 72%, transparent 73%);
    box-shadow:
        0 0 0 1px rgba(22, 14, 48, 0.8),
        inset 0 0 22px rgba(141, 97, 255, 0.18),
        0 0 22px rgba(141, 97, 255, 0.42);
    pointer-events: none;
}

.wrap-effect-point
{
    position: absolute;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border-radius: 50%;
    border: 2px solid rgba(237, 231, 255, 0.96);
    background:
        radial-gradient(circle at 35% 30%, #ffffff 0, #cdbdff 24%, var(--mobile-purple) 72%);
    color: #ffffff;
    font: 800 12px/1 Inter, "Segoe UI", Arial, sans-serif;
    text-align: center;
    cursor: grab;
    touch-action: none;
    pointer-events: auto;
    box-shadow:
        0 0 0 3px rgba(141, 97, 255, 0.18),
        0 0 18px rgba(141, 97, 255, 0.66),
        0 8px 18px rgba(0, 0, 0, 0.42);
    display: none;
}

.wrap-effect-point:active
{
    cursor: grabbing;
}

#clip-transform-overlay
{
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1200;
    pointer-events: auto;
    overflow: visible;
}

#clip-transform-box
{
    position: absolute;
    left: 50%;
    top: 50%;
    width: 120px;
    height: 80px;
    border: 2px solid rgba(141, 97, 255, 0.95);
    box-shadow:
        0 0 10px rgba(141, 97, 255, 0.52),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    transform-origin: center center;
    cursor: move;
    touch-action: none;
    pointer-events: auto;
}

#clip-transform-overlay.main-transform-active #clip-transform-box
{
    border-color: rgba(212, 171, 93, 0.96);
    box-shadow:
        0 0 12px rgba(212, 171, 93, 0.48),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

#clip-transform-overlay.main-transform-active .clip-transform-handle
{
    border-color: rgba(212, 171, 93, 0.96);
}

#clip-transform-overlay.main-transform-active #clip-transform-panel
{
    border-color: rgba(212, 171, 93, 0.46);
}

#clip-transform-overlay.main-transform-active #clip-transform-panel button,
#clip-transform-overlay.main-transform-active #clip-transform-panel select
{
    color: #e1c58c;
    border-color: rgba(212, 171, 93, 0.5);
}

#clip-transform-panel button:disabled,
#clip-transform-panel select:disabled
{
    opacity: 0.42;
    cursor: not-allowed;
}

.timeline-clip.audio-cancel-region
{
    background: rgba(180, 72, 190, 0.86);
    border: 1px solid rgba(235, 145, 255, 0.92);
    box-shadow: inset 0 0 0 1px rgba(80, 16, 96, 0.35);
}

.timeline-clip.audio-fade-region
{
    background: rgba(58, 142, 207, 0.86);
    border: 1px solid rgba(151, 215, 255, 0.92);
    box-shadow: inset 0 0 0 1px rgba(12, 58, 95, 0.35);
}

.audio-cancel-label,
.audio-fade-label
{
    position: absolute;
    inset: 6px 8px auto 8px;
    color: #f1f8ff;
    font: 11px monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.clip-transform-handle
{
    position: absolute;
    width: 24px;
    height: 24px;
    border: 2px solid rgba(141, 97, 255, 0.95);
    background: rgba(8, 12, 19, 0.88);
    box-sizing: border-box;
    touch-action: none;
    pointer-events: auto;
    z-index: 5;
}

.clip-crop-handle
{
    position: absolute;
    border: 2px solid rgba(141, 97, 255, 0.92);
    background: rgba(8, 12, 19, 0.78);
    box-shadow: 0 0 8px rgba(141, 97, 255, 0.5);
    box-sizing: border-box;
    touch-action: none;
    pointer-events: auto;
    z-index: 6;
}

.clip-crop-left,
.clip-crop-right
{
    width: 12px;
    height: 36px;
    top: 50%;
    margin-top: -18px;
    cursor: ew-resize;
}

.clip-crop-left
{
    left: 5px;
}

.clip-crop-right
{
    right: 5px;
}

.clip-crop-top,
.clip-crop-bottom
{
    width: 36px;
    height: 12px;
    left: 50%;
    margin-left: -18px;
    cursor: ns-resize;
}

.clip-crop-top
{
    top: 5px;
    margin-left: 26px;
}

.clip-crop-bottom
{
    bottom: 5px;
}

.clip-crop-top-left,
.clip-crop-top-right,
.clip-crop-bottom-left,
.clip-crop-bottom-right
{
    width: 14px;
    height: 14px;
}

.clip-crop-top-left
{
    left: 5px;
    top: 5px;
    cursor: nwse-resize;
}

.clip-crop-top-right
{
    right: 5px;
    top: 5px;
    cursor: nesw-resize;
}

.clip-crop-bottom-left
{
    left: 5px;
    bottom: 5px;
    cursor: nesw-resize;
}

.clip-crop-bottom-right
{
    right: 5px;
    bottom: 5px;
    cursor: nwse-resize;
}

.clip-transform-proxy
{
    display: none;
    z-index: 3;
    box-shadow: 0 0 12px rgba(141, 97, 255, 0.75);
}

.clip-transform-proxy.visible
{
    display: block;
}

.clip-crop-proxy
{
    display: none;
    z-index: 7;
    box-shadow: 0 0 12px rgba(141, 97, 255, 0.8);
}

.clip-crop-proxy.visible
{
    display: block;
}

.clip-crop-proxy.clip-crop-left,
.clip-crop-proxy.clip-crop-right,
.clip-crop-proxy.clip-crop-top,
.clip-crop-proxy.clip-crop-bottom,
.clip-crop-proxy.clip-crop-top-left,
.clip-crop-proxy.clip-crop-top-right,
.clip-crop-proxy.clip-crop-bottom-left,
.clip-crop-proxy.clip-crop-bottom-right
{
    right: auto;
    bottom: auto;
    top: auto;
    left: auto;
    margin: 0;
}

.clip-transform-scale-xy
{
    right: -42px;
    bottom: -42px;
    cursor: nwse-resize;
}

.clip-transform-scale-x
{
    right: -42px;
    top: 50%;
    margin-top: -12px;
    cursor: ew-resize;
}

.clip-transform-scale-y
{
    left: 50%;
    bottom: -42px;
    margin-left: -12px;
    cursor: ns-resize;
}

.clip-transform-proxy.clip-transform-scale-x,
.clip-transform-proxy.clip-transform-scale-y,
.clip-transform-proxy.clip-transform-scale-xy,
.clip-transform-proxy.clip-transform-rotate
{
    right: auto;
    bottom: auto;
    top: auto;
    left: auto;
    margin: 0;
}

.clip-transform-rotate
{
    left: 50%;
    top: -44px;
    margin-left: -12px;
    border-radius: 50%;
    cursor: grab;
}

.clip-transform-proxy.clip-transform-rotate
{
    left: auto;
    top: auto;
    margin: 0;
}

#clip-transform-panel
{
    position: absolute;
    left: 8px;
    top: 8px;
    display: flex;
    gap: 6px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    pointer-events: auto;
    z-index: 8;
}

#clip-transform-panel select,
#clip-transform-panel button
{
    background: transparent;
    color: var(--mobile-text);
    border: 1px solid rgba(151, 161, 184, 0.28);
    border-radius: 5px;
    padding: 5px 7px;
    font: 700 12px Inter, "Segoe UI", Arial, sans-serif;
}

#clip-transform-panel select:hover,
#clip-transform-panel button:hover
{
    color: #ffffff;
    border-color: rgba(141, 97, 255, 0.6);
    background: rgba(141, 97, 255, 0.16);
}

#clip-transform-panel select:focus,
#clip-transform-panel button:focus-visible
{
    outline: none;
    border-color: rgba(141, 97, 255, 0.82);
    box-shadow: 0 0 0 2px rgba(141, 97, 255, 0.2);
}

#clip-transform-overlay.main-transform-active #clip-transform-panel select:hover,
#clip-transform-overlay.main-transform-active #clip-transform-panel button:hover
{
    color: #fff3d7;
    border-color: rgba(212, 171, 93, 0.66);
    background: rgba(212, 171, 93, 0.16);
}


#timeline-context-menu
{
    position:fixed;
    display:none;

    background:#0c0c0c;
    border:1px solid rgba(151, 161, 184, 0.28);

    min-width:220px;
    max-width: calc(100vw - 16px);
    max-height: var(--timeline-context-max-height, min(80vh, 560px));
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index:2147483647;
}

.ctx-item
{
    padding:6px 10px;
    cursor:pointer;
    color:#d9dced;
}

.ctx-item:hover
{
    background:rgba(141, 97, 255, 0.18);
}

.ctx-submenu
{
    position: relative;
}

.ctx-submenu > .ctx-item::after
{
    content: ">";
    float: right;
    opacity: 0.72;
}

.ctx-submenu-panel
{
    display: none;
    position: fixed;
    min-width: 220px;
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    background: linear-gradient(180deg, rgba(17, 23, 34, 0.99), rgba(9, 13, 20, 0.99));
    border: 1px solid rgba(151, 161, 184, 0.28);
    border-radius: 7px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.48);
    z-index: 2147483647;
}

.ctx-submenu.ctx-submenu-open > .ctx-submenu-panel
{
    display: block;
}

.ctx-sep
{
    height:1px;
    background:rgba(151, 161, 184, 0.18);
}

.ctx-control
{
    padding: 8px 10px;
    color: #aeb4c4;
}

.ctx-control label
{
    display: block;
    margin: 4px 0;
    font: 11px monospace;
}

.ctx-info-line
{
    margin: 3px 0 6px;
    color: #ffffff;
    font: 11px monospace;
    opacity: 0.9;
    text-align: left;
}

.ctx-control textarea,
.ctx-control input,
.ctx-control select,
.ctx-control button
{
    background: #030303;
    color: #d9dced;
    border: 1px solid rgba(151, 161, 184, 0.28);
    font: 12px monospace;
    box-sizing: border-box;
}

.ctx-control textarea,
.ctx-control input[type="text"],
.ctx-control select
{
    width: 100%;
}

.ctx-control textarea
{
    min-height: 70px;
    resize: vertical;
}

.ctx-control-row
{
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.ctx-control-row input[type="number"]
{
    width: 72px;
}

.ctx-control-row input[type="range"]
{
    flex: 1;
    min-width: 86px;
}

.ctx-control-grid
{
    display: grid;
    grid-template-columns: auto 64px auto 64px;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

.ctx-control-grid label
{
    margin: 0;
}

.ctx-control-grid input[type="number"]
{
    width: 64px;
}

.ctx-check-row
{
    display: flex !important;
    align-items: center;
    gap: 6px;
}

.timeline-clip.text-clip
{
    background: linear-gradient(135deg, rgba(79, 52, 155, 0.88), rgba(40, 18, 70, 0.88));
    border: 1px solid rgba(171, 139, 255, 0.78);
}

.text-clip-label
{
    position: absolute;
    inset: 6px 8px;
    color: #ffffff;
    font: 12px monospace;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    pointer-events: none;
}


.asset-item
{
    display: flex;
    align-items: center;
    gap: 10px;

    padding: 8px;
    margin: 6px;

    background: rgba(141, 97, 255, 0.08);
    border: 1px solid rgba(151, 161, 184, 0.18);
    border-radius: 6px;

    cursor: pointer;
}

.asset-item:hover
{
    background: rgba(141, 97, 255, 0.16);
}

.asset-thumb
{
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
}

#asset-panel
{
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: calc(var(--mobile-bottom-tools-height) + var(--mobile-bottom-chrome-gap, 0px));
    z-index: 2450;
    width: 100vw !important;
    max-width: 100vw !important;
    box-sizing: border-box;
    height: var(--mobile-asset-panel-height);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    border-top: 1px solid var(--mobile-line);
    border-bottom: 1px solid rgba(151, 161, 184, 0.08);
    background: rgba(9, 13, 20, 0.74);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 -24px 44px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
    overflow: hidden;
}

#asset-panel.templates-folded
{
    height: 28px;
    grid-template-rows: 28px 0;
}

#asset-panel.templates-folded #asset-content
{
    display: none;
}

#asset-panel-close
{
    position: absolute;
    top: 4px;
    right: 8px;
    z-index: 2;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--mobile-muted);
    cursor: pointer;
    font: 800 18px/1 Inter, "Segoe UI", Arial, sans-serif;
}

#asset-panel-close:hover,
#asset-panel-close:focus-visible
{
    color: #f4f1ff;
    outline: none;
    background: rgba(141, 97, 255, 0.16);
    box-shadow:
        0 0 0 1px rgba(171, 139, 255, 0.18) inset,
        0 0 14px rgba(141, 97, 255, 0.24);
}

#asset-tabs
{
    display: flex;
    align-items: stretch;
    gap: 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border-bottom: 1px solid rgba(151, 161, 184, 0.08);
    background: rgba(7, 11, 17, 0.42);
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
    padding-right: 40px;
}

.asset-tab
{
    flex: 1 1 0;
    min-width: 0;
    display: grid;
    place-items: center;
    padding: 9px 12px 8px;
    border: 0 !important;
    border-right: 1px solid rgba(151, 161, 184, 0.07) !important;
    background: transparent !important;
    color: var(--mobile-muted) !important;
    box-shadow: none !important;
    font: 700 12px/1.1 Inter, "Segoe UI", Arial, sans-serif !important;
    text-align: center;
    cursor: pointer;
    position: relative;
    isolation: isolate;
    scroll-snap-align: start;
}

#asset-tabs .asset-tab[data-tab="face-effects"],
#asset-tabs .asset-tab[data-tab="voice-effects"],
#asset-tabs .asset-tab[data-tab="timelines"]
{
    min-width: 68px;
}

.asset-tab:hover,
.asset-tab.active
{
    color: var(--mobile-purple) !important;
    background: transparent;
    text-shadow:
        0 0 8px rgba(167, 125, 255, 0.72),
        0 0 16px rgba(151, 111, 255, 0.3);
}

.asset-tab.active
{
    background: transparent !important;
    box-shadow:
        inset 0 -2px 0 rgba(139, 92, 246, 0.9),
        0 0 18px rgba(124, 84, 255, 0.2) !important;
}

#asset-tabs .asset-tab[data-tab="transitions"],
#asset-tabs .asset-tab[data-tab="characters"],
#asset-tabs .asset-tab[data-tab="tts"],
#asset-tabs .asset-tab[data-tab="loaded"],
#asset-tabs .asset-tab[data-tab="weights"]
{
    display: none !important;
}

#asset-content
{
    min-height: 0;
    overflow: hidden;
}

.asset-panel-content
{
    height: 100%;
    min-height: 0;
    display: none;
    overflow: auto;
}

.asset-panel-content.active
{
    display: block;
}

#tab-templates.active,
#tab-used-templates.active,
#tab-still-assets.active,
#tab-used-assets.active,
#tab-face-effects.active,
#tab-voice-effects.active,
#tab-timelines.active
{
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.voice-fx-header > div
{
    min-width: 0;
    display: grid;
    gap: 3px;
}

.voice-fx-header > div > span
{
    overflow: hidden;
    color: var(--mobile-muted);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.voice-fx-live-badge
{
    padding: 4px 7px;
    border: 1px solid rgba(99, 230, 190, 0.35);
    border-radius: 999px;
    background: rgba(99, 230, 190, 0.08);
    color: #72efc4;
    font: 800 9px/1 Inter, "Segoe UI", sans-serif;
    letter-spacing: 0.08em;
}

.voice-effect-grid
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
    padding: 12px;
    overflow: auto;
}

.voice-effect-card
{
    min-width: 0;
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 11px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--voice-fx-color) 38%, transparent);
    border-radius: 10px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--voice-fx-color) 10%, #101722), #0b1018 72%);
    color: #edf0f8;
    text-align: left;
    cursor: pointer;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

.voice-effect-card:hover,
.voice-effect-card:focus-visible
{
    outline: none;
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--voice-fx-color) 72%, transparent);
    box-shadow: 0 10px 26px color-mix(in srgb, var(--voice-fx-color) 15%, transparent);
}

.voice-effect-card.dragging
{
    opacity: 0.55;
}

.voice-effect-card-drag-ghost
{
    position: fixed;
    top: 0;
    left: 0;
    z-index: 10000;
    width: min(280px, 72vw);
    pointer-events: none;
    opacity: 0.9;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}

.voice-effect-card.locked
{
    filter: saturate(0.72);
}

.voice-effect-visual
{
    height: 66px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: color-mix(in srgb, var(--voice-fx-color) 12%, #080d14);
}

.voice-effect-visual i
{
    position: absolute;
    z-index: 1;
    color: var(--voice-fx-color);
    font: 900 20px/1 Inter, sans-serif;
    text-shadow: 0 0 14px var(--voice-fx-color);
}

.voice-effect-visual b
{
    width: 3px;
    height: 13px;
    border-radius: 99px;
    background: var(--voice-fx-color);
    opacity: 0.35;
}

.voice-effect-visual b:nth-of-type(2), .voice-effect-visual b:nth-of-type(4) { height: 31px; }
.voice-effect-visual b:nth-of-type(3) { height: 48px; }

.voice-effect-copy
{
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 5px;
}

.voice-effect-copy strong { font-size: 13px; }
.voice-effect-copy small { min-height: 28px; color: var(--mobile-muted); font-size: 10px; line-height: 1.35; }
.voice-effect-footer { display: flex; align-items: center; justify-content: space-between; gap: 7px; color: var(--voice-fx-color); font-size: 9px; font-weight: 800; }
.voice-effect-footer em { padding: 3px 5px; border-radius: 4px; background: color-mix(in srgb, var(--voice-fx-color) 18%, transparent); font-style: normal; }

.timeline-clip.audio-effect-clip
{
    border-color: rgba(245, 200, 75, 0.85) !important;
    background: linear-gradient(135deg, rgba(245, 200, 75, 0.26), rgba(141, 97, 255, 0.28)) !important;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 0 12px rgba(245, 200, 75, 0.14);
}

.timeline-manager-header
{
    align-items: center;
}

#timeline-manager-active-name
{
    color: var(--mobile-muted);
    font: 700 12px/1.2 Inter, "Segoe UI", Arial, sans-serif;
}

.timeline-manager-list
{
    display: grid;
    align-content: start;
    gap: 8px;
    padding: 12px 20px 18px;
    overflow: auto;
}

.timeline-manager-row
{
    display: grid;
    grid-template-columns: minmax(160px, 1fr) auto auto auto;
    gap: 8px;
    align-items: center;
    min-height: 42px;
    padding: 7px;
    border: 1px solid rgba(151, 161, 184, 0.14);
    border-radius: 7px;
    background: rgba(8, 12, 18, 0.72);
}

.timeline-manager-row.active
{
    border-color: rgba(139, 92, 246, 0.72);
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.2);
}

.timeline-manager-select,
.timeline-manager-icon
{
    min-height: 30px;
    border: 1px solid rgba(151, 161, 184, 0.18);
    border-radius: 6px;
    background: rgba(12, 18, 27, 0.82);
    color: var(--mobile-text);
    font: 700 12px/1 Inter, "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}

.timeline-manager-select
{
    text-align: left;
    padding: 0 10px;
}

.timeline-manager-icon
{
    padding: 0 9px;
    color: var(--mobile-muted);
}

.timeline-manager-icon:disabled
{
    opacity: 0.45;
    cursor: not-allowed;
}

.face-effect-color-control
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    color: var(--mobile-muted);
    font: 700 12px/1 Inter, "Segoe UI", Arial, sans-serif;
}

.face-effect-color-control input
{
    width: 32px;
    height: 26px;
    padding: 0;
    border: 1px solid rgba(151, 161, 184, 0.22);
    border-radius: 6px;
    background: rgba(8, 12, 18, 0.72);
}

.face-effect-color-control input.face-effect-intensity-input
{
    width: 48px;
    padding: 0 5px;
    color: var(--mobile-text);
}

.face-effect-grid
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    min-height: 0;
    overflow: auto;
    padding: 10px 16px 18px;
    touch-action: pan-y;
}

.face-effect-card
{
    display: grid;
    align-content: start;
    gap: 7px;
    min-height: 82px;
    padding: 11px 12px;
    border: 1px solid rgba(151, 161, 184, 0.18);
    border-radius: 8px;
    background: rgba(11, 16, 24, 0.74);
    color: var(--mobile-text);
    text-align: left;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    touch-action: pan-y;
}

.face-effect-card strong
{
    font: 800 13px/1.15 Inter, "Segoe UI", Arial, sans-serif;
}

.face-effect-card span
{
    color: var(--mobile-muted);
    font: 600 11px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

.face-effect-card-texture
{
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
}

.face-effect-card-texture img
{
    grid-row: span 2;
    width: 38px;
    height: 52px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(238, 244, 248, 0.9);
    padding: 4px;
}

.face-effect-update-button
{
    min-height: 28px;
    padding: 0 10px;
    font: 800 11px/1 Inter, "Segoe UI", Arial, sans-serif;
}

.template-panel-header
{
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
    padding: 9px 16px 7px;
    color: var(--mobile-text);
    font: 700 13px/1.2 Inter, "Segoe UI", Arial, sans-serif;
}

.template-panel-header strong
{
    margin-right: auto;
    color: #d8dbe6;
    text-shadow: 0 0 10px rgba(141, 97, 255, 0.18);
}

.template-panel-header .gui-button
{
    min-height: 28px;
    border: 0 !important;
    border-radius: 7px;
    padding: 0 12px;
    background: transparent !important;
    color: var(--mobile-purple) !important;
    box-shadow: none !important;
    font: 700 12px/1 Inter, "Segoe UI", Arial, sans-serif !important;
    text-shadow:
        0 0 8px rgba(167, 125, 255, 0.48),
        0 0 16px rgba(151, 111, 255, 0.22) !important;
}

.template-search-input
{
    min-height: 30px;
    width: clamp(180px, 18vw, 280px);
    border: 1px solid rgba(151, 161, 184, 0.22);
    border-radius: 7px;
    background: rgba(7, 11, 17, 0.82);
    color: #e6e8f2;
    padding: 0 10px;
    font: 700 12px/1 Inter, "Segoe UI", Arial, sans-serif;
    outline: none;
}

.template-search-input::placeholder
{
    color: rgba(196, 202, 224, 0.56);
}

.template-search-input:focus
{
    border-color: rgba(171, 139, 255, 0.6);
    box-shadow: 0 0 0 2px rgba(141, 97, 255, 0.16);
}

.template-kind-tabs
{
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid rgba(151, 161, 184, 0.12);
    border-radius: 8px;
    background: rgba(7, 11, 17, 0.54);
}

.template-kind-tabs button
{
    min-height: 24px;
    border: 0;
    border-radius: 6px;
    padding: 0 10px;
    background: transparent;
    color: var(--mobile-muted);
    font: 700 11px/1 Inter, "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}

.template-kind-tabs button.active
{
    background: rgba(141, 97, 255, 0.2);
    color: #d8ceff;
    box-shadow: inset 0 0 0 1px rgba(171, 139, 255, 0.24);
}

.template-kind-tabs button:hover,
.template-kind-tabs button:focus-visible
{
    color: #eeeaff;
    outline: none;
}

.template-card-grid
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    grid-auto-rows: 108px;
    min-height: 0;
    gap: 7px;
    padding: 8px 16px 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    scrollbar-width: none;
    scrollbar-color: rgba(141, 97, 255, 0.68) rgba(8, 12, 18, 0.74);
}

.template-card-grid::-webkit-scrollbar
{
    width: 0;
    height: 0;
}

.template-card
{
    min-height: 0;
    height: 108px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 9px;
    border: 1px solid rgba(151, 161, 184, 0.12);
    border-radius: 7px;
    background: rgba(10, 15, 23, 0.58);
    color: var(--mobile-text);
    text-align: left;
    cursor: grab;
    touch-action: pan-y;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.035),
        0 8px 18px rgba(0, 0, 0, 0.16);
}

.template-card:active
{
    cursor: grabbing;
}

.template-card.touch-drag-ready
{
    outline: 2px solid rgba(255,255,255,0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        0 0 18px rgba(132,88,255,0.75);
}

.template-card-drag-ghost
{
    position: fixed;
    left: 0;
    top: 0;
    width: min(250px, calc(100vw - 24px));
    z-index: 20000;
    opacity: 0.9;
    pointer-events: none;
    transform: translate(-9999px, -9999px);
    translate: -50% -50%;
    box-shadow: 0 0 18px rgba(132,88,255,0.85);
}

.template-card:hover,
.template-card:focus-visible
{
    border-color: rgba(171, 139, 255, 0.5);
    background: rgba(13, 18, 28, 0.78);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.055),
        0 0 16px rgba(124, 84, 255, 0.18);
    outline: none;
}

.template-card.locked,
.asset-browser-card.locked
{
    cursor: pointer;
    border-color: rgba(255, 201, 92, 0.42);
    background:
        linear-gradient(135deg, rgba(255, 201, 92, 0.1), rgba(10, 15, 23, 0.76)),
        rgba(10, 15, 23, 0.72);
}

.template-card.locked .template-card-summary,
.asset-browser-card.locked .asset-browser-preview
{
    opacity: 0.72;
}

.template-card.locked .template-card-action
{
    display: block;
    color: #ffd98c;
}

.template-card-top
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.template-card-top strong
{
    color: #eef0f7;
    font-size: 13px;
    line-height: 1.2;
}

.template-tier
{
    flex: 0 0 auto;
    padding: 3px 6px;
    border-radius: 999px;
    background: rgba(141, 97, 255, 0.16);
    color: #cdbfff;
    font: 700 10px/1 Inter, "Segoe UI", Arial, sans-serif;
    text-transform: uppercase;
}

.template-tier.pro
{
    background: rgba(255, 201, 92, 0.14);
    color: #ffd98c;
}

.template-card-meta,
.template-card-summary,
.template-card-action,
.template-empty
{
    color: var(--mobile-muted);
    font: 12px/1.3 Inter, "Segoe UI", Arial, sans-serif;
}

.template-card-summary
{
    min-height: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.template-card-action
{
    margin-top: auto;
    color: #c9c3ff;
    display: none;
}

.template-empty
{
    padding: 14px 10px;
}

.asset-browser-select
{
    min-height: 32px;
    min-width: 150px;
    border: 1px solid rgba(151, 161, 184, 0.24);
    border-radius: 6px;
    background: rgba(7, 11, 17, 0.94);
    color: #d9dced;
    padding: 4px 8px;
    font: 12px/1.2 Inter, "Segoe UI", Arial, sans-serif;
}

.asset-browser-grid
{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    min-height: 0;
    gap: 8px;
    padding: 8px 10px 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
    scrollbar-width: thin;
}

.asset-browser-card
{
    min-height: 154px;
    display: grid;
    grid-template-rows: 92px auto auto;
    gap: 6px;
    padding: 8px;
    border: 1px solid rgba(151, 161, 184, 0.22);
    border-radius: 7px;
    background: rgba(13, 18, 27, 0.92);
    color: #d9dced;
    text-align: left;
    cursor: grab;
    touch-action: pan-y;
}

.asset-browser-card:active
{
    cursor: grabbing;
}

.asset-browser-card.touch-drag-ready
{
    outline: 2px solid rgba(255,255,255,0.9);
    box-shadow: 0 0 18px rgba(85, 214, 170, 0.62);
}

.asset-browser-card-drag-ghost
{
    position: fixed;
    left: 0;
    top: 0;
    width: min(180px, calc(100vw - 24px));
    z-index: 20000;
    opacity: 0.9;
    pointer-events: none;
    transform: translate(-9999px, -9999px);
    translate: -50% -50%;
    box-shadow: 0 0 18px rgba(85, 214, 170, 0.72);
}

.asset-browser-card:hover,
.asset-browser-card:focus-visible
{
    border-color: rgba(85, 214, 170, 0.58);
    background: rgba(23, 29, 43, 0.96);
    outline: none;
}

.asset-browser-preview
{
    width: 100%;
    height: 92px;
    object-fit: contain;
    border-radius: 5px;
    background:
        linear-gradient(45deg, rgba(255,255,255,0.055) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.055) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.055) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.055) 75%),
        rgba(5, 8, 13, 0.72);
    background-size: 18px 18px;
    background-position: 0 0, 0 9px, 9px -9px, -9px 0;
}

.asset-browser-card strong
{
    color: #ffffff;
    font: 700 12px/1.2 Inter, "Segoe UI", Arial, sans-serif;
}

.asset-browser-card span,
.asset-browser-empty
{
    color: #aeb4c2;
    font: 12px/1.3 Inter, "Segoe UI", Arial, sans-serif;
}

.asset-browser-empty
{
    padding: 14px 10px;
}

.timeline-clip[data-clip-label*="Beat"],
.timeline-clip[data-clip-kind="audio-reactive"]
{
    border-style: solid;
}

.timeline-clip.wrap-effect-clip,
.timeline-clip[data-clip-kind="wrap-effect"]
{
    background:
        linear-gradient(
            90deg,
            rgba(141, 97, 255, 0.16),
            rgba(141, 97, 255, 0.08)
        ),
        repeating-linear-gradient(
            135deg,
            rgba(141, 97, 255, 0.46) 0px,
            rgba(141, 97, 255, 0.46) 9px,
            rgba(66, 45, 122, 0.36) 9px,
            rgba(66, 45, 122, 0.36) 18px
        );
    border: 1px solid rgba(164, 130, 255, 0.72);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.08),
        inset 0 -14px 28px rgba(19, 12, 40, 0.28),
        0 0 12px rgba(141, 97, 255, 0.22);
}

.wrap-effect-label
{
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0 8px;
    color: #ffffff;
    font: 700 12px/1.15 monospace;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

#mobile-bottom-tools button[onclick="mobileMenuAction(openAudioFile)"]
{
    display: none !important;
}

#zoom-workspace
{
    width: 100%;
    height: 1024px; /* visible viewport */
    overflow: auto;
    background: #000;
    border: 1px solid rgba(151, 161, 184, 0.18);
}

#zoom-inner
{
    width: 5000px;
    height: 5000px;
    position: relative;
}

#zoom-workspace.hidden
{
    display: none;
}

#shader-clip-editor.hidden
{
    display: none;
}

#wrap-effect-editor.hidden
{
    display: none;
}

#project-save-dialog.hidden
{
    display: none;
}

#project-transfer-dialog.hidden
{
    display: none;
}

#ai-effect-dialog.hidden,
#ai-project-agent-dialog.hidden
{
    display: none;
}

#ai-vision-effect-dialog.hidden
{
    display: none;
}

#speech-clip-dialog.hidden,
#preferences-dialog.hidden,
#privacy-policy-dialog.hidden,
#profile-billing-dialog.hidden
{
    display: none;
}

#face-effect-editor.hidden
{
    display: none;
}

#project-save-dialog,
#project-transfer-dialog
{
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 6, 11, 0.78);
    backdrop-filter: blur(2px);
}

#ai-effect-dialog,
#ai-vision-effect-dialog
{
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(3, 6, 11, 0.78);
    backdrop-filter: blur(2px);
}

#ai-project-agent-dialog
{
    position: relative;
    display: block;
    width: min(980px, calc(100% - 24px));
    margin: 12px auto 0;
    padding: 0;
    box-sizing: border-box;
}

#face-effect-editor
{
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 16px;
    box-sizing: border-box;
    background: transparent;
    pointer-events: none;
}

#speech-clip-dialog,
#preferences-dialog,
#privacy-policy-dialog,
#profile-billing-dialog
{
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    background: rgba(3, 6, 11, 0.78);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

#privacy-policy-panel
{
    width: min(780px, calc(100vw - 24px));
    max-height: min(92dvh, 880px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--mobile-line);
    border-radius: 11px;
    background: linear-gradient(180deg, rgba(17, 23, 34, 0.995), rgba(8, 12, 19, 0.995));
    box-shadow: 0 24px 76px rgba(0, 0, 0, 0.62), 0 0 42px rgba(124, 84, 255, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: var(--mobile-text);
    font: 13px/1.5 Inter, "Segoe UI", Arial, sans-serif;
}

.privacy-policy-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(151, 161, 184, 0.11);
}

.privacy-policy-kicker
{
    margin-bottom: 4px;
    color: var(--mobile-purple);
    font: 800 9px/1 Inter, "Segoe UI", Arial, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#privacy-policy-title
{
    margin: 0;
    color: #f4f2ff;
    font-size: 20px;
    line-height: 1.2;
}

.privacy-policy-body
{
    min-height: 0;
    overflow: auto;
    padding: 16px 18px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(141, 97, 255, 0.55) rgba(12, 17, 26, 0.96);
}

.privacy-policy-body::-webkit-scrollbar { width: 8px; }
.privacy-policy-body::-webkit-scrollbar-track { background: rgba(12, 17, 26, 0.96); }
.privacy-policy-body::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(141, 97, 255, 0.55); }

.privacy-policy-hero
{
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    align-items: center;
    gap: 13px;
    padding: 14px;
    border: 1px solid rgba(139, 92, 246, 0.34);
    border-radius: 9px;
    background: linear-gradient(110deg, rgba(124, 58, 237, 0.15), rgba(34, 199, 216, 0.045));
}

.privacy-policy-shield
{
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(124, 58, 237, 0.2);
    color: #c4b5fd;
    font-size: 24px;
}

.privacy-policy-hero strong { color: #f1edff; font-size: 14px; }
.privacy-policy-hero p { margin: 3px 0 0; color: #afb5c7; }

.privacy-policy-grid
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.privacy-policy-card
{
    padding: 14px;
    border: 1px solid rgba(151, 161, 184, 0.13);
    border-radius: 8px;
    background: rgba(15, 21, 31, 0.68);
}

.privacy-policy-number
{
    color: #9f83ff;
    font: 800 9px/1 ui-monospace, Consolas, monospace;
    letter-spacing: 0.1em;
}

.privacy-policy-card h3,
.privacy-policy-summary h3
{
    margin: 7px 0 7px;
    color: #eae7f8;
    font-size: 13px;
}

.privacy-policy-card p
{
    margin: 0 0 8px;
    color: #aeb4c5;
    font-size: 11px;
}

.privacy-policy-card p:last-child { margin-bottom: 0; }

.privacy-policy-summary
{
    margin-top: 12px;
    padding: 14px;
    border-radius: 8px;
    background: rgba(7, 11, 17, 0.54);
}

.privacy-policy-summary ul
{
    display: grid;
    gap: 5px;
    margin: 0;
    padding-left: 18px;
    color: #b7bdcc;
    font-size: 11px;
}

.privacy-policy-caution
{
    margin: 11px 0 0;
    padding-top: 10px;
    border-top: 1px solid rgba(151, 161, 184, 0.1);
    color: #8f97aa;
    font-size: 10px;
}

#speech-clip-panel
{
    width: min(620px, calc(100vw - 24px));
    max-height: min(90dvh, 780px);
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--mobile-line);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(17, 23, 34, 0.99), rgba(8, 12, 19, 0.99));
    box-shadow:
        0 24px 72px rgba(0, 0, 0, 0.56),
        0 0 32px rgba(124, 84, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: var(--mobile-text);
    font: 13px/1.4 Inter, "Segoe UI", Arial, sans-serif;
}

.speech-clip-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid rgba(151, 161, 184, 0.1);
}

.speech-clip-kicker
{
    margin-bottom: 3px;
    color: var(--mobile-purple);
    font: 800 10px/1.1 Inter, "Segoe UI", Arial, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#speech-clip-title
{
    color: #f4f2ff;
    font-size: 18px;
    font-weight: 780;
}

.speech-clip-tabs
{
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid rgba(151, 161, 184, 0.09);
    background: rgba(7, 11, 17, 0.48);
}

.speech-clip-tabs button
{
    min-height: 42px;
    border: 0;
    border-right: 1px solid rgba(151, 161, 184, 0.08);
    background: transparent;
    color: var(--mobile-muted);
    cursor: pointer;
    font: 760 13px/1 Inter, "Segoe UI", Arial, sans-serif;
}

.speech-clip-tabs button:hover,
.speech-clip-tabs button.active
{
    color: #d8ceff;
    background: rgba(141, 97, 255, 0.09);
}

.speech-clip-tabs button.active
{
    box-shadow: inset 0 -2px 0 rgba(139, 92, 246, 0.95);
}

.speech-clip-source-row
{
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(151, 161, 184, 0.08);
    color: var(--mobile-muted);
    background: rgba(141, 97, 255, 0.035);
}

.speech-clip-source-row strong
{
    min-width: 0;
    overflow: hidden;
    color: #dfe2ed;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.speech-clip-pane
{
    display: none;
    min-height: 0;
    overflow: auto;
    padding: 16px;
    gap: 9px;
}

.speech-clip-pane.active
{
    display: grid;
}

.speech-clip-pane > label:not(.speech-clip-check)
{
    color: #d5d8e3;
    font-weight: 720;
}

.speech-clip-pane textarea,
.speech-clip-pane input[type="text"],
.speech-clip-pane input[type="url"],
.speech-clip-pane input[type="number"],
.speech-clip-pane input[type="file"],
.speech-clip-pane select
{
    width: 100%;
    min-height: 38px;
    box-sizing: border-box;
    border: 1px solid rgba(151, 161, 184, 0.24);
    border-radius: 7px;
    background: rgba(4, 7, 12, 0.92);
    color: #e6e7ee;
    padding: 8px 10px;
    font: 13px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

.speech-clip-pane textarea
{
    min-height: 104px;
    resize: vertical;
}

.speech-clip-pane textarea:focus,
.speech-clip-pane input:focus,
.speech-clip-pane select:focus
{
    outline: 1px solid rgba(141, 97, 255, 0.8);
    border-color: rgba(141, 97, 255, 0.72);
    box-shadow: 0 0 16px rgba(141, 97, 255, 0.14);
}

.speech-clip-check
{
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    padding: 10px;
    border: 1px solid rgba(151, 161, 184, 0.14);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.025);
    cursor: pointer;
}

.speech-clip-check input
{
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--mobile-purple);
}

.speech-clip-consent
{
    border-color: rgba(141, 97, 255, 0.28);
}

.speech-clip-help
{
    margin: 0;
    color: var(--mobile-muted);
    font-size: 12px;
}

.speech-clip-actions
{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.speech-clip-primary,
.speech-clip-secondary
{
    min-height: 38px;
    border-radius: 7px;
    padding: 8px 13px;
    cursor: pointer;
    color: #eeebff;
    font: 760 13px/1 Inter, "Segoe UI", Arial, sans-serif;
}

.speech-clip-primary
{
    border: 1px solid rgba(159, 123, 255, 0.74);
    background: linear-gradient(180deg, rgba(141, 97, 255, 0.48), rgba(103, 66, 210, 0.38));
}

.speech-clip-secondary
{
    border: 1px solid rgba(151, 161, 184, 0.25);
    background: rgba(18, 24, 34, 0.88);
}

.speech-clip-primary:hover,
.speech-clip-secondary:hover
{
    border-color: rgba(178, 151, 255, 0.82);
    filter: brightness(1.1);
}

.speech-clip-primary:disabled,
.speech-clip-secondary:disabled,
.speech-clip-pane input:disabled,
.speech-clip-pane select:disabled,
.speech-clip-pane textarea:disabled
{
    cursor: not-allowed;
    opacity: 0.48;
}

#speech-clip-status
{
    min-height: 18px;
    padding: 10px 16px 13px;
    border-top: 1px solid rgba(151, 161, 184, 0.08);
    color: var(--mobile-muted);
    font-size: 12px;
}

#speech-clip-status[data-state="busy"]
{
    color: #cfc3ff;
}

#speech-clip-status[data-state="success"]
{
    color: #9ee6bd;
}

#speech-clip-status[data-state="error"]
{
    color: #ff9aab;
}

body.speech-clip-dialog-open
{
    overflow: hidden;
}

@media (max-width: 620px)
{
    #speech-clip-dialog
    {
        align-items: flex-end;
        padding: 8px;
    }

    #speech-clip-panel
    {
        width: 100%;
        max-height: calc(100dvh - 16px);
        border-radius: 12px 12px 8px 8px;
    }

    .speech-clip-header
    {
        padding: 13px;
    }

    .speech-clip-pane
    {
        padding: 13px;
    }
}

#preferences-panel
{
    width: min(560px, calc(100vw - 24px));
    max-height: min(86vh, 680px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--mobile-line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(17, 23, 34, 0.98), rgba(10, 15, 23, 0.98));
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: var(--mobile-text);
    font: 13px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

.preferences-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 14px 10px;
    border-bottom: 1px solid rgba(151, 161, 184, 0.08);
}

#preferences-title
{
    color: #f0f2f8;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: 0;
}

.preferences-close
{
    min-height: 30px;
}

.preferences-tabs
{
    display: flex;
    border-bottom: 1px solid rgba(151, 161, 184, 0.08);
    background: rgba(7, 11, 17, 0.42);
}

.preferences-tab
{
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    border: 0;
    border-right: 1px solid rgba(151, 161, 184, 0.07);
    background: transparent;
    color: var(--mobile-muted);
    cursor: pointer;
    font: 750 12px/1.1 Inter, "Segoe UI", Arial, sans-serif;
}

.preferences-tab:hover,
.preferences-tab.active
{
    color: var(--mobile-purple);
    text-shadow:
        0 0 8px rgba(167, 125, 255, 0.72),
        0 0 16px rgba(151, 111, 255, 0.3);
}

.preferences-tab.active
{
    box-shadow:
        inset 0 -2px 0 rgba(139, 92, 246, 0.9),
        0 0 18px rgba(124, 84, 255, 0.2);
}

.preferences-content
{
    display: none;
    min-height: 160px;
    overflow: auto;
    padding: 14px;
}

.preferences-content.active
{
    display: block;
}

.preferences-check-row
{
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(151, 161, 184, 0.14);
    border-radius: 8px;
    background: rgba(7, 11, 17, 0.46);
    cursor: pointer;
}

.preferences-check-row input
{
    width: 18px;
    height: 18px;
    margin: 1px 0 0;
    accent-color: var(--mobile-purple);
}

.preferences-check-row span
{
    display: grid;
    gap: 4px;
    min-width: 0;
}

.preferences-check-row strong
{
    color: #e7e8f1;
    font: 750 13px/1.2 Inter, "Segoe UI", Arial, sans-serif;
}

.preferences-check-row small,
.preferences-empty
{
    color: var(--mobile-muted);
    font: 600 12px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

.preferences-project-note
{
    margin: 0 0 10px;
    color: var(--mobile-muted);
    font: 600 12px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

.preferences-setting-row
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    padding: 12px;
    border: 1px solid rgba(151, 161, 184, 0.14);
    border-radius: 8px;
    background: rgba(7, 11, 17, 0.46);
}

.preferences-setting-row > span:first-child
{
    display: grid;
    gap: 4px;
    min-width: 0;
}

.preferences-setting-row strong
{
    color: #e7e8f1;
    font: 750 13px/1.2 Inter, "Segoe UI", Arial, sans-serif;
}

.preferences-setting-row small
{
    color: var(--mobile-muted);
    font: 600 12px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

.preferences-setting-row select
{
    width: 100%;
    min-width: 180px;
    min-height: 34px;
    padding: 6px 30px 6px 9px;
    border: 1px solid rgba(151, 161, 184, 0.22);
    border-radius: 6px;
    background: #101722;
    color: #e7e8f1;
    font: 650 12px/1.2 Inter, "Segoe UI", Arial, sans-serif;
}

.preferences-fixed-value
{
    color: #d9ccff;
    font: 700 12px/1.3 Inter, "Segoe UI", Arial, sans-serif;
    text-align: right;
}

#profile-billing-panel
{
    width: min(650px, calc(100vw - 24px));
    max-height: min(94dvh, 860px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--mobile-line);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(17, 23, 34, 0.99), rgba(8, 12, 19, 0.99));
    box-shadow:
        0 24px 72px rgba(0, 0, 0, 0.58),
        0 0 38px rgba(124, 84, 255, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: var(--mobile-text);
    font: 13px/1.4 Inter, "Segoe UI", Arial, sans-serif;
}

.profile-billing-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 16px;
    border-bottom: 1px solid rgba(151, 161, 184, 0.1);
}

.profile-billing-kicker
{
    margin-bottom: 3px;
    color: var(--mobile-purple);
    font: 800 10px/1 Inter, "Segoe UI", Arial, sans-serif;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

#profile-billing-title
{
    color: #f4f2ff;
    font-size: 18px;
    font-weight: 780;
}

.profile-billing-tabs
{
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border-bottom: 1px solid rgba(151, 161, 184, 0.09);
    background: rgba(7, 11, 17, 0.48);
}

.profile-billing-tab
{
    min-height: 42px;
    border: 0;
    border-right: 1px solid rgba(151, 161, 184, 0.08);
    background: transparent;
    color: var(--mobile-muted);
    cursor: pointer;
    font: 760 12px/1.15 Inter, "Segoe UI", Arial, sans-serif;
}

.profile-billing-tab:hover,
.profile-billing-tab.active
{
    color: #d8ceff;
    background: rgba(141, 97, 255, 0.09);
}

.profile-billing-tab.active
{
    box-shadow: inset 0 -2px 0 rgba(139, 92, 246, 0.95);
}

.profile-billing-body
{
    min-height: 0;
    overflow: hidden;
}

.profile-billing-content
{
    display: none;
    height: 100%;
    overflow: auto;
    padding: 16px;
}

.profile-billing-content.active
{
    display: block;
}

.profile-account-card
{
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(151, 161, 184, 0.14);
    border-radius: 9px;
    background: rgba(7, 11, 17, 0.48);
}

.profile-account-card > div:last-child
{
    display: grid;
    gap: 4px;
}

.profile-account-card strong
{
    color: #f3f2fa;
    font-size: 16px;
}

.profile-account-card small,
.profile-billing-note
{
    color: var(--mobile-muted);
}

.profile-account-avatar
{
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: linear-gradient(135deg, #8d61ff, #22c7d8);
    background-position: center;
    background-size: cover;
    color: #fff;
    font-weight: 800;
}

.profile-account-avatar.has-image
{
    color: transparent;
}

.profile-metric-grid
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.profile-metric
{
    display: grid;
    gap: 5px;
    padding: 13px;
    border: 1px solid rgba(151, 161, 184, 0.12);
    border-radius: 8px;
    background: rgba(15, 21, 31, 0.7);
}

.profile-metric span
{
    color: var(--mobile-muted);
    font-size: 11px;
}

.profile-metric strong
{
    color: #ece8ff;
    font-size: 15px;
}

.profile-support-card
{
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 12px 13px;
    border: 1px solid rgba(139, 92, 246, 0.32);
    border-radius: 8px;
    background: linear-gradient(110deg, rgba(124, 58, 237, 0.13), rgba(76, 55, 183, 0.05));
}

.profile-support-icon
{
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 9px;
    background: rgba(124, 58, 237, 0.18);
    color: #c4b5fd;
    font-size: 21px;
}

.profile-support-copy
{
    min-width: 0;
    display: grid;
    gap: 3px;
}

.profile-support-copy strong { color: #ece8ff; font-size: 13px; }
.profile-support-copy small { color: var(--mobile-muted); font-size: 10px; line-height: 1.35; }

.profile-support-button
{
    height: 32px;
    padding: 0 13px;
    border: 1px solid rgba(167, 139, 250, 0.5);
    border-radius: 6px;
    background: rgba(124, 58, 237, 0.16);
    color: #d8ccff;
    cursor: pointer;
    font: 800 11px/1 Inter, "Segoe UI", sans-serif;
}

.profile-support-button:hover
{
    border-color: rgba(167, 139, 250, 0.85);
    background: rgba(124, 58, 237, 0.28);
}

.profile-billing-note
{
    margin: 12px 0 0;
    font-size: 12px;
    line-height: 1.45;
}

.profile-billing-admin-tools
{
    display: grid;
    gap: 16px;
    margin-top: 16px;
    padding: 14px;
    border: 1px solid rgba(139, 92, 246, 0.45);
    border-radius: 8px;
    background: rgba(124, 58, 237, 0.1);
}

.profile-admin-heading,
.profile-admin-actions
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.profile-vault-grid
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.profile-vault-asset
{
    min-width: 0;
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid rgba(139, 92, 246, 0.22);
    border-radius: 7px;
    background: rgba(7, 11, 17, 0.42);
    color: inherit;
    text-decoration: none;
}

.profile-vault-asset:hover { border-color: rgba(139, 92, 246, 0.58); background: rgba(139, 92, 246, 0.1); }
.profile-vault-asset > span { color: var(--mobile-muted); font-size: 9px; text-transform: uppercase; letter-spacing: 0.07em; }
.profile-vault-asset > strong { overflow: hidden; color: #72efc4; font: 800 13px/1.2 ui-monospace, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.profile-vault-usd-value { overflow: hidden; color: #f4f7ff; font: 700 12px/1.2 ui-monospace, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.profile-vault-asset > small { overflow: hidden; color: #8f97aa; font: 9px/1.2 ui-monospace, Consolas, monospace; text-overflow: ellipsis; white-space: nowrap; }
.profile-vault-asset.unavailable > strong { color: #ff8f9c; }
.profile-vault-updated { grid-column: 1 / -1; color: var(--mobile-muted); font-size: 9px; text-align: right; }
.profile-vault-loading { grid-column: 1 / -1; color: var(--mobile-muted); font-size: 11px; }
.profile-vault-loading.error { color: #ff8f9c; }

.profile-donation-page
{
    max-width: 560px;
    margin: 0 auto;
    display: grid;
    gap: 16px;
}

.profile-donation-hero
{
    padding: 22px;
    border: 1px solid rgba(141, 97, 255, 0.38);
    border-radius: 12px;
    background: radial-gradient(circle at 78% 0%, rgba(99, 230, 190, 0.16), transparent 42%), linear-gradient(145deg, rgba(141, 97, 255, 0.19), rgba(10, 15, 23, 0.92));
}

.profile-donation-hero > span { color: #72efc4; font: 800 9px/1 Inter, sans-serif; letter-spacing: 0.14em; }
.profile-donation-hero > strong { display: block; max-width: 420px; margin-top: 9px; color: #f8f5ff; font: 850 24px/1.08 Inter, sans-serif; }
.profile-donation-hero > p { max-width: 470px; margin: 10px 0 0; color: #9aa2b5; font-size: 12px; line-height: 1.5; }

.profile-donation-amounts
{
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}

.profile-donation-amounts button
{
    min-height: 48px;
    border: 1px solid rgba(151, 161, 184, 0.2);
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    color: #e9e7f3;
    cursor: pointer;
    font-size: 15px;
    font-weight: 850;
}

.profile-donation-amounts button.active
{
    border-color: #72efc4;
    background: rgba(99, 230, 190, 0.12);
    color: #72efc4;
    box-shadow: 0 0 16px rgba(99, 230, 190, 0.12);
}

.profile-donation-custom { display: grid; gap: 6px; }
.profile-donation-custom > div { display: grid; grid-template-columns: 32px 1fr; align-items: center; overflow: hidden; border: 1px solid rgba(151, 161, 184, 0.2); border-radius: 8px; background: #101722; }
.profile-donation-custom.active > div { border-color: #72efc4; }
.profile-donation-custom > div > span { color: #72efc4; text-align: center; font-weight: 850; }
.profile-donation-custom input { min-height: 42px; border: 0; outline: none; background: transparent; color: #f4f1ff; font: 800 15px/1 Inter, sans-serif; }
.profile-donation-continue { min-height: 48px; }

.profile-donation-checkout-banner
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(99, 230, 190, 0.3);
    border-radius: 8px;
    background: rgba(99, 230, 190, 0.08);
    color: #72efc4;
    font-weight: 800;
}

.profile-donation-checkout-banner[hidden] { display: none; }
#profile-billing-product-picker[hidden],
#profile-billing-add-cart[hidden] { display: none !important; }
.profile-donation-checkout-banner button { border: 0; background: transparent; color: #d9d2ff; cursor: pointer; font-weight: 800; }

.profile-billing-admin-tools[hidden]
{
    display: none;
}

.profile-billing-admin-tools strong,
.profile-billing-admin-tools small
{
    display: block;
}

.profile-billing-admin-tools small
{
    margin-top: 4px;
    color: var(--mobile-muted);
}

.profile-purchase-form
{
    display: grid;
    gap: 12px;
    max-width: 560px;
    margin: 0 auto;
}

.profile-purchase-form label
{
    color: #c9c3dc;
    font-size: 12px;
    font-weight: 700;
}

.profile-purchase-form select
{
    min-height: 42px;
    padding: 7px 34px 7px 10px;
    border: 1px solid rgba(151, 161, 184, 0.22);
    border-radius: 7px;
    background: #101722;
    color: #e7e8f1;
    color-scheme: dark;
}

.profile-purchase-form select option
{
    background: #101722;
    color: #f6f3ff;
}

.profile-checkout-product
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
}

.profile-checkout-product-copy
{
    display: grid;
    gap: 6px;
    min-width: 0;
}

.profile-checkout-product-copy select
{
    width: 100%;
    min-height: 38px;
    padding-left: 0;
    border: 0;
    background-color: transparent;
    color: #f6f3ff;
    font-size: 19px;
    font-weight: 780;
}

.profile-checkout-eyebrow,
.profile-payment-heading
{
    color: #9e91b9;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.profile-checkout-product-copy > span:last-child
{
    color: var(--mobile-muted);
    font-size: 12px;
}

#profile-billing-item-price
{
    color: #65ef9a;
    font-size: 28px;
    line-height: 1;
}

.profile-order-summary
{
    display: grid;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid rgba(151, 161, 184, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.035);
}

.profile-order-summary > div:not(.profile-cart-list)
{
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: #d8d5e2;
}

.profile-order-summary > div:not(.profile-order-total):not(.profile-cart-list)
{
    font-size: 12px;
}

.profile-order-total
{
    padding-top: 7px;
    border-top: 1px solid rgba(151, 161, 184, 0.12);
    color: #f5f2ff;
}

.profile-add-cart
{
    justify-self: end;
    min-width: 126px;
    padding: 0 14px;
}

.profile-cart-heading
{
    align-items: center;
}

.profile-cart-heading span
{
    color: var(--mobile-muted);
    font-size: 11px;
}

.profile-cart-actions
{
    display: flex;
    gap: 8px;
    align-items: center;
}

.profile-cart-actions button
{
    padding: 3px 7px;
    border: 1px solid rgba(255, 135, 151, 0.2);
    border-radius: 5px;
    background: rgba(255, 135, 151, 0.06);
    color: #ff9ca9;
    font: inherit;
    font-size: 11px;
    cursor: pointer;
}

.profile-cart-actions button:disabled
{
    opacity: 0.4;
    cursor: default;
}

.profile-cart-list
{
    display: grid;
    gap: 6px;
}

.profile-cart-empty
{
    padding: 12px 0;
    color: var(--mobile-muted);
    font-size: 12px;
    text-align: center;
}

.profile-cart-row
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 7px 0;
    border-top: 1px solid rgba(151, 161, 184, 0.1);
}

.profile-cart-row:first-child
{
    border-top: 0;
}

.profile-cart-row > span
{
    min-width: 0;
    overflow: hidden;
    color: #d8d5e2;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-cart-row > b
{
    font-size: 12px;
}

.profile-cart-remove
{
    width: 25px;
    height: 25px;
    padding: 0;
    border: 1px solid rgba(255, 135, 151, 0.2);
    border-radius: 5px;
    background: rgba(255, 135, 151, 0.06);
    color: #ff9ca9;
    cursor: pointer;
}

#profile-billing-credit-exchange
{
    margin: 1px 0 0;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(101, 239, 154, 0.08);
    color: #8cf3b2;
    font-size: 11px;
}

#profile-billing-credit-exchange[hidden]
{
    display: none;
}

.profile-payment-heading
{
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-payment-heading small
{
    color: var(--mobile-muted);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.profile-payment-methods
{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.profile-payment-method
{
    min-width: 0;
    min-height: 57px;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid rgba(151, 161, 184, 0.18);
    border-radius: 8px;
    background: rgba(12, 18, 28, 0.88);
    color: #e9e6f2;
    cursor: pointer;
    text-align: left;
}

.profile-payment-method:hover,
.profile-payment-method.active
{
    border-color: rgba(139, 92, 246, 0.78);
    background: rgba(139, 92, 246, 0.1);
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.16);
}

.profile-payment-method:disabled
{
    cursor: not-allowed;
    opacity: 0.35;
}

.profile-payment-method > span:last-child
{
    min-width: 0;
    display: grid;
    gap: 2px;
}

.profile-payment-method strong,
.profile-payment-method small
{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-payment-method small
{
    color: var(--mobile-muted);
    font-size: 10px;
}

.profile-payment-mark
{
    width: 25px;
    height: 25px;
    flex: 0 0 25px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    color: #fff;
    font-weight: 900;
}

.stripe-mark { background: #635bff; }
.apple-mark { background: #050505; font-size: 12px; }
.google-mark { background: #fff; color: #4285f4; }
.paypal-mark { background: #0070ba; color: #ffd140; }
.crypto-mark { background: linear-gradient(135deg, #f59e0b, #7c3aed); }
.mnemonic-mark { background: linear-gradient(135deg, #22c7d8, #6d4de8); }

.profile-checkout-detail
{
    display: grid;
    gap: 7px;
}

.profile-checkout-detail[hidden],
.profile-paypal-buttons[hidden],
.profile-mnemonic-panel[hidden],
.profile-mnemonic-connected[hidden]
{
    display: none;
}

.profile-mnemonic-panel
{
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(34, 199, 216, 0.28);
    border-radius: 8px;
    background: rgba(34, 199, 216, 0.045);
}

.profile-mnemonic-warning
{
    display: grid;
    gap: 3px;
}

.profile-mnemonic-warning strong
{
    color: #7eeaf5;
    font-size: 12px;
}

.profile-mnemonic-warning span
{
    color: var(--mobile-muted);
    font-size: 10px;
    line-height: 1.4;
}

.profile-bitcoin-wallet-type
{
    display: grid;
    gap: 5px;
}

.profile-bitcoin-wallet-type[hidden]
{
    display: none;
}

.profile-bitcoin-wallet-type span
{
    color: #a9b4c5;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.profile-bitcoin-wallet-type select
{
    width: 100%;
    min-height: 34px;
    border: 1px solid rgba(34, 199, 216, 0.3);
    border-radius: 6px;
    background: rgba(0, 12, 21, 0.82);
    color: #d7eef2;
    padding: 0 9px;
}

.profile-mnemonic-counts
{
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin: 9px 0;
}

.profile-mnemonic-counts button
{
    min-height: 29px;
    border: 1px solid rgba(34, 199, 216, 0.25);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.025);
    color: #a9b4c5;
    cursor: pointer;
}

.profile-mnemonic-counts button.active
{
    border-color: #22c7d8;
    background: rgba(34, 199, 216, 0.12);
    color: #7eeaf5;
}

.profile-mnemonic-grid
{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 9px;
}

.profile-mnemonic-grid input
{
    width: 100%;
    min-width: 0;
    min-height: 32px;
    box-sizing: border-box;
    padding: 5px;
    border: 1px solid rgba(34, 199, 216, 0.25);
    border-radius: 5px;
    outline: none;
    background: rgba(0, 12, 21, 0.72);
    color: #7eeaf5;
    font: 12px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace;
    text-align: center;
}

.profile-mnemonic-grid input:focus
{
    border-color: #22c7d8;
    box-shadow: 0 0 0 2px rgba(34, 199, 216, 0.1);
}

.profile-mnemonic-connected
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.profile-mnemonic-connected > div
{
    min-width: 0;
    display: grid;
    gap: 3px;
}

.profile-mnemonic-connected span
{
    color: var(--mobile-muted);
    font-size: 10px;
}

.profile-mnemonic-connected strong
{
    overflow: hidden;
    color: #7eeaf5;
    font: 11px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-paypal-buttons
{
    min-height: 44px;
    overflow: hidden;
    border-radius: 7px;
}

.profile-checkout-secure
{
    display: flex;
    justify-content: center;
    gap: 6px;
    color: var(--mobile-muted);
    font-size: 10px;
}

.profile-billing-quote
{
    display: grid;
    gap: 5px;
    padding: 13px;
    border: 1px solid rgba(139, 92, 246, 0.28);
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.08);
}

.profile-billing-quote span
{
    color: var(--mobile-muted);
    font-size: 12px;
}

.profile-billing-quote b
{
    color: #72efc4;
}

.profile-billing-primary,
.profile-billing-secondary
{
    border-radius: 7px;
    cursor: pointer;
    font-weight: 750;
}

.profile-billing-primary
{
    min-height: 42px;
    border: 0;
    background: linear-gradient(135deg, #8d61ff, #6f47de);
    color: #fff;
}

.profile-billing-secondary
{
    min-height: 32px;
    border: 1px solid rgba(151, 161, 184, 0.2);
    background: rgba(255, 255, 255, 0.04);
    color: #e7e8f1;
}

.profile-billing-primary:disabled,
.profile-billing-secondary:disabled
{
    cursor: wait;
    opacity: 0.55;
}

.profile-billing-list
{
    display: grid;
    gap: 9px;
}

.profile-billing-row
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px;
    border: 1px solid rgba(151, 161, 184, 0.13);
    border-radius: 8px;
    background: rgba(7, 11, 17, 0.46);
}

.profile-billing-row > div:first-child
{
    min-width: 0;
    display: grid;
    gap: 4px;
}

.profile-billing-row small
{
    color: var(--mobile-muted);
}

.profile-billing-row-actions
{
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-billing-badge
{
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(98, 240, 190, 0.12);
    color: #72efc4;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.profile-billing-badge.refund_pending,
.profile-billing-badge.requested,
.profile-billing-badge.approved,
.profile-billing-badge.confirming
{
    background: rgba(244, 200, 99, 0.12);
    color: #f4c863;
}

.profile-billing-empty
{
    padding: 28px 16px;
    border: 1px dashed rgba(151, 161, 184, 0.18);
    border-radius: 8px;
    color: var(--mobile-muted);
    text-align: center;
}

.profile-billing-status
{
    min-height: 39px;
    padding: 10px 16px;
    border-top: 1px solid rgba(151, 161, 184, 0.09);
    color: var(--mobile-muted);
    font-size: 12px;
}

.profile-billing-status[data-kind="error"]
{
    color: #ff9ca9;
}

.profile-billing-status[data-kind="success"]
{
    color: #72efc4;
}

@media (max-width: 660px)
{
    #profile-billing-dialog,
    #privacy-policy-dialog
    {
        align-items: flex-end;
        padding: 8px;
    }

    #profile-billing-panel
    {
        width: 100%;
        max-height: calc(100dvh - 16px);
    }

    #privacy-policy-panel
    {
        width: 100%;
        max-height: calc(100dvh - 16px);
    }

    .privacy-policy-grid { grid-template-columns: 1fr; }

    .profile-billing-tab
    {
        min-height: 46px;
        font-size: 10px;
    }

    .profile-metric-grid
    {
        grid-template-columns: 1fr;
    }

    .profile-payment-methods
    {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-mnemonic-grid
    {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .profile-checkout-product
    {
        align-items: start;
    }

    #profile-billing-item-price
    {
        font-size: 22px;
    }

    .profile-billing-row
    {
        align-items: flex-start;
        flex-direction: column;
    }
}

.preferences-face-ai-depth
{
    margin-bottom: 10px;
}

.preferences-model-status
{
    display: grid;
    gap: 7px;
    min-height: 18px;
    padding: 8px 10px;
    border-radius: 6px;
    background: rgba(124, 84, 255, 0.08);
    color: var(--mobile-muted);
    font: 600 11px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

.preferences-model-progress
{
    display: grid;
    gap: 4px;
}

.preferences-model-progress[hidden]
{
    display: none;
}

.preferences-model-progress-track
{
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(151, 161, 184, 0.18);
}

.preferences-model-progress-fill
{
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #7454ff, #b46cff);
    transition: width 120ms linear;
}

.preferences-model-status[data-state="initializing"] .preferences-model-progress-fill
{
    width: 38% !important;
    animation: preferences-model-progress-pulse 1.1s ease-in-out infinite alternate;
}

.preferences-model-progress-detail
{
    color: rgba(206, 211, 226, 0.72);
    font: 600 10px/1.3 Inter, "Segoe UI", Arial, sans-serif;
}

@keyframes preferences-model-progress-pulse
{
    from { transform: translateX(-65%); }
    to { transform: translateX(165%); }
}

.preferences-model-status[data-state="error"]
{
    color: #ff9aa8;
}

@media (max-width: 520px)
{
    .preferences-setting-row
    {
        grid-template-columns: 1fr;
    }

    .preferences-fixed-value
    {
        text-align: left;
    }
}

#face-effect-dialog
{
    width: min(390px, calc(100vw - 24px));
    max-height: min(78dvh, 700px);
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    background:
        linear-gradient(180deg, rgba(17, 23, 34, 0.98), rgba(10, 15, 23, 0.98));
    border: 1px solid var(--mobile-line);
    border-radius: 8px;
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: var(--mobile-text);
    font: 13px/1.35 Inter, "Segoe UI", Arial, sans-serif;
    pointer-events: auto;
}

.face-effect-dialog-title
{
    color: #f0f2f8;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: 0;
}

.face-effect-dialog-clip
{
    color: #b9c0d1;
    font: 700 12px/1.3 Inter, "Segoe UI", Arial, sans-serif;
    padding: 8px 10px;
    border: 1px solid rgba(151, 161, 184, 0.18);
    border-radius: 6px;
    background: rgba(8, 12, 18, 0.62);
}

.face-effect-dialog-grid
{
    display: grid;
    grid-template-columns: minmax(96px, 0.85fr) minmax(96px, 1fr);
    gap: 8px;
    align-items: center;
}

.face-effect-dialog-grid label,
.face-effect-dialog-check
{
    color: #aeb4c4;
    font: 650 12px/1.25 Inter, "Segoe UI", Arial, sans-serif;
}

.face-effect-dialog-grid input
{
    min-width: 0;
    height: 30px;
    box-sizing: border-box;
    background: rgba(7, 11, 17, 0.94);
    color: #d9dced;
    -webkit-text-fill-color: #d9dced;
    border: 1px solid rgba(151, 161, 184, 0.24);
    border-radius: 6px;
    caret-color: var(--mobile-purple);
    padding: 5px 7px;
    font: 12px/1.25 Inter, "Segoe UI", Arial, sans-serif;
}

.face-effect-dialog-grid input[type="color"]
{
    padding: 2px;
    -webkit-text-fill-color: initial;
}

.face-effect-dialog-grid input:focus
{
    outline: none;
    border-color: rgba(141, 97, 255, 0.64);
    box-shadow: 0 0 0 2px rgba(141, 97, 255, 0.18);
}

.face-effect-dialog-check
{
    display: flex;
    align-items: center;
    gap: 8px;
}

.face-effect-dialog-check input
{
    accent-color: var(--mobile-purple);
}

[data-fx-group].hidden
{
    display: none !important;
}

.face-effect-dialog-actions
{
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 720px)
{
    #face-effect-editor
    {
        align-items: flex-end;
        justify-content: center;
        padding: 8px 10px calc(112px + env(safe-area-inset-bottom, 0px) + 10px);
    }

    #face-effect-dialog
    {
        width: calc(100vw - 20px);
        max-height: min(42dvh, 420px);
    }

    .face-effect-dialog-grid
    {
        grid-template-columns: minmax(96px, 1fr) minmax(96px, 1.2fr);
    }
}

@media (orientation: landscape) and (max-height: 820px)
{
    #face-effect-editor
    {
        align-items: flex-start;
        justify-content: flex-end;
        padding:
            calc(96px + env(safe-area-inset-top, 0px) + 12px)
            max(12px, env(safe-area-inset-right, 0px))
            calc(112px + env(safe-area-inset-bottom, 0px) + 12px)
            max(12px, env(safe-area-inset-left, 0px));
    }

    #face-effect-dialog
    {
        width: min(360px, calc(100vw - 24px));
        max-height: calc(100dvh - 220px);
    }
}

#ai-effect-panel,
#ai-vision-effect-panel
{
    width: min(780px, calc(100vw - 24px));
    max-height: min(86vh, 760px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background:
        linear-gradient(180deg, rgba(17, 23, 34, 0.98), rgba(10, 15, 23, 0.98));
    border: 1px solid var(--mobile-line);
    border-radius: 8px;
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: var(--mobile-text);
    font: 13px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

#ai-project-agent-panel
{
    width: 100%;
    display: grid;
    grid-template-columns: minmax(210px, 260px) minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    box-sizing: border-box;
    background:
        linear-gradient(180deg, rgba(17, 23, 34, 0.98), rgba(10, 15, 23, 0.98));
    border: 1px solid var(--mobile-line);
    border-radius: 8px;
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: var(--mobile-text);
    font: 13px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

.ai-project-agent-workspace
{
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-project-agent-topbar > * { min-width: 0; max-width: 100%; box-sizing: border-box; }
.ai-project-agent-topbar select { flex: 1 1 150px; }
#ai-project-agent-credits { white-space: normal; overflow-wrap: anywhere; }
.ai-provider-settings { border: 1px solid var(--mobile-line); padding: 10px; border-radius: 6px; overflow-wrap: anywhere; }
.ai-provider-settings summary { cursor: pointer; }
.ai-provider-settings label { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }
.ai-provider-settings input, .ai-provider-settings select { flex: 1 1 180px; min-width: 0; max-width: 100%; box-sizing: border-box; padding: 8px; color: inherit; background: #0b1019; border: 1px solid var(--mobile-line); }
.ai-provider-settings a { color: #bfa5ff; }
.mobile-popover-menu button[onclick*="openAIProjectAgentDialog"]::before { content: "✦"; }

.ai-project-agent-sidebar
{
    min-width: 0;
    max-height: 650px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 10px;
    border-right: 1px solid rgba(151, 161, 184, 0.2);
}

.ai-project-agent-sidebar-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ai-project-agent-sidebar-header strong
{
    color: #f0f2f8;
    font-size: 13px;
}

#ai-project-agent-thread-list
{
    min-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 2px;
}

.ai-project-agent-thread-item
{
    width: 100%;
    display: grid;
    grid-template-columns: 8px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    padding: 9px;
    box-sizing: border-box;
    color: #cfd4e3;
    background: rgba(7, 11, 17, 0.72);
    border: 1px solid rgba(151, 161, 184, 0.18);
    border-radius: 7px;
    text-align: left;
    cursor: pointer;
}

.ai-project-agent-thread-item:hover
{
    border-color: rgba(141, 97, 255, 0.5);
    background: rgba(30, 23, 50, 0.72);
}

.ai-project-agent-thread-item.selected
{
    border-color: rgba(141, 97, 255, 0.8);
    background: rgba(141, 97, 255, 0.14);
    box-shadow: inset 2px 0 0 var(--mobile-purple);
}

.ai-project-agent-thread-dot
{
    width: 7px;
    height: 7px;
    margin-top: 5px;
    border-radius: 50%;
    background: #778096;
}

.ai-project-agent-thread-dot.running,
.ai-project-agent-thread-dot.queued,
.ai-project-agent-thread-dot.requires_action
{
    background: #46c5f1;
    box-shadow: 0 0 8px rgba(70, 197, 241, 0.65);
}

.ai-project-agent-thread-dot.completed
{
    background: #54d39b;
}

.ai-project-agent-thread-dot.failed,
.ai-project-agent-thread-dot.interrupted
{
    background: #f06f7d;
}

.ai-project-agent-thread-copy
{
    min-width: 0;
}

.ai-project-agent-thread-title,
.ai-project-agent-thread-meta
{
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-project-agent-thread-title
{
    color: #edf0f7;
    font-size: 12px;
    font-weight: 650;
}

.ai-project-agent-thread-meta
{
    margin-top: 3px;
    color: #8992a8;
    font-size: 10px;
    text-transform: capitalize;
}

#ai-effect-panel h3,
#ai-project-agent-panel h3,
#ai-vision-effect-panel h3
{
    margin: 0;
    color: #f0f2f8;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: 0;
}

#ai-effect-prompt,
#ai-effect-code,
#ai-effect-model,
#ai-effect-library,
#ai-project-agent-input,
#ai-project-agent-plan,
#ai-project-agent-mode,
#ai-project-agent-model,
#ai-project-agent-thread,
#ai-vision-effect-prompt,
#ai-vision-effect-plan,
#ai-vision-effect-model,
#ai-vision-effect-resolution,
#ai-vision-effect-preview-step,
#ai-vision-effect-export-step
{
    width: 100%;
    box-sizing: border-box;
    background: rgba(7, 11, 17, 0.94);
    color: #d9dced;
    -webkit-text-fill-color: #d9dced;
    border: 1px solid rgba(151, 161, 184, 0.24);
    border-radius: 6px;
    caret-color: var(--mobile-purple);
    padding: 8px;
    font: 12px/1.35 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

#ai-effect-prompt:focus,
#ai-effect-code:focus,
#ai-effect-model:focus,
#ai-effect-library:focus,
#ai-project-agent-input:focus,
#ai-project-agent-plan:focus,
#ai-project-agent-mode:focus,
#ai-project-agent-model:focus,
#ai-project-agent-thread:focus,
#ai-vision-effect-prompt:focus,
#ai-vision-effect-plan:focus,
#ai-vision-effect-model:focus,
#ai-vision-effect-resolution:focus,
#ai-vision-effect-preview-step:focus,
#ai-vision-effect-export-step:focus
{
    outline: none;
    border-color: rgba(141, 97, 255, 0.64);
    box-shadow: 0 0 0 2px rgba(141, 97, 255, 0.18);
}

#ai-effect-prompt,
#ai-project-agent-input,
#ai-vision-effect-prompt
{
    min-height: 72px;
    resize: vertical;
}

#ai-effect-code,
#ai-project-agent-plan,
#ai-vision-effect-plan
{
    min-height: 220px;
    resize: vertical;
}

#ai-effect-library
{
    min-height: 92px;
}

.ai-project-agent-topbar
{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

#ai-project-agent-credits
{
    min-height: 34px;
    padding: 7px 10px;
    border: 1px solid rgba(151, 161, 184, 0.24);
    border-radius: 6px;
    background: rgba(7, 11, 17, 0.94);
    color: #c7cce0;
    font: 700 11px/1.2 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
    white-space: normal;
    cursor: pointer;
}

#ai-project-agent-credits[data-low="true"]
{
    border-color: rgba(255, 174, 80, 0.64);
    color: #ffc57e;
}

#ai-project-agent-credits[data-exempt="true"]
{
    border-color: rgba(117, 225, 180, 0.46);
    color: #91e5bd;
}

#ai-project-agent-thread
{
    min-width: 0;
}

.ai-project-agent-topbar > label
{
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    white-space: normal;
    cursor: pointer;
}

#ai-project-agent-allow-js,
#webrtc-panel-shell #ai-project-agent-allow-js
{
    flex: 0 0 14px;
    width: 14px;
    min-width: 14px;
    max-width: 14px;
    height: 14px;
    min-height: 14px;
    max-height: 14px;
    margin: 0;
    padding: 0;
    accent-color: var(--mobile-purple);
}

#ai-project-agent-status
{
    min-height: 18px;
    color: #aeb4c4;
    font-size: 12px;
    text-align: right;
}

#ai-project-agent-messages
{
    min-height: 260px;
    max-height: 390px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(7, 11, 17, 0.72);
    border: 1px solid rgba(151, 161, 184, 0.2);
    border-radius: 6px;
    text-align: left;
}

.ai-project-agent-message
{
    margin: 0 0 8px;
    padding: 8px;
    border-radius: 6px;
    color: #d9dced;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.ai-project-agent-message.user
{
    background: rgba(62, 183, 231, 0.12);
    border: 1px solid rgba(62, 183, 231, 0.24);
}

.ai-project-agent-message.assistant
{
    background: rgba(141, 97, 255, 0.12);
    border: 1px solid rgba(141, 97, 255, 0.24);
}

.ai-project-agent-generated-image
{
    display: block;
    width: min(100%, 520px);
    max-height: 360px;
    margin: 8px 0;
    object-fit: contain;
    border-radius: 6px;
    background: #070b11;
}

.ai-project-agent-generated-download
{
    display: inline-block;
    color: #75ccff;
    font-size: 12px;
    text-decoration: none;
}

.ai-project-agent-generated-download:hover
{
    text-decoration: underline;
}

.ai-project-agent-message.activity
{
    position: relative;
    padding-left: 28px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(151, 161, 184, 0.14);
    color: #bdc5d8;
    font-size: 12px;
}

.ai-project-agent-message.activity::before
{
    content: "";
    position: absolute;
    left: 10px;
    top: 13px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8d61ff;
    box-shadow: 0 0 8px rgba(141, 97, 255, 0.6);
}

.ai-project-agent-message.activity.working::before
{
    animation: ai-project-agent-pulse 1.1s ease-in-out infinite;
}

.ai-project-agent-message.activity.success::before
{
    background: #54d39b;
    box-shadow: none;
}

.ai-project-agent-message.activity.error::before
{
    background: #f06f7d;
    box-shadow: none;
}

@keyframes ai-project-agent-pulse
{
    0%, 100% { opacity: 0.35; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

#ai-tutorial-overlay.hidden,
#ai-tutorial-highlight.hidden
{
    display: none;
}

#ai-tutorial-overlay
{
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
}

#ai-tutorial-highlight
{
    position: fixed;
    border: 2px solid rgba(62, 183, 231, 0.95);
    border-radius: 8px;
    box-shadow:
        0 0 0 9999px rgba(3, 6, 11, 0.48),
        0 0 22px rgba(62, 183, 231, 0.55);
    pointer-events: none;
    transition:
        left 0.18s ease,
        top 0.18s ease,
        width 0.18s ease,
        height 0.18s ease;
}

#ai-tutorial-card
{
    position: fixed;
    width: min(360px, calc(100vw - 24px));
    max-height: min(240px, calc(100dvh - 24px));
    overflow: auto;
    padding: 12px;
    box-sizing: border-box;
    background:
        linear-gradient(180deg, rgba(17, 23, 34, 0.98), rgba(10, 15, 23, 0.98));
    border: 1px solid rgba(151, 161, 184, 0.28);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
    color: #f0f2f8;
    text-align: left;
    pointer-events: auto;
}

.ai-tutorial-card-header
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.ai-tutorial-card-header strong
{
    font-size: 14px;
    font-weight: 750;
}

#ai-tutorial-count
{
    color: #aeb4c4;
    font-size: 12px;
}

#ai-tutorial-caption
{
    color: #d9dced;
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 10px;
}

.ai-tutorial-actions
{
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.ai-tutorial-actions button:disabled
{
    opacity: 0.45;
    cursor: default;
}

@media (max-width: 640px)
{
    #ai-project-agent-panel
    {
        grid-template-columns: 1fr;
    }

    .ai-project-agent-sidebar
    {
        max-height: 210px;
        padding-right: 0;
        padding-bottom: 8px;
        border-right: 0;
        border-bottom: 1px solid rgba(151, 161, 184, 0.2);
    }

    #ai-project-agent-thread-list
    {
        min-height: 0;
        max-height: 150px;
    }

    .ai-project-agent-topbar
    {
        grid-template-columns: 1fr;
    }

    #ai-project-agent-status
    {
        text-align: left;
    }
}

.ai-effect-actions
{
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

#ai-vision-effect-wallet
{
    min-height: 18px;
    color: #aeb4c4;
    font-size: 12px;
}

.ai-vision-effect-grid
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 8px;
    align-items: center;
}

.ai-vision-effect-grid label,
#ai-vision-effect-panel > label
{
    color: #c6cbda;
    font-size: 12px;
}

.ai-vision-effect-label
{
    position: absolute;
    inset: 4px;
    display: flex;
    align-items: center;
    overflow: hidden;
    color: #f3f5ff;
    font-size: 11px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.timeline-clip.ai-vision-effect-clip
{
    background:
        linear-gradient(135deg, rgba(20, 184, 166, 0.34), rgba(99, 102, 241, 0.34));
    border-color: rgba(94, 234, 212, 0.58);
}

#project-save-panel,
#project-transfer-panel
{
    width: min(420px, calc(100vw - 24px));
    padding: 14px;
    background:
        linear-gradient(180deg, rgba(17, 23, 34, 0.98), rgba(10, 15, 23, 0.98));
    border: 1px solid var(--mobile-line);
    border-radius: 8px;
    box-shadow:
        0 22px 60px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    color: var(--mobile-text);
    font: 13px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

#project-save-panel h3,
#project-transfer-panel h3
{
    margin: 0 0 4px 0;
    color: #f0f2f8;
    font-size: 16px;
    font-weight: 750;
    letter-spacing: 0;
}

#project-transfer-panel
{
    width: min(560px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px;
}

#project-transfer-status
{
    min-height: 18px;
    color: #aeb4c4;
    line-height: 1.35;
    font-size: 12px;
}

#project-transfer-qr
{
    display: none;
    align-self: center;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 6px;
    box-shadow:
        0 12px 28px rgba(0, 0, 0, 0.26),
        0 0 0 1px rgba(141, 97, 255, 0.18);
    line-height: 0;
    box-sizing: border-box;
}

#project-transfer-qr.active
{
    display: block;
}

#project-transfer-qr .project-transfer-qr-bitmap
{
    display: block;
    width: min(260px, calc(100vw - 104px));
    height: min(260px, calc(100vw - 104px));
    background: #ffffff;
}

#project-transfer-scanner
{
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
    border: 1px solid rgba(141, 97, 255, 0.46);
    border-radius: 6px;
    overflow: hidden;
}

#project-transfer-scanner.hidden
{
    display: none;
}

#project-transfer-scan-video
{
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#project-transfer-scan-guide
{
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(58%, 260px);
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
    box-sizing: border-box;
    pointer-events: none;
}

#project-transfer-link
{
    width: 100%;
    box-sizing: border-box;
    background: rgba(7, 11, 17, 0.92) !important;
    color: #c7cad7 !important;
    -webkit-text-fill-color: #c7cad7 !important;
    caret-color: var(--mobile-purple) !important;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 6px;
    padding: 9px 10px;
    font: 12px/1.25 "SFMono-Regular", Consolas, monospace;
    outline: none;
}

#project-transfer-link::selection
{
    background: rgba(141, 97, 255, 0.72);
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
}

#project-transfer-link:-webkit-autofill,
#project-transfer-link:-webkit-autofill:hover,
#project-transfer-link:-webkit-autofill:focus,
.timeline-track-label-editor:-webkit-autofill,
.timeline-track-label-editor:-webkit-autofill:hover,
.timeline-track-label-editor:-webkit-autofill:focus
{
    -webkit-text-fill-color: #c7cad7 !important;
    box-shadow: 0 0 0 1000px rgba(7, 11, 17, 0.96) inset !important;
    caret-color: var(--mobile-purple) !important;
}

.mobile-project-name-input:-webkit-autofill,
.mobile-project-name-input:-webkit-autofill:hover,
.mobile-project-name-input:-webkit-autofill:focus
{
    -webkit-text-fill-color: #f3f0ff !important;
    box-shadow:
        0 0 0 1000px rgba(8, 12, 19, 0.98) inset,
        0 0 0 2px rgba(141, 97, 255, 0.18) !important;
    caret-color: var(--mobile-purple) !important;
}

.project-transfer-progress-row
{
    display: grid;
    grid-template-columns: 64px 1fr minmax(108px, auto);
    gap: 10px;
    align-items: center;
    color: #aeb4c4;
    font-size: 12px;
}

.project-transfer-progress-row span
{
    color: #8f96aa;
}

.project-transfer-progress-row progress
{
    width: 100%;
    height: 7px;
    accent-color: var(--mobile-purple);
}

.project-transfer-actions
{
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

#project-transfer-panel .timeline-tool
{
    min-height: 31px;
    border: 1px solid rgba(151, 161, 184, 0.22);
    border-radius: 6px;
    padding: 0 12px;
    background: rgba(19, 25, 36, 0.84);
    color: #d9dced;
    font: 650 12px/1 Inter, "Segoe UI", Arial, sans-serif;
    box-shadow: none;
}

#project-transfer-panel .timeline-tool:hover
{
    border-color: rgba(141, 97, 255, 0.56);
    background: rgba(31, 37, 54, 0.92);
}

#project-transfer-scan-qr,
#project-transfer-relay-share,
#project-transfer-connect-invite:not(.hidden)
{
    border-color: transparent !important;
    background: linear-gradient(135deg, var(--mobile-purple), var(--mobile-purple-2)) !important;
    color: #ffffff !important;
}

.project-save-option
{
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin: 10px 0;
}

.project-save-option input
{
    margin-top: 2px;
}

.project-save-field
{
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0 10px;
    color: #f0f2f8;
    font-weight: 650;
}

.project-save-field input
{
    width: 100%;
    box-sizing: border-box;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid rgba(151, 161, 184, 0.24);
    border-radius: 6px;
    outline: none;
    background: rgba(7, 11, 17, 0.94);
    color: #d9dced;
    -webkit-text-fill-color: #d9dced;
    caret-color: var(--mobile-purple);
    font: 13px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

.project-save-field input:focus
{
    border-color: rgba(141, 97, 255, 0.64);
}

.project-save-hint
{
    color: #9aa2b8;
    line-height: 1.35;
    font-weight: 400;
}

.project-save-actions
{
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
}

#project-save-dialog .timeline-tool,
#project-transfer-dialog .timeline-tool,
#ai-effect-dialog .timeline-tool
{
    min-height: 34px;
    height: auto;
    border: 1px solid rgba(151, 161, 184, 0.24) !important;
    border-radius: 7px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015)),
        rgba(18, 24, 34, 0.9) !important;
    color: #d9dced !important;
    font: 750 13px/1 Inter, "Segoe UI", Arial, sans-serif;
    box-shadow: none !important;
    text-shadow: none !important;
}

#project-save-dialog .timeline-tool:is(:hover, :focus-visible),
#project-transfer-dialog .timeline-tool:is(:hover, :focus-visible),
#ai-effect-dialog .timeline-tool:is(:hover, :focus-visible)
{
    outline: none;
    border-color: rgba(141, 97, 255, 0.62) !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.018)),
        var(--ui-hover-bg) !important;
    color: #ffffff !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.055) inset,
        0 0 18px rgba(141, 97, 255, 0.26) !important;
}

#project-transfer-dialog .project-transfer-primary,
#project-transfer-dialog #project-transfer-connect-invite:not(.hidden),
#project-transfer-dialog #project-transfer-relay-share
{
    border-color: rgba(171, 139, 255, 0.68) !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.02)),
        linear-gradient(135deg, var(--mobile-purple), var(--mobile-purple-2)) !important;
    color: #ffffff !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.06) inset,
        0 0 18px rgba(141, 97, 255, 0.34) !important;
}

#project-transfer-dialog .project-transfer-primary:is(:hover, :focus-visible),
#project-transfer-dialog #project-transfer-connect-invite:not(.hidden):is(:hover, :focus-visible),
#project-transfer-dialog #project-transfer-relay-share:is(:hover, :focus-visible)
{
    border-color: rgba(196, 173, 255, 0.82) !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.16), rgba(255,255,255,0.035)),
        linear-gradient(135deg, #9b75ff, var(--mobile-purple)) !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.08) inset,
        0 0 22px rgba(141, 97, 255, 0.46) !important;
}

#project-save-dialog input[type="checkbox"],
#project-transfer-dialog input[type="checkbox"],
#ai-effect-dialog input[type="checkbox"]
{
    accent-color: var(--mobile-purple);
}

#project-transfer-link
{
    background: rgba(7, 11, 17, 0.94);
    color: #d9dced;
    -webkit-text-fill-color: #d9dced;
    caret-color: var(--mobile-purple);
    border: 1px solid rgba(151, 161, 184, 0.24);
    border-radius: 6px;
    outline: none;
}

#project-transfer-link:focus
{
    border-color: rgba(141, 97, 255, 0.64);
    box-shadow: 0 0 0 2px rgba(141, 97, 255, 0.18);
}

#shader-clip-editor,
#wrap-effect-editor
{
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 5, 12, 0.72);
    backdrop-filter: blur(5px);
}

#wrap-effect-editor
{
    pointer-events: none;
    background: transparent;
    backdrop-filter: none;
}

#wrap-effect-dialog
{
    pointer-events: auto;
}

#shader-clip-dialog,
#wrap-effect-dialog
{
    width: min(760px, calc(100vw - 24px));
    max-height: min(80vh, 720px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    background:
        linear-gradient(180deg, rgba(18, 23, 35, 0.98), rgba(8, 12, 20, 0.98));
    border: 1px solid rgba(141, 97, 255, 0.42);
    border-radius: 7px;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.035) inset,
        0 0 28px rgba(141, 97, 255, 0.16);
}

.shader-clip-title
{
    color: #f3f1ff;
    font: 700 14px system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

.shader-clip-preset-row
{
    display: flex;
    gap: 8px;
    align-items: center;
}

.shader-clip-help
{
    color: rgba(205, 211, 230, 0.78);
    font: 11px monospace;
    line-height: 1.35;
}

.wrap-effect-grid
{
    display: grid;
    grid-template-columns: minmax(86px, 0.8fr) minmax(150px, 1.6fr) minmax(72px, 0.7fr);
    gap: 8px;
    align-items: center;
}

.wrap-effect-grid label
{
    color: rgba(229, 233, 246, 0.9);
    font: 12px monospace;
}

.wrap-effect-grid input[type="number"],
.wrap-effect-grid input[type="range"]
{
    min-width: 0;
}

.wrap-effect-grid input[type="number"]
{
    height: 30px;
    box-sizing: border-box;
    background: rgba(5, 9, 16, 0.92);
    color: #f4f1ff;
    border: 1px solid rgba(151, 161, 184, 0.28);
    border-radius: 5px;
    outline: none;
    padding: 0 8px;
    font: 12px monospace;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.wrap-effect-grid input[type="number"]:focus
{
    border-color: rgba(141, 97, 255, 0.72);
    box-shadow:
        0 0 0 1px rgba(141, 97, 255, 0.2),
        0 0 18px rgba(141, 97, 255, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.wrap-effect-grid input[type="range"]
{
    height: 24px;
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    accent-color: var(--mobile-purple);
}

.wrap-effect-grid input[type="range"]:focus
{
    outline: none;
}

.wrap-effect-grid input[type="range"]:focus::-webkit-slider-thumb
{
    box-shadow:
        0 0 0 4px rgba(141, 97, 255, 0.24),
        0 0 18px rgba(141, 97, 255, 0.68);
}

.wrap-effect-grid input[type="range"]::-webkit-slider-runnable-track
{
    height: 6px;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            rgba(141, 97, 255, 0.92),
            rgba(181, 149, 255, 0.7)
        );
    border: 1px solid rgba(151, 161, 184, 0.22);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.46);
}

.wrap-effect-grid input[type="range"]::-webkit-slider-thumb
{
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    margin-top: -6px;
    border-radius: 50%;
    border: 2px solid rgba(234, 230, 255, 0.96);
    background:
        radial-gradient(circle at 35% 30%, #ffffff 0, #c9b8ff 22%, var(--mobile-purple) 70%);
    box-shadow:
        0 0 0 3px rgba(141, 97, 255, 0.18),
        0 0 16px rgba(141, 97, 255, 0.56);
}

.wrap-effect-grid input[type="range"]::-moz-range-track
{
    height: 6px;
    border-radius: 999px;
    background:
        linear-gradient(
            90deg,
            rgba(141, 97, 255, 0.92),
            rgba(181, 149, 255, 0.7)
        );
    border: 1px solid rgba(151, 161, 184, 0.22);
}

.wrap-effect-grid input[type="range"]::-moz-range-thumb
{
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(234, 230, 255, 0.96);
    background: var(--mobile-purple);
    box-shadow: 0 0 12px rgba(141, 97, 255, 0.5);
}

#shader-clip-preset,
#shader-clip-target,
#wrap-effect-type
{
    flex: 1;
    min-width: 0;
    height: 32px;
    background: rgba(5, 9, 16, 0.92);
    color: #f4f1ff;
    border: 1px solid rgba(151, 161, 184, 0.28);
    border-radius: 5px;
    outline: none;
    padding: 0 9px;
    font: 12px monospace;
}

#shader-clip-code
{
    width: 100%;
    min-height: 280px;
    resize: vertical;
    box-sizing: border-box;
    background: rgba(2, 5, 10, 0.96);
    color: #f4f1ff;
    border: 1px solid rgba(151, 161, 184, 0.3);
    border-radius: 6px;
    outline: none;
    padding: 10px;
    font: 12px monospace;
    line-height: 1.35;
    caret-color: #a77dff;
}

#shader-clip-preset:focus,
#shader-clip-target:focus,
#shader-clip-code:focus,
#wrap-effect-type:focus,
#wrap-effect-editor input:focus
{
    border-color: rgba(141, 97, 255, 0.72);
    box-shadow:
        0 0 0 1px rgba(141, 97, 255, 0.2),
        0 0 18px rgba(141, 97, 255, 0.18);
}

#shader-clip-code::selection,
#shader-clip-preset::selection,
#shader-clip-target::selection,
#wrap-effect-type::selection,
#wrap-effect-editor input::selection
{
    color: #ffffff;
    background: rgba(141, 97, 255, 0.55);
}

#shader-clip-code::-webkit-scrollbar
{
    width: 12px;
}

#shader-clip-code::-webkit-scrollbar-track
{
    background: rgba(7, 10, 16, 0.95);
}

#shader-clip-code::-webkit-scrollbar-thumb
{
    background: rgba(141, 97, 255, 0.48);
    border: 3px solid rgba(7, 10, 16, 0.95);
    border-radius: 8px;
}

#shader-clip-error
{
    min-height: 18px;
    color: #ff8f9b;
    font: 11px monospace;
    white-space: pre-wrap;
}

.shader-clip-actions
{
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

#shader-clip-dialog .timeline-tool,
#wrap-effect-dialog .timeline-tool
{
    min-height: 32px;
    border: 1px solid rgba(151, 161, 184, 0.28);
    border-radius: 5px;
    background: rgba(12, 17, 28, 0.96);
    color: #f4f1ff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

#shader-clip-dialog .timeline-tool:is(:hover, :focus-visible),
#wrap-effect-dialog .timeline-tool:is(:hover, :focus-visible)
{
    border-color: rgba(141, 97, 255, 0.72);
    background: rgba(141, 97, 255, 0.18);
    color: #ffffff;
    outline: none;
}

@media (max-width: 640px)
{
    .shader-clip-preset-row,
    .shader-clip-actions
    {
        flex-direction: column;
        align-items: stretch;
    }

    .wrap-effect-grid
    {
        grid-template-columns: 1fr;
    }
}

.ctx-control
{
    padding: 7px 10px;
    color: #aeb4c4;
}

.ctx-control label
{
    display: block;
    margin-bottom: 5px;
}

.ctx-control-row
{
    display: flex;
    gap: 5px;
}

.ctx-control input
{
    width: 64px;
    min-width: 0;
    background: #050505;
    color: #d9dced;
    border: 1px solid rgba(151, 161, 184, 0.28);
    padding: 4px;
}

.ctx-control input[type="range"]
{
    flex: 1;
    width: auto;
}

#ctx-clip-opacity-number
{
    width: 58px;
}

.ctx-control button
{
    background: #050505;
    color: #d9dced;
    border: 1px solid rgba(151, 161, 184, 0.28);
    padding: 4px 7px;
    cursor: pointer;
}

.ctx-control button:hover
{
    background: rgba(141, 97, 255, 0.18);
}

/* Mobile editor context menu theme */
#timeline-context-menu
{
    background:
        linear-gradient(180deg, rgba(17, 23, 34, 0.98), rgba(9, 13, 20, 0.98)) !important;
    border: 1px solid var(--mobile-line) !important;
    border-radius: 7px;
    min-width: 250px;
    padding: 6px;
    scroll-padding-bottom: 18px;
    box-shadow:
        0 22px 52px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    scrollbar-color: rgba(141, 97, 255, 0.55) rgba(12, 17, 26, 0.96);
    max-height: var(--timeline-context-max-height, calc(100vh - 160px)) !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

#timeline-context-menu::-webkit-scrollbar
{
    width: 10px;
}

#timeline-context-menu::-webkit-scrollbar-track
{
    background: rgba(12, 17, 26, 0.96);
}

#timeline-context-menu::-webkit-scrollbar-thumb
{
    background: rgba(141, 97, 255, 0.55);
    border-radius: 999px;
}

#timeline-context-menu .ctx-item
{
    min-height: 32px;
    display: block;
    position: relative;
    box-sizing: border-box;
    padding: 8px 30px 8px 40px;
    border-radius: 5px;
    color: #d7dbea !important;
    font: 13px/1.2 Inter, "Segoe UI", Arial, sans-serif;
    white-space: nowrap;
}

#timeline-context-menu .ctx-item::before
{
    content: "";
    color: #aeb4c4;
    position: absolute;
    left: 8px;
    top: 50%;
    display: block;
    width: 24px;
    height: 20px;
    transform: translateY(-50%);
    justify-content: center;
    align-items: center;
    overflow: hidden;
    font: 18px/1 "Segoe UI Symbol", "Segoe UI", Arial, sans-serif;
    line-height: 20px;
    text-align: center;
}

#timeline-context-menu .ctx-submenu > .ctx-item::after
{
    float: none;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
    padding-left: 0;
}

#ctxCopy::before { content: "\29C9" !important; }
#ctxCut::before { content: "\2702" !important; }
#ctxPaste::before { content: "\25A4" !important; }
#ctxDelete::before { content: "\232B" !important; }
#ctxRenameTrack::before { content: "T" !important; }
#ctxDeleteTrack::before { content: "\232B" !important; }
#ctx-select-start::before { content: "[" !important; }
#ctx-select-end::before { content: "]" !important; }
#ctx-clear-selection-range::before { content: "\00D7" !important; }
#ctxFlipHorizontal::before { content: "\2194" !important; }
#ctxFlipVertical::before { content: "\2195" !important; }
#ctxProjectSizeToFrame::before { content: "\25A3" !important; }
#ctxReverseClip::before { content: "\21C4" !important; }
#ctxEditShader::before { content: "\2726" !important; }
#ctxAnalyzeLoop::before { content: "\21BB" !important; }
#ctxMergeBeat::before,
#ctxMergeSubmenu > .ctx-item::before { content: "\2387" !important; }
#ctxMergeBeatLeft::before { content: "\2190" !important; }
#ctxMergeBeatRight::before { content: "\2192" !important; }
#ctxAddCancellationRegion::before { content: "\2212" !important; }

#timeline-context-menu .ctx-item:hover
{
    background: rgba(141, 97, 255, 0.18) !important;
    color: #ffffff !important;
}

#timeline-context-menu .ctx-sep
{
    height: 1px;
    margin: 5px 2px;
    background: var(--mobile-line) !important;
}

#timeline-context-menu .ctx-control
{
    padding: 8px 10px;
    color: #aeb4c4 !important;
    font: 12px/1.3 Inter, "Segoe UI", Arial, sans-serif;
}

#timeline-context-menu .ctx-control label,
#timeline-context-menu .ctx-info-line
{
    color: #aeb4c4 !important;
    font: 12px/1.3 Inter, "Segoe UI", Arial, sans-serif;
}

#timeline-context-menu .ctx-info-line
{
    color: #d7dbea !important;
}

#timeline-context-menu .ctx-control textarea,
#timeline-context-menu .ctx-control input,
#timeline-context-menu .ctx-control select
{
    background: rgba(7, 11, 17, 0.94) !important;
    color: #c7cad7 !important;
    -webkit-text-fill-color: #c7cad7 !important;
    caret-color: var(--mobile-purple) !important;
    border: 1px solid rgba(151, 161, 184, 0.24) !important;
    border-radius: 5px;
    padding: 5px 7px;
    font: 12px/1.25 Inter, "Segoe UI", Arial, sans-serif;
}

#timeline-context-menu .ctx-control input[type="color"]
{
    padding: 2px;
    -webkit-text-fill-color: initial !important;
}

#timeline-context-menu .ctx-control input[type="range"]
{
    accent-color: var(--mobile-purple);
}

#timeline-context-menu .ctx-control button
{
    min-height: 28px;
    border: 1px solid rgba(151, 161, 184, 0.24) !important;
    border-radius: 5px;
    background: rgba(19, 25, 36, 0.86) !important;
    color: #d9dced !important;
    font: 650 12px/1 Inter, "Segoe UI", Arial, sans-serif;
    padding: 0 9px;
}

#timeline-context-menu .ctx-control button:hover
{
    border-color: rgba(141, 97, 255, 0.56) !important;
    background: rgba(141, 97, 255, 0.18) !important;
    color: #ffffff !important;
}

#timeline-context-menu .ctx-emoji-chip-list,
#timeline-context-menu .ctx-emoji-storage-list
{
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 7px 0;
}

#timeline-context-menu .ctx-emoji-storage-list
{
    margin-top: 2px;
}

#timeline-context-menu .ctx-emoji-chip,
#timeline-context-menu .ctx-emoji-storage-chip
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    border: 1px solid rgba(151, 161, 184, 0.24) !important;
    border-radius: 6px;
    background: rgba(19, 25, 36, 0.9) !important;
    color: #ffffff !important;
    font: 18px/1 "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
    cursor: pointer;
}

#timeline-context-menu .ctx-emoji-chip
{
    padding: 0 7px;
    gap: 5px;
}

#timeline-context-menu .ctx-emoji-chip-remove
{
    color: #aeb4c4;
    font: 700 12px/1 Inter, "Segoe UI", Arial, sans-serif;
}

#timeline-context-menu .ctx-emoji-image-chip
{
    min-width: 44px;
    overflow: hidden;
}

#timeline-context-menu .ctx-emoji-image-chip img
{
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

#timeline-context-menu .ctx-emoji-storage-chip
{
    opacity: 0.88;
}

#timeline-context-menu .ctx-emoji-storage-empty
{
    color: #747b8d;
    font: 12px/1.3 Inter, "Segoe UI", Arial, sans-serif;
}

#timeline-context-menu .ctx-emoji-add-row
{
    align-items: center;
}

#timeline-context-menu .ctx-emoji-add-row input
{
    min-width: 0;
    flex: 1 1 54px;
}

#timeline-context-menu .ctx-submenu-panel
{
    border-left: 1px solid var(--mobile-line) !important;
}

@media (pointer: coarse), (max-width: 700px)
{
    #timeline-tools
    {
        flex-wrap: wrap;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 5px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        padding: 5px;
        top: 0;
        border-top-color: rgba(151, 161, 184, 0.24);
        overflow-x: hidden;
        overflow-y: visible;
    }

    .timeline-tool
    {
        min-width: 0;
        max-width: 100%;
        min-height: 28px;
        height: 28px;
        padding: 3px 5px;
        font-size: 11px;
        line-height: 1;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .primary-tools
    {
        position: static;
    }

    .timeline-quick-actions
    {
        overflow-x: visible;
    }

    .timeline-tool-menu
    {
        position: static;
        flex: 0 0 calc((100% - 10px) / 3);
        min-width: 0;
        max-width: 100%;
    }

    .timeline-tool-menu > summary
    {
        width: 100%;
        min-width: 0;
    }

    .timeline-tool-group
    {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
        gap: 4px;
        padding: 2px;
        flex: 1 1 100%;
    }

    .timeline-menu-panel
    {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 8px);
        z-index: 4000;
        max-height: 34dvh;
        overflow: auto;
    }

    .clip-type-grid
    {
        grid-auto-flow: row;
        grid-auto-columns: auto;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: none;
        box-sizing: border-box;
        width: auto;
    }

    .clip-type-tool
    {
        min-height: 28px;
        height: 28px;
        gap: 4px;
        padding: 3px 5px;
    }

    .clip-type-tool span:last-child
    {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .tool-glyph
    {
        min-width: 24px;
        height: 16px;
        padding: 0 2px;
        flex: 0 0 auto;
        font-size: 10px;
    }

    .export-menu-panel
    {
        align-items: stretch;
    }

    #export-size-controls
    {
        width: 100%;
        flex-wrap: wrap;
    }

    #timeline-viewport
    {
        max-height: none;
        scrollbar-width: auto;
    }

    #timeline-viewport::-webkit-scrollbar
    {
        width: 20px;
        height: 20px;
    }

    .timeline-clip.touch-drag-ready
    {
        outline: 3px solid rgba(141, 97, 255, 0.9);
        outline-offset: -3px;
    }

    .clip-resize-handle
    {
        width: 14px;
        background: rgba(210, 214, 228, 0.12);
        box-shadow: inset 0 0 0 1px rgba(141, 97, 255, 0.14);
    }
}

/* ==========================================================
   Mobile video editor renderer
   ========================================================== */

:root
{
    --mobile-bg: #090d14;
    --mobile-panel: #111722;
    --mobile-panel-2: #171d2b;
    --mobile-line: rgba(151, 161, 184, 0.18);
    --mobile-text: #c7cad7;
    --mobile-muted: #7d8495;
    --mobile-purple: #8d61ff;
    --mobile-purple-2: #6f44df;
    --ui-hover-bg: rgba(141, 97, 255, 0.16);
    --ui-hover-bg-strong: rgba(141, 97, 255, 0.24);
    --ui-hover-line: rgba(171, 139, 255, 0.62);
    --ui-hover-glow: rgba(190, 144, 255, 0.34);
    --mobile-green: #875dff;
    --mobile-blue: #7752e6;
    --track-label-w: 76px;
    --mobile-bottom-tool-row-height: 41px;
    --mobile-bottom-tools-height: calc(var(--mobile-bottom-tool-row-height) * 2);
}

:where(
    .timeline-tool,
    .mobile-icon-button,
    .mobile-project-title,
    .mobile-export-button,
    .mobile-popover-menu button,
    .mobile-export-presets button,
    .mobile-export-menu .mobile-export-primary,
    .mobile-playback-buttons button,
    .mobile-fit-button,
    .mobile-fullscreen-button,
    #mobile-bottom-tools button,
    #mobile-mode-tabs button,
    #mobile-side-rail button,
    #clip-transform-panel button,
    #clip-transform-panel select,
    #timeline-context-menu .ctx-item,
    #timeline-context-menu .ctx-control button,
    #timeline-context-menu .ctx-control select,
    #export-menu button,
    #export-menu select,
    .export-menu-panel button,
    .export-menu-panel select,
    .mobile-export-row input,
    .mobile-export-row select
)
{
    transition:
        background-color 0.16s ease,
        background 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        color 0.16s ease,
        filter 0.16s ease,
        font-weight 0.16s ease,
        text-shadow 0.16s ease,
        transform 0.16s ease;
}

@media (hover: hover)
{
    :where(
        .timeline-tool,
        .mobile-icon-button,
        .mobile-project-title,
        .mobile-export-button,
        .mobile-popover-menu button,
        .mobile-export-presets button,
        .mobile-export-menu .mobile-export-primary,
        .mobile-playback-buttons button,
        .mobile-fit-button,
        .mobile-fullscreen-button,
        #mobile-bottom-tools button,
        #mobile-mode-tabs button,
        #mobile-side-rail button,
        #clip-transform-panel button,
        #clip-transform-panel select,
        #timeline-context-menu .ctx-item,
        #timeline-context-menu .ctx-control button,
        #timeline-context-menu .ctx-control select,
        #export-menu button,
        #export-menu select,
        .export-menu-panel button,
        .export-menu-panel select,
        .mobile-export-row input,
        .mobile-export-row select
    ):where(:hover):not(:disabled)
    {
        color: #f4f1ff;
        border-color: var(--ui-hover-line);
        background:
            linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.018)),
            var(--ui-hover-bg);
        box-shadow:
            0 0 0 1px rgba(255,255,255,0.055) inset,
            0 0 18px rgba(141, 97, 255, 0.26),
            0 8px 24px rgba(0, 0, 0, 0.22);
        text-shadow:
            0 0 10px rgba(171, 139, 255, 0.42),
            0 0 18px var(--ui-hover-glow);
        filter: saturate(1.12) brightness(1.08);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        transform: translateY(-1px);
    }

    :where(
        .timeline-tool,
        .mobile-icon-button,
        .mobile-project-title,
        .mobile-export-button,
        .mobile-popover-menu button,
        .mobile-export-presets button,
        .mobile-export-menu .mobile-export-primary,
        .mobile-playback-buttons button,
        .mobile-fit-button,
        .mobile-fullscreen-button,
        #mobile-bottom-tools button,
        #mobile-mode-tabs button,
        #mobile-side-rail button,
        #clip-transform-panel button,
        #timeline-context-menu .ctx-item,
        #timeline-context-menu .ctx-control button,
        #export-menu button,
        .export-menu-panel button
    ):where(:hover):not(:disabled)
    {
        font-weight: 800;
    }

    :where(
        .timeline-tool,
        .mobile-icon-button,
        .mobile-project-title,
        .mobile-export-button,
        .mobile-popover-menu button,
        .mobile-export-presets button,
        .mobile-export-menu .mobile-export-primary,
        .mobile-playback-buttons button,
        .mobile-fit-button,
        .mobile-fullscreen-button,
        #mobile-bottom-tools button,
        #mobile-mode-tabs button,
        #mobile-side-rail button,
        #clip-transform-panel button,
        #timeline-context-menu .ctx-item,
        #timeline-context-menu .ctx-control button,
        #export-menu button,
        .export-menu-panel button
    ):where(:active):not(:disabled)
    {
        transform: translateY(0);
        box-shadow:
            0 0 0 1px rgba(171, 139, 255, 0.2) inset,
            0 0 10px rgba(141, 97, 255, 0.18);
        filter: brightness(0.96);
    }
}

:where(
    .timeline-tool,
    .mobile-icon-button,
    .mobile-project-title,
    .mobile-export-button,
    .mobile-popover-menu button,
    .mobile-export-presets button,
    .mobile-export-menu .mobile-export-primary,
    .mobile-playback-buttons button,
    .mobile-fit-button,
    .mobile-fullscreen-button,
    #mobile-bottom-tools button,
    #mobile-mode-tabs button,
    #mobile-side-rail button,
    #clip-transform-panel button,
    #clip-transform-panel select,
    #timeline-context-menu .ctx-control button,
    #timeline-context-menu .ctx-control select,
    #export-menu button,
    #export-menu select,
    .export-menu-panel button,
    .export-menu-panel select,
    .mobile-export-row input,
    .mobile-export-row select
):where(:focus-visible)
{
    outline: none;
    border-color: var(--ui-hover-line);
    box-shadow:
        0 0 0 2px rgba(141, 97, 255, 0.28),
        0 0 18px rgba(141, 97, 255, 0.22);
}

html,
body
{
    min-height: 100%;
    margin: 0;
    overscroll-behavior-x: auto !important;
    overscroll-behavior-y: auto !important;
    background:
        radial-gradient(circle at 50% -16%, rgba(91, 101, 130, 0.22), transparent 42%),
        linear-gradient(180deg, #0c1119 0%, #070a10 100%);
    color: var(--mobile-text);
    font-family: Inter, "SF Pro Display", "Segoe UI", Arial, sans-serif;
    text-align: left;
    padding-top: 0 !important;
    overflow-x: hidden;
}

body::before
{
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.025), transparent 12%, transparent 88%, rgba(255,255,255,0.018)),
        radial-gradient(circle at 35% 22%, rgba(255,255,255,0.05), transparent 20%);
    z-index: -1;
}

:root
{
    --mobile-asset-panel-height: min(320px, calc(100vh - 245px));
    --mobile-log-panel-height: min(92px, 15vh);
}

.menubar,
#app-menubar,
#ftp-upload-check,
.top-toggle-hidden,
body > .gui-button,
body > #output-resolution-label,
body > br,
#play_pause_btn,
#asset-panel.hidden,
#logContainer,
#scratchpad-container,
#scratchpad-replace-overlay,
#wallet_fileInput,
body > input[type="file"]:not(#videoFileInput):not(#audioFileInput):not(#imageFileInput):not(#projectFileInput):not(#projectAppendFileInput),
#timeline-stream-panel.collapsed,
#timeline-camera-panel.collapsed,
#timeline-audio-device-panel.collapsed
{
    display: none !important;
}

#webrtc-panel-shell.hidden
{
    display: none !important;
}

#webrtc-panel-shell.room-chat-overlay
{
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    padding: 16px;
    box-sizing: border-box;
    overflow: auto;
    background: rgba(3, 6, 11, 0.82);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

#webrtc-panel-shell.room-chat-overlay .private-wifi-chat-panel
{
    width: min(980px, calc(100vw - 24px));
    min-height: 0;
    max-height: calc(100dvh - 32px);
    margin: 0 auto;
    overflow: auto;
}

#webrtc-panel-shell.timeline-room-chat
{
    position: relative;
    inset: auto;
    z-index: 20;
    width: auto;
    margin: 12px;
}

#webrtc-panel-shell.timeline-room-chat .private-wifi-chat-panel
{
    min-height: 50vh;
}

#webrtc-panel-shell.timeline-room-chat .private-wifi-chat-grid
{
    grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
}

#webrtc-panel-shell.timeline-room-chat #private-wifi-chat-messages
{
    min-height: calc(50vh - 164px);
    max-height: calc(70vh - 164px);
}

#webrtc-panel-shell.timeline-room-chat .private-wifi-chat-media,
#webrtc-panel-shell.timeline-room-chat .private-wifi-chat-debug
{
    display: none;
}

body.private-chat-standalone
{
    min-height: 100vh;
    background: #05070b;
    overflow: hidden;
}

body.private-chat-standalone #webrtc-panel-shell.standalone-room-chat
{
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: block !important;
    width: auto;
    height: auto;
    padding: 14px;
    background: #05070b;
    overflow: auto;
}

body.private-chat-standalone #webrtc-panel-shell.standalone-room-chat .private-wifi-chat-panel
{
    min-height: calc(100vh - 28px);
    align-content: start;
}

body.private-chat-standalone #webrtc-panel-shell.standalone-room-chat .private-wifi-chat-setup,
body.private-chat-standalone #webrtc-panel-shell.standalone-room-chat .private-wifi-chat-actions,
body.private-chat-standalone #webrtc-panel-shell.standalone-room-chat #private-wifi-chat-qr-shell,
body.private-chat-standalone #webrtc-panel-shell.standalone-room-chat .private-wifi-chat-media,
body.private-chat-standalone #webrtc-panel-shell.standalone-room-chat .private-wifi-chat-debug
{
    display: none;
}

body.private-chat-standalone #webrtc-panel-shell.standalone-room-chat .private-wifi-chat-grid
{
    grid-template-columns: minmax(0, 1fr);
}

body.private-chat-standalone #webrtc-panel-shell.standalone-room-chat .private-wifi-chat-grid .private-wifi-chat-section:first-child
{
    display: none;
}

body.private-chat-standalone #webrtc-panel-shell.standalone-room-chat #private-wifi-chat-messages
{
    min-height: calc(100vh - 154px);
    max-height: calc(100vh - 154px);
}

#logContainer.mobile-debug-visible
{
    display: block !important;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(var(--mobile-bottom-tools-height) + var(--mobile-bottom-chrome-gap, 0px) + var(--mobile-asset-panel-height) + 6px);
    height: var(--mobile-log-panel-height);
    z-index: 9099;
    overflow: auto;
    padding: 8px;
    border: 1px solid rgba(151, 161, 184, 0.22);
    border-radius: 8px;
    background: rgba(5, 8, 13, 0.94);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.55);
}

#logContainer.mobile-debug-visible .logLine
{
    width: auto;
    margin: 0 0 5px;
    padding: 6px 7px;
    border-radius: 5px;
    font: 600 11px/1.35 Consolas, "SFMono-Regular", monospace;
}

#legacy-desktop-tail > br,
#legacy-desktop-tail > #myVideo
{
    display: none !important;
}

#webrtc-panel-shell
{
    display: block;
    margin: 0;
    padding: 14px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.035);
    border-bottom: 1px solid var(--mobile-line);
    background:
        linear-gradient(180deg, rgba(10, 15, 23, 0.98), rgba(7, 11, 17, 0.98));
    color: var(--mobile-text);
    font: 13px/1.35 Inter, "Segoe UI", Arial, sans-serif;
}

#webrtc-panel-shell .relay-config-box
{
    max-width: 980px;
    margin: 0 auto;
    padding: 14px;
    border: 1px solid rgba(151, 161, 184, 0.16);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(17, 23, 34, 0.72), rgba(9, 13, 20, 0.72));
    box-shadow:
        0 18px 42px rgba(0, 0, 0, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#webrtc-panel-shell .relay-row
{
    display: grid;
    gap: 6px;
    margin: 0 0 10px;
}

#webrtc-panel-shell label,
#webrtc-panel-shell .relay-row > div,
#webrtc-panel-shell [style*="font-size:12px"]
{
    color: #aeb4c4 !important;
    font: 700 12px/1.25 Inter, "Segoe UI", Arial, sans-serif !important;
    opacity: 1 !important;
}

#webrtc-panel-shell input
{
    width: 100%;
    min-height: 36px;
    border: 1px solid rgba(151, 161, 184, 0.24) !important;
    border-radius: 6px !important;
    background: rgba(7, 11, 17, 0.94) !important;
    color: #d9dced !important;
    -webkit-text-fill-color: #d9dced !important;
    caret-color: var(--mobile-purple) !important;
    padding: 7px 9px !important;
    box-sizing: border-box;
    font: 13px/1.25 Inter, "Segoe UI", Arial, sans-serif !important;
    box-shadow: none !important;
}

#webrtc-panel-shell input::placeholder
{
    color: rgba(184, 189, 204, 0.56) !important;
    -webkit-text-fill-color: rgba(184, 189, 204, 0.56) !important;
}

#webrtc-panel-shell input:focus
{
    outline: none;
    border-color: rgba(141, 97, 255, 0.64) !important;
    box-shadow: 0 0 0 2px rgba(141, 97, 255, 0.18) !important;
}

#webrtc-panel-shell .scratchpad-UX
{
    min-height: 32px;
    margin: 0 6px 6px 0;
    padding: 0 12px;
    border: 1px solid rgba(151, 161, 184, 0.22) !important;
    border-radius: 6px !important;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.014)),
        rgba(12, 17, 26, 0.86) !important;
    color: #d9dced !important;
    box-shadow: none !important;
    cursor: pointer;
    font: 800 12px/1 Inter, "Segoe UI", Arial, sans-serif !important;
    text-shadow: none !important;
}

#webrtc-panel-shell .scratchpad-UX:is(:hover, :focus-visible)
{
    color: #f4f1ff !important;
    border-color: var(--ui-hover-line) !important;
    outline: none;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.018)),
        var(--ui-hover-bg) !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.055) inset,
        0 0 18px rgba(141, 97, 255, 0.24) !important;
}

#webrtc-panel-shell hr
{
    margin: 12px 0 !important;
    border: 0 !important;
    border-top: 1px solid rgba(151, 161, 184, 0.14) !important;
}

#webrtc-panel-shell video
{
    width: 100% !important;
    max-width: 320px !important;
    min-height: 150px;
    border: 1px solid rgba(151, 161, 184, 0.18) !important;
    border-radius: 8px !important;
    background: #000 !important;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.035),
        0 10px 26px rgba(0, 0, 0, 0.28);
}

#webrtcStatus
{
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    margin-top: 8px !important;
    padding: 2px 8px;
    border: 1px solid rgba(141, 97, 255, 0.22);
    border-radius: 999px;
    background: rgba(141, 97, 255, 0.10);
    color: #f3efff !important;
    -webkit-text-fill-color: #f3efff !important;
    font: 800 12px/1 Inter, "Segoe UI", Arial, sans-serif !important;
    text-shadow: none !important;
}

.private-wifi-chat-header-actions
{
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

#webrtc-panel-shell .ai-chat-open-primary
{
    min-height: 36px;
    padding: 0 16px;
    border-color: rgba(62, 183, 231, 0.58) !important;
    background:
        linear-gradient(180deg, rgba(62, 183, 231, 0.32), rgba(141, 97, 255, 0.22)),
        rgba(9, 18, 28, 0.94) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08) inset,
        0 0 18px rgba(62, 183, 231, 0.26) !important;
}

.private-wifi-ai-chat-strip
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px;
    border: 1px solid rgba(62, 183, 231, 0.24);
    border-radius: 6px;
    background: rgba(62, 183, 231, 0.08);
    color: #d9dced;
    font: 800 12px/1.25 Inter, "Segoe UI", Arial, sans-serif;
}

#webrtc-panel-shell .private-wifi-chat-panel
{
    display: grid;
    gap: 12px;
}

.private-wifi-chat-header
{
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.private-wifi-chat-header h3
{
    margin: 0 0 4px;
    color: #f0f2f8;
    font: 800 16px/1.2 Inter, "Segoe UI", Arial, sans-serif;
    letter-spacing: 0;
}

#private-wifi-chat-identity
{
    color: var(--mobile-muted);
    font: 700 12px/1.25 Inter, "Segoe UI", Arial, sans-serif;
}

.private-wifi-chat-setup,
.private-wifi-chat-grid,
.private-wifi-chat-media
{
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.private-wifi-chat-actions
{
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.private-wifi-chat-section
{
    min-width: 0;
    display: grid;
    gap: 8px;
}

.private-wifi-chat-section-title
{
    color: #aeb4c4;
    font: 800 12px/1.2 Inter, "Segoe UI", Arial, sans-serif;
}

#private-wifi-chat-devices,
#private-wifi-chat-messages
{
    min-height: 164px;
    max-height: 240px;
    overflow: auto;
    border: 1px solid rgba(151, 161, 184, 0.16);
    border-radius: 7px;
    background: rgba(5, 8, 13, 0.54);
}

.private-wifi-chat-device,
.private-wifi-chat-empty,
.private-wifi-chat-message
{
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.private-wifi-chat-device
{
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 0;
    border-bottom: 1px solid rgba(151, 161, 184, 0.11);
    background: transparent;
    color: #d9dced;
    text-align: left;
    cursor: pointer;
    font: 700 12px/1.25 Inter, "Segoe UI", Arial, sans-serif;
}

.private-wifi-chat-device:hover,
.private-wifi-chat-device.active
{
    background: rgba(141, 97, 255, 0.14);
}

.private-wifi-chat-device strong,
.private-wifi-chat-message strong
{
    overflow-wrap: anywhere;
    color: #f0f2f8;
}

.private-wifi-chat-device span,
.private-wifi-chat-empty,
.private-wifi-chat-message small
{
    color: var(--mobile-muted);
    font: 650 11px/1.25 Inter, "Segoe UI", Arial, sans-serif;
}

.private-wifi-chat-empty
{
    padding: 12px;
}

.private-wifi-chat-message
{
    display: grid;
    gap: 3px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(151, 161, 184, 0.08);
    color: #d9dced;
    overflow-wrap: anywhere;
}

.private-wifi-chat-message-body
{
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.private-wifi-chat-link
{
    max-width: 100%;
    border: 1px solid rgba(110, 168, 255, 0.4);
    border-radius: 6px;
    background: rgba(42, 111, 255, 0.16);
    color: #dce9ff;
    cursor: pointer;
    font: 750 11px/1.2 Inter, "Segoe UI", Arial, sans-serif;
    padding: 5px 7px;
    text-align: left;
    overflow-wrap: anywhere;
}

.private-wifi-chat-link:hover
{
    background: rgba(42, 111, 255, 0.28);
}

.private-wifi-chat-image-preview
{
    display: block;
    width: min(220px, 100%);
    max-height: 150px;
    object-fit: cover;
    border: 1px solid rgba(151, 161, 184, 0.22);
    border-radius: 6px;
    cursor: pointer;
}

.private-wifi-chat-image-preview.attached
{
    flex-basis: min(280px, 100%);
    width: min(280px, 100%);
    max-height: 210px;
}

#private-wifi-shared-tab.hidden
{
    display: none;
}

#private-wifi-shared-tab
{
    position: fixed;
    right: 18px;
    top: 96px;
    z-index: 99998;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: min(560px, calc(100vw - 36px));
    height: min(520px, calc(100vh - 132px));
    border: 1px solid rgba(151, 161, 184, 0.28);
    border-radius: 8px;
    background: #05070b;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46);
    overflow: hidden;
}

.private-wifi-shared-tab-bar
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    padding: 9px 10px;
    border-bottom: 1px solid rgba(151, 161, 184, 0.18);
    background: rgba(18, 23, 34, 0.98);
}

.private-wifi-shared-tab-bar strong
{
    min-width: 0;
    color: #f2f5ff;
    font: 800 12px/1.2 Inter, "Segoe UI", Arial, sans-serif;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.private-wifi-shared-tab-actions
{
    display: flex;
    align-items: center;
    gap: 6px;
}

.private-wifi-shared-tab-actions a,
.private-wifi-shared-tab-actions button
{
    border: 1px solid rgba(151, 161, 184, 0.24);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
    color: #eef3ff;
    cursor: pointer;
    font: 800 11px/1 Inter, "Segoe UI", Arial, sans-serif;
    padding: 7px 9px;
    text-decoration: none;
}

.private-wifi-shared-tab-body
{
    min-height: 0;
    background: #000;
}

#private-wifi-shared-tab-frame,
#private-wifi-shared-tab-image
{
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

#private-wifi-shared-tab-image
{
    object-fit: contain;
}

.private-wifi-chat-message.local
{
    background: rgba(72, 187, 120, 0.08);
}

.private-wifi-chat-message.remote
{
    background: rgba(141, 97, 255, 0.08);
}

.private-wifi-chat-message-row
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
}

.private-wifi-chat-attach
{
    min-width: 64px;
}

#private-wifi-chat-qr-shell.hidden,
#private-wifi-chat-scanner.hidden
{
    display: none;
}

#private-wifi-chat-qr-shell
{
    display: grid;
    gap: 10px;
    justify-items: center;
    padding: 10px;
    border: 1px solid rgba(151, 161, 184, 0.14);
    border-radius: 7px;
    background: rgba(5, 8, 13, 0.45);
}

#private-wifi-chat-qr
{
    line-height: 0;
    background: #ffffff;
}

#private-wifi-chat-qr canvas,
#private-wifi-chat-qr img
{
    display: block;
    width: min(224px, calc(100vw - 88px));
    height: min(224px, calc(100vw - 88px));
    image-rendering: pixelated;
}

#private-wifi-chat-link
{
    width: min(520px, 100%);
}

#private-wifi-chat-scanner
{
    position: relative;
    width: min(520px, 100%);
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid rgba(141, 97, 255, 0.46);
    border-radius: 7px;
    background: #000;
}

#private-wifi-chat-scan-video
{
    width: 100% !important;
    max-width: none !important;
    height: 100%;
    object-fit: cover;
}

#private-wifi-chat-scan-guide
{
    position: absolute;
    left: 50%;
    top: 50%;
    width: min(58%, 260px);
    aspect-ratio: 1 / 1;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, 0.82);
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.28);
    pointer-events: none;
}

.private-wifi-chat-debug
{
    border-top: 1px solid rgba(151, 161, 184, 0.14);
    padding-top: 8px;
}

.private-wifi-chat-debug summary
{
    cursor: pointer;
    color: #aeb4c4;
    font: 800 12px/1.2 Inter, "Segoe UI", Arial, sans-serif;
}

@media (max-width: 760px)
{
    .private-wifi-chat-header,
    .private-wifi-chat-setup,
    .private-wifi-chat-grid,
    .private-wifi-chat-media
    {
        grid-template-columns: 1fr;
    }

    .private-wifi-chat-header
    {
        display: grid;
    }

    #private-wifi-chat-devices,
    #private-wifi-chat-messages
    {
        max-height: 190px;
    }
}

#timeline-stream-panel,
#timeline-camera-panel,
#timeline-audio-device-panel
{
    border-top: 1px solid rgba(255, 255, 255, 0.035) !important;
    border-bottom: 1px solid var(--mobile-line) !important;
    background:
        linear-gradient(180deg, rgba(10, 15, 23, 0.98), rgba(7, 11, 17, 0.98)) !important;
    color: #b8bdcc !important;
    font: 13px/1.35 Inter, "Segoe UI", Arial, sans-serif !important;
}

#timeline-stream-panel
{
    padding: 12px 14px !important;
}

#timeline-camera-panel,
#timeline-audio-device-panel
{
    padding: 12px 14px !important;
}

.timeline-stream-controls,
.timeline-camera-header,
.timeline-camera-body,
.timeline-audio-device-header,
.timeline-audio-device-body
{
    color: #b8bdcc !important;
    font: 13px/1.35 Inter, "Segoe UI", Arial, sans-serif !important;
}

#timeline-stream-status,
#timeline-camera-status,
#timeline-audio-device-status,
#phone-camera-status
{
    color: var(--mobile-muted) !important;
    font: 13px/1.35 Inter, "Segoe UI", Arial, sans-serif !important;
}

#timeline-stream-status.active
{
    color: #a8f0c4 !important;
}

.timeline-stream-controls input,
.timeline-stream-controls select,
#timeline-phone-camera-link,
#timeline-phone-camera-code,
#phone-camera-select,
#phone-camera-invite-code,
#phone-camera-panel input,
#phone-camera-panel textarea,
#phone-camera-panel select
{
    min-height: 36px;
    border: 1px solid rgba(151, 161, 184, 0.24) !important;
    border-radius: 6px !important;
    background: rgba(7, 11, 17, 0.94) !important;
    color: #d9dced !important;
    -webkit-text-fill-color: #d9dced !important;
    caret-color: var(--mobile-purple) !important;
    padding: 7px 9px !important;
    box-sizing: border-box;
    font: 13px/1.25 Inter, "Segoe UI", Arial, sans-serif !important;
    box-shadow: none !important;
}

.timeline-stream-controls input::placeholder,
#timeline-phone-camera-link::placeholder,
#timeline-phone-camera-code::placeholder,
#phone-camera-invite-code::placeholder
{
    color: rgba(184, 189, 204, 0.56) !important;
    -webkit-text-fill-color: rgba(184, 189, 204, 0.56) !important;
}

.timeline-stream-destination input[type="checkbox"]
{
    width: 20px;
    height: 20px;
    accent-color: var(--mobile-purple) !important;
}

#timeline-stream-panel .timeline-tool,
#timeline-camera-panel .timeline-tool,
#timeline-audio-device-panel .timeline-tool,
#phone-camera-buttons button,
#phone-camera-connect-code,
#phone-camera-close
{
    min-height: 38px;
    border: 1px solid rgba(151, 161, 184, 0.24) !important;
    border-radius: 7px !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015)),
        rgba(18, 24, 34, 0.9) !important;
    color: #d9dced !important;
    font: 700 13px/1 Inter, "Segoe UI", Arial, sans-serif !important;
    text-shadow: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    transition:
        background-color 0.16s ease,
        background 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        color 0.16s ease,
        filter 0.16s ease,
        text-shadow 0.16s ease,
        transform 0.16s ease;
}

#timeline-stream-panel .panel-close-tool,
#timeline-camera-panel .panel-close-tool,
#timeline-audio-device-panel .panel-close-tool
{
    margin-left: auto;
    color: #b8bdcc !important;
    background: rgba(10, 15, 23, 0.74) !important;
}

#timeline-stream-panel .timeline-tool:is(:hover, :active, :focus-visible),
#timeline-camera-panel .timeline-tool:is(:hover, :active, :focus-visible),
#timeline-audio-device-panel .timeline-tool:is(:hover, :active, :focus-visible),
#phone-camera-buttons button:is(:hover, :active, :focus-visible),
#phone-camera-connect-code:is(:hover, :active, :focus-visible),
#phone-camera-close:is(:hover, :active, :focus-visible)
{
    border-color: rgba(141, 97, 255, 0.56) !important;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.018)),
        var(--ui-hover-bg) !important;
    color: #ffffff !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.055) inset,
        0 0 18px rgba(141, 97, 255, 0.26),
        0 8px 24px rgba(0, 0, 0, 0.22) !important;
    text-shadow:
        0 0 10px rgba(171, 139, 255, 0.42),
        0 0 18px var(--ui-hover-glow) !important;
    filter: saturate(1.12) brightness(1.08);
    outline: none;
}

#timeline-stream-panel .timeline-tool:active,
#timeline-camera-panel .timeline-tool:active,
#timeline-audio-device-panel .timeline-tool:active,
#phone-camera-buttons button:active,
#phone-camera-connect-code:active,
#phone-camera-close:active
{
    transform: translateY(0);
    filter: brightness(0.96);
}

#timeline-stream-panel,
#timeline-camera-panel,
#timeline-audio-device-panel,
#phone-camera-panel
{
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#timeline-stream-panel :where(button, label, .timeline-camera-source, .timeline-camera-source *),
#timeline-camera-panel :where(button, label, .timeline-camera-source, .timeline-camera-source *),
#timeline-audio-device-panel :where(button, label, .timeline-audio-device-source, .timeline-audio-device-source *),
#phone-camera-panel :where(button, label)
{
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

#timeline-stream-panel :where(input, select),
#timeline-camera-panel :where(input, select),
#timeline-audio-device-panel :where(input, select),
#phone-camera-panel :where(input, select)
{
    -webkit-user-select: text;
    user-select: text;
}

#timeline-stream-panel :where(button, label, .timeline-camera-source, .timeline-camera-source *)::selection,
#timeline-camera-panel :where(button, label, .timeline-camera-source, .timeline-camera-source *)::selection,
#timeline-audio-device-panel :where(button, label, .timeline-audio-device-source, .timeline-audio-device-source *)::selection,
#phone-camera-panel :where(button, label)::selection
{
    color: inherit;
    -webkit-text-fill-color: inherit;
    background: transparent;
}

#timeline-stream-panel ::selection,
#timeline-camera-panel ::selection,
#timeline-audio-device-panel ::selection,
#phone-camera-panel ::selection
{
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    background: rgba(141, 97, 255, 0.55);
}

.timeline-camera-source,
.timeline-audio-device-source
{
    border: 1px solid rgba(151, 161, 184, 0.24) !important;
    border-radius: 7px !important;
    background: rgba(14, 20, 30, 0.9) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
    -webkit-tap-highlight-color: transparent !important;
    transition:
        background-color 0.16s ease,
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        color 0.16s ease,
        filter 0.16s ease,
        transform 0.16s ease;
}

.timeline-camera-source:is(:hover, :active, :focus-visible),
.timeline-audio-device-source:is(:hover, :active, :focus-visible)
{
    border-color: rgba(141, 97, 255, 0.56) !important;
    background: rgba(141, 97, 255, 0.14) !important;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.045) inset,
        0 0 18px rgba(141, 97, 255, 0.22) !important;
    outline: none;
}

.timeline-camera-source.touch-drag-ready
{
    outline: 2px solid rgba(141, 97, 255, 0.82) !important;
    box-shadow: 0 0 18px rgba(141, 97, 255, 0.34) !important;
}

.timeline-camera-source-drag-ghost
{
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 100000 !important;
    width: 220px !important;
    pointer-events: none !important;
    opacity: 0.92 !important;
    transform: translate(-9999px, -9999px);
    box-shadow: 0 18px 34px rgba(0, 0, 0, 0.42), 0 0 18px rgba(141, 97, 255, 0.34) !important;
}

.timeline-camera-source-title,
.timeline-audio-device-source-title
{
    color: #f0f2f8 !important;
    font: 800 14px/1.2 Inter, "Segoe UI", Arial, sans-serif !important;
}

.timeline-camera-source-meta,
.timeline-audio-device-source-meta
{
    color: var(--mobile-muted) !important;
    font: 12px/1.25 Inter, "Segoe UI", Arial, sans-serif !important;
}

.timeline-camera-source-kind,
.timeline-audio-device-source-kind
{
    border: 1px solid rgba(141, 97, 255, 0.42) !important;
    border-radius: 5px !important;
    background: rgba(141, 97, 255, 0.12) !important;
    color: #c9bcff !important;
    font: 800 11px/1 Inter, "Segoe UI", Arial, sans-serif !important;
}

#timeline-phone-camera-qr,
#phone-camera-preview,
#phone-camera-scanner,
#timeline-stream-preview
{
    border: 1px solid rgba(151, 161, 184, 0.24) !important;
    border-radius: 7px !important;
    background: rgba(4, 7, 12, 0.96) !important;
    box-shadow: none !important;
}

#phone-camera-panel
{
    background: rgba(7, 11, 17, 0.98) !important;
    color: #b8bdcc !important;
    font: 14px/1.35 Inter, "Segoe UI", Arial, sans-serif !important;
}

#phone-camera-title
{
    color: #f0f2f8 !important;
}

@media (max-width: 700px)
{
    #timeline-stream-panel,
    #timeline-camera-panel,
    #timeline-audio-device-panel
    {
        display: block;
    }

    .timeline-stream-controls,
    .timeline-camera-header,
    .timeline-audio-device-header
    {
        gap: 8px;
    }

    .timeline-stream-destination
    {
        grid-template-columns: 22px minmax(118px, 1fr) minmax(104px, 1fr) 72px auto auto auto;
        gap: 8px;
    }

    .timeline-stream-destination input[type="text"],
    .timeline-stream-destination input[type="password"]
    {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
    }

    .timeline-stream-destination button
    {
        min-width: 0;
    }

    #timeline-stream-preview
    {
        margin-top: 12px;
        max-height: 260px;
    }

    #timeline-camera-sources
    {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        min-width: 0;
        width: 100%;
    }

    #timeline-phone-camera-invite
    {
        width: 100%;
    }
}

#mobile-editor-chrome
{
    height: 96px;
    position: sticky;
    top: 0;
    z-index: 5200;
    border-bottom: 1px solid var(--mobile-line);
    background: rgba(8, 12, 19, 0.94);
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.35);
}

#mobile-status-bar
{
    height: 0;
    display: none;
    align-items: center;
    justify-content: flex-start;
    padding: 0 56px;
    box-sizing: border-box;
    color: #f5f6fb;
    font-weight: 800;
    letter-spacing: 0;
}

.mobile-status-time
{
    font-size: 27px;
    line-height: 1;
    user-select: none;
}

.mobile-status-period
{
    font-size: 0.58em;
    font-weight: 800;
    vertical-align: 0.18em;
    letter-spacing: 0;
}

#mobile-project-bar
{
    height: 96px;
    display: grid;
    grid-template-columns: 78px 1fr 74px 74px 74px 56px 44px auto;
    align-items: center;
    gap: 10px;
    padding: 0 22px 0 25px;
    box-sizing: border-box;
}

.mobile-popover-menu
{
    position: fixed;
    top: 88px;
    left: 26px;
    z-index: 6000;
    width: 230px;
    padding: 8px;
    display: grid;
    gap: 4px;
    border: 1px solid rgba(151, 161, 184, 0.22);
    border-radius: 8px;
    background: rgba(13, 18, 28, 0.98);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.42);
    max-height: min(70dvh, 560px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(141, 97, 255, 0.64) rgba(12, 17, 26, 0.96);
}

.mobile-popover-menu.hidden
{
    display: none !important;
}

.mobile-popover-menu button
{
    height: 38px;
    border: 0;
    border-radius: 5px;
    padding: 0 12px 0 8px;
    background: transparent;
    color: #d2d6e4;
    text-align: left;
    font: 15px/1 "Segoe UI", Arial, sans-serif;
    cursor: pointer;
    display: grid;
    grid-template-columns: 30px 1fr;
    align-items: center;
    gap: 6px;
}

.mobile-popover-menu button::before
{
    content: "";
    color: #aeb4c4;
    font: 22px/1 "Segoe UI Symbol", "Segoe UI", Arial, sans-serif;
    text-align: center;
}

.mobile-popover-menu button[onclick*="newTimelineProject"]::before { content: "+"; }
.mobile-popover-menu button[onclick*="openPreferencesDialog"]::before { content: "*"; }
.mobile-popover-menu button[onclick*="openPrivacyPolicyDialog"]::before { content: "\25C7"; }
.mobile-popover-menu button[onclick*="openProfileAndBilling"]::before { content: "\2699"; }
.mobile-popover-menu button[onclick*="mobileLogoutAccount"]::before { content: "\21E5"; }
.mobile-popover-menu button[onclick*="renameTimelineProject"]::before { content: "T"; }
.mobile-popover-menu button[onclick*="openTimelineProjectFile"]::before { content: "\25A1"; }
.mobile-popover-menu button[onclick*="openTimelineProjectAppendFile"]::before { content: "\2295"; }
.mobile-popover-menu button[onclick*="saveTimelineProject"]::before { content: "\25A3"; }
.mobile-popover-menu button[onclick*="mobileShareProject"]::before { content: "\21E7"; }
.mobile-popover-menu button[onclick*="openVideoFile"]::before { content: "\25B7"; }
.mobile-popover-menu button[onclick*="openAudioFile"]::before { content: "\266A"; }
.mobile-popover-menu button[onclick*="openImageFile"]::before { content: "\25A7"; }
.mobile-popover-menu button[onclick*="exportTimelineAudio"]::before { content: "\266B"; }
.mobile-popover-menu button[onclick*="exportTimelineMP4"]::before { content: "\25A3"; }
.mobile-popover-menu button[onclick*="exportTimelineGIF"]::before { content: "\25A8"; }
.mobile-popover-menu button[onclick*="saveCompositorPNG"]::before { content: "\25C7"; }
.mobile-popover-menu button[onclick*="useProjectSizeForExport"]::before { content: "\2317"; }
.mobile-popover-menu button[onclick*="swapExportFrameSize"]::before { content: "\21C4"; }
.mobile-popover-menu button[onclick*="undoTimeline"]::before { content: "\21B6"; }
.mobile-popover-menu button[onclick*="redoTimeline"]::before { content: "\21B7"; }
.mobile-popover-menu button[onclick*="cutClip"]::before { content: "\2702"; }
.mobile-popover-menu button[onclick*="copyClip"]::before { content: "\29C9"; }
.mobile-popover-menu button[onclick*="pasteClip"]::before { content: "\25A4"; }
.mobile-popover-menu button[onclick*="mobileDeleteSelection"]::before { content: "\232B"; }
.mobile-popover-menu button[onclick*="selectAllTimelineClips"]::before { content: "\25A3"; }
.mobile-popover-menu button[onclick*="deselectTimelineClips"]::before { content: "\25A1"; }
.mobile-popover-menu button[onclick*="invertTimelineClipSelection"]::before { content: "\25C8"; }
.mobile-popover-menu button[onclick*="setCurrentClipSelectionStart"]::before { content: "["; }
.mobile-popover-menu button[onclick*="setCurrentClipSelectionEnd"]::before { content: "]"; }
.mobile-popover-menu button[onclick*="clearTimelineRangeSelection"]::before { content: "\00D7"; }
.mobile-popover-menu button[onclick*="flipCurrentClipHorizontal"]::before { content: "\2194"; }
.mobile-popover-menu button[onclick*="flipCurrentClipVertical"]::before { content: "\2195"; }
.mobile-popover-menu button[onclick*="applyFadeToCurrentAudioClip(true"]::before { content: "\25D0"; }
.mobile-popover-menu button[onclick*="applyFadeToCurrentAudioClip(false"]::before { content: "\25D1"; }
.mobile-popover-menu button[onclick*="mergeClipToMatch"]::before { content: "\2387"; }
.mobile-popover-menu button[onclick*="addAudioCancellationRegionForClip"]::before { content: "\2212"; }
.mobile-popover-menu button[onclick*="toggleMainTransformScope"]::before { content: "\25A3"; }
.mobile-popover-menu button[onclick*="toggleTimelineLoop"]::before { content: "\21BB"; }
.mobile-popover-menu button[onclick*="loadAlignmentFromFile"]::before { content: "T"; }
.mobile-popover-menu button[onclick*="tool-speech"]::before { content: "\25D4"; }
.mobile-popover-menu button[onclick*="tool-speech2text"]::before { content: "\25D5"; }
.mobile-popover-menu button[onclick*="mobileOpenCameraPanel"]::before { content: "\25A3"; }
.mobile-popover-menu button[onclick*="showTimelinePhoneCameraInvite"]::before { content: "\25A6"; }
.mobile-popover-menu button[onclick*="startTimelinePhoneCameraQrScan"]::before { content: "\25CE"; }
.mobile-popover-menu button[onclick*="mobileOpenStreamPanel"]::before { content: "\25CF"; }
.mobile-popover-menu button[onclick*="mobileToggleWebRTCPanel"]::before { content: "\25C9"; }

.mobile-help-menu
{
    width: 264px;
    padding: 10px;
}

.mobile-help-menu-heading
{
    display: grid;
    gap: 4px;
    padding: 7px 10px 10px;
    border-bottom: 1px solid rgba(174, 180, 196, 0.18);
    margin-bottom: 3px;
}

.mobile-help-menu-heading strong
{
    color: #f5f2ff;
    font: 700 15px/1.2 "Segoe UI", Arial, sans-serif;
}

.mobile-help-menu-heading span
{
    color: #959db1;
    font: 12px/1.35 "Segoe UI", Arial, sans-serif;
}

.mobile-help-menu button.mobile-help-live::before { content: "\1F4AC"; font-size: 15px; }
.mobile-help-menu button.mobile-help-shortcuts::before { content: "\2328"; }
.mobile-help-menu button.mobile-help-tutorials::before { content: "\25B7"; }
.mobile-help-menu button.mobile-help-gesture::before { content: "\2197"; }

.mobile-menu-separator
{
    height: 14px;
    display: flex;
    align-items: center;
    margin: 1px 5px;
    pointer-events: none;
}

.mobile-menu-separator::before
{
    content: "";
    display: block;
    width: 100%;
    border-top: 1px solid rgba(174, 180, 196, 0.28);
    box-shadow: 0 1px 0 rgba(141, 97, 255, 0.16);
}

.mobile-popover-menu button:hover
{
    background: rgba(141, 97, 255, 0.18);
    color: #fff;
}

.mobile-account-summary
{
    min-height: 52px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 5px 6px 7px;
}

.mobile-account-summary.hidden,
.mobile-account-profile.hidden,
.mobile-account-logout.hidden,
.mobile-menu-separator.hidden
{
    display: none !important;
}

.mobile-account-avatar
{
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #8d61ff, #22c7d8);
    background-size: cover;
    background-position: center;
    color: #fff;
    font: 700 13px/1 "Segoe UI", Arial, sans-serif;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.mobile-account-avatar.has-image
{
    color: transparent;
}

.mobile-account-copy
{
    min-width: 0;
    display: grid;
    gap: 4px;
    text-align: left;
}

.mobile-account-copy strong,
.mobile-account-copy span
{
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-account-copy strong
{
    color: #f2f5ff;
    font: 600 14px/1.15 "Segoe UI", Arial, sans-serif;
}

.mobile-account-copy span
{
    color: #8f98ad;
    font: 12px/1.15 "Segoe UI", Arial, sans-serif;
}

.mobile-popover-menu .mobile-account-logout
{
    color: #ffd8df;
}

.mobile-export-menu
{
    width: 320px;
}

.mobile-export-menu .hidden
{
    display: none !important;
}

.mobile-export-row
{
    min-height: 42px;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    color: #d2d6e4;
    font: 14px/1.2 "Segoe UI", Arial, sans-serif;
}

.mobile-export-row select,
.mobile-export-row input
{
    width: 100%;
    min-width: 0;
    height: 34px;
    border: 1px solid rgba(151, 161, 184, 0.24);
    border-radius: 5px;
    padding: 0 8px;
    box-sizing: border-box;
    background: rgba(7, 11, 17, 0.96);
    color: #eef1fb;
    font: inherit;
}

.export-aspect-lock,
.mobile-export-aspect-lock-row
{
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.export-aspect-lock
{
    gap: 7px;
    padding: 0 !important;
    min-height: 24px;
    height: 24px;
    color: #c7cad7;
}

#export-aspect-lock,
#mobile-export-aspect-lock
{
    appearance: none;
    -webkit-appearance: none;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    padding: 0 !important;
    border: 1px solid rgba(174, 180, 196, 0.42) !important;
    border-radius: 4px;
    background: rgba(7, 11, 17, 0.22) !important;
    display: inline-grid;
    place-content: center;
    cursor: pointer;
}

#export-aspect-lock::before,
#mobile-export-aspect-lock::before
{
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 2px;
    background: var(--mobile-purple);
    transform: scale(0);
    transition: transform 0.12s ease;
}

#export-aspect-lock:checked::before,
#mobile-export-aspect-lock:checked::before
{
    transform: scale(1);
}

.mobile-export-size-fields
{
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
}

.mobile-export-presets
{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 4px 0;
}

.mobile-export-presets button,
.mobile-export-menu .mobile-export-primary
{
    text-align: center;
}

.mobile-export-menu .mobile-export-primary
{
    background: linear-gradient(135deg, var(--mobile-purple), #6f4be4);
    color: #fff;
    font-weight: 800;
}

.mobile-export-menu .export-pro-notice
{
    margin: 6px 0;
    flex-direction: column;
    align-items: stretch;
}

.mobile-export-menu .export-pro-notice button
{
    width: 100%;
    text-align: center;
}

#export-progress
{
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: max(18px, env(safe-area-inset-top, 0px)) max(18px, env(safe-area-inset-right, 0px)) max(18px, env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
    box-sizing: border-box;
    z-index: 99999;
    background: rgba(3, 5, 10, 0.74);
    backdrop-filter: blur(12px);
}

#export-progress > div
{
    width: min(440px, 100%) !important;
    box-sizing: border-box;
    padding: 22px !important;
    border: 1px solid rgba(139, 92, 246, 0.46) !important;
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(25, 30, 43, 0.96), rgba(12, 16, 25, 0.98)) !important;
    color: #f3f5ff !important;
    font-family: Arial, Helvetica, sans-serif !important;
    box-shadow:
        0 22px 70px rgba(0, 0, 0, 0.54),
        0 0 0 1px rgba(255, 255, 255, 0.035) inset;
}

#export-text
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #f7f7ff;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
}

#export-text::before
{
    content: "Rendering";
    color: #9aa2b8;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

#export-preview-strip
{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 16px;
}

.export-preview-card
{
    position: relative;
    height: 78px;
    overflow: hidden;
    border: 1px solid rgba(151, 161, 184, 0.16);
    border-radius: 7px;
    background:
        radial-gradient(circle at 20% 20%, rgba(141, 97, 255, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(7, 11, 18, 0.96), rgba(4, 7, 12, 0.98));
    box-shadow:
        0 0 18px rgba(141, 97, 255, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.025) inset;
}

.export-preview-card::before
{
    position: absolute;
    left: 9px;
    top: 7px;
    z-index: 2;
    color: rgba(229, 232, 244, 0.72);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.export-video-preview::before
{
    content: "Video frame";
}

.export-audio-preview::before
{
    content: "Audio frame";
}

.export-preview-card canvas
{
    width: 100%;
    height: 100%;
    display: block;
}

.export-video-preview canvas
{
    opacity: 0.86;
}

#export-progress-track
{
    position: relative;
    width: 100% !important;
    height: 12px !important;
    margin: 18px 0 20px !important;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.09) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.055) inset;
}

#export-bar
{
    height: 100% !important;
    min-width: 2px;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--mobile-purple), #b88cff) !important;
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.32);
    transition: width 0.18s ease;
}

#export-keep-recording,
#export-cancel
{
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: min(220px, 100%);
    min-height: 42px;
    margin: 0 auto !important;
    padding: 0 18px !important;
    border: 1px solid rgba(174, 180, 196, 0.22) !important;
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.065) !important;
    color: transparent !important;
    font-size: 0;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    box-shadow: none !important;
}

#export-keep-recording
{
    display: none !important;
    margin-bottom: 10px !important;
}

#export-cancel::after
{
    content: "Cancel";
    color: #eef1fb;
    font-size: 14px;
    line-height: 1;
}

#export-keep-recording::after
{
    content: "Keep recording blob";
    color: #eef1fb;
    font-size: 14px;
    line-height: 1;
}

#export-progress.recording-finalize #export-keep-recording
{
    display: flex !important;
}

#export-progress.recording-finalize #export-cancel::after
{
    content: "Cancel recording";
}

#export-keep-recording:hover
{
    border-color: rgba(141, 97, 255, 0.62) !important;
    background: rgba(141, 97, 255, 0.16) !important;
}

#export-cancel:hover
{
    border-color: rgba(255, 95, 122, 0.55) !important;
    background: rgba(255, 95, 122, 0.13) !important;
}

#project-load-indicator
{
    position: fixed;
    right: max(18px, env(safe-area-inset-right, 0px));
    top: calc(104px + env(safe-area-inset-top, 0px));
    z-index: 7000;
    display: none;
    pointer-events: none;
}

#project-load-indicator.active
{
    display: block;
}

.project-load-card
{
    min-width: 210px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border: 1px solid rgba(139, 92, 246, 0.38);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(23, 28, 41, 0.96), rgba(10, 14, 22, 0.98));
    box-shadow:
        0 18px 44px rgba(0, 0, 0, 0.42),
        0 0 24px rgba(141, 97, 255, 0.20),
        0 0 0 1px rgba(255, 255, 255, 0.035) inset;
    color: #eef1fb;
}

.project-load-main
{
    min-width: 0;
}

#project-load-indicator.model-progress-active .project-load-card
{
    min-width: min(340px, calc(100vw - 36px));
}

.project-load-card strong,
.project-load-card span
{
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-load-card strong
{
    color: #f4f1ff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.15;
}

.project-load-card span
{
    margin-top: 3px;
    color: #9aa2b8;
    font-size: 11px;
    line-height: 1.2;
}

.project-load-model-progress
{
    margin-top: 8px;
}

.project-load-model-progress[hidden]
{
    display: none;
}

.project-load-model-progress-track
{
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(154, 162, 184, 0.18);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.project-load-model-progress-track span
{
    width: 0;
    height: 100%;
    margin: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #8055ff, #b58cff);
    box-shadow: 0 0 12px rgba(141, 97, 255, 0.58);
    transition: width 120ms linear;
}

#project-load-indicator.model-progress-indeterminate
    .project-load-model-progress-track span
{
    width: 38% !important;
    animation: project-load-model-indeterminate 1.15s ease-in-out infinite;
}

#project-load-model-progress-detail
{
    margin-top: 5px;
    color: #b1b8ca;
    font-variant-numeric: tabular-nums;
}

@keyframes project-load-model-indeterminate
{
    0% { transform: translateX(-120%); }
    55% { transform: translateX(105%); }
    100% { transform: translateX(275%); }
}

.project-load-pulse
{
    width: 32px;
    height: 32px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: end;
    gap: 3px;
    padding: 7px 6px;
    box-sizing: border-box;
    border-radius: 7px;
    background: rgba(141, 97, 255, 0.12);
    box-shadow: 0 0 18px rgba(141, 97, 255, 0.22);
}

.project-load-pulse span
{
    display: block;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(180deg, #a77dff, #b88cff);
    box-shadow: 0 0 10px rgba(167, 125, 255, 0.58);
    animation: projectLoadPulse 0.88s ease-in-out infinite;
}

.project-load-pulse span:nth-child(2)
{
    animation-delay: 0.12s;
}

.project-load-pulse span:nth-child(3)
{
    animation-delay: 0.24s;
}

@keyframes projectLoadPulse
{
    0%,
    100%
    {
        height: 7px;
        opacity: 0.58;
    }

    50%
    {
        height: 18px;
        opacity: 1;
    }
}

.mobile-icon-button,
.mobile-project-title,
.mobile-donate-button,
.mobile-export-button
{
    border: 0;
    background: transparent;
    color: #aeb3c4;
    cursor: pointer;
    font: inherit;
}

.mobile-donate-button
{
    width: 44px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    position: relative;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #bca9ff;
    font-size: 25px;
    line-height: 1;
    transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.mobile-donate-button::before
{
    content: "+";
    position: absolute;
    top: 4px;
    left: 7px;
    color: #a98cff;
    font: 900 13px/1 Inter, "Segoe UI", sans-serif;
}

.mobile-donate-button span
{
    transform: translate(2px, 2px);
}

.mobile-donate-button:hover,
.mobile-donate-button:focus-visible
{
    outline: none;
    background: rgba(124, 58, 237, 0.13);
    color: #ddd4ff;
    box-shadow: 0 0 18px rgba(124, 58, 237, 0.16);
}

.mobile-donate-button:active
{
    transform: translateY(1px);
}

.mobile-icon-button
{
    width: 56px;
    height: 56px;
    display: inline-grid;
    place-items: center;
    color: #aeb3c4;
    font-size: 42px;
    line-height: 1;
}

.mobile-home::before
{
    content: "";
    width: 34px;
    height: 30px;
    background: currentColor;
    clip-path: polygon(50% 0, 100% 38%, 88% 38%, 88% 100%, 61% 100%, 61% 67%, 39% 67%, 39% 100%, 12% 100%, 12% 38%, 0 38%);
}

.mobile-project-title
{
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    color: #b9bdca;
}

.mobile-project-title .mobile-project-chevron
{
    width: 11px;
    height: 11px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-4px);
}

#mobile-project-name
{
    min-width: 0;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-project-name-input
{
    width: min(240px, 42vw);
    height: 34px;
    border: 1px solid rgba(141, 97, 255, 0.72) !important;
    border-radius: 4px;
    padding: 0 8px;
    box-sizing: border-box;
    background: rgba(8, 12, 19, 0.94) !important;
    color: #f3f0ff !important;
    -webkit-text-fill-color: #f3f0ff !important;
    caret-color: var(--mobile-purple) !important;
    font: inherit;
    outline: none;
    box-shadow: 0 0 0 2px rgba(141, 97, 255, 0.18) !important;
    text-shadow: 0 0 8px rgba(141, 97, 255, 0.28);
}

.mobile-project-name-input:focus
{
    border-color: rgba(167, 125, 255, 0.9) !important;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        0 0 18px rgba(141, 97, 255, 0.34) !important;
}

.mobile-project-name-input::selection
{
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    background: rgba(141, 97, 255, 0.55) !important;
}

.mobile-share::before
{
    content: "⇧";
    font-size: 40px;
}

.mobile-more::before
{
    content: "⋮";
    font-size: 42px;
}

.mobile-more
{
    position: relative;
}

.mobile-cart-toolbar-count
{
    position: absolute;
    top: 1px;
    right: -2px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    box-sizing: border-box;
    border: 2px solid #090e16;
    border-radius: 999px;
    background: #8d61ff;
    color: #fff;
    font: 800 10px/13px "Segoe UI", Arial, sans-serif;
    text-align: center;
}

.mobile-cart-toolbar-count[hidden]
{
    display: none;
}

.mobile-popover-menu button.mobile-cart-button
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.mobile-cart-count
{
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #8d61ff;
    color: #fff;
    font: 800 11px/22px "Segoe UI", Arial, sans-serif;
    text-align: center;
    box-shadow: 0 0 14px rgba(141, 97, 255, 0.42);
}

.mobile-export-button
{
    height: 52px;
    min-width: 96px;
    border-radius: 7px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--mobile-purple), #6f4be4);
    color: #fff;
    font-size: 23px;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(96, 63, 211, 0.28);
}

#main-layout
{
    display: grid !important;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 0;
    width: 100%;
    height: 462px;
    min-height: 462px;
    position: relative;
    border-bottom: 1px solid var(--mobile-line);
    background: rgba(7, 11, 17, 0.72);
}

#mobile-side-rail
{
    grid-column: 1;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 30;
    width: 132px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;
    padding: 9px 11px 11px;
    box-sizing: border-box;
    border-right: 1px solid var(--mobile-line);
    background: linear-gradient(180deg, rgba(11, 16, 24, 0.88), rgba(8, 12, 18, 0.96));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(141, 97, 255, 0.55) rgba(12, 17, 26, 0.96);
}

#mobile-side-rail::-webkit-scrollbar,
.mobile-popover-menu::-webkit-scrollbar
{
    width: 8px;
}

#mobile-side-rail::-webkit-scrollbar-track,
.mobile-popover-menu::-webkit-scrollbar-track
{
    background: rgba(12, 17, 26, 0.96);
}

#mobile-side-rail::-webkit-scrollbar-thumb,
.mobile-popover-menu::-webkit-scrollbar-thumb
{
    background: rgba(141, 97, 255, 0.55);
    border-radius: 999px;
}

#mobile-side-rail button
{
    height: 58px;
    border: 0;
    border-radius: 6px;
    color: #b4b8c7;
    background: transparent;
    display: grid;
    grid-template-rows: 27px 18px;
    place-items: center;
    gap: 1px;
    cursor: pointer;
    font: 13px/1 "Segoe UI", Arial, sans-serif;
    position: relative;
}

#mobile-side-rail button.active
{
    color: var(--mobile-purple);
    background: transparent !important;
    box-shadow: none !important;
    text-shadow:
        0 0 8px rgba(141, 97, 255, 0.78),
        0 0 16px rgba(141, 97, 255, 0.38);
    filter: drop-shadow(0 0 8px rgba(141, 97, 255, 0.52));
}

#mobile-side-rail button.active::before
{
    content: "";
    position: absolute;
    left: -11px;
    top: 18px;
    width: 3px;
    height: 22px;
    border-radius: 0 4px 4px 0;
    background: var(--mobile-purple);
}

.rail-icon
{
    font-size: 23px;
    line-height: 1;
    font-weight: 600;
}

#editor-area
{
    grid-column: 2;
    min-width: 0;
    display: block !important;
    flex: none !important;
    padding: 12px 20px 0 16px;
    box-sizing: border-box;
}

#canvas-wrapper
{
    width: 100%;
    aspect-ratio: 1.52 / 1;
    max-height: 452px;
    min-height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
    border: 1px solid rgba(150, 163, 189, 0.36);
    background:
        linear-gradient(180deg, rgba(121, 183, 228, 0.92), rgba(32, 55, 75, 0.92) 44%, rgba(12, 26, 24, 0.96)),
        radial-gradient(circle at 62% 12%, rgba(183, 142, 255, 0.82), transparent 22%);
}

#canvas-wrapper::before
{
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.72;
    background:
        linear-gradient(150deg, transparent 0 26%, rgba(11, 24, 33, 0.88) 27% 39%, transparent 40%),
        linear-gradient(18deg, transparent 0 50%, rgba(8, 19, 23, 0.92) 51% 68%, transparent 69%),
        linear-gradient(10deg, rgba(14, 69, 91, 0.85) 0 24%, transparent 25%),
        linear-gradient(172deg, transparent 0 57%, rgba(15, 70, 93, 0.82) 58% 66%, transparent 67%),
        linear-gradient(0deg, rgba(14, 34, 26, 0.9) 0 15%, transparent 16%);
    mix-blend-mode: normal;
}

#canvas
{
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    position: relative;
    z-index: 1;
    background: transparent;
}

#face-overlay
{
    display: none;
}

#mobile-transport
{
    height: 112px;
    display: grid;
    grid-template-columns: 205px 1fr 90px 58px;
    align-items: center;
    gap: 18px;
    padding: 0 22px 0 calc(var(--track-label-w) + 8px);
    box-sizing: border-box;
    background: rgba(8, 12, 18, 0.94);
    border-bottom: 1px solid var(--mobile-line);
}

.mobile-time-readout
{
    display: grid;
    gap: 6px;
    line-height: 1;
}

.mobile-time-readout strong
{
    color: var(--mobile-purple);
    font-size: 21px;
    font-weight: 800;
}

.mobile-time-readout span
{
    color: var(--mobile-muted);
    font-size: 21px;
}

.mobile-playback-buttons
{
    display: flex;
    justify-content: center;
    gap: 30px;
}

.mobile-playback-buttons button,
.mobile-fit-button,
.mobile-fullscreen-button
{
    border: 0;
    background: transparent;
    color: #aeb4c4;
    cursor: pointer;
    font: 27px/1 "Segoe UI", Arial, sans-serif;
}

.mobile-playback-buttons button
{
    width: 28px;
    height: 36px;
    white-space: nowrap;
}

#mobile-play-pause-btn.playing
{
    color: #d9deea;
    text-shadow:
        0 0 8px rgba(174, 180, 196, 0.42),
        0 0 16px rgba(174, 180, 196, 0.22);
}

.mobile-loop-button.active
{
    color: var(--mobile-purple);
    background: transparent !important;
    box-shadow: none !important;
    text-shadow:
        0 0 8px rgba(141, 97, 255, 0.78),
        0 0 16px rgba(141, 97, 255, 0.38);
    filter: drop-shadow(0 0 8px rgba(141, 97, 255, 0.52));
}

.mobile-record-button
{
    color: #aeb4c4;
}

.mobile-record-button.recording
{
    color: #ff9a9a !important;
    text-shadow:
        0 0 8px rgba(255, 82, 82, 0.82),
        0 0 18px rgba(255, 82, 82, 0.46);
    animation: recordingPulse 1.15s ease-in-out infinite;
}

@keyframes recordingPulse
{
    0%,
    100%
    {
        opacity: 0.78;
        filter: drop-shadow(0 0 2px rgba(255, 82, 82, 0.42));
    }

    50%
    {
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(255, 82, 82, 0.82));
    }
}

.mobile-fit-button
{
    height: 50px;
    border: 1px solid rgba(156, 164, 184, 0.2);
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 19px;
    background: rgba(19, 25, 36, 0.72);
}

.mobile-fit-button span
{
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translateY(-3px);
}

.mobile-fullscreen-button
{
    width: 48px;
    height: 48px;
    border: 1px solid rgba(156, 164, 184, 0.2);
    border-radius: 7px;
    background:
        linear-gradient(#aeb4c4, #aeb4c4) 12px 12px / 12px 2px no-repeat,
        linear-gradient(#aeb4c4, #aeb4c4) 12px 12px / 2px 12px no-repeat,
        linear-gradient(#aeb4c4, #aeb4c4) calc(100% - 12px) 12px / 12px 2px no-repeat,
        linear-gradient(#aeb4c4, #aeb4c4) calc(100% - 14px) 12px / 2px 12px no-repeat,
        linear-gradient(#aeb4c4, #aeb4c4) 12px calc(100% - 12px) / 12px 2px no-repeat,
        linear-gradient(#aeb4c4, #aeb4c4) 12px calc(100% - 22px) / 2px 12px no-repeat,
        linear-gradient(#aeb4c4, #aeb4c4) calc(100% - 24px) calc(100% - 12px) / 12px 2px no-repeat,
        linear-gradient(#aeb4c4, #aeb4c4) calc(100% - 14px) calc(100% - 22px) / 2px 12px no-repeat,
        rgba(19, 25, 36, 0.72);
}

#timeline-tools
{
    display: none !important;
}

#timeline-root
{
    width: 100%;
    min-height: 738px;
    background:
        linear-gradient(90deg, rgba(16, 21, 31, 0.98) 0 var(--track-label-w), rgba(7, 11, 17, 0.96) var(--track-label-w)),
        linear-gradient(180deg, rgba(12, 16, 24, 0.97), rgba(7, 10, 15, 0.98));
    border-bottom: 1px solid var(--mobile-line);
}

#timeline-viewport
{
    min-height: 738px;
    max-height: 738px !important;
    border: 0;
    background:
        linear-gradient(90deg, rgba(151,161,184,0.24) 0 1px, transparent 1px) var(--track-label-w) 0 / 136px 100% repeat-x,
        linear-gradient(90deg, rgba(151,161,184,0.18), rgba(151,161,184,0.04) 1px, transparent 1px) var(--track-label-w) 0 / 17px 100% repeat-x,
        transparent;
    scrollbar-width: none;
}

#timeline-viewport::-webkit-scrollbar
{
    display: none;
}

#timeline-ruler
{
    height: 86px;
    background:
        linear-gradient(90deg, rgba(151,161,184,0.16) 0 1px, transparent 1px) var(--track-label-w) 0 / 136px 100% repeat-x,
        linear-gradient(180deg, rgba(14, 19, 28, 0.96), rgba(8, 12, 18, 0.96));
    border: 0;
    border-bottom: 1px solid var(--mobile-line);
}

#timeline-ruler::before
{
    content: "00:00              00:00:05              00:00:10              00:00:15              00:00:20              00";
    position: absolute;
    left: var(--track-label-w);
    right: 0;
    bottom: 13px;
    color: #7f8697;
    font-size: 19px;
    white-space: pre;
}

#timeline-content
{
    min-height: 652px;
    position: relative;
}

#timeline-content::before
{
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 652px;
    pointer-events: none;
    background:
        linear-gradient(90deg, transparent 0 var(--track-label-w), rgba(141, 97, 255, 0.95) var(--track-label-w) calc(var(--track-label-w) + 2px), transparent calc(var(--track-label-w) + 2px)) 0 192px / 100% 96px no-repeat,
        linear-gradient(135deg, rgba(176,72,151,0.95), rgba(104,53,177,0.95)) calc(var(--track-label-w) + 195px) 30px / 196px 72px no-repeat,
        linear-gradient(135deg, rgba(139,76,205,0.95), rgba(103,55,180,0.95)) calc(var(--track-label-w) + 250px) 126px / 262px 72px no-repeat,
        linear-gradient(120deg, rgba(125, 91, 214, 0.94), rgba(39, 47, 71, 0.96) 38%, rgba(174, 127, 255, 0.90)) calc(var(--track-label-w) + 190px) 220px / 118px 78px no-repeat,
        linear-gradient(120deg, rgba(154, 119, 226, 0.92), rgba(57, 48, 91, 0.96)) calc(var(--track-label-w) + 309px) 220px / 152px 78px no-repeat,
        linear-gradient(120deg, rgba(117, 88, 201, 0.94), rgba(39, 45, 70, 0.96)) calc(var(--track-label-w) + 461px) 220px / 144px 78px no-repeat,
        linear-gradient(120deg, rgba(183, 142, 255, 0.90), rgba(61, 55, 86, 0.96)) calc(var(--track-label-w) + 605px) 220px / 97px 78px no-repeat,
        linear-gradient(180deg, rgba(116, 83, 216, 0.92), rgba(82, 58, 165, 0.94)) calc(var(--track-label-w) + 197px) 322px / 498px 78px no-repeat,
        linear-gradient(180deg, rgba(126, 88, 226, 0.92), rgba(86, 60, 169, 0.94)) calc(var(--track-label-w) + 206px) 418px / 433px 78px no-repeat,
        linear-gradient(180deg, rgba(102, 78, 201, 0.94), rgba(72, 55, 154, 0.95)) calc(var(--track-label-w) + 208px) 514px / 502px 78px no-repeat,
        linear-gradient(180deg, rgba(25,31,45,0.82), rgba(15,20,31,0.82)) 0 0 / var(--track-label-w) 96px repeat-y,
        linear-gradient(rgba(151,161,184,0.08), rgba(151,161,184,0.08)) 0 95px / 100% 1px repeat-y;
    z-index: 0;
}

#timeline-content::after
{
    content:
        "V3    🔒    ◉    ⧉\A"
        "V2    🔒    ◉    ⧉\A"
        "V1    🔒    ◉\A"
        "A1    🔒    M    S\A"
        "A2    🔒    M    S\A"
        "A3    🔒    M    S\A"
        "◴   Mix      0.0";
    white-space: pre;
    position: absolute;
    left: 24px;
    top: 33px;
    color: #8d93a3;
    font-size: 18px;
    line-height: 96px;
    pointer-events: none;
    z-index: 1;
}

.timeline-track
{
    height: 96px;
    background: transparent !important;
    border-bottom: 1px solid rgba(151, 161, 184, 0.08);
    box-sizing: border-box;
}

.timeline-track::before
{
    content: "V" counter(track);
    counter-increment: track;
    position: absolute;
    left: 0;
    top: 0;
    width: var(--track-label-w);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-sizing: border-box;
    color: #8d93a3;
    font-size: 12px;
    line-height: 1.1;
    white-space: nowrap;
    letter-spacing: 0;
    background: linear-gradient(180deg, rgba(25, 31, 45, 0.74), rgba(15, 20, 31, 0.74));
    border-bottom: 1px solid rgba(151, 161, 184, 0.08);
}

#timeline-content
{
    counter-reset: track;
}

.timeline-track:nth-child(1)::before { content: "V3    🔒    ◉    ⧉"; }
.timeline-track:nth-child(2)::before { content: "V2    🔒    ◉    ⧉"; }
.timeline-track:nth-child(3)::before { content: "V1    🔒    ◉"; color: var(--mobile-purple); }
.timeline-track:nth-child(4)::before { content: "A1    🔒    M    S"; }
.timeline-track:nth-child(5)::before { content: "A2    🔒    M    S"; }
.timeline-track:nth-child(6)::before { content: "A3    🔒    M    S"; }
.timeline-track:nth-child(7)::before { content: "◴   Mix      0.0"; color: #a77dff; }

.timeline-clip
{
    top: 11px;
    height: 72px;
    margin-left: var(--track-label-w);
    border-radius: 5px;
    border: 0;
    background: linear-gradient(135deg, rgba(173, 69, 166, 0.92), rgba(100, 52, 183, 0.92));
    color: #fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12), 0 8px 18px rgba(0,0,0,0.16);
    cursor: pointer;
}

.timeline-clip.video-clip,
.timeline-clip.image-clip,
.timeline-clip.visual-clip
{
    top: 9px;
    height: 78px;
    border: 2px solid rgba(255,255,255,0.88);
    background:
        linear-gradient(120deg, rgba(126, 91, 220, 0.88), rgba(45, 42, 72, 0.96) 46%, rgba(184, 140, 255, 0.88) 100%);
}

.timeline-clip.audio-clip
{
    height: 78px;
    background: linear-gradient(180deg, rgba(116, 83, 216, 0.92), rgba(82, 58, 165, 0.92));
}

.timeline-track:nth-child(6) .timeline-clip.audio-clip
{
    background: linear-gradient(180deg, rgba(102, 78, 201, 0.92), rgba(72, 55, 154, 0.94));
}

.timeline-clip.text-clip,
.timeline-clip.text-clip-kind
{
    background: linear-gradient(135deg, rgba(176, 72, 151, 0.94), rgba(115, 55, 171, 0.94));
}

.timeline-clip::before
{
    content: attr(data-clip-label);
    position: absolute;
    left: 18px;
    top: 16px;
    color: rgba(255,255,255,0.95);
    font-size: 16px;
    z-index: 3;
    white-space: nowrap;
}

#timeline-playhead
{
    background: var(--mobile-purple) !important;
    width: 2px !important;
    top: 0 !important;
    bottom: 0 !important;
    box-shadow: 0 0 10px rgba(141, 97, 255, 0.55);
    margin-left: var(--track-label-w);
    z-index: 5 !important;
}

#timeline-playhead::before
{
    border-top-color: var(--mobile-purple) !important;
    left: 0 !important;
    background: var(--mobile-purple) !important;
    box-shadow:
        0 0 8px rgba(141, 97, 255, 0.86),
        0 0 16px rgba(141, 97, 255, 0.42) !important;
}

#mobile-bottom-tools,
#mobile-mode-tabs
{
    display: grid;
    align-items: center;
    background: rgba(9, 13, 20, 0.58);
    backdrop-filter: blur(6px);
    border-bottom: 0;
    left: 0;
    right: 0;
    z-index: 5150;
}

#mobile-bottom-tools
{
    grid-template-columns: repeat(8, minmax(0, 1fr));
    height: var(--mobile-bottom-tool-row-height);
    position: fixed;
    bottom: calc(var(--mobile-bottom-tool-row-height) + var(--mobile-bottom-chrome-gap, 0px));
    border-top: 1px solid rgba(151, 161, 184, 0.08);
}

#mobile-mode-tabs
{
    grid-template-columns: repeat(7, minmax(0, 1fr));
    height: var(--mobile-bottom-tool-row-height);
    box-sizing: border-box;
    position: fixed;
    bottom: 0;
}

#mobile-bottom-tools button,
#mobile-mode-tabs button
{
    height: 100%;
    border: 0;
    background: transparent;
    color: #b5bac8;
    display: grid;
    grid-template-rows: 17px 14px;
    align-content: center;
    justify-items: center;
    gap: 1px;
    font: 12px/1 "Segoe UI", Arial, sans-serif;
    cursor: pointer;
}

#mobile-bottom-tools span,
#mobile-mode-tabs span
{
    font-size: 17px;
    line-height: 1;
    color: inherit;
    -webkit-text-fill-color: currentColor;
    font-family: "Segoe UI Symbol", "Arial Unicode MS", "Segoe UI", Arial, sans-serif;
    font-variant-emoji: text;
}

#mobile-editor-chrome,
#mobile-editor-chrome *,
#mobile-transport,
#mobile-transport *,
#mobile-bottom-tools,
#mobile-bottom-tools *,
#mobile-mode-tabs,
#mobile-mode-tabs *,
#mobile-side-rail,
#mobile-side-rail *,
#timeline-root,
#timeline-root *
{
    -webkit-tap-highlight-color: transparent;
}

#mobile-editor-chrome button,
#mobile-transport button,
#mobile-bottom-tools button,
#mobile-mode-tabs button,
#mobile-side-rail button,
#timeline-root button,
.timeline-clip
{
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

#mobile-editor-chrome button,
#mobile-transport button,
#mobile-bottom-tools button,
#mobile-mode-tabs button,
#mobile-side-rail button
{
    position: relative;
    isolation: isolate;
}

#mobile-editor-chrome button > *,
#mobile-transport button > *,
#mobile-bottom-tools button > *,
#mobile-mode-tabs button > *,
#mobile-side-rail button > *
{
    position: relative;
    z-index: 1;
}

#mobile-split span
{
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
    font-family: "Segoe UI Symbol", "Arial Unicode MS", Arial, sans-serif !important;
}

#mobile-bottom-tools button.active,
#mobile-mode-tabs button.active
{
    color: var(--mobile-purple);
    background: linear-gradient(180deg, rgba(124, 84, 255, 0.14), rgba(124, 84, 255, 0.04));
    box-shadow:
        inset 0 2px 0 rgba(139, 92, 246, 0.85),
        0 0 18px rgba(124, 84, 255, 0.28);
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.48);
}

@media (hover: hover)
{
    #mobile-side-rail button:hover:not(:disabled):not(.active),
    .mobile-icon-button:hover:not(:disabled),
    .mobile-project-title:hover:not(:disabled),
    .mobile-playback-buttons button:hover:not(:disabled):not(.active),
    .mobile-fit-button:hover:not(:disabled),
    #mobile-bottom-tools button:hover:not(:disabled):not(.active),
    #mobile-mode-tabs button:hover:not(:disabled):not(.active)
    {
        color: #a77dff;
        background: transparent;
        box-shadow: none;
        text-shadow:
            0 0 8px rgba(167, 125, 255, 0.74),
            0 0 16px rgba(151, 111, 255, 0.34);
        filter: drop-shadow(0 0 7px rgba(151, 111, 255, 0.46));
        font-weight: 400;
        transform: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    .mobile-fullscreen-button:hover:not(:disabled)
    {
        color: #a77dff;
        background:
            linear-gradient(#a77dff, #a77dff) 12px 12px / 12px 2px no-repeat,
            linear-gradient(#a77dff, #a77dff) 12px 12px / 2px 12px no-repeat,
            linear-gradient(#a77dff, #a77dff) calc(100% - 12px) 12px / 12px 2px no-repeat,
            linear-gradient(#a77dff, #a77dff) calc(100% - 14px) 12px / 2px 12px no-repeat,
            linear-gradient(#a77dff, #a77dff) 12px calc(100% - 12px) / 12px 2px no-repeat,
            linear-gradient(#a77dff, #a77dff) 12px calc(100% - 22px) / 2px 12px no-repeat,
            linear-gradient(#a77dff, #a77dff) calc(100% - 24px) calc(100% - 12px) / 12px 2px no-repeat,
            linear-gradient(#a77dff, #a77dff) calc(100% - 14px) calc(100% - 22px) / 2px 12px no-repeat,
            transparent;
        box-shadow: none;
        text-shadow:
            0 0 8px rgba(167, 125, 255, 0.74),
            0 0 16px rgba(151, 111, 255, 0.34);
        filter: drop-shadow(0 0 7px rgba(151, 111, 255, 0.46));
        font-weight: 400;
        transform: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

#mobile-side-rail button:active:not(:disabled):not(.active),
.mobile-icon-button:active:not(:disabled),
.mobile-project-title:active:not(:disabled),
.mobile-playback-buttons button:active:not(:disabled):not(.active),
.mobile-fit-button:active:not(:disabled),
#mobile-bottom-tools button:active:not(:disabled):not(.active),
#mobile-mode-tabs button:active:not(:disabled):not(.active)
{
    color: #a77dff;
    background: transparent;
    box-shadow: none;
    text-shadow:
        0 0 8px rgba(167, 125, 255, 0.72),
        0 0 16px rgba(151, 111, 255, 0.32);
    filter: drop-shadow(0 0 7px rgba(151, 111, 255, 0.44));
    font-weight: 400;
    transform: none;
}

.mobile-fullscreen-button:active:not(:disabled)
{
    color: #a77dff;
    background:
        linear-gradient(#a77dff, #a77dff) 12px 12px / 12px 2px no-repeat,
        linear-gradient(#a77dff, #a77dff) 12px 12px / 2px 12px no-repeat,
        linear-gradient(#a77dff, #a77dff) calc(100% - 12px) 12px / 12px 2px no-repeat,
        linear-gradient(#a77dff, #a77dff) calc(100% - 14px) 12px / 2px 12px no-repeat,
        linear-gradient(#a77dff, #a77dff) 12px calc(100% - 12px) / 12px 2px no-repeat,
        linear-gradient(#a77dff, #a77dff) 12px calc(100% - 22px) / 2px 12px no-repeat,
        linear-gradient(#a77dff, #a77dff) calc(100% - 24px) calc(100% - 12px) / 12px 2px no-repeat,
        linear-gradient(#a77dff, #a77dff) calc(100% - 14px) calc(100% - 22px) / 2px 12px no-repeat,
        transparent;
    box-shadow: none;
    text-shadow:
        0 0 8px rgba(167, 125, 255, 0.72),
        0 0 16px rgba(151, 111, 255, 0.32);
    filter: drop-shadow(0 0 7px rgba(151, 111, 255, 0.44));
    font-weight: 400;
    transform: none;
}

#mobile-side-rail button:focus-visible:not(.active),
.mobile-icon-button:focus-visible,
.mobile-project-title:focus-visible,
.mobile-playback-buttons button:focus-visible:not(.active),
.mobile-fit-button:focus-visible,
#mobile-bottom-tools button:focus-visible:not(.active),
#mobile-mode-tabs button:focus-visible:not(.active)
{
    color: #a77dff;
    background: transparent;
    box-shadow: none;
    text-shadow:
        0 0 8px rgba(167, 125, 255, 0.74),
        0 0 16px rgba(151, 111, 255, 0.34);
    filter: drop-shadow(0 0 7px rgba(151, 111, 255, 0.46));
}

.mobile-fullscreen-button:focus-visible
{
    color: #a77dff;
    background:
        linear-gradient(#a77dff, #a77dff) 12px 12px / 12px 2px no-repeat,
        linear-gradient(#a77dff, #a77dff) 12px 12px / 2px 12px no-repeat,
        linear-gradient(#a77dff, #a77dff) calc(100% - 12px) 12px / 12px 2px no-repeat,
        linear-gradient(#a77dff, #a77dff) calc(100% - 14px) 12px / 2px 12px no-repeat,
        linear-gradient(#a77dff, #a77dff) 12px calc(100% - 12px) / 12px 2px no-repeat,
        linear-gradient(#a77dff, #a77dff) 12px calc(100% - 22px) / 2px 12px no-repeat,
        linear-gradient(#a77dff, #a77dff) calc(100% - 24px) calc(100% - 12px) / 12px 2px no-repeat,
        linear-gradient(#a77dff, #a77dff) calc(100% - 14px) calc(100% - 22px) / 2px 12px no-repeat,
        transparent;
    box-shadow: none;
    text-shadow:
        0 0 8px rgba(167, 125, 255, 0.74),
        0 0 16px rgba(151, 111, 255, 0.34);
    filter: drop-shadow(0 0 7px rgba(151, 111, 255, 0.46));
}

#mobile-side-rail button:is(:hover, :active, :focus-visible):not(:disabled):not(.active),
.mobile-icon-button:is(:hover, :active, :focus-visible):not(:disabled),
.mobile-project-title:is(:hover, :active, :focus-visible):not(:disabled),
.mobile-playback-buttons button:is(:hover, :active, :focus-visible):not(:disabled):not(.active),
.mobile-fit-button:is(:hover, :active, :focus-visible):not(:disabled),
#mobile-bottom-tools button:is(:hover, :active, :focus-visible):not(:disabled):not(.active),
    #mobile-mode-tabs button:is(:hover, :active, :focus-visible):not(:disabled):not(.active)
{
    background: transparent !important;
    box-shadow: none !important;
}

    .mobile-playback-buttons .mobile-record-button:is(:hover, :focus-visible):not(:disabled)
    {
        color: #ff8a8a !important;
        text-shadow:
            0 0 7px rgba(255, 115, 115, 0.86),
            0 0 15px rgba(255, 82, 82, 0.46),
            0 0 24px rgba(255, 82, 82, 0.24) !important;
        filter: drop-shadow(0 0 8px rgba(255, 82, 82, 0.58));
    }

#mobile-side-rail button:is(:hover, :active, :focus-visible):not(:disabled):not(.active)::after,
.mobile-icon-button:is(:hover, :active, :focus-visible):not(:disabled)::after,
.mobile-project-title:is(:hover, :active, :focus-visible):not(:disabled)::after,
.mobile-playback-buttons button:is(:hover, :active, :focus-visible):not(:disabled):not(.active)::after,
.mobile-fit-button:is(:hover, :active, :focus-visible):not(:disabled)::after,
#mobile-bottom-tools button:is(:hover, :active, :focus-visible):not(:disabled):not(.active)::after,
#mobile-mode-tabs button:is(:hover, :active, :focus-visible):not(:disabled):not(.active)::after
{
    content: "";
    position: absolute;
    inset: -8px -10px;
    z-index: 0;
    pointer-events: none;
    border-radius: 12px;
    background:
        radial-gradient(ellipse at center,
            rgba(151, 111, 255, 0.24) 0%,
            rgba(151, 111, 255, 0.13) 34%,
            rgba(151, 111, 255, 0.035) 62%,
            transparent 78%);
    filter: blur(8px);
}

#mobile-home-indicator
{
    display: none !important;
}

body
{
    padding-bottom: 0 !important;
}

html,
body
{
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar
{
    display: none;
    width: 0;
    height: 0;
}

@media (min-width: 761px)
{
    #mobile-bottom-tools
    {
        grid-template-columns: repeat(8, 86px);
        justify-content: center;
        column-gap: clamp(12px, 3vw, 44px);
    }

    #mobile-mode-tabs
    {
        grid-template-columns: repeat(7, 86px);
        justify-content: center;
        column-gap: clamp(14px, 4vw, 50px);
    }
}

@media (max-width: 760px)
{
    :root
    {
        --track-label-w: 58px;
        --mobile-bottom-chrome-gap: 0px;
    }

    #mobile-status-bar
    {
        padding: 0 28px;
    }

    #mobile-project-bar
    {
        grid-template-columns: 44px minmax(100px, 1fr) 42px 42px 42px 32px 38px auto;
        gap: 4px;
        padding: 0 10px;
    }

    .mobile-icon-button
    {
        width: 40px;
        font-size: 30px;
    }

    .mobile-project-title
    {
        font-size: 18px;
    }

    .mobile-export-button
    {
        min-width: 74px;
        font-size: 18px;
        padding: 0 12px;
    }

    .mobile-donate-button
    {
        width: 38px;
        height: 38px;
        border-radius: 7px;
        font-size: 22px;
    }

    #main-layout
    {
        display: flex !important;
        flex-direction: column;
        height: auto;
        min-height: 0;
    }

    #mobile-side-rail
    {
        order: 2;
        position: relative;
        width: 100%;
        height: auto;
        max-height: 116px;
        min-height: 58px;
        flex-direction: row;
        flex-wrap: wrap;
        align-content: flex-start;
        align-items: stretch;
        justify-content: center;
        padding: 6px;
        gap: 4px;
        border-right: 0;
        border-top: 1px solid var(--mobile-line);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-x: contain;
        overscroll-behavior-y: contain;
        touch-action: pan-y;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    #mobile-side-rail::-webkit-scrollbar
    {
        width: 6px;
        height: 0;
    }

    #mobile-side-rail button
    {
        flex: 1 0 58px;
        max-width: 72px;
        height: 50px;
        font-size: 11px;
        grid-template-rows: 23px 15px;
        touch-action: pan-y;
    }

    #mobile-side-rail button.active::before
    {
        left: 12px;
        top: auto;
        bottom: -3px;
        width: calc(100% - 24px);
        height: 3px;
        border-radius: 4px 4px 0 0;
    }

    .rail-icon
    {
        font-size: 20px;
    }

    #editor-area
    {
        order: 1;
        padding: 10px 10px 0;
        width: 100%;
    }

    #mobile-transport
    {
        height: 76px;
        grid-template-columns: 106px minmax(0, 1fr) 56px 40px;
        gap: 6px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .mobile-time-readout strong,
    .mobile-time-readout span
    {
        font-size: 15px;
    }

    .mobile-playback-buttons
    {
        gap: 9px;
    }

    .mobile-playback-buttons button,
    .mobile-fit-button,
    .mobile-fullscreen-button
    {
        font-size: 22px;
    }

    .mobile-playback-buttons button
    {
        width: 22px;
        height: 28px;
    }

    .mobile-fit-button
    {
        height: 40px;
        gap: 6px;
        font-size: 16px;
    }

    .mobile-fullscreen-button
    {
        width: 40px;
        height: 40px;
        background:
            linear-gradient(#aeb4c4, #aeb4c4) 10px 10px / 10px 2px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) 10px 10px / 2px 10px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) calc(100% - 10px) 10px / 10px 2px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) calc(100% - 12px) 10px / 2px 10px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) 10px calc(100% - 10px) / 10px 2px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) 10px calc(100% - 18px) / 2px 10px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) calc(100% - 20px) calc(100% - 10px) / 10px 2px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) calc(100% - 12px) calc(100% - 18px) / 2px 10px no-repeat,
            rgba(19, 25, 36, 0.72);
    }

    #mobile-bottom-tools button,
    #mobile-mode-tabs button
    {
        font-size: 12px;
    }
}

/* Keep the complete editor chrome visible on narrow phone viewports. Physical
   screen resolution is not useful here: mobile browsers lay the page out in
   CSS pixels (commonly 393-412px), so every column must be allowed to shrink. */
@media (max-width: 600px)
{
    #mobile-editor-chrome,
    #mobile-project-bar
    {
        height: 72px;
    }

    #mobile-project-bar
    {
        grid-template-columns:
            36px minmax(60px, 1fr)
            repeat(4, 34px) 32px 62px;
        gap: 2px;
        padding: 0 6px;
    }

    #mobile-project-bar > button
    {
        min-width: 0;
        max-width: 100%;
    }

    #mobile-project-bar .mobile-icon-button,
    #mobile-project-bar .mobile-donate-button,
    #mobile-project-bar .mobile-export-button
    {
        width: 100%;
        height: 44px;
        padding-left: 0;
        padding-right: 0;
    }

    #mobile-project-bar .mobile-icon-button
    {
        font-size: 27px;
    }

    #mobile-project-bar .mobile-home::before
    {
        width: 29px;
        height: 26px;
    }

    #mobile-project-bar .mobile-share::before
    {
        font-size: 30px;
    }

    #mobile-project-bar .mobile-more::before
    {
        font-size: 34px;
    }

    #mobile-project-bar .mobile-donate-button
    {
        font-size: 20px;
    }

    #mobile-project-bar .mobile-donate-button::before
    {
        top: 6px;
        left: 4px;
        font-size: 11px;
    }

    #mobile-project-bar .mobile-export-button
    {
        font-size: 15px;
    }

    #mobile-project-name
    {
        max-width: 100%;
    }

    .mobile-project-title
    {
        width: 100%;
        gap: 7px;
        font-size: 16px;
        overflow: hidden;
    }

    .mobile-project-title .mobile-project-chevron
    {
        flex: 0 0 auto;
    }

    .mobile-popover-menu
    {
        top: 66px;
    }

    #mobile-transport
    {
        height: 68px;
        grid-template-columns: 88px minmax(0, 1fr) 48px 38px;
        gap: 3px;
        padding: 0 6px;
    }

    .mobile-time-readout
    {
        min-width: 0;
        gap: 5px;
    }

    .mobile-time-readout strong,
    .mobile-time-readout span
    {
        overflow: hidden;
        font-size: 13px;
        text-overflow: clip;
        white-space: nowrap;
    }

    .mobile-playback-buttons
    {
        min-width: 0;
        justify-content: space-evenly;
        gap: 2px;
    }

    .mobile-playback-buttons button
    {
        width: 20px;
        height: 34px;
        padding: 0;
        font-size: 20px;
    }

    .mobile-fit-button
    {
        width: 48px;
        height: 38px;
        gap: 4px;
        padding: 0;
        font-size: 14px;
    }

    .mobile-fit-button span
    {
        width: 7px;
        height: 7px;
    }

    .mobile-fullscreen-button
    {
        width: 38px;
        height: 38px;
        background:
            linear-gradient(#aeb4c4, #aeb4c4) 9px 9px / 9px 2px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) 9px 9px / 2px 9px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) calc(100% - 9px) 9px / 9px 2px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) calc(100% - 11px) 9px / 2px 9px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) 9px calc(100% - 9px) / 9px 2px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) 9px calc(100% - 16px) / 2px 9px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) calc(100% - 18px) calc(100% - 9px) / 9px 2px no-repeat,
            linear-gradient(#aeb4c4, #aeb4c4) calc(100% - 11px) calc(100% - 16px) / 2px 9px no-repeat,
            rgba(19, 25, 36, 0.72);
    }
}

@media (max-width: 360px)
{
    #mobile-project-bar
    {
        grid-template-columns:
            32px minmax(42px, 1fr)
            repeat(4, 30px) 30px 54px;
        gap: 1px;
        padding: 0 4px;
    }

    #mobile-project-bar .mobile-home::before
    {
        width: 26px;
        height: 23px;
    }

    #mobile-project-bar .mobile-export-button
    {
        font-size: 13px;
    }

    .mobile-project-title
    {
        gap: 4px;
        font-size: 14px;
    }

    #mobile-transport
    {
        grid-template-columns: 76px minmax(0, 1fr) 44px 34px;
        gap: 2px;
        padding: 0 4px;
    }

    .mobile-time-readout strong,
    .mobile-time-readout span
    {
        font-size: 12px;
    }

    .mobile-playback-buttons
    {
        gap: 1px;
    }

    .mobile-playback-buttons button
    {
        width: 18px;
        font-size: 18px;
    }

    .mobile-fit-button
    {
        width: 44px;
        font-size: 13px;
    }

    .mobile-fullscreen-button
    {
        width: 34px;
    }
}

/* Real timeline restoration: keep the original renderer authoritative. */
#timeline-content::before,
#timeline-content::after,
#timeline-ruler::before
{
    content: none !important;
    display: none !important;
}

#timeline-root
{
    min-height: 0 !important;
    overflow: visible !important;
}

#timeline-viewport
{
    min-height: 180px !important;
    max-height: none;
    overflow-x: auto !important;
    overflow-y: auto !important;
    overscroll-behavior-x: contain !important;
    overscroll-behavior-y: auto !important;
    scrollbar-width: auto !important;
}

#timeline-viewport::-webkit-scrollbar
{
    display: block !important;
    width: 12px !important;
    height: 12px !important;
}

#timeline-viewport::-webkit-scrollbar:vertical
{
    display: none !important;
    width: 0 !important;
}

#timeline-ruler
{
    height: 42px !important;
    border-bottom: 1px solid var(--mobile-line) !important;
}

#timeline-content
{
    min-height: 0 !important;
}

#timeline-viewport,
#timeline-tools,
#timeline-context-menu,
#mobile-side-rail,
.mobile-popover-menu,
#scratchpad-editor,
#scratchpad-highlight,
#scratchpad-autocomplete,
#project-panel
{
    scrollbar-color: rgba(141, 97, 255, 0.68) rgba(8, 12, 18, 0.96) !important;
}

#timeline-viewport::-webkit-scrollbar-track,
#timeline-tools::-webkit-scrollbar-track,
#timeline-context-menu::-webkit-scrollbar-track,
#mobile-side-rail::-webkit-scrollbar-track,
.mobile-popover-menu::-webkit-scrollbar-track,
#scratchpad-editor::-webkit-scrollbar-track,
#scratchpad-highlight::-webkit-scrollbar-track,
#scratchpad-autocomplete::-webkit-scrollbar-track,
#project-panel::-webkit-scrollbar-track
{
    background: rgba(8, 12, 18, 0.96) !important;
}

#timeline-viewport::-webkit-scrollbar-thumb,
#timeline-tools::-webkit-scrollbar-thumb,
#timeline-context-menu::-webkit-scrollbar-thumb,
#mobile-side-rail::-webkit-scrollbar-thumb,
.mobile-popover-menu::-webkit-scrollbar-thumb,
#scratchpad-editor::-webkit-scrollbar-thumb,
#scratchpad-highlight::-webkit-scrollbar-thumb,
#scratchpad-autocomplete::-webkit-scrollbar-thumb,
#project-panel::-webkit-scrollbar-thumb
{
    border-radius: 999px !important;
    background:
        linear-gradient(90deg, rgba(141, 97, 255, 0.92), rgba(184, 140, 255, 0.76)) !important;
    box-shadow:
        0 0 10px rgba(141, 97, 255, 0.44),
        inset 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}

#timeline-viewport::-webkit-scrollbar-thumb:hover,
#timeline-tools::-webkit-scrollbar-thumb:hover,
#timeline-context-menu::-webkit-scrollbar-thumb:hover,
#mobile-side-rail::-webkit-scrollbar-thumb:hover,
.mobile-popover-menu::-webkit-scrollbar-thumb:hover,
#scratchpad-editor::-webkit-scrollbar-thumb:hover,
#scratchpad-highlight::-webkit-scrollbar-thumb:hover,
#scratchpad-autocomplete::-webkit-scrollbar-thumb:hover,
#project-panel::-webkit-scrollbar-thumb:hover
{
    background:
        linear-gradient(90deg, rgba(167, 125, 255, 0.98), rgba(205, 178, 255, 0.86)) !important;
    box-shadow:
        0 0 14px rgba(141, 97, 255, 0.62),
        inset 0 0 0 1px rgba(255, 255, 255, 0.12) !important;
}

@media (max-width: 760px)
{
    #timeline-viewport
    {
        min-height: 260px !important;
        padding-bottom: 10px !important;
        scroll-padding-bottom: calc(var(--mobile-bottom-tools-height) + 18px) !important;
        box-sizing: border-box;
    }

    #timeline-root
    {
        margin-bottom: calc(var(--mobile-bottom-tools-height) + 18px);
    }
}

.timeline-track
{
    height: var(--track-height) !important;
}

.timeline-track::before
{
    content: attr(data-mobile-label) !important;
    pointer-events: none;
    font-size: clamp(11px, calc(var(--track-height) / 7), 18px) !important;
    line-height: 1.1 !important;
    color: #8f96aa !important;
    background:
        linear-gradient(180deg, rgba(18, 24, 36, 0.66), rgba(10, 15, 23, 0.66)) !important;
}

.timeline-clip
{
    top: 10px !important;
    height: calc(var(--track-height) - 20px) !important;
    margin-left: 0 !important;
}

.timeline-clip.video-clip,
.timeline-clip.image-clip,
.timeline-clip.visual-clip,
.timeline-clip.audio-clip
{
    top: 10px !important;
    height: calc(var(--track-height) - 20px) !important;
}

#timeline-playhead
{
    width: 22px !important;
    margin-left: -11px !important;
    top: 0 !important;
    background: transparent !important;
    touch-action: none;
}

#timeline-playhead::before
{
    left: 10px !important;
}
