/* ============================================================
   OVERLOOK  |  Design System v5
   Brick Brand — Dark, Red accent, JetBrains Mono, Inter
   ============================================================ */

:root {
    --bg: #000000;
    --surface: #0d0d0d;
    --surface-2: #141414;
    --surface-3: #1a1a1a;
    --border: #222222;
    --border-hover: #333333;

    --accent: #DC2626;
    --accent-rgb: 220, 38, 38;
    --accent-dim: rgba(220, 38, 38, 0.08);
    --accent-glow: rgba(220, 38, 38, 0.25);

    --green: #00c853;
    --green-dim: rgba(0, 200, 83, 0.1);
    --yellow: #ffd600;
    --yellow-dim: rgba(255, 214, 0, 0.1);
    --blue: #2979ff;
    --blue-dim: rgba(41, 121, 255, 0.1);

    --text: #ffffff;
    --text-dim: #999;
    --text-muted: #555;

    --font: 'Inter', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;
    --sans: 'Inter', -apple-system, sans-serif;

    --radius: 3px;
    --header-h: 56px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Reset ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ============================================================
   HEADER
   ============================================================ */
#app-header {
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    padding: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 24px;
    height: 100%;
    border-right: 1px solid var(--border);
}

.logo-mark {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-weight: 800;
    font-size: 12px;
    color: #fff;
    letter-spacing: -0.05em;
    flex-shrink: 0;
}

.logo-mark::after {
    content: 'BR';
}

.header-divider {
    width: 1px;
    height: 20px;
    background: var(--border);
    margin: 0 14px;
}

.logo-text {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text);
    text-transform: uppercase;
    white-space: nowrap;
}

.logo-sub {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid var(--border);
}

.header-center {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.header-center .breadcrumb-sep {
    color: var(--border);
}

.header-center .breadcrumb-active {
    color: var(--text);
    font-weight: 600;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    padding: 0 24px;
}

.credits-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: border-color 0.15s;
}

.credits-badge:hover {
    border-color: var(--green);
}

.credits-badge svg {
    color: var(--green);
    flex-shrink: 0;
}

.credits-l.header-breadcrumb {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    text-transform: uppercase;
}

.header-breadcrumb a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.header-breadcrumb a:hover {
    color: var(--accent);
}

.header-breadcrumb #breadcrumb-cat {
    color: var(--text);
    font-weight: 600;
}

.credits-value {
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--green);
}

.version-tag {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-muted);
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    letter-spacing: 0.06em;
}

/* ============================================================
   LOBBY / PRE-MENU
   ============================================================ */
.lobby {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    overflow-y: auto;
    position: relative;
    background: linear-gradient(145deg, #050505 0%, #0a0a0a 40%, #080808 70%, #050505 100%);
    z-index: 1;
}

.lobby::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(220, 38, 38, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(220, 38, 38, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(220, 38, 38, 0.04) 0%, transparent 50%);
    pointer-events: none;
}

.lobby-inner {
    max-width: 900px;
    width: 100%;
}

.lobby-hero {
    margin-bottom: 48px;
    text-align: center;
}

.lobby-hero-badge {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.2em;
    color: var(--accent);
    margin-bottom: 20px;
}

.lobby-title {
    font-family: var(--sans);
    font-size: clamp(32px, 5vw, 56px);
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 16px;
}

.blink {
    animation: blink-cursor 1s step-end infinite;
    color: var(--accent);
}

@keyframes blink-cursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.lobby-subtitle {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 300;
    color: var(--text-dim);
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
}

/* Lobby Grid */
.lobby-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.lobby-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 20px;
    background: rgba(18, 18, 18, 0.5);
    border: 1px solid rgba(220, 38, 38, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    overflow: hidden;
}

.lobby-card:hover {
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(24, 24, 24, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.lobby-card:focus-visible {
    outline: 2px solid var(--accent, #7c5cff);
    outline-offset: 2px;
}

.lobby-card:hover .lobby-card-glow {
    opacity: 1;
}

.lobby-card-glow {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 60px;
    background: radial-gradient(ellipse, rgba(220, 38, 38, 0.15), transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.lobby-card-wide {
    grid-column: span 3;
    flex-direction: row;
    align-items: center;
    padding: 20px 24px;
}

.lobby-card-wide .lobby-card-body {
    flex: 1;
}

.lobby-card-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lobby-card-icon svg {
    width: 28px;
    height: 28px;
    color: var(--text-dim);
    transition: color 0.2s;
}

.lobby-card:hover .lobby-card-icon svg {
    color: var(--accent);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.lobby-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.lobby-card-title {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

.lobby-card-desc {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-muted);
    line-height: 1.4;
    letter-spacing: 0.02em;
}

.lobby-card-count {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-muted);
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    white-space: nowrap;
    align-self: flex-start;
}

.lobby-card:hover .lobby-card-count {
    color: var(--accent);
    border-color: rgba(220, 38, 38, 0.3);
}

/* ── Seedance 2.0 Featured Card ── */
.lobby-card-featured {
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    background: linear-gradient(135deg, rgba(88, 28, 235, 0.08) 0%, rgba(15, 15, 15, 0.9) 40%, rgba(37, 99, 235, 0.06) 100%);
    border: 1px solid rgba(88, 28, 235, 0.2);
    position: relative;
    overflow: hidden;
}

.lobby-card-featured .lobby-card-body {
    padding: 0;
}

.lobby-card-featured::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.5), rgba(59, 130, 246, 0.5), transparent);
}

.lobby-card-featured-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 50%, rgba(88, 28, 235, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.lobby-card-featured:hover {
    border-color: rgba(139, 92, 246, 0.45);
    background: linear-gradient(135deg, rgba(88, 28, 235, 0.12) 0%, rgba(20, 20, 20, 0.95) 40%, rgba(37, 99, 235, 0.08) 100%);
    box-shadow: 0 8px 32px rgba(88, 28, 235, 0.15), 0 0 0 1px rgba(139, 92, 246, 0.1);
}

.lobby-card-featured:hover .lobby-card-icon svg {
    color: #8b5cf6;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.4));
}

.lobby-card-featured:hover .lobby-card-count {
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.35);
}

.lobby-card-featured .lobby-card-glow {
    background: radial-gradient(ellipse, rgba(139, 92, 246, 0.2), transparent 70%);
}

.lobby-card-featured .lobby-card-body {
    flex: 1;
}

.lobby-card-new-badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: #fff;
    background: linear-gradient(135deg, #7c3aed, #3b82f6);
    padding: 2px 7px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ── Seedance 2.0 Workflow Picker Modal ── */
.seedance2-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px 24px 28px;
}

.seedance2-wf-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px 20px;
    background: rgba(18, 18, 18, 0.6);
    border: 1px solid rgba(139, 92, 246, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.seedance2-wf-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 100%, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.seedance2-wf-card:hover {
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(24, 24, 24, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(139, 92, 246, 0.08);
}

.seedance2-wf-card:hover::before {
    opacity: 1;
}

.seedance2-wf-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seedance2-wf-icon svg {
    width: 32px;
    height: 32px;
    color: var(--text-dim);
    transition: color 0.2s, filter 0.2s;
}

.seedance2-wf-card:hover .seedance2-wf-icon svg {
    color: #8b5cf6;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.4));
}

.seedance2-wf-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.seedance2-wf-title {
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.seedance2-wf-desc {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.5;
    letter-spacing: 0.02em;
}

.seedance2-wf-tag {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-muted);
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    white-space: nowrap;
    align-self: flex-start;
    transition: all 0.2s;
}

.seedance2-wf-card:hover .seedance2-wf-tag {
    color: #8b5cf6;
    border-color: rgba(139, 92, 246, 0.3);
}

/* ── Lobby Divider & Slim Card ── */
.lobby-divider {
    margin-top: 48px;
    margin-bottom: 36px;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-align: center;
}

.lobby-slim-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 80px;
    padding: 0 24px;
    background: rgba(18, 18, 18, 0.5);
    border: 1px solid rgba(220, 38, 38, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
}

.lobby-slim-card:hover {
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(24, 24, 24, 0.8);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.lobby-slim-card:hover .lsc-arrow {
    color: var(--accent);
}

.lobby-slim-card:hover .lsc-arrow svg {
    transform: translateX(4px);
}

.lsc-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.lsc-icon svg {
    width: 28px;
    height: 28px;
    color: var(--text);
}

.lsc-title {
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.lsc-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 2;
    justify-content: center;
    transform: translateY(-1px);
    /* Optical alignment refinement */
}

.lsc-pill {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-muted);
    background: var(--surface-2);
    padding: 6px 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    white-space: nowrap;
}

.lsc-right {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: flex-end;
}

.lsc-count {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-muted);
    padding: 3px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    white-space: nowrap;
}

.lsc-arrow {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    transition: color 0.2s ease;
}

.lsc-arrow svg {
    transition: transform 0.25s ease;
}

/* ── Panel Header Bar ── */

/* ── Model Picker Trigger Button ── */

/* V1 .config-panel-inline and .inline-params-header removed */

/* ── Model Picker Modal ── */
.model-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-picker-modal.hidden {
    display: none;
}

.mpm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    animation: mpm-fade-in 0.2s ease;
}

@keyframes mpm-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.mpm-panel {
    position: relative;
    z-index: 10;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    width: min(900px, calc(100vw - 48px));
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: mpm-slide-up 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

@keyframes mpm-slide-up {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.97);
    }

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

.mpm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.mpm-title {
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.mpm-subtitle {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    letter-spacing: 0.05em;
}

.mpm-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
}

.mpm-close:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.mpm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    padding: 20px 24px 28px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    align-content: start;
}

.mpm-grid::after {
    content: "";
    display: block;
    height: 10px;
    grid-column: 1 / -1;
}

/* Model Picker Card */
.mpm-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    padding-top: 22px;
    background: rgba(18, 18, 18, 0.5);
    border: 1px solid rgba(220, 38, 38, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    overflow: hidden;
}

.mpm-card:hover {
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(24, 24, 24, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.mpm-card.active {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.mpm-card[data-color="mc-ideogram"] {
    background: radial-gradient(circle at 100% 0%, rgba(0, 122, 255, 0.05), var(--surface-2) 60%);
}

.mpm-card.active[data-color="mc-ideogram"] {
    border-color: #007AFF;
    background: radial-gradient(circle at 100% 0%, rgba(0, 122, 255, 0.1), var(--surface-2) 70%);
}

.mpm-card[data-color="mc-qwen"] {
    background: radial-gradient(circle at 100% 0%, rgba(123, 97, 255, 0.05), var(--surface-2) 60%);
}

.mpm-card.active[data-color="mc-qwen"] {
    border-color: #7B61FF;
    background: radial-gradient(circle at 100% 0%, rgba(123, 97, 255, 0.1), var(--surface-2) 70%);
}

.mpm-card[data-color="mc-flux"] {
    background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.03), var(--surface-2) 60%);
}

.mpm-card.active[data-color="mc-flux"] {
    border-color: #FFFFFF;
    background: radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.08), var(--surface-2) 70%);
}

.mpm-card[data-color="mc-kling"] {
    background: radial-gradient(circle at 100% 0%, rgba(0, 196, 182, 0.05), var(--surface-2) 60%);
}

.mpm-card.active[data-color="mc-kling"] {
    border-color: #00C4B6;
    background: radial-gradient(circle at 100% 0%, rgba(0, 196, 182, 0.1), var(--surface-2) 70%);
}

.mpm-card[data-color="mc-openai"] {
    background: radial-gradient(circle at 100% 0%, rgba(16, 163, 127, 0.05), var(--surface-2) 60%);
}

.mpm-card.active[data-color="mc-openai"] {
    border-color: #10A37F;
    background: radial-gradient(circle at 100% 0%, rgba(16, 163, 127, 0.1), var(--surface-2) 70%);
}

.mpm-card[data-color="mc-bytedance"] {
    background: radial-gradient(circle at 100% 0%, rgba(0, 85, 255, 0.05), var(--surface-2) 60%);
}

.mpm-card.active[data-color="mc-bytedance"] {
    border-color: #0055FF;
    background: radial-gradient(circle at 100% 0%, rgba(0, 85, 255, 0.1), var(--surface-2) 70%);
}

.mpm-card[data-color="mc-wan"] {
    background: radial-gradient(circle at 100% 0%, rgba(2, 106, 240, 0.05), var(--surface-2) 60%);
}

.mpm-card.active[data-color="mc-wan"] {
    border-color: #026AF0;
    background: radial-gradient(circle at 100% 0%, rgba(2, 106, 240, 0.1), var(--surface-2) 70%);
}

/* V1 card sub-elements removed (.mpm-card-top, .mpm-card-icon, .mpm-card-cost,
   .mpm-card-name, .mpm-card-provider, .mpm-card-desc, .mpm-card-footer,
   .mpm-card-tag, .mpm-card-glow) — all cards now use V2 glassmorphism design */

/* ============================================================
   NANO BANANA V2 — Glassmorphism Experimental Card
   Inspired by modern dark AI studio interfaces
   ============================================================ */

/* ── V2 Glassmorphism Card Design (all image cards) ── */

/* ── Provider color tokens ── */
.mpm-card-v2 {
    --v2-c1: 96, 165, 250;
    --v2-c2: 139, 92, 246;
}

.mpm-card-v2[data-color="mc-yellow"] {
    --v2-c1: 255, 214, 0;
    --v2-c2: 255, 171, 0;
}

.mpm-card-v2[data-color="mc-purple"] {
    --v2-c1: 180, 79, 255;
    --v2-c2: 124, 77, 255;
}

.mpm-card-v2[data-color="mc-blue"] {
    --v2-c1: 41, 121, 255;
    --v2-c2: 68, 138, 255;
}

.mpm-card-v2[data-color="mc-green"] {
    --v2-c1: 0, 231, 96;
    --v2-c2: 0, 200, 83;
}

.mpm-card-v2[data-color="mc-bytedance"] {
    --v2-c1: 0, 200, 255;
    --v2-c2: 0, 85, 255;
}

.mpm-card-v2[data-color="mc-flux"] {
    --v2-c1: 200, 200, 200;
    --v2-c2: 150, 150, 150;
}

.mpm-card-v2[data-color="mc-ideogram"] {
    --v2-c1: 255, 59, 48;
    --v2-c2: 0, 122, 255;
}

.mpm-card-v2[data-color="mc-qwen"] {
    --v2-c1: 123, 97, 255;
    --v2-c2: 80, 50, 200;
}

.mpm-card-v2[data-color="mc-openai"] {
    --v2-c1: 16, 163, 127;
    --v2-c2: 14, 200, 160;
}

.mpm-card-v2[data-color="mc-nano-v2"] {
    --v2-c1: 96, 165, 250;
    --v2-c2: 167, 139, 250;
}

.mpm-card-v2[data-color="mc-kling"] {
    --v2-c1: 0, 153, 255;
    --v2-c2: 0, 196, 182;
}

.mpm-card-v2[data-color="mc-wan"] {
    --v2-c1: 2, 106, 240;
    --v2-c2: 20, 184, 255;
}

.mpm-card-v2[data-color="mc-red"] {
    --v2-c1: 239, 68, 68;
    --v2-c2: 220, 38, 38;
}

.mpm-card-v2[data-color="mc-pink"] {
    --v2-c1: 255, 64, 129;
    --v2-c2: 233, 30, 99;
}

.mpm-card-v2[data-color="mc-teal"] {
    --v2-c1: 0, 191, 165;
    --v2-c2: 0, 150, 136;
}

.mpm-card-v2[data-color="mc-orange"] {
    --v2-c1: 255, 140, 0;
    --v2-c2: 255, 109, 0;
}

.mpm-card-v2[data-color="mc-cyan"] {
    --v2-c1: 0, 212, 238;
    --v2-c2: 0, 188, 212;
}

.mpm-card-v2[data-color="mc-coral"] {
    --v2-c1: 255, 127, 80;
    --v2-c2: 255, 99, 71;
}

.mpm-card-v2[data-color="mc-indigo"] {
    --v2-c1: 121, 134, 203;
    --v2-c2: 63, 81, 181;
}

.mpm-card-v2[data-color="mc-white"] {
    --v2-c1: 208, 208, 208;
    --v2-c2: 158, 158, 158;
}

.mpm-card.mpm-card-v2 {
    position: relative;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.mpm-card.mpm-card-v2:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow:
        0 20px 60px rgba(var(--v2-c1), 0.15),
        0 0 40px rgba(var(--v2-c2), 0.1);
    background: transparent;
    border: none;
}

.mpm-card.mpm-card-v2.active {
    border: none;
    background: transparent;
}

/* ── Animated gradient border ── */
.mpm-v2-glow-border {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(var(--v2-c1), 0.6),
            rgba(var(--v2-c2), 0.4),
            rgba(var(--v2-c1), 0.2),
            rgba(var(--v2-c2), 0.6));
    background-size: 300% 300%;
    animation: v2-border-shift 6s ease infinite;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    z-index: 1;
}

@keyframes v2-border-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.mpm-card.mpm-card-v2:hover .mpm-v2-glow-border {
    background: linear-gradient(135deg,
            rgba(var(--v2-c1), 0.9),
            rgba(var(--v2-c2), 0.7),
            rgba(var(--v2-c1), 0.5),
            rgba(var(--v2-c2), 0.9));
    background-size: 300% 300%;
    animation: v2-border-shift 3s ease infinite;
}

/* ── Inner glass panel ── */
.mpm-v2-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    height: 100%;
    background: linear-gradient(145deg,
            rgba(15, 15, 30, 0.95),
            rgba(10, 10, 25, 0.85));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 16px;
}

/* ── Header: icon + badge ── */
.mpm-v2-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mpm-v2-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--v2-c1), 0.15), rgba(var(--v2-c2), 0.15));
    border: 1px solid rgba(var(--v2-c1), 0.2);
    border-radius: 12px;
    color: rgb(var(--v2-c1));
    transition: all 0.3s ease;
}

.mpm-v2-icon svg {
    width: 22px;
    height: 22px;
}

.mpm-card.mpm-card-v2:hover .mpm-v2-icon {
    background: linear-gradient(135deg, rgba(var(--v2-c1), 0.25), rgba(var(--v2-c2), 0.25));
    border-color: rgba(var(--v2-c1), 0.4);
    box-shadow: 0 0 20px rgba(var(--v2-c1), 0.2);
}

.mpm-card.mpm-card-v2.active .mpm-v2-icon {
    background: linear-gradient(135deg, rgba(var(--v2-c1), 0.35), rgba(var(--v2-c2), 0.35));
    border-color: rgba(var(--v2-c1), 0.6);
    box-shadow: 0 0 30px rgba(var(--v2-c1), 0.3);
}

.mpm-v2-badge {
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.15em;
    padding: 4px 10px;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(var(--v2-c1), 0.15), rgba(var(--v2-c2), 0.15));
    border: 1px solid rgba(var(--v2-c1), 0.25);
    color: rgb(var(--v2-c1));
    text-transform: uppercase;
}

/* ── Body: name, provider, desc ── */
.mpm-v2-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mpm-v2-name {
    font-family: var(--sans);
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.2;
    background: linear-gradient(135deg, #ffffff, rgb(var(--v2-c1)));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mpm-v2-provider {
    font-family: var(--sans);
    font-size: 11px;
    color: rgba(148, 163, 184, 0.8);
    font-weight: 500;
    margin-bottom: 4px;
}

.mpm-v2-desc {
    font-family: var(--sans);
    font-size: 11px;
    color: rgba(148, 163, 184, 0.6);
    line-height: 1.5;
}

/* ── Features list ── */
.mpm-v2-features {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid rgba(var(--v2-c1), 0.1);
}

.mpm-v2-feature {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(148, 163, 184, 0.7);
    letter-spacing: 0.02em;
}

.mpm-v2-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgb(var(--v2-c1)), rgb(var(--v2-c2)));
    flex-shrink: 0;
}

/* ── Footer: tag + cost ── */
.mpm-v2-footer {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mpm-v2-tag {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(var(--v2-c1), 0.12);
    color: rgb(var(--v2-c1));
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid rgba(var(--v2-c1), 0.15);
}

.mpm-v2-cost {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.15);
}

/* ── Ambient glow behind card ── */
.mpm-v2-ambient {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 80px;
    background: radial-gradient(ellipse,
            rgba(var(--v2-c1), 0.15),
            rgba(var(--v2-c2), 0.08) 40%,
            transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.mpm-card.mpm-card-v2:hover .mpm-v2-ambient {
    opacity: 1;
}

.mpm-card.mpm-card-v2.active .mpm-v2-ambient {
    opacity: 0.8;
}

/* ── Active state: enhanced glow ── */
.mpm-card.mpm-card-v2.active .mpm-v2-glow-border {
    background: linear-gradient(135deg,
            rgba(var(--v2-c1), 1),
            rgba(var(--v2-c2), 0.8),
            rgba(var(--v2-c1), 0.6),
            rgba(var(--v2-c2), 1));
    background-size: 300% 300%;
    animation: v2-border-shift 2s ease infinite;
}

.mpm-card.mpm-card-v2.active .mpm-v2-inner {
    background: linear-gradient(145deg,
            rgba(20, 20, 45, 0.95),
            rgba(15, 15, 35, 0.9));
}

.mpm-card.mpm-card-v2.active .mpm-v2-badge {
    background: linear-gradient(135deg, rgba(var(--v2-c1), 0.25), rgba(var(--v2-c2), 0.25));
    border-color: rgba(var(--v2-c1), 0.5);
    color: #bfdbfe;
}

/* ── Accent stripe color for v2 ── */

.model-selector-grid {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.model-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    font-size: 0;
    line-height: 1;
}

.model-chip:hover {
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(24, 24, 24, 0.8);
}

.model-chip.active {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.model-chip .mc-icon {
    width: 24px;
    height: 24px;
    font-size: 9px;
}

.model-chip-name {
    font-family: var(--sans);
    font-size: 10px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.model-chip.active .model-chip-name {
    color: var(--accent);
}

.model-chip-provider {
    font-family: var(--mono);
    font-size: 8px;
    color: var(--text-muted);
    display: none;
}

.model-context-desc {
    font-family: var(--sans);
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.5;
    margin-top: 10px;
    min-height: 33px;
    /* 2 lines approx */
    padding: 0 4px;
}

/* Prompt word count & shortcuts */
.prompt-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
}

.prompt-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    padding: 0 4px;
}

.shortcut-legend {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-muted);
}

.kbd {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 9px;
    color: var(--text-dim);
}

.btn-text-only {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.15s;
}

.btn-text-only:hover {
    color: var(--accent);
}

/* Tab pulse animation */

@keyframes tab-pulse-anim {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* ============================================================
   CATEGORY FILTER
   ============================================================ */
.cat-filter {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.cat-btn {
    padding: 5px 10px;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: all 0.15s;
    white-space: nowrap;
}

.cat-btn:hover {
    color: var(--text-dim);
    border-color: var(--border-hover);
}

.cat-btn.active {
    color: var(--bg);
    background: var(--text);
    border-color: var(--text);
}

/* ============================================================
   MODEL CATALOG (kept for legacy compat)
   ============================================================ */
.model-catalog {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.model-group-label {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-group-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.model-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
}

.model-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    width: 100%;
    position: relative;
}

.model-card:hover {
    background: var(--surface-2);
    border-color: var(--border-hover);
}

.model-card.active {
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* Model icon — text badge */
.mc-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    letter-spacing: 0;
}

.model-card.active .mc-icon {
    box-shadow: 0 0 10px currentColor;
    opacity: 1;
}

.mc-top {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
}

.mc-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.mc-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* Provider color variants */
.mc-purple {
    background: rgba(148, 0, 211, 0.15);
    color: #b44fff;
    border-color: rgba(148, 0, 211, 0.3);
}

.mc-blue {
    background: rgba(41, 121, 255, 0.15);
    color: #5b9aff;
    border-color: rgba(41, 121, 255, 0.3);
}

.mc-cyan {
    background: rgba(0, 188, 212, 0.15);
    color: #00d4ee;
    border-color: rgba(0, 188, 212, 0.3);
}

.mc-green {
    background: rgba(0, 200, 83, 0.15);
    color: #00e760;
    border-color: rgba(0, 200, 83, 0.3);
}

.mc-teal {
    background: rgba(0, 150, 136, 0.15);
    color: #00bfa5;
    border-color: rgba(0, 150, 136, 0.3);
}

.mc-yellow {
    background: rgba(255, 214, 0, 0.15);
    color: #ffd600;
    border-color: rgba(255, 214, 0, 0.3);
}

.mc-orange {
    background: rgba(255, 109, 0, 0.15);
    color: #ff8c00;
    border-color: rgba(255, 109, 0, 0.3);
}

.mc-red {
    background: rgba(220, 38, 38, 0.15);
    color: #DC2626;
    border-color: rgba(220, 38, 38, 0.3);
}

.mc-pink {
    background: rgba(233, 30, 99, 0.15);
    color: #ff4081;
    border-color: rgba(233, 30, 99, 0.3);
}

.mc-indigo {
    background: rgba(63, 81, 181, 0.15);
    color: #7986cb;
    border-color: rgba(63, 81, 181, 0.3);
}

.mc-white {
    background: rgba(240, 240, 240, 0.1);
    color: #d0d0d0;
    border-color: rgba(240, 240, 240, 0.2);
}

.mc-coral {
    background: rgba(255, 127, 80, 0.15);
    color: #ff7f50;
    border-color: rgba(255, 127, 80, 0.3);
}

.mc-name {
    font-size: 10px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--sans);
    line-height: 1.2;
    display: block;
}

.mc-provider {
    font-family: var(--mono);
    font-size: 8px;
    color: var(--text-muted);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.mc-type {
    font-family: var(--mono);
    font-size: 7px;
    padding: 2px 5px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.05em;
}

.mc-type-file {
    background: rgba(0, 200, 83, 0.08);
    color: var(--green);
    border-color: rgba(0, 200, 83, 0.2);
}

.mc-type-text {
    background: rgba(41, 121, 255, 0.08);
    color: #5b9aff;
    border-color: rgba(41, 121, 255, 0.2);
}

.model-card.active .mc-type {
    border-color: var(--accent);
    color: var(--accent);
}

/* ============================================================
   CONFIG PANEL
   ============================================================ */
.config-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.config-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.config-selected {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.config-cost-tag {
    font-family: var(--mono);
    font-size: 9px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    white-space: nowrap;
}

.cost-low {
    color: var(--green);
    border-color: rgba(0, 200, 83, 0.3);
}

.cost-mid {
    color: var(--yellow);
    border-color: rgba(255, 214, 0, 0.3);
}

.cost-high {
    color: var(--accent);
    border-color: rgba(220, 38, 38, 0.3);
}

/* Params Empty */
.params-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    text-align: center;
}

.params-empty svg {
    color: var(--text-muted);
    opacity: 0.4;
}

.params-empty p {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Forms */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.form-input,
.form-textarea,
.form-select {
    padding: 10px 12px;
    font-size: 12px;
    font-family: var(--mono);
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    outline: none;
    transition: border-color 0.15s;
    width: 100%;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    border-color: var(--accent);
}

.form-textarea::placeholder,
.form-input::placeholder {
    color: var(--text-muted);
}

/* Radio Pills */
.radio-group {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.radio-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 10px;
    font-family: var(--mono);
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.radio-pill:hover {
    border-color: var(--border-hover);
    color: var(--text-dim);
}

.radio-pill:has(input:checked) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.radio-pill input[type="radio"] {
    display: none;
}

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--surface-2);
    position: relative;
    overflow: hidden;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.upload-icon {
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upload-zone:hover .upload-icon {
    color: var(--accent);
}

.upload-text {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
}

.upload-hint {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 4px;
    opacity: 0.6;
}

.upload-link {
    color: var(--text-dim);
    text-decoration: underline;
}

/* File Preview */
.file-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.file-preview-thumb {
    width: 36px;
    height: 36px;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.file-preview-thumb img,
.file-preview-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-preview-name {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-preview-size {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-muted);
}

.file-preview-remove {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s;
}

.file-preview-remove:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ── Submit Button ── */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 20px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.btn-primary:hover:not(:disabled) {
    background: #ef4444;
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: var(--surface-2);
    color: var(--text-muted);
    cursor: not-allowed;
    border: 1px solid var(--border);
    transform: none;
}

.btn-primary.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
    position: relative;
}

.btn-primary.loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    margin-left: 6px;
}

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

/* ── Prompt Char Counter ── */
.prompt-char-counter {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 600;
    transition: color 0.2s;
}

.prompt-char-counter.char-ok {
    color: var(--text-muted);
}

.prompt-char-counter.char-warn {
    color: var(--yellow);
}

.prompt-char-counter.char-over {
    color: #ef4444;
}

/* ── Ghost Button ── */
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.btn-ghost:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}

.btn-ghost.btn-danger:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-sm {
    padding: 4px 8px;
    font-size: 9px;
}

/* ============================================================
   RIGHT PANEL — PARAMETERS
   ============================================================ */
#panel-params {
    border-left: 1px solid var(--border);
    background: var(--surface);
}

@keyframes strip-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ── Card header ── */

/* Spinner / status icon */

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

/* Model + prompt info */

.card-model-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 800;
    margin-right: 6px;
    vertical-align: middle;
}

/* Badge */

@keyframes badge-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* ── Progress bar ── */

@keyframes progress-slide {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(350%);
    }
}

/* ── Error info inside card ── */

/* ── Result area ── */

.audio-track-label {
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Suno Rich Track Cards (task card inline view) ── */
/* ── Suno Track Card ── */

/* ── Suno Lightbox Premium Design ── */
.suno-lightbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 520px;
    max-width: 92vw;
    padding: 4px 0;
}

.suno-lb-card {
    background: #0d0d0d;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.suno-lb-card:hover {
    border-color: rgba(220, 38, 38, 0.3);
}

/* Hero zone: cover art OR gradient background */
.suno-lb-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 6;
    overflow: hidden;
    background: linear-gradient(135deg, #1a0505 0%, #2a0a0a 50%, #111 100%);
}

.suno-lb-cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: brightness(0.6) saturate(1.1);
}

.suno-lb-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right,
            rgba(0, 0, 0, 0.92) 0%,
            rgba(0, 0, 0, 0.5) 55%,
            rgba(0, 0, 0, 0.15) 100%);
    pointer-events: none;
}

.suno-lb-meta {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 18px;
    gap: 4px;
    min-width: 0;
}

.suno-lb-track-num {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent);
    opacity: 0.9;
}

.suno-lb-title {
    font-family: var(--font);
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.suno-lb-tags {
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.suno-lb-dur {
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.55);
    display: inline-block;
    width: fit-content;
    padding: 2px 7px;
    border-radius: 4px;
    margin-top: 2px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Decorative waveform bars (no-cover state) */
.suno-lb-waveform {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 2px;
    height: 44px;
    opacity: 0.25;
    z-index: 1;
}

.suno-lb-waveform span {
    display: block;
    width: 3px;
    border-radius: 2px;
    background: var(--accent);
    min-height: 4px;
}

/* Audio player */
.suno-lb-player {
    padding: 10px 14px 6px;
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.suno-lb-player audio {
    width: 100%;
    height: 32px;
    border-radius: 6px;
    accent-color: var(--accent);
    background: transparent;
}

/* Action buttons row */
.suno-lb-actions {
    display: flex;
    gap: 3px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    flex-wrap: wrap;
}

.suno-lb-btn {
    flex: 1;
    min-width: 60px;
    padding: 5px 6px;
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    white-space: nowrap;
}

.suno-lb-btn:hover {
    color: var(--accent);
    border-color: rgba(220, 38, 38, 0.4);
    background: rgba(220, 38, 38, 0.08);
}

.suno-lb-btn.loading {
    opacity: 0.4;
    pointer-events: none;
}

/* Full-width cover with overlay */
.suno-track-header {
    position: relative;
    width: 100%;
    aspect-ratio: 16/5;
    overflow: hidden;
    display: block;
}

.suno-track-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    flex-shrink: unset;
    border-radius: 0;
    border: none;
    filter: brightness(0.75);
}

/* Overlay gradient for text readability */
.suno-track-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.2) 100%);
    pointer-events: none;
}

.suno-track-info {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 12px 16px;
    gap: 4px;
    min-width: 0;
}

.suno-track-title {
    font-family: var(--font);
    font-size: 15px;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suno-track-duration {
    font-family: var(--mono);
    font-size: 9px;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.5);
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    width: fit-content;
}

.suno-track-tags {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--mono);
}

/* ── Custom Music Player (replaces native <audio>) ── */
.music-player-container {
    width: 100%;
    padding: 0;
}

.main-music-card {
    background: rgba(0, 0, 0, 0.35);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    padding: 10px 14px;
    position: relative;
}

/* Track info row */
.main-music-card .track-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.main-music-card .album-art {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: linear-gradient(135deg, #1a0a0a 0%, var(--accent) 100%);
    flex-shrink: 0;
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.main-music-card .track-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.main-music-card .track-title {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.main-music-card .artist-name {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Volume bars */
.main-music-card .volume-bars {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 28px;
    flex-shrink: 0;
}

.main-music-card .volume-bars .bar {
    width: 3px;
    height: 6px;
    background: var(--accent);
    border-radius: 2px;
    transition: height 0.15s ease;
}

/* Animate bars when playing */
.main-music-card.is-playing .volume-bars .bar {
    animation: mp-bounce 0.8s ease-in-out infinite;
}

.main-music-card.is-playing .volume-bars .bar:nth-child(1) { animation-delay: 0s; }
.main-music-card.is-playing .volume-bars .bar:nth-child(2) { animation-delay: 0.1s; }
.main-music-card.is-playing .volume-bars .bar:nth-child(3) { animation-delay: 0.2s; }
.main-music-card.is-playing .volume-bars .bar:nth-child(4) { animation-delay: 0.3s; }
.main-music-card.is-playing .volume-bars .bar:nth-child(5) { animation-delay: 0.4s; }
.main-music-card.is-playing .volume-bars .bar:nth-child(6) { animation-delay: 0.5s; }
.main-music-card.is-playing .volume-bars .bar:nth-child(7) { animation-delay: 0.6s; }
.main-music-card.is-playing .volume-bars .bar:nth-child(8) { animation-delay: 0.7s; }

@keyframes mp-bounce {
    0%, 100% { height: 6px; }
    50% { height: 22px; }
}

/* Playback controls */
.main-music-card .playback-controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Time info */
.main-music-card .time-info {
    display: flex;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    line-height: 1;
}

/* Progress bar */
.main-music-card .progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    position: relative;
    cursor: pointer;
    transition: height 0.1s ease;
}

.main-music-card .progress-bar:hover {
    height: 6px;
}

.main-music-card .progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
    pointer-events: none;
}

.main-music-card .progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.main-music-card .progress-bar:hover .progress-handle,
.main-music-card.is-scrubbing .progress-handle {
    opacity: 1;
}

/* Button row */
.main-music-card .button-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 2px;
}

.main-music-card .main-control-btns {
    display: flex;
    align-items: center;
    gap: 4px;
}

.main-music-card .control-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
}

.main-music-card .control-button:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.06);
}

.main-music-card .play-pause-btns {
    display: inline-flex;
}

.main-music-card .play-pause-button {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.main-music-card .play-pause-button:hover {
    background: #b91c1c;
    color: #fff;
}

/* Play/pause icon toggling */
.main-music-card .icon-pause { display: none; }
.main-music-card .icon-play { display: block; }
.main-music-card.is-playing .icon-pause { display: block; }
.main-music-card.is-playing .icon-play { display: none; }

/* Hidden checkbox — not used in our JS-driven approach */
.main-music-card input[type="checkbox"] { display: none; }

/* Download button */
.main-music-card .control-button.d {
    margin-left: auto;
    width: 28px;
    height: 28px;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

.main-music-card .control-button.d:hover {
    color: #fff;
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.5);
}

/* ── Lightbox variant tweaks ── */
.suno-lb-player .main-music-card {
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.suno-track-lyrics-wrap {
    margin: 0;
    border-top: 1px solid var(--border);
}

.suno-track-lyrics-wrap summary {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 700;
    color: var(--accent);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 8px 12px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.suno-track-lyrics-wrap summary::before {
    content: '▶';
    font-size: 7px;
    transition: transform 0.15s;
}

.suno-track-lyrics-wrap[open] summary::before {
    transform: rotate(90deg);
}

.suno-track-lyrics-wrap summary:hover {
    background: var(--surface-2);
}

.suno-track-lyrics {
    font-family: var(--font);
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow-y: auto;
    padding: 12px 16px;
    margin: 0;
    background: rgba(0, 0, 0, 0.25);
    border-top: 1px solid var(--border);
}

/* ── Suno Action Buttons ── */
.suno-actions-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.suno-actions-row .suno-action {
    flex: 1;
    min-width: 0;
    justify-content: center;
    padding: 6px 6px;
    font-size: 10px;
    font-family: var(--mono);
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-dim);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.suno-actions-row .suno-action:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(220, 38, 38, 0.08);
}

.suno-actions-row .suno-action.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ── Suno Inline Edit Panel ── */
.suno-inline-panel {
    margin-top: 10px;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    animation: fadeSlideIn 0.15s ease;
}

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

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

.suno-panel-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.suno-panel-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.suno-panel-label {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.suno-panel-hint {
    opacity: 0.5;
    font-size: 9px;
    text-transform: none;
    letter-spacing: 0;
}

.suno-panel-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 6px 10px;
    color: var(--text);
    font-size: 12px;
    font-family: var(--mono);
    outline: none;
    transition: border-color 0.15s;
}

.suno-panel-input:focus {
    border-color: var(--accent);
}

.suno-panel-radios {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.suno-panel-radio {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
}

.suno-panel-radio input {
    accent-color: var(--accent);
    cursor: pointer;
}

.suno-panel-actions {
    display: flex;
    gap: 8px;
}

.suno-panel-confirm {
    padding: 6px 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: opacity 0.15s;
}

.suno-panel-confirm:hover {
    opacity: 0.85;
}

.suno-panel-confirm:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.suno-panel-cancel {
    padding: 6px 12px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.suno-panel-cancel:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: var(--text);
}

/* ── Lightbox Grid ── */
.lightbox-grid {
    max-width: 100%;
}

.lightbox-grid .task-result-grid-img {
    max-height: none;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: default;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    background: rgba(18, 18, 18, 0.5);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    padding: 7px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-download:hover {
    background: rgba(220, 38, 38, 0.1);
    border-color: var(--accent);
    color: var(--accent);
}

.btn-download svg {
    opacity: 0.8;
}

/* ── Empty state ── */

/* ── History ── */

/* Multi-image mini-grid in history thumbnail (MJ 4 images) */
.history-thumb-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
    width: 100%;
    aspect-ratio: 1;
}

.history-thumb-grid-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Audio badge overlay on Suno cover art */
.history-thumb-audio-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 4px;
    color: var(--accent);
}

/* Audio placeholder for Suno tracks without cover */
.history-thumb-audio {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(20, 20, 20, 1) 0%, rgba(40, 40, 40, 1) 100%);
    position: relative;
    overflow: hidden;
}

.history-thumb-audio::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(var(--accent-rgb), 0.15) 0%, transparent 60%);
}

.history-thumb-audio svg {
    opacity: 0.8;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.history-play-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.history-play-icon svg {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5));
}

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    border-radius: var(--radius);
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text);
    animation: slideUp 0.25s ease;
    max-width: 300px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.toast.success {
    border-left-color: var(--green);
}

.toast.error {
    border-left-color: var(--accent);
}

.toast.info {
    border-left-color: var(--blue);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* ============================================================
   FORM RANGE
   ============================================================ */
.form-range {
    -webkit-appearance: none;
    appearance: none;
    height: 2px;
    background: var(--border);
    border-radius: 0;
    outline: none;
    cursor: pointer;
    flex: 1;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: var(--accent);
    cursor: pointer;
    border: none;
}

.range-value {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-dim);
    min-width: 36px;
    text-align: right;
}

/* ============================================================
   CONFIG MODEL PARAMS
   ============================================================ */
.config-model-params {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ============================================================
   SCROLLBARS
   ============================================================ */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-hover);
}

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden {
    display: none !important;
}

/* ============================================================
   TRANSITIONS
   ============================================================ */
.lobby {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lobby.exit {
    opacity: 0;
    transform: scale(0.98);
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

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

/* ============================================================
   HISTORY LIGHTBOX PLAYBACK
   ============================================================ */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}

.lightbox-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
}

.lightbox-content {
    position: relative;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(90vw, 960px);
    max-height: 92vh;
    animation: slideUp 0.3s ease;
}

.lightbox-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 10px;
}

.lightbox-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lightbox-model {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.01em;
}

.lightbox-date {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-dim);
}

.lightbox-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lightbox-close:hover {
    color: #fff;
    background: rgba(220, 38, 38, 0.25);
    border-color: rgba(220, 38, 38, 0.4);
}

.lightbox-body {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    overflow-y: auto;
    background: #050505;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 1;
    min-height: 0;
    max-height: 82vh;
    width: 100%;
}

.lightbox-media {
    width: 100%;
    max-width: min(88vw, 960px);
    max-height: 75vh;
    height: auto;
    display: block;
    object-fit: contain;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: all 0.18s ease;
}

.lightbox-nav:hover {
    background: rgba(220, 38, 38, 0.35);
    border-color: rgba(220, 38, 38, 0.7);
}

.lightbox-nav-prev {
    left: 12px;
}

.lightbox-nav-next {
    right: 12px;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 36px;
        height: 36px;
        font-size: 26px;
    }

    .lightbox-nav-prev {
        left: 8px;
    }

    .lightbox-nav-next {
        right: 8px;
    }
}

.lightbox-prompt {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 12px;
    text-align: center;
    max-width: min(88vw, 800px);
    line-height: 1.5;
    opacity: 0.7;
}

.lightbox-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.lightbox-actions .btn-download,
.lightbox-actions [class*="btn"] {
    font-size: 12px;
    padding: 7px 16px;
    border-radius: 7px;
}

.lightbox-cost {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--accent);
    background: rgba(220, 38, 38, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(220, 38, 38, 0.2);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .lobby-grid {
        grid-template-columns: 1fr 1fr;
    }

    .lobby-card-wide {
        grid-column: span 2;
    }

    #panel-prompt {
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    #panel-params {
        border-left: none;
        border-top: 1px solid var(--border);
    }

    body {
        overflow: auto;
    }

    /* ── Header mobile ── */
    .header-left {
        padding: 0 12px;
        gap: 0;
    }

    .header-right {
        padding: 0 12px;
        gap: 8px;
    }

    .credits-label {
        display: none;
    }

    .header-center {
        display: none;
    }

    .version-tag {
        display: none;
    }

    /* ── Model Picker Modal — tablet ── */
    .mpm-panel {
        width: calc(100vw - 24px);
        max-height: calc(100vh - 40px);
        border-radius: 8px;
    }

    .mpm-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 8px;
        padding: 16px;
    }

    .mpm-header {
        padding: 16px;
    }

    .mpm-card {
        padding: 14px;
        gap: 10px;
    }

    /* V1 .mpm-card-name, .mpm-card-desc responsive rules removed */
}

@media (max-width: 600px) {
    .lobby-grid {
        grid-template-columns: 1fr;
    }

    .lobby-card-wide {
        grid-column: span 1;
    }

    .lobby-slim-card {
        flex-direction: column;
        height: auto;
        padding: 24px;
        gap: 16px;
    }

    .lsc-left {
        width: 100%;
        justify-content: center;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border);
    }

    .lsc-center {
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
    }

    .lsc-right {
        width: 100%;
        justify-content: center;
        padding-top: 8px;
    }

    /* ── Header — compact mobile ── */
    :root {
        --header-h: 48px;
    }

    #app-header {
        height: 48px;
    }

    .header-left {
        padding: 0 10px;
    }

    .logo-text {
        font-size: 11px;
    }

    .logo-sub {
        font-size: 8px;
    }

    .header-divider {
        margin: 0 6px;
    }

    .header-right {
        padding: 0 10px;
        gap: 6px;
    }

    .credits-badge {
        padding: 4px 8px;
        gap: 5px;
    }

    .credits-value {
        font-size: 10px;
    }

    /* ── Model Picker Modal — full-screen bottom sheet on phone ── */
    .model-picker-modal {
        align-items: flex-end;
    }

    .mpm-panel {
        width: 100vw;
        max-height: 92vh;
        border-radius: 16px 16px 0 0;
        border: none;
        border-top: 1px solid var(--border);
    }

    .mpm-header {
        padding: 14px 16px;
    }

    .mpm-title {
        font-size: 14px;
    }

    .mpm-subtitle {
        font-size: 9px;
    }

    .mpm-close {
        width: 32px;
        height: 32px;
    }

    .mpm-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 12px;
    }

    .mpm-card {
        padding: 12px;
        padding-top: 14px;
        gap: 8px;
    }

    /* V1 card responsive styles removed (.mpm-card-icon, -name, -provider, -desc, -cost, -footer, -tag, -glow) */

    /* ── Lobby ── */
    .lobby {
        padding: 24px 16px;
    }

    .lobby-hero-badge {
        font-size: 9px;
    }

    .lobby-title {
        font-size: 28px;
    }

    .lobby-subtitle {
        font-size: 13px;
    }

    .lobby-card {
        padding: 18px 16px;
        gap: 10px;
    }

    /* ── Workspace panels ── */

    .submit-dock {
        padding: 10px 12px;
    }

    /* ── Results panel tabs ── */
}

/* ── Extra-small phones (≤ 380px) ── */
@media (max-width: 380px) {
    .mpm-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 10px;
    }

    .mpm-card {
        padding: 10px;
        gap: 8px;
    }

    /* V1 .mpm-card-desc responsive rule removed */

    .lobby-title {
        font-size: 24px;
    }
}

/* ============================================================
   MODEL ACTIVE STRIP  — persistent "you are working with X" bar
   ============================================================ */
.model-active-strip {
    flex-shrink: 0;
    padding: 10px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    min-height: 46px;
    display: flex;
    align-items: center;
}

.mas-empty {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    opacity: 0.5;
}

.mas-empty svg {
    flex-shrink: 0;
    color: var(--text-muted);
}

.mas-model {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.mas-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 10px;
    font-weight: 700;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    letter-spacing: 0;
}

.mas-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mas-name {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.01em;
}

.mas-provider {
    font-family: var(--mono);
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.mas-cost {
    font-family: var(--mono);
    font-size: 9px;
    padding: 2px 7px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============================================================
   SUBMIT DOCK  — always-visible submit footer in left panel
   ============================================================ */
.submit-dock {
    flex-shrink: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* ============================================================
   MODEL CHIP — enhanced active state + readability
   ============================================================ */

/* Slightly larger chip text */
.model-chip-name {
    font-size: 11px;
}

/* Stronger active state: left accent bar + bolder background */
.model-chip.active {
    border-color: var(--accent);
    background: var(--accent-dim);
    box-shadow: inset 2px 0 0 var(--accent);
}

.model-chip.active .model-chip-name {
    color: var(--text);
    font-weight: 700;
}

/* ============================================================
   CONFIG HEADER — more prominence when model selected
   ============================================================ */
.config-header {
    border: 1px solid var(--border-hover);
}

/* Right panel uses same topbar style as left panel */

/* ── V2 Cards — Mobile responsive ── */
@media (max-width: 600px) {
    .mpm-v2-inner {
        padding: 14px;
        gap: 10px;
    }

    .mpm-v2-name {
        font-size: 14px;
    }

    .mpm-v2-features {
        gap: 8px;
    }

    .mpm-v2-feature {
        font-size: 9px;
    }
}

/* ── Video Duration buttons (3-col grid, same pattern as resolution) ── */
.v2-duration-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

/* ── Video Aspect Ratio buttons (3-col grid) ── */
.v2-video-ar-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

/* ── Video gallery items ── */
.v2-gallery-item.video-item {
    aspect-ratio: 16 / 9;
    /* Force grid track to respect item height: aspect-ratio alone doesn't
       contribute to grid auto-row sizing (track collapses to min-content of
       children, ~29px). min-height pins the row track so items don't overlap.
       180px column min × 9/16 = 101.25px; rounds to 101. */
    min-height: 101px;
}

.v2-gallery-item.video-item .history-thumb-empty,
.v2-gallery-item.video-item .history-thumb-empty-inner {
    width: 100%;
    height: 100%;
}

.v2-gallery-item video,
.v2-gallery-item.video-item > img {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    background: rgba(0, 0, 0, 0.35);
}

/* ============================================================
   IMAGE V2 — FULL WORKSPACE OVERLAY
   3-column layout inspired by modern AI studio UIs
   ============================================================ */

.v2-ws {
    position: fixed;
    inset: 0;
    top: var(--header-h);
    z-index: 90;
    display: grid;
    grid-template-columns: 340px 1fr auto;
    overflow: hidden;
}

.v2-ws.hidden {
    display: none;
}

/* ── Animated background ── */
.v2-ws-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(145deg, #050505 0%, #0a0a0a 40%, #080808 70%, #050505 100%);
    z-index: 0;
}

.v2-ws-bg::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(220, 38, 38, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(220, 38, 38, 0.05) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(220, 38, 38, 0.04) 0%, transparent 50%);
}

/* ── Left Column ── */
.v2-ws-left {
    position: relative;
    z-index: 2;
    overflow-y: auto;
    padding: 20px;
    border-right: 1px solid rgba(220, 38, 38, 0.08);
}

.v2-ws-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Back button ── */
.v2-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 11px;
    color: rgba(148, 163, 184, 0.7);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 0;
    transition: color 0.2s;
    align-self: flex-start;
}

.v2-back-btn:hover {
    color: #DC2626;
}

/* ── Model badge ── */
.v2-model-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(220, 38, 38, 0.06);
    border: 1px solid rgba(220, 38, 38, 0.12);
    border-radius: 12px;
}

.v2-model-badge-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.v2-model-badge-icon svg {
    width: 100%;
    height: 100%;
}

.v2-model-badge-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.v2-model-badge-name {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.v2-model-badge-provider {
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(148, 163, 184, 0.6);
}

.v2-model-badge-tag {
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 3px 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.15), rgba(220, 38, 38, 0.15));
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #DC2626;
}

/* ── Form elements ── */
.v2-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.v2-label {
    font-family: var(--sans);
    font-size: 12px;
    font-weight: 600;
    color: rgba(226, 232, 240, 0.9);
}

.v2-label-hint {
    font-weight: 400;
    color: rgba(148, 163, 184, 0.4);
}

.v2-textarea {
    font-family: var(--sans);
    font-size: 13px;
    color: #e2e8f0;
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(220, 38, 38, 0.12);
    border-radius: 10px;
    padding: 12px 14px;
    resize: vertical;
    min-height: 120px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    line-height: 1.6;
}

.v2-textarea::placeholder {
    color: rgba(148, 163, 184, 0.35);
}

.v2-textarea:focus {
    border-color: rgba(220, 38, 38, 0.4);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}

.v2-prompt-meta {
    display: flex;
    justify-content: flex-end;
}

.v2-char-counter {
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(148, 163, 184, 0.4);
}

/* ── Upload zone ── */
.v2-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border: 1px dashed rgba(220, 38, 38, 0.2);
    border-radius: 10px;
    background: rgba(15, 15, 15, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    color: rgba(148, 163, 184, 0.5);
    font-family: var(--sans);
    font-size: 12px;
}

.v2-upload-zone:hover {
    border-color: rgba(220, 38, 38, 0.4);
    background: rgba(220, 38, 38, 0.04);
    color: rgba(148, 163, 184, 0.8);
}

.v2-upload-zone.dragover {
    border-color: rgba(220, 38, 38, 0.6);
    background: rgba(220, 38, 38, 0.08);
}

/* ── Label row (label + counter side by side) ── */
.v2-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.v2-file-counter {
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(148, 163, 184, 0.4);
    transition: color 0.2s;
}

.v2-file-counter.has-files {
    color: #DC2626;
}

.v2-file-counter.full {
    color: #f59e0b;
}

.v2-upload-hint {
    font-size: 10px;
    color: rgba(148, 163, 184, 0.3);
}

/* ── Multi-file preview grid ── */
.v2-files-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.v2-files-grid:empty {
    display: none;
}

.v2-file-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(220, 38, 38, 0.12);
    background: rgba(15, 15, 15, 0.5);
    transition: all 0.2s;
}

.v2-file-card:hover {
    border-color: rgba(220, 38, 38, 0.3);
}

.v2-file-preview-tooltip {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(220, 38, 38, 0.3);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
    width: 150px;
    height: 150px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.v2-file-preview-tooltip.visible {
    opacity: 1;
}

.v2-file-preview-tooltip img,
.v2-file-preview-tooltip video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.v2-file-card img,
.v2-file-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.v2-file-card-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 50%;
    color: #ef4444;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
    padding: 0;
}

.v2-file-card:hover .v2-file-card-remove {
    opacity: 1;
}

.v2-file-card-remove:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(1.1);
}

.v2-file-card-index {
    position: absolute;
    bottom: 3px;
    left: 3px;
    font-family: var(--mono);
    font-size: 8px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.6);
    padding: 1px 5px;
    border-radius: 4px;
}

.v2-file-card-name {
    position: absolute;
    bottom: 4px;
    left: 4px;
    right: 4px;
    font-size: 8px;
    color: #ccc;
    font-family: var(--mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Upload zone: full state ── */
.v2-upload-zone.v2-upload-full {
    padding: 10px;
    border-style: solid;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.04);
    opacity: 0.6;
    pointer-events: none;
}

/* ── Frame dropzone: hide upload area when a file is set ── */
.v2-frame-dropzone .v2-upload-zone.v2-frame-has-file {
    display: none;
}

/* ── Frame dropzone: thumbnail grid replaces zone ── */
.v2-frame-dropzone .v2-files-grid:not(:empty) {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
    grid-template-columns: 1fr;
}

.v2-frame-dropzone .v2-files-grid .v2-file-card {
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 8px;
}

.v2-frame-dropzone .v2-files-grid .v2-file-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    display: block;
    background: rgba(0, 0, 0, 0.3);
}

/* ── Frame Drag-and-Drop Swap ── */
.v2-frame-card {
    cursor: grab;
}

.v2-frame-card:active {
    cursor: grabbing;
}

.v2-frame-drag-source {
    opacity: 0.4;
    transform: scale(0.95);
    transition: opacity 0.2s, transform 0.2s;
}

/* Both dropzones light up when a frame is being dragged */
.v2-frame-dropzone.v2-frame-drop-target {
    position: relative;
}

.v2-frame-dropzone.v2-frame-drop-target::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px dashed rgba(220, 38, 38, 0.25);
    border-radius: 10px;
    pointer-events: none;
    z-index: 5;
    animation: v2-frame-target-pulse 1.5s ease-in-out infinite;
}

/* Active hover on the receiving dropzone */
.v2-frame-dropzone.v2-frame-drop-hover {
    background: rgba(220, 38, 38, 0.06);
    border-radius: 10px;
    transition: background 0.2s;
}

.v2-frame-dropzone.v2-frame-drop-hover::after {
    border-color: rgba(220, 38, 38, 0.6);
    box-shadow: inset 0 0 20px rgba(220, 38, 38, 0.08);
    animation: none;
}

@keyframes v2-frame-target-pulse {
    0%, 100% {
        border-color: rgba(220, 38, 38, 0.15);
    }
    50% {
        border-color: rgba(220, 38, 38, 0.4);
    }
}

/* ── Upload zone: uploading state ── */
.v2-upload-zone.uploading {
    pointer-events: none;
    opacity: 0.5;
}

/* ── Select ── */
.v2-select {
    font-family: var(--sans);
    font-size: 13px;
    color: #e2e8f0;
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(220, 38, 38, 0.12);
    border-radius: 10px;
    padding: 10px 14px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.v2-select:focus {
    border-color: rgba(220, 38, 38, 0.4);
}

.v2-select option {
    background: #0f172a;
    color: #e2e8f0;
}

/* ── Generate button ── */
.v2-generate-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #DC2626, #b91c1c);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s;
    margin-top: 8px;
    position: relative;
    overflow: hidden;
}

.v2-generate-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.v2-generate-btn:hover:not(:disabled)::before {
    opacity: 1;
}

.v2-generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.3);
}

.v2-generate-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.v2-generate-btn.loading {
    pointer-events: none;
}

.v2-generate-btn.loading span {
    opacity: 0.7;
}

/* ── Center Column: Gallery ── */
.v2-ws-center {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.v2-gallery-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(220, 38, 38, 0.08);
    flex-shrink: 0;
}

.v2-gallery-title {
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    color: rgba(226, 232, 240, 0.9);
    margin-right: auto;
}

.v2-gallery-count {
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(148, 163, 184, 0.5);
}

.v2-gallery {
    position: relative;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    min-height: 0;
    align-content: flex-start;
}

.v2-gallery-empty {
    column-span: all;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 60px 20px;
    color: rgba(148, 163, 184, 0.3);
    text-align: center;
}

.v2-gallery-empty p {
    font-family: var(--sans);
    font-size: 14px;
    color: rgba(148, 163, 184, 0.4);
}

.v2-gallery-empty-hint {
    font-size: 12px !important;
    color: rgba(148, 163, 184, 0.25) !important;
}

/* ── Gallery items ── */
.v2-gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(15, 15, 15, 0.5);
    border: 1px solid rgba(220, 38, 38, 0.14);
    transition: all 0.25s;
    cursor: pointer;
    min-width: 0;
}

.v2-gallery-item:hover {
    border-color: rgba(220, 38, 38, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.v2-gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.v2-gallery-item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    opacity: 0;
    transition: opacity 0.2s;
}

.v2-gallery-item:hover .v2-gallery-item-overlay {
    opacity: 1;
}

.v2-gallery-item-status {
    font-family: var(--mono);
    font-size: 9px;
    color: rgba(255, 255, 255, 0.8);
}

/* ── Per-item hover action bar ── */
.v2-item-actions {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 10;
}

.v2-gallery-item:hover .v2-item-actions {
    opacity: 1;
}

.v2-item-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.55);
    color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-decoration: none;
}

.v2-item-dl:hover {
    background: rgba(220, 38, 38, 0.6);
    border-color: rgba(220, 38, 38, 0.8);
    color: #fff;
}

.v2-item-del:hover {
    background: rgba(239, 68, 68, 0.6);
    border-color: rgba(239, 68, 68, 0.8);
    color: #fff;
}

/* Processing state */
.v2-gallery-item.processing {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
}

.v2-gallery-item.processing::after {
    content: '';
    width: 28px;
    height: 28px;
    border: 2px solid rgba(220, 38, 38, 0.2);
    border-top-color: #DC2626;
    border-radius: 50%;
    animation: v2-spin 0.8s linear infinite;
}

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

.v2-gallery-item.failed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 12px;
    position: relative;
    min-height: 160px;
}

.v2-fail-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
}

.v2-fail-title {
    color: #ef4444;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
}

.v2-fail-detail {
    color: rgba(239, 68, 68, 0.75);
    font-size: 10px;
    font-family: var(--mono);
    line-height: 1.4;
    word-break: break-word;
    max-width: 100%;
}

.v2-fail-dismiss {
    position: absolute;
    top: 6px;
    right: 6px;
    opacity: 0;
    transition: opacity 0.15s;
}

.v2-gallery-item.failed:hover .v2-fail-dismiss {
    opacity: 1;
}

/* ── Multi-Select: Rubber Band ── */
.v2-rubber-band {
    position: absolute;
    border: 1px solid rgba(220, 38, 38, 0.6);
    background: rgba(220, 38, 38, 0.08);
    border-radius: 4px;
    pointer-events: none;
    z-index: 50;
    backdrop-filter: blur(1px);
}

/* ── Multi-Select: Selected Items ── */
.v2-gallery-item.v2-selected {
    border-color: rgba(220, 38, 38, 0.7) !important;
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.3), 0 0 16px rgba(220, 38, 38, 0.15);
    transform: translateY(-2px);
}

.v2-gallery-item.v2-selected::before {
    content: '';
    position: absolute;
    top: 6px;
    left: 6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 15;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: v2-select-pop 0.15s ease-out;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 12px;
}

@keyframes v2-select-pop {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Multi-Select: Context Menu ── */
.v2-ctx-menu {
    position: fixed;
    z-index: 10000;
    min-width: 200px;
    background: rgba(15, 15, 15, 0.92);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: 12px;
    padding: 6px;
    backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 1px rgba(220, 38, 38, 0.3);
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
    pointer-events: none;
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.v2-ctx-menu.visible {
    opacity: 1;
    transform: scale(1) translateY(0);
    pointer-events: auto;
}

.v2-ctx-header {
    padding: 8px 12px 6px;
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(148, 163, 184, 0.6);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 4px;
}

.v2-ctx-count {
    color: #DC2626;
    font-weight: 700;
}

.v2-ctx-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: rgba(226, 232, 240, 0.9);
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.12s;
    text-align: left;
}

.v2-ctx-option:hover {
    background: rgba(220, 38, 38, 0.12);
    color: #ffffff;
}

.v2-ctx-option svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.v2-ctx-option:hover svg {
    opacity: 1;
}

.v2-ctx-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.v2-ctx-danger:hover svg {
    stroke: #ef4444;
}

/* Prevent text selection while dragging */
.v2-gallery.v2-dragging {
    user-select: none;
    -webkit-user-select: none;
}

/* ── Right Column: Settings ── */
.v2-ws-right {
    position: relative;
    z-index: 2;
    overflow-y: auto;
    padding: 20px;
    border-left: 1px solid rgba(220, 38, 38, 0.08);
}

.v2-ws-panel-right {
    gap: 20px;
}

.v2-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.v2-settings-title {
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.v2-settings-reset {
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(148, 163, 184, 0.5);
    background: none;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.v2-settings-reset:hover {
    color: #DC2626;
    border-color: rgba(220, 38, 38, 0.3);
}

/* ── Setting groups ── */
.v2-setting-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.v2-setting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.v2-setting-value {
    font-family: var(--mono);
    font-size: 10px;
    color: #DC2626;
}

/* ── Dimension buttons (aspect ratio grid) ── */
.v2-dimensions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.v2-dim-btn,
.v2-res-btn,
.v2-fmt-btn,
.v2-dur-btn,
.v2-var-btn {
    padding: 8px 4px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.7);
    background: rgba(15, 15, 15, 0.5);
    border: 1px solid rgba(220, 38, 38, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.v2-dim-btn:hover,
.v2-res-btn:hover,
.v2-fmt-btn:hover,
.v2-dur-btn:hover,
.v2-var-btn:hover {
    border-color: rgba(220, 38, 38, 0.3);
    color: #e2e8f0;
}

.v2-dim-btn.active,
.v2-res-btn.active,
.v2-fmt-btn.active,
.v2-dur-btn.active,
.v2-var-btn.active {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(220, 38, 38, 0.2));
    border-color: rgba(220, 38, 38, 0.5);
    color: #DC2626;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.1);
}

/* ── Resolution & Format buttons ── */
.v2-resolution-btns,
.v2-format-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.v2-format-btns {
    grid-template-columns: repeat(2, 1fr);
}

/* ── Seed input ── */
.v2-input-number {
    font-family: var(--mono);
    font-size: 12px;
    color: #e2e8f0;
    background: rgba(15, 15, 15, 0.5);
    border: 1px solid rgba(220, 38, 38, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
}

.v2-input-number::placeholder {
    color: rgba(148, 163, 184, 0.3);
}

.v2-input-number:focus {
    border-color: rgba(220, 38, 38, 0.4);
}

/* ── Dynamic V2 Params ── */
#v2-dynamic-params {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.v2-param-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.v2-param-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.v2-param-value {
    font-family: var(--mono);
    font-size: 10px;
    color: #DC2626;
}

/* Radio pill grid */
.v2-param-pills {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 6px;
}

.v2-param-pill {
    padding: 8px 4px;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.7);
    background: rgba(15, 15, 15, 0.5);
    border: 1px solid rgba(220, 38, 38, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.v2-param-pill:hover {
    border-color: rgba(220, 38, 38, 0.3);
    color: #e2e8f0;
}

.v2-param-pill.active {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.2), rgba(220, 38, 38, 0.2));
    border-color: rgba(220, 38, 38, 0.5);
    color: #DC2626;
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.1);
}

/* Select dropdown */
.v2-param-select {
    font-family: var(--mono);
    font-size: 12px;
    color: #e2e8f0;
    background: rgba(15, 15, 15, 0.5);
    border: 1px solid rgba(220, 38, 38, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    outline: none;
    width: 100%;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.v2-param-select:focus {
    border-color: rgba(220, 38, 38, 0.4);
}

.v2-param-select option {
    background: #0f172a;
    color: #e2e8f0;
}

/* Range slider */
.v2-param-range-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.v2-param-range {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(220, 38, 38, 0.15);
    border-radius: 2px;
    outline: none;
}

.v2-param-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #DC2626;
    border: 2px solid rgba(15, 15, 15, 0.8);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.3);
}

.v2-param-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #DC2626;
    border: 2px solid rgba(15, 15, 15, 0.8);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.3);
}

.v2-param-range-val {
    font-family: var(--mono);
    font-size: 12px;
    color: rgba(148, 163, 184, 0.7);
    min-width: 40px;
    text-align: right;
}

/* Toggle switch */
.v2-param-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.v2-param-toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    background: rgba(15, 15, 15, 0.6);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-radius: 10px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.v2-param-toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.5);
    transition: all 0.2s;
}

.v2-param-toggle.active .v2-param-toggle-track {
    background: rgba(220, 38, 38, 0.2);
    border-color: rgba(220, 38, 38, 0.5);
}

.v2-param-toggle.active .v2-param-toggle-track::after {
    left: 18px;
    background: #DC2626;
    box-shadow: 0 0 6px rgba(220, 38, 38, 0.4);
}

.v2-param-toggle-label {
    font-family: var(--mono);
    font-size: 11px;
    color: rgba(148, 163, 184, 0.6);
}

.v2-param-toggle.active .v2-param-toggle-label {
    color: #DC2626;
}

/* Text input */
.v2-param-text {
    font-family: var(--mono);
    font-size: 12px;
    color: #e2e8f0;
    background: rgba(15, 15, 15, 0.5);
    border: 1px solid rgba(220, 38, 38, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    outline: none;
    width: 100%;
    transition: border-color 0.2s;
}

.v2-param-text::placeholder {
    color: rgba(148, 163, 184, 0.3);
}

.v2-param-text:focus {
    border-color: rgba(220, 38, 38, 0.4);
}

/* No params message */
.v2-no-params {
    font-family: var(--mono);
    font-size: 11px;
    color: rgba(148, 163, 184, 0.4);
    text-align: center;
    padding: 16px 0;
}

/* ── Credits box ── */
.v2-credits-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.12);
    border-radius: 10px;
    margin-top: 4px;
}

.v2-credits-label {
    font-family: var(--sans);
    font-size: 12px;
    color: rgba(148, 163, 184, 0.6);
}

.v2-credits-amount {
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 700;
    color: #4ade80;
}

/* ── Model info ── */
.v2-model-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(15, 15, 15, 0.4);
    border: 1px solid rgba(220, 38, 38, 0.06);
    border-radius: 8px;
}

.v2-model-info-label {
    font-family: var(--sans);
    font-size: 11px;
    color: rgba(148, 163, 184, 0.4);
}

.v2-model-info-value {
    font-family: var(--mono);
    font-size: 11px;
    color: rgba(148, 163, 184, 0.6);
}

/* ── V2 Workspace scrollbar ── */
.v2-ws-left::-webkit-scrollbar,
.v2-ws-right::-webkit-scrollbar,
.v2-gallery::-webkit-scrollbar {
    width: 4px;
}

.v2-ws-left::-webkit-scrollbar-track,
.v2-ws-right::-webkit-scrollbar-track,
.v2-gallery::-webkit-scrollbar-track {
    background: transparent;
}

.v2-ws-left::-webkit-scrollbar-thumb,
.v2-ws-right::-webkit-scrollbar-thumb,
.v2-gallery::-webkit-scrollbar-thumb {
    background: rgba(220, 38, 38, 0.15);
    border-radius: 4px;
}

/* ── V2 Workspace — Responsive ── */
@media (max-width: 1200px) {
  .v2-ws {
    grid-template-columns: 280px 1fr auto;
  }

  .v2-gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (max-width: 1024px) {
  .v2-ws {
    grid-template-columns: 240px 1fr auto;
  }

  .v2-folders-panel {
    width: 200px;
  }

  .v2-gallery {
    column-width: 140px;
    column-gap: 10px;
    padding: 16px;
  }

  .v2-gallery-header {
    padding: 14px 16px;
  }
}

@media (max-width: 900px) {
    .v2-ws {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        overflow-y: auto;
    }

    .v2-ws-left {
        border-right: none;
        border-bottom: 1px solid rgba(220, 38, 38, 0.08);
    }

    .v2-ws-right {
        border-left: none;
        border-top: 1px solid rgba(220, 38, 38, 0.08);
    }

    .v2-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .v2-gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
        padding: 16px;
    }

    .v2-gallery-header {
        padding: 12px 16px;
    }
}

@media (max-width: 600px) {

    .v2-ws-left,
    .v2-ws-right {
        padding: 14px;
    }

    .v2-dimensions-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .v2-gallery {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        padding: 14px;
    }
}

/* ============================================================
   VIDEO LIGHTBOX — CINEMA MODE
   ============================================================ */

/* Wider, immersive layout when showing a video */
.lightbox-overlay.video-mode .lightbox-content {
    max-width: 96vw;
    width: 96vw;
    background: var(--surface);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
}

/* Header bar with surface background */
.lightbox-overlay.video-mode .lightbox-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
}

/* Larger, clearly readable model badge */
.lightbox-overlay.video-mode .lightbox-model {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text);
}

.lightbox-overlay.video-mode .lightbox-date {
    font-size: 11px;
    color: var(--text-dim);
}

/* Prominent close button */
.lightbox-overlay.video-mode .lightbox-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--surface-3);
    border: 1px solid var(--border);
    color: var(--text-muted);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.lightbox-overlay.video-mode .lightbox-close:hover {
    background: var(--accent-dim);
    border-color: var(--accent);
    color: var(--accent);
}

/* Video body — pure black cinema background */
.lightbox-overlay.video-mode .lightbox-body {
    border-radius: 0;
    background: #000;
    width: 100%;
    max-height: 74vh;
}

/* Video element — full width, tall */
.lightbox-overlay.video-mode .lightbox-media {
    max-width: 100%;
    max-height: 74vh;
    width: 100%;
    height: auto;
}

/* Prompt — single line below video */
.lightbox-overlay.video-mode .lightbox-prompt {
    width: 100%;
    max-width: 100%;
    text-align: left;
    padding: 11px 20px;
    margin-top: 0;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    font-size: 11px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: var(--mono);
}

/* Actions bar — full width toolbar */
.lightbox-overlay.video-mode .lightbox-actions {
    width: 100%;
    margin-top: 0;
    padding: 12px 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* Download — primary red accent button */
.lightbox-overlay.video-mode .btn-download {
    padding: 9px 20px;
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    font-family: var(--mono);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.lightbox-overlay.video-mode .btn-download:hover {
    background: var(--accent-dark, #b91c1c);
    border-color: var(--accent-dark, #b91c1c);
    color: #fff;
}

/* Ghost action buttons (HD, 4K, Extend, Reutilizar, etc.) */
.lightbox-overlay.video-mode .btn-ghost.btn-sm {
    padding: 7px 14px;
    font-size: 10px;
    border-radius: 6px;
    color: var(--text-dim);
    border-color: var(--border-hover);
    background: var(--surface-3);
}

.lightbox-overlay.video-mode .btn-ghost.btn-sm:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-dim);
}

/* Delete button — push to far right */
.lightbox-overlay.video-mode .lightbox-delete {
    margin-left: auto;
}

/* .lightbox-delete:hover is handled by .btn-ghost.btn-sm:hover above */

/* Veo special model actions — subtle highlight */
.lightbox-overlay.video-mode .veo-action {
    background: var(--surface-2);
    border-color: var(--border);
}

/* Cost badge in video header */
.lightbox-overlay.video-mode .lightbox-cost {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 4px;
}

/* Mobile: stack actions */
@media (max-width: 600px) {
    .lightbox-overlay.video-mode .lightbox-content {
        max-width: 100vw;
        width: 100vw;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .lightbox-overlay.video-mode .lightbox-media {
        max-height: 55vw;
    }

    .lightbox-overlay.video-mode .lightbox-body {
        max-height: 55vw;
    }

    .lightbox-overlay.video-mode .lightbox-actions {
        gap: 6px;
        padding: 10px 14px;
    }

    .lightbox-overlay.video-mode .lightbox-delete {
        margin-left: 0;
    }
}
/* ============================================================
   DIALOGUE EDITOR & VOICE PICKER
   ============================================================ */

.v2-dialogue-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: v2-fade-in-slide 0.3s ease-out;
}

@keyframes v2-fade-in-slide {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.v2-dialogue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.v2-dialogue-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
    font-family: var(--sans);
}

.v2-dialogue-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.v2-dialogue-remove:hover {
    opacity: 1;
}

.v2-voice-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.v2-voice-selector:hover {
    border-color: var(--accent);
    background: var(--surface-3);
}

.v2-voice-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-dim);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
}

.v2-voice-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    flex: 1;
}

.voice-picker-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 20px;
}

.voice-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.voice-card:hover {
    border-color: var(--accent);
    background: var(--surface-3);
    transform: translateY(-1px);
}

.voice-card.active {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.voice-card-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    font-weight: 700;
    font-size: 12px;
    border: 1px solid var(--border);
}

.voice-card.active .voice-card-icon {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.voice-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.voice-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.voice-card-desc {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* ============================================================
   IMAGE CROP MODAL
   ============================================================ */

.crop-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: crop-fade-in 0.2s ease;
}

.crop-modal.hidden {
    display: none;
}

@keyframes crop-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.crop-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.crop-panel {
    position: relative;
    z-index: 1;
    width: 90vw;
    max-width: 720px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(220, 38, 38, 0.15);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6), 0 0 60px rgba(220, 38, 38, 0.06);
    animation: crop-panel-in 0.25s ease;
}

@keyframes crop-panel-in {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── Header ── */
.crop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(220, 38, 38, 0.1);
}

.crop-title {
    font-family: var(--sans);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}

.crop-subtitle {
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(148, 163, 184, 0.5);
    margin-top: 2px;
}

.crop-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.crop-rotate-btn,
.crop-close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.15s;
}

.crop-rotate-btn:hover {
    background: rgba(220, 38, 38, 0.15);
    border-color: rgba(220, 38, 38, 0.3);
    color: #DC2626;
}

.crop-close-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ── Body / Canvas ── */
.crop-body {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.crop-canvas-wrap {
    position: relative;
    display: inline-block;
    max-width: 100%;
    max-height: 60vh;
    line-height: 0;
    user-select: none;
    -webkit-user-select: none;
    overflow: visible;
}

.crop-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    border-radius: 6px;
}

/* ── Overlay: darkens outside crop area ── */
.crop-overlay {
    position: absolute;
    /* width/height/left/top/transform set by JS to match canvas rendered size */
    cursor: crosshair;
    overflow: visible; /* handles extend -7px outside; overflow:hidden clips them and breaks pointer events at edges */
}

/* ── Selection box ── */
.crop-selection {
    position: absolute;
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    cursor: move;
    z-index: 2;
    transition: box-shadow 0.15s;
}

.crop-selection:hover {
    border-color: #DC2626;
}

/* ── Rule of thirds grid ── */
.crop-grid-line {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.crop-grid-h1 { left: 0; right: 0; top: 33.33%; height: 1px; }
.crop-grid-h2 { left: 0; right: 0; top: 66.66%; height: 1px; }
.crop-grid-v1 { top: 0; bottom: 0; left: 33.33%; width: 1px; }
.crop-grid-v2 { top: 0; bottom: 0; left: 66.66%; width: 1px; }

/* ── Corner handles ── */
.crop-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    border: 2px solid #DC2626;
    border-radius: 3px;
    z-index: 3;
    transition: transform 0.1s;
}

.crop-handle:hover {
    transform: scale(1.3);
    background: #DC2626;
}

.crop-handle-nw { top: -7px; left: -7px; cursor: nw-resize; }
.crop-handle-ne { top: -7px; right: -7px; cursor: ne-resize; }
.crop-handle-sw { bottom: -7px; left: -7px; cursor: sw-resize; }
.crop-handle-se { bottom: -7px; right: -7px; cursor: se-resize; }

/* ── Footer ── */
.crop-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid rgba(220, 38, 38, 0.1);
    flex-wrap: wrap;
}

.crop-zoom-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 160px;
}

.crop-zoom-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(220, 38, 38, 0.15);
    border-radius: 2px;
    outline: none;
}

.crop-zoom-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #DC2626;
    border: 2px solid rgba(15, 15, 15, 0.8);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.3);
}

.crop-zoom-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #DC2626;
    border: 2px solid rgba(15, 15, 15, 0.8);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.3);
}

.crop-zoom-pct {
    font-family: var(--mono);
    font-size: 10px;
    color: rgba(148, 163, 184, 0.6);
    min-width: 32px;
    text-align: right;
}

.crop-ar-select {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 700;
    color: #DC2626;
    background: rgba(220, 38, 38, 0.08);
    border: 1px solid rgba(220, 38, 38, 0.25);
    border-radius: 6px;
    padding: 5px 28px 5px 10px;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23DC2626' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    white-space: nowrap;
}

.crop-ar-select:hover,
.crop-ar-select:focus {
    border-color: rgba(220, 38, 38, 0.5);
    background-color: rgba(220, 38, 38, 0.12);
}

.crop-ar-select option {
    background: #0a0a0a;
    color: #e2e8f0;
    font-family: var(--mono);
    font-size: 12px;
}

.crop-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.crop-btn-cancel {
    padding: 8px 18px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    color: rgba(148, 163, 184, 0.7);
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.crop-btn-cancel:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

.crop-btn-skip {
    padding: 8px 16px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 600;
    color: rgba(220, 220, 220, 0.85);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}

.crop-btn-skip:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.crop-btn-confirm {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    font-family: var(--sans);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #DC2626, #b91c1c);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.crop-btn-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.35);
}

/* ── Mobile adjustments ── */
/* ── Expired media placeholder ── */
.history-thumb-empty-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 100px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}
.history-thumb-empty-inner.expired {
    flex-direction: column;
    gap: 6px;
    opacity: 0.5;
}
.history-thumb-empty-inner .expired-label {
    font-size: 10px;
    color: var(--text-muted);
    font-family: var(--mono);
}

/* ── Multi-shot card styles ── */
.v2-multishot-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px;
}
.v2-multishot-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.v2-multishot-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}
.v2-multishot-remove {
    background: none;
    border: none;
    color: var(--accent-red, #e74c3c);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
}
.v2-multishot-dur-row {
    display: flex;
    align-items: center;
    gap: 10px;
}
.v2-multishot-dur-label {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}
.v2-multishot-dur-slider {
    flex: 1;
    accent-color: var(--accent-red, #c0392b);
}
.v2-multishot-dur-val {
    font-size: 13px;
    color: var(--text-primary);
    min-width: 24px;
    text-align: center;
}

/* ── Dialogue card styles ── */
.v2-dialogue-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 14px;
}
.v2-dialogue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.v2-dialogue-label {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-primary);
}
.v2-dialogue-remove {
    background: none;
    border: none;
    color: var(--accent-red, #e74c3c);
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
}

/* ── Textarea within dialogue card ── */
.v2-dialogue-card .v2-textarea {
    min-height: 50px;
    font-size: 13px;
}
.v2-multishot-card .v2-textarea {
    min-height: 70px;
    margin-bottom: 8px;
    font-size: 13px;
}

@media (max-width: 640px) {
    .crop-panel {
        width: 96vw;
        max-height: 95vh;
        border-radius: 12px;
    }

    .crop-body {
        padding: 8px;
    }

    .crop-canvas-wrap canvas {
        max-height: 50vh;
    }

    .crop-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .crop-actions {
        justify-content: flex-end;
    }
}

/* ===== Folders sidebar ===== */
.v2-folders-panel {
    position: relative;
    z-index: 2;
    width: 0;
    overflow: hidden;
    box-sizing: border-box;
    padding: 0;
    border-left: 1px solid transparent;
    background: rgba(10, 10, 10, 0.97);
    transition: width 0.2s ease, padding 0.2s ease;
}

.v2-folders-panel.v2-folders-open {
    width: 220px;
    padding: 12px 10px;
    overflow-y: auto;
    border-left-color: rgba(220, 38, 38, 0.08);
}
.v2-folders-toggle {
    background: transparent; color: inherit; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 4px; width: 28px; height: 28px; cursor: pointer; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
}
.v2-folders-toggle:hover {
    border-color: var(--accent, #DC2626);
    background: rgba(220, 38, 38, 0.08);
}
.v2-folders-toggle.v2-folders-open {
    border-color: var(--accent, #DC2626);
    background: rgba(220, 38, 38, 0.12);
}
.v2-folders-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 4px 6px 10px; font-size: 12px; text-transform: uppercase;
    letter-spacing: 0.05em; opacity: 0.7;
}
.v2-folders-new {
    background: transparent; color: inherit; border: 1px solid currentColor;
    border-radius: 4px; width: 22px; height: 22px; cursor: pointer; line-height: 1;
}
.v2-folder-tree { list-style: none; margin: 0; padding: 0; }
.v2-folder-node {
    padding: 6px 8px; border-radius: 4px; cursor: pointer;
    display: flex; align-items: center; gap: 6px; font-size: 13px;
    user-select: none;
}
.v2-folder-node:hover { background: rgba(255,255,255,0.04); }
.v2-folder-active { background: rgba(255,255,255,0.08); font-weight: 600; }
.v2-folder-node.v2-drop-target { outline: 2px dashed var(--accent, #4a9eff); }
.v2-folder-children { list-style: none; margin: 0; padding-left: 16px; }
.v2-folder-twisty { width: 12px; opacity: 0.5; }
.v2-folder-cover { width: 18px; height: 18px; border-radius: 3px; object-fit: cover; }
.v2-folder-menu-btn {
    margin-left: auto; opacity: 0; background: none; border: none;
    color: inherit; cursor: pointer; font-size: 14px;
}
.v2-folder-node:hover .v2-folder-menu-btn { opacity: 1; }
.v2-folder-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    color: inherit;
    border: 1px solid rgba(220, 38, 38, 0.4);
    border-radius: 4px;
    padding: 4px 6px;
    font: inherit;
    font-size: 13px;
    outline: none;
    min-width: 0;
}
.v2-folder-input:focus { border-color: var(--accent, #DC2626); }
.v2-folder-creating { padding: 4px 6px; }

/* Bulk toolbar and drag-and-drop styles */
.v2-bulk-toolbar { display: inline-flex; gap: 8px; margin-left: 12px; align-items: center; }
.v2-bulk-toolbar[hidden] { display: none; }
.v2-bulk-toolbar button {
    background: var(--accent, #4a9eff); color: #000; border: 0; padding: 4px 10px;
    border-radius: 4px; cursor: pointer; font-size: 12px;
}
.v2-gallery-item[draggable="true"] { cursor: grab; }
.v2-gallery-item.v2-dragging { opacity: 0.4; }

/* ===== Share Modal ===== */
.share-modal { position: fixed; inset: 0; z-index: 1000; }
.share-modal.hidden { display: none; }
.share-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.share-modal-panel {
    position: relative; max-width: 480px; margin: 10vh auto;
    background: var(--bg, #1a1a1a); padding: 20px; border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}
.share-modal-panel h3 { margin: 0 0 12px; font-size: 18px; color: var(--text); }
.share-modal-target { margin: 8px 0; font-size: 13px; color: var(--text-dim); }
.share-modal-row { display: flex; gap: 8px; margin: 12px 0; }
.share-modal-row input { flex: 1; padding: 6px 8px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 4px; font-family: var(--mono); font-size: 12px; }
.share-modal-row button { padding: 6px 12px; background: var(--accent); color: #000; border: 0; border-radius: 4px; cursor: pointer; font-weight: 500; }
.share-modal-existing { margin: 12px 0; font-size: 12px; color: var(--text-muted); }
.share-modal-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }
.share-modal-actions button { padding: 6px 12px; border: 1px solid var(--border); background: transparent; color: var(--text); border-radius: 4px; cursor: pointer; }
.share-modal-actions button[id="share-modal-revoke"] { border-color: var(--accent); color: var(--accent); }
.share-modal-actions button:not([id="share-modal-revoke"]):hover { background: var(--surface-2); }
