/* ------------------------------------------------------------ Model picker */

.vs-model-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.vs-loading-state,
.vs-empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 60px 20px;
    color: var(--text-muted);
    text-align: center;
}

.vs-empty-state i {
    font-size: 40px;
    opacity: 0.4;
}

.vs-empty-state span {
    font-size: 12px;
}

.vs-load-error {
    color: var(--error-color);
}

.vs-load-error p {
    margin: 0;
    color: var(--text-primary);
    font-weight: 700;
}

.vs-inline-retry {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 8px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    background: var(--bg-elevated);
    color: var(--text-primary);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.vs-inline-retry:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.vs-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--border-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: vs-spin 0.8s linear infinite;
}

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

.vs-model-card {
    width: 100%;
    background: var(--card-bg);
    border: 2px solid var(--border-light);
    border-radius: 14px;
    padding: 14px;
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s ease);
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: inherit;
    font: inherit;
    text-align: left;
}

.vs-model-card:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.vs-model-card.selected {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.06);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.15);
}

.vs-model-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.vs-model-label {
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
}

.vs-model-tier {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 999px;
    flex-shrink: 0;
}

.vs-model-tier.budget {
    background: rgba(var(--ds-ok-rgb), 0.15);
    color: var(--success-color);
}

.vs-model-tier.standard {
    background: rgba(var(--primary-color-rgb), 0.15);
    color: var(--primary-color);
}

.vs-model-tier.premium {
    background: rgba(var(--ds-accent-rgb), 0.15);
    color: var(--accent-color);
}

.vs-model-canary {
    align-self: center;
    border: 1px solid rgba(var(--ds-accent-rgb), 0.45);
    border-radius: 999px;
    color: var(--ds-accent);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.035em;
    padding: 0.24rem 0.42rem;
    white-space: nowrap;
}

.vs-model-vendor {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.vs-model-tagline {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.vs-model-caps {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 2px;
}

.vs-model-cap-chip {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 3px 7px;
    border-radius: 6px;
    white-space: nowrap;
}

.vs-model-price {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: auto;
    padding-top: 6px;
    border-top: 1px dashed var(--border-light);
}

/* ------------------------------------------------------------------ Form */

.vs-form-area {
    display: none;
    flex-direction: column;
    gap: 18px;
    animation: vs-fade-in 0.2s ease-out;
}

.vs-form-area.visible {
    display: flex;
}

.vs-form-error {
    margin-top: 14px;
    padding: 10px 12px;
    border-left: 3px solid var(--error-color);
    border-radius: 6px;
    background: rgba(var(--ds-danger-rgb), 0.08);
    color: var(--error-color);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.vs-confirm {
    margin-top: 14px;
    padding: 14px 16px;
    border: 1px solid var(--border-color, rgba(var(--ds-ink-rgb), 0.12));
    border-left: 3px solid var(--accent-color, #6ea8fe);
    border-radius: 8px;
    background: rgba(var(--ds-accent-rgb), 0.06);
    font-size: 12.5px;
    line-height: 1.5;
}

.vs-confirm h4 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
}

.vs-confirm dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 14px;
    margin: 0 0 12px;
}

.vs-confirm dt {
    opacity: 0.7;
}

.vs-confirm dd {
    margin: 0;
    font-weight: 600;
}

/* The pictures the video is made from, small, in the order the model reads them. */
.vs-confirm-pictures {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}

.vs-confirm-pictures figure {
    width: 64px;
    margin: 0;
}

.vs-confirm-pictures img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: cover;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
}

.vs-confirm-pictures figcaption {
    margin-top: 4px;
    font-size: 10.5px;
    line-height: 1.25;
    opacity: 0.7;
}

.vs-confirm-prompt {
    margin: 0 0 12px;
    max-height: 120px;
    overflow: auto;
    opacity: 0.85;
    white-space: pre-wrap;
}

.vs-confirm-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

@keyframes vs-fade-in {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.vs-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vs-field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
}

.vs-field-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.vs-field-label .vs-required {
    color: var(--error-color);
}

.vs-field-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.vs-textarea,
.vs-select,
.vs-number-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-medium);
    border-radius: 10px;
    background: var(--input-background);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    transition: border-color var(--transition-fast, 0.15s ease);
}

.vs-textarea:focus,
.vs-select:focus,
.vs-number-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.vs-textarea {
    min-height: 72px;
    resize: vertical;
}

/* Single-slot dropzones (first_frame / last_frame / first_clip / audio) */

.vs-dropzone {
    position: relative;
    border: 2px dashed var(--border-medium);
    border-radius: 12px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
    color: var(--text-muted);
    text-align: center;
    padding: 12px;
    transition: all var(--transition-fast, 0.15s ease);
    background: var(--bg-secondary);
    overflow: hidden;
}

.vs-dropzone:hover,
.vs-dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.05);
}

.vs-dropzone i {
    font-size: 22px;
    opacity: 0.6;
}

.vs-dropzone span {
    font-size: 11px;
}

.vs-dropzone.has-file {
    border-style: solid;
    padding: 0;
}

.vs-dropzone-preview {
    width: 100%;
    height: 100%;
    min-height: 120px;
    object-fit: cover;
    display: block;
}

.vs-dropzone-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.65);
    color: var(--ds-on-media);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    z-index: 2;
}

.vs-dropzone-file-badge {
    position: absolute;
    bottom: 6px;
    left: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: var(--ds-on-media);
    font-size: 10px;
    padding: 3px 6px;
    border-radius: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 2;
}

/* Multi-reference grids (reference_images / reference_videos / reference_audios) */

.vs-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}

.vs-ref-tile {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
}

.vs-ref-tile img,
.vs-ref-tile video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vs-ref-tile-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.65);
    color: var(--ds-on-media);
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-ref-tile-add {
    aspect-ratio: 1;
    border: 2px dashed var(--border-medium);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    color: var(--text-muted);
    background: var(--bg-secondary);
    font-size: 10px;
    transition: all var(--transition-fast, 0.15s ease);
}

.vs-ref-tile-add:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.vs-ref-tile-add i {
    font-size: 18px;
}

/* Multi-shot script builder */

.vs-shots-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vs-shot-row {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 8px;
}

.vs-shot-index {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--ds-accent-ink);
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 6px;
}

.vs-shot-row textarea {
    flex: 1;
    min-height: 44px;
    resize: vertical;
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    padding: 6px 8px;
    font-size: 12px;
    background: var(--input-background);
    color: var(--text-primary);
    font-family: inherit;
}

.vs-shot-duration {
    width: 64px;
    flex-shrink: 0;
    text-align: center;
}

.vs-shot-remove {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    margin-top: 4px;
}

.vs-shot-remove:hover {
    color: var(--error-color);
    background: var(--bg-tertiary);
}

.vs-add-shot-btn {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px dashed var(--border-medium);
    border-radius: 8px;
    background: transparent;
    color: var(--primary-color);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.vs-add-shot-btn:hover {
    background: rgba(var(--primary-color-rgb), 0.06);
}

.vs-add-shot-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Duration / option button groups */

.vs-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.vs-opt-btn {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-medium);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast, 0.15s ease);
}

.vs-opt-btn:hover {
    border-color: var(--primary-color);
}

.vs-opt-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--ds-accent-ink);
}

.vs-opt-btn:disabled,
.vs-opt-btn:disabled:hover {
    border-color: var(--border-light);
    background: var(--bg-secondary);
    color: var(--text-tertiary);
    cursor: not-allowed;
    opacity: 0.38;
}

.vs-range-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.vs-range-row input[type="range"] {
    flex: 1;
}

.vs-range-value {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 44px;
    text-align: right;
}

/* Toggle switches */

.vs-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
}

.vs-toggle-row .vs-field-label {
    margin: 0;
}

.vs-fixed-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 6px 9px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.28);
    border-radius: 999px;
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-light);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: 0.06em;
}

.vs-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
}

.vs-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.vs-switch-slider {
    position: absolute;
    inset: 0;
    background: var(--border-medium);
    border-radius: 999px;
    cursor: pointer;
    transition: background var(--transition-fast, 0.15s ease);
}

.vs-switch-slider::before {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    left: 3px;
    top: 3px;
    background: var(--ds-surface);
    border-radius: 50%;
    transition: transform var(--transition-fast, 0.15s ease);
}

.vs-switch input:checked+.vs-switch-slider {
    background: var(--primary-color);
}

.vs-switch input:checked+.vs-switch-slider::before {
    transform: translateX(18px);
}

/* -------------------------------------------------------------- Submit bar */

.vs-submit-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0 4px;
    border-top: 1px solid var(--border-light);
    margin-top: 8px;
}

.vs-cost-estimate {
    font-size: 12px;
    color: var(--text-muted);
}

.vs-cost-estimate strong {
    color: var(--text-primary);
    font-size: 14px;
}

.vs-submit-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 13px;
}

.vs-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* -------------------------------------------------------- Fullscreen player */

.vs-player-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 21500;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal, 0.25s ease);
}

.vs-player-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.vs-player-box {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.vs-player-box video {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: var(--shadow-xl);
}

.vs-player-box {
    touch-action: none;   /* the gestures (video-player-gestures.js) are the overlay's */
}

.vs-player-overlay.is-chrome-hidden .vs-player-close {
    opacity: 0;
    pointer-events: none;
}

.vs-player-close {
    transition: opacity 0.18s ease;
    position: absolute;
    top: -40px;
    right: 0;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: var(--ds-on-media);
    cursor: pointer;
    font-size: 16px;
}

/* ---------------------------------------------------------- Header trigger */

.vs-model-card:focus-visible,
.vs-dropzone:focus-visible,
.vs-ref-tile-add:focus-visible,
.vs-inline-retry:focus-visible,
.vs-add-shot-btn:focus-visible,
.vs-opt-btn:focus-visible,
.vs-player-close:focus-visible,
.vs-textarea:focus-visible,
.vs-select:focus-visible,
.vs-number-input:focus-visible,
.vs-shot-row textarea:focus-visible,
.vs-shot-duration:focus-visible,
.vs-switch input:focus-visible + .vs-switch-slider {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .vs-model-card,
    .vs-player-overlay {
        transition-duration: 0.01ms;
    }

    .vs-spinner {
        animation: none;
    }
}

@keyframes vs-pulse-dot {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(var(--ds-accent-rgb), 0.6);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(var(--ds-accent-rgb), 0);
    }
}

/* -------------------------------------------------------------- Responsive */

@media (max-width: 768px) {

    .vs-model-picker {
        grid-template-columns: 1fr 1fr;
    }

    .vs-player-close {
        top: 12px;
        right: 12px;
        z-index: 2;
        background: rgba(var(--ds-accent-rgb), 0.68);
    }
}

/* A phone: no ✕ (a swipe down closes the player, as it does the picture viewer). */
@media (max-width: 768px) and (pointer: coarse) {
    .vs-player-overlay .vs-player-close {
        display: none !important;
    }
}

@media (max-width: 560px) {
    .vs-model-picker,
    .vs-field-row {
        grid-template-columns: 1fr;
    }

    .vs-submit-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .vs-submit-btn {
        justify-content: center;
        width: 100%;
    }

    .vs-shot-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
    }

    .vs-shot-row textarea {
        grid-column: 2 / -1;
    }

    .vs-shot-duration {
        grid-column: 2;
    }
}

/* ========================================================================
   Video Studio 2.0 — cinematic workspace
   The modal deliberately owns a compact dark design system so video work
   keeps consistent contrast in both the application's light and dark modes.
   ======================================================================== */

.vs-submit-btn svg,
.vs-director-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.vs-model-picker {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 0 0 auto;
    min-height: 74px;
    margin: 0;
    padding: 11px 18px;
    border-bottom: 1px solid var(--border-light);
    background: var(--ds-surface);
    overflow: hidden;
}

.vs-model-picker-label {
    display: flex;
    flex: 0 0 132px;
    flex-direction: column;
    gap: 4px;
    padding-right: 14px;
    border-right: 1px solid var(--border-light);
}

.vs-model-picker-label span,
.vs-eyebrow,
.vs-section-heading > div > span,
.vs-inspector-heading > span,
.vs-prompt-heading label > span,
.vs-director-prompt > span,
.vs-stage-kicker {
    color: var(--ds-ink-2);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.vs-model-picker-label small {
    color: var(--ds-ink-2);
    font-size: 9px;
}

.vs-default-model-btn {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 5px;
    min-height: 24px;
    margin-top: 2px;
    padding: 0 8px;
    border: 1px solid rgba(var(--ds-ink-rgb), 0.1);
    border-radius: 999px;
    background: var(--ds-surface);
    color: var(--ds-muted);
    font: inherit;
    font-size: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.vs-default-model-btn:hover:not(:disabled) {
    border-color: rgba(var(--primary-color-rgb), 0.42);
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-light);
}

.vs-default-model-btn.is-default,
.vs-default-model-btn:disabled {
    border-color: rgba(var(--primary-color-rgb), 0.22);
    background: rgba(var(--primary-color-rgb), 0.07);
    color: var(--primary-light);
    cursor: default;
    opacity: 0.8;
}

.vs-model-track {
    display: flex;
    flex: 1;
    gap: 7px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.vs-model-track::-webkit-scrollbar {
    display: none;
}

.vs-model-card {
    position: relative;
    width: auto;
    min-width: 178px;
    min-height: 48px;
    padding: 8px 9px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--border-light);
    border-radius: 7px;
    background: var(--ds-surface);
    box-shadow: none;
}

.vs-model-card:hover {
    border-color: rgba(var(--ds-ink-rgb), 0.2);
    background: var(--ds-surface);
    transform: none;
    box-shadow: none;
}

.vs-model-card.selected {
    border-color: rgba(var(--primary-color-rgb), 0.48);
    background: rgba(var(--primary-color-rgb), 0.09);
    box-shadow: inset 0 0 0 1px rgba(var(--primary-color-rgb), 0.1);
}

.vs-model-picker.has-constraint .vs-model-card.is-compatible {
    border-color: rgba(var(--primary-color-rgb), 0.34);
    background: rgba(var(--primary-color-rgb), 0.055);
}

.vs-model-picker.has-constraint .vs-model-card.is-compatible:hover,
.vs-model-picker.has-constraint .vs-model-card.is-compatible.selected {
    border-color: rgba(var(--primary-color-rgb), 0.62);
    background: rgba(var(--primary-color-rgb), 0.12);
}

.vs-model-picker.has-constraint .vs-model-card.is-limited {
    border-style: dashed;
    background: rgba(var(--primary-color-rgb), 0.035);
}

.vs-model-picker.has-constraint .vs-model-card.is-limited .vs-model-fit {
    color: var(--primary-light);
    opacity: 0.72;
}

.vs-model-card.is-incompatible,
.vs-model-card.is-incompatible:hover {
    border-color: rgba(var(--ds-ink-rgb), 0.045);
    background: var(--ds-surface);
    color: var(--ds-ink-2);
    cursor: not-allowed;
    opacity: 0.36;
    filter: saturate(0.35);
}

.vs-model-fit {
    position: absolute;
    top: 4px;
    right: 5px;
    color: var(--primary-light);
    font-size: 6px;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.vs-model-card.is-incompatible .vs-model-fit {
    color: var(--ds-ink-2);
}

.vs-model-default-mark {
    position: absolute;
    right: 6px;
    bottom: 4px;
    color: var(--primary-light);
    font-size: 7px;
}

.vs-model-default-mark[hidden],
.vs-model-fit[hidden] {
    display: none;
}

.vs-model-signal {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border: 1px solid var(--ds-line);
    border-radius: 50%;
}

.vs-model-card.selected .vs-model-signal {
    border-color: var(--primary-light);
    background: var(--primary-color);
    box-shadow: 0 0 9px rgba(var(--primary-color-rgb), 0.8);
}

.vs-model-copy {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    gap: 2px;
}

.vs-model-label {
    overflow: hidden;
    color: var(--ds-muted);
    font-size: 11px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-model-vendor {
    overflow: hidden;
    color: var(--ds-ink-2);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-model-tier {
    display: none;
}

.vs-form-area.visible {
    display: block;
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px 18px 20px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.vs-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 326px;
    align-items: start;
    gap: 14px;
    max-width: 1280px;
    margin: 0 auto;
}

.vs-creative-column {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 12px;
}

.vs-stage {
    position: relative;
    height: clamp(238px, 36vh, 326px);
    min-height: 238px;
    overflow: hidden;
    border: 1px solid rgba(var(--ds-ink-rgb), 0.1);
    border-radius: 9px;
    background: var(--ds-bg);
    box-shadow: inset 0 0 0 6px var(--ds-bg), inset 0 0 0 7px rgba(var(--ds-ink-rgb), 0.05);
}

.vs-stage-grid {
    position: absolute;
    inset: 7px;
    opacity: 0.18;
    background-image: linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 48px 48px;
}

.vs-stage-grid::after {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 48%, rgba(var(--primary-color-rgb), 0.12), transparent 58%);
    content: "";
}

.vs-stage-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    padding: 28px;
    text-align: center;
}

.vs-stage-empty[hidden],
.vs-stage-media[hidden] {
    display: none;
}

.vs-stage-empty svg {
    width: 37px;
    height: 37px;
    margin: 7px 0 5px;
    stroke: var(--ds-ink-2);
    stroke-width: 1.1;
}

.vs-stage-empty strong {
    color: var(--ds-muted);
    font-size: 13px;
    font-weight: 550;
}

.vs-stage-empty > span:last-child {
    color: var(--ds-muted);
    font-size: 10px;
}

.vs-stage-media {
    position: absolute;
    inset: 7px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: var(--ds-bg);
}

.vs-stage-media img,
.vs-stage-media video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.vs-stage-meta {
    position: absolute;
    right: 16px;
    bottom: 13px;
    left: 16px;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

.vs-stage-meta span {
    padding: 4px 6px;
    border: 1px solid rgba(var(--ds-ink-rgb), 0.11);
    border-radius: 3px;
    background: rgba(var(--ds-surface-rgb), 0.94);
    color: var(--ds-muted);
    font-size: 7px;
    font-weight: 750;
    letter-spacing: 0.1em;
    backdrop-filter: blur(8px);
}

.vs-prompt-composer,
.vs-assets-section,
.vs-director-panel,
.vs-inspector {
    border: 1px solid var(--border-light);
    border-radius: 9px;
    background: var(--ds-surface);
}

.vs-prompt-composer {
    padding: 13px;
}

.vs-prompt-heading,
.vs-prompt-actions,
.vs-section-heading,
.vs-director-result-head,
.vs-director-result-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.vs-prompt-heading label {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 650;
}

.vs-prompt-heading label > span {
    color: var(--primary-light);
}

.vs-prompt-heading label em {
    color: var(--ds-danger);
    font-style: normal;
}

.vs-prompt-heading label small,
.vs-prompt-status {
    color: var(--ds-ink-2);
    font-size: 8px;
    font-weight: 500;
}

.vs-prompt-status {
    padding: 4px 6px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.18);
    border-radius: 3px;
    color: var(--primary-light);
    letter-spacing: 0.04em;
}

.vs-prompt-composer .vs-textarea {
    min-height: 92px;
    margin-top: 9px;
    padding: 11px 0;
    border: 0;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    border-radius: 0;
    background: transparent;
    color: var(--ds-accent);
    font-size: 13px;
    line-height: 1.55;
}

.vs-prompt-composer .vs-textarea::placeholder {
    color: var(--ds-ink-2);
}

.vs-prompt-actions {
    margin-top: 10px;
}

.vs-prompt-actions > span {
    color: var(--ds-ink-2);
    font-size: 9px;
}

.vs-director-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.35);
    border-radius: 6px;
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-light);
    font: inherit;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 180ms cubic-bezier(0.22, 1, 0.36, 1),
        background-color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.vs-director-btn:hover {
    border-color: rgba(var(--primary-color-rgb), 0.7);
    background: rgba(var(--primary-color-rgb), 0.18);
}

.vs-director-btn:disabled {
    cursor: wait;
    opacity: 0.72;
}

.vs-director-loader,
.vs-director-orbit {
    width: 13px;
    height: 13px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.25);
    border-top-color: var(--primary-light);
    border-radius: 50%;
    animation: vs-spin 0.8s linear infinite;
}

.vs-assets-section {
    padding: 14px;
}

.vs-section-heading {
    align-items: flex-end;
    margin-bottom: 12px;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--border-light);
}

.vs-section-heading h3,
.vs-inspector-heading h3 {
    margin: 3px 0 0;
    color: var(--ds-muted);
    font-size: 12px;
    font-weight: 620;
}

.vs-section-heading small {
    color: var(--ds-ink-2);
    font-size: 9px;
}

.vs-assets-section > .vs-field + .vs-field,
.vs-assets-section > .vs-field-row + .vs-field,
.vs-assets-section > .vs-field + .vs-field-row,
.vs-assets-section > .vs-frame-pair-row + .vs-field,
.vs-assets-section > .vs-frame-pair-row + .vs-field-row,
.vs-assets-section > .vs-field + .vs-frame-pair-row,
.vs-assets-section > .vs-field-row + .vs-frame-pair-row {
    margin-top: 12px;
}

.vs-assets-section .vs-field-label,
.vs-inspector .vs-field-label {
    color: var(--ds-muted);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.035em;
}

/* The hints read at ≈5.6:1 on the panel's dark ground (they were #60615f, ≈2.9:1 — §0.31). */
.vs-assets-section .vs-field-hint,
.vs-inspector .vs-field-hint {
    color: var(--ds-muted);
    font-size: 10px;
    line-height: 1.45;
}

/* A drop box is one height, empty or filled: its preview fills it instead of
   taking the picture's own proportions, so a portrait frame beside an empty
   one no longer makes the pair unequal. */
.vs-assets-section .vs-dropzone {
    height: 96px;
    min-height: 0;
    border-width: 1px;
    border-radius: 6px;
    background: var(--ds-bg);
}

.vs-assets-section .vs-dropzone-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.vs-assets-section .vs-ref-grid {
    grid-template-columns: repeat(auto-fill, minmax(72px, 86px));
}

.vs-ref-tile,
.vs-ref-tile-add {
    border-width: 1px;
    border-radius: 6px;
    background: var(--ds-bg);
}

.vs-inspector {
    position: sticky;
    top: 0;
    overflow: hidden;
}

.vs-inspector-model {
    padding: 14px;
    border-bottom: 1px solid var(--border-light);
    background: var(--ds-surface);
}

.vs-inspector-model strong {
    display: block;
    margin-top: 6px;
    color: var(--ds-accent);
    font-size: 14px;
    font-weight: 650;
}

.vs-inspector-model p {
    margin: 4px 0 0;
    color: var(--ds-ink-2);
    font-size: 9px;
    line-height: 1.45;
}

.vs-inspector-caps,
.vs-director-subjects,
.vs-director-recommendations {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.vs-inspector-caps span,
.vs-director-subjects span,
.vs-director-recommendations span {
    padding: 4px 6px;
    border: 1px solid var(--border-light);
    border-radius: 3px;
    background: var(--ds-surface);
    color: var(--ds-muted);
    font-size: 8px;
}

.vs-inspector-heading {
    padding: 13px 14px 8px;
}

.vs-inspector-stack {
    display: flex;
    flex-direction: column;
    padding: 0 14px 14px;
}

.vs-inspector-stack > .vs-field,
.vs-inspector-stack > .vs-field-row,
.vs-inspector-stack > .vs-toggle-row {
    padding: 11px 0;
    border-top: 1px solid var(--border-light);
}

.vs-inspector .vs-field-row {
    grid-template-columns: 1fr;
    gap: 0;
}

/* The rows of one group (the switches, then Seed) are spaced like the
   stack's own rows: air on both sides of the rule between them. */
.vs-inspector .vs-field-row > * + * {
    margin-top: 11px;
    padding-top: 11px;
    border-top: 1px solid var(--border-light);
}

.vs-inspector .vs-textarea,
.vs-inspector .vs-select,
.vs-inspector .vs-number-input,
.vs-shot-row textarea {
    min-height: 34px;
    padding: 8px 9px;
    border-radius: 5px;
    border-color: rgba(var(--ds-ink-rgb), 0.11);
    background: var(--ds-bg);
    color: var(--ds-muted);
    font-size: 10px;
}

.vs-inspector .vs-textarea {
    min-height: 64px;
}

.vs-inspector .vs-opt-btn {
    padding: 6px 10px;
    border-radius: 4px;
    background: var(--ds-bg);
    font-size: 9px;
}

.vs-inspector .vs-opt-btn.active {
    border-color: rgba(var(--primary-color-rgb), 0.55);
    background: rgba(var(--primary-color-rgb), 0.13);
    color: var(--primary-light);
}

.vs-director-panel {
    padding: 14px;
    border-color: rgba(var(--primary-color-rgb), 0.2);
    background: var(--ds-surface);
}

.vs-director-panel[hidden] {
    display: none;
}

.vs-director-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 54px;
}

.vs-director-orbit {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
}

.vs-director-loading strong,
.vs-director-error strong {
    color: var(--ds-accent);
    font-size: 11px;
}

.vs-director-loading p,
.vs-director-error p,
.vs-director-rationale {
    margin: 4px 0 0;
    color: var(--ds-ink-2);
    font-size: 9px;
    line-height: 1.5;
}

.vs-director-result-head {
    align-items: flex-start;
    padding-bottom: 11px;
    border-bottom: 1px solid var(--border-light);
}

.vs-director-result-head h3 {
    margin: 4px 0 0;
    color: var(--ds-accent);
    font-size: 14px;
    font-weight: 620;
}

.vs-director-media-count {
    color: var(--ds-ink-2);
    font-size: 8px;
    white-space: nowrap;
}

.vs-director-rationale {
    margin-top: 11px;
    color: var(--ds-muted);
}

.vs-motion-plan {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 11px;
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-radius: 5px;
    background: var(--border-light);
}

.vs-motion-plan > div {
    padding: 9px;
    background: var(--ds-bg);
}

.vs-motion-plan span {
    color: var(--primary-light);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.vs-motion-plan p {
    margin: 5px 0 0;
    color: var(--ds-muted);
    font-size: 9px;
    line-height: 1.45;
}

.vs-director-prompt {
    margin-top: 11px;
    padding: 10px;
    border-left: 2px solid var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.055);
}

.vs-director-prompt p {
    margin: 6px 0 0;
    color: var(--ds-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 9px;
    line-height: 1.55;
}

.vs-director-warnings {
    margin: 9px 0 0;
    padding-left: 17px;
    color: var(--ds-warn);
    font-size: 8px;
}

.vs-director-result-actions {
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px solid var(--border-light);
    justify-content: flex-end;
}

.vs-director-secondary,
.vs-director-apply,
.vs-director-error button {
    min-height: 32px;
    padding: 0 11px;
    border: 1px solid var(--border-medium);
    border-radius: 5px;
    background: transparent;
    color: var(--ds-muted);
    font: inherit;
    font-size: 9px;
    font-weight: 700;
    cursor: pointer;
}

.vs-director-apply {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--accent-contrast, #ffffff);
}

.vs-director-error button {
    margin-top: 9px;
}

.vs-form-error {
    flex: 0 0 auto;
    margin: 0 18px 8px;
    border-radius: 4px;
    background: rgba(var(--ds-danger-rgb), 0.08);
}

.vs-submit-bar {
    flex: 0 0 auto;
    min-height: 62px;
    margin: 0;
    padding: 9px 18px;
    border-top: 1px solid var(--border-light);
    background: rgba(var(--ds-surface-rgb), 0.96);
    backdrop-filter: blur(16px);
}

.vs-cost-estimate {
    color: var(--ds-ink-2);
    font-size: 9px;
}

.vs-cost-estimate strong {
    color: var(--ds-muted);
    font-size: 11px;
}

.vs-submit-btn {
    min-width: 170px;
    min-height: 40px;
    justify-content: center;
    padding: 0 15px;
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    background: var(--primary-color);
    color: var(--accent-contrast, #ffffff);
    font-size: 10px;
    letter-spacing: 0.02em;
    box-shadow: none;
}

.vs-submit-btn svg {
    width: 15px;
    height: 15px;
}

.vs-director-btn:focus-visible,
.vs-default-model-btn:focus-visible,
.vs-director-secondary:focus-visible,
.vs-director-apply:focus-visible,
.vs-director-error button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

@media (max-width: 980px) {
    .vs-workspace {
        grid-template-columns: minmax(0, 1fr) 280px;
    }

    .vs-stage {
        height: clamp(220px, 34vh, 290px);
        min-height: 220px;
    }
}

@media (max-width: 760px) {

    .vs-prompt-actions > span,
    .vs-section-heading small {
        display: none;
    }

    .vs-model-picker {
        min-height: 64px;
        padding: 8px 12px;
    }

    .vs-model-picker-label {
        display: flex;
        flex: 0 0 34px;
        justify-content: center;
        padding-right: 8px;
    }

    .vs-model-picker-label > span,
    .vs-model-picker-label > small {
        display: none;
    }

    .vs-default-model-btn {
        width: 30px;
        min-height: 30px;
        justify-content: center;
        margin: 0;
        padding: 0;
        font-size: 0;
    }

    .vs-default-model-btn i {
        font-size: 9px;
    }

    .vs-model-card {
        min-width: 160px;
    }

    .vs-form-area.visible {
        padding: 12px;
    }

    .vs-workspace {
        grid-template-columns: 1fr;
    }

    .vs-inspector {
        position: static;
    }

    .vs-stage {
        height: clamp(190px, 29vh, 240px);
        min-height: 190px;
        aspect-ratio: 16 / 9;
    }

    .vs-motion-plan {
        grid-template-columns: 1fr;
    }

    .vs-submit-bar {
        padding: 8px 12px;
    }
}

@media (max-width: 520px) {

    .vs-stage {
        height: 176px;
        min-height: 176px;
    }

    .vs-assets-section .vs-field-row {
        grid-template-columns: 1fr;
    }

    .vs-prompt-heading,
    .vs-prompt-actions,
    .vs-director-result-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .vs-director-btn,
    .vs-submit-btn {
        width: 100%;
    }

    .vs-submit-bar {
        align-items: stretch;
        flex-direction: column;
    }
}

/* -------------------------------------------------------------------------
   System alignment: active accent + pill-first interaction language
   ------------------------------------------------------------------------- */

.vs-model-card,
.vs-model-signal,
.vs-prompt-status,
.vs-director-btn,
.vs-inspector-caps span,
.vs-director-subjects span,
.vs-director-recommendations span,
.vs-opt-btn,
.vs-add-shot-btn,
.vs-director-secondary,
.vs-director-apply,
.vs-director-error button,
.vs-submit-btn,
.vs-inline-retry,
.gallery-to-video-btn {
    border-radius: 999px;
}

.vs-stage,
.vs-prompt-composer,
.vs-assets-section,
.vs-director-panel,
.vs-inspector {
    border-radius: 22px;
}

.vs-stage-media {
    border-radius: 16px;
}

.vs-assets-section .vs-dropzone,
.vs-ref-tile,
.vs-ref-tile-add,
.vs-motion-plan,
.vs-director-prompt,
.vs-form-error {
    border-radius: 16px;
}

.vs-inspector .vs-select,
.vs-inspector .vs-number-input,
.vs-inspector .vs-opt-btn {
    border-radius: 999px;
}

.gallery-to-video-btn {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--accent-contrast, #ffffff);
    white-space: nowrap;
}

.gallery-to-video-btn:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.carousel-item-overlay .btn-icon.result-video-btn,
.grid-item-overlay .btn-icon.result-video-btn,
.gallery-item .result-overlay .btn-icon.result-video-btn {
    border-color: rgba(var(--primary-color-rgb), 0.58);
    background: var(--primary-color);
    color: var(--accent-contrast, #ffffff);
    box-shadow: 0 6px 18px rgba(var(--primary-color-rgb), 0.28);
}

.carousel-item-overlay .btn-icon.result-video-btn:hover,
.grid-item-overlay .btn-icon.result-video-btn:hover,
.gallery-item .result-overlay .btn-icon.result-video-btn:hover {
    border-color: var(--primary-light);
    background: var(--primary-hover, var(--primary-color));
    color: var(--accent-contrast, #ffffff);
    box-shadow: 0 8px 22px rgba(var(--primary-color-rgb), 0.38);
}

/* Main Gallery: durable Video Studio output view */
.gallery-video-item {
    cursor: pointer;
    border-color: rgba(var(--primary-color-rgb), 0.16);
    background: var(--ds-surface);
}

.gallery-video-item .result-image {
    height: auto;
    padding-bottom: 62.5%;
    background: radial-gradient(circle at 20% 10%, rgba(var(--primary-color-rgb), 0.13), transparent 40%),
        var(--ds-bg);
}

.gallery-video-item .result-image > img,
.gallery-video-item .result-image > video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform 240ms ease, filter 240ms ease;
}

.gallery-video-item:hover .result-image > img,
.gallery-video-item:hover .result-image > video {
    transform: scale(1.015);
    filter: brightness(0.72);
}

.gallery-video-model {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: calc(100% - 120px);
    padding: 6px 10px;
    overflow: hidden;
    border: 1px solid rgba(var(--primary-color-rgb), 0.3);
    border-radius: 999px;
    background: rgba(var(--ds-media-glass-rgb), 0.72);
    color: var(--ds-on-media);
    font-size: 9px;
    font-weight: 780;
    text-overflow: ellipsis;
    white-space: nowrap;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.gallery-video-model i {
    color: var(--primary-light);
}

.gallery-video-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    background: rgba(var(--ds-media-glass-rgb), 0.6);
    color: var(--ds-on-media);
    opacity: 0.86;
    transform: translate(-50%, -50%);
    transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.gallery-video-item:hover .gallery-video-play {
    background: var(--primary-color);
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
}

.gallery-video-copy {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 3;
    padding: 46px 14px 13px;
    color: var(--ds-on-media);
    background: linear-gradient(transparent, rgba(5, 6, 8, 0.94));
    pointer-events: none;
}

.gallery-video-copy p {
    display: -webkit-box;
    margin: 0 0 5px;
    overflow: hidden;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.gallery-video-copy span {
    color: rgba(255, 255, 255, 0.62);
    font-size: 9px;
}

.gallery-video-item .result-overlay {
    z-index: 7;
}

.gallery-video-empty i {
    margin-bottom: 10px;
    color: var(--primary-color);
    font-size: 30px;
}

#galleryGrid .gallery-item[draggable="true"] {
    cursor: grab;
}

#gridContainer .grid-item[draggable="true"],
#carouselContainer .carousel-item[draggable="true"] {
    cursor: grab;
}

#galleryGrid .gallery-item.vs-gallery-dragging,
#gridContainer .grid-item.vs-gallery-dragging,
#carouselContainer .carousel-item.vs-gallery-dragging {
    cursor: grabbing;
    opacity: 0.46;
    transform: scale(0.98);
}

.vs-stage-drop {
    position: absolute;
    z-index: 8;
    inset: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    border: 1px dashed rgba(var(--primary-color-rgb), 0.7);
    border-radius: 18px;
    background: rgba(var(--ds-media-glass-rgb), 0.9);
    color: var(--primary-light);
    opacity: 0;
    pointer-events: none;
    transform: scale(0.985);
    transition: opacity 180ms ease, transform 180ms ease;
}

.vs-stage-drop i {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--accent-contrast, #ffffff);
}

.vs-stage-drop strong {
    color: var(--ds-accent);
    font-size: 12px;
}

.vs-stage-drop span {
    color: var(--ds-muted);
    font-size: 9px;
}

.vs-stage.is-gallery-dragover .vs-stage-drop {
    opacity: 1;
    transform: scale(1);
}

.vs-assets-section.is-gallery-dragover {
    border-color: var(--primary-color);
    box-shadow: inset 0 0 0 1px var(--primary-color),
        0 0 0 5px rgba(var(--primary-color-rgb), 0.09);
}

.vs-import-banner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding: 8px 9px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.26);
    border-radius: 999px;
    background: rgba(var(--primary-color-rgb), 0.08);
}

.vs-import-icon {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary-color);
    color: var(--accent-contrast, #ffffff);
    font-size: 10px;
}

.vs-import-banner > div:nth-child(2) {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
}

.vs-import-banner strong {
    color: var(--ds-muted);
    font-size: 9px;
}

.vs-import-banner span {
    overflow: hidden;
    color: var(--ds-ink-2);
    font-size: 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-import-banner button {
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.35);
    border-radius: 999px;
    background: transparent;
    color: var(--primary-light);
    font: inherit;
    font-size: 8px;
    font-weight: 750;
    cursor: pointer;
}

.vs-ref-source {
    position: absolute;
    bottom: 4px;
    left: 4px;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(var(--ds-media-glass-rgb), 0.76);
    color: var(--primary-light);
    font-size: 6px;
    font-weight: 800;
    letter-spacing: 0.08em;
    backdrop-filter: blur(6px);
}

.vs-ref-tile.from-gallery.is-overflow {
    border-style: dashed;
    border-color: rgba(var(--primary-color-rgb), 0.22);
    background: rgba(var(--primary-color-rgb), 0.025);
}

.vs-ref-tile.from-gallery.is-overflow img {
    opacity: 0.34;
    filter: saturate(0.15) contrast(0.86);
}

.vs-ref-tile.from-gallery.is-overflow .vs-ref-tile-remove {
    opacity: 1;
    background: rgba(var(--ds-media-glass-rgb), 0.88);
    color: var(--ds-muted);
}

.vs-ref-source.is-waiting {
    color: var(--ds-muted);
}

.vs-ref-waiting {
    position: absolute;
    top: 50%;
    left: 50%;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 20px;
    padding: 0 7px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.24);
    border-radius: 999px;
    background: rgba(var(--ds-media-glass-rgb), 0.88);
    color: var(--primary-light);
    font-size: 6px;
    font-weight: 850;
    letter-spacing: 0.08em;
    white-space: nowrap;
    transform: translate(-50%, -50%);
}

.vs-import-banner.has-overflow {
    border-style: dashed;
}

.vs-gallery-context-menu {
    position: fixed;
    z-index: 22000;
    width: min(290px, calc(100vw - 24px));
    padding: 8px;
    border: 1px solid rgba(var(--ds-ink-rgb), 0.13);
    border-radius: 22px;
    background: rgba(var(--ds-surface-rgb), 0.97);
    color: var(--ds-accent);
    box-shadow: 0 22px 64px rgba(0, 0, 0, 0.48),
        inset 0 0 0 1px rgba(var(--ds-ink-rgb), 0.025);
    backdrop-filter: blur(18px);
    animation: vs-context-in 150ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes vs-context-in {
    from {
        opacity: 0;
        transform: translateY(4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.vs-context-head {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px 9px;
}

.vs-context-head span {
    color: var(--primary-light);
    font-size: 7px;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.vs-context-head strong {
    overflow: hidden;
    color: var(--ds-muted);
    font-size: 9px;
    font-weight: 550;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-gallery-context-menu > button {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ds-muted);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: color 160ms ease, background-color 160ms ease;
}

.vs-gallery-context-menu > button:hover,
.vs-gallery-context-menu > button:focus-visible {
    outline: none;
    background: rgba(var(--primary-color-rgb), 0.13);
    color: var(--primary-light);
}

.vs-gallery-context-menu > button > i {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.22);
    border-radius: 50%;
    background: rgba(var(--primary-color-rgb), 0.07);
    color: var(--primary-light);
    font-size: 10px;
}

.vs-gallery-context-menu > button > span {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 1px;
}

.vs-gallery-context-menu > button strong {
    font-size: 9px;
    font-weight: 700;
}

.vs-gallery-context-menu > button small {
    color: var(--ds-ink-2);
    font-size: 7px;
}

@media (max-width: 760px) {

    .vs-import-banner {
        grid-template-columns: auto minmax(0, 1fr);
        border-radius: 18px;
    }

    .vs-import-banner button {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* Two-image role controls: frame transition or multimodal references. Both
   boxes start on the same line; the swap button sits at the boxes' middle
   (the box is 96px, the button 34px). */
.vs-frame-pair-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: start;
    gap: 8px;
}

.vs-field-label-split {
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
    min-width: 0;
}

.vs-field-label-split > span,
.vs-field-label-split > small {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vs-field-label-split > small {
    color: var(--ds-muted);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0;
}

.vs-frame-swap {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    align-self: end;
    margin: 0 0 31px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.36);
    border-radius: 999px;
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-light);
    cursor: pointer;
    transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.vs-frame-swap:not(:disabled):hover,
.vs-frame-swap:not(:disabled):focus-visible {
    outline: none;
    border-color: var(--primary-color);
    background: rgba(var(--primary-color-rgb), 0.2);
    transform: rotate(180deg);
}

.vs-frame-swap:not(:disabled):active {
    transform: rotate(180deg) scale(0.94);
}

.vs-frame-swap:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.vs-import-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.vs-import-role-switch {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid rgba(var(--primary-color-rgb), 0.2);
    border-radius: 999px;
    background: rgba(var(--ds-surface-rgb), 0.94);
}

.vs-import-role-switch > span {
    padding: 0 5px 0 7px;
    color: var(--ds-ink-2);
    font-size: 6px;
    font-weight: 800;
    letter-spacing: 0.1em;
}

.vs-import-banner .vs-import-role-switch button {
    width: auto;
    min-height: 24px;
    padding: 0 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ds-ink-2);
    font-size: 7px;
    font-weight: 700;
    white-space: nowrap;
}

.vs-import-banner .vs-import-role-switch button:hover,
.vs-import-banner .vs-import-role-switch button:focus-visible {
    outline: none;
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-light);
}

.vs-import-banner .vs-import-role-switch button[aria-pressed="true"] {
    background: var(--primary-color);
    color: var(--accent-contrast, #ffffff);
    box-shadow: 0 5px 14px rgba(var(--primary-color-rgb), 0.2);
}

.vs-import-banner .vs-import-role-switch button:disabled {
    opacity: 0.32;
    cursor: not-allowed;
}

@media (max-width: 980px) {
    .vs-import-banner {
        grid-template-columns: auto minmax(0, 1fr);
        border-radius: 18px;
    }

    .vs-import-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .vs-import-role-switch {
        min-width: 0;
        flex: 1;
    }

    .vs-import-banner .vs-import-role-switch button {
        flex: 1;
    }
}

@media (max-width: 560px) {
    .vs-frame-pair-row {
        gap: 5px;
    }

    .vs-frame-swap {
        width: 30px;
        height: 30px;
    }

    .vs-import-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .vs-import-role-switch > span {
        display: none;
    }
}

/* Seedance and a real person's picture (V0): said where the pictures are given. */
.vs-provider-notice {
    margin: 10px 0 0;
    padding: 8px 10px;
    border-left: 3px solid var(--warning-color, #f59e0b);
    border-radius: 6px;
    background: rgba(var(--ds-accent-rgb), 0.08);
    font-size: 12px;
    line-height: 1.45;
}
