/* ── RESET & BASE ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #ffffff;
    color: #1a1a2e;
    height: 100vh;
}

.dashboard {
    width: 100%;
    height: 100vh;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ── HEADER ── */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 32px;
    flex-shrink: 0;
    background: #0a0a14;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: -0.3px;
}

.logo .trident-icon {
    color: #fbbf24;
    font-size: 22px;
}

.logo .brand-trident {
    color: #b22234;
    font-size: 20px;
    font-weight: 700;
}

.logo .brand-flow {
    color: #ffffff;
    font-size: 20px;
    font-weight: 400;
}

.logo .brand-ai {
    background: #fbbf24;
    color: #0a0a14;
    font-weight: 700;
    font-size: 13px;
    padding: 2px 10px;
    border-radius: 40px;
    letter-spacing: 0.3px;
    margin-left: 4px;
    border: none;
    line-height: 1.4;
}

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

.header-actions .launchpad-btn {
    background: transparent;
    border: 1px solid #fbbf2444;
    color: #fbbf24;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.header-actions .launchpad-btn:hover {
    background: #fbbf2418;
    border-color: #fbbf24;
}

.header-actions #myProjectsBtn {
    background: transparent;
    border: 1px solid #ffffff44;
    color: #ffffff;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.header-actions #myProjectsBtn:hover {
    background: #ffffff18;
    border-color: #ffffff;
}

.header-actions .launchpad-btn.ready {
    background: #10b981;
    border-color: #059669;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.5);
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
    50% { box-shadow: 0 0 25px rgba(16, 185, 129, 0.8); }
    100% { box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #cbd5e1;
    border-top: 4px solid #fbbf24;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

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

.header-actions .profile {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid #ffffff66;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #ffffff;
    cursor: pointer;
    transition: 0.2s;
}

.profile-menu {
    position: relative;
}

.profile-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    padding: 12px;
    min-width: 200px;
    z-index: 50;
}

.profile-email {
    font-size: 12px;
    color: #64748b;
    padding: 4px 8px 10px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 8px;
    word-break: break-all;
}

.profile-logout-btn {
    width: 100%;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.profile-logout-btn:hover {
    background: #e2e8f0;
}

.header-actions .profile:hover {
    background: #ffffff18;
    border-color: #ffffff;
}

/* ── PROGRESS BAR ── */
.progress-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 32px;
    background: #ffffff;
    border-bottom: 1px solid #d0d0d0;
    flex-shrink: 0;
    font-size: 13px;
    color: #64748b;
}

.progress-bar .steps {
    display: flex;
    gap: 6px;
    margin-left: auto;
}

.progress-bar .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d0d0d0;
    transition: 0.3s;
}

.progress-bar .dot.active {
    background: #fbbf24;
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.3);
}

.progress-bar .dot.done {
    background: #fbbf24;
}

.progress-label {
    font-weight: 500;
    color: #1a1a2e;
}

.progress-percent {
    color: #94a3b8;
    font-size: 12px;
}

/* ── SPLIT VIEW ── */
.split {
    display: flex;
    flex: 1;
    min-height: 0;
}

/* ── LEFT: CHAT ── */
.chat-panel {
    width: 50%;
    border-right: 1px solid #d0d0d0;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    padding: 20px 28px;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.chat-header .ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #0a0a14;
    font-weight: 700;
}

.chat-header .ai-name {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a2e;
}

.chat-header .ai-badge {
    font-size: 11px;
    background: #e8e8e8;
    color: #64748b;
    padding: 2px 10px;
    border-radius: 40px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-right: 8px;
    margin-bottom: 16px;
}

.chat-messages .msg {
    max-width: 88%;
    padding: 12px 18px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    animation: fadeUp 0.3s ease;
    border: 2px solid #b0b0b0;
}

.chat-messages .msg.ai {
    background: #e5e7eb;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    color: #1a1a2e;
    border-color: #b0b0b0;
}

.chat-messages .msg.user {
    background: #1E293B;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    color: #ffffff;
    border-color: #0f172a;
}

.chat-messages .msg .timestamp {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 6px;
    display: block;
}

.chat-messages .msg.user .timestamp {
    color: #94a3b8;
}

.chat-input-area {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    border-top: 1px solid #d0d0d0;
    padding-top: 16px;
}

.chat-input-area textarea {
    flex: 1;
    background: #e5e7eb;
    border: 2px solid #b0b0b0;
    border-radius: 12px;
    padding: 12px 16px;
    color: #1a1a2e;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 48px;
    max-height: 120px;
    line-height: 1.5;
    transition: 0.2s;
}

.chat-input-area textarea:focus {
    outline: none;
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px #fbbf2418;
    background: #ffffff;
}

.chat-input-area .send-btn {
    background: #fbbf24;
    border: none;
    color: #0a0a14;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid #d0a020;
}

.chat-input-area .send-btn:hover {
    background: #fcd34d;
}

.chat-input-area .upload-btn {
    background: #e5e7eb;
    border: 2px solid #b0b0b0;
    color: #1a1a2e;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.chat-input-area .upload-btn:hover {
    background: #d1d5db;
    border-color: #fbbf24;
    color: #fbbf24;
}

/* ── RIGHT: WORKSPACE ── */
.workspace-panel {
    width: 50%;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

.workspace-preview {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    scrollbar-width: thin;
    scrollbar-color: #c0c0c0 #f1f1f4;
}

/* Custom scrollbar for Chrome/Safari */
.workspace-preview::-webkit-scrollbar {
    width: 6px;
}

.workspace-preview::-webkit-scrollbar-track {
    background: #f1f1f4;
    border-radius: 8px;
}

.workspace-preview::-webkit-scrollbar-thumb {
    background: #c0c0c0;
    border-radius: 8px;
}

.workspace-preview::-webkit-scrollbar-thumb:hover {
    background: #a0a0a0;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.step-header .step-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    flex-shrink: 0;
}

.step-header .step-label {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a2e;
}

.asset-card {
    background: #fafafa;
    border: 2px solid #c0c0c0;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: 0.2s;
}

.asset-card .title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a2e;
}

.asset-card .subtitle {
    font-size: 14px;
    color: #64748b;
}

.asset-card .cover-mock {
    width: 100%;
    max-width: 200px;
    aspect-ratio: 1 / 1.4;
    background: #f1f1f4;
    border-radius: 12px;
    border: 2px dashed #b0b0b0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    color: #94a3b8;
    flex-shrink: 0;
    cursor: pointer;
    transition: 0.2s;
}

.asset-card .cover-mock:hover {
    border-color: #fbbf24;
    background: #fef9e7;
}

.asset-card .actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
    position: sticky;
    bottom: -24px; /* offset asset-card padding */
    background: #fafafa;
    padding: 16px 0;
    z-index: 10;
    border-top: 1px solid #e2e8f0;
}

.asset-card .actions .btn {
    background: transparent;
    border: 2px solid #c0c0c0;
    color: #1a1a2e;
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.asset-card .actions .btn:hover {
    background: #f1f1f4;
    border-color: #a0a0a0;
}

.asset-card .actions .btn.edit {
    border-color: #c0c0c0;
    color: #1a1a2e;
}

.asset-card .actions .btn.edit:hover {
    background: #f1f1f4;
    border-color: #a0a0a0;
}

.asset-card .actions .btn.save {
    border-color: #c0c0c0;
    color: #1a1a2e;
}

.asset-card .actions .btn.save:hover {
    background: #f1f1f4;
    border-color: #a0a0a0;
}

.asset-card .actions .btn.primary {
    background: #22c55e;
    border-color: #16a34a;
    color: #ffffff;
    font-weight: 600;
}

.asset-card .actions .btn.primary:hover {
    background: #16a34a;
    border-color: #15803d;
}

.co-pilot-nudge {
    margin-top: 10px;
    padding: 12px 16px;
    background: #fef9e7;
    border-left: 4px solid #fbbf24;
    border-radius: 8px;
    font-size: 13px;
    color: #1a1a2e;
    line-height: 1.5;
}

.co-pilot-nudge strong {
    color: #b22234;
}

.co-pilot-nudge .example {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #94a3b8;
}

.cover-note {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

.status-tags {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.status-tags .tag {
    font-size: 12px;
    color: #64748b;
    background: #f1f1f4;
    padding: 4px 12px;
    border-radius: 40px;
    border: 2px solid #c0c0c0;
}

.status-tags .tag.gold {
    color: #fbbf24;
    background: #fef9e7;
    border-color: #fbbf24;
}

/* ── ASSET VAULT ── */
.asset-vault {
    border-top: 2px solid #c0c0c0;
    background: #fafafa;
    flex-shrink: 0;
    max-height: 200px;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.asset-vault.collapsed {
    max-height: 48px;
}

.vault-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vault-header .vault-icon {
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
}

.vault-header .vault-label {
    font-weight: 600;
    font-size: 15px;
    color: #1a1a2e;
}

.vault-header .vault-count {
    font-weight: 400;
    font-size: 15px;
    color: #64748b;
}

.asset-vault .vault-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 28px;
    cursor: pointer;
    transition: 0.2s;
    border-bottom: 1px solid transparent;
}

.asset-vault .vault-toggle:hover {
    background: #f1f1f4;
}

.asset-vault .vault-toggle .arrow {
    transition: 0.3s;
    font-size: 12px;
    color: #fbbf24;
}

.asset-vault .vault-toggle .arrow.open {
    transform: rotate(180deg);
}

.asset-vault .vault-content {
    padding: 16px 28px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    max-height: 140px;
}

.asset-vault .vault-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #ffffff;
    border-radius: 10px;
    border: 2px solid #c0c0c0;
    font-size: 13px;
}

.asset-vault .vault-item .name {
    color: #1a1a2e;
    display: flex;
    align-items: center;
    gap: 10px;
}

.asset-vault .vault-item .name .icon {
    font-size: 16px;
}

.asset-vault .vault-item .actions {
    display: flex;
    gap: 8px;
}

.asset-vault .vault-item .actions .vbtn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: 0.2s;
}

.asset-vault .vault-item .actions .vbtn:hover {
    color: #1a1a2e;
    background: #f1f1f4;
}

.asset-vault .vault-item .actions .vbtn.download {
    color: #22c55e;
}

.asset-vault .vault-item .actions .vbtn.download:hover {
    background: #22c55e10;
}

.asset-vault .vault-item .actions .vbtn.sync {
    color: #b22234;  /* Changed from gold to Marine Red */
}

.asset-vault .vault-item .actions .vbtn.sync:hover {
    background: #b2223410;  /* Very light red tint on hover */
}

.asset-vault .vault-item .actions .vbtn.copy {
    color: #64748b;
}

.asset-vault .vault-item .actions .vbtn.copy:hover {
    background: #f1f1f4;
}

.asset-vault .vault-item.highlight {
    border-color: #fbbf24;
    background: #fef9e7;
}

.asset-vault .vault-footer {
    font-size: 12px;
    color: #94a3b8;
    padding: 8px 0 4px 0;
    text-align: center;
    border-top: 2px solid #c0c0c0;
    margin-top: 4px;
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.asset-vault .vault-footer span {
    cursor: default;
    transition: 0.2s;
}

.asset-vault .vault-footer .gold {
    color: #fbbf24;
}

/* ── ASSET VAULT: SYNC TO DRIVE (MARINE RED) ── */
.vault-footer .sync-red {
    color: #b22234;  /* Marine Red */
    cursor: default;
    transition: 0.2s;
}

.vault-footer .sync-red:hover {
    opacity: 0.7;
}

/* ── ASSET VAULT: COPY ALL (BLACK) ── */
.vault-footer .copy-black {
    color: #1a1a2e;  /* Clean black, matching other text */
    cursor: default;
    transition: 0.2s;
}

.vault-footer .copy-black:hover {
    opacity: 0.7;
}

.asset-vault .vault-footer .green {
    color: #22c55e;
}

.asset-vault .vault-footer span:hover {
    opacity: 0.7;
}

@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

::-webkit-scrollbar {
    width: 5px;
}
::-webkit-scrollbar-track {
    background: #f1f1f4;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 40px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (max-width: 820px) {
    .split {
        flex-direction: column;
    }
    .chat-panel,
    .workspace-panel {
        width: 100%;
    }
    .chat-panel {
        border-right: none;
        border-bottom: 1px solid #d0d0d0;
        max-height: 50vh;
    }
    .workspace-panel {
        max-height: 50vh;
    }
    .logo .brand-ai {
        font-size: 11px;
        padding: 1px 8px;
    }
    .header {
        padding: 12px 16px;
    }
    .progress-bar {
        padding: 8px 16px;
        flex-wrap: wrap;
    }
    .chat-panel {
        padding: 16px;
    }
    .workspace-preview {
        padding: 16px;
    }
    .asset-vault .vault-item {
        flex-wrap: wrap;
        gap: 8px;
    }
    .asset-vault .vault-item .actions {
        flex-wrap: wrap;
    }
}

/* ── LAUNCHPAD MODAL ── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(10, 10, 20, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #ffffff;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    padding: 32px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    top: 16px; right: 16px;
    background: none; border: none;
    font-size: 24px; color: #64748b;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #0f172a;
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 8px;
}

.modal-subtitle {
    color: #64748b;
    font-size: 14px;
    margin-bottom: 24px;
}

.deploy-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.deploy-card {
    display: flex;
    gap: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fafafa;
    transition: transform 0.2s, box-shadow 0.2s;
}

.deploy-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.deploy-card.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.deploy-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

.card-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.card-body h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.card-body .badge {
    background: #fbbf24;
    color: #0a0a14;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.embed-code-box {
    display: flex;
    gap: 8px;
}

.embed-code-box input {
    flex-grow: 1;
    padding: 8px 12px;
    font-family: monospace;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    background: #f1f5f9;
    color: #334155;
}

.embed-code-box .btn.copy {
    background: #e2e8f0;
    color: #0f172a;
    border: none;
    padding: 0 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}

.embed-code-box .btn.copy:hover {
    background: #cbd5e1;
}

/* ── LEAD CRM ── */
.lead-crm {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 24px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    overflow: hidden;
}

.crm-header {
    background: #f8fafc;
    padding: 16px 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.crm-icon {
    font-size: 24px;
}

.crm-title-box h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 2px;
}

.lead-count {
    font-size: 13px;
    font-weight: 600;
    color: #b22234;
}

.crm-body {
    padding: 24px;
}

.crm-body p {
    font-size: 13px;
    color: #64748b;
    margin-bottom: 16px;
}

.lead-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.lead-form input {
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.lead-form input:focus {
    border-color: #fbbf24;
}

.lead-form .btn {
    align-self: flex-start;
    padding: 10px 24px;
    font-size: 14px;
}

/* ── AUTH GATE ── */
.auth-gate {
    z-index: 2000; /* above every other modal — this one can't be dismissed */
}

.auth-gate-content {
    max-width: 380px;
    text-align: center;
}

.auth-gate-logo {
    justify-content: center;
    margin-bottom: 24px;
}

.auth-gate-logo .brand-flow {
    color: #0f172a; /* the header's white brand-flow text is invisible on this modal's white background */
}

.auth-gate-tabs {
    justify-content: center;
    margin-bottom: 20px;
}

.auth-gate-form {
    text-align: left;
}

.auth-gate-form .btn {
    align-self: stretch;
    text-align: center;
    margin-top: 4px;
}

.auth-gate-error {
    background: #fef2f2;
    color: #b91c1c;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #fecaca;
}

.auth-gate-note {
    margin-top: 20px;
    font-size: 12px;
    color: #94a3b8;
}

/* ── MY PROJECTS ── */
.projects-modal-content {
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.projects-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.projects-empty .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fafafa;
    transition: transform 0.15s, box-shadow 0.15s;
}

.project-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.project-card-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.project-card-body {
    flex: 1;
    min-width: 0;
}

.project-card-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card-meta {
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 8px;
    align-items: center;
}

.project-card-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.project-card-actions .btn {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.15s, border-color 0.15s;
}

/* Most .btn elements elsewhere in the app render unstyled beyond padding/sizing —
   there's no global .btn.primary/.btn.secondary rule anywhere in this file (confirmed
   by search), each usage is styled per-container. Defining colors explicitly here
   rather than assuming a shared base exists to inherit from. */
.project-card-actions .btn.primary {
    background: #3b82f6;
    border: 1px solid #2563eb;
    color: #ffffff;
}

.project-card-actions .btn.primary:hover {
    background: #2563eb;
}

.project-card-delete {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.project-card-delete:hover {
    color: #dc2626;
    background: #fef2f2;
}

.project-card-actions .btn.secondary {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #334155;
}

.project-card-actions .btn.secondary:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* ── PROJECT LEADS ── */
.leads-modal-content {
    max-width: 560px;
    max-height: 80vh;
    overflow-y: auto;
}

.leads-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leads-empty {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.leads-empty .empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

.lead-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fafafa;
}

.lead-row-body {
    min-width: 0;
}

.lead-row-email {
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lead-row-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
}

.lead-row-delete {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
}

.lead-row-delete:hover {
    color: #dc2626;
    background: #fef2f2;
}

.chat-messages .msg p { margin: 0 0 10px 0; }
.chat-messages .msg p:last-child { margin: 0; }
.chat-messages .msg ul { margin: 0 0 10px 20px; padding: 0; }
.chat-messages .msg li { margin-bottom: 4px; }
.chat-messages .msg strong { font-weight: 600; color: inherit; }

.new-chat-btn {
    margin-left: auto;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    color: #475569;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}
.new-chat-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* LaunchPad States */
.launchpad-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    margin-bottom: 20px;
}
.launchpad-state .state-icon {
    font-size: 32px;
    margin-bottom: 12px;
}
.launchpad-state .state-title {
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 8px;
}
.launchpad-state .state-desc {
    font-size: 14px;
    color: #64748b;
}
.state-message {
    padding: 12px;
    background: #f1f5f9;
    border-radius: 8px;
    font-size: 14px;
    color: #334155;
    margin: 16px 0;
    text-align: center;
}
.hidden {
    display: none !important;
}

/* Post-Generation Workflow UI */
.post-gen-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
    width: 100%;
}

/* Editor Modal */
.editor-content {
    max-width: 800px;
    width: 90%;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

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

.editor-controls {
    display: flex;
    align-items: center;
    gap: 16px;
}

.asset-select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-size: 14px;
    outline: none;
    background: #f8fafc;
    color: #1e293b;
    cursor: pointer;
}

.editor-body {
    flex: 1;
    display: flex;
    min-height: 0; /* Important for flex child to allow scrolling */
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 16px;
}

.editor-body textarea {
    width: 100%;
    height: 100%;
    border: none;
    padding: 16px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    background: #f8fafc;
    resize: none;
    outline: none;
}

.asset-preview {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* ── COVER EDITOR PANEL ── */
.cover-editor-panel {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    background: #f8fafc;
    overflow-y: auto;
}

.cover-editor-panel img {
    max-width: 320px;
    max-height: 320px;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.cover-editor-status {
    font-size: 13px;
    color: #64748b;
    min-height: 18px;
    text-align: center;
}

.cover-editor-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.cover-editor-actions .btn {
    font-size: 13px;
    padding: 8px 14px;
}

.editor-tabs {
    display: flex;
    gap: 8px;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
}

.editor-tab {
    padding: 6px 12px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-tab.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.editor-footer {
    display: flex;
    justify-content: flex-end;
}

/* ── LOADING SPINNER ── */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 16px auto;
}

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

/* ── STEP PROGRESS TRACKER (State 5 sub-steps) ── */
.step-progress-tracker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 16px 0;
    padding: 0 8px;
}

.step-progress-tracker .step-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #94a3b8;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.step-progress-tracker .step-item.active {
    color: #3b82f6;
    font-weight: 700;
}

.step-progress-tracker .step-item.complete {
    color: #22c55e;
}

.step-progress-tracker .step-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    background: #e2e8f0;
    color: #64748b;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.step-progress-tracker .step-item.active .step-dot {
    background: #3b82f6;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.step-progress-tracker .step-item.complete .step-dot {
    background: #22c55e;
    color: #fff;
}

.step-progress-tracker .step-connector {
    width: 16px;
    height: 2px;
    background: #e2e8f0;
    flex-shrink: 0;
}

.step-progress-tracker .step-item.complete + .step-connector {
    background: #22c55e;
}

/* ── SUB-STEP ACTION BUTTONS ── */
.substep-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.substep-actions .btn {
    flex: 1;
    min-width: 100px;
    font-size: 12px;
    padding: 8px 12px;
}

/* ── PREVIEW PANEL IN STATE 5 ── */
.step-preview-panel {
    position: relative;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    margin: 12px 0;
    background: #f8fafc;
    min-height: 120px;
    max-height: 200px;
}

.step-preview-panel iframe {
    width: 100%;
    height: 200px;
    border: none;
    transform: scale(0.5);
    transform-origin: top left;
    width: 200%;
    height: 400px;
}

.step-preview-panel img {
    max-width: 100%;
    max-height: 180px;
    display: block;
    margin: 8px auto;
    border-radius: 8px;
}

.expand-preview-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 4px 10px;
    font-size: 11px;
    line-height: 1.4;
    z-index: 10;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Expanded (full-width) preview overlay */
.step-preview-panel.expanded {
    position: fixed;
    inset: 32px;
    z-index: 2000;
    max-height: none;
    min-height: 0;
    background: #fff;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.step-preview-panel.expanded iframe {
    width: 100%;
    height: 100%;
    transform: none;
}

.step-preview-panel.expanded img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    margin: auto;
    position: absolute;
    inset: 0;
}

.preview-panel-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 1999;
}
