/* ============================================
   TACTICAL COMMAND CENTER DESIGN SYSTEM
   High-tech factory for AI creative generation
   ============================================ */

/* CSS Variables - Military/Tactical Theme */
:root {
    /* Primary Colors */
    --bg-primary: #0a0c0f;
    --bg-secondary: #0d1117;
    --bg-tertiary: #151b23;
    --bg-elevated: #1c2128;

    /* Accent Colors */
    --accent-cyan: #00d4ff;
    --accent-cyan-dim: rgba(0, 212, 255, 0.15);
    --accent-green: #00ff88;
    --accent-green-dim: rgba(0, 255, 136, 0.1);
    --accent-amber: #ffaa00;
    --accent-amber-dim: rgba(255, 170, 0, 0.1);
    --accent-red: #ff3366;
    --accent-red-dim: rgba(255, 51, 102, 0.1);

    /* Text Colors */
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #484f58;
    --text-accent: #00d4ff;

    /* Border Colors */
    --border-primary: #21262d;
    --border-secondary: #30363d;
    --border-accent: rgba(0, 212, 255, 0.3);

    /* Typography */
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Consolas', monospace;
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-mono);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    /* Subtle scan line effect */
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.01) 1px, transparent 1px);
    background-size: 100% 4px, 4px 100%;
}

/* Ensure all form elements use mono font */
input, select, textarea, button {
    font-family: var(--font-mono);
}

/* Global tactical styling */
::selection {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

/* Topbar - Command Header */
.topbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-bottom: 1px solid var(--border-primary);
    position: relative;
}
.topbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.3;
}
.brand {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-cyan);
}
.topbar-actions { display: flex; gap: 12px; align-items: center; }
.auth-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.auth-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}
.credits-pill {
    background: var(--accent-cyan-dim);
    border: 1px solid var(--border-accent);
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 10px;
}
#credits-value {
    font-weight: 700;
}

.buy-credits-btn {
    background: var(--accent-green);
    border: none;
    color: var(--bg-primary);
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.buy-credits-btn:hover {
    background: #00cc6a;
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.4);
}

.save-defaults-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
}
.save-defaults-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.container {
    display: flex;
    height: calc(100vh - 49px);
}

/* Sidebar - Control Panel */
.sidebar {
    width: 340px;
    height: 100%;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}
.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-cyan) 0%, transparent 50%, var(--accent-cyan) 100%);
    opacity: 0.2;
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    padding-bottom: 16px;
}

.sidebar label {
    display: block;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sidebar input[type="text"],
.sidebar textarea,
.sidebar select {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.2s;
}

.sidebar input[type="text"]:focus,
.sidebar textarea:focus,
.sidebar select:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px var(--accent-cyan-dim);
}

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

/* Product Section */
.product-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}

.product-row { display:flex; gap:8px; align-items:center; }
.product-row select { flex:1; }
.product-actions { display:flex; gap:6px; }

/* Tactical Buttons */
.small-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.small-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}
.small-btn.danger {
    border-color: var(--accent-red);
    color: var(--accent-red);
}
.small-btn.danger:hover {
    background: var(--accent-red-dim);
}

.product-section input {
    margin-bottom: 10px;
}

.product-section textarea {
    min-height: 80px;
}

/* Ad Reference Section */
.ad-reference {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}

.image-ref-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}
.image-ref-header { display: flex; justify-content: space-between; align-items: center; }
.image-ref-content { margin-top: 12px; }
.image-ref-controls { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.image-ref-preview {
    position: relative;
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    overflow: hidden;
}
.image-ref-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Image Reference Loading Overlay */
.image-ref-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 14, 20, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 10;
}

.image-ref-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-secondary);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.image-ref-loading-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

/* Talking Avatar Section */
.talking-avatar-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}

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

.talking-avatar-content {
    margin-top: 12px;
}

.avatar-voice-section {
    margin-bottom: 16px;
}

.avatar-label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.voice-type-toggle {
    display: flex;
    gap: 16px;
    margin-bottom: 10px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

.radio-option input[type="radio"] {
    appearance: none;
    width: 14px;
    height: 14px;
    border: 1px solid var(--border-secondary);
    border-radius: 50%;
    background: var(--bg-tertiary);
    cursor: pointer;
    position: relative;
}

.radio-option input[type="radio"]:checked {
    border-color: var(--accent-cyan);
}

.radio-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 6px;
    height: 6px;
    background: var(--accent-cyan);
    border-radius: 50%;
}

.avatar-select {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
}

.avatar-select:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

#custom-voice-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#create-voice-btn {
    align-self: flex-start;
}

/* Voice Settings Sliders */
.avatar-voice-settings {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.voice-slider-group {
    flex: 1;
}

.voice-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.voice-slider-header label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.slider-value {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-cyan);
    background: rgba(0, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.voice-slider {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--bg-secondary);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.voice-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent-cyan);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s;
}

.voice-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.voice-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent-cyan);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 10px;
    color: var(--text-muted);
}

.avatar-dialog-section {
    margin-bottom: 16px;
}

.avatar-dialog-input {
    width: 100%;
    min-height: 100px;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    resize: vertical;
    line-height: 1.4;
}

.avatar-dialog-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.avatar-dialog-input::placeholder {
    color: var(--text-muted);
}

.dialog-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

#dialog-char-count {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

.dialog-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.tag-btn {
    padding: 4px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    border-radius: 3px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 9px;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.avatar-preview-section {
    margin-top: 12px;
}

.preview-btn {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.preview-btn:hover:not(:disabled) {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

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

.preview-cost {
    font-size: 10px;
    color: var(--text-muted);
}

#audio-preview-container {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
}

#avatar-audio-preview {
    width: 100%;
    height: 36px;
    margin-bottom: 8px;
}

.audio-preview-info {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

/* Create Voice Modal */
.voice-modal {
    max-width: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    max-height: 90vh;
    overflow-y: auto;
}

.voice-form-section {
    margin-bottom: 20px;
    padding: 0 20px;
}

.voice-form-section:first-child {
    padding-top: 20px;
}

.voice-form-section label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.voice-name-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
}

.voice-name-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.voice-upload-area {
    padding: 24px;
    background: var(--bg-tertiary);
    border: 2px dashed var(--border-secondary);
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-upload-area:hover {
    border-color: var(--accent-cyan);
}

.voice-upload-area.has-file {
    border-style: solid;
    border-color: var(--accent-green);
}

.voice-upload-placeholder {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
}

.voice-upload-placeholder .upload-hint {
    font-size: 10px;
    color: var(--text-muted);
}

.voice-trim-section {
    margin-top: 16px;
    display: none;
}

.voice-trim-section.active {
    display: block;
}

.voice-audio-player {
    width: 100%;
    margin-bottom: 12px;
}

.trim-slider-container {
    margin-bottom: 12px;
}

.trim-slider-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.trim-range-container {
    position: relative;
    height: 24px;
    background: var(--bg-elevated);
    border-radius: 4px;
}

.trim-range-container input[type="range"] {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
}

.trim-range-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 24px;
    background: var(--accent-cyan);
    cursor: ew-resize;
    pointer-events: auto;
    border: none;
    border-radius: 2px;
}

.trim-range-container input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 24px;
    background: var(--accent-cyan);
    cursor: ew-resize;
    pointer-events: auto;
    border: none;
    border-radius: 2px;
}

.trim-range-fill {
    position: absolute;
    height: 100%;
    background: var(--accent-cyan-dim);
    pointer-events: none;
}

.trim-info {
    text-align: center;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

.trim-info.valid {
    color: var(--accent-green);
}

.trim-info.invalid {
    color: var(--accent-red);
}

.voice-form-actions {
    padding: 16px 20px;
    border-top: 1px solid var(--border-secondary);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.voice-cancel-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-cancel-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.voice-save-btn {
    padding: 10px 20px;
    background: var(--accent-cyan-dim);
    border: 1px solid var(--accent-cyan);
    border-radius: 4px;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.voice-save-btn:hover:not(:disabled) {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

.voice-save-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle switch - Tactical */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    transition: 0.3s;
    border-radius: 4px;
}
.toggle-slider::before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background: var(--text-muted);
    transition: 0.3s;
    border-radius: 2px;
}
.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-cyan-dim);
    border-color: var(--accent-cyan);
}
.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
}

/* Navigation arrows for image history */
.image-ref-nav {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.7);
    padding: 6px 12px;
    border-radius: 20px;
}
.image-ref-nav .nav-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.image-ref-nav .nav-btn:hover { opacity: 1; }
.image-ref-nav .nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
#image-ref-counter {
    color: #aaa;
    font-size: 12px;
    min-width: 32px;
    text-align: center;
}

.image-edit-panel {
    margin-top: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    padding: 12px;
}
.prompt-wrap { position: relative; }
.image-edit-panel textarea {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 10px;
    padding-right: 50px;
    font-size: 13px;
    min-height: 60px;
    resize: vertical;
    transition: all 0.2s;
}
.image-edit-panel textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
}
.send-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: var(--accent-cyan);
    border: none;
    color: var(--bg-primary);
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
}
.send-btn:hover {
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.5);
}
.send-btn:disabled {
    background: var(--bg-elevated);
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
}

/* Attachments area */
.prompt-attachments-area {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.prompt-attachments-area:empty { display: none; }
.prompt-attachment {
    position: relative;
    width: 56px;
    height: 56px;
}
.prompt-attachment img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-secondary);
}
.prompt-attachment .remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    background: var(--accent-red);
    color: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.prompt-attachment .remove-btn:hover {
    box-shadow: 0 0 8px var(--accent-red);
}

.attach-controls {
    margin-top: 10px;
}
.attach-controls .small-btn {
    font-size: 11px;
    padding: 6px 10px;
}

/* Loader for gallery cell while editing */
.thumb-loading { width:64px; height:64px; border:2px solid #333; border-radius:6px; display:flex; align-items:center; justify-content:center; }
.spinner-xs { width:16px; height:16px; border:2px solid #666; border-top-color:#aaa; border-radius:50%; animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg);} to { transform: rotate(360deg);} }

.upload-area {
    border: 1px dashed var(--border-secondary);
    border-radius: 4px;
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-tertiary);
    margin-top: 8px;
}

.upload-area:hover {
    border-color: var(--accent-cyan);
    background: var(--accent-cyan-dim);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.upload-placeholder svg {
    width: 24px;
    height: 24px;
    color: var(--accent-cyan);
    opacity: 0.7;
}

.upload-placeholder span {
    font-size: 14px;
}

/* Video Download Helper Tooltip */
.upload-area {
    position: relative;
}

.video-download-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    border: 1px solid var(--border-accent);
    border-radius: 6px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.video-download-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--border-accent);
}

.upload-area:hover .video-download-tooltip {
    opacity: 1;
    visibility: visible;
}

.video-download-tooltip .tooltip-header {
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.video-download-tooltip a {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-cyan);
    text-decoration: none;
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-download-tooltip a::before {
    content: '>';
    color: var(--text-muted);
}

.video-download-tooltip a:hover {
    background: var(--accent-cyan-dim);
    color: #fff;
}

.uploaded-video {
    position: relative;
    margin-top: 8px;
    border-radius: 8px;
    overflow: hidden;
}

.uploaded-video video {
    width: 100%;
    height: auto;
    display: block;
}

.remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

/* Notes Section */
.notes-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}

.notes-section textarea {
    min-height: 80px;
}

/* Negative Prompt - Collapsible */
.negative-section {
    margin-bottom: 20px;
}
.negative-section.collapsible {
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    background: var(--bg-tertiary);
}
.negative-section.collapsible summary {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-muted);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.negative-section.collapsible summary::before {
    content: '▸';
    font-size: 12px;
    transition: transform 0.2s;
    color: var(--accent-cyan);
}
.negative-section.collapsible[open] summary::before {
    transform: rotate(90deg);
}
.negative-section.collapsible summary::-webkit-details-marker {
    display: none;
}
.negative-section.collapsible textarea {
    border: none;
    border-top: 1px solid var(--border-secondary);
    border-radius: 0 0 4px 4px;
    min-height: 80px;
    background: var(--bg-secondary);
}

/* Model warning - Tactical Alert */
.model-warning {
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--accent-amber-dim);
    border: 1px solid rgba(255, 170, 0, 0.3);
    border-radius: 4px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--accent-amber);
    line-height: 1.4;
}

/* Sidebar Footer - Fixed Create Button */
.sidebar-footer {
    flex-shrink: 0;
    background: linear-gradient(180deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    padding: 16px;
    border-top: 1px solid var(--border-secondary);
    min-height: 72px;
    position: relative;
}
.sidebar-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.3;
}

/* Create Button - Primary Action */
.create-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--accent-cyan) 0%, #0099cc 100%);
    border: none;
    color: var(--bg-primary);
    padding: 14px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-family: var(--font-mono);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.create-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}
.create-btn:hover:not(:disabled)::before {
    left: 100%;
}

.create-btn:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    transform: translateY(-1px);
}

.create-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

/* Settings Section */
.settings-section {
    border-top: 1px solid var(--border-primary);
    padding-top: 16px;
    padding-bottom: 16px;
    margin-bottom: 0;
}

.settings-section h4 {
    color: var(--text-secondary);
    font-size: 11px;
    font-family: var(--font-mono);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.setting-group {
    margin-bottom: 12px;
}

.setting-group label {
    font-size: 10px;
    margin-bottom: 4px;
}

.setting-group select {
    padding: 8px 10px;
    font-size: 12px;
    font-family: var(--font-mono);
}

/* Main Content - Command Center Display */
.main-content {
    flex: 1;
    height: 100%;
    background: var(--bg-primary);
    padding: 20px 24px;
    overflow-y: auto;
    position: relative;
}
/* Grid overlay effect */
.main-content::before {
    content: '';
    position: fixed;
    top: 0;
    left: 340px;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(0, 212, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 212, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
    z-index: 0;
}

/* Tabs - Module Selector */
.tabs-header {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
    position: relative;
    z-index: 1;
    padding: 4px;
    background: var(--bg-secondary);
    border-radius: 4px;
    border: 1px solid var(--border-primary);
}
.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-family: var(--font-mono);
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.tab-btn:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}
.tab-btn.active {
    background: var(--accent-cyan-dim);
    color: var(--accent-cyan);
    border-color: var(--accent-cyan);
}

.videos-header {
    margin-bottom: 20px;
}

.videos-header h2 {
    font-size: 16px;
    font-family: var(--font-mono);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* Asset Grid */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    justify-items: center;
    position: relative;
    z-index: 1;
}

/* Asset Card - Tactical Frame */
.video-card {
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-secondary);
    width: 100%;
    max-width: 260px;
    position: relative;
    transition: all 0.2s;
}
.video-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}
.video-card:hover::before {
    opacity: 1;
}
.video-card:hover {
    border-color: var(--border-accent);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

.video-card video {
    width: 100%;
    height: 380px;
    object-fit: contain;
    background: var(--bg-primary);
}

.video-card-actions {
    padding: 12px;
    display: flex;
    gap: 8px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-primary);
}

/* Action Buttons - Tactical Style */
.remix-btn {
    flex: 1;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-family: var(--font-mono);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.delete-btn {
    background: var(--accent-red-dim);
    border: 1px solid rgba(255, 51, 102, 0.3);
    color: var(--accent-red);
    padding: 8px 12px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}
.delete-btn:hover {
    background: rgba(255, 51, 102, 0.2);
    border-color: var(--accent-red);
}

.delete-btn.icon-btn {
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading State - Processing Indicator */
.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
}

.loading-card {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
}
.loading-card .loading-state {
    height: auto;
    width: 100%;
}
.loading-card .loading-content {
    max-width: 440px;
    margin: 0 auto;
    text-align: center;
    padding: 24px;
}
.loading-card .loading-content h3 {
    margin-bottom: 16px;
    font-family: var(--font-mono);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-cyan);
}
.loading-card .loading-steps {
    text-align: left;
    margin-top: 12px;
}
.loading-card .step {
    padding: 10px 0;
}

.loading-content {
    text-align: center;
    max-width: 500px;
}

/* Tactical Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-secondary);
    border-top: 2px solid var(--accent-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h3 {
    margin-bottom: 24px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.loading-steps {
    text-align: left;
    margin-bottom: 24px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    padding: 12px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    border-bottom: 1px solid var(--border-primary);
}
.step:last-child {
    border-bottom: none;
}

.step.active {
    color: var(--accent-cyan);
}

.step.completed {
    color: var(--accent-green);
}

.step-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.step.completed .step-icon::before {
    content: "✓";
}

.step-text {
    font-size: 14px;
}

/* Debug Panel */
/* Debug panel hidden */
.debug-panel { display: none; }

.debug-panel h4 {
    margin-bottom: 12px;
    color: #ccc;
    font-size: 14px;
}

.debug-panel > div {
    margin-bottom: 8px;
    font-size: 12px;
    color: #999;
}

.debug-panel span {
    color: #fff;
    word-break: break-all;
}

/* Empty State - Standby Mode */
.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    position: relative;
    z-index: 1;
}

.empty-content {
    text-align: center;
    color: var(--text-muted);
    padding: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
}

.empty-content h3 {
    margin-bottom: 12px;
    font-size: 14px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.empty-content p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 300px;
}

.empty-content p.empty-description {
    max-width: 400px;
    margin: 8px auto;
    line-height: 1.6;
}

.empty-steps {
    text-align: left;
    margin: 16px auto;
    padding-left: 24px;
    max-width: 360px;
}

.empty-steps li {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.5;
}

.empty-steps li::marker {
    color: var(--accent-cyan);
}

/* Modal - Command Dialog */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 4px;
    padding: 24px;
    width: 420px;
    max-width: 90vw;
    position: relative;
    z-index: 1001;
    border: 1px solid var(--border-secondary);
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.1);
}
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
}

.modal-content h3 {
    margin-bottom: 16px;
    font-size: 14px;
    font-family: var(--font-mono);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-cyan);
}

.modal-content textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 12px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 20px;
    transition: all 0.2s;
}
.modal-content textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px var(--accent-cyan-dim);
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-actions button {
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 12px;
    font-family: var(--font-mono);
    cursor: pointer;
    border: 1px solid var(--border-secondary);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-actions button:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.modal-actions button.primary {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, #0099cc 100%);
    border: none;
    color: var(--bg-primary);
    font-weight: 600;
}

.modal-actions button.primary:hover {
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

/* Import URL Button */
.import-url-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.2s;
}

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

.import-url-btn svg {
    flex-shrink: 0;
}

/* Import URL Modal */
.import-url-input {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-primary);
    padding: 12px;
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.import-url-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 2px var(--accent-cyan-dim);
}

.import-url-input::placeholder {
    color: var(--text-muted);
}

.import-url-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    margin-bottom: 16px;
}

.import-url-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    background: var(--bg-primary);
}

.import-url-preview img[style*="display: none"] + .import-url-info::before,
.import-url-preview img:not([src]),
.import-url-preview img[src=""] {
    display: none;
}

.import-url-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.import-url-title {
    font-size: 13px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.import-url-error {
    color: var(--accent-red);
    font-size: 12px;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: rgba(255, 85, 85, 0.1);
    border: 1px solid rgba(255, 85, 85, 0.3);
    border-radius: 4px;
}

/* Credit Packages - Resource Allocation */
.credit-packages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.credit-package {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.credit-package:hover {
    border-color: var(--accent-cyan);
    background: var(--accent-cyan-dim);
}

.credit-package:hover {
    border-color: #4f46e5;
    background: #222;
}

.credit-package-info h4 {
    font-size: 16px;
    margin-bottom: 4px;
    color: #fff;
}

.credit-package-info p {
    font-size: 13px;
    color: #999;
}

.credit-package-price {
    font-size: 20px;
    font-weight: 700;
    color: #4f46e5;
}

.credit-package.loading {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Carousel Creator Styles */
.carousel-container {
    max-width: 1200px;
    margin: 0 auto;
}

.carousel-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}

.carousel-header h2 {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.carousel-header p {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.carousel-editor {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.carousel-section {
    margin-bottom: 24px;
}

.carousel-section:last-child {
    margin-bottom: 0;
}

.carousel-section h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: #ccc;
}

.carousel-meta-prompt {
    width: 100%;
    background-color: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 6px;
    color: #fff;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
}

.carousel-meta-prompt:focus {
    outline: none;
    border-color: #666;
}

.carousel-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.carousel-slot {
    background: #2a2a2a;
    border: 2px dashed #404040;
    border-radius: 8px;
    padding: 12px;
    position: relative;
    transition: all 0.2s;
}

.carousel-slot:hover {
    border-color: #666;
}

.carousel-slot.has-image {
    border-style: solid;
    border-color: #4ade80;
}

.carousel-slot-number {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.carousel-slot-image {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 8px;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
}

.carousel-slot-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.carousel-slot-upload {
    width: 100%;
    padding: 8px;
    background: #333;
    border: 1px solid #555;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.carousel-slot-upload:hover {
    background: #404040;
    border-color: #4ade80;
    transform: translateY(-1px);
}

/* Images row - side by side reference and output */
.carousel-slot-images-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.carousel-slot-reference,
.carousel-slot-output {
    flex: 1;
    position: relative;
}

.carousel-slot-image-label {
    font-size: 10px;
    color: #888;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.carousel-slot-output .carousel-slot-image-label {
    color: #4ade80;
}

.carousel-slot-image,
.carousel-slot-generated {
    aspect-ratio: 9/16;
    border-radius: 6px;
    overflow: hidden;
    background: #1a1a1a;
    border: 1px dashed #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slot-image img,
.carousel-slot-generated img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-slot-generated.has-image {
    border: 1px solid #4ade80;
}

.no-image {
    color: #555;
    font-size: 10px;
    text-align: center;
    padding: 8px;
}

.carousel-slot-upload-mini,
.carousel-slot-clear-mini {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: all 0.2s ease;
}

.carousel-slot-upload-mini {
    background: #333;
    color: #fff;
}

.carousel-slot-clear-mini {
    background: rgba(239, 68, 68, 0.8);
    color: #fff;
}

.carousel-slot-upload-mini:hover,
.carousel-slot-clear-mini:hover {
    opacity: 1;
    transform: scale(1.1);
}

.carousel-slot.has-generated {
    border-color: #4ade80;
}

.carousel-slot-generate-btn {
    flex: 1;
    padding: 8px 12px;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    color: #000;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    transition: all 0.2s;
}

.carousel-slot-generate-btn:hover {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.carousel-slot-prompt-panel {
    margin-top: 8px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px;
}

.carousel-prompt-wrap {
    position: relative;
}

.carousel-slot-prompt {
    width: 100%;
    background-color: #2a2a2a;
    border: 1px solid #404040;
    border-radius: 4px;
    color: #fff;
    padding: 8px;
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.carousel-slot-prompt:focus {
    outline: none;
    border-color: #666;
}

.carousel-slot-dependencies {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #2a2a2a;
}

.carousel-dependency-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.carousel-dependency-tag {
    padding: 4px 8px;
    background: #2a2a2a;
    border: 1px solid #404040;
    color: #999;
    border-radius: 4px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-dependency-tag:hover {
    background: #333;
    border-color: #666;
    color: #fff;
}

.carousel-dependency-tag.active {
    background: #4ade80;
    border-color: #4ade80;
    color: #000;
    font-weight: 600;
}

.carousel-slot-prompt-controls {
    margin-top: 6px;
    display: flex;
    gap: 6px;
}

.carousel-slot-attach-btn {
    padding: 6px 10px;
    background: #2a2a2a;
    border: 1px solid #3d3d3d;
    color: #fff;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-slot-attach-btn:hover {
    background: #333;
    border-color: #4ade80;
}

.carousel-slot-attachments {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #2a2a2a;
    overflow-x: auto;
}

.carousel-slot-attachment {
    position: relative;
    flex-shrink: 0;
}

.carousel-slot-attachment img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #333;
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-slot-attachment img:hover {
    border-color: #4ade80;
    transform: scale(1.05);
}

.carousel-slot-attachment-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff4444;
    color: white;
    border: 2px solid #1a1a1a;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
}

.carousel-slot-attachment-remove:hover {
    background: #ff0000;
}

.carousel-slot-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #ff4444;
    color: white;
    border: none;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slot-remove:hover {
    background: #ff0000;
}

.carousel-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.carousel-add-slot {
    padding: 10px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.carousel-add-slot:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}

.carousel-generate {
    padding: 12px 24px;
    background: rgba(0, 212, 255, 0.15);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex: 1;
    max-width: 300px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.carousel-generate:hover {
    background: rgba(0, 212, 255, 0.25);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.carousel-generate:hover:not(:disabled) {
    background: #0052a3;
}

.carousel-generate:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.carousel-results {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 24px;
}

.carousel-results h3 {
    font-size: 18px;
    margin-bottom: 16px;
}

.carousel-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.carousel-result-item {
    position: relative;
    cursor: pointer;
}

.carousel-result-item:hover .carousel-result-overlay {
    opacity: 1;
}

.carousel-result-item img {
    width: 100%;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #333;
    transition: opacity 0.2s;
}

.carousel-result-number {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 2;
}

.carousel-result-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.7) 70%, transparent 100%);
    padding: 12px 8px 8px;
    border-radius: 0 0 8px 8px;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 1;
}

.carousel-result-btn {
    width: 100%;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-result-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.carousel-result-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
}

.carousel-download-all {
    padding: 10px 20px;
    background: #4ade80;
    border: 1px solid #4ade80;
    color: #000;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.carousel-download-all:hover {
    background: #22c55e;
}

.carousel-loading {
    text-align: center;
    padding: 40px;
}

.carousel-loading .spinner {
    margin: 0 auto 20px;
}

.carousel-loading h3 {
    margin-bottom: 12px;
}

.carousel-loading p {
    color: #999;
    font-size: 14px;
}

/* Template Browser Styles - Tactical Theme */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.template-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    padding: 0;
    transition: all 0.2s;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}

.template-card:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
    transform: translateY(-2px);
}

.template-card-preview {
    background: var(--bg-primary) !important;
}

.template-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-primary);
}

.template-card-name {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    margin-right: 8px;
}

.template-slots-badge {
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
}

.template-card-meta {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-primary);
}

.template-meta-prompt {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.5;
    margin: 0;
}

.template-card-actions {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-secondary);
}

.template-btn {
    padding: 6px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    font-size: 10px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.template-btn:hover {
    background: var(--bg-elevated);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.template-btn-primary {
    background: rgba(0, 212, 255, 0.15);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    flex: 1;
}

.template-btn-primary:hover {
    background: rgba(0, 212, 255, 0.25);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.template-btn-secondary {
    background: var(--accent-green-dim);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.template-btn-secondary:hover {
    background: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.3);
}

.template-btn-danger {
    background: var(--accent-red-dim);
    border-color: rgba(255, 51, 102, 0.4);
    color: var(--accent-red);
}

.template-btn-danger:hover {
    background: rgba(255, 51, 102, 0.2);
    box-shadow: 0 0 12px rgba(255, 51, 102, 0.3);
}

.empty-templates {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.empty-templates p:first-child {
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Variation Cards - Tactical Theme */
.variation-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    padding: 0;
    transition: all 0.2s;
    overflow: hidden;
}

.variation-card:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
}

.variation-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-primary);
}

.variation-card-header h4 {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.variation-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    min-height: 120px;
    background: var(--bg-primary);
    padding: 8px;
    border-bottom: 1px solid var(--border-primary);
}

.variation-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
    aspect-ratio: 9 / 16;
    border: 1px solid var(--border-primary);
}

.variation-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-secondary);
    border-radius: 2px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    text-transform: uppercase;
}

/* ========================================
   SIMPLIFIED CAROUSEL CREATOR
   ======================================== */

/* === TEMPLATE CREATION MODE === */
/* Template Creator - Tactical Theme */
.simple-creator {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.simple-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-primary);
}

.simple-header h2 {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 18px;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.simple-btn-secondary {
    padding: 10px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    transition: all 0.2s;
}

.simple-btn-secondary:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Back button used in carousel creator */
.gen-back-btn {
    padding: 8px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.gen-back-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.simple-section {
    margin-bottom: 32px;
}

.simple-section label {
    display: block;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.simple-hint {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 11px;
    margin: 0 0 16px 0;
}

.simple-images-grid {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.simple-image-slot {
    position: relative;
}

.simple-slot-preview {
    width: 160px;
    aspect-ratio: 9/16;
    background: var(--bg-tertiary);
    border: 1px dashed var(--border-secondary);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    overflow: hidden;
    position: relative;
}

.simple-slot-preview:hover {
    border-color: var(--accent-cyan);
    background: var(--accent-cyan-dim);
}

.simple-slot-preview.has-image {
    border-style: solid;
    border-color: var(--accent-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.15);
}

.simple-slot-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.simple-slot-placeholder {
    font-size: 28px;
    color: var(--text-muted);
}

.simple-slot-number {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    width: 24px;
    height: 24px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
}

.simple-slot-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: var(--accent-red);
    color: #fff;
    border: 2px solid var(--bg-primary);
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.simple-slot-change {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.simple-slot-change:hover {
    background: var(--accent-cyan);
    color: var(--bg-primary);
}

.simple-slot-controls {
    width: 100%;
    margin-top: 10px;
}

.simple-attachments-list {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.simple-attachment-thumb {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border-secondary);
}

.simple-attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.simple-attachment-thumb button {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: var(--accent-red);
    color: white;
    border: none;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.simple-slot-prompt {
    display: flex;
    gap: 6px;
}

.simple-slot-attach {
    padding: 8px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-muted);
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
}

.simple-slot-attach:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.simple-slot-prompt input {
    flex: 1;
    padding: 8px 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 3px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 10px;
    min-width: 0;
}

.simple-slot-prompt input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.simple-slot-gen {
    padding: 8px 14px;
    background: var(--accent-cyan-dim);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    transition: all 0.2s;
}

.simple-slot-gen:hover {
    background: rgba(0, 212, 255, 0.25);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

.simple-slot-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-family: var(--font-mono);
    color: var(--accent-cyan);
    font-size: 11px;
    text-transform: uppercase;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Live Variation Generation UI */
.generating-variation {
    background: #1a1a1a;
    position: relative;
}

.generating-variation .template-header {
    background: linear-gradient(135deg, #4CAF50 0%, #2196F3 100%);
    padding: 12px;
    border-radius: 8px 8px 0 0;
}

.generating-variation .template-header h3 {
    margin: 0;
    font-size: 16px;
    color: white;
}

.variation-outfit-name {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
    display: block;
    margin-top: 4px;
}

.slot-preview {
    min-height: 100px;
    background: #0d0d0d;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    padding: 8px;
}

.slot-status {
    font-size: 14px;
    color: #888;
    text-align: center;
}

.simple-add-image {
    width: 160px;
    aspect-ratio: 9/16;
    background: transparent;
    border: 1px dashed var(--border-secondary);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-muted);
}

.simple-add-image:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
    background: var(--accent-cyan-dim);
}

.simple-add-image span {
    font-size: 28px;
}

.simple-add-image small {
    font-family: var(--font-mono);
    font-size: 10px;
    margin-top: 6px;
    text-transform: uppercase;
}

.simple-story-input {
    width: 100%;
    padding: 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    min-height: 100px;
    resize: vertical;
}

.simple-story-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.simple-actions {
    display: flex;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-primary);
}

.simple-save-btn {
    padding: 14px 40px;
    background: var(--accent-green-dim);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.simple-save-btn:hover:not(:disabled) {
    background: rgba(0, 255, 136, 0.25);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.simple-save-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* === GENERATION MODE === */
.gen-mode {
    padding: 20px;
}

.gen-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2a2a2a;
}

.gen-template-name {
    font-size: 18px;
    color: #4ade80;
    cursor: pointer;
}

.gen-template-name:hover {
    text-decoration: underline;
}

.gen-header-btn {
    padding: 8px 16px;
    background: #2a2a2a;
    border: none;
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}

.gen-header-btn:hover {
    background: #3a3a3a;
    color: #fff;
}

.gen-controls-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 24px;
    border: 1px solid #333;
}

.gen-global-controls label {
    display: block;
    color: #888;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.gen-story-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.gen-story {
    width: 100%;
    background: #121212;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    color: #eee;
    font-size: 14px;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.gen-story:focus {
    outline: none;
    border-color: #4ade80;
}

.gen-global-actions {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.gen-global-attachments-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.gen-global-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 200px;
}

.gen-attach-global {
    width: 100%;
    padding: 8px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.gen-attach-global:hover {
    background: #333;
    color: #fff;
}

.gen-btn-mass {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    transition: all 0.2s;
}

.gen-btn-mass:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.4);
}

.gen-hint {
    color: #666;
    font-size: 12px;
    margin-top: 8px;
    font-style: italic;
}

/* Ensure slot attachments look good inside controls */
.gen-slot-controls .gen-attachments {
    margin-top: 8px;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.gen-att-thumb {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #444;
}

.gen-att-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gen-att-thumb button {
    position: absolute;
    top: 0;
    right: 0;
    width: 14px;
    height: 14px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gen-results {
    background: #1a2a1a;
    border: 1px solid #4ade80;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
}

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

.gen-results-header span {
    color: #4ade80;
    font-weight: 600;
}

.gen-results-actions {
    display: flex;
    gap: 8px;
}

.gen-results-actions button {
    padding: 6px 12px;
    background: #2a2a2a;
    border: none;
    color: #888;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.gen-results-actions button:hover {
    background: #3a3a3a;
    color: #fff;
}

.gen-results-actions button.danger {
    color: #ef4444;
}

.gen-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.gen-slot {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
}

.gen-slot.has-output {
    border-color: #4ade80;
}

.gen-slot.gen-slot-add {
    border: 2px dashed #3a3a3a;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 300px;
}

.gen-slot.gen-slot-add:hover {
    border-color: #4ade80;
    background: rgba(74, 222, 128, 0.05);
}

.gen-slot-add-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #666;
}

.gen-slot.gen-slot-add:hover .gen-slot-add-content {
    color: #4ade80;
}

.gen-slot-add-icon {
    font-size: 48px;
    font-weight: 300;
    line-height: 1;
}

.gen-slot-add-text {
    font-size: 14px;
    font-weight: 500;
}

.gen-slot-image {
    position: relative;
    aspect-ratio: 9/16;
    background: #0d0d0d;
}

.gen-slot-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gen-template-img {
    opacity: 0.7;
}

.gen-output-img {
    cursor: pointer;
}

.gen-slot-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #4ade80;
    color: #000;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.gen-slot-controls {
    padding: 12px;
}

.gen-prompt {
    width: 100%;
    padding: 10px;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    min-height: 50px;
    resize: none;
    font-family: inherit;
    margin-bottom: 8px;
}

.gen-prompt:focus {
    outline: none;
    border-color: #4ade80;
}

.gen-slot-actions {
    display: flex;
    gap: 8px;
}

.gen-attach {
    padding: 8px 12px;
    background: #2a2a2a;
    border: none;
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.gen-attach:hover {
    background: #3a3a3a;
    color: #fff;
}

.gen-btn {
    flex: 1;
    padding: 8px 12px;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    color: #000;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.gen-btn:hover {
    transform: translateY(-1px);
}

.gen-btn-edit {
    flex: 1;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.gen-btn-reset,
.gen-btn-new {
    padding: 8px 10px;
    background: #2a2a2a;
    border: none;
    color: #888;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.gen-btn-reset:hover {
    background: #3a3a3a;
    color: #fbbf24;
}

.gen-btn-new:hover {
    background: #3a3a3a;
    color: #4ade80;
}

.gen-attachments {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.gen-attach-thumb {
    position: relative;
    width: 36px;
    height: 36px;
}

.gen-attach-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.gen-attach-thumb button {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 14px;
    height: 14px;
    background: #ef4444;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gen-variations-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #2a2a2a;
}

.gen-variations-header {
    margin-bottom: 16px;
}

.gen-variations-header h3 {
    margin: 0;
    font-size: 16px;
    color: #888;
}

.gen-variations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.gen-variation-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    transition: all 0.2s;
}

.gen-variation-card:hover {
    border-color: #3a3a3a;
}

.gen-variation-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 8px;
    background: #0d0d0d;
    position: relative;
}

.gen-variation-images img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    border-radius: 4px;
}

.gen-variation-images .more {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(0,0,0,0.8);
    color: #888;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
}

.gen-variation-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
}

.gen-variation-date {
    font-size: 12px;
    color: #666;
}

.gen-variation-actions {
    display: flex;
    gap: 6px;
}

.gen-variation-actions button {
    padding: 6px 12px;
    background: #2a2a2a;
    border: none;
    color: #888;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.gen-variation-actions button:hover {
    background: #3a3a3a;
    color: #fff;
}

.gen-variation-actions button.danger {
    color: #ef4444;
}

.gen-variation-actions button.danger:hover {
    background: #3a2a2a;
}

/* ========== NEW WORKSPACE STYLES ========== */
.template-workspace {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Workspace Header - Tactical */
.workspace-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}

.workspace-title {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--accent-cyan);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.workspace-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.workspace-action-btn {
    padding: 8px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.workspace-action-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.workspace-action-btn.danger:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.workspace-clone-btn {
    padding: 10px 20px;
    background: var(--accent-green-dim);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.workspace-clone-btn:hover {
    background: rgba(0, 255, 136, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

/* Template reference strip - Tactical */
.template-reference {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    margin-bottom: 24px;
}

.template-label {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.template-thumbs {
    display: flex;
    gap: 10px;
    flex: 1;
    overflow-x: auto;
    padding: 4px 0;
}

.template-thumb {
    position: relative;
    width: 50px;
    aspect-ratio: 9/16;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid var(--border-secondary);
    transition: all 0.2s;
}

.template-thumb:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

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

.template-thumb-num {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 2px;
}

.template-thumb-delete {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: rgba(255, 51, 102, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.template-thumb:hover .template-thumb-delete {
    opacity: 1;
}

.template-thumb-delete:hover {
    background: var(--accent-red);
}

.template-add-slot {
    width: 50px;
    aspect-ratio: 9/16;
    border-radius: 3px;
    border: 1px dashed var(--border-secondary);
    background: transparent;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s;
}

.template-add-slot:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* Main workspace - Tactical */
.workspace-main {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    padding: 24px;
    margin-bottom: 24px;
    position: relative;
}

.workspace-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
    opacity: 0.3;
}

.workspace-section-header {
    margin-bottom: 20px;
}

.workspace-section-header h3 {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--accent-cyan);
    margin: 0 0 6px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.workspace-hint {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 10px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Horizontal scrolling carousel layout */
.workspace-slots {
    display: flex;
    gap: 32px;
    overflow-x: auto;
    padding: 20px 8px;
    margin-bottom: 20px;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
}

/* Custom scrollbar for workspace carousel */
.workspace-slots::-webkit-scrollbar {
    height: 8px;
}

.workspace-slots::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

.workspace-slots::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: 4px;
}

.workspace-slots::-webkit-scrollbar-thumb:hover {
    background: var(--accent-cyan);
}

.workspace-slot {
    flex: 0 0 320px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-primary);
    transition: all 0.2s;
    scroll-snap-align: start;
}

.workspace-slot.has-output {
    border-color: var(--accent-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.15);
}

.workspace-slot-image {
    position: relative;
    aspect-ratio: 9/16;
    background: var(--bg-primary);
}

.workspace-slot-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.workspace-slot-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    width: 24px;
    height: 24px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
}

.workspace-generated-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-green);
    color: var(--bg-primary);
    padding: 4px 8px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.workspace-slot-info {
    padding: 12px;
    border-top: 1px solid var(--border-primary);
}

.workspace-prompt {
    width: 100%;
    padding: 10px;
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    border-radius: 3px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    min-height: 60px;
    resize: none;
    margin-bottom: 10px;
}

.workspace-prompt::placeholder {
    color: var(--text-muted);
}

.workspace-prompt:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

.workspace-slot-actions {
    display: flex;
    gap: 8px;
}

.workspace-attach {
    padding: 8px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 10px;
    transition: all 0.2s;
}

.workspace-attach:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.workspace-gen-btn {
    flex: 1;
    padding: 8px 12px;
    background: var(--accent-cyan-dim);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}

.workspace-gen-btn:hover {
    background: rgba(0, 212, 255, 0.25);
    box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

.workspace-reset-btn {
    padding: 8px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-muted);
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s;
}

.workspace-reset-btn:hover {
    border-color: var(--accent-amber);
    color: var(--accent-amber);
}

.workspace-attachments {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.workspace-att-thumb {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border-secondary);
}

.workspace-att-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.workspace-att-thumb button {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: var(--accent-red);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workspace-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.workspace-gen-all, .workspace-save {
    padding: 12px 28px;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.workspace-gen-all {
    background: var(--accent-green-dim);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.workspace-gen-all:hover {
    background: rgba(0, 255, 136, 0.25);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}

.workspace-save {
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
}

.workspace-save:hover:not(:disabled) {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.workspace-save:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Variations section - Tactical Vertical Feed */
.variations-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    padding: 24px;
    margin-top: 24px;
}

.variations-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}

.variations-header h3 {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent-cyan);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.variations-count {
    background: var(--accent-cyan-dim);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 11px;
}

/* New vertical feed layout */
.variations-feed {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.variation-card-v2 {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s;
}

.variation-card-v2:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

.variation-card-images {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: var(--bg-primary);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}

.variation-image-item {
    flex: 0 0 auto;
    width: 140px;
    position: relative;
    scroll-snap-align: start;
}

.variation-image-item img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-secondary);
}

.variation-image-num {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    width: 22px;
    height: 22px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
}

.variation-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
}

.variation-card-date {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.variation-card-btns {
    display: flex;
    gap: 8px;
}

.variation-btn {
    padding: 8px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}

.variation-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

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

/* ============================================
   GALLERY VIEW - Template + Variations Feed
   ============================================ */

.template-gallery {
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.gallery-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}

.gallery-title {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 18px;
    color: var(--text-primary);
    margin: 0;
}

.gallery-header-actions {
    display: flex;
    gap: 8px;
}

.gallery-action-btn {
    padding: 8px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}

.gallery-action-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.gallery-action-btn.danger:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.gallery-template-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    padding: 20px;
}

.gallery-section-header {
    margin-bottom: 16px;
}

.gallery-section-header h3 {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-cyan);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-template-images {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px;
}

.gallery-template-image {
    flex: 0 0 auto;
    width: 120px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-template-image:hover {
    transform: scale(1.02);
}

.gallery-template-image img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid var(--border-secondary);
}

.gallery-image-num {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    width: 22px;
    height: 22px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
}

/* CTA Section */
.gallery-cta-section {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding: 16px 0;
}

.gallery-cta-btn {
    padding: 14px 28px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

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

.gallery-cta-btn.primary {
    background: var(--accent-cyan);
    border-color: var(--accent-cyan);
    color: var(--bg-primary);
}

.gallery-cta-btn.primary:hover {
    background: #00b8e0;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

/* Variations Feed in Gallery */
.gallery-variations-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    padding: 20px;
}

.gallery-variations-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gallery-feed {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gallery-variation-card.template-card {
    border-color: var(--accent-cyan);
    border-width: 2px;
}

.gallery-variation-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s;
}

.gallery-variation-card:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

.gallery-variation-card.new-variation {
    border-color: var(--accent-green);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.15);
}

.gallery-variation-images {
    display: flex;
    gap: 8px;
    padding: 16px;
    background: var(--bg-primary);
    overflow-x: auto;
}

.gallery-variation-image {
    flex: 0 0 auto;
    width: 120px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-variation-image:hover {
    transform: scale(1.02);
}

.gallery-variation-image img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid var(--border-secondary);
}

.gallery-variation-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-tertiary);
}

.gallery-variation-date {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gallery-variation-btns {
    display: flex;
    gap: 8px;
}

.gallery-btn {
    padding: 8px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}

.gallery-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

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

/* Empty state */
.gallery-empty-state {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-secondary);
    border: 1px dashed var(--border-secondary);
    border-radius: 4px;
}

.gallery-empty-state p {
    color: var(--text-muted);
    font-size: 13px;
}

/* Workspace mode additions */
.workspace-remix-badge {
    background: var(--accent-amber-dim);
    border: 1px solid var(--accent-amber);
    color: var(--accent-amber);
    padding: 6px 12px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.workspace-cancel {
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: all 0.2s;
}

.workspace-cancel:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

/* Inline workspace (appears in feed) */
.inline-workspace {
    background: var(--bg-secondary);
    border: 2px solid var(--accent-cyan);
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}

.inline-workspace-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-primary);
}

.inline-workspace-header h3 {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-cyan);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.inline-workspace-header .workspace-hint {
    font-size: 11px;
    color: var(--text-muted);
}

.inline-workspace-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-primary);
}

/* Keep old variation grid for backwards compat */
.variations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.variation-card {
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border-primary);
    transition: all 0.2s;
}

.variation-card:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.1);
}

.variation-images {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 8px;
    background: var(--bg-primary);
    position: relative;
}

.variation-images img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    border-radius: 2px;
}

.variation-more {
    position: absolute;
    right: 12px;
    bottom: 12px;
    background: rgba(0, 0, 0, 0.85);
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 10px;
}

.variation-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-top: 1px solid var(--border-primary);
}

.variation-date {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.variation-actions {
    display: flex;
    gap: 6px;
}

.variation-actions button {
    padding: 6px 10px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 10px;
    transition: all 0.2s;
}

.variation-actions button:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.variation-actions button.danger:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.variations-loading {
    text-align: center;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.variations-loading span {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

/* ========== BATCH CLONE MODAL - Tactical ========== */
.batch-clone-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.batch-clone-desc {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 11px;
    margin-bottom: 20px;
}

.batch-clone-section {
    margin-bottom: 20px;
}

.batch-clone-section label {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.batch-hint {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 10px;
    margin: 0 0 10px 0;
}

.batch-input {
    width: 100px;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 3px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
}

.batch-slot-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
    transition: opacity 0.2s;
}

.batch-slot-row.excluded {
    opacity: 0.5;
}

.batch-slot-row.excluded .batch-slot-input {
    background: var(--bg-primary);
    color: var(--text-muted);
}

.batch-slot-thumb {
    position: relative;
    width: 50px;
    aspect-ratio: 9/16;
    border-radius: 3px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-secondary);
}

.batch-slot-row.excluded .batch-slot-thumb {
    border-color: var(--text-muted);
}

.batch-slot-row.excluded .batch-slot-thumb img {
    filter: grayscale(100%);
}

.batch-slot-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.2s;
}

.batch-slot-thumb span {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: var(--accent-cyan);
    color: var(--bg-primary);
    padding: 2px 6px;
    border-radius: 2px;
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
}

.batch-slot-controls {
    position: absolute;
    top: 2px;
    left: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    transition: opacity 0.2s;
}

.batch-slot-thumb:hover .batch-slot-controls {
    opacity: 1;
}

.batch-slot-row.excluded .batch-slot-controls {
    opacity: 1;
}

.batch-slot-controls button {
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 3px;
    font-size: 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.batch-slot-exclude {
    background: var(--bg-tertiary);
    color: var(--accent-cyan);
    border: 1px solid var(--border-secondary) !important;
}

.batch-slot-exclude:hover {
    border-color: var(--accent-cyan) !important;
}

.batch-slot-row.excluded .batch-slot-exclude {
    color: var(--text-muted);
}

.batch-slot-delete {
    background: var(--accent-red);
    color: #fff;
}

.batch-slot-delete:hover {
    background: #ff1a4a;
}

.slot-excluded-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 7px;
    padding: 2px 4px;
    border-radius: 2px;
    letter-spacing: 0.5px;
}

.batch-slot-input {
    flex: 1;
    padding: 10px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 3px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    min-height: 60px;
    resize: vertical;
}

.batch-slot-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.1);
}

.batch-ai-input {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-cyan-dim);
    border-radius: 3px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    min-height: 70px;
    resize: vertical;
}

.batch-ai-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.15);
}

.batch-ai-input::placeholder {
    color: var(--text-muted);
}

.batch-attachments-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.batch-attachments-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.batch-att-thumb {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border-secondary);
    transition: all 0.2s;
}

.batch-att-thumb.excluded {
    opacity: 0.4;
    border-color: var(--text-muted);
}

.batch-att-thumb.excluded img {
    filter: grayscale(100%);
}

.batch-att-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.2s;
}

.batch-att-controls {
    position: absolute;
    top: 2px;
    right: 2px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.batch-att-thumb button {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.batch-att-delete {
    background: var(--accent-red);
    color: #fff;
}

.batch-att-delete:hover {
    background: #ff1a4a;
    transform: scale(1.1);
}

.batch-att-exclude {
    background: var(--bg-tertiary);
    color: var(--accent-cyan);
    border: 1px solid var(--border-secondary) !important;
}

.batch-att-exclude:hover {
    border-color: var(--accent-cyan) !important;
}

.batch-att-thumb.excluded .batch-att-exclude {
    color: var(--text-muted);
}

.excluded-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-muted);
    font-size: 7px;
    font-family: var(--font-mono);
    text-align: center;
    padding: 2px;
    letter-spacing: 0.5px;
}

.batch-attach-btn {
    padding: 8px 14px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    transition: all 0.2s;
}

.batch-attach-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.batch-progress {
    margin: 20px 0;
}

.batch-progress-text {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 11px;
    margin-bottom: 8px;
}

.batch-progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    border: 1px solid var(--border-primary);
}

.batch-progress-fill {
    height: 100%;
    background: var(--accent-green);
    transition: width 0.3s;
}

.batch-cancel-btn {
    padding: 10px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    transition: all 0.2s;
}

.batch-cancel-btn:hover {
    border-color: var(--accent-amber);
    color: var(--accent-amber);
}

.batch-start-btn {
    padding: 10px 20px;
    background: var(--accent-green-dim);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.batch-start-btn:hover {
    background: rgba(0, 255, 136, 0.25);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

/* ========== CHARACTERS FEATURE - Tactical ========== */
.characters-container {
    padding: 20px;
}

.characters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-primary);
}

.characters-header h2 {
    font-family: var(--font-mono);
    font-size: 16px;
    color: var(--accent-cyan);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.characters-create-btn {
    padding: 10px 20px;
    background: var(--accent-green-dim);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.characters-create-btn:hover {
    background: rgba(0, 255, 136, 0.25);
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.3);
}

.characters-loading,
.characters-generating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
}

.characters-loading span,
.characters-generating span {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.character-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.2s;
}

.character-card:hover {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.15);
    transform: translateY(-2px);
}

.character-card-image {
    aspect-ratio: 3/4;
    background: var(--bg-primary);
    overflow: hidden;
}

.character-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-primary);
}

.character-card-name {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.character-card-delete {
    width: 24px;
    height: 24px;
    background: transparent;
    border: 1px solid var(--border-secondary);
    color: var(--text-muted);
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.character-card-delete:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Character Create Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-secondary);
}

.modal-overlay .modal-header h2 {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent-cyan);
    margin: 0;
}

.modal-overlay .modal-close {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-overlay .modal-close:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Character Create Modal */
.character-modal {
    max-width: 500px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    max-height: 90vh;
    overflow-y: auto;
}

.character-create-form {
    padding: 20px;
}

.character-form-section {
    margin-bottom: 20px;
}

.character-form-section label {
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.character-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 3px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
}

.character-input:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.character-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 3px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 11px;
    min-height: 80px;
    resize: vertical;
}

.character-textarea:focus {
    outline: none;
    border-color: var(--accent-cyan);
}

.character-upload-area {
    border: 1px dashed var(--border-secondary);
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.character-upload-area:hover,
.character-upload-area.drag-over {
    border-color: var(--accent-cyan);
    background: var(--accent-cyan-dim);
}

.character-upload-placeholder {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.character-upload-placeholder span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
}

.character-upload-placeholder .upload-hint {
    font-size: 10px;
    color: var(--text-muted);
}

.character-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.character-generate-btn {
    flex: 1;
    padding: 12px 20px;
    background: var(--accent-cyan-dim);
    border: 1px solid var(--accent-cyan);
    color: var(--accent-cyan);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
}

.character-generate-btn:hover {
    background: rgba(0, 212, 255, 0.25);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

.character-upload-btn {
    padding: 12px 20px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 11px;
    transition: all 0.2s;
}

.character-upload-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.character-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    margin-top: 16px;
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.character-status span {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.character-result {
    margin-top: 20px;
    padding: 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    border-radius: 4px;
}

.character-result h4 {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-green);
    text-transform: uppercase;
    margin: 0 0 12px 0;
}

.character-result-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.character-save-btn {
    flex: 1;
    padding: 10px 16px;
    background: var(--accent-green-dim);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.2s;
}

.character-save-btn:hover {
    background: rgba(0, 255, 136, 0.25);
}

.character-regenerate-btn {
    padding: 10px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    border-radius: 3px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 10px;
    transition: all 0.2s;
}

.character-regenerate-btn:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

/* OLD STYLES - keeping for backwards compat */
.carousel-unified {
    padding: 20px;
}

/* Top Bar */
.carousel-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid #2a2a2a;
    flex-wrap: wrap;
    gap: 12px;
}

.carousel-top-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.carousel-top-left h2 {
    margin: 0;
    font-size: 22px;
    color: #fff;
}

.carousel-template-badge {
    background: #1a3a1a;
    border: 1px solid #4ade80;
    color: #4ade80;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-template-badge:hover {
    background: #2a4a2a;
}

.carousel-template-badge .badge-change {
    opacity: 0.6;
    font-size: 11px;
    margin-left: 4px;
}

.carousel-template-select {
    background: #2a2a2a;
    border: 1px solid #3d3d3d;
    color: #888;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.carousel-template-select:hover {
    background: #3a3a3a;
    color: #fff;
    border-color: #4ade80;
}

.carousel-top-right {
    display: flex;
    gap: 8px;
}

.carousel-top-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    color: #000;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.carousel-top-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.carousel-top-btn.secondary {
    background: #2a2a2a;
    color: #888;
}

.carousel-top-btn.secondary:hover {
    background: #3a3a3a;
    color: #fff;
    box-shadow: none;
    transform: none;
}

/* Meta Section */
.carousel-meta-section {
    margin-bottom: 20px;
}

.carousel-meta-section label {
    display: block;
    color: #888;
    font-size: 12px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.carousel-meta-input {
    width: 100%;
    padding: 14px;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    min-height: 80px;
    resize: vertical;
    font-family: inherit;
}

.carousel-meta-input:focus {
    outline: none;
    border-color: #4ade80;
}

/* Current Preview Strip */
.carousel-current-preview {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #2a2a2a;
}

.current-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.current-preview-header h3 {
    margin: 0;
    font-size: 14px;
    color: #4ade80;
}

.current-preview-actions {
    display: flex;
    gap: 8px;
}

.current-preview-actions button {
    padding: 6px 12px;
    background: #2a2a2a;
    border: none;
    color: #888;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.current-preview-actions button:hover {
    background: #3a3a3a;
    color: #fff;
}

.current-preview-actions button.primary {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #000;
    font-weight: 600;
}

.current-preview-actions button.danger {
    color: #ef4444;
}

.current-preview-actions button.danger:hover {
    background: #3a2a2a;
}

.current-preview-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.preview-strip-item {
    flex-shrink: 0;
    width: 80px;
    position: relative;
    cursor: pointer;
    transition: transform 0.2s;
}

.preview-strip-item:hover {
    transform: scale(1.05);
}

.preview-strip-item img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #333;
}

.preview-strip-item span {
    position: absolute;
    top: 4px;
    left: 4px;
    background: #4ade80;
    color: #000;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Slots Section */
.carousel-slots-section {
    margin-bottom: 20px;
}

.slots-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.slots-section-header h3 {
    margin: 0;
    font-size: 16px;
    color: #fff;
}

.slots-section-actions {
    display: flex;
    gap: 8px;
}

.slots-section-actions button {
    padding: 8px 14px;
    background: #2a2a2a;
    border: none;
    color: #888;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.slots-section-actions button:hover {
    background: #3a3a3a;
    color: #fff;
}

.slots-section-actions button.generate-all {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #000;
    font-weight: 600;
}

.carousel-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Slot Card */
.carousel-slot-card {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #2a2a2a;
    overflow: hidden;
    transition: all 0.2s;
}

.carousel-slot-card:hover {
    border-color: #3a3a3a;
}

.carousel-slot-card.has-output {
    border-color: #4ade80;
}

.slot-card-header {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #0d0d0d;
    gap: 8px;
}

.slot-card-number {
    background: #4ade80;
    color: #000;
    font-size: 12px;
    font-weight: 700;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-card-status {
    flex: 1;
    font-size: 11px;
    color: #888;
}

.carousel-slot-card.has-output .slot-card-status {
    color: #4ade80;
}

.slot-card-remove {
    width: 24px;
    height: 24px;
    background: transparent;
    border: none;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.slot-card-remove:hover {
    background: #3a2a2a;
    color: #ef4444;
}

/* Slot Card Images */
.slot-card-images {
    display: flex;
    align-items: center;
    padding: 12px;
    gap: 8px;
}

.slot-card-ref,
.slot-card-output {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.slot-card-arrow {
    color: #444;
    font-size: 20px;
    flex-shrink: 0;
}

.slot-card-img-container {
    aspect-ratio: 9/16;
    border-radius: 8px;
    overflow: hidden;
    background: #0d0d0d;
    border: 1px dashed #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slot-card-img-container.empty {
    color: #444;
    font-size: 24px;
}

.slot-card-img-container.has-output {
    border: 2px solid #4ade80;
    border-style: solid;
}

.slot-card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.slot-card-img-btn {
    padding: 6px 10px;
    background: #2a2a2a;
    border: none;
    color: #888;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.slot-card-img-btn:hover {
    background: #3a3a3a;
    color: #fff;
}

.slot-card-edit-btn {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #000;
    font-weight: 600;
}

/* Slot Card Prompt */
.slot-card-prompt {
    padding: 12px;
    border-top: 1px solid #2a2a2a;
}

.slot-card-prompt textarea {
    width: 100%;
    padding: 10px;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    min-height: 60px;
    resize: none;
    font-family: inherit;
    margin-bottom: 8px;
}

.slot-card-prompt textarea:focus {
    outline: none;
    border-color: #4ade80;
}

.slot-card-prompt-actions {
    display: flex;
    gap: 8px;
}

.slot-prompt-attach,
.slot-prompt-generate {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.slot-prompt-attach {
    background: #2a2a2a;
    color: #888;
}

.slot-prompt-attach:hover {
    background: #3a3a3a;
    color: #fff;
}

.slot-prompt-generate {
    flex: 1;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #000;
    font-weight: 600;
}

.slot-prompt-generate:hover {
    transform: translateY(-1px);
}

.slot-card-attachments {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.slot-attachment-thumb {
    position: relative;
    width: 40px;
    height: 40px;
}

.slot-attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #333;
}

.slot-attachment-thumb button {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background: #ef4444;
    color: #fff;
    border: 1px solid #1a1a1a;
    border-radius: 50%;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Variations Timeline */
.carousel-variations-timeline {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #2a2a2a;
}

.variations-timeline-header {
    margin-bottom: 12px;
}

.variations-timeline-header h3 {
    margin: 0;
    font-size: 14px;
    color: #888;
}

.variations-timeline-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.variation-timeline-item {
    flex-shrink: 0;
    width: 200px;
    background: #0d0d0d;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    cursor: pointer;
    transition: all 0.2s;
}

.variation-timeline-item:hover {
    border-color: #4ade80;
    transform: translateY(-2px);
}

.variation-timeline-previews {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    padding: 4px;
}

.variation-timeline-previews img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    border-radius: 4px;
}

.variation-timeline-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-top: 1px solid #2a2a2a;
}

.variation-timeline-date {
    font-size: 11px;
    color: #666;
}

.variation-timeline-delete {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 2px;
    font-size: 12px;
    transition: color 0.2s;
}

.variation-timeline-delete:hover {
    color: #ef4444;
}

/* Edit Modal */
.carousel-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-edit-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.carousel-edit-modal-content {
    position: relative;
    background: #1a1a1a;
    border-radius: 16px;
    border: 1px solid #2a2a2a;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.carousel-edit-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #2a2a2a;
}

.carousel-edit-modal-header h3 {
    margin: 0;
    color: #fff;
    font-size: 18px;
}

.carousel-edit-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: #2a2a2a;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.carousel-edit-modal-close:hover {
    background: #3a3a3a;
    color: #fff;
}

.carousel-edit-modal-body {
    padding: 20px;
    overflow-y: auto;
    display: flex;
    gap: 20px;
}

.carousel-edit-preview {
    flex-shrink: 0;
    width: 180px;
    position: relative;
}

.carousel-edit-preview img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #333;
}

.carousel-edit-preview-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    text-align: center;
    background: rgba(0, 0, 0, 0.7);
    color: #888;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
}

.carousel-edit-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.carousel-edit-field label {
    display: block;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
}

.carousel-edit-field textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    background: #0d0d0d;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.carousel-edit-field textarea:focus {
    outline: none;
    border-color: #4ade80;
}

.carousel-edit-hint {
    color: #666;
    font-size: 12px;
    margin: 0 0 12px 0;
}

.carousel-edit-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.carousel-edit-attachment {
    position: relative;
    width: 64px;
    height: 64px;
}

.carousel-edit-attachment img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #333;
}

.carousel-edit-attachment button {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: 2px solid #1a1a1a;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-edit-attach-btn {
    padding: 10px 16px;
    background: #2a2a2a;
    border: 1px dashed #444;
    color: #888;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.carousel-edit-attach-btn:hover {
    background: #333;
    border-color: #4ade80;
    color: #fff;
}

.carousel-edit-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 20px;
    border-top: 1px solid #2a2a2a;
}

.carousel-edit-btn-cancel {
    padding: 12px 20px;
    background: #2a2a2a;
    border: none;
    color: #888;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.carousel-edit-btn-cancel:hover {
    background: #3a3a3a;
    color: #fff;
}

.carousel-edit-btn-generate {
    padding: 12px 24px;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    color: #000;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.carousel-edit-btn-generate:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        max-height: 50vh;
    }
    
    .sidebar-content {
        flex: 1;
        overflow-y: auto;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
    }
    
    .carousel-template-grid,
    .carousel-results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .carousel-header {
        flex-direction: column;
    }
}
/* Add slot loading overlay styles */
.slot-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    z-index: 10;
    border-radius: inherit;
}

.slot-loading-overlay .spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-cyan);
    animation: spin 1s ease-in-out infinite;
}

.slot-loading-overlay .loading-message {
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Ensure workspace slot images can contain absolute positioned overlays */
.workspace-slot-image {
    position: relative;
}
/* Enhance Save Variation Button */
.gen-save-btn {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.4);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gen-save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(74, 222, 128, 0.5);
}

.gen-save-btn:disabled {
    background: #333;
    color: #666;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
/* Updated simplified creator styles */
.simple-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.simple-image-slot {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.simple-slot-preview {
    position: relative;
    aspect-ratio: 9/16;
    background: #0d0d0d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-bottom: 1px solid #2a2a2a;
    transition: background 0.2s;
}

.simple-slot-preview:hover {
    background: #151515;
}

.simple-slot-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.simple-slot-placeholder {
    font-size: 32px;
    color: #444;
    font-weight: 300;
}

.simple-slot-number {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #4ade80;
    color: #000;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
}

.simple-slot-change {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.simple-slot-change:hover {
    background: rgba(0,0,0,0.9);
    border-color: #fff;
}

.simple-slot-controls {
    padding: 12px;
    background: #1a1a1a;
}

.simple-slot-prompt-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.simple-slot-attach {
    width: 36px;
    height: 36px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #888;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.simple-slot-attach:hover {
    background: #333;
    color: #fff;
    border-color: #444;
}

.simple-slot-input {
    flex: 1;
    height: 36px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0 12px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
}

.simple-slot-input:focus {
    outline: none;
    border-color: #4ade80;
}

.simple-slot-gen {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    color: #000;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.simple-slot-gen:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(74, 222, 128, 0.3);
}

.simple-attachments-list {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 0;
}

.simple-attachment-thumb {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #333;
}

.simple-attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.simple-attachment-thumb button {
    position: absolute;
    top: 0;
    right: 0;
    width: 16px;
    height: 16px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.simple-add-image {
    background: #1a1a1a;
    border: 2px dashed #333;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 400px; /* Match height of other slots roughly */
}

.simple-add-image:hover {
    border-color: #4ade80;
    background: #1f1f1f;
}

.simple-add-image span {
    font-size: 32px;
    color: #444;
    margin-bottom: 8px;
}

.simple-add-image small {
    color: #666;
    font-size: 14px;
    font-weight: 600;
}
/* Updated simplified creator styles */
.simple-images-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.simple-image-slot {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.simple-slot-preview {
    position: relative;
    aspect-ratio: 9/16;
    background: #0d0d0d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-bottom: 1px solid #2a2a2a;
    transition: background 0.2s;
}

.simple-slot-preview:hover {
    background: #151515;
}

.simple-slot-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.simple-slot-placeholder {
    font-size: 32px;
    color: #444;
    font-weight: 300;
}

.simple-slot-number {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #4ade80;
    color: #000;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    z-index: 2;
}

.simple-slot-change {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.simple-slot-change:hover {
    background: rgba(0,0,0,0.8);
    border-color: #fff;
    transform: scale(1.05);
}

.simple-slot-controls {
    padding: 16px;
    background: #1a1a1a;
    border-top: 1px solid #2a2a2a;
}

.simple-slot-prompt-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.simple-slot-attach {
    width: 40px;
    height: 40px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #888;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.simple-slot-attach:hover {
    background: #333;
    color: #fff;
    border-color: #444;
}

.simple-slot-input {
    flex: 1;
    height: 40px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
}

.simple-slot-input:focus {
    outline: none;
    border-color: #4ade80;
}

.simple-slot-gen {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    color: #000;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.simple-slot-gen:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.simple-attachments-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 0;
}

.simple-attachment-thumb {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    background: #000;
}

.simple-attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.simple-attachment-thumb button {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.simple-add-image {
    background: #1a1a1a;
    border: 2px dashed #333;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    /* Removing fixed height to let it match grid row */
    aspect-ratio: 9/16;
}

.simple-add-image:hover {
    border-color: #4ade80;
    background: #1f1f1f;
}

.simple-add-image span {
    font-size: 40px;
    color: #444;
    margin-bottom: 12px;
}

.simple-add-image small {
    color: #666;
    font-size: 14px;
    font-weight: 600;
}
/* Updated simplified creator styles */
.simple-images-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.simple-image-slot {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

.simple-slot-preview {
    position: relative;
    aspect-ratio: 9/16;
    background: #0d0d0d;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-bottom: 1px solid #2a2a2a;
    transition: background 0.2s;
}

.simple-slot-preview:hover {
    background: #151515;
}

.simple-slot-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.simple-slot-placeholder {
    font-size: 32px;
    color: #444;
    font-weight: 300;
}

.simple-slot-number {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #4ade80;
    color: #000;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    z-index: 2;
}

.simple-slot-change {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2;
}

.simple-slot-change:hover {
    background: rgba(0,0,0,0.8);
    border-color: #fff;
    transform: scale(1.05);
}

.simple-slot-controls {
    padding: 16px;
    background: #1a1a1a;
    border-top: 1px solid #2a2a2a;
}

.simple-slot-prompt-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.simple-slot-attach {
    width: 40px;
    height: 40px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #888;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.simple-slot-attach:hover {
    background: #333;
    color: #fff;
    border-color: #444;
}

.simple-slot-input {
    flex: 1;
    height: 40px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 0 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
}

.simple-slot-input:focus {
    outline: none;
    border-color: #4ade80;
}

.simple-slot-gen {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    color: #000;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.simple-slot-gen:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 222, 128, 0.3);
}

.simple-attachments-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    min-height: 0;
}

.simple-attachment-thumb {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #333;
    background: #000;
}

.simple-attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.simple-attachment-thumb button {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.simple-add-image {
    background: #1a1a1a;
    border: 2px dashed #333;
    border-radius: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 16px 24px;
}

.simple-add-image:hover {
    border-color: #4ade80;
    background: #1f1f1f;
}

.simple-add-image span {
    font-size: 24px;
    color: #444;
    margin-bottom: 0;
}

.simple-add-image small {
    color: #666;
    font-size: 14px;
    font-weight: 600;
}

/* Horizontal Slot Layout for Template Creation */
.simple-image-slot.horizontal {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 16px;
    align-items: stretch;
}

.simple-image-slot.horizontal .simple-slot-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

.simple-image-slot.horizontal .simple-slot-preview {
    width: 140px;
    aspect-ratio: 9/16;
}

.simple-image-slot.horizontal .simple-slot-controls {
    flex: 1;
    padding: 0;
    background: transparent;
    border-top: none;
    display: flex;
    flex-direction: column;
}

.simple-image-slot.horizontal .simple-slot-prompt-area {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.simple-image-slot.horizontal .simple-slot-textarea {
    flex: 1;
    min-height: 80px;
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    line-height: 1.4;
}

.simple-image-slot.horizontal .simple-slot-textarea:focus {
    outline: none;
    border-color: #4ade80;
}

.simple-image-slot.horizontal .simple-slot-textarea::placeholder {
    color: #555;
}

.simple-image-slot.horizontal .simple-slot-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.simple-image-slot.horizontal .simple-slot-gen {
    width: auto;
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
    gap: 6px;
}

.simple-image-slot.horizontal .simple-slot-attach {
    width: 36px;
    height: 36px;
}

/* Slot History Navigation */
.simple-slot-history-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 6px 0;
}

.slot-nav-btn {
    width: 28px;
    height: 28px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.slot-nav-btn:hover:not(:disabled) {
    background: #333;
    border-color: #4ade80;
    color: #4ade80;
}

.slot-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.slot-history-count {
    font-size: 12px;
    color: #888;
    min-width: 40px;
    text-align: center;
}

/* Attachment Picker Modal */
.att-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.att-picker-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.att-picker-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.att-picker-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #fff;
    font-size: 18px;
    text-align: center;
}

.att-picker-section {
    margin-bottom: 24px;
}

.att-picker-section h4 {
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.att-picker-upload-btn {
    width: 100%;
    padding: 16px;
    background: #2a2a2a;
    border: 1px dashed #444;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.att-picker-upload-btn:hover {
    background: #333;
    border-color: #666;
    transform: translateY(-1px);
}

.att-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.att-picker-option {
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.att-picker-option:hover {
    border-color: #4ade80;
    transform: translateY(-2px);
}

.att-picker-option img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    display: block;
}

.att-picker-option span {
    display: block;
    padding: 8px;
    font-size: 11px;
    color: #ccc;
    text-align: center;
    background: #151515;
    border-top: 1px solid #2a2a2a;
}

.att-picker-close {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid #333;
    color: #888;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.att-picker-close:hover {
    background: #2a2a2a;
    color: #fff;
}

/* Attachment Picker Modal */
.att-picker-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.att-picker-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.att-picker-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 24px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.att-picker-content h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #fff;
    font-size: 18px;
    text-align: center;
}

.att-picker-section {
    margin-bottom: 24px;
}

.att-picker-section h4 {
    color: #888;
    font-size: 12px;
    text-transform: uppercase;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
}

.att-picker-upload-btn {
    width: 100%;
    padding: 16px;
    background: #2a2a2a;
    border: 1px dashed #444;
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.att-picker-upload-btn:hover {
    background: #333;
    border-color: #666;
    transform: translateY(-1px);
}

.att-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.att-picker-option {
    background: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.att-picker-option:hover {
    border-color: #4ade80;
    transform: translateY(-2px);
}

.att-picker-option img {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    display: block;
}

.att-picker-option span {
    display: block;
    padding: 8px;
    font-size: 11px;
    color: #ccc;
    text-align: center;
    background: #151515;
    border-top: 1px solid #2a2a2a;
}

.att-picker-close {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid #333;
    color: #888;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.att-picker-close:hover {
    background: #2a2a2a;
    color: #fff;
}

/* Unified Image Picker Enhancements */
.att-picker-large {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.att-picker-upload {
    padding: 10px 0;
}

.att-picker-upload-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border: 2px dashed #444;
    color: #fff;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.att-picker-upload-btn:hover {
    border-color: #4ade80;
    background: linear-gradient(135deg, #2a3a2a 0%, #1a2a1a 100%);
}

.att-picker-grid-video {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.att-picker-video-option video {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    background: #000;
}

.att-picker-video-option:hover video {
    opacity: 0.8;
}

.small-btn.danger {
    background: #3a2a2a;
    color: #f87171;
    border-color: #5a3a3a;
}

.small-btn.danger:hover {
    background: #4a2a2a;
    color: #fca5a5;
}

/* Characters Tab */
.characters-container {
    padding: 20px;
}

.characters-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}

.characters-header h2 {
    margin: 0 0 4px 0;
    color: #fff;
}

.characters-header p {
    margin: 0;
    color: #888;
    font-size: 14px;
}

.characters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.character-card {
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #2a2a2a;
    transition: all 0.2s ease;
}

.character-card:hover {
    border-color: #4ade80;
    transform: translateY(-2px);
}

.character-image {
    position: relative;
    aspect-ratio: 1;
    cursor: pointer;
    overflow: hidden;
}

.character-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    opacity: 0;
    transition: opacity 0.2s;
}

.character-image:hover .character-edit-overlay {
    opacity: 1;
}

.character-info {
    padding: 12px;
    border-bottom: 1px solid #2a2a2a;
}

.character-info h4 {
    margin: 0;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.character-actions {
    padding: 8px 12px;
    display: flex;
    gap: 8px;
}

.char-btn {
    flex: 1;
    padding: 8px;
    background: #2a2a2a;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.char-btn:hover {
    background: #3a3a3a;
}

.char-btn-danger:hover {
    background: #4a2a2a;
}

.empty-characters {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-characters p:first-child {
    font-size: 18px;
    color: #888;
    margin-bottom: 8px;
}

/* Character Edit Mode */
.character-edit-mode {
    max-width: 800px;
    margin: 0 auto;
}

.character-edit-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.character-edit-header h2 {
    margin: 0;
    color: #fff;
}

.character-edit-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .character-edit-content {
        grid-template-columns: 1fr;
    }
}

.character-edit-image-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.character-edit-preview {
    aspect-ratio: 1;
    background: #1a1a1a;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px dashed #3a3a3a;
}

.character-edit-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.character-edit-preview:hover {
    border-color: #4ade80;
}

.character-upload-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.2s;
}

.character-edit-preview:hover .character-upload-overlay {
    opacity: 1;
}

.character-upload-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #666;
}

.character-upload-placeholder span:first-child {
    font-size: 48px;
}

.character-edit-tools {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.char-edit-prompt-wrap {
    display: flex;
    gap: 8px;
}

.char-edit-prompt-wrap textarea {
    flex: 1;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #fff;
    resize: none;
    height: 60px;
    font-family: inherit;
}

.char-edit-prompt-wrap textarea:focus {
    outline: none;
    border-color: #4ade80;
}

.char-edit-apply {
    padding: 12px 16px;
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.char-edit-apply:hover {
    opacity: 0.9;
}

.char-edit-apply:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.char-edit-history {
    display: flex;
    gap: 8px;
}

.char-history-btn {
    flex: 1;
    padding: 10px;
    background: #2a2a2a;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
}

.char-history-btn:hover:not(:disabled) {
    background: #3a3a3a;
}

.char-history-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.character-edit-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.character-edit-details label {
    color: #888;
    font-size: 13px;
    margin-bottom: -8px;
}

.character-edit-details input {
    padding: 14px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
}

.character-edit-details input:focus {
    outline: none;
    border-color: #4ade80;
}

.character-save-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
}

.character-save-actions button {
    flex: 1;
}

/* Character Edit Enhanced Styles */
.char-edit-prompt-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.char-edit-prompt-section textarea {
    width: 100%;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    color: #fff;
    resize: none;
    min-height: 80px;
    font-family: inherit;
    font-size: 14px;
}

.char-edit-prompt-section textarea:focus {
    outline: none;
    border-color: #4ade80;
}

.char-attachments-row {
    display: flex;
    gap: 8px;
}

.char-attach-btn {
    padding: 10px 16px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.char-attach-btn:hover {
    background: #3a3a3a;
    border-color: #4ade80;
}

.char-attachments-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.char-attachment-thumb {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #3a3a3a;
}

.char-attachment-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.char-attachment-thumb button {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    color: #fff;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.char-attachment-thumb:hover button {
    opacity: 1;
}

.char-action-buttons {
    display: flex;
    gap: 8px;
}

.char-action-buttons .char-edit-apply {
    flex: 1;
}

.char-edit-history {
    display: flex;
    gap: 8px;
}

.char-edit-history .char-history-btn {
    flex: 1;
    padding: 10px;
    background: #2a2a2a;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.char-edit-history .char-history-btn:hover:not(:disabled) {
    background: #3a3a3a;
}

.char-edit-history .char-history-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Clean Character Editor Styles */
.character-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    max-width: 1000px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .character-edit-grid {
        grid-template-columns: 1fr;
    }
}

.character-preview-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.character-controls-col {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.character-edit-preview {
    aspect-ratio: 3/4;
    background: #1a1a1a;
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px dashed #333;
    transition: all 0.2s ease;
}

.character-edit-preview:hover {
    border-color: #4ade80;
    background: #222;
}

.character-upload-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #888;
}

.upload-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 8px;
}

.character-upload-placeholder span {
    font-weight: 500;
    font-size: 15px;
}

.character-upload-placeholder .sub-text {
    font-size: 13px;
    color: #555;
    font-weight: 400;
}

.char-control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.char-control-group label {
    font-size: 12px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-input {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 14px;
    color: #fff;
    font-size: 15px;
    width: 100%;
    transition: border-color 0.2s;
}

.modern-input:focus {
    border-color: #4ade80;
    outline: none;
}

.char-prompt-container {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 4px;
    transition: border-color 0.2s;
}

.char-prompt-container:focus-within {
    border-color: #4ade80;
}

.modern-textarea {
    width: 100%;
    min-height: 100px;
    background: transparent;
    border: none;
    padding: 12px;
    color: #fff;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.modern-textarea:focus {
    outline: none;
}

.char-prompt-actions {
    display: flex;
    justify-content: flex-end;
    padding: 8px;
    border-top: 1px solid #2a2a2a;
}

.char-attach-btn {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #888;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.char-attach-btn:hover {
    background: #2a2a2a;
    color: #fff;
}

.gen-btn-primary {
    background: #4ade80;
    color: #000;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.gen-btn-primary:hover {
    background: #22c55e;
    transform: translateY(-1px);
}

.gen-btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.full-width {
    width: 100%;
}

.char-save-section {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #222;
    display: flex;
    gap: 12px;
}

.char-save-section button {
    flex: 1;
}

/* Multi-selection styles for attachment picker */
.att-picker-option {
    position: relative;
    border: 2px solid transparent;
}

.att-picker-option.selected {
    border-color: #4ade80;
}

.att-picker-check {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: #4ade80;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s;
}

.att-picker-option.selected .att-picker-check {
    opacity: 1;
    transform: scale(1);
}

.att-picker-footer {
    border-top: 1px solid #2a2a2a;
    padding-top: 16px;
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.att-picker-footer button {
    padding: 10px 20px;
    font-size: 14px;
}

/* ============================================
   UNIFIED IMAGE PICKER (NEW DESIGN)
   Segmented sections with preview rows
   ============================================ */

.uip-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.uip-content {
    position: relative;
    width: 90%;
    max-width: 480px;
    max-height: 85vh;
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.uip-header {
    padding: 20px 20px 16px;
    border-bottom: 1px solid #2a2a2a;
    text-align: center;
}

.uip-header h3 {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #fff;
}

.uip-subtitle {
    margin: 6px 0 0;
    font-size: 12px;
    color: #666;
}

.uip-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.uip-footer {
    padding: 16px 20px;
    border-top: 1px solid #2a2a2a;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Upload Section */
.uip-upload-section {
    margin-bottom: 20px;
}

.uip-upload-btn {
    width: 100%;
    padding: 14px 16px;
    background: #1e1e1e;
    border: 1px dashed #3a3a3a;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
}

.uip-upload-btn:hover {
    background: #252525;
    border-color: #4a4a4a;
}

.uip-upload-icon {
    font-size: 18px;
}

/* Sections */
.uip-section {
    margin-bottom: 20px;
}

.uip-section:last-child {
    margin-bottom: 0;
}

.uip-section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #222;
}

.uip-section-icon {
    font-size: 14px;
}

.uip-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
    flex: 1;
}

.uip-section-count {
    font-size: 11px;
    color: #555;
    background: #222;
    padding: 2px 8px;
    border-radius: 10px;
}

.uip-see-more {
    background: none;
    border: none;
    color: var(--accent-cyan);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.uip-see-more:hover {
    background: rgba(0, 255, 255, 0.1);
}

/* Items Grid - horizontal row by default */
.uip-section-items {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}

.uip-section-items::-webkit-scrollbar {
    height: 4px;
}

.uip-section-items::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

/* Expanded grid */
.uip-section-items.uip-expanded {
    flex-wrap: wrap;
    overflow-x: visible;
}

/* Individual items */
.uip-item {
    flex: 0 0 auto;
    width: 90px;
    background: #1a1a1a;
    border: 2px solid #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.uip-item:hover {
    border-color: #444;
    transform: translateY(-2px);
}

.uip-item.selected {
    border-color: var(--accent-cyan);
}

.uip-item img,
.uip-item video {
    width: 100%;
    aspect-ratio: 9/16;
    object-fit: cover;
    display: block;
}

.uip-item-label {
    display: block;
    padding: 6px 4px;
    font-size: 10px;
    color: #888;
    text-align: center;
    background: #151515;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uip-item-video {
    position: relative;
}

.uip-item-video::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -70%);
    font-size: 20px;
    color: rgba(255,255,255,0.8);
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
    pointer-events: none;
}

/* Selection checkmark */
.uip-check {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: var(--accent-cyan);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #000;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.15s;
}

.uip-item.selected .uip-check {
    opacity: 1;
    transform: scale(1);
}

/* Mobile adjustments */
@media (max-width: 480px) {
    .uip-content {
        width: 95%;
        max-height: 90vh;
    }

    .uip-item {
        width: 80px;
    }

    .uip-header {
        padding: 16px 16px 12px;
    }

    .uip-body {
        padding: 12px;
    }
}

/* ============================================
   PARTICLE EFFECT
   Subtle burst effect on button clicks
   ============================================ */

.particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10000;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: var(--accent-cyan);
    border-radius: 50%;
    pointer-events: none;
    box-shadow: 0 0 6px var(--accent-cyan), 0 0 12px var(--accent-cyan);
    animation: particleBurst 0.7s ease-out forwards;
}

.particle:nth-child(odd) {
    background: var(--accent-green);
    box-shadow: 0 0 6px var(--accent-green), 0 0 12px var(--accent-green);
}

.particle:nth-child(3n) {
    width: 4px;
    height: 4px;
}

@keyframes particleBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) scale(0.3);
    }
}

/* ============================================
   ONBOARDING DIALOG
   ============================================ */

.onboarding-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.onboarding-dialog {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    width: 90%;
    max-width: 480px;
    padding: 32px;
    box-shadow:
        0 0 40px rgba(0, 212, 255, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.5);
    animation: dialogSlideIn 0.3s ease-out;
}

/* Stacked layout for onboarding - video centered, content below */
.onboarding-dialog.onboarding-stacked-layout {
    max-width: 380px;
    padding: 20px 20px 0 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.onboarding-video-container {
    width: 100%;
    aspect-ratio: 9/16;
    max-height: 340px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
}

.onboarding-video-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.onboarding-content {
    padding: 32px 28px;
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 8px;
}

@keyframes dialogSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.onboarding-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-primary);
}

.onboarding-logo {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--accent-cyan);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.onboarding-subtitle {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.onboarding-slides {
    min-height: 110px;
    position: relative;
    margin-bottom: 8px;
}

.onboarding-slide {
    display: none;
    text-align: center;
    animation: slideIn 0.3s ease-out;
    width: 100%;
}

.onboarding-slide.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Hero slide styling */
.onboarding-hero-title {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 3px;
    color: var(--accent-cyan);
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
    margin-bottom: 16px;
}

.onboarding-hero-tagline {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-secondary);
    letter-spacing: 0.3px;
}

/* Feature slide styling */
.onboarding-slide .slide-number {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-cyan);
    letter-spacing: 2px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.onboarding-slide .slide-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.onboarding-slide h3 {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.onboarding-slide p {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Responsive: smaller screens */
@media (max-width: 450px) {
    .onboarding-dialog.onboarding-stacked-layout {
        max-width: 95%;
    }

    .onboarding-video-container {
        max-height: 280px;
    }

    .onboarding-content {
        padding: 24px 20px;
    }

    .onboarding-hero-title {
        font-size: 20px;
    }
}

.onboarding-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 20px 0 24px 0;
}

.onboarding-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.onboarding-dots .dot.active {
    background: var(--accent-cyan);
    box-shadow: 0 0 8px var(--accent-cyan);
}

.onboarding-dots .dot:hover {
    background: var(--text-muted);
}

.onboarding-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    margin-top: 8px;
    border-top: 1px solid var(--border-primary);
}

.onboarding-skip {
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 12px;
    cursor: pointer;
    padding: 8px 12px;
    transition: color 0.2s;
}

.onboarding-skip:hover {
    color: var(--text-secondary);
}

.onboarding-nav {
    display: flex;
    gap: 10px;
}

.onboarding-prev,
.onboarding-next {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.onboarding-prev:hover,
.onboarding-next:hover {
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}

.onboarding-cta {
    background: var(--accent-cyan);
    border: none;
    color: var(--bg-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

.onboarding-cta:hover {
    background: #00e5ff;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

/* ============================================
   BATCH GENERATION LIVE PROGRESS
   ============================================ */

.batch-live-progress {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-accent);
    border-radius: 6px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.1);
}

.batch-live-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.batch-live-indicator {
    width: 10px;
    height: 10px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: batchPulse 1s ease-in-out infinite;
    box-shadow: 0 0 8px var(--accent-green);
}

@keyframes batchPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.batch-live-status {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-primary);
}

.batch-live-count {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent-cyan);
    font-weight: 600;
}

.batch-live-bar {
    height: 6px;
    background: var(--bg-primary);
    border-radius: 3px;
    overflow: hidden;
}

.batch-live-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
    border-radius: 3px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-cyan);
}

/* New Variation Badge */
.variation-card.variation-new {
    border-color: var(--accent-green);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.2);
    animation: newVariationPulse 2s ease-in-out;
}

@keyframes newVariationPulse {
    0% { box-shadow: 0 0 30px rgba(0, 255, 136, 0.5); }
    50% { box-shadow: 0 0 15px rgba(0, 255, 136, 0.3); }
    100% { box-shadow: 0 0 20px rgba(0, 255, 136, 0.2); }
}

.variation-new-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-green);
    color: var(--bg-primary);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 3px;
    letter-spacing: 1px;
    animation: newBadgeBlink 0.5s ease-in-out 3;
    z-index: 10;
}

@keyframes newBadgeBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.variation-card {
    position: relative;
}

/* Load More Button */
.load-more-container {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 24px 0;
}

.load-more-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-cyan);
    color: var(--accent-cyan);
}
