:root {
    --bg-color: #0d0f14;
    --sidebar-bg: #13161c;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --card-bg: rgba(255, 255, 255, 0.03);
    --card-border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(19, 22, 28, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --grad-1: linear-gradient(135deg, #6366f1, #a855f7);
    --grad-2: linear-gradient(135deg, #10b981, #3b82f6);
    --grad-3: linear-gradient(135deg, #f59e0b, #ef4444);
    --grad-4: linear-gradient(135deg, #ec4899, #8b5cf6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    overflow: hidden;
    height: 100vh;
}

/* Base Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 48px;
}

.logo i {
    color: var(--accent);
    font-size: 28px;
    background: var(--grad-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background-color: rgba(99, 102, 241, 0.15);
    color: var(--accent);
    position: relative;
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: var(--accent);
    border-radius: 0 4px 4px 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--card-border);
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--grad-1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-weight: 600;
    font-size: 14px;
}

.user-info .plan {
    font-size: 12px;
    color: var(--text-muted);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    padding: 6px;
    margin-left: auto;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    color: var(--text-main);
    background-color: rgba(255, 255, 255, 0.05);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 32px 48px;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(99, 102, 241, 0.1), transparent 40%),
                radial-gradient(circle at bottom left, rgba(168, 85, 247, 0.05), transparent 40%);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 48px;
}

.top-bar h1 {
    font-size: 32px;
    font-weight: 600;
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 10px 20px;
    width: 350px;
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 12px;
}

.search-bar input {
    background: none;
    border: none;
    color: var(--text-main);
    width: 100%;
    outline: none;
    font-size: 14px;
}

/* Workflows Grid */
.workflows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.workflow-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.workflow-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.workflow-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.15);
}

.workflow-card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 20px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.gradient-1 { background: var(--grad-1); }
.gradient-2 { background: var(--grad-2); }
.gradient-3 { background: var(--grad-3); }
.gradient-4 { background: var(--grad-4); }

.workflow-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.workflow-card p {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 24px;
    min-height: 42px;
}

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

.time {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.run-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-main);
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    z-index: 1;
    position: relative;
}

.run-btn i {
    font-size: 12px;
}

.run-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

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

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    width: 100%;
    max-width: 600px;
    padding: 40px;
    position: relative;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

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

.close-modal {
    position: absolute;
    top: 24px;
    right: 24px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-main);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.modal-header h2 {
    font-size: 24px;
    font-weight: 600;
}

/* Execution Steps */
.execution-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.execution-steps::before {
    content: '';
    position: absolute;
    left: 14px;
    top: 20px;
    bottom: 20px;
    width: 2px;
    background: var(--card-border);
    z-index: 0;
}

.step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    position: relative;
    z-index: 1;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 1;
}

.step-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--sidebar-bg);
    border: 2px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.3s ease;
}

.step.active .step-icon {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.step.completed .step-icon {
    border-color: #10b981;
    background: #10b981;
    color: white;
}

.step-content {
    flex: 1;
    padding-top: 4px;
}

.step-title {
    font-weight: 500;
    font-size: 16px;
    margin-bottom: 4px;
}

.step-desc {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.4;
}

.step-model {
    display: inline-block;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    margin-top: 8px;
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Result Screen */
.execution-result {
    text-align: center;
    padding: 20px 0;
    animation: fadeIn 0.5s ease;
}

.execution-result.hidden {
    display: none;
}

.success-icon {
    font-size: 64px;
    color: #10b981;
    margin-bottom: 20px;
}

.execution-result h3 {
    font-size: 24px;
    margin-bottom: 8px;
}

.execution-result p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.view-result-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.view-result-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

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

.logout-form {
    margin-left: auto;
}

.logout-form .logout-btn {
    margin-left: 0;
}

body.modal-open {
    overflow: hidden;
}

.upgrade-nav-item {
    width: 100%;
    margin-top: auto;
    border: 1px solid rgba(139, 92, 246, 0.38);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(168, 85, 247, 0.12));
    color: #ddd6fe;
    cursor: pointer;
    font-size: 15px;
    text-align: left;
}

.upgrade-nav-item:hover {
    color: white;
    border-color: rgba(167, 139, 250, 0.75);
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.18);
    transform: translateY(-1px);
}

.upgrade-nav-item i {
    color: #c4b5fd;
}

.upgrade-pill {
    margin-left: auto;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.upgrade-modal {
    padding: 24px;
    overflow-y: auto;
    align-items: flex-start;
}

.upgrade-modal-content {
    width: min(1180px, 100%);
    margin: auto;
    padding: 36px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    background:
        radial-gradient(circle at 15% 0%, rgba(99, 102, 241, 0.22), transparent 30%),
        radial-gradient(circle at 90% 10%, rgba(168, 85, 247, 0.14), transparent 24%),
        rgba(13, 15, 20, 0.97);
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.65);
    position: relative;
    transform: translateY(24px) scale(0.98);
    transition: transform 0.28s ease;
}

.upgrade-modal.active .upgrade-modal-content {
    transform: translateY(0) scale(1);
}

.upgrade-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    padding-right: 44px;
    margin-bottom: 26px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    color: #c4b5fd;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.upgrade-heading h2 {
    max-width: 690px;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.upgrade-heading p {
    max-width: 680px;
    margin-top: 12px;
    color: var(--text-muted);
    line-height: 1.55;
}

.current-plan-summary {
    min-width: 165px;
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.current-plan-summary span,
.current-plan-summary small {
    color: var(--text-muted);
    font-size: 12px;
}

.current-plan-summary strong {
    font-size: 20px;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.plan-card {
    min-width: 0;
    min-height: 505px;
    padding: 22px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.035);
    position: relative;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.plan-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.2);
}

.plan-card.featured {
    border-color: rgba(139, 92, 246, 0.65);
    background: linear-gradient(180deg, rgba(124, 58, 237, 0.14), rgba(255, 255, 255, 0.035));
    box-shadow: 0 18px 50px rgba(76, 29, 149, 0.22);
}

.plan-card.current {
    box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.58);
}

.popular-badge {
    position: absolute;
    top: -11px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: white;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.35);
}

.plan-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    min-height: 82px;
}

.plan-card-head h3 {
    font-size: 22px;
    margin-bottom: 7px;
}

.plan-card-head p {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
}

.current-badge {
    flex: 0 0 auto;
    padding: 4px 8px;
    border: 1px solid rgba(52, 211, 153, 0.34);
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.plan-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 22px;
}

.plan-price strong {
    font-size: 38px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.plan-price span,
.razorpay-price {
    color: var(--text-muted);
    font-size: 12px;
}

.razorpay-price {
    margin-top: 8px;
}

.plan-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px 0;
    color: #d1d5db;
    font-size: 13px;
    line-height: 1.4;
}

.plan-features li {
    display: flex;
    gap: 9px;
    align-items: flex-start;
}

.plan-features i {
    margin-top: 2px;
    color: #8b5cf6;
}

.payment-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.razorpay-pay-btn,
.plan-disabled-btn {
    width: 100%;
    min-height: 42px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
}

.razorpay-pay-btn {
    border: 1px solid rgba(99, 102, 241, 0.55);
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.razorpay-pay-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(99, 102, 241, 0.3);
}

.razorpay-pay-btn:disabled,
.plan-disabled-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.plan-disabled-btn {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
}

.paypal-button-slot {
    min-height: 42px;
    overflow: hidden;
    border-radius: 9px;
}

.paypal-loading {
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 9px;
    color: var(--text-muted);
    font-size: 12px;
}

.payment-message {
    display: none;
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13px;
}

.payment-message.visible {
    display: block;
}

.payment-message.success {
    border: 1px solid rgba(52, 211, 153, 0.3);
    background: rgba(16, 185, 129, 0.12);
    color: #a7f3d0;
}

.payment-message.error {
    border: 1px solid rgba(248, 113, 113, 0.3);
    background: rgba(239, 68, 68, 0.12);
    color: #fecaca;
}

.payment-message.neutral {
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(148, 163, 184, 0.08);
    color: #cbd5e1;
}

.payment-disclaimer {
    margin-top: 18px;
    color: #6b7280;
    font-size: 11px;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 1080px) {
    .plans-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .plan-card {
        min-height: 470px;
    }
}

@media (max-width: 760px) {
    body {
        overflow: auto;
        height: auto;
    }

    .app-container {
        min-height: 100vh;
        height: auto;
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        padding: 18px;
    }

    .logo {
        margin-bottom: 18px;
    }

    .nav-menu {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .upgrade-nav-item {
        margin-top: 0;
    }

    .user-profile {
        margin-top: 18px;
    }

    .main-content {
        padding: 28px 18px;
    }

    .top-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
        margin-bottom: 28px;
    }

    .search-bar {
        width: 100%;
    }

    .upgrade-modal {
        padding: 10px;
    }

    .upgrade-modal-content {
        padding: 26px 16px 18px;
        border-radius: 20px;
    }

    .upgrade-heading {
        flex-direction: column;
        padding-right: 32px;
    }

    .current-plan-summary {
        width: 100%;
    }

    .plans-grid {
        grid-template-columns: 1fr;
    }

    .plan-card {
        min-height: auto;
    }
}

/* Outcome workspace navigation and views */
.sidebar {
    width: 268px;
    min-width: 268px;
    padding: 20px;
    transition: width 0.24s ease, min-width 0.24s ease, padding 0.24s ease;
    position: relative;
    z-index: 20;
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 34px;
    min-height: 42px;
}

.logo {
    margin-bottom: 0;
    min-width: 0;
    white-space: nowrap;
}

.logo-text,
.nav-label,
.user-info,
.profile-chevron,
.upgrade-pill {
    transition: opacity 0.16s ease, width 0.2s ease;
}

.sidebar-toggle {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sidebar-toggle:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.nav-menu {
    min-height: 0;
}

.nav-item {
    width: 100%;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font-size: 15px;
    font-family: inherit;
    white-space: nowrap;
}

.nav-item i {
    width: 18px;
    flex: 0 0 18px;
    text-align: center;
}

.upgrade-nav-item {
    margin-top: auto;
}

.sidebar-footer {
    position: relative;
    margin-top: 18px;
}

.user-profile {
    width: 100%;
    min-width: 0;
    padding: 18px 4px 0;
    border: 0;
    border-top: 1px solid var(--card-border);
    background: transparent;
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
}

.user-profile:hover .avatar {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

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

.user-info .name,
.user-info .plan {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-chevron {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 11px;
    transition: transform 0.2s ease;
}

.user-profile[aria-expanded="true"] .profile-chevron {
    transform: rotate(180deg);
}

.profile-menu {
    position: absolute;
    left: 0;
    bottom: calc(100% + 12px);
    width: 228px;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(19, 22, 28, 0.98);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.48);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px) scale(0.98);
    transform-origin: bottom left;
    transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease;
    z-index: 80;
}

.profile-menu.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.profile-menu-heading {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 10px 10px 12px;
    border-bottom: 1px solid var(--card-border);
    margin-bottom: 5px;
}

.profile-menu-heading strong {
    font-size: 14px;
}

.profile-menu-heading span {
    color: var(--text-muted);
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-menu form {
    margin: 0;
}

.profile-menu-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #d1d5db;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
}

.profile-menu-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

.profile-menu-item i {
    width: 16px;
    color: var(--text-muted);
    text-align: center;
}

.profile-menu-item.danger:hover,
.profile-menu-item.danger:hover i {
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.09);
}

.sidebar.collapsed {
    width: 88px;
    min-width: 88px;
    padding-inline: 14px;
}

.sidebar.collapsed .sidebar-brand-row {
    flex-direction: column;
    gap: 14px;
    margin-bottom: 26px;
}

.sidebar.collapsed .logo {
    width: 100%;
    justify-content: center;
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .nav-label,
.sidebar.collapsed .user-info,
.sidebar.collapsed .profile-chevron,
.sidebar.collapsed .upgrade-pill {
    display: none;
}

.sidebar.collapsed .nav-item {
    justify-content: center;
    padding-inline: 10px;
}

.sidebar.collapsed .nav-item.active::before {
    left: -14px;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
    padding-inline: 0;
}

.sidebar.collapsed .profile-menu {
    left: 56px;
    bottom: 0;
    transform-origin: bottom left;
}

.main-content {
    min-width: 0;
    padding: 30px 42px 54px;
}

.top-bar {
    gap: 28px;
    margin-bottom: 34px;
}

.page-heading {
    min-width: 0;
}

.page-heading h1 {
    margin-top: 5px;
    font-size: clamp(28px, 3vw, 36px);
    letter-spacing: -0.025em;
}

.page-heading p {
    max-width: 720px;
    margin-top: 8px;
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 14px;
}

.page-kicker,
.section-label {
    color: #a5b4fc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.topbar-actions {
    flex: 0 1 350px;
}

.search-bar {
    width: min(350px, 100%);
    padding-right: 10px;
}

.search-clear {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.search-clear:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.dashboard-view {
    animation: workspaceFade 0.24s ease;
}

.dashboard-view[hidden],
.search-hidden {
    display: none !important;
}

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

.search-empty-state {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-muted);
    text-align: center;
}

.search-empty-state[hidden] {
    display: none;
}

.search-empty-state i {
    margin-bottom: 8px;
    font-size: 32px;
    color: #6366f1;
}

.search-empty-state strong {
    color: var(--text-main);
    font-size: 18px;
}

.outcome-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
    gap: 42px;
    align-items: center;
    min-height: 386px;
    padding: clamp(28px, 4vw, 48px);
    border: 1px solid rgba(139, 92, 246, 0.32);
    border-radius: 26px;
    background: #05060c;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 24px 80px rgba(0, 0, 0, 0.22);
    overflow: hidden;
    isolation: isolate;
    position: relative;
}

.outcome-hero::before,
.outcome-hero::after {
    display: none;
}

.hyperspeed-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: #000;
}

.hyperspeed-background #lights {
    inset: 0;
}

.hyperspeed-background canvas {
    display: block;
}

.outcome-hero-copy,
.outcome-route {
    position: relative;
    z-index: 2;
}

.outcome-route .route-node,
.outcome-route .route-stack {
    backdrop-filter: blur(10px);
}

.outcome-hero h2 {
    max-width: 690px;
    margin-top: 12px;
    font-size: clamp(32px, 4.4vw, 54px);
    line-height: 1.02;
    letter-spacing: -0.045em;
}

.outcome-hero p {
    max-width: 690px;
    margin-top: 18px;
    color: #aeb4c0;
    line-height: 1.65;
    font-size: 15px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.primary-action,
.secondary-action {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 10px 17px;
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.primary-action {
    border: 1px solid #6366f1;
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: white;
    box-shadow: 0 10px 28px rgba(99, 102, 241, 0.22);
}

.primary-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 32px rgba(99, 102, 241, 0.3);
}

.secondary-action {
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-main);
}

.secondary-action:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
}

.primary-action.run-btn,
.secondary-action.run-btn {
    width: auto;
    padding: 10px 17px;
}

.outcome-route {
    display: grid;
    grid-template-columns: 1fr 28px 1fr 28px 1fr;
    align-items: center;
    min-width: 0;
}

.route-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.route-node {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    background: rgba(13, 15, 20, 0.78);
    color: #d1d5db;
    font-size: 11px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.route-node i {
    color: #a78bfa;
}

.route-node.source,
.route-node.result {
    min-height: 76px;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.route-node.result {
    border-color: rgba(52, 211, 153, 0.28);
}

.route-node.result i {
    color: #34d399;
}

.route-line {
    height: 1px;
    background: linear-gradient(90deg, rgba(99,102,241,0.2), #8b5cf6, rgba(99,102,241,0.2));
}

.pulse-grid,
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.pulse-card,
.metric-card {
    padding: 20px;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: var(--card-bg);
}

.pulse-card span,
.metric-card span {
    color: var(--text-muted);
    font-size: 12px;
}

.pulse-card strong,
.metric-card strong {
    display: block;
    margin: 8px 0 5px;
    font-size: 28px;
    letter-spacing: -0.03em;
}

.pulse-card small,
.metric-card small {
    color: #8b93a1;
    font-size: 11px;
}

.pulse-card small i,
.metric-card small.positive,
.metric-card small.positive i {
    color: #34d399;
}

.metric-card small.warning,
.metric-card small.warning i {
    color: #fbbf24;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    margin: 44px 0 18px;
}

.section-heading.compact {
    margin-top: 34px;
}

.section-heading h2 {
    margin-top: 5px;
    font-size: 24px;
    letter-spacing: -0.02em;
}

.workflows-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.workflow-card {
    min-width: 0;
}

.workspace-grid,
.analytics-grid,
.crm-layout,
.settings-layout {
    display: grid;
    gap: 20px;
}

.marketing-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.95fr);
}

.command-card,
.activity-panel,
.chart-panel,
.insight-panel,
.customer-panel,
.crm-action-panel,
.settings-card {
    border: 1px solid var(--card-border);
    border-radius: 20px;
    background: var(--card-bg);
}

.command-card,
.crm-action-panel {
    padding: 28px;
    background:
        radial-gradient(circle at 90% 10%, rgba(99, 102, 241, 0.13), transparent 36%),
        rgba(255, 255, 255, 0.03);
}

.command-card h2,
.crm-action-panel h3 {
    margin-top: 10px;
    font-size: 28px;
    letter-spacing: -0.025em;
}

.command-card > p,
.crm-action-panel > p {
    max-width: 640px;
    margin-top: 12px;
    color: var(--text-muted);
    line-height: 1.6;
    font-size: 14px;
}

.command-card-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    border-radius: 15px;
    font-size: 21px;
}

.command-card-icon.marketing {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
}

.command-card-icon.crm {
    background: linear-gradient(135deg, #0ea5e9, #10b981);
}

.deliverable-list {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 22px 0;
    list-style: none;
}

.deliverable-list li {
    padding: 7px 10px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    font-size: 11px;
}

.deliverable-list i {
    margin-right: 5px;
    color: #34d399;
}

.activity-panel,
.chart-panel,
.customer-panel,
.settings-card,
.insight-panel {
    padding: 24px;
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.panel-heading h3 {
    margin-top: 5px;
    font-size: 19px;
}

.status-badge,
.positive-badge {
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.13);
    color: #c4b5fd;
    font-size: 10px;
    font-weight: 700;
}

.positive-badge {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
}

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-row {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 15px 0;
    border-top: 1px solid var(--card-border);
}

.activity-row:first-child {
    border-top: 0;
}

.activity-icon,
.integration-icon {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
}

.activity-row div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-row strong {
    font-size: 13px;
}

.activity-row small {
    color: var(--text-muted);
    font-size: 11px;
}

.status-dot {
    padding: 4px 7px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
}

.status-dot.ready {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
}

.status-dot.scheduled {
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
}

.metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 0;
}

.analytics-grid {
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
    margin-top: 20px;
}

.bar-chart {
    height: 260px;
    display: grid;
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    align-items: end;
    gap: 14px;
    padding-top: 18px;
}

.bar-column {
    height: 100%;
    display: grid;
    grid-template-rows: 18px 1fr 18px;
    gap: 6px;
    align-items: end;
    text-align: center;
}

.bar-value,
.bar-label {
    color: var(--text-muted);
    font-size: 9px;
}

.bar-track {
    width: min(34px, 76%);
    height: 100%;
    margin: 0 auto;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    overflow: hidden;
    display: flex;
    align-items: flex-end;
}

.bar-fill {
    width: 100%;
    min-height: 5px;
    border-radius: 8px;
    background: linear-gradient(180deg, #8b5cf6, #4f46e5);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.22);
}

.insight-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    background:
        radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 32%),
        rgba(255, 255, 255, 0.03);
}

.insight-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 22px;
    border-radius: 14px;
    background: rgba(245, 158, 11, 0.13);
    color: #fbbf24;
    font-size: 20px;
}

.insight-panel h3 {
    margin-top: 10px;
    font-size: 22px;
    line-height: 1.25;
}

.insight-panel p {
    margin: 12px 0 22px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.6;
}

.crm-metrics {
    margin-bottom: 20px;
}

.crm-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.7fr);
}

.customer-table {
    width: 100%;
}

.customer-row {
    display: grid;
    grid-template-columns: minmax(180px, 1.1fr) minmax(150px, 0.9fr) minmax(160px, 1fr);
    align-items: center;
    gap: 16px;
    padding: 14px 4px;
    border-top: 1px solid var(--card-border);
    color: #cbd5e1;
    font-size: 12px;
}

.customer-head {
    padding-top: 2px;
    border-top: 0;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.customer-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.customer-name strong {
    color: var(--text-main);
}

.mini-avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.14);
    color: #c4b5fd;
    font-size: 10px;
    font-weight: 700;
}

.customer-signal {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10px;
}

.customer-signal.loyal {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

.customer-signal.risk {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.customer-signal.attention {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
}

.crm-action-panel {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.settings-layout {
    grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.8fr);
    align-items: start;
}

.profile-settings-card {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
}

.large-avatar {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: var(--grad-1);
    font-size: 18px;
    font-weight: 700;
}

.profile-settings-card h2 {
    margin-top: 4px;
    font-size: 23px;
}

.profile-settings-card p,
.settings-description {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.55;
}

.settings-plan-card {
    min-width: 230px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 3px 16px;
    padding: 14px;
    border: 1px solid var(--card-border);
    border-radius: 14px;
    background: rgba(255,255,255,0.035);
}

.settings-plan-card span,
.settings-plan-card small {
    color: var(--text-muted);
    font-size: 10px;
}

.settings-plan-card strong {
    grid-row: 2;
    font-size: 17px;
}

.settings-plan-card small {
    grid-row: 3;
}

.settings-plan-card button {
    grid-column: 2;
    grid-row: 1 / 4;
}

.settings-form {
    min-width: 0;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.form-grid label > span {
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
}

.form-grid .full-width {
    grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-main);
    padding: 11px 12px;
    outline: none;
    font: inherit;
    font-size: 12px;
    resize: vertical;
}

.form-grid select option {
    background: #151820;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.preference-list {
    display: flex;
    flex-direction: column;
    margin-top: 20px;
    border-top: 1px solid var(--card-border);
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 0;
    border-bottom: 1px solid var(--card-border);
    cursor: pointer;
}

.toggle-row > span:first-child {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.toggle-row strong {
    font-size: 12px;
}

.toggle-row small {
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.4;
}

.toggle-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toggle-control {
    width: 38px;
    height: 22px;
    flex: 0 0 38px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    transition: background 0.2s ease;
}

.toggle-control::after {
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #d1d5db;
    transition: transform 0.2s ease, background 0.2s ease;
}

.toggle-row input:checked + .toggle-control {
    background: #6366f1;
}

.toggle-row input:checked + .toggle-control::after {
    transform: translateX(16px);
    background: white;
}

.settings-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 18px;
}

.settings-status {
    color: #6ee7b7;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.settings-status.visible {
    opacity: 1;
}

.integration-list {
    display: flex;
    flex-direction: column;
    margin-top: 14px;
}

.integration-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 15px 0;
    border-top: 1px solid var(--card-border);
}

.integration-row:first-child {
    border-top: 0;
}

.integration-row > div {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.integration-row strong {
    font-size: 12px;
}

.integration-row small {
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.45;
}

.integration-connect-btn {
    padding: 7px 10px;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    color: #cbd5e1;
    font: inherit;
    font-size: 10px;
    cursor: pointer;
}

.integration-connect-btn:hover {
    border-color: rgba(255,255,255,0.2);
    color: white;
}

.integration-connect-btn.connected {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

.integration-row.connected .integration-icon {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

@media (max-width: 1180px) {
    .outcome-hero {
        grid-template-columns: 1fr;
    }

    .outcome-route {
        max-width: 650px;
    }

    .workflows-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .marketing-layout,
    .analytics-grid,
    .crm-layout,
    .settings-layout {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    body {
        overflow: auto;
        height: auto;
    }

    .app-container {
        min-height: 100vh;
        height: auto;
        flex-direction: column;
    }

    .sidebar,
    .sidebar.collapsed {
        width: 100%;
        min-width: 100%;
        padding: 14px 18px;
        border-right: 0;
        border-bottom: 1px solid var(--card-border);
    }

    .sidebar-brand-row,
    .sidebar.collapsed .sidebar-brand-row {
        min-height: 38px;
        flex-direction: row;
        margin-bottom: 14px;
    }

    .sidebar.collapsed .logo {
        width: auto;
        justify-content: flex-start;
    }

    .sidebar.collapsed .logo-text {
        display: inline;
    }

    .sidebar.collapsed .nav-menu,
    .sidebar.collapsed .sidebar-footer {
        display: none;
    }

    .nav-menu {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .nav-item,
    .sidebar.collapsed .nav-item {
        justify-content: center;
        padding: 10px;
    }

    .upgrade-nav-item {
        grid-column: 1 / -1;
        margin-top: 0;
    }

    .sidebar-footer {
        margin-top: 12px;
    }

    .user-profile {
        padding-top: 12px;
    }

    .profile-menu,
    .sidebar.collapsed .profile-menu {
        left: 0;
        right: auto;
        bottom: calc(100% + 8px);
    }

    .main-content {
        padding: 26px 18px 46px;
    }

    .top-bar {
        align-items: stretch;
        flex-direction: column;
        gap: 18px;
    }

    .topbar-actions,
    .search-bar {
        width: 100%;
        max-width: none;
        flex-basis: auto;
    }

    .profile-settings-card {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .settings-plan-card {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 620px) {
    .nav-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .outcome-hero {
        padding: 24px 20px;
        border-radius: 20px;
    }

    .outcome-hero h2 {
        font-size: 34px;
    }

    .outcome-hero::before {
        background:
            linear-gradient(180deg, rgba(5, 6, 12, 0.9) 0%, rgba(5, 6, 12, 0.68) 58%, rgba(5, 6, 12, 0.56) 100%),
            linear-gradient(90deg, rgba(5, 6, 12, 0.9), rgba(5, 6, 12, 0.26));
    }

    .hyperspeed-canvas {
        opacity: 0.76;
    }

    .outcome-route {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .route-line {
        width: 1px;
        height: 18px;
        margin: 0 auto;
        background: linear-gradient(180deg, rgba(99,102,241,0.2), #8b5cf6, rgba(99,102,241,0.2));
    }

    .pulse-grid,
    .metrics-grid,
    .workflows-grid {
        grid-template-columns: 1fr;
    }

    .hero-actions,
    .hero-actions .primary-action,
    .hero-actions .secondary-action {
        width: 100%;
    }

    .bar-chart {
        gap: 6px;
    }

    .bar-value {
        display: none;
    }

    .customer-head {
        display: none;
    }

    .customer-row {
        grid-template-columns: 1fr;
        gap: 8px;
        padding: 16px 2px;
    }

    .panel-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid .full-width {
        grid-column: auto;
    }

    .profile-settings-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .large-avatar {
        margin: 0 auto;
    }

    .settings-plan-card {
        text-align: left;
    }

    .integration-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }

    .integration-connect-btn {
        grid-column: 1 / -1;
        width: 100%;
    }

    .plans-grid {
        grid-template-columns: 1fr;
    }
}

/* Extended settings and site customization */
:root {
    --accent-rgb: 99, 102, 241;
    --site-radius-lg: 18px;
    --site-radius-md: 12px;
    color-scheme: dark;
}

.settings-form-shell {
    display: block;
    padding-bottom: 8px;
}

.settings-card-wide {
    grid-column: 1 / -1;
}

.settings-section-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--accent-rgb), 0.24);
    border-radius: 12px;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
}

.settings-form-grid {
    margin-top: 18px;
}

.single-column-grid {
    grid-template-columns: 1fr;
}

.setting-control {
    position: relative;
    min-width: 0;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.018);
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.setting-control:hover {
    border-color: var(--card-border);
    background: rgba(255, 255, 255, 0.028);
}

.setting-control > small {
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.4;
}

.setting-group {
    min-width: 0;
    margin-top: 20px;
    padding: 0;
    border: 0;
}

.setting-group legend {
    margin-bottom: 10px;
    color: #cbd5e1;
    font-size: 11px;
    font-weight: 600;
}

.theme-choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.theme-choice {
    position: relative;
    display: grid;
    grid-template-columns: 58px 1fr;
    align-items: center;
    gap: 11px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--card-border);
    border-radius: 13px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.025);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.theme-choice:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-rgb), 0.45);
}

.theme-choice input,
.accent-choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-choice:has(input:checked) {
    border-color: var(--accent);
    background: rgba(var(--accent-rgb), 0.1);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1);
}

.theme-choice strong {
    font-size: 12px;
}

.theme-preview {
    height: 42px;
    display: grid;
    grid-template-columns: 14px 1fr;
    grid-template-rows: 10px 1fr;
    gap: 4px;
    padding: 5px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.theme-preview i {
    display: block;
    border-radius: 3px;
}

.theme-preview i:first-child {
    grid-row: 1 / 3;
}

.theme-preview i:nth-child(2) {
    grid-column: 2;
}

.theme-preview i:nth-child(3) {
    grid-column: 2;
}

.dark-preview { background: #0d0f14; }
.dark-preview i:first-child { background: #20242d; }
.dark-preview i:nth-child(2) { background: #343946; }
.dark-preview i:nth-child(3) { background: #6366f1; opacity: 0.72; }
.midnight-preview { background: #050914; }
.midnight-preview i:first-child { background: #0d1930; }
.midnight-preview i:nth-child(2) { background: #142442; }
.midnight-preview i:nth-child(3) { background: #3b82f6; opacity: 0.72; }
.light-preview { background: #eef2f7; border-color: rgba(15, 23, 42, 0.12); }
.light-preview i:first-child { background: #d7deea; }
.light-preview i:nth-child(2) { background: #ffffff; }
.light-preview i:nth-child(3) { background: #6366f1; opacity: 0.72; }

.accent-choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.accent-choice {
    position: relative;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}

.accent-choice > span {
    width: 24px;
    height: 24px;
    display: block;
    border: 3px solid transparent;
    border-radius: inherit;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.accent-choice:hover > span { transform: scale(1.08); }
.accent-choice:has(input:checked) > span {
    box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 4px currentColor;
}
.accent-choice.indigo { color: #6366f1; }
.accent-choice.indigo > span { background: #6366f1; }
.accent-choice.blue { color: #3b82f6; }
.accent-choice.blue > span { background: #3b82f6; }
.accent-choice.emerald { color: #10b981; }
.accent-choice.emerald > span { background: #10b981; }
.accent-choice.rose { color: #f43f5e; }
.accent-choice.rose > span { background: #f43f5e; }
.accent-choice.amber { color: #f59e0b; }
.accent-choice.amber > span { background: #f59e0b; }

.appearance-selects {
    padding-top: 4px;
    border-top: 1px solid var(--card-border);
}

.compact-preference-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    border-top: 0;
}

.compact-preference-list .toggle-row {
    align-items: flex-start;
    padding: 13px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.018);
}

.danger-outline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    padding: 10px 13px;
    border: 1px solid rgba(239, 68, 68, 0.32);
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.07);
    color: #fca5a5;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.danger-outline-btn:hover,
.danger-outline-btn[data-confirming="true"] {
    border-color: rgba(239, 68, 68, 0.65);
    background: rgba(239, 68, 68, 0.14);
}

.settings-save-bar {
    position: sticky;
    z-index: 20;
    bottom: -1px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: rgba(13, 15, 20, 0.88);
    box-shadow: 0 -12px 38px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(20px);
}

.settings-save-bar > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.settings-save-bar strong { font-size: 12px; }
.settings-save-bar span { color: var(--text-muted); font-size: 10px; }
.settings-save-bar span.saved { color: #6ee7b7; }
.settings-save-bar span.pending { color: #fcd34d; }
.settings-save-actions { display: flex; align-items: center; gap: 10px; }

.settings-search-results {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid rgba(var(--accent-rgb), 0.3);
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(var(--accent-rgb), 0.13), rgba(255, 255, 255, 0.025));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
}

.settings-search-results[hidden] { display: none; }

.settings-search-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 13px;
}

.settings-search-heading h2 {
    margin-top: 3px;
    font-size: 20px;
}

.settings-result-count {
    padding: 6px 9px;
    border-radius: 999px;
    color: var(--accent);
    background: rgba(var(--accent-rgb), 0.12);
    font-size: 10px;
    font-weight: 600;
}

.settings-search-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.settings-search-result {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-main);
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.settings-search-result:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-rgb), 0.5);
    background: rgba(var(--accent-rgb), 0.08);
}

.settings-search-result > i {
    margin-left: auto;
    color: var(--accent);
    font-size: 11px;
}

.settings-search-result-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.settings-search-result-copy small {
    color: var(--accent);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.settings-search-result-copy strong { font-size: 12px; }
.settings-search-result-copy > span {
    overflow: hidden;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-search-no-results {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 16px;
    border: 1px dashed var(--card-border);
    border-radius: 12px;
    color: var(--text-muted);
}

.settings-search-no-results > i { color: var(--accent); }
.settings-search-no-results > div { display: flex; flex-direction: column; gap: 3px; }
.settings-search-no-results strong { color: var(--text-main); font-size: 12px; }
.settings-search-no-results span { font-size: 10px; }

.setting-search-match {
    border-color: rgba(var(--accent-rgb), 0.38) !important;
}

.setting-search-focus {
    animation: settingFocusPulse 1.8s ease;
}

@keyframes settingFocusPulse {
    0%, 100% { box-shadow: none; }
    20%, 70% { box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.18), 0 0 32px rgba(var(--accent-rgb), 0.15); }
}

/* Theme presets */
html[data-theme="midnight"] {
    --bg-color: #050914;
    --sidebar-bg: #08101f;
    --text-main: #eef5ff;
    --text-muted: #8da2c0;
    --card-bg: rgba(25, 44, 74, 0.28);
    --card-border: rgba(125, 166, 219, 0.13);
    --glass-bg: rgba(8, 16, 31, 0.76);
    --glass-border: rgba(125, 166, 219, 0.16);
}

html[data-theme="light"] {
    --bg-color: #f4f7fb;
    --sidebar-bg: #ffffff;
    --text-main: #152033;
    --text-muted: #64748b;
    --card-bg: rgba(255, 255, 255, 0.82);
    --card-border: rgba(15, 23, 42, 0.11);
    --glass-bg: rgba(255, 255, 255, 0.82);
    --glass-border: rgba(15, 23, 42, 0.11);
    color-scheme: light;
}

html[data-theme="light"] body,
html[data-theme="light"] .main-content {
    background-color: var(--bg-color);
}

html[data-theme="light"] .sidebar,
html[data-theme="light"] .profile-menu,
html[data-theme="light"] .settings-save-bar,
html[data-theme="light"] .upgrade-modal-content,
html[data-theme="light"] .modal-content {
    background-color: rgba(255, 255, 255, 0.94);
}

html[data-theme="light"] .settings-save-bar { background: rgba(255, 255, 255, 0.9); }
html[data-theme="light"] .settings-card,
html[data-theme="light"] .workflow-card,
html[data-theme="light"] .pulse-card,
html[data-theme="light"] .metric-card,
html[data-theme="light"] .command-card,
html[data-theme="light"] .activity-panel,
html[data-theme="light"] .chart-panel,
html[data-theme="light"] .insight-panel,
html[data-theme="light"] .crm-action-panel,
html[data-theme="light"] .customer-panel {
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 16px 45px rgba(15, 23, 42, 0.06);
}

html[data-theme="light"] .form-grid label > span,
html[data-theme="light"] .setting-group legend,
html[data-theme="light"] .toggle-row strong,
html[data-theme="light"] .profile-settings-card h2,
html[data-theme="light"] .settings-search-heading h2,
html[data-theme="light"] .settings-search-result,
html[data-theme="light"] .settings-save-bar strong {
    color: var(--text-main);
}

html[data-theme="light"] .form-grid input,
html[data-theme="light"] .form-grid select,
html[data-theme="light"] .form-grid textarea,
html[data-theme="light"] .setting-control,
html[data-theme="light"] .theme-choice,
html[data-theme="light"] .compact-preference-list .toggle-row,
html[data-theme="light"] .settings-search-result,
html[data-theme="light"] .settings-plan-card {
    background: rgba(248, 250, 252, 0.94);
    color: var(--text-main);
}

html[data-theme="light"] .form-grid select option { background: white; }
html[data-theme="light"] .search-bar { background: rgba(255, 255, 255, 0.8); }
html[data-theme="light"] .search-bar input { color: var(--text-main); }
html[data-theme="light"] .nav-item:hover { background: rgba(15, 23, 42, 0.05); }

/* Card and spacing controls */
html[data-card-style="solid"] {
    --card-bg: var(--sidebar-bg);
    --glass-bg: var(--sidebar-bg);
}

html[data-card-style="solid"] .settings-card,
html[data-card-style="solid"] .workflow-card,
html[data-card-style="solid"] .pulse-card,
html[data-card-style="solid"] .metric-card,
html[data-card-style="solid"] .command-card,
html[data-card-style="solid"] .activity-panel,
html[data-card-style="solid"] .chart-panel,
html[data-card-style="solid"] .insight-panel,
html[data-card-style="solid"] .crm-action-panel,
html[data-card-style="solid"] .customer-panel {
    background: var(--sidebar-bg);
    backdrop-filter: none;
}

html[data-card-style="minimal"] .settings-card,
html[data-card-style="minimal"] .workflow-card,
html[data-card-style="minimal"] .pulse-card,
html[data-card-style="minimal"] .metric-card,
html[data-card-style="minimal"] .command-card,
html[data-card-style="minimal"] .activity-panel,
html[data-card-style="minimal"] .chart-panel,
html[data-card-style="minimal"] .insight-panel,
html[data-card-style="minimal"] .crm-action-panel,
html[data-card-style="minimal"] .customer-panel {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

html[data-corner-style="rounded"] { --site-radius-lg: 22px; --site-radius-md: 14px; }
html[data-corner-style="soft"] { --site-radius-lg: 12px; --site-radius-md: 9px; }
html[data-corner-style="sharp"] { --site-radius-lg: 4px; --site-radius-md: 3px; }

html[data-corner-style] .settings-card,
html[data-corner-style] .workflow-card,
html[data-corner-style] .pulse-card,
html[data-corner-style] .metric-card,
html[data-corner-style] .command-card,
html[data-corner-style] .activity-panel,
html[data-corner-style] .chart-panel,
html[data-corner-style] .insight-panel,
html[data-corner-style] .crm-action-panel,
html[data-corner-style] .customer-panel,
html[data-corner-style] .settings-search-results,
html[data-corner-style] .settings-save-bar {
    border-radius: var(--site-radius-lg);
}

html[data-corner-style] .form-grid input,
html[data-corner-style] .form-grid select,
html[data-corner-style] .form-grid textarea,
html[data-corner-style] .setting-control,
html[data-corner-style] .toggle-row,
html[data-corner-style] .theme-choice,
html[data-corner-style] .settings-search-result,
html[data-corner-style] button {
    border-radius: var(--site-radius-md);
}

html[data-density="compact"] .main-content { padding-top: 24px; }
html[data-density="compact"] .settings-layout { gap: 12px; }
html[data-density="compact"] .settings-card { padding: 18px; }
html[data-density="compact"] .form-grid { gap: 9px; margin-top: 12px; }
html[data-density="compact"] .toggle-row { padding-top: 10px; padding-bottom: 10px; }
html[data-density="compact"] .workflows-grid,
html[data-density="compact"] .metrics-grid,
html[data-density="compact"] .pulse-grid { gap: 12px; }
html[data-density="compact"] .workflow-card,
html[data-density="compact"] .metric-card,
html[data-density="compact"] .pulse-card { padding: 16px; }

html[data-text-size="small"] body { font-size: 13px; }
html[data-text-size="small"] .page-heading h1 { font-size: 28px; }
html[data-text-size="small"] .settings-description,
html[data-text-size="small"] .toggle-row small,
html[data-text-size="small"] .setting-control > small { font-size: 9px; }
html[data-text-size="large"] body { font-size: 17px; }
html[data-text-size="large"] .page-heading h1 { font-size: 36px; }
html[data-text-size="large"] .settings-description,
html[data-text-size="large"] .toggle-row small,
html[data-text-size="large"] .setting-control > small { font-size: 11px; }
html[data-text-size="large"] .toggle-row strong,
html[data-text-size="large"] .form-grid label > span { font-size: 12px; }

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
}

html[data-contrast="high"] {
    --text-muted: #cbd5e1;
    --card-border: rgba(255, 255, 255, 0.23);
    --glass-border: rgba(255, 255, 255, 0.28);
}

html[data-theme="light"][data-contrast="high"] {
    --text-muted: #334155;
    --card-border: rgba(15, 23, 42, 0.28);
    --glass-border: rgba(15, 23, 42, 0.32);
}

.nav-item.active,
.sidebar-toggle:hover,
.integration-connect-btn.connected {
    border-color: rgba(var(--accent-rgb), 0.34);
}

@media (max-width: 980px) {
    .compact-preference-list { grid-template-columns: 1fr; }
    .settings-search-list { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .theme-choice-grid { grid-template-columns: 1fr; }
    .settings-save-bar { align-items: stretch; flex-direction: column; }
    .settings-save-actions,
    .settings-save-actions button { width: 100%; }
    .settings-save-actions { display: grid; grid-template-columns: 1fr; }
    .settings-search-heading { align-items: flex-start; }
}


/* OrexisAI brand lockup and post-login reveal */
.outcome-brand-lockup {
    display: inline-flex;
    align-items: center;
    gap: 0;
    min-width: 0;
    isolation: isolate;
}

.outcome-brand-o {
    position: relative;
    z-index: 2;
    display: inline-grid;
    place-items: center;
    width: 1.02em;
    flex: 0 0 auto;
    color: transparent;
    background: linear-gradient(145deg, #ffffff 8%, var(--accent) 45%, #a855f7 82%);
    -webkit-background-clip: text;
    background-clip: text;
    font-size: 1.16em;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.1em;
    text-indent: -0.05em;
    filter: drop-shadow(0 0 10px rgba(var(--accent-rgb, 99, 102, 241), 0.28));
}

.outcome-brand-o::after {
    content: '';
    position: absolute;
    inset: 8% 5% 6% 8%;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: inset 0 0 9px rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.outcome-brand-word-mask {
    display: inline-flex;
    overflow: hidden;
    min-width: 0;
}

.outcome-brand-word {
    display: inline-block;
    color: var(--text-main);
    font-weight: 650;
    letter-spacing: -0.045em;
    line-height: 1;
    white-space: nowrap;
}

.outcome-brand-ai {
    margin-left: 0.03em;
    color: var(--accent);
    font-weight: 700;
}

.sidebar .outcome-brand-lockup {
    font-size: 23px;
}

.sidebar .outcome-brand-word-mask {
    overflow: visible;
}

.login-brand-intro {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb, 99, 102, 241), 0.17), transparent 28%),
        linear-gradient(145deg, #090b10 0%, #0d1017 52%, #090b10 100%);
    animation: outcome-login-intro-exit 0.58s cubic-bezier(0.7, 0, 0.3, 1) 2.62s both;
}

.login-brand-intro::before,
.login-brand-intro::after {
    content: '';
    position: absolute;
    width: min(64vw, 760px);
    aspect-ratio: 1;
    border-radius: 50%;
    pointer-events: none;
}

.login-brand-intro::before {
    top: 50%;
    left: 50%;
    border: 1px solid rgba(255, 255, 255, 0.055);
    transform: translate(-50%, -50%) scale(0.72);
    animation: outcome-login-orbit 2.8s ease-out both;
}

.login-brand-intro::after {
    top: 50%;
    left: 50%;
    width: min(42vw, 500px);
    border: 1px solid rgba(var(--accent-rgb, 99, 102, 241), 0.1);
    transform: translate(-50%, -50%) scale(0.82);
    animation: outcome-login-orbit 2.8s 0.12s ease-out both reverse;
}

.login-brand-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: rgba(var(--accent-rgb, 99, 102, 241), 0.28);
    filter: blur(72px);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.6);
    animation: outcome-login-glow 2.45s ease-out both;
}

.login-brand-stage {
    position: relative;
    z-index: 2;
    display: flex;
    width: min(94vw, 1000px);
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
}

.login-brand-lockup {
    font-size: clamp(52px, 8vw, 92px);
    filter: drop-shadow(0 18px 42px rgba(0, 0, 0, 0.42));
}

.login-brand-lockup .outcome-brand-o {
    opacity: 0;
    transform: scale(0.54) rotate(-12deg);
    filter: blur(12px) drop-shadow(0 0 28px rgba(var(--accent-rgb, 99, 102, 241), 0.45));
    animation: outcome-login-o-arrive 0.72s cubic-bezier(0.16, 1, 0.3, 1) 0.12s both;
}

.login-brand-lockup .outcome-brand-o::after {
    opacity: 0;
    animation: outcome-login-o-detail 0.42s ease 0.56s both;
}

.login-brand-lockup .outcome-brand-word-mask {
    width: auto;
    max-width: 0;
    animation: outcome-login-word-mask 0.96s cubic-bezier(0.16, 1, 0.3, 1) 0.72s both;
}

.login-brand-lockup .outcome-brand-word {
    opacity: 0;
    transform: translateX(-104%);
    animation: outcome-login-word-slide 0.96s cubic-bezier(0.16, 1, 0.3, 1) 0.72s both;
}

.login-brand-tagline {
    color: var(--text-muted);
    font-size: clamp(12px, 1.6vw, 15px);
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    opacity: 0;
    transform: translateY(10px);
    animation: outcome-login-tagline 0.55s ease 1.48s both;
}

.login-brand-skip {
    position: absolute;
    right: 28px;
    bottom: 24px;
    z-index: 3;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: rgba(255, 255, 255, 0.52);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    animation: outcome-login-skip 0.35s ease 1.2s both;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.login-brand-skip:hover,
.login-brand-skip:focus-visible {
    color: white;
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.07);
    outline: none;
}

.login-brand-intro.is-skipping {
    animation: none;
    opacity: 0;
    transition: opacity 0.22s ease;
}

body.login-intro-active .app-container {
    animation: outcome-dashboard-underlay 3.05s ease both;
}

@keyframes outcome-login-o-arrive {
    0% { opacity: 0; transform: scale(0.54) rotate(-12deg); filter: blur(12px) drop-shadow(0 0 28px rgba(var(--accent-rgb, 99, 102, 241), 0.45)); }
    58% { opacity: 1; transform: scale(1.07) rotate(2deg); filter: blur(0) drop-shadow(0 0 34px rgba(var(--accent-rgb, 99, 102, 241), 0.5)); }
    100% { opacity: 1; transform: scale(1) rotate(0); filter: blur(0) drop-shadow(0 0 18px rgba(var(--accent-rgb, 99, 102, 241), 0.3)); }
}

@keyframes outcome-login-o-detail {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes outcome-login-word-mask {
    from { max-width: 0; }
    to { max-width: 4.2em; }
}

@keyframes outcome-login-word-slide {
    0% { opacity: 0; transform: translateX(-104%); filter: blur(7px); }
    22% { opacity: 1; }
    100% { opacity: 1; transform: translateX(0); filter: blur(0); }
}

@keyframes outcome-login-tagline {
    from { opacity: 0; transform: translateY(10px); letter-spacing: 0.22em; }
    to { opacity: 0.72; transform: translateY(0); letter-spacing: 0.16em; }
}

@keyframes outcome-login-glow {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
    32% { opacity: 0.72; }
    100% { opacity: 0.12; transform: translate(-50%, -50%) scale(1.7); }
}

@keyframes outcome-login-orbit {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.72) rotate(0deg); }
    26% { opacity: 1; }
    100% { opacity: 0.12; transform: translate(-50%, -50%) scale(1.04) rotate(26deg); }
}

@keyframes outcome-login-skip {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes outcome-login-intro-exit {
    0% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}

@keyframes outcome-dashboard-underlay {
    0%, 72% { opacity: 0.35; transform: scale(1.015); filter: blur(5px); }
    100% { opacity: 1; transform: scale(1); filter: blur(0); }
}

@media (max-width: 600px) {
    .login-brand-lockup {
        font-size: clamp(45px, 16vw, 68px);
    }

    .login-brand-tagline {
        max-width: 82vw;
        text-align: center;
        line-height: 1.65;
    }

    .login-brand-skip {
        right: 18px;
        bottom: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-brand-intro,
    .login-brand-intro::before,
    .login-brand-intro::after,
    .login-brand-glow,
    .login-brand-lockup .outcome-brand-o,
    .login-brand-lockup .outcome-brand-o::after,
    .login-brand-lockup .outcome-brand-word-mask,
    .login-brand-lockup .outcome-brand-word,
    .login-brand-tagline,
    .login-brand-skip,
    body.login-intro-active .app-container {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
    }

    .login-brand-lockup .outcome-brand-word-mask {
        width: auto;
        max-width: 4.2em;
    }
}

/* Persistent AI-agent chat history */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.sidebar .nav-menu {
    flex: 0 0 auto;
}

.chat-history-panel {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--card-border);
}

.new-chat-button,
.recent-chats-button {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    color: var(--text-main);
    font: inherit;
    cursor: pointer;
    text-align: left;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.new-chat-button {
    border: 1px solid rgba(var(--accent-rgb), 0.24);
    background: rgba(var(--accent-rgb), 0.08);
    font-size: 13px;
    font-weight: 600;
}

.new-chat-button:hover:not(:disabled) {
    background: rgba(var(--accent-rgb), 0.15);
    border-color: rgba(var(--accent-rgb), 0.42);
    transform: translateY(-1px);
}

.new-chat-button:disabled {
    cursor: wait;
    opacity: 0.58;
}

.new-chat-button > i,
.recent-chats-button > i:first-child {
    width: 18px;
    flex: 0 0 18px;
    color: var(--accent);
    text-align: center;
}

.recent-chats-button {
    min-height: 58px;
    border: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.025);
}

.recent-chats-button:hover,
.recent-chats-button[aria-expanded="true"] {
    border-color: rgba(var(--accent-rgb), 0.3);
    background: rgba(var(--accent-rgb), 0.08);
    transform: translateY(-1px);
}

.recent-chats-button-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 2px;
}

.recent-chats-button-copy strong,
.recent-chats-button-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-chats-button-copy strong {
    color: var(--text-main);
    font-size: 12px;
    font-weight: 650;
}

.recent-chats-button-copy small {
    color: var(--text-muted);
    font-size: 9px;
}

.recent-chats-count {
    min-width: 24px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 1px solid rgba(var(--accent-rgb), 0.22);
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--text-main);
    font-size: 9px;
    font-weight: 700;
}

.recent-chats-chevron {
    width: auto !important;
    flex: 0 0 auto !important;
    color: var(--text-muted) !important;
    font-size: 9px;
    transition: transform 0.18s ease;
}

.recent-chats-button[aria-expanded="true"] .recent-chats-chevron {
    transform: rotate(90deg);
}

.chat-history-modal {
    z-index: 140;
    padding: 24px;
    overflow-y: auto;
}

.chat-history-window {
    width: min(720px, 100%);
    max-height: min(720px, calc(100vh - 48px));
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 24px;
    background:
        radial-gradient(circle at 10% 0%, rgba(var(--accent-rgb), 0.16), transparent 34%),
        rgba(10, 14, 24, 0.98);
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.62);
    transform: translateY(18px) scale(0.975);
    transition: transform 0.24s ease;
}

.chat-history-modal.active .chat-history-window {
    transform: translateY(0) scale(1);
}

.chat-history-close {
    top: 20px;
    right: 20px;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--card-border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.035);
    font-size: 15px;
}

.chat-history-window-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 2px 54px 20px 2px;
    border-bottom: 1px solid var(--card-border);
}

.chat-history-window-header > div {
    min-width: 0;
    flex: 1;
}

.chat-history-window-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    border-radius: 14px;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
    font-size: 17px;
}

.chat-history-window-header h2 {
    margin: 3px 0 4px;
    color: var(--text-main);
    font-size: 20px;
    line-height: 1.1;
}

.chat-history-window-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.45;
}

.chat-sync-status {
    max-width: 160px;
    overflow: hidden;
    color: var(--text-muted);
    font-size: 9px;
    font-weight: 600;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-sync-status[data-state="success"] { color: #6ee7b7; }
.chat-sync-status[data-state="warning"] { color: #fbbf24; }
.chat-sync-status[data-state="error"] { color: #fca5a5; }

.chat-history-list {
    min-height: 180px;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 6px;
    margin: 16px -6px -6px;
    padding: 0 6px 6px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.chat-history-item {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-muted);
    font: inherit;
    cursor: pointer;
    text-align: left;
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.chat-history-item:hover {
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.055);
    color: var(--text-main);
    transform: translateX(2px);
}

.chat-history-item.active {
    border-color: rgba(var(--accent-rgb), 0.28);
    background: rgba(var(--accent-rgb), 0.11);
    color: var(--text-main);
}

.chat-history-item > i {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.045);
    color: currentColor;
    font-size: 12px;
}

.chat-history-item.active > i {
    background: rgba(var(--accent-rgb), 0.14);
    color: var(--accent);
}

.chat-history-copy {
    min-width: 0;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 3px;
}

.chat-history-copy strong,
.chat-history-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-history-copy strong {
    color: inherit;
    font-size: 13px;
    font-weight: 600;
}

.chat-history-copy small {
    color: var(--text-muted);
    font-size: 10px;
}

.chat-history-loading,
.chat-history-empty,
.chat-history-error {
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 18px;
    border: 1px dashed var(--card-border);
    border-radius: 14px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.4;
}

.chat-history-error { color: #fca5a5; }

.sidebar-upgrade-button {
    flex: 0 0 auto;
    margin-top: auto;
}

.sidebar.collapsed .chat-history-panel {
    display: none;
}

.sidebar.collapsed .sidebar-upgrade-button {
    justify-content: center;
    padding-inline: 10px;
}

.agent-view {
    min-height: calc(100vh - 170px);
}

.agent-chat-shell {
    position: relative;
    min-height: calc(100vh - 175px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid var(--card-border);
    border-radius: 24px;
    background: #000000;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.24);
}

.agent-orb-background {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.agent-orb-background .orb-container,
.agent-orb-background canvas {
    width: 100%;
    height: 100%;
}

.agent-orb-background canvas {
    display: block;
}

.agent-chat-header,
.agent-message-list,
.agent-command-composer {
    position: relative;
    z-index: 1;
}

.agent-chat-header {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(255, 255, 255, 0.018);
}

.agent-chat-heading,
.agent-chat-actions {
    display: flex;
    align-items: center;
}

.agent-chat-heading {
    min-width: 0;
    gap: 12px;
}

.agent-chat-heading > div {
    min-width: 0;
}

.agent-chat-heading h2 {
    max-width: min(46vw, 560px);
    margin-top: 2px;
    overflow: hidden;
    color: var(--text-main);
    font-size: 18px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agent-status-dot {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 5px rgba(52, 211, 153, 0.1), 0 0 18px rgba(52, 211, 153, 0.28);
}

.agent-chat-actions {
    flex: 0 0 auto;
    gap: 8px;
}

.database-saved-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid rgba(52, 211, 153, 0.18);
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.07);
    color: #a7f3d0;
    font-size: 10px;
    font-weight: 600;
}

.icon-action {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--card-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.icon-action:hover:not(:disabled) {
    border-color: rgba(var(--accent-rgb), 0.34);
    background: rgba(var(--accent-rgb), 0.09);
    color: var(--text-main);
}

.icon-action.danger:hover:not(:disabled),
.icon-action.danger.confirming {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.icon-action:disabled {
    cursor: default;
    opacity: 0.35;
}

.chat-title-editor {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 3px;
}

.chat-title-editor[hidden] { display: none; }

.chat-title-editor input {
    width: min(42vw, 420px);
    padding: 7px 9px;
    border: 1px solid rgba(var(--accent-rgb), 0.45);
    border-radius: 8px;
    outline: none;
    background: rgba(0, 0, 0, 0.22);
    color: var(--text-main);
    font: inherit;
    font-size: 13px;
}

.chat-title-editor button {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--card-border);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-muted);
    cursor: pointer;
}

.agent-message-list {
    min-height: 320px;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 28px clamp(20px, 6vw, 84px) 24px;
    scroll-behavior: smooth;
}

.agent-empty-state {
    max-width: 720px;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 auto;
    padding: 40px 0;
    text-align: center;
}

.agent-empty-state[hidden] { display: none; }

.agent-empty-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 4px;
    border: 1px solid rgba(var(--accent-rgb), 0.28);
    border-radius: 18px;
    background: var(--grad-1);
    color: white;
    font-size: 21px;
    box-shadow: 0 16px 35px rgba(var(--accent-rgb), 0.22);
}

.agent-empty-state h3 {
    color: var(--text-main);
    font-size: clamp(22px, 3vw, 31px);
    letter-spacing: -0.025em;
}

.agent-empty-state > p {
    max-width: 610px;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.65;
}

.agent-prompt-suggestions {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.agent-prompt-suggestions button {
    min-height: 68px;
    padding: 12px;
    border: 1px solid var(--card-border);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.025);
    color: var(--text-muted);
    font: inherit;
    font-size: 11px;
    line-height: 1.45;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.agent-prompt-suggestions button:hover {
    border-color: rgba(var(--accent-rgb), 0.36);
    background: rgba(var(--accent-rgb), 0.07);
    color: var(--text-main);
    transform: translateY(-2px);
}

.agent-message {
    max-width: 820px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    margin: 0 auto 22px;
}

.agent-message-avatar {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--card-border);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    font-size: 12px;
}

.agent-message.assistant .agent-message-avatar {
    border-color: rgba(var(--accent-rgb), 0.26);
    background: rgba(var(--accent-rgb), 0.12);
    color: #c4b5fd;
}

.agent-message-body {
    min-width: 0;
    padding: 2px 0;
}

.agent-message-author {
    display: block;
    margin-bottom: 6px;
    color: var(--text-main);
    font-size: 12px;
}

.agent-message-content {
    min-width: 0;
    color: #e5e7eb;
    font-size: 14px;
    line-height: 1.72;
    overflow-wrap: anywhere;
}

.agent-message-content > :first-child {
    margin-top: 0;
}

.agent-message-content > :last-child {
    margin-bottom: 0;
}

.agent-message-content p {
    margin: 0 0 12px;
}

.agent-message-content .agent-message-paragraph {
    white-space: pre-wrap;
}

.agent-message-content h3,
.agent-message-content h4,
.agent-message-content h5 {
    margin: 17px 0 8px;
    color: #f8fafc;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -0.015em;
}

.agent-message-content h3 { font-size: 17px; }
.agent-message-content h4 { font-size: 15px; }
.agent-message-content h5 { font-size: 14px; }

.agent-message-content ul,
.agent-message-content ol {
    display: grid;
    gap: 7px;
    margin: 8px 0 14px;
    padding-left: 1.35rem;
}

.agent-message-content li {
    padding-left: 3px;
}

.agent-message-content li::marker {
    color: #a78bfa;
    font-weight: 700;
}

.agent-message-content strong {
    color: #f8fafc;
    font-weight: 700;
}

.agent-message-content em {
    color: #ddd6fe;
}

.agent-message-content a {
    color: #a5b4fc;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(165, 180, 252, 0.45);
    text-underline-offset: 3px;
}

.agent-message-content a:hover {
    color: #c4b5fd;
    text-decoration-color: currentColor;
}

.agent-message-content code {
    padding: 2px 5px;
    border: 1px solid rgba(var(--accent-rgb), 0.18);
    border-radius: 6px;
    background: rgba(var(--accent-rgb), 0.1);
    color: #ddd6fe;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.9em;
}

.agent-message-content pre {
    max-width: 100%;
    margin: 10px 0 14px;
    padding: 14px 15px;
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: rgba(10, 12, 18, 0.9);
    line-height: 1.55;
}

.agent-message-content pre code {
    padding: 0;
    border: 0;
    background: transparent;
    color: #e2e8f0;
    font-size: 12px;
    white-space: pre;
}

.agent-message-content blockquote {
    margin: 10px 0 14px;
    padding: 9px 13px;
    border-left: 3px solid rgba(var(--accent-rgb), 0.65);
    border-radius: 0 9px 9px 0;
    background: rgba(var(--accent-rgb), 0.07);
    color: #d1d5db;
}

.agent-message-content hr {
    height: 1px;
    margin: 15px 0;
    border: 0;
    background: rgba(255, 255, 255, 0.1);
}

.agent-message-body > small {
    display: block;
    margin-top: 7px;
    color: var(--text-muted);
    font-size: 9px;
}

.agent-message.pending {
    opacity: 0.62;
}

.agent-conversation-loading {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--text-muted);
    font-size: 12px;
}

.agent-command-composer {
    position: relative;
    width: min(850px, calc(100% - 36px));
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 10px;
    align-items: end;
    margin: 0 auto 20px;
    padding: 11px 11px 8px 15px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 19px;
    background: rgba(24, 27, 35, 0.96);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.agent-command-composer:focus-within {
    border-color: rgba(var(--accent-rgb), 0.52);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.1), 0 18px 48px rgba(0, 0, 0, 0.28);
}

.agent-command-composer textarea {
    min-height: 38px;
    max-height: 180px;
    resize: none;
    overflow-y: auto;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
}

.agent-command-composer textarea::placeholder {
    color: #7d8492;
}

.agent-send-button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: var(--accent);
    color: white;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease, opacity 0.18s ease;
}

.agent-send-button:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.agent-send-button:disabled {
    cursor: default;
    opacity: 0.32;
}

.agent-composer-meta {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 0 3px;
    color: var(--text-muted);
    font-size: 8px;
}

.agent-composer-meta i {
    margin-right: 4px;
}

html[data-theme="light"] .agent-chat-shell {
    background: #000000;
}

html[data-theme="light"] .agent-command-composer,
html[data-theme="light"] .chat-title-editor input {
    background: rgba(255, 255, 255, 0.96);
}

html[data-theme="light"] .agent-message-content {
    color: #334155;
}

html[data-theme="light"] .chat-history-window {
    border-color: rgba(15, 23, 42, 0.12);
    background:
        radial-gradient(circle at 10% 0%, rgba(var(--accent-rgb), 0.12), transparent 34%),
        rgba(255, 255, 255, 0.99);
}

html[data-theme="light"] .recent-chats-button,
html[data-theme="light"] .chat-history-item {
    background: rgba(15, 23, 42, 0.025);
}

html[data-theme="light"] .chat-history-item:hover,
html[data-theme="light"] .agent-prompt-suggestions button {
    background: rgba(15, 23, 42, 0.055);
}

@media (max-width: 1180px) {
    .database-saved-badge { display: none; }
}

@media (max-width: 860px) {
    .sidebar .nav-menu {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .chat-history-panel {
        margin-top: 12px;
    }

    .chat-history-window {
        max-height: min(680px, calc(100vh - 40px));
    }

    .sidebar-upgrade-button {
        margin-top: 10px;
    }

    .agent-view,
    .agent-chat-shell {
        min-height: 680px;
    }
}

@media (max-width: 620px) {
    .chat-history-modal {
        align-items: flex-end;
        padding: 10px;
    }

    .chat-history-window {
        width: 100%;
        max-height: calc(100vh - 20px);
        padding: 18px;
        border-radius: 20px;
    }

    .chat-history-window-header {
        align-items: flex-start;
        padding: 2px 42px 16px 0;
    }

    .chat-history-window-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .chat-sync-status {
        display: none;
    }

    .chat-history-list {
        min-height: 220px;
        margin-top: 12px;
    }

    .sidebar .nav-menu {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .agent-chat-shell {
        min-height: 640px;
        border-radius: 18px;
    }

    .agent-chat-header {
        align-items: flex-start;
        padding: 14px;
    }

    .agent-chat-heading h2 {
        max-width: 50vw;
        font-size: 15px;
    }

    .agent-chat-actions {
        gap: 5px;
    }

    .agent-message-list {
        padding: 22px 14px 18px;
    }

    .agent-prompt-suggestions {
        grid-template-columns: 1fr;
    }

    .agent-empty-state {
        justify-content: flex-start;
        padding-top: 30px;
    }

    .agent-command-composer {
        width: calc(100% - 20px);
        margin-bottom: 10px;
    }

    .agent-composer-meta span:last-child {
        display: none;
    }

    .chat-title-editor input {
        width: 44vw;
    }
}

/* Gemini-backed AI Agent status and response states. */
.gemini-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 220px;
    padding: 7px 10px;
    border: 1px solid rgba(var(--accent-rgb), 0.24);
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.08);
    color: #ddd6fe;
    font-size: 10px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gemini-status-badge.setup-required {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.08);
    color: #fcd34d;
}

.agent-message.pending.assistant .agent-message-content {
    color: var(--text-muted);
    font-style: italic;
}

.agent-message.pending.assistant .agent-message-avatar i {
    animation: agent-thinking-pulse 1.15s ease-in-out infinite;
}

.agent-message.error .agent-message-avatar {
    border-color: rgba(239, 68, 68, 0.32);
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.agent-message.error .agent-message-content {
    color: #fecaca;
}

@keyframes agent-thinking-pulse {
    0%, 100% { opacity: 0.45; transform: scale(0.92); }
    50% { opacity: 1; transform: scale(1.08); }
}

@media (max-width: 980px) {
    .gemini-status-badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .agent-message.pending.assistant .agent-message-avatar i { animation: none; }
}
