/* ══════════════════════════════════════════════════════════════════════
   CineAgent Studio — Cinematic UI Design System
   ══════════════════════════════════════════════════════════════════════ */

:root {
    /* Color Palette */
    --bg-base: #0a0b0f;
    --bg-surface: #10121a;
    --bg-panel: rgba(18, 21, 30, 0.82);
    --bg-panel-hover: rgba(24, 28, 40, 0.92);
    --bg-card: rgba(22, 26, 38, 0.7);
    --bg-card-elevated: rgba(28, 33, 48, 0.85);
    --bg-input: rgba(10, 12, 18, 0.65);
    
    /* Accents */
    --accent-gold: #f59e0b;
    --accent-gold-glow: rgba(245, 158, 11, 0.35);
    --accent-gold-dim: rgba(245, 158, 11, 0.12);
    --accent-rose: #f43f5e;
    --accent-rose-dim: rgba(244, 63, 94, 0.12);
    --accent-cyan: #06b6d4;
    --accent-cyan-dim: rgba(6, 182, 212, 0.12);
    --accent-indigo: #6366f1;
    --accent-purple: #a855f7;
    --accent-green: #10b981;
    
    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.12);
    --border-accent: rgba(245, 158, 11, 0.3);
    --border-glow: 0 0 0 1px rgba(245, 158, 11, 0.4), 0 0 16px rgba(245, 158, 11, 0.2);

    /* Typography */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-dim: #475569;
    
    --font-heading: 'Outfit', sans-serif;
    --font-sans: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-screenplay: 'Courier Prime', monospace;
    --font-mono: 'JetBrains Mono', monospace;

    /* Radii */
    --radius-full: 9999px;
    --radius-xl: 20px;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 6px;

    /* Shadows & Transitions */
    --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    --shadow-glow-gold: 0 0 24px rgba(245, 158, 11, 0.2);
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

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

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(10, 11, 15, 0.6);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

::selection {
    background: rgba(245, 158, 11, 0.3);
    color: #fff;
}

body {
    background-color: var(--bg-base);
    background-image: 
        radial-gradient(ellipse 80% 50% at 20% -10%, rgba(245, 158, 11, 0.09) 0%, transparent 60%),
        radial-gradient(ellipse 60% 40% at 85% 10%, rgba(6, 182, 212, 0.07) 0%, transparent 50%),
        radial-gradient(ellipse 70% 50% at 50% 110%, rgba(244, 63, 94, 0.06) 0%, transparent 60%);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* ── Top Navigation Bar ── */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 24px;
    background: rgba(10, 12, 18, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    z-index: 100;
    flex-shrink: 0;
    gap: 16px;
}

.brand-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #f59e0b 0%, #f43f5e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
    flex-shrink: 0;
}

.logo-glow {
    position: absolute;
    inset: -2px;
    border-radius: calc(var(--radius-md) + 2px);
    background: linear-gradient(135deg, #f59e0b, #f43f5e);
    z-index: -1;
    opacity: 0.4;
    filter: blur(6px);
}

.brand-titles {
    display: flex;
    flex-direction: column;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-titles h1 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #fff;
}

.brand-titles h1 span {
    background: linear-gradient(135deg, #f59e0b, #f43f5e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.version-tag {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
    letter-spacing: 0.5px;
}

.subtitle {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Center Inspo Button */
.nav-center-actions {
    display: flex;
    align-items: center;
}

.inspo-random-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: var(--accent-gold);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-sans);
    cursor: pointer;
    transition: var(--transition-fast);
}

.inspo-random-btn:hover {
    background: rgba(245, 158, 11, 0.2);
    border-color: var(--accent-gold);
    transform: translateY(-1px);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

.inspo-random-btn:active {
    transform: translateY(0);
}

/* Telemetry Pills */
.system-telemetry-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.telemetry-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 5px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.telemetry-pill:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-medium);
}

.telemetry-pill i {
    font-size: 11px;
    color: var(--text-muted);
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted);
}

.status-dot.online {
    background: var(--accent-green);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

/* ── Main Workspace Layout ── */
.workspace {
    display: grid;
    grid-template-columns: 380px 1fr;
    flex: 1;
    overflow: hidden;
    padding: 16px 20px;
    gap: 18px;
}

/* ── Sidebar ── */
.sidebar-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    padding-right: 4px;
}

.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    box-shadow: var(--shadow-card);
    transition: var(--transition-normal);
}

.glass-panel:hover {
    border-color: var(--border-medium);
}

.panel-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 14px;
}

.panel-header-between {
    justify-content: space-between;
    align-items: center;
}

.header-left-col {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon-wrap {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    background: var(--accent-gold-dim);
    border: 1px solid rgba(245, 158, 11, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    font-size: 13px;
    flex-shrink: 0;
}

.upload-icon-wrap {
    background: var(--accent-cyan-dim);
    border-color: rgba(6, 182, 212, 0.2);
    color: var(--accent-cyan);
}

.crew-icon-wrap {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
    color: var(--accent-indigo);
}

.panel-header h2 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.panel-tagline {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.35;
    margin-top: 1px;
}

/* Inspiration Chips */
.inspo-chips-wrapper {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.inspo-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    display: block;
    margin-bottom: 6px;
}

.inspo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-family: var(--font-sans);
}

.chip-btn:hover {
    background: var(--accent-gold-dim);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--accent-gold);
    transform: translateY(-1px);
}

/* Forms */
.film-input-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-group label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label i {
    color: var(--accent-gold);
    font-size: 11px;
}

.char-count {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-dim);
}

textarea, select, input[type="text"] {
    background: var(--bg-input);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 13px;
    padding: 10px 12px;
    transition: var(--transition-fast);
    width: 100%;
}

textarea {
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
}

textarea:focus, select:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
    background: rgba(12, 14, 22, 0.95);
}

.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.custom-select-wrap {
    position: relative;
}

.custom-select-wrap select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    padding-right: 30px;
    background-color: var(--bg-input);
}

.select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
    font-size: 10px;
}

/* Primary Generate Button */
.btn-generate-main {
    position: relative;
    width: 100%;
    margin-top: 4px;
    padding: 12px 18px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, #f59e0b 0%, #f43f5e 100%);
    color: #fff;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2px;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(245, 158, 11, 0.35);
    overflow: hidden;
    transition: var(--transition-normal);
}

.btn-generate-main:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(245, 158, 11, 0.45);
}

.btn-generate-main:active {
    transform: translateY(0);
}

.btn-generate-main:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-hotkey {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 4px;
}

.loader-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Script Upload Drop Zone */
.upload-drop-zone {
    border: 1.5px dashed rgba(6, 182, 212, 0.35);
    border-radius: var(--radius-md);
    background: rgba(6, 182, 212, 0.03);
    padding: 14px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.upload-drop-zone:hover, .upload-drop-zone.drag-over {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
    box-shadow: 0 0 16px rgba(6, 182, 212, 0.15);
}

.drop-zone-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-icon-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(6, 182, 212, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-cyan);
    font-size: 15px;
    flex-shrink: 0;
}

.drop-text-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upload-drop-label {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.upload-browse-link {
    color: var(--accent-cyan);
    text-decoration: underline;
    cursor: pointer;
}

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

.upload-status {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.upload-status.status-parsing {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.upload-status.status-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.upload-status.status-error {
    background: rgba(244, 63, 94, 0.12);
    color: var(--accent-rose);
    border: 1px solid rgba(244, 63, 94, 0.3);
}

.parsed-preview {
    margin-top: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.parsed-preview-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.parsed-preview-logline {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.parsed-preview-meta {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.parsed-preview-themes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}

.theme-tag {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    padding: 2px 6px;
    color: var(--text-muted);
}

.parsed-preview-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-dim);
    border-top: 1px solid var(--border-subtle);
    padding-top: 6px;
}

.clear-script-btn {
    background: none;
    border: none;
    color: var(--accent-rose);
    font-size: 11px;
    cursor: pointer;
    font-weight: 600;
}

.clear-script-btn:hover {
    text-decoration: underline;
}

/* AI Crew Mission Control */
.crew-counter-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

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

.agent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-subtle);
    transition: var(--transition-normal);
}

.agent-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 11px;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.agent-info {
    flex: 1;
    min-width: 0;
}

.agent-name-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.agent-name-row strong {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-primary);
}

.agent-phase-tag {
    font-size: 9.5px;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.04);
    border-radius: 3px;
    padding: 1px 5px;
    color: var(--text-muted);
}

.agent-info small {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agent-status-indicator {
    font-size: 13px;
    color: var(--text-dim);
}

/* Agent States */
.agent-item.idle .status-icon {
    color: var(--text-dim);
}

.agent-item.running {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.1);
}

.agent-item.running .agent-avatar {
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
}

.agent-item.running .agent-name-row strong {
    color: var(--accent-gold);
}

.agent-item.running .status-icon {
    color: var(--accent-gold);
}

.agent-item.done {
    border-color: rgba(16, 185, 129, 0.25);
    background: rgba(16, 185, 129, 0.04);
}

.agent-item.done .agent-avatar {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.agent-item.done .status-icon {
    color: var(--accent-green);
}

/* ── Main Stage ── */
.main-stage {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-content-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    gap: 14px;
}

/* Studio Tabs Bar */
.studio-tabs-bar {
    flex-shrink: 0;
}

.studio-tabs {
    display: flex;
    align-items: center;
    background: rgba(14, 17, 24, 0.8);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 4px;
    gap: 4px;
    overflow-x: auto;
}

.tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    background: var(--bg-card-elevated);
    color: #fff;
    border: 1px solid var(--border-medium);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tab-btn.active i {
    color: var(--accent-gold);
}

/* Tab Content Areas */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.25s ease-out;
}

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

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    margin: auto 0;
}

.empty-state-visual {
    position: relative;
    margin-bottom: 20px;
}

.empty-clapper-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(244, 63, 94, 0.2));
    border: 1px solid rgba(245, 158, 11, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--accent-gold);
}

.empty-clapper-glow {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, transparent 70%);
    filter: blur(12px);
    z-index: -1;
}

.empty-state h2 {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    color: #fff;
    margin-bottom: 8px;
    letter-spacing: -0.4px;
}

.empty-state p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 520px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.empty-state-hints {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.hint-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    color: var(--text-muted);
}

.hint-chip i {
    color: var(--accent-gold);
}

/* Overview / Film Bible Hero */
.overview-hero-card {
    position: relative;
    background: linear-gradient(135deg, rgba(24, 28, 42, 0.9) 0%, rgba(16, 18, 28, 0.95) 100%);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    padding: 24px 28px;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.hero-overlay-glow {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.15) 0%, transparent 70%);
    filter: blur(30px);
    pointer-events: none;
}

.hero-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.title-with-badge {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.overview-hero-card h2 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
}

.grounded-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.meta-pills {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
}

.pill-genre {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-gold);
}

.pill-audience {
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.3);
    color: var(--accent-cyan);
}

.logline-container {
    position: relative;
    padding-left: 20px;
    border-left: 2px solid var(--accent-gold);
}

.quote-mark {
    display: none;
}

.logline-text {
    font-size: 15px;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Section Headers */
.section-header-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.section-header-between {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title i {
    color: var(--accent-gold);
    font-size: 15px;
}

.section-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

/* Character Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.character-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-normal);
}

.character-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.character-card h4 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.role-tag {
    align-self: flex-start;
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.char-detail {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.char-detail strong {
    color: var(--text-secondary);
}

/* ── Screenplay (Master Final Draft) ── */
.screenplay-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}

.screenplay-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 10px 16px;
}

.script-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.script-badge {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.script-subtext {
    font-size: 12px;
    color: var(--text-muted);
}

.script-actions-right {
    display: flex;
    gap: 8px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.btn-primary-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-gold);
    border: none;
    color: #000;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-primary-action:hover {
    background: #fbbf24;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.screenplay-paper {
    background: #0d0f15;
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    box-shadow: var(--shadow-card);
    font-family: var(--font-screenplay);
}

.screenplay-content {
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 800px;
    margin: 0 auto;
}

.scene-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 24px;
}

.scene-revision-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.slugline {
    font-family: var(--font-screenplay);
    font-weight: 700;
    font-size: 15px;
    color: var(--accent-gold);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-directors-cut {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: var(--accent-rose);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-family: var(--font-sans);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-directors-cut:hover {
    background: rgba(244, 63, 94, 0.2);
    border-color: var(--accent-rose);
}

.scene-desc {
    font-family: var(--font-screenplay);
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Dialogue Blocks */
.dialogue-item {
    margin: 8px 0;
    padding-left: 20%;
    padding-right: 20%;
    text-align: center;
}

.dialogue-char {
    font-family: var(--font-screenplay);
    font-weight: 700;
    font-size: 13px;
    color: #fff;
    letter-spacing: 1px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2px;
}

.dialogue-emotion {
    font-style: italic;
    font-weight: 400;
    font-size: 11.5px;
    color: var(--text-muted);
    text-transform: none;
}

.dialogue-line {
    font-family: var(--font-screenplay);
    font-size: 13.5px;
    color: #e2e8f0;
    line-height: 1.5;
    text-align: left;
}

.btn-tts {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-gold);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 9px;
    transition: var(--transition-fast);
}

.btn-tts:hover {
    background: var(--accent-gold);
    color: #000;
    transform: scale(1.1);
}

/* Revision Input Container */
.revision-container {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--radius-md);
    border: 1px solid rgba(244, 63, 94, 0.25);
}

.revision-notes {
    flex: 1;
    font-family: var(--font-sans);
    font-size: 12.5px;
    padding: 6px 10px;
}

.btn-submit-revision {
    background: var(--accent-rose);
    border: none;
    color: #fff;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

/* ── Storyboards Grid & Cards ── */
.storyboards-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.storyboard-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-normal);
}

.storyboard-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
}

.storyboard-preview {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #090a0f;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
    cursor: zoom-in;
}

.storyboard-card:hover .sb-image {
    transform: scale(1.04);
}

.shot-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    z-index: 2;
}

.storyboard-regen-overlay {
    position: absolute;
    bottom: 10px;
    right: 10px;
    opacity: 0;
    transition: var(--transition-fast);
    z-index: 2;
}

.storyboard-card:hover .storyboard-regen-overlay {
    opacity: 1;
}

.btn-regen-img {
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-medium);
    color: #fff;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.btn-regen-img:hover {
    background: var(--accent-gold);
    color: #000;
}

.sb-loading {
    background: linear-gradient(90deg, #111420 25%, #181d30 50%, #111420 75%);
    background-size: 200% 100%;
    animation: shimmer 1.8s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.sb-loading-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--accent-gold);
    font-size: 12px;
    font-family: var(--font-mono);
}

.sb-error-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    font-size: 11px;
}

.storyboard-details {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.storyboard-details h4 {
    font-family: var(--font-heading);
    font-size: 14.5px;
    font-weight: 700;
    color: #fff;
}

.prompt-text {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

/* ── Production Design & Audio Lists ── */
.full-width-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.design-card, .audio-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-normal);
}

.design-card:hover, .audio-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-1px);
}

.design-card h4, .audio-card h4 {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.design-card h4 i {
    color: var(--accent-cyan);
}

.audio-card h4 i {
    color: var(--accent-purple);
}

.card-body-text {
    font-size: 13.5px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
}

.card-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.card-section-text {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ── Analytics & Vector Telemetry ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-soft);
}

.stat-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--accent-cyan);
    flex-shrink: 0;
}

.highlight-stat .stat-icon-circle {
    background: var(--accent-gold-dim);
    border-color: rgba(245, 158, 11, 0.3);
    color: var(--accent-gold);
}

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.stat-label {
    font-size: 11.5px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Search HUD Card */
.hud-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-card);
}

.hud-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-header h3 i {
    color: var(--accent-cyan);
}

.search-subtitle {
    font-size: 12.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

.search-bar-wrap {
    display: flex;
    gap: 10px;
}

.search-input-box {
    position: relative;
    flex: 1;
}

.search-leading-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
}

.search-input-box input {
    padding-left: 38px;
}

/* ── Continuity & Anti-Amnesia Memory Shield Styles ── */
.continuity-hud-card {
    border: 1px solid rgba(16, 185, 129, 0.3);
    background: linear-gradient(180deg, rgba(16, 26, 24, 0.6), rgba(12, 16, 22, 0.9));
}

.continuity-top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
}

.continuity-score-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: var(--radius-md);
    padding: 6px 14px;
}

.continuity-score-val {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: #34d399;
    letter-spacing: -0.5px;
}

.continuity-score-lbl {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #a7f3d0;
    font-weight: 600;
}

.continuity-shields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.shield-item {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: var(--transition-normal);
}

.shield-item:hover {
    border-color: rgba(52, 211, 153, 0.5);
    background: var(--bg-card-elevated);
    transform: translateY(-2px);
}

.shield-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #34d399;
    font-size: 15px;
    flex-shrink: 0;
}

.shield-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.shield-info strong {
    font-size: 13px;
    color: #fff;
}

.shield-info p {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.35;
}

.shield-status-tag {
    align-self: flex-start;
    margin-top: 4px;
    font-size: 10.5px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.shield-status-tag.active {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Character Trajectory Section */
.char-trajectory-section {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trajectory-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.char-trajectory-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.trajectory-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    flex-wrap: wrap;
}

.traj-char-name {
    font-weight: 700;
    font-size: 13px;
    color: #fff;
}

.traj-role-tag {
    font-size: 10.5px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    padding: 1px 6px;
    border-radius: 4px;
}

.traj-flow {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #38bdf8;
}

.traj-status {
    font-size: 11px;
    color: #34d399;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Tension Chart Card */
.chart-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-card);
}

.chart-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.chart-card-header h3 {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-card-header h3 i {
    color: var(--accent-gold);
}

.chart-tag {
    font-family: var(--font-mono);
    font-size: 10.5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
}

.chart-wrapper {
    position: relative;
    height: 260px;
    width: 100%;
}

/* ── Project Library ── */
.library-header-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 4px;
}

.library-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.library-titles h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.library-titles h2 i {
    color: var(--accent-indigo);
}

.library-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.library-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
}

.library-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.library-refresh-btn.spinning i {
    animation: fa-spin 1s linear infinite;
}

.library-empty {
    text-align: center;
    padding: 60px 20px;
}

.library-empty-icon {
    font-size: 36px;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.library-empty h3 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.library-empty p {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto;
}

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

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: var(--shadow-soft);
    transition: var(--transition-normal);
}

.project-card:hover {
    border-color: var(--border-medium);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.project-card-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-card-pill {
    font-size: 10.5px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.project-card-pill.tone {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-cyan);
    border-color: rgba(6, 182, 212, 0.2);
}

.project-card-pill.grounded {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border-color: rgba(16, 185, 129, 0.2);
}

.project-card-premise {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-date {
    font-size: 11px;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}

.project-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.project-load-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--accent-gold-dim);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--accent-gold);
    padding: 6px 12px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition-fast);
}

.project-load-btn:hover {
    background: var(--accent-gold);
    color: #000;
}

.project-delete-btn {
    background: rgba(244, 63, 94, 0.1);
    border: 1px solid rgba(244, 63, 94, 0.25);
    color: var(--accent-rose);
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.project-delete-btn:hover {
    background: var(--accent-rose);
    color: #fff;
}

/* ── Lightbox & Modals ── */
.lightbox-overlay, .confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 6, 10, 0.85);
    backdrop-filter: blur(16px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease-out;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-medium);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
}

.lightbox-caption {
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    max-width: 600px;
}

.lightbox-close-btn {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.confirm-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-card);
}

.confirm-modal-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(244, 63, 94, 0.15);
    color: var(--accent-rose);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.confirm-modal-title {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    color: #fff;
}

.confirm-modal-body {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
}

.confirm-modal-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-top: 8px;
}

.confirm-cancel-btn {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
}

.confirm-delete-btn {
    flex: 1;
    padding: 8px;
    border-radius: var(--radius-md);
    background: var(--accent-rose);
    border: none;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

/* Toast Notifications */
.save-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(18, 21, 30, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: var(--transition-normal);
}

.save-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast-icon-circle {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-green);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

/* ── Utility Classes ── */
.hidden {
    display: none !important;
}

/* ══════════════════════════════════════════════════════════════════════
   ClickHouse Vector Vault & MCP Inspector Styles (High Contrast & Clean)
   ══════════════════════════════════════════════════════════════════════ */
.ch-header-card {
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: linear-gradient(180deg, rgba(20, 24, 36, 0.95), rgba(14, 17, 26, 0.95));
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.ch-vault-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.ch-vault-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ch-glow-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(245, 158, 11, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    font-size: 20px;
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
    flex-shrink: 0;
}

.ch-main-title {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
}

.ch-main-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.ch-main-subtitle code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
}

.ch-vault-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ch-live-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 700;
    color: #34d399;
}

.ch-refresh-hud-btn {
    padding: 7px 14px;
    font-size: 12.5px;
}

.ch-host-val {
    font-size: 14px !important;
    color: #38bdf8 !important;
    font-family: var(--font-mono) !important;
    word-break: break-all;
}

.ch-mcp-val {
    font-size: 15px !important;
    color: var(--accent-gold) !important;
}

.ch-tools-val {
    font-size: 15px !important;
    color: #a78bfa !important;
}

/* 8 Tables Catalog */
.ch-catalog-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ch-catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}

.ch-engine-badge {
    font-size: 11.5px;
    font-family: var(--font-mono);
    padding: 4px 10px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-full);
    color: var(--accent-gold);
}

.ch-tables-flex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.ch-table-row-card {
    background: var(--bg-card);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: var(--transition-normal);
}

.ch-table-row-card:hover {
    background: var(--bg-card-elevated);
    border-color: rgba(245, 158, 11, 0.4);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.ch-vector-row-card {
    border-color: rgba(99, 102, 241, 0.35);
    background: rgba(99, 102, 241, 0.04);
}

.ch-tbl-icon-col {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-gold);
    font-size: 14px;
    flex-shrink: 0;
}

.ch-vector-row-card .ch-tbl-icon-col {
    color: #818cf8;
    background: rgba(99, 102, 241, 0.12);
}

.ch-tbl-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.ch-tbl-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ch-tbl-name {
    font-family: var(--font-mono);
    font-size: 13.5px;
    font-weight: 700;
    color: #fff;
}

.ch-vector-tag {
    font-size: 10px;
    font-family: var(--font-mono);
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: #c7d2fe;
    padding: 1px 6px;
    border-radius: 4px;
}

.ch-tbl-rows-badge {
    font-size: 11px;
    font-family: var(--font-mono);
    background: rgba(6, 182, 212, 0.12);
    color: var(--accent-cyan);
    padding: 1px 7px;
    border-radius: var(--radius-sm);
}

.ch-tbl-summary {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.35;
}

.ch-quick-sql-btn {
    align-self: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 9px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: var(--transition-fast);
}

.ch-quick-sql-btn:hover {
    background: var(--accent-gold-dim);
    color: var(--accent-gold);
    border-color: var(--accent-gold);
}

/* Split Studio Layout */
.ch-split-studio {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 16px;
}

@media (max-width: 1150px) {
    .ch-split-studio {
        grid-template-columns: 1fr;
    }
}

.ch-sql-console-hud,
.ch-vector-hud {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Query Presets */
.ch-query-presets-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ch-query-presets-wrap .preset-label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--accent-gold);
    display: flex;
    align-items: center;
    gap: 5px;
}

.ch-presets-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ch-preset-chip {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

.ch-preset-chip:hover {
    background: rgba(6, 182, 212, 0.12);
    color: #67e8f9;
    border-color: var(--accent-cyan);
}

/* SQL Editor & Console */
.ch-sql-editor-container textarea {
    width: 100%;
    background: #090b10;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    color: #67e8f9;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.55;
    resize: vertical;
    outline: none;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.ch-sql-editor-container textarea:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2), inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.ch-console-action-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ch-exec-query-btn {
    padding: 8px 18px;
    font-size: 13px;
}

.ch-exec-time-pill {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    padding: 3px 10px;
    border-radius: var(--radius-full);
}

.ch-output-box {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.ch-output-top-bar {
    background: rgba(255, 255, 255, 0.03);
    padding: 6px 12px;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-subtle);
}

.ch-terminal-output {
    background: #06080d;
    padding: 14px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: #cbd5e1;
    max-height: 240px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    line-height: 1.5;
}

/* Vector Search in HUD */
.ch-vec-search-bar {
    display: flex;
    gap: 8px;
}

.ch-vec-results-scroll {
    min-height: 260px;
    max-height: 400px;
    overflow-y: auto;
}

.ch-vec-placeholder {
    height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 8px;
    color: var(--text-muted);
    padding: 20px;
}

.ch-vec-placeholder i {
    font-size: 32px;
    color: #6366f1;
    opacity: 0.6;
    margin-bottom: 4px;
}

.ch-vec-placeholder h4 {
    font-size: 14px;
    color: var(--text-secondary);
}

.ch-vec-placeholder p {
    font-size: 12px;
    max-width: 280px;
    line-height: 1.4;
}

.ch-vec-card {
    background: var(--bg-card);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: var(--transition-fast);
}

.ch-vec-card:hover {
    border-color: #818cf8;
    background: var(--bg-card-elevated);
}

.ch-vec-card-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ch-vec-rank {
    font-weight: 700;
    color: var(--accent-gold);
    font-family: var(--font-mono);
    font-size: 12px;
}

.ch-vec-dist {
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 11.5px;
}

.ch-vec-act {
    margin-left: auto;
    font-size: 10.5px;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--text-secondary);
}

.ch-vec-card h4 {
    font-size: 13.5px;
    color: #fff;
    margin-top: 2px;
}

.ch-vec-card p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.ch-loading-msg,
.ch-empty-vec {
    padding: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ── Media Queries ── */
@media (max-width: 1100px) {
    .workspace {
        grid-template-columns: 320px 1fr;
        padding: 12px;
        gap: 12px;
    }
    .system-telemetry-bar {
        display: none;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-container {
        height: auto;
        overflow: auto;
    }
    .workspace {
        grid-template-columns: 1fr;
        overflow: visible;
    }
    .screenplay-paper {
        padding: 20px 16px;
    }
    .dialogue-item {
        padding-left: 5%;
        padding-right: 5%;
    }
}
