/* ==========================================================================
   A2Z Connector - Modern Enterprise Design System (n8n & Linear Inspired)
   ========================================================================== */

:root {
    /* Surface Color Palette (Obsidian & Deep Slate) */
    --bg-canvas: #07090e;
    --bg-color: #0b0f19;
    --bg-surface-0: #0e1422;
    --bg-card: #121929;
    --bg-card-hover: #182238;
    --bg-card-subtle: rgba(18, 25, 41, 0.75);
    --bg-input: rgba(15, 23, 42, 0.8);

    /* Brand Accents & Semantic Colors */
    --primary-color: #0284c7;
    --primary-hover: #0369a1;
    --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    --accent-color: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.25);
    --logo-primary: var(--text-main);
    --logo-secondary: var(--accent-color);
    --success-color: #10b981;
    --success-glow: rgba(16, 185, 129, 0.25);
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.25);

    /* Borders & Dividers */
    --border-color: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-focus: #38bdf8;
    --border-hover: rgba(56, 189, 248, 0.4);

    /* Typography */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #94a3b8;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Shadows & Radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-pill: 9999px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 20px 35px -10px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06);

    --grid-dot-color: rgba(255, 255, 255, 0.1);
}

/* Accessible Keyboard Focus Indicators (WCAG 2.1 AA) */
a:focus-visible,
button:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent-color, #38bdf8) !important;
    outline-offset: 2px !important;
}

/* Form inputs already have crisp focus rings; suppress double outline */
input,
select,
textarea,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible,
.node-input,
.node-input:focus,
.node-input:focus-visible,
.node-select,
.node-select:focus,
.node-select:focus-visible {
    outline: none !important;
    outline-offset: 0 !important;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
    outline: none;
}

/* Global Sleek Enterprise Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}
[data-theme='light'] * {
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}
[data-theme='light'] ::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.18);
}
[data-theme='light'] ::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   A2Z Theme-Aware Vector Logo System
   ========================================================================== */
.a2z-logo-mark,
.a2z-logo-full {
    display: inline-block;
    vertical-align: middle;
    overflow: visible;
}

.a2z-logo-primary {
    fill: var(--logo-primary, var(--text-main, #0f172a));
    transition: fill 0.25s ease;
}

.a2z-logo-secondary {
    fill: var(--logo-secondary, var(--accent-color, #0284c7));
    transition: fill 0.25s ease;
}

.theme-picker-item:hover .theme-swatch-badge {
    transform: scale(1.15);
    transition: transform 0.15s ease;
}

/* ==========================================================================
   MIDNIGHT CYBER THEME (Obsidian & Electric Cyan - Default Dark)
   ========================================================================== */
[data-theme='midnight'],
[data-theme='dark'] {
    --bg-canvas: #07090e;
    --bg-color: #0b0f19;
    --bg-surface-0: #0e1422;
    --bg-card: #121929;
    --bg-card-hover: #182238;
    --bg-card-subtle: rgba(18, 25, 41, 0.75);
    --bg-input: rgba(15, 23, 42, 0.8);

    --primary-color: #0284c7;
    --primary-hover: #0369a1;
    --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    --accent-color: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.25);

    --border-color: rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.05);
    --border-focus: #38bdf8;
    --border-hover: rgba(56, 189, 248, 0.4);

    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --grid-dot-color: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   NEBULA VIOLET THEME (Deep Velvet & Neon Amethyst / Pink)
   ========================================================================== */
[data-theme='nebula'] {
    --bg-canvas: #0a0614;
    --bg-color: #0f0a20;
    --bg-surface-0: #160f2e;
    --bg-card: #1c143a;
    --bg-card-hover: #261b4d;
    --bg-card-subtle: rgba(28, 20, 58, 0.75);
    --bg-input: rgba(22, 15, 46, 0.85);

    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-gradient: linear-gradient(135deg, #c084fc 0%, #8b5cf6 50%, #ec4899 100%);
    --accent-color: #c084fc;
    --accent-glow: rgba(192, 132, 252, 0.3);

    --border-color: rgba(192, 132, 252, 0.15);
    --border-subtle: rgba(192, 132, 252, 0.08);
    --border-focus: #c084fc;
    --border-hover: rgba(192, 132, 252, 0.45);

    --text-main: #faf5ff;
    --text-muted: #c4b5fd;
    --text-dim: #8b5cf6;
    --grid-dot-color: rgba(192, 132, 252, 0.14);
}

/* ==========================================================================
   EMERALD MATRIX THEME (Cyber Teal & Mint Glow)
   ========================================================================== */
[data-theme='emerald'] {
    --bg-canvas: #030f0a;
    --bg-color: #061711;
    --bg-surface-0: #0a241b;
    --bg-card: #0e3025;
    --bg-card-hover: #144032;
    --bg-card-subtle: rgba(14, 48, 37, 0.75);
    --bg-input: rgba(10, 36, 27, 0.85);

    --primary-color: #10b981;
    --primary-hover: #059669;
    --primary-gradient: linear-gradient(135deg, #34d399 0%, #10b981 50%, #059669 100%);
    --accent-color: #34d399;
    --accent-glow: rgba(52, 211, 153, 0.28);

    --border-color: rgba(52, 211, 153, 0.14);
    --border-subtle: rgba(52, 211, 153, 0.08);
    --border-focus: #34d399;
    --border-hover: rgba(52, 211, 153, 0.45);

    --text-main: #ecfdf5;
    --text-muted: #a7f3d0;
    --text-dim: #6ee7b7;
    --grid-dot-color: rgba(52, 211, 153, 0.14);
}

/* ==========================================================================
   SUNSET HORIZON THEME (Warm Charcoal & Fiery Amber / Orange)
   ========================================================================== */
[data-theme='sunset'] {
    --bg-canvas: #120904;
    --bg-color: #1a0e06;
    --bg-surface-0: #24150a;
    --bg-card: #301c0d;
    --bg-card-hover: #3d2412;
    --bg-card-subtle: rgba(48, 28, 13, 0.75);
    --bg-input: rgba(36, 21, 10, 0.85);

    --primary-color: #f97316;
    --primary-hover: #ea580c;
    --primary-gradient: linear-gradient(135deg, #fb923c 0%, #f97316 50%, #ef4444 100%);
    --accent-color: #fb923c;
    --accent-glow: rgba(251, 146, 60, 0.28);

    --border-color: rgba(251, 146, 60, 0.15);
    --border-subtle: rgba(251, 146, 60, 0.08);
    --border-focus: #fb923c;
    --border-hover: rgba(251, 146, 60, 0.45);

    --text-main: #fff7ed;
    --text-muted: #fed7aa;
    --text-dim: #fdba74;
    --grid-dot-color: rgba(251, 146, 60, 0.14);
}

/* ==========================================================================
   OCEAN SAPPHIRE THEME (Deep Navy & Electric Azure)
   ========================================================================== */
[data-theme='ocean'] {
    --bg-canvas: #050b18;
    --bg-color: #081126;
    --bg-surface-0: #0c1a38;
    --bg-card: #10224a;
    --bg-card-hover: #172e61;
    --bg-card-subtle: rgba(16, 34, 74, 0.75);
    --bg-input: rgba(12, 26, 56, 0.85);

    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-gradient: linear-gradient(135deg, #60a5fa 0%, #2563eb 50%, #4f46e5 100%);
    --accent-color: #60a5fa;
    --accent-glow: rgba(96, 165, 250, 0.28);

    --border-color: rgba(96, 165, 250, 0.15);
    --border-subtle: rgba(96, 165, 250, 0.08);
    --border-focus: #60a5fa;
    --border-hover: rgba(96, 165, 250, 0.45);

    --text-main: #eff6ff;
    --text-muted: #bfdbfe;
    --text-dim: #93c5fd;
    --grid-dot-color: rgba(96, 165, 250, 0.14);
}

/* ==========================================================================
   CRIMSON ROSE THEME (Velvet Black & Vivid Ruby)
   ========================================================================== */
[data-theme='crimson'] {
    --bg-canvas: #120408;
    --bg-color: #1a070d;
    --bg-surface-0: #260a14;
    --bg-card: #330e1b;
    --bg-card-hover: #421323;
    --bg-card-subtle: rgba(51, 14, 27, 0.75);
    --bg-input: rgba(38, 10, 20, 0.85);

    --primary-color: #e11d48;
    --primary-hover: #be123c;
    --primary-gradient: linear-gradient(135deg, #fb7185 0%, #e11d48 50%, #be123c 100%);
    --accent-color: #fb7185;
    --accent-glow: rgba(251, 113, 133, 0.28);

    --border-color: rgba(251, 113, 133, 0.15);
    --border-subtle: rgba(251, 113, 133, 0.08);
    --border-focus: #fb7185;
    --border-hover: rgba(251, 113, 133, 0.45);

    --text-main: #fff1f2;
    --text-muted: #fecdd3;
    --text-dim: #fda4af;
    --grid-dot-color: rgba(251, 113, 133, 0.14);
}

/* ==========================================================================
   LIGHT THEME PALETTE (Clean, Modern SaaS, High Contrast & Polished)
   ========================================================================== */
[data-theme='light'],
body.theme-light {
    /* Light Surface Color Palette */
    --bg-canvas: #f1f5f9;
    --bg-color: #f8fafc;
    --bg-surface-0: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --bg-card-subtle: #f1f5f9;
    --bg-input: #ffffff;

    /* Brand Accents & Semantic Colors */
    --primary-color: #0284c7;
    --primary-hover: #0369a1;
    --primary-gradient: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    --accent-color: #0284c7;
    --accent-glow: rgba(2, 132, 199, 0.15);
    --success-color: #059669;
    --success-glow: rgba(5, 150, 105, 0.15);
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --danger-glow: rgba(220, 38, 38, 0.15);

    /* Borders & Dividers */
    --border-color: #e2e8f0;
    --border-subtle: #cbd5e1;
    --border-focus: #0284c7;
    --border-hover: rgba(2, 132, 199, 0.5);

    /* Typography */
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;

    /* Shadows for Light Mode */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 18px 30px -10px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);

    --grid-dot-color: rgba(15, 23, 42, 0.14);
}

/* Light Mode Overrides for Specific Components */
[data-theme='light'] .navbar {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(203, 213, 225, 0.8);
    box-shadow:
        0 12px 30px -10px rgba(15, 23, 42, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.02);
}

[data-theme='light'] .nav-links {
    background: rgba(241, 245, 249, 0.85);
    border-color: rgba(226, 232, 240, 0.9);
}

[data-theme='light'] .nav-links a {
    color: #64748b;
}

[data-theme='light'] .nav-links a:hover {
    color: #0f172a;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

[data-theme='light'] .nav-links a.active {
    color: #0284c7;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(2, 132, 199, 0.12);
}

[data-theme='light'] .navbar .theme-palette-trigger {
    background: rgba(241, 245, 249, 0.85);
    border-color: #cbd5e1;
    color: #334155;
}

[data-theme='light'] .navbar .theme-palette-trigger:hover {
    background: #ffffff;
    border-color: #94a3b8;
    color: #0f172a;
}

[data-theme='light'] .navbar #openLoginBtn {
    color: #475569;
}

[data-theme='light'] .navbar #openLoginBtn:hover {
    color: #0f172a;
    background: #f1f5f9;
    border-color: #cbd5e1;
}

[data-theme='light'] .mobile-menu-toggle {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #334155;
}

[data-theme='light'] .mobile-nav-drawer {
    background: rgba(255, 255, 255, 0.95);
    border-color: #e2e8f0;
    box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.12);
}

[data-theme='light'] .mobile-nav-drawer a {
    color: #475569;
}

[data-theme='light'] .mobile-nav-drawer a:hover {
    color: #0f172a;
    background: #f1f5f9;
}

[data-theme='light'] .logo-text {
    color: #0f172a;
}

[data-theme='light'] .hero {
    background-image: radial-gradient(rgba(2, 132, 199, 0.12) 1.2px, transparent 1.2px);
}

[data-theme='light'] .hero-title {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0284c7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme='light'] .hero-subtitle {
    color: #475569;
}

[data-theme='light'] .hero-badge {
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
    border-color: rgba(2, 132, 199, 0.25);
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.08);
}

[data-theme='light'] .hero-badge-highlight {
    color: #0f172a;
}

[data-theme='light'] .btn-outline {
    background: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

[data-theme='light'] .btn-outline:hover {
    background: #f1f5f9;
    color: #0284c7;
    border-color: #0284c7;
}

[data-theme='light'] .btn-secondary {
    background-color: #ffffff;
    color: #0f172a;
    border-color: #cbd5e1;
}

[data-theme='light'] .btn-secondary:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
}

[data-theme='light'] .sidebar-item:hover {
    background: #f1f5f9;
    color: #0284c7;
}

[data-theme='light'] .sidebar-item.active {
    background: #e0f2fe;
    border-color: #7dd3fc;
    color: #0369a1;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.12);
}

[data-theme='light'] .feature-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

[data-theme='light'] .feature-card:hover {
    border-color: #0284c7;
    box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.12);
}

[data-theme='light'] .feature-card h3 {
    color: #0f172a;
}

[data-theme='light'] .feature-card p {
    color: #475569;
}

[data-theme='light'] .how-it-works {
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

[data-theme='light'] .step-item h3 {
    color: #0f172a;
}

[data-theme='light'] .step-item p {
    color: #475569;
}

[data-theme='light'] .arch-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

[data-theme='light'] .arch-card:hover {
    border-color: #0284c7;
    box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.12);
}

[data-theme='light'] .arch-card h3 {
    color: #0f172a;
}

[data-theme='light'] .arch-card p {
    color: #475569;
}

[data-theme='light'] .hero-preview-card {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.1);
}

[data-theme='light'] .preview-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme='light'] .preview-title {
    color: #475569;
}

[data-theme='light'] .org-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

[data-theme='light'] .org-name {
    color: #0f172a;
}

[data-theme='light'] .modal {
    background: rgba(15, 23, 42, 0.45);
}

[data-theme='light'] .modal-content,
[data-theme='light'] .auth-modal-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.15),
        0 0 20px rgba(2, 132, 199, 0.06);
}

[data-theme='light'] .modal-content h2,
[data-theme='light'] .auth-modal-header h2 {
    color: #0f172a;
}

[data-theme='light'] .modal-content .modal-sub,
[data-theme='light'] .auth-modal-header .modal-sub {
    color: #64748b;
}

[data-theme='light'] .custom-checkbox-box {
    background: #ffffff;
    border-color: #cbd5e1;
}

[data-theme='light'] .form-footer {
    border-top-color: #e2e8f0;
    color: #64748b;
}

[data-theme='light'] .auth-switch-link,
[data-theme='light'] .form-footer a {
    color: #0284c7;
    font-weight: 700;
}

[data-theme='light'] .auth-switch-link:hover,
[data-theme='light'] .form-footer a:hover {
    color: #0369a1;
    background: rgba(2, 132, 199, 0.08);
}

[data-theme='light'] .close-modal {
    color: #64748b;
    background: #f1f5f9;
    border-color: #e2e8f0;
}

[data-theme='light'] .close-modal:hover {
    color: #ef4444;
    background: #fee2e2;
    border-color: #fca5a5;
}

[data-theme='light'] .toggle-password-btn {
    color: #64748b;
}

[data-theme='light'] .toggle-password-btn:hover {
    color: #0284c7;
    background-color: rgba(2, 132, 199, 0.1);
}

[data-theme='light'] .footer {
    color: #64748b;
    border-color: #e2e8f0;
}

[data-theme='light'] .form-group input,
[data-theme='light'] .form-group select,
[data-theme='light'] .form-group textarea {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

[data-theme='light'] .form-group input:focus,
[data-theme='light'] .form-group select:focus,
[data-theme='light'] .form-group textarea:focus {
    background: #ffffff;
    color: #0f172a;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

[data-theme='light'] .table {
    border-color: #e2e8f0;
}

[data-theme='light'] .table th {
    background: #f8fafc;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme='light'] .table td {
    border-bottom: 1px solid #f1f5f9;
    color: #0f172a;
}

[data-theme='light'] .table tr:hover td {
    background: #f8fafc;
}

/* Status Badges */
.status-badge {
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.25;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.status-badge .status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-badge.active,
.status-badge.connected,
.status-badge.success {
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.32);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.08);
}

.status-badge.active .status-dot,
.status-badge.connected .status-dot,
.status-badge.success .status-dot {
    background: #10b981;
    box-shadow: 0 0 6px #10b981;
}

.status-badge.draft,
.status-badge.inactive {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.32);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.08);
}

.status-badge.draft .status-dot,
.status-badge.inactive .status-dot {
    background: #fbbf24;
    box-shadow: 0 0 6px rgba(251, 191, 36, 0.6);
}

.status-badge.paused,
.status-badge.failed,
.status-badge.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.status-badge.paused .status-dot,
.status-badge.failed .status-dot,
.status-badge.error .status-dot {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
}

/* Light Theme Badges & Text Visibility */
[data-theme='light'] .status-badge.active,
[data-theme='light'] .status-badge.connected,
[data-theme='light'] .status-badge.success,
[data-theme='clean-light'] .status-badge.active,
[data-theme='clean-light'] .status-badge.connected,
[data-theme='clean-light'] .status-badge.success {
    background: rgba(5, 150, 105, 0.12) !important;
    color: #047857 !important;
    border: 1px solid rgba(5, 150, 105, 0.35) !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

[data-theme='light'] .status-badge.active .status-dot,
[data-theme='light'] .status-badge.connected .status-dot,
[data-theme='light'] .status-badge.success .status-dot,
[data-theme='clean-light'] .status-badge.active .status-dot,
[data-theme='clean-light'] .status-badge.connected .status-dot,
[data-theme='clean-light'] .status-badge.success .status-dot {
    background: #047857 !important;
    box-shadow: none !important;
}

[data-theme='light'] .status-badge.paused,
[data-theme='light'] .status-badge.failed,
[data-theme='light'] .status-badge.error,
[data-theme='clean-light'] .status-badge.paused,
[data-theme='clean-light'] .status-badge.failed,
[data-theme='clean-light'] .status-badge.error {
    background: rgba(220, 38, 38, 0.12) !important;
    color: #b91c1c !important;
    border: 1px solid rgba(220, 38, 38, 0.35) !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

[data-theme='light'] .status-badge.paused .status-dot,
[data-theme='light'] .status-badge.failed .status-dot,
[data-theme='light'] .status-badge.error .status-dot,
[data-theme='clean-light'] .status-badge.paused .status-dot,
[data-theme='clean-light'] .status-badge.failed .status-dot,
[data-theme='clean-light'] .status-badge.error .status-dot {
    background: #b91c1c !important;
    box-shadow: none !important;
}

[data-theme='light'] .status-badge.beta,
[data-theme='light'] .status-badge.draft,
[data-theme='light'] .status-badge.inactive,
[data-theme='light'] .status-badge.warning,
[data-theme='clean-light'] .status-badge.beta,
[data-theme='clean-light'] .status-badge.draft,
[data-theme='clean-light'] .status-badge.inactive,
[data-theme='clean-light'] .status-badge.warning {
    background: rgba(217, 119, 6, 0.12) !important;
    color: #b45309 !important;
    border: 1px solid rgba(217, 119, 6, 0.35) !important;
    font-weight: 700 !important;
    box-shadow: none !important;
}

[data-theme='light'] .status-badge.draft .status-dot,
[data-theme='light'] .status-badge.inactive .status-dot,
[data-theme='clean-light'] .status-badge.draft .status-dot,
[data-theme='clean-light'] .status-badge.inactive .status-dot {
    background: #b45309 !important;
    box-shadow: none !important;
}

[data-theme='light'] .log-step-badge {
    color: #047857 !important;
    font-weight: 700 !important;
}

[data-theme='light'] .log-duration-badge {
    color: #0284c7 !important;
    font-weight: 600 !important;
}

[data-theme='light'] .app-tag {
    background: rgba(2, 132, 199, 0.08) !important;
    border: 1px solid rgba(2, 132, 199, 0.25) !important;
    color: #0369a1 !important;
    font-weight: 600 !important;
}

[data-theme='light'] .app-tag.salesforce {
    background: rgba(2, 132, 199, 0.1) !important;
    border-color: rgba(2, 132, 199, 0.3) !important;
    color: #0284c7 !important;
}

[data-theme='light'] .app-tag.stripe {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
    color: #4f46e5 !important;
}

[data-theme='light'] .app-tag.xero {
    background: rgba(13, 148, 136, 0.1) !important;
    border-color: rgba(13, 148, 136, 0.3) !important;
    color: #0d9488 !important;
}

[data-theme='light'] .app-tag.slack {
    background: rgba(219, 39, 119, 0.1) !important;
    border-color: rgba(219, 39, 119, 0.3) !important;
    color: #db2777 !important;
}

[data-theme='light'] .app-tag.gmail {
    background: rgba(220, 38, 38, 0.1) !important;
    border-color: rgba(220, 38, 38, 0.3) !important;
    color: #dc2626 !important;
}

[data-theme='light'] .app-tag.openai {
    background: rgba(5, 150, 105, 0.1) !important;
    border-color: rgba(5, 150, 105, 0.3) !important;
    color: #059669 !important;
}

[data-theme='light'] .app-tag.a2z_webhook {
    background: rgba(147, 51, 234, 0.1) !important;
    border-color: rgba(147, 51, 234, 0.3) !important;
    color: #9333ea !important;
}

[data-theme='light'] .app-tag.gemini {
    background: rgba(37, 99, 235, 0.1) !important;
    border-color: rgba(37, 99, 235, 0.3) !important;
    color: #2563eb !important;
}

[data-theme='light'] .app-tag.bookings {
    background: rgba(2, 132, 199, 0.1) !important;
    border-color: rgba(2, 132, 199, 0.3) !important;
    color: #0284c7 !important;
}

[data-theme='light'] .connection-endpoint-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

[data-theme='light'] .connection-endpoint-code {
    color: #0284c7;
}

[data-theme='light'] .connections-group-header {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme='light'] .connection-card-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

[data-theme='light'] .connection-card-item:hover {
    border-color: #0284c7;
    box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.12);
}

[data-theme='light'] .connection-card-title {
    color: #0f172a;
}

[data-theme='light'] .custom-combobox-item {
    color: #0f172a;
}

[data-theme='light'] .custom-combobox-item:hover,
[data-theme='light'] .custom-combobox-item.focused {
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
}

[data-theme='light'] .canvas-navbar {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme='light'] .flow-node {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

[data-theme='light'] .flow-node:hover {
    border-color: #0284c7;
    box-shadow: 0 12px 28px -5px rgba(2, 132, 199, 0.12);
}

[data-theme='light'] .node-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme='light'] .node-body {
    background: #ffffff;
}

[data-theme='light'] .node-select,
[data-theme='light'] .node-input {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

[data-theme='light'] .node-select:disabled,
[data-theme='light'] .node-input:disabled {
    background: #f1f5f9;
    border-color: #e2e8f0;
    color: #94a3b8;
}

[data-theme='light'] .config-drawer {
    background: #ffffff;
    border-left: 1px solid #e2e8f0;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.1);
}

[data-theme='light'] .drawer-header,
[data-theme='light'] .drawer-footer {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme='light'] .drawer-body {
    background: #f8fafc;
}

[data-theme='light'] .node-tabs-nav {
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme='light'] .mapping-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}

[data-theme='light'] .mapping-row:hover {
    background: #f8fafc;
    border-color: #0284c7;
}

[data-theme='light'] .preview-glass-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

[data-theme='light'] .preview-glass-val {
    color: #0f172a;
}

[data-theme='light'] .add-step-btn,
[data-theme='light'] .btn-insert-step {
    background: #ffffff;
    border-color: #0284c7;
    color: #0284c7;
}

[data-theme='light'] .add-step-btn:hover,
[data-theme='light'] .btn-insert-step:hover {
    background: #0284c7;
    color: #ffffff;
}

[data-theme='light'] .endpoint-code-box,
[data-theme='light'] pre,
[data-theme='light'] code {
    background: #f1f5f9;
    color: #0f172a;
    border-color: #e2e8f0;
}

[data-theme='light'] .toast {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #0f172a;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.15);
}

[data-theme='light'] .toast-title {
    color: #0f172a;
}

[data-theme='light'] .toast-message {
    color: #475569;
}

/* Theme Toggle Button Style */
.theme-toggle-btn {
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.theme-toggle-btn:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    color: var(--accent-color);
    transform: translateY(-1px);
}

.theme-toggle-btn:active {
    transform: translateY(0);
}

.theme-color-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px var(--accent-glow);
}

/* ==========================================================================
   THEME PALETTE DROPDOWN POPOVER
   ========================================================================== */
.theme-palette-wrapper {
    position: relative;
    display: inline-block;
}

.theme-palette-trigger {
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.theme-current-name {
    white-space: nowrap;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.theme-palette-trigger:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
    box-shadow: 0 0 12px var(--accent-glow);
}

.theme-current-swatch {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 0 8px var(--accent-glow);
    flex-shrink: 0;
}

.theme-palette-dropdown-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    box-shadow:
        0 20px 40px -10px rgba(0, 0, 0, 0.6),
        0 0 20px var(--accent-glow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 8px;
    z-index: 9999;
    display: none;
    flex-direction: column;
    box-sizing: border-box;
    animation: themeMenuIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-palette-dropdown-menu.dropdown-top {
    top: calc(100% + 8px);
    bottom: auto;
    right: 0;
    left: auto;
    width: 250px;
}

.theme-palette-dropdown-menu.active {
    display: flex;
}

@keyframes themeMenuIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(6px);
    }

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

.theme-palette-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px 10px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
}

.theme-palette-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 290px;
    overflow-y: auto;
    padding-right: 2px;
}

.theme-picker-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.theme-picker-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color);
}

.theme-picker-item.active {
    background: var(--bg-card-hover);
    border-color: var(--border-focus);
}

.theme-swatch-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

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

.theme-picker-name {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-picker-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-check-icon {
    margin-left: auto;
    flex-shrink: 0;
}

/* Global Reset & Base Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   GLOBAL CUSTOM SCROLLBAR DESIGN SYSTEM (Smooth, Modern, Minimalist)
   ========================================================================== */

/* Universal Smooth Scrolling */
html,
body,
div,
pre,
code,
textarea,
select {
    scroll-behavior: smooth;
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.6) rgba(11, 15, 25, 0.6);
}

/* WebKit (Chrome, Edge, Safari, Opera, Brave) */
::-webkit-scrollbar {
    width: 7px;
    height: 7px;
}

::-webkit-scrollbar-track {
    background: rgba(11, 15, 25, 0.5);
    border-radius: 9999px;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.28);
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition:
        background 0.2s ease,
        transform 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(56, 189, 248, 0.65);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.4);
}

::-webkit-scrollbar-thumb:active {
    background: #38bdf8;
}

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

/* Ultra-slim scrollbar for inline code, endpoint boxes, textareas */
code::-webkit-scrollbar,
pre::-webkit-scrollbar,
textarea::-webkit-scrollbar,
.endpoint-code-box::-webkit-scrollbar,
.endpoint-code-box code::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

code::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track,
.endpoint-code-box code::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 9999px;
}

code::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb,
.endpoint-code-box code::-webkit-scrollbar-thumb {
    background: rgba(56, 189, 248, 0.35);
    border-radius: 9999px;
}

code::-webkit-scrollbar-thumb:hover,
pre::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover,
.endpoint-code-box code::-webkit-scrollbar-thumb:hover {
    background: #38bdf8;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-canvas);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container Layout */
.app-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
    background-color: var(--bg-canvas);
    position: relative;
}

/* Sleek Left Sidebar */
.sidebar {
    width: 250px;
    min-width: 250px;
    background: var(--bg-surface-0);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 90;
    padding: 20px 14px;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 24px;
    padding: 0 6px;
    letter-spacing: -0.02em;
}

.sidebar-logo .logo-icon {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    padding: 0;
}

.sidebar-logo .logo-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.sidebar-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid transparent;
}

.sidebar-item:hover {
    background: var(--bg-card-hover);
    color: var(--text-main);
    transform: translateX(2px);
}

.sidebar-item.active {
    background: var(--accent-glow);
    border-color: var(--border-focus);
    color: var(--text-main);
    font-weight: 600;
    box-shadow: 0 4px 14px var(--accent-glow);
}

.sidebar-footer {
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.main-content {
    margin-left: 250px;
    flex: 1;
    min-width: 0;
    max-width: calc(100vw - 250px);
    box-sizing: border-box;
    padding: 28px 32px;
    background: var(--bg-canvas);
    min-height: 100vh;
    overflow-x: hidden;
}

@media (max-width: 1366px) {
    .main-content {
        padding: 22px 24px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
        min-width: 220px;
    }

    .main-content {
        margin-left: 220px;
        max-width: calc(100vw - 220px);
        padding: 18px 20px;
    }
}

.tab-pane {
    display: none;
    animation: fadeIn 0.2s ease-out;
}

.tab-pane.active {
    display: block;
}

/* Landing Page Navbar */
.navbar {
    background-color: var(--bg-surface-0);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 68px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo-text span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 28px;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent-color);
}

.nav-actions {
    display: flex;
    gap: 10px;
}

/* Modern Buttons */
.btn {
    font-family: var(--font-sans);
    height: 36px;
    padding: 0 14px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    white-space: nowrap;
    line-height: 1;
    user-select: none;
    box-sizing: border-box;
}

.btn-primary {
    background: var(--primary-color, #0284c7);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover {
    background: var(--primary-hover, #0369a1);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(2, 132, 199, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.btn-outline {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.btn-outline:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--text-main);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.btn-sm {
    height: 28px !important;
    padding: 0 10px !important;
    font-size: 0.8125rem !important;
    border-radius: 6px !important;
    gap: 5px !important;
}

.btn-icon {
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    flex-shrink: 0;
}

.btn-icon-sm {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    flex-shrink: 0;
}

.btn-pill {
    border-radius: var(--radius-pill);
}

.btn-lg {
    padding: 12px 24px;
    font-size: 0.98rem;
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
    padding: 11px;
}

.btn:disabled,
.node-tab-btn:disabled,
button:disabled {
    opacity: 0.8 !important;
    cursor: not-allowed !important;
    pointer-events: auto !important;
    background: #1e293b !important;
    background-image: none !important;
    border-color: rgba(255, 255, 255, 0.12) !important;
    color: #94a3b8 !important;
    box-shadow: none !important;
    transform: none !important;
}

.btn-primary:disabled {
    background: rgba(30, 41, 59, 0.9) !important;
    background-image: none !important;
    border: 1px solid rgba(56, 189, 248, 0.3) !important;
    color: #93c5fd !important;
    opacity: 0.85 !important;
}

/* Modern Form Controls */
.form-group {
    margin-bottom: 18px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.node-input,
.node-select {
    width: 100%;
    height: 36px;
    padding: 0 12px;
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    outline: none;
    transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

.form-group input:hover,
.form-group select:hover,
.node-input:hover,
.node-select:hover {
    border-color: rgba(255, 255, 255, 0.18);
}

.form-group input:focus,
.form-group select:focus,
.node-input:focus,
.node-select:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
    background: var(--bg-surface-0) !important;
    color: var(--text-main) !important;
}

.input-sm,
.node-input-sm {
    height: 28px !important;
    padding: 0 8px !important;
    font-size: 0.8125rem !important;
    border-radius: 5px !important;
}

.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--bg-input) inset !important;
    -webkit-text-fill-color: var(--text-main) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Password Input with Eye Toggle */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.password-input-wrapper input {
    width: 100%;
    padding-right: 44px !important;
}

.toggle-password-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    user-select: none;
    z-index: 5;
}

.toggle-password-btn:hover {
    color: var(--accent-color);
    background-color: rgba(56, 189, 248, 0.12);
}

/* ==========================================================================
   Interactive Password Strength & Requirements Checklist Card
   ========================================================================== */
.password-checklist-card {
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm, 10px);
    padding: 12px 14px;
    margin-top: 10px;
    margin-bottom: 12px;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(8px);
}

[data-theme='light'] .password-checklist-card {
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(226, 232, 240, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

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

.checklist-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #94a3b8);
}

.checklist-title i,
.checklist-title svg {
    width: 14px;
    height: 14px;
    color: var(--accent-color, #38bdf8);
}

.strength-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    transition: all 0.2s ease;
    text-transform: capitalize;
}

.strength-badge.badge-neutral {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted, #94a3b8);
}

.strength-badge.badge-weak {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

.strength-badge.badge-fair {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.2);
}

.strength-badge.badge-good {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.strength-badge.badge-strong {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* 5-segment Strength Track */
.strength-meter-track {
    display: flex;
    gap: 4px;
    height: 4px;
    margin-bottom: 10px;
    width: 100%;
}

.meter-segment {
    flex: 1;
    height: 100%;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    transition:
        background 0.3s ease,
        box-shadow 0.3s ease;
}

[data-theme='light'] .meter-segment {
    background: rgba(0, 0, 0, 0.08);
}

.meter-segment.active-red {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.meter-segment.active-orange {
    background: #f97316;
    box-shadow: 0 0 6px rgba(249, 115, 22, 0.4);
}

.meter-segment.active-amber {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.meter-segment.active-cyan {
    background: #38bdf8;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}

.meter-segment.active-green {
    background: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

/* Rules Grid */
.checklist-rules {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
}

@media (max-width: 480px) {
    .checklist-rules {
        grid-template-columns: 1fr;
    }
}

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

.rule-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-muted, #94a3b8);
    transition: all 0.2s ease;
    user-select: none;
}

.rule-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid rgba(148, 163, 184, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    background: transparent;
    position: relative;
}

.rule-icon .check-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.2s ease;
}

.rule-item.valid {
    color: var(--text-main, #f8fafc);
}

[data-theme='light'] .rule-item.valid {
    color: #0f172a;
}

.rule-item.valid .rule-icon {
    background: #10b981;
    border-color: #10b981;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    animation: popCheck 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.rule-item.valid .rule-icon::after {
    content: '';
    display: block;
    width: 3.5px;
    height: 7px;
    border: solid white;
    border-width: 0 1.8px 1.8px 0;
    transform: rotate(45deg) translate(-0.5px, -0.5px);
}

.rule-item.valid .check-dot {
    display: none;
}

.rule-item.valid .rule-label {
    font-weight: 500;
}

@keyframes popCheck {
    0% {
        transform: scale(0.7);
    }

    60% {
        transform: scale(1.25);
    }

    100% {
        transform: scale(1);
    }
}

/* Unified Enterprise Modal Architecture */
.modal,
.modal-backdrop,
.flow-modal-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(3, 7, 18, 0.75);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

.modal.active,
.modal[style*="display: flex"],
.modal[style*="display: block"] {
    display: flex !important;
}

.modal-content,
.modal-card,
.flow-modal-content {
    background: var(--bg-card, #121929);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-md, 12px);
    width: 100%;
    max-width: min(640px, 94vw);
    max-height: min(88vh, 850px);
    padding: 28px 30px;
    box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 255, 255, 0.05);
    box-sizing: border-box;
    overflow-y: auto;
    position: relative;
    animation: modalPop 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.close-modal,
.modal-close-btn,
.drawer-close-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
}

.close-modal:hover,
.modal-close-btn:hover,
.drawer-close-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

/* Enhanced Auth Glassmorphic Card */
.auth-modal-card {
    max-width: 480px;
    background: linear-gradient(165deg, var(--bg-surface-0) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 36px 32px 30px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    box-shadow:
        0 30px 70px -15px rgba(0, 0, 0, 0.8),
        0 0 40px var(--accent-glow),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 22px;
}

.auth-modal-icon-badge {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2) 0%, rgba(2, 132, 199, 0.35) 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    margin-bottom: 14px;
    box-shadow: 0 4px 18px var(--accent-glow);
    transition: transform 0.3s ease;
}

.auth-modal-card:hover .auth-modal-icon-badge {
    transform: scale(1.08) rotate(4deg);
}

.auth-modal-header h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.auth-modal-header .modal-sub {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

/* Input Icon Wrappers */
.input-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.input-leading-icon {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    pointer-events: none;
    z-index: 2;
    transition: color 0.2s ease;
}

.input-icon-wrapper input {
    width: 100%;
    padding-left: 42px !important;
}

.input-icon-wrapper input:focus+.input-leading-icon,
.input-icon-wrapper:focus-within .input-leading-icon {
    color: var(--accent-color);
}

/* Remember Me & Forgot Password Row */
.auth-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    margin-top: 4px;
    font-size: 0.84rem;
}

.remember-me-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
}

.remember-me-label input[type='checkbox'] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-checkbox-box {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.remember-me-label input[type='checkbox']:checked+.custom-checkbox-box {
    background: var(--primary-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-glow);
}

.remember-me-label input[type='checkbox']:checked+.custom-checkbox-box::after {
    content: '✓';
    color: white;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
}

.forgot-pwd-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.forgot-pwd-link:hover {
    text-decoration: underline;
    filter: brightness(1.2);
}

/* Auth Submit Button */
.btn-auth-submit {
    padding: 13px 20px;
    font-size: 0.95rem;
    font-weight: 700;
    box-shadow: 0 4px 18px var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
}

/* Auth Modal Form Footer & Switch Links */
.form-footer {
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    text-align: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.5;
}

.auth-switch-link,
.form-footer a {
    color: var(--accent-color);
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: var(--radius-sm, 6px);
    background: transparent;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-switch-link:hover,
.form-footer a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 12px var(--accent-glow);
    text-decoration: none;
    transform: translateX(1px);
}

.auth-switch-link:hover i,
.form-footer a:hover i {
    transform: translateX(2px);
    transition: transform 0.2s ease;
}

.auth-switch-link i,
.form-footer a i {
    transition: transform 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-8px);
    }

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

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    z-index: 10;
}

.close-modal:hover {
    color: white;
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
}

/* Custom Dialog / Confirmation & Alert Modal */
.custom-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(4, 7, 13, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    box-sizing: border-box;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.custom-dialog-card {
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 30px 28px 24px;
    width: 100%;
    max-width: 440px;
    box-shadow:
        0 25px 50px -12px rgba(0, 0, 0, 0.55),
        0 0 30px rgba(56, 189, 248, 0.08);
    transform: scale(0.92) translateY(8px);
    transition:
        transform 0.24s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.24s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    box-sizing: border-box;
}

.custom-dialog-overlay.active .custom-dialog-card {
    transform: scale(1) translateY(0);
}

.custom-dialog-icon-wrapper {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.custom-dialog-icon-wrapper.danger {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

.custom-dialog-icon-wrapper.warning {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #f59e0b;
}

.custom-dialog-icon-wrapper.info,
.custom-dialog-icon-wrapper.primary {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
}

.custom-dialog-icon-wrapper.success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.custom-dialog-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.custom-dialog-message {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 0 0 22px;
    word-break: break-word;
}

.custom-dialog-actions {
    display: flex;
    gap: 12px;
    width: 100%;
}

.custom-dialog-btn {
    flex: 1;
    padding: 11px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}

.custom-dialog-btn-cancel {
    background: var(--bg-surface-1);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.custom-dialog-btn-cancel:hover {
    background: var(--bg-surface-2);
    border-color: var(--border-hover);
}

.custom-dialog-btn-confirm.danger {
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.custom-dialog-btn-confirm.danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.45);
    transform: translateY(-1px);
}

.custom-dialog-btn-confirm.primary,
.custom-dialog-btn-confirm.info {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.custom-dialog-btn-confirm.primary:hover,
.custom-dialog-btn-confirm.info:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    box-shadow: 0 6px 20px rgba(2, 132, 199, 0.45);
    transform: translateY(-1px);
}

.custom-dialog-btn-confirm.warning {
    background: #f59e0b;
    color: #0f172a;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.custom-dialog-btn-confirm.warning:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.custom-dialog-btn-confirm.success {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

.custom-dialog-btn-confirm.success:hover {
    background: #059669;
    transform: translateY(-1px);
}

/* Light Mode Overrides for Custom Dialog */
[data-theme='light'] .custom-dialog-overlay {
    background: rgba(15, 23, 42, 0.52);
}

[data-theme='light'] .custom-dialog-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow:
        0 25px 60px -15px rgba(0, 0, 0, 0.15),
        0 0 20px rgba(2, 132, 199, 0.08);
}

[data-theme='light'] .custom-dialog-title {
    color: #0f172a;
}

[data-theme='light'] .custom-dialog-message {
    color: #64748b;
}

[data-theme='light'] .custom-dialog-btn-cancel {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

[data-theme='light'] .custom-dialog-btn-cancel:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #0f172a;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 320px;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
    color: white;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition:
        opacity 0.3s,
        transform 0.3s;
}

.toast.toast-success {
    border-left-color: #10b981;
}

.toast.toast-error {
    border-left-color: #ef4444;
}

.toast.toast-info {
    border-left-color: #38bdf8;
}

.toast-title {
    font-weight: 700;
    font-size: 0.92rem;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 0.84rem;
    color: var(--text-muted);
}

.toast-close-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s;
    align-self: flex-start;
}

.toast-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(80px);
    }

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

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 0.85s linear infinite;
    display: inline-block;
}

/* Navigation Header - Floating Glass Pill with Interactive Animations (Linear / Raycast Inspired) */
.navbar {
    position: sticky;
    top: 14px;
    z-index: 1000;
    width: calc(100% - 32px);
    max-width: 1280px;
    margin: 14px auto 0;
    height: 58px;
    padding: 0 14px 0 18px;
    border-radius: var(--radius-pill);
    background: rgba(14, 20, 34, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 14px 35px -10px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    transition:
        height 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        padding 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease,
        transform 0.3s ease;
}

/* Interactive Cursor Spotlight Glow on Floating Pill */
.navbar::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: radial-gradient(200px circle at var(--nav-mx, -200px) var(--nav-my, -200px),
            var(--accent-color),
            transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: -1;
    padding: 1px;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.navbar:hover::before {
    opacity: 0.85;
}

/* Scrolled State: Compact Elevation & Luminous Shadow */
.navbar.is-scrolled {
    height: 52px;
    background: rgba(10, 15, 26, 0.9);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow:
        0 18px 45px -10px rgba(0, 0, 0, 0.8),
        0 0 24px rgba(56, 189, 248, 0.14);
}

[data-theme='light'] .navbar.is-scrolled {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(2, 132, 199, 0.35);
    box-shadow:
        0 14px 35px -10px rgba(15, 23, 42, 0.12),
        0 0 18px rgba(2, 132, 199, 0.1);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 14px;
}

/* Sliding Liquid Indicator Track */
.nav-links {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.04);
    padding: 3px 4px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-indicator-pill {
    position: absolute;
    top: 3px;
    left: 0;
    height: calc(100% - 6px);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    pointer-events: none;
    opacity: 0;
    transition:
        transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
        width 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.2s ease,
        background 0.2s ease;
    z-index: 0;
}

.nav-indicator-pill.active {
    background: rgba(56, 189, 248, 0.14);
    border-color: rgba(56, 189, 248, 0.3);
    box-shadow: 0 0 14px var(--accent-glow);
}

[data-theme='light'] .nav-indicator-pill {
    background: #ffffff;
    border-color: rgba(203, 213, 225, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme='light'] .nav-indicator-pill.active {
    background: #ffffff;
    border-color: rgba(2, 132, 199, 0.35);
    box-shadow: 0 2px 10px rgba(2, 132, 199, 0.16);
}

.nav-links a {
    position: relative;
    z-index: 1;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.84rem;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    transition: color 0.2s ease;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-main);
}

[data-theme='light'] .nav-links a:hover,
[data-theme='light'] .nav-links a.active {
    color: #0284c7;
}

/* ----------------------------------------------------
   Navigation Link Motion: Entrance, Sheen & Feedback
   ---------------------------------------------------- */
.nav-links {
    animation: navTrackIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

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

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

.nav-links a {
    overflow: hidden;
    animation: navLinkIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
    animation-delay: calc(0.1s + var(--nav-i, 0) * 55ms);
    transition:
        color 0.2s ease,
        transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.2s ease;
}

.nav-links a:nth-child(2) {
    --nav-i: 0;
}

.nav-links a:nth-child(3) {
    --nav-i: 1;
}

.nav-links a:nth-child(4) {
    --nav-i: 2;
}

.nav-links a:nth-child(5) {
    --nav-i: 3;
}

.nav-links a:nth-child(6) {
    --nav-i: 4;
}

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

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

/* Light sweep that glides across the link on hover */
.nav-links a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.22) 50%, transparent 65%);
    transform: translateX(-130%);
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.nav-links a:hover::after {
    animation: navSheenSweep 0.65s ease-out;
}

@keyframes navSheenSweep {
    0% {
        transform: translateX(-130%);
        opacity: 0;
    }

    25% {
        opacity: 1;
    }

    100% {
        transform: translateX(130%);
        opacity: 0;
    }
}

[data-theme='light'] .nav-links a::after {
    background: linear-gradient(105deg, transparent 35%, rgba(2, 132, 199, 0.16) 50%, transparent 65%);
}

.nav-links a:hover {
    transform: translateY(-1px);
}

.nav-links a:active {
    transform: scale(0.94);
}

/* Soft breathing glow on the active pill */
.nav-indicator-pill.active {
    animation: navPillBreathe 2.6s ease-in-out infinite;
}

@keyframes navPillBreathe {

    0%,
    100% {
        box-shadow: 0 0 10px var(--accent-glow);
    }

    50% {
        box-shadow: 0 0 20px var(--accent-glow);
    }
}

@media (prefers-reduced-motion: reduce) {

    .nav-links,
    .nav-links a,
    .nav-links a:hover::after,
    .nav-indicator-pill.active {
        animation: none;
    }

    .nav-links a,
    .nav-indicator-pill {
        transition:
            color 0.2s ease,
            opacity 0.2s ease;
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    white-space: nowrap;
}

.navbar .theme-palette-wrapper {
    position: relative;
    flex-shrink: 0;
}

.navbar .theme-palette-trigger {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    border-radius: var(--radius-pill);
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    height: 36px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.navbar .theme-palette-trigger:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--border-hover);
    color: var(--text-main);
}

.navbar .theme-current-name {
    white-space: nowrap;
    max-width: 105px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

.navbar #openLoginBtn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    border-radius: var(--radius-pill);
    padding: 6px 14px;
    font-size: 0.84rem;
    font-weight: 600;
    height: 36px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.navbar #openLoginBtn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

/* Sign Up / Dashboard Button: High-Tech Shimmer Sweep & Glow */
.navbar #openSignupBtn,
.navbar .btn-primary {
    position: relative;
    overflow: hidden;
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-pill);
    padding: 7px 18px;
    font-size: 0.84rem;
    font-weight: 700;
    height: 36px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 2px 10px var(--accent-glow);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.navbar #openSignupBtn::after,
.navbar .btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -80%;
    width: 50%;
    height: 200%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
    transform: rotate(25deg);
    animation: btnShimmerSweep 4.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes btnShimmerSweep {

    0%,
    70% {
        left: -80%;
        opacity: 0;
    }

    75% {
        opacity: 1;
    }

    100% {
        left: 140%;
        opacity: 0;
    }
}

.navbar #openSignupBtn:hover,
.navbar .btn-primary:hover {
    transform: translateY(-1px) scale(1.02);
    box-shadow: 0 4px 18px var(--accent-glow);
    color: #ffffff;
}

.logo:hover .a2z-logo-mark {
    transform: scale(1.08) rotate(-4deg);
}

.a2z-logo-mark {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: var(--radius-pill);
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Mobile Nav Drawer Dropdown */
.mobile-nav-drawer {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: rgba(14, 20, 34, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 18px;
    padding: 10px 8px;
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.7);
    flex-direction: column;
    gap: 4px;
    z-index: 999;
}

.mobile-nav-drawer.active {
    display: flex;
    animation: drawerFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.mobile-nav-drawer a {
    color: var(--text-muted);
    text-decoration: none;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.18s ease;
}

.mobile-nav-drawer a:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

/* Responsive Breakpoints for Floating Pill (Laptops, Tablets & Mobile) */
@media (max-width: 1280px) {
    .navbar {
        width: calc(100% - 24px);
        padding: 0 12px 0 16px;
    }

    .nav-container {
        gap: 10px;
    }

    .nav-links a {
        padding: 5px 9px;
        font-size: 0.81rem;
    }

    .nav-actions {
        gap: 6px;
    }

    .navbar .theme-palette-trigger {
        padding: 5px 10px;
        font-size: 0.78rem;
        gap: 5px;
    }

    .navbar #openLoginBtn {
        padding: 5px 11px;
        font-size: 0.82rem;
    }

    .navbar #openSignupBtn,
    .navbar .btn-primary {
        padding: 6px 14px;
        font-size: 0.82rem;
    }
}

@media (max-width: 1200px) {
    .navbar {
        padding: 0 10px 0 14px;
    }

    .nav-container {
        gap: 8px;
    }

    .logo {
        font-size: 1.15rem;
        gap: 8px;
    }

    .logo-icon {
        width: 30px;
        height: 30px;
    }

    .nav-links {
        gap: 1px;
        padding: 2px 3px;
    }

    .nav-links a {
        padding: 4px 7px;
        font-size: 0.77rem;
    }

    /* Hide long theme name text on compact laptops, keeping swatch dot & chevron */
    .navbar .theme-current-name {
        display: none;
    }

    .navbar .theme-palette-trigger {
        padding: 5px 8px;
    }

    .navbar #openLoginBtn {
        padding: 5px 8px;
        font-size: 0.78rem;
    }

    .navbar #openSignupBtn,
    .navbar .btn-primary {
        padding: 5px 12px;
        font-size: 0.78rem;
    }
}

@media (max-width: 1024px) {
    .nav-links {
        display: none !important;
    }

    .mobile-menu-toggle {
        display: inline-flex;
    }

    .navbar {
        width: calc(100% - 24px);
    }
}

@media (max-width: 640px) {
    .navbar {
        width: calc(100% - 16px);
        margin: 8px auto 0;
        top: 8px;
        padding: 0 10px 0 12px;
        height: 52px;
    }

    .logo-text {
        font-size: 0.98rem;
    }

    .navbar .theme-current-name {
        display: none;
    }

    .navbar #openLoginBtn {
        padding: 5px 8px;
        font-size: 0.78rem;
    }

    .navbar #openSignupBtn,
    .navbar .btn-primary {
        padding: 5px 11px;
        font-size: 0.78rem;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    white-space: nowrap;
    flex-shrink: 0;
}

.logo-icon {
    width: 34px;
    height: 34px;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
    padding: 0;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.logo-text {
    color: var(--text-main);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.logo-text span {
    color: var(--accent-color);
}

/* Landing Page Hero Section */
.hero {
    padding: 100px 0 70px;
    text-align: center;
    position: relative;
    background-image: radial-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
}

.hero-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 6px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 24px;
    box-shadow: 0 2px 10px rgba(56, 189, 248, 0.1);
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
}

.hero-badge-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    flex-shrink: 0;
}

.hero-badge-highlight {
    font-weight: 700;
    color: var(--text-main);
}

.hero-badge-sep {
    opacity: 0.45;
    font-size: 0.75rem;
}

.hero-badge-preview {
    color: var(--accent-color);
    font-weight: 600;
}

.hero-title {
    font-size: 3.4rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 20px;
    max-width: 880px;
    background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 50%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 740px;
    margin-bottom: 36px;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    gap: 16px;
    margin-bottom: 56px;
}

/* Hero Preview Card */
.hero-preview-card {
    width: 100%;
    max-width: 840px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition:
        transform 0.3s ease,
        border-color 0.3s ease;
}

.hero-preview-card:hover {
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateY(-2px);
}

.preview-header {
    background: rgba(14, 20, 34, 0.85);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid var(--border-color);
}

.dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.dot.red {
    background: #ef4444;
}

.dot.yellow {
    background: #f59e0b;
}

.dot.green {
    background: #10b981;
}

.preview-title {
    margin-left: 12px;
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
}

.preview-body {
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.org-box {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid var(--border-color);
    padding: 20px 24px;
    border-radius: var(--radius-md);
    width: 220px;
    text-align: left;
    transition: all 0.2s ease;
}

.org-box:hover {
    border-color: rgba(56, 189, 248, 0.35);
    background: rgba(18, 25, 41, 0.95);
}

.org-tag {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-color);
    font-weight: 700;
    margin-bottom: 4px;
}

.org-name {
    font-weight: 600;
    font-size: 0.96rem;
    margin-bottom: 6px;
    color: var(--text-main);
}

.org-status {
    font-size: 0.82rem;
    color: var(--success-color);
    font-weight: 500;
}

.sync-flow-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.sync-icon {
    font-size: 1.6rem;
    color: var(--accent-color);
}

.sync-speed {
    font-size: 0.76rem;
    font-weight: 600;
    background: rgba(56, 189, 248, 0.15);
    color: var(--accent-color);
    padding: 3px 12px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(56, 189, 248, 0.25);
}

/* Features Section */
.features {
    padding: 90px 0;
    border-top: 1px solid var(--border-color);
}

.section-header {
    text-align: center;
    margin-bottom: 56px;
}

.section-header h2 {
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
    max-width: 620px;
    margin: 0 auto;
}

/* Section Pill Badges & Gradient Text */
.section-pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--accent-color);
    margin-bottom: 16px;
    box-shadow: 0 0 16px var(--accent-glow);
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-color) 0%, #38bdf8 50%, #818cf8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

[data-theme='light'] .text-gradient {
    background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.features {
    padding: 100px 0 120px;
    position: relative;
    background: radial-gradient(circle at 50% 10%, rgba(56, 189, 248, 0.03) 0%, transparent 70%);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    max-width: 1240px;
    margin: 0 auto;
}

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

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

/* Feature Cards - Modern Glassmorphism & High Elevation */
.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 28px 26px 24px;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition:
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    transition: background 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-6px);
    box-shadow:
        0 20px 40px -15px rgba(0, 0, 0, 0.5),
        0 0 25px rgba(56, 189, 248, 0.15);
}

/* Card Accent Variations */
.feature-card-cyan:hover {
    border-color: rgba(56, 189, 248, 0.5);
}

.feature-card-cyan::before {
    background: linear-gradient(90deg, #38bdf8, #0284c7);
}

.feature-card-amber:hover {
    border-color: rgba(245, 158, 11, 0.5);
}

.feature-card-amber::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.feature-card-purple:hover {
    border-color: rgba(192, 132, 252, 0.5);
}

.feature-card-purple::before {
    background: linear-gradient(90deg, #c084fc, #8b5cf6);
}

.feature-card-emerald:hover {
    border-color: rgba(16, 185, 129, 0.5);
}

.feature-card-emerald::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.feature-card-rose:hover {
    border-color: rgba(244, 63, 94, 0.5);
}

.feature-card-rose::before {
    background: linear-gradient(90deg, #f43f5e, #fb7185);
}

.feature-card-blue:hover {
    border-color: rgba(59, 130, 246, 0.5);
}

.feature-card-blue::before {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* Card Header & Icon Squircles */
.feature-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.feature-icon-box {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.feature-card:hover .feature-icon-box {
    transform: scale(1.08) rotate(3deg);
}

.icon-box-cyan {
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: #38bdf8;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.18);
}

.icon-box-amber {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.28);
    color: #f59e0b;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
}

.icon-box-purple {
    background: rgba(192, 132, 252, 0.12);
    border: 1px solid rgba(192, 132, 252, 0.28);
    color: #c084fc;
    box-shadow: 0 4px 14px rgba(192, 132, 252, 0.18);
}

.icon-box-emerald {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.28);
    color: #10b981;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.18);
}

.icon-box-rose {
    background: rgba(244, 63, 94, 0.12);
    border: 1px solid rgba(244, 63, 94, 0.28);
    color: #f43f5e;
    box-shadow: 0 4px 14px rgba(244, 63, 94, 0.18);
}

.icon-box-blue {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.28);
    color: #3b82f6;
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.18);
}

/* Feature Badge Pill */
.feature-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.badge-cyan {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
}

.badge-amber {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-purple {
    background: rgba(192, 132, 252, 0.12);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.25);
}

.badge-emerald {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-rose {
    background: rgba(244, 63, 94, 0.12);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.25);
}

.badge-blue {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* Card Headings and Text */
.feature-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 22px;
    flex-grow: 1;
}

/* Feature Card Mini Widgets */
.feature-mini-widget {
    margin-top: auto;
    padding: 13px 15px;
    background: var(--bg-surface-0);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
}

[data-theme='light'] .feature-mini-widget {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.widget-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.widget-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.78rem;
}

.widget-status-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.74rem;
    font-weight: 600;
}

.widget-status-dot.active {
    color: #10b981;
}

.widget-auth-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-top: 8px;
}

.auth-pill {
    padding: 4px 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.22);
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 5px;
}

.widget-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-val {
    font-size: 0.78rem;
    font-weight: 700;
}

.widget-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    margin: 7px 0;
}

[data-theme='light'] .widget-progress-bar {
    background: #e2e8f0;
}

.widget-progress-fill {
    height: 100%;
    border-radius: 4px;
}

.fill-amber {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.widget-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.mapping-pill-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(192, 132, 252, 0.08);
    border: 1px solid rgba(192, 132, 252, 0.2);
    border-radius: 6px;
    padding: 5px 9px;
    margin-bottom: 6px;
    font-family: var(--font-mono);
    font-size: 0.73rem;
}

.mapping-pill-item:last-child {
    margin-bottom: 0;
}

.pill-field {
    color: var(--text-main);
}

.pill-target {
    color: #c084fc;
    font-weight: 600;
}

.tree-flow-visual {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tree-node {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-main);
}

.tree-node span {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.68rem;
}

.tree-arrow {
    padding-left: 10px;
    display: flex;
    align-items: center;
}

.tree-child {
    margin-left: 14px;
    background: rgba(16, 185, 129, 0.14);
}

.log-stream-preview {
    font-family: var(--font-mono);
    font-size: 0.71rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.log-entry {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-tag {
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

.tag-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.tag-info {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.code-snippet-box {
    font-family: var(--font-mono);
    font-size: 0.73rem;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.06);
    padding: 7px 10px;
    border-radius: 6px;
    border-left: 3px solid #38bdf8;
}

.code-prefix {
    color: #f59e0b;
    font-weight: 700;
}

/* How It Works Section */
.how-it-works {
    padding: 90px 0;
    background: rgba(14, 20, 34, 0.5);
    border-top: 1px solid var(--border-color);
}

.steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
}

.step-item {
    text-align: center;
    padding: 24px;
}

.step-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: white;
    font-weight: 800;
    font-size: 1.3rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.step-item h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
}

.step-item p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

/* Architecture Section */
.architecture {
    padding: 90px 0;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface-0);
}

.architecture-grid {
    margin: 0px 20px 0px 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.arch-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 28px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.arch-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.arch-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
}

.arch-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.arch-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ==========================================================================
   Landing Page Pricing & Plans Section
   ========================================================================== */
.pricing-section {
    padding: 100px 0 110px;
    position: relative;
    border-top: 1px solid var(--border-color);
    background: radial-gradient(circle at 50% 12%, rgba(56, 189, 248, 0.04) 0%, transparent 60%);
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    max-width: 1240px;
    margin: 0 auto 48px;
    align-items: stretch;
}

@media (max-width: 1160px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

@media (max-width: 640px) {
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 24px 26px;
    display: flex;
    flex-direction: column;
    position: relative;
    transition:
        transform 0.28s cubic-bezier(0.4, 0, 0.2, 1),
        border-color 0.28s ease,
        box-shadow 0.28s ease;
    box-shadow: var(--shadow-sm);
}

.pricing-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow:
        var(--shadow-lg),
        0 0 25px rgba(56, 189, 248, 0.12);
}

.pricing-card-featured {
    border-color: rgba(56, 189, 248, 0.45);
    background: linear-gradient(180deg, rgba(14, 20, 34, 0.98) 0%, var(--bg-card) 100%);
    box-shadow:
        0 12px 30px -10px rgba(0, 0, 0, 0.6),
        0 0 25px rgba(56, 189, 248, 0.16);
}

.pricing-card-featured:hover {
    border-color: rgba(56, 189, 248, 0.7);
    box-shadow:
        0 20px 45px -12px rgba(0, 0, 0, 0.7),
        0 0 35px rgba(56, 189, 248, 0.25);
}

.pricing-popular-ribbon {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 3px 14px;
    border-radius: var(--radius-pill);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    z-index: 2;
}

.pricing-card-header {
    margin-bottom: 8px;
}

.pricing-tier-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-color);
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    padding: 2px 10px;
    border-radius: var(--radius-pill);
    margin-bottom: 8px;
}

.pricing-tier-tag.badge-cyan {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.3);
}

.pricing-tier-tag.badge-purple {
    color: #c084fc;
    background: rgba(192, 132, 252, 0.12);
    border-color: rgba(192, 132, 252, 0.3);
}

.pricing-tier-tag.badge-emerald {
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.3);
}

.pricing-tier-name {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 4px 0 6px;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.pricing-tier-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
    min-height: 38px;
    margin: 0;
}

.pricing-card-price-block {
    margin: 16px 0 14px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.pricing-price-wrap {
    display: flex;
    align-items: baseline;
    gap: 3px;
}

.pricing-currency {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-muted);
}

.pricing-amount {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1;
    letter-spacing: -0.03em;
}

.pricing-period {
    font-size: 0.84rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 2px;
}

.pricing-unit-rate {
    font-size: 0.74rem;
    color: var(--text-dim);
    margin-top: 6px;
    font-weight: 500;
}

.pricing-credit-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-main);
    margin-bottom: 20px;
}

.pricing-credit-badge.popular-credit-badge {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.25);
    color: var(--text-main);
}

.pricing-features-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 11px;
    flex-grow: 1;
}

.pricing-features-list li {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.pricing-features-list li strong {
    color: var(--text-main);
}

.pricing-features-list .check-icon {
    color: #10b981;
    flex-shrink: 0;
    margin-top: 2px;
}

.pricing-btn {
    margin-top: auto;
    padding: 11px 18px;
    font-weight: 700;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Fair Billing Guarantees Ribbon Banner */
.pricing-guarantees-wrapper {
    background: linear-gradient(135deg, var(--bg-surface-0) 0%, var(--bg-card) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 30px;
    max-width: 1240px;
    margin: 0 auto;
    box-shadow: var(--shadow-sm);
}

.pricing-guarantees-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: #10b981;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.pricing-guarantees-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
}

@media (max-width: 1040px) {
    .pricing-guarantees-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 620px) {
    .pricing-guarantees-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

.pricing-guarantee-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.guarantee-icon-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.guarantee-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px;
}

.guarantee-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
}

/* Light Mode Overrides for Pricing Section */
[data-theme='light'] .pricing-section {
    background: radial-gradient(circle at 50% 12%, rgba(2, 132, 199, 0.04) 0%, transparent 60%);
    border-color: #e2e8f0;
}

[data-theme='light'] .pricing-card {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme='light'] .pricing-card:hover {
    border-color: rgba(2, 132, 199, 0.4);
    box-shadow:
        0 16px 32px -10px rgba(0, 0, 0, 0.1),
        0 0 20px rgba(2, 132, 199, 0.1);
}

[data-theme='light'] .pricing-card-featured {
    border-color: #0284c7;
    background: #ffffff;
    box-shadow: 0 10px 30px -8px rgba(2, 132, 199, 0.2);
}

[data-theme='light'] .pricing-card-price-block {
    border-bottom-color: #f1f5f9;
}

[data-theme='light'] .pricing-credit-badge {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme='light'] .pricing-credit-badge.popular-credit-badge {
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.25);
    color: #0369a1;
}

[data-theme='light'] .pricing-guarantees-wrapper {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Footer */
.footer {
    padding: 36px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ==========================================================================
   Enterprise Multi-Column Footer with OAuth Trust & Live Status
   ========================================================================== */
.footer-enterprise {
    background: linear-gradient(180deg, transparent 0%, rgba(10, 15, 26, 0.95) 100%);
    border-top: 1px solid var(--border-color);
    padding: 68px 0 32px;
    margin-top: 60px;
    position: relative;
    z-index: 2;
}

[data-theme='light'] .footer-enterprise {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-top-color: #cbd5e1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr 1fr 1.1fr 1fr;
    gap: 40px;
    margin-bottom: 48px;
    padding: 0 60px;
}

.footer-bottom-bar {
    padding-left: 60px;
    padding-right: 60px;
}

.footer-brand-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.status-indicator-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 600;
    color: #10b981;
    transition: all 0.2s ease;
}

.status-indicator-pill:hover {
    background: rgba(16, 185, 129, 0.16);
    border-color: #10b981;
    transform: translateY(-1px);
}

.status-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: statusPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.85);
    }
}

.footer-col h4 {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-main);
    margin-bottom: 18px;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    font-size: 0.88rem;
    text-decoration: none;
    margin-bottom: 11px;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.footer-col a:hover {
    color: var(--accent-color);
    transform: translateX(3px);
}

[data-theme='light'] .footer-col a:hover {
    color: #0284c7;
}

.footer-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    font-size: 0.84rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 16px;
}

.footer-trust-tags {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-trust-tags span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.footer-trust-tags span i {
    color: #10b981;
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 30px;
    }

    .footer-brand-col {
        grid-column: span 2;
    }

    .footer-bottom-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-brand-col {
        grid-column: span 1;
    }
}

/* ==========================================================================
   Dashboard Connected Applications Status (3x2 Balanced Grid)
   ========================================================================== */
.connectors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 36px;
}

@media (max-width: 1280px) {
    .connectors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ==========================================================================
   Modern Card UI for App Connections & Flow Cards (n8n / Vercel Style)
   ========================================================================== */

.connections-groups-wrapper {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 36px;
}

.connections-app-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.connections-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.connections-group-title-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.connections-group-badge {
    background: var(--accent-glow);
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-focus);
}

.connections-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 18px;
}

.connection-card-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.connection-card-item:hover {
    border-color: var(--border-focus);
    transform: translateY(-2px);
    box-shadow:
        var(--shadow-md),
        0 0 20px var(--accent-glow);
}

.connection-card-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.connection-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.connection-header-badges {
    display: flex;
    align-items: center;
    gap: 8px;
}

.connection-avatar-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    flex: 1;
}

.connection-avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-glow);
    border: 1px solid var(--border-focus);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.connection-card-item:hover .connection-avatar {
    transform: scale(1.05);
}

.connection-avatar.webhook {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.35);
    color: #c084fc;
}

.connection-avatar.xero {
    background: rgba(19, 181, 234, 0.15);
    border-color: rgba(19, 181, 234, 0.35);
    color: #13b5ea;
}

.connection-avatar.slack {
    background: rgba(224, 30, 90, 0.15);
    border-color: rgba(224, 30, 90, 0.35);
    color: #e01e5a;
}

.connection-avatar.openai {
    background: rgba(16, 163, 127, 0.15);
    border-color: rgba(16, 163, 127, 0.35);
    color: #10a37f;
}

.connection-header-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.connection-card-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
    letter-spacing: -0.01em;
    line-height: 1.35;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.connection-card-subtitle {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.connection-card-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.conn-sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    padding: 3px 8px;
    border-radius: 6px;
    line-height: 1.25;
    white-space: nowrap;
}

.conn-sub-badge i,
.conn-sub-badge svg {
    width: 12px;
    height: 12px;
    opacity: 0.85;
}

.conn-sub-badge.secondary {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='light'] .conn-sub-badge.secondary,
[data-theme='clean-light'] .conn-sub-badge.secondary {
    border-color: rgba(0, 0, 0, 0.08);
    background: #f1f5f9;
}

.connection-card-body {
    margin-bottom: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.connection-endpoint-box {
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.connection-endpoint-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.copy-url-icon-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--accent-color);
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.copy-url-icon-btn:hover {
    background: var(--accent-glow);
    border-color: var(--border-focus);
    color: var(--text-main);
}

.connection-endpoint-code {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--accent-color);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: all;
}

.connection-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    padding: 4px 0;
}

.connection-card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 14px;
    flex-wrap: wrap;
}

.connection-card-actions .btn {
    flex: 1;
    font-size: 0.78rem;
    padding: 6px 10px;
}

/* Clickable Table Rows */
.table-row-clickable {
    cursor: pointer;
    transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

.table-row-clickable:hover td {
    background: rgba(56, 189, 248, 0.05);
}

.table-row-clickable:hover .flow-row-name {
    color: #38bdf8 !important;
}

.table-row-clickable:hover .row-arrow {
    opacity: 1 !important;
    transform: translateX(3px);
    color: #38bdf8;
}

/* Fields to Retrieve Tags / Pills */
.retrieve-field-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.35);
    color: #38bdf8;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.retrieve-field-tag:hover {
    background: rgba(56, 189, 248, 0.22);
    border-color: #38bdf8;
}

.retrieve-field-tag .remove-tag-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    margin-left: 2px;
    font-size: 0.8rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.retrieve-field-tag .remove-tag-btn:hover {
    color: #ef4444;
}

/* Custom Object Combobox Dropdown */
.custom-combobox-menu {
    scrollbar-width: thin;
}

.custom-combobox-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #f1f5f9;
    font-size: 0.82rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
}

.custom-combobox-item:hover,
.custom-combobox-item.focused {
    background: rgba(56, 189, 248, 0.18);
    color: #38bdf8;
}

.custom-combobox-item.selected {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.custom-combobox-item .obj-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.custom-combobox-item .obj-tag {
    font-size: 0.72rem;
    color: #94a3b8;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.combobox-highlight {
    background: rgba(56, 189, 248, 0.28);
    color: #38bdf8;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(56, 189, 248, 0.6);
    text-underline-offset: 2px;
}

/* Lucide Icons Utilities */
.lucide,
svg.lucide {
    width: 1em;
    height: 1em;
    stroke-width: 1.85;
    vertical-align: -0.15em;
    display: inline-block;
    stroke: currentColor;
    fill: none;
    flex-shrink: 0;
}

.icon-xs {
    width: 12px;
    height: 12px;
}

.icon-sm {
    width: 14px;
    height: 14px;
}

.icon-md {
    width: 16px;
    height: 16px;
}

.icon-lg {
    width: 20px;
    height: 20px;
}

.icon-xl {
    width: 24px;
    height: 24px;
}

/* ==========================================================================
   Salesforce-Style Flow Versioning Styles
   ========================================================================== */

.flow-version-container {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.flow-version-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 20px;
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

.flow-version-btn:hover {
    background: var(--bg-surface-1);
    border-color: var(--accent-color);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.version-status-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
}

.version-status-pill.active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

[data-theme='clean-light'] .version-status-pill.active {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #6ee7b7;
}

.version-status-pill.draft {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

[data-theme='clean-light'] .version-status-pill.draft {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.version-status-pill.inactive {
    background: rgba(148, 163, 184, 0.12);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.flow-version-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow:
        var(--shadow-lg),
        0 12px 28px rgba(0, 0, 0, 0.35);
    z-index: 1050;
    overflow: hidden;
    animation: fadeIn 0.18s ease-out;
}

.version-dropdown-header {
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--bg-surface-0);
    border-bottom: 1px solid var(--border-color);
}

.version-header-action {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    border-radius: 4px;
}

.version-header-action:hover {
    text-decoration: underline;
}

.version-dropdown-list {
    max-height: 240px;
    overflow-y: auto;
    padding: 4px 0;
}

.version-dropdown-item {
    padding: 9px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 0.15s ease;
    border-left: 3px solid transparent;
}

.version-dropdown-item:hover {
    background: var(--bg-surface-1);
}

.version-dropdown-item.current {
    background: rgba(56, 189, 248, 0.08);
    border-left-color: var(--accent-color);
}

.version-dropdown-footer {
    padding: 8px 12px;
    background: var(--bg-surface-0);
    border-top: 1px solid var(--border-color);
}

/* Modal Versions Table */
.versions-table {
    width: 100%;
    border-collapse: collapse;
}

.versions-table th {
    padding: 10px 14px;
    font-size: 0.76rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.versions-table td {
    padding: 12px 14px;
    font-size: 0.86rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.versions-table tr:hover td {
    background: var(--bg-surface-0);
}

.versions-table tr.is-current-version td {
    background: rgba(56, 189, 248, 0.05);
}

.version-pill-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* =========================================================================
   SALESFORCE FLOW LOGIC ELEMENTS (Decision, Assignment, Loop)
   ========================================================================= */

/* Element Palette Card */
.element-palette-card {
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.element-palette-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent-color) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    background: var(--bg-card-hover) !important;
}

/* Logic Node Header Badges */
.node-type-badge.decision {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.node-type-badge.assignment {
    background: rgba(168, 85, 247, 0.12);
    color: #a855f7;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.node-type-badge.loop {
    background: rgba(99, 102, 241, 0.18);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.45);
}

.node-type-badge.stripe {
    background: rgba(99, 91, 255, 0.18);
    color: #a5b4fc;
    border: 1px solid rgba(99, 91, 255, 0.45);
}

.node-type-badge.slack {
    background: rgba(224, 30, 90, 0.18);
    color: #fb7185;
    border: 1px solid rgba(224, 30, 90, 0.45);
}

.node-type-badge.gmail {
    background: rgba(234, 67, 53, 0.18);
    color: #f87171;
    border: 1px solid rgba(234, 67, 53, 0.45);
}

.node-type-badge.xero {
    background: rgba(19, 181, 234, 0.18);
    color: #38bdf8;
    border: 1px solid rgba(19, 181, 234, 0.45);
}

.node-type-badge.ai {
    background: rgba(16, 163, 127, 0.18);
    color: #34d399;
    border: 1px solid rgba(16, 163, 127, 0.45);
}

.node-type-badge.webhook {
    background: rgba(139, 92, 246, 0.18);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.45);
}

.node-type-badge.bookings {
    background: rgba(0, 130, 114, 0.18);
    color: #2dd4bf;
    border: 1px solid rgba(0, 130, 114, 0.45);
}

/* Outcome Card in Decision Drawer */
.outcome-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s;
}

.outcome-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
}

.condition-row {
    display: grid;
    grid-template-columns: 1fr 120px 1fr 32px;
    gap: 6px;
    align-items: center;
}

.assignment-row {
    display: grid;
    grid-template-columns: 1fr 100px 1fr 32px;
    gap: 6px;
    align-items: center;
}

/* =========================================================================
   SALESFORCE FLOW BUILDER INLINE ADD ELEMENT POPOVER
   ========================================================================= */

.flow-element-popover {
    position: absolute;
    width: 290px;
    background: var(--bg-card, #ffffff) !important;
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    box-shadow:
        0 16px 44px -4px rgba(0, 0, 0, 0.35),
        0 6px 18px rgba(0, 0, 0, 0.15) !important;
    z-index: 100000 !important;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    user-select: none;
    font-family: inherit;
}

[data-theme='light'] .flow-element-popover {
    background: #ffffff !important;
    border-color: #cbd5e1;
    box-shadow:
        0 16px 40px rgba(0, 0, 0, 0.18),
        0 4px 12px rgba(0, 0, 0, 0.08) !important;
}

.popover-header {
    padding: 10px 14px 4px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.popover-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
}

.popover-search-container {
    padding: 6px 12px 8px 12px;
}

.popover-search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.popover-search-icon {
    position: absolute;
    left: 9px;
    color: var(--text-muted);
    width: 13px;
    height: 13px;
    pointer-events: none;
}

.popover-search-input {
    width: 100%;
    padding: 6px 10px 6px 28px;
    font-size: 0.82rem;
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-main);
    outline: none;
    transition: all 0.15s ease;
}

[data-theme='light'] .popover-search-input {
    background: #ffffff;
    border-color: #0284c7;
}

.popover-search-input:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

.popover-scroll-body {
    max-height: 290px;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    overscroll-behavior: contain !important;
    padding: 2px 8px 10px 8px;
    border-top: 1px solid var(--border-color);
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.popover-scroll-body::-webkit-scrollbar {
    width: 5px;
}

.popover-scroll-body::-webkit-scrollbar-track {
    background: transparent;
}

.popover-scroll-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.popover-scroll-body::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.popover-section-label {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 8px 4px 4px 4px;
    text-transform: none;
}

.popover-element-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-radius: 5px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    position: relative;
}

.popover-element-item:hover,
.popover-element-item.is-focused {
    background: rgba(2, 132, 199, 0.08);
    border-color: #0284c7;
}

[data-theme='light'] .popover-element-item:hover {
    background: #f0f7ff;
    border-color: #0284c7;
}

.popover-item-badge {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
}

.popover-item-badge.badge-action {
    background: #002d62;
    /* Navy Salesforce Action */
}

.popover-item-badge.badge-assignment {
    background: #d97706;
    /* Amber/Orange */
}

.popover-item-badge.badge-decision {
    background: #ea580c;
    /* Orange Diamond */
    transform: rotate(45deg);
    border-radius: 3px;
}

.popover-item-badge.badge-decision i {
    transform: rotate(-45deg);
}

.popover-item-badge.badge-loop {
    background: #4f46e5;
    /* Indigo */
}

.popover-item-badge.badge-salesforce {
    background: #0284c7;
    /* Salesforce Blue */
}

.popover-item-badge.badge-slack {
    background: #e01e5a;
    /* Slack Crimson / Aubergine */
}

.popover-item-badge.badge-gmail {
    background: #ea4335;
    /* Gmail Red */
}

.popover-item-badge.badge-openai {
    background: #10a37f;
    /* OpenAI Emerald */
}

.popover-item-badge.badge-xero {
    background: #13b5ea;
    /* Xero Sky Blue */
}

.popover-item-badge.badge-stripe {
    background: #635bff;
    /* Stripe Indigo */
}

.popover-item-badge.badge-webhook {
    background: #8b5cf6;
    /* Purple Webhook */
}

.popover-item-badge.badge-bookings {
    background: #008272;
    /* Microsoft Bookings Teal */
}

.popover-item-badge.badge-create {
    background: #0284c7;
    /* Salesforce Blue */
}

.popover-item-badge.badge-update {
    background: #0284c7;
    /* Salesforce Blue */
}

.popover-item-badge.badge-lookup {
    background: #e11d48;
    /* Crimson */
}

.popover-item-badge.badge-delete {
    background: #dc2626;
    /* Red */
}

.popover-item-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-main);
    flex: 1;
}

.popover-item-info {
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.15s ease;
    display: flex;
    align-items: center;
}

.popover-element-item:hover .popover-item-info {
    opacity: 0.8;
}

/* Connector Line & Circular Button Styling */
.btn-insert-step {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    border-radius: 50% !important;
    background: var(--bg-card, #ffffff) !important;
    border: 2px solid #64748b !important;
    color: #0284c7 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.12) !important;
    z-index: 10 !important;
}

[data-theme='light'] .btn-insert-step {
    background: #ffffff !important;
    border-color: #64748b !important;
    color: #0284c7 !important;
}

.btn-insert-step:hover {
    border-color: #0284c7 !important;
    color: #0284c7 !important;
    transform: scale(1.15) !important;
    box-shadow: 0 0 10px var(--accent-glow) !important;
}

.btn-insert-step.is-open {
    background: #0284c7 !important;
    border-color: #0284c7 !important;
    color: #ffffff !important;
    transform: scale(1.08) !important;
    box-shadow: 0 0 12px rgba(2, 132, 199, 0.5) !important;
}

.pipeline-connector-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

.pipeline-connector-line {
    width: 2px;
    height: 18px;
    background: #64748b;
    opacity: 0.75;
    margin: 0;
}

.add-step-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

/* =========================================================================
   SALESFORCE FLOW BUILDER DECISION MULTI-BRANCH VISUALIZER
   ========================================================================= */

.decision-branch-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

.decision-stem-top {
    width: 2px;
    height: 14px;
    background: #64748b;
    opacity: 0.6;
    margin: 0;
}

.decision-branches-container {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 44px;
    position: relative;
    width: 100%;
    max-width: none;
    padding: 24px 20px;
    margin: 0;
}

.decision-branch-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    min-width: 320px;
    position: relative;
    z-index: 2;
}

.decision-outcome-pill {
    background: var(--bg-card, #1e293b);
    border: 1.5px solid #f59e0b;
    border-radius: 20px;
    padding: 6px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 100%;
}

.decision-outcome-pill:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.35);
    border-color: #fbbf24;
}

.decision-outcome-pill.branch-taken {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.2) !important;
    box-shadow: 0 0 16px rgba(16, 185, 129, 0.55) !important;
    transform: scale(1.05);
}

.decision-outcome-pill.branch-taken .decision-pill-text {
    color: #34d399 !important;
    font-weight: 700;
}

.decision-branch-col.branch-skipped {
    opacity: 0.35;
    filter: grayscale(0.7);
    transition: all 0.3s ease;
}

.decision-stem-top,
.decision-branch-line {
    position: relative;
    width: 2px;
    background: #64748b;
    opacity: 0.75;
    border-radius: 2px;
    overflow: hidden;
    margin: 0;
}

.decision-stem-top {
    height: 14px;
}

.decision-branch-line {
    height: 14px;
}

.decision-stem-top::after,
.decision-branch-line::after {
    display: none;
}

.decision-stem-top.connector-laser-shot::after,
.decision-branch-line.connector-laser-shot::after {
    display: block;
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #3b82f6 0%, #60a5fa 50%, #ffffff 100%) !important;
    box-shadow:
        0 0 16px #60a5fa,
        0 0 8px #ffffff !important;
    animation: streamPulseDown 0.45s ease-out forwards !important;
}

.decision-branch-col.branch-taken .decision-branch-line {
    background: rgba(16, 185, 129, 0.4) !important;
}

.decision-branch-col.branch-taken .decision-branch-line::after {
    background: linear-gradient(180deg, #10b981 0%, #34d399 50%, #ffffff 100%) !important;
    box-shadow:
        0 0 16px #34d399,
        0 0 8px #ffffff !important;
    animation: streamPulseDown 0.45s ease-out forwards !important;
}

.decision-pill-icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.decision-pill-text {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.decision-branch-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.decision-branch-add-btn {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    border-style: solid !important;
}

.decision-branch-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
}

.decision-branch-svg path.decision-branch-track {
    stroke: #64748b;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.75;
}

.decision-branch-svg path.decision-branch-laser {
    stroke: #10b981;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 40 180;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.decision-branch-col.branch-skipped {
    opacity: 0.35 !important;
    filter: grayscale(0.6) !important;
    transition: all 0.35s ease;
}

.decision-branch-col.branch-taken {
    opacity: 1 !important;
    transform: translateY(-2px);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.decision-branch-col.branch-taken .decision-outcome-pill {
    border-color: #10b981 !important;
    background: rgba(16, 185, 129, 0.18) !important;
    box-shadow:
        0 0 16px rgba(16, 185, 129, 0.45),
        0 0 4px #10b981 !important;
}

/* ==========================================================================
   DECISION BRANCH CHILD STEP CARDS
   ========================================================================== */
.decision-branch-step-card {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    background: var(--bg-card, #111827);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.28);
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    flex-shrink: 0;
}

.decision-branch-step-card:hover {
    border-color: #38bdf8;
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.4),
        0 0 12px rgba(56, 189, 248, 0.25);
}

.decision-branch-step-card.active-node-selected {
    border-color: #38bdf8;
    box-shadow:
        0 0 0 2px rgba(56, 189, 248, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.45);
}

.branch-step-header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.branch-step-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
}

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

.branch-step-name {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-step-sub {
    font-size: 0.65rem;
    color: var(--text-muted, #94a3b8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-step-delete-btn {
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.65;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.decision-branch-step-card:hover .branch-step-delete-btn,
.nested-loop-card:hover .branch-step-delete-btn,
.branch-step-delete-btn:hover {
    opacity: 1;
}

.branch-step-delete-btn:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.15) !important;
}

[data-theme='light'] .decision-branch-step-card {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-theme='light'] .decision-branch-svg path.decision-branch-track {
    stroke: #64748b;
    opacity: 0.75;
}

[data-theme='light'] .decision-stem-top,
[data-theme='light'] .decision-branch-line {
    background: #64748b;
    opacity: 0.75;
}

[data-theme='light'] .decision-outcome-pill {
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   CUSTOM SEARCHABLE FIELD & RELATIONSHIP COMBOBOX
   ========================================================================== */
.field-combobox-wrapper {
    position: relative;
    width: 100%;
}

.field-combobox-input-box {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
}

.field-combobox-input {
    width: 100%;
    background: var(--bg-canvas);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 36px 8px 32px;
    font-size: 0.82rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.field-combobox-input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.18);
    background: var(--bg-surface-0);
}

.field-combobox-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    display: flex;
    align-items: center;
}

.field-combobox-toggle-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        color 0.15s,
        background 0.15s;
}

.field-combobox-toggle-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

/* Floating Dropdown Menu */
.field-combobox-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 320px;
    background: var(--bg-card, #111827);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    animation: fieldMenuFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.field-combobox-tabs {
    display: flex;
    background: var(--bg-surface-0, rgba(255, 255, 255, 0.03));
    border-bottom: 1px solid var(--border-color);
    padding: 4px 6px;
    gap: 4px;
    flex-shrink: 0;
}

.field-combobox-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 5px 6px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s ease;
}

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

.field-combobox-tab-btn.active {
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.field-combobox-breadcrumb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(56, 189, 248, 0.08);
    border-bottom: 1px solid rgba(56, 189, 248, 0.2);
    font-size: 0.74rem;
    color: #38bdf8;
    font-weight: 600;
    flex-shrink: 0;
}

.field-combobox-back-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    padding: 2px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.15s;
}

.field-combobox-back-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    color: #ffffff;
}

.field-combobox-list {
    max-height: 240px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-sizing: border-box;
}

.field-combobox-list::-webkit-scrollbar {
    width: 5px;
    height: 0px;
}

.field-combobox-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.field-combobox-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.78rem;
    color: var(--text-main);
    transition: all 0.12s ease;
    user-select: none;
    width: 100%;
    box-sizing: border-box;
    gap: 8px;
}

.field-combobox-item:hover,
.field-combobox-item.focused {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}

.field-combobox-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.field-combobox-item-left>div {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.field-combobox-item-title {
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.field-combobox-item:hover .field-combobox-item-title {
    color: #38bdf8;
}

.field-combobox-item-sub {
    font-family: monospace;
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    display: inline-block;
    box-sizing: border-box;
}

.field-combobox-item-badge {
    font-size: 0.68rem;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: capitalize;
    background: rgba(148, 163, 184, 0.15);
    color: #94a3b8;
    flex-shrink: 0;
    white-space: nowrap;
}

.field-combobox-item.relationship {
    border-left: 2px solid #a855f7;
}

.field-combobox-item.relationship:hover {
    background: rgba(168, 85, 247, 0.12);
    color: #c084fc;
}

.field-combobox-item.relationship:hover .field-combobox-item-title {
    color: #c084fc;
}

.field-combobox-item.parent-group {
    border-left: 2px solid #38bdf8;
    background: rgba(56, 189, 248, 0.04);
}

.field-combobox-item.parent-group:hover {
    background: rgba(56, 189, 248, 0.15);
}

.field-combobox-item.add-custom {
    background: rgba(16, 185, 129, 0.08);
    border: 1px dashed rgba(16, 185, 129, 0.4);
    color: #34d399;
}

.field-combobox-item.add-custom:hover {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
}

.field-combobox-empty {
    padding: 18px 12px;
    text-align: center;
    font-size: 0.76rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ==========================================================================
   UI Enhancement System: Modals, Dropdowns & Filter Controls
   ========================================================================== */

/* Dropdown Menu Item Styling */
.dropdown-menu-item {
    transition: all 0.15s ease;
}

.dropdown-menu-item:hover {
    background: var(--bg-card-hover) !important;
    color: var(--accent-color) !important;
}

.dropdown-menu-item.danger-item:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #ef4444 !important;
}

/* Spin animation helper */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 1s linear infinite;
}

/* Modal Backdrops & Cards */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.modal-card {
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 100%;
    overflow: hidden;
    animation: modalPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }

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

/* ==========================================================================
   Table Column Sorting Styles
   ========================================================================== */
th.sortable-header {
    cursor: pointer !important;
    user-select: none;
    transition: all 0.15s ease;
    white-space: nowrap;
}

th.sortable-header:hover {
    background: var(--bg-card-hover) !important;
    color: var(--accent-color) !important;
}

th.sortable-header .sort-icon {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    opacity: 0.35;
    transition: all 0.15s ease;
    vertical-align: middle;
}

th.sortable-header:hover .sort-icon {
    opacity: 0.85;
    color: var(--accent-color);
}

th.sortable-header.sorted-asc .sort-icon,
th.sortable-header.sorted-desc .sort-icon {
    opacity: 1;
    color: var(--accent-color);
}

/* ==========================================================================
   Skeleton Shimmer & Loading State Design System
   ========================================================================== */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton-box {
    display: inline-block;
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.04) 25%,
            rgba(255, 255, 255, 0.09) 37%,
            rgba(255, 255, 255, 0.04) 63%);
    background-size: 400% 100%;
    animation: skeleton-shimmer 1.4s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    border-radius: var(--radius-xs);
}

/* Light Mode Overrides for Skeleton and Loader Elements */
[data-theme='light'] .skeleton-box,
body.theme-light .skeleton-box {
    background: linear-gradient(90deg, #e2e8f0 25%, #cbd5e1 37%, #e2e8f0 63%) !important;
    background-size: 400% 100% !important;
}

[data-theme='light'] .skeleton-conn-card,
body.theme-light .skeleton-conn-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme='light'] .skeleton-table-row td,
body.theme-light .skeleton-table-row td {
    border-bottom: 1px solid #e2e8f0;
}

.skeleton-text {
    height: 13px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.skeleton-pill {
    height: 22px;
    border-radius: var(--radius-pill);
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-table-row td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.skeleton-conn-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Spinner Animation Utility */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.spin {
    animation: spin 0.85s linear infinite !important;
}

/* Canvas Full-Screen Loading Overlay */
.canvas-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(7, 9, 14, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition:
        opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.3s;
}

.canvas-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.canvas-loading-card {
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.7),
        0 0 30px var(--accent-glow);
    text-align: center;
    max-width: 420px;
}

.canvas-loading-spinner-ring {
    width: 52px;
    height: 52px;
    border: 3px solid rgba(56, 189, 248, 0.15);
    border-top-color: #38bdf8;
    border-right-color: #0284c7;
    border-radius: 50%;
    animation: spin 0.85s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 25px rgba(56, 189, 248, 0.3);
}

.canvas-loading-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.canvas-loading-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Light Mode Overrides for Canvas Loader */
[data-theme='light'] .canvas-loading-overlay,
body.theme-light .canvas-loading-overlay {
    background: rgba(248, 250, 252, 0.92);
}

[data-theme='light'] .canvas-loading-card,
body.theme-light .canvas-loading-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.08),
        0 0 30px rgba(2, 132, 199, 0.12);
}

[data-theme='light'] .canvas-loading-spinner-ring,
body.theme-light .canvas-loading-spinner-ring {
    border: 3px solid rgba(2, 132, 199, 0.15);
    border-top-color: #0284c7;
    border-right-color: #38bdf8;
    box-shadow: 0 0 20px rgba(2, 132, 199, 0.2);
}

/* Connection Health Alert Banners */
.connection-alerts-wrapper {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.conn-alert-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 18px;
    border-radius: var(--radius-md, 12px);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(245, 158, 11, 0.08) 100%);
    border: 1px solid rgba(239, 68, 68, 0.35);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.12);
    animation: fadeInDown 0.3s ease-out;
    transition:
        opacity 0.25s ease,
        transform 0.25s ease;
}

[data-theme='light'] .conn-alert-banner {
    background: linear-gradient(135deg, #fef2f2 0%, #fffbeb 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    box-shadow: 0 2px 10px rgba(239, 68, 68, 0.08);
}

.conn-alert-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.conn-alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    flex-shrink: 0;
}

.conn-alert-text {
    font-size: 0.9rem;
    color: var(--text-main);
    line-height: 1.4;
}

.conn-alert-text strong {
    color: #f87171;
}

[data-theme='light'] .conn-alert-text strong {
    color: #dc2626;
}

.conn-alert-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #ffffff !important;
    border: none;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    transition: all 0.2s ease;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.conn-alert-dismiss {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.conn-alert-dismiss:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

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

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

/* ==========================================================================
   CUSTOM SOURCE FIELD PICKER
   ========================================================================== */

/* Wrapper for relative dropdown positioning */
.source-picker-wrapper {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

/* Trigger button that replaces the visible select */
.source-picker-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 5px 8px;
    font-size: 0.78rem;
    font-family: var(--font-sans);
    color: var(--text-main);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    text-align: left;
    min-height: 30px;
    box-sizing: border-box;
    overflow: hidden;
}

.source-picker-trigger:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.source-picker-trigger:focus,
.source-picker-trigger.open {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.source-picker-trigger .sp-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-picker-trigger .sp-trigger-placeholder {
    color: var(--text-dim);
}

.source-picker-trigger .sp-trigger-chevron {
    flex-shrink: 0;
    color: var(--text-dim);
    transition: transform 0.25s ease;
}

.source-picker-trigger.open .sp-trigger-chevron {
    transform: rotate(180deg);
}

.source-picker-trigger .sp-trigger-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 6px;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: var(--radius-pill);
    white-space: nowrap;
    flex-shrink: 0;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Dropdown panel */
.source-picker-dropdown {
    position: fixed;
    min-width: 360px;
    max-width: 520px;
    max-height: 420px;
    z-index: 99999;
    background: rgba(14, 20, 34, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.06);
    overflow: hidden;
    animation: spDropdownIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

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

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

/* Category view (step 1) */
.sp-categories-view {
    display: flex;
    flex-direction: column;
    max-height: 380px;
}

.sp-categories-body {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 300px;
}

.sp-categories-body::-webkit-scrollbar {
    width: 4px;
}

.sp-categories-body::-webkit-scrollbar-track {
    background: transparent;
}

.sp-categories-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

/* Search results group headers */
.sp-search-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 6px;
}

.sp-search-group:last-child {
    margin-bottom: 0;
}

.sp-search-group-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 4px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 2px;
}

.sp-search-group-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 600;
}

.sp-search-group-count {
    font-size: 0.62rem;
    padding: 1px 6px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    font-weight: 600;
}

.sp-search-highlight {
    color: #38bdf8;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: rgba(56, 189, 248, 0.4);
}

.sp-categories {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.sp-categories-title {
    padding: 4px 8px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
}

.sp-category-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.sp-category-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}

.sp-category-card .sp-cat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.sp-category-card .sp-cat-icon.sp-cat-static {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.sp-category-card .sp-cat-icon.sp-cat-variables {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.sp-category-card .sp-cat-icon.sp-cat-trigger {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.sp-category-card .sp-cat-icon.sp-cat-step {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
}

.sp-category-card .sp-cat-icon.sp-cat-picklist {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
}

.sp-category-card .sp-cat-icon.sp-cat-loop {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
}

.sp-picklist-pill {
    display: inline-block;
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    font-weight: 600;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

.sp-picklist-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.sp-picklist-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    line-height: 1.3;
}

.sp-picklist-btn:hover {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.4);
}

.sp-picklist-btn.active {
    background: rgba(16, 185, 129, 0.25);
    color: #34d399;
    border-color: #10b981;
    font-weight: 600;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

[data-theme='light'] .sp-picklist-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #475569;
}

[data-theme='light'] .sp-picklist-btn:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

[data-theme='light'] .sp-picklist-btn.active {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
    border-color: #10b981;
}

.sp-date-pill {
    display: inline-block;
    font-size: 0.65rem;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    font-weight: 600;
    margin-left: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    vertical-align: middle;
}

.sp-date-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 5px;
}

.sp-date-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #94a3b8;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    line-height: 1.3;
}

.sp-date-btn:hover {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border-color: rgba(56, 189, 248, 0.4);
}

.sp-date-btn.active {
    background: rgba(56, 189, 248, 0.25);
    color: #38bdf8;
    border-color: #38bdf8;
    font-weight: 600;
    box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

[data-theme='light'] .sp-date-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
    color: #475569;
}

[data-theme='light'] .sp-date-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    color: #0284c7;
}

[data-theme='light'] .sp-date-btn.active {
    background: rgba(56, 189, 248, 0.15);
    color: #0369a1;
    border-color: #0284c7;
}

.sp-category-card .sp-cat-info {
    flex: 1;
    min-width: 0;
}

.sp-category-card .sp-cat-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
}

.sp-category-card .sp-cat-count {
    font-size: 0.65rem;
    color: var(--text-dim);
    margin-top: 1px;
}

.sp-category-card .sp-cat-arrow {
    flex-shrink: 0;
    color: var(--text-dim);
    opacity: 0;
    transform: translateX(-4px);
    transition: all 0.15s ease;
}

.sp-category-card:hover .sp-cat-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Field list view (step 2) */
.sp-fields-view {
    display: flex;
    flex-direction: column;
    max-height: 320px;
}

.sp-fields-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sp-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
    padding: 0;
}

.sp-back-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

.sp-fields-header-title {
    flex: 1;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-search-wrapper {
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sp-search-input {
    width: 100%;
    padding: 6px 10px 6px 28px;
    font-size: 0.75rem;
    font-family: var(--font-sans);
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.sp-search-input:focus {
    border-color: var(--border-focus);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.15);
}

.sp-search-input::placeholder {
    color: var(--text-dim);
}

.sp-search-wrapper {
    position: relative;
}

.sp-search-icon {
    position: absolute;
    left: 17px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
    width: 13px;
    height: 13px;
}

/* Field items list */
.sp-field-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 6px;
    max-height: 220px;
}

.sp-field-list::-webkit-scrollbar {
    width: 4px;
}

.sp-field-list::-webkit-scrollbar-track {
    background: transparent;
}

.sp-field-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

.sp-field-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.12s ease;
    font-size: 0.76rem;
    color: var(--text-main);
}

.sp-field-item:hover {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
}

.sp-field-item .sp-field-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.6;
}

.sp-field-item .sp-field-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sp-field-item .sp-field-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sp-field-item .sp-field-path {
    font-size: 0.65rem;
    color: var(--text-dim);
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.85;
}

.sp-field-item .sp-field-check {
    flex-shrink: 0;
    color: var(--success-color);
    opacity: 0;
    transition: opacity 0.12s ease;
}

.sp-field-item.selected .sp-field-check {
    opacity: 1;
}

.sp-field-item.selected {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.sp-no-results {
    padding: 16px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Slide transitions */
.sp-view-enter {
    animation: spSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.sp-view-back {
    animation: spSlideBack 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes spSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

@keyframes spSlideBack {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

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

/* ---- Light theme overrides ---- */
[data-theme='light'] .source-picker-trigger {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme='light'] .source-picker-trigger:hover {
    border-color: #0284c7;
    background: #f8fafc;
}

[data-theme='light'] .source-picker-trigger .sp-trigger-placeholder {
    color: #94a3b8;
}

[data-theme='light'] .source-picker-dropdown {
    background: rgba(255, 255, 255, 0.97);
    border-color: #e2e8f0;
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.04);
}

[data-theme='light'] .sp-category-card:hover {
    background: rgba(0, 0, 0, 0.03);
    border-color: #e2e8f0;
}

[data-theme='light'] .sp-category-card .sp-cat-name {
    color: #0f172a;
}

[data-theme='light'] .sp-fields-header {
    border-bottom-color: #e2e8f0;
}

[data-theme='light'] .sp-back-btn {
    background: #f1f5f9;
    color: #64748b;
}

[data-theme='light'] .sp-back-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme='light'] .sp-search-wrapper {
    border-bottom-color: #e2e8f0;
}

[data-theme='light'] .sp-search-input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme='light'] .sp-search-input:focus {
    border-color: #0284c7;
    background: #ffffff;
}

[data-theme='light'] .sp-field-item {
    color: #1e293b;
}

[data-theme='light'] .sp-field-item:hover {
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
}

[data-theme='light'] .sp-field-item.selected {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}

[data-theme='light'] .sp-field-list::-webkit-scrollbar-thumb,
[data-theme='light'] .sp-categories-body::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
}

[data-theme='light'] .sp-search-group-header {
    border-bottom-color: #f1f5f9;
}

[data-theme='light'] .sp-search-group-title {
    color: #0f172a;
}

[data-theme='light'] .sp-search-group-count {
    background: #f1f5f9;
    color: #64748b;
}

[data-theme='light'] .sp-search-highlight {
    color: #0284c7;
    text-decoration-color: rgba(2, 132, 199, 0.4);
}

/* Source Entry Conditions Styles */
.source-condition-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
    transition: all 0.2s ease;
}

.source-condition-row:hover {
    border-color: var(--border-hover);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.source-condition-field {
    flex: 1.2;
    min-width: 0;
}

.source-condition-op {
    flex: 1;
    min-width: 0;
}

.source-condition-val-wrapper {
    flex: 1.2;
    min-width: 0;
}

.source-condition-val {
    flex: 1.2;
    min-width: 0;
}

.source-condition-del-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

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

.source-condition-num-badge {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Custom Dropdown for Entry Condition Picklist Values */
.source-custom-select-wrapper {
    position: relative;
    flex: 1.3;
    min-width: 0;
}

.source-custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    height: 32px;
    padding: 6px 10px;
    font-size: 0.8rem;
    font-family: inherit;
    background: var(--bg-surface-0, #18181b);
    border: 1px solid var(--border-color, #27272a);
    border-radius: 6px;
    color: var(--text-main, #f4f4f5);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    outline: none;
    box-sizing: border-box;
}

.source-custom-select-trigger:hover {
    border-color: var(--border-hover, #3f3f46);
    background: var(--bg-surface-1, #27272a);
}

.source-custom-select-trigger.open {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
    background: var(--bg-surface-1, #27272a);
}

.source-custom-select-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    font-size: 0.8rem;
    line-height: 1.2;
}

.source-custom-select-label.is-placeholder {
    color: var(--text-muted, #71717a);
    font-style: italic;
}

.source-custom-select-chevron {
    width: 14px;
    height: 14px;
    color: var(--text-muted, #71717a);
    transition:
        transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        color 0.15s ease;
    flex-shrink: 0;
}

.source-custom-select-trigger.open .source-custom-select-chevron {
    transform: rotate(180deg);
    color: #38bdf8;
}

.source-custom-select-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    min-width: 190px;
    max-width: 320px;
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 999;
    padding: 4px;
    overflow: hidden;
    animation: spDropdownSlide 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

@keyframes spDropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

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

.source-custom-select-search-wrap {
    position: relative;
    padding: 3px 4px 5px;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.source-custom-select-search-input {
    width: 100%;
    padding: 4px 8px 4px 26px;
    font-size: 0.74rem;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: var(--text-main, #f4f4f5);
    outline: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
}

.source-custom-select-search-input:focus {
    border-color: #38bdf8;
    background: rgba(255, 255, 255, 0.08);
}

.source-custom-select-search-icon {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    color: var(--text-muted, #71717a);
    pointer-events: none;
}

.source-custom-select-options-list {
    max-height: 190px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.source-custom-select-options-list::-webkit-scrollbar {
    width: 4px;
}

.source-custom-select-options-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 4px;
}

.source-custom-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.78rem;
    color: var(--text-main, #f4f4f5);
    cursor: pointer;
    transition: all 0.12s ease;
    user-select: none;
}

.source-custom-select-option:hover {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}

.source-custom-select-option.selected {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    font-weight: 600;
}

.sc-opt-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-opt-check {
    width: 13px;
    height: 13px;
    color: #10b981;
    flex-shrink: 0;
    transition: opacity 0.12s ease;
}

/* Light Theme Overrides for Custom Select */
[data-theme='light'] .source-custom-select-trigger {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme='light'] .source-custom-select-trigger:hover {
    border-color: #0284c7;
    background: #f8fafc;
}

[data-theme='light'] .source-custom-select-trigger.open {
    border-color: #0284c7;
    background: #f8fafc;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

[data-theme='light'] .source-custom-select-menu {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow:
        0 14px 35px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

[data-theme='light'] .source-custom-select-search-wrap {
    border-bottom-color: #e2e8f0;
}

[data-theme='light'] .source-custom-select-search-input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #0f172a;
}

[data-theme='light'] .source-custom-select-search-input:focus {
    border-color: #0284c7;
    background: #ffffff;
}

[data-theme='light'] .source-custom-select-option {
    color: #1e293b;
}

[data-theme='light'] .source-custom-select-option:hover {
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
}

[data-theme='light'] .source-custom-select-option.selected {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

/* Gmail Connector Styling */
.connection-avatar.gmail,
.app-badge.gmail,
.app-select-card[data-key='gmail'] .icon-lg {
    color: #ea4335;
}

.connection-avatar.gmail {
    background: rgba(234, 67, 53, 0.12);
    border: 1px solid rgba(234, 67, 53, 0.3);
}

/* Connector Category Tags */
.app-tag {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-muted);
}

.app-tag.salesforce {
    background: rgba(56, 189, 248, 0.14);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.app-tag.stripe {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.app-tag.xero {
    background: rgba(19, 181, 234, 0.14);
    color: #13b5ea;
    border: 1px solid rgba(19, 181, 234, 0.3);
}

.app-tag.slack {
    background: rgba(236, 72, 153, 0.14);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

.app-tag.gmail {
    background: rgba(234, 67, 53, 0.14);
    color: #f87171;
    border: 1px solid rgba(234, 67, 53, 0.3);
}

.app-tag.openai {
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.app-tag.a2z_webhook {
    background: rgba(192, 132, 252, 0.14);
    color: #c084fc;
    border: 1px solid rgba(192, 132, 252, 0.3);
}

.app-tag.gemini {
    background: rgba(66, 133, 244, 0.14);
    color: #60a5fa;
    border: 1px solid rgba(66, 133, 244, 0.3);
}

.app-tag.bookings {
    background: rgba(0, 120, 212, 0.14);
    color: #38bdf8;
    border: 1px solid rgba(0, 120, 212, 0.3);
}

.app-select-card[data-key='gmail']:hover,
.app-select-card[data-key='gmail'].selected {
    border-color: rgba(234, 67, 53, 0.6) !important;
    box-shadow: 0 0 16px rgba(234, 67, 53, 0.2) !important;
}

/* ==========================================================
   Landing Page: Available Connector Drivers Section
   ========================================================== */
.connectors-section {
    padding: 100px 0 120px;
    position: relative;
    background: radial-gradient(circle at 50% 20%, rgba(56, 189, 248, 0.04) 0%, transparent 70%);
}

.connector-filter-bar {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.connector-filter-btn {
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 8px 18px;
    border-radius: var(--radius-pill);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.connector-filter-btn:hover {
    border-color: var(--accent-color);
    color: var(--text-main);
    transform: translateY(-1px);
}

.connector-filter-btn.active {
    background: rgba(56, 189, 248, 0.12);
    border-color: var(--accent-color);
    color: var(--accent-color);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.landing-connectors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 1240px;
    margin: 0 auto;
}

@media (max-width: 1100px) {
    .landing-connectors-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 720px) {
    .landing-connectors-grid {
        grid-template-columns: 1fr;
    }
}

.landing-connector-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.landing-connector-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--card-accent-grad, linear-gradient(90deg, #38bdf8, #818cf8));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.landing-connector-card:hover {
    transform: translateY(-6px);
    border-color: var(--card-border-hover, rgba(56, 189, 248, 0.45));
    box-shadow:
        0 20px 40px -15px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(56, 189, 248, 0.12);
}

.landing-connector-card:hover::before {
    opacity: 1;
}

.landing-connector-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.landing-connector-icon-box {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.landing-connector-card:hover .landing-connector-icon-box {
    transform: scale(1.08) rotate(4deg);
}

.landing-connector-title {
    font-size: 1.12rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.landing-connector-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.landing-connector-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-pill);
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    white-space: nowrap;
}

.landing-connector-desc {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
}

.landing-connector-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.landing-connector-meta-chip {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.landing-connector-features {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.landing-connector-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.landing-connector-feature-item i {
    color: var(--accent-color);
    flex-shrink: 0;
    margin-top: 2px;
}

.landing-connector-btn {
    margin-top: auto;
    width: 100%;
    padding: 9px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: var(--radius-md);
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.landing-connector-card:hover .landing-connector-btn {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

/* ==========================================================
   Horizontal Scrollable Connection Filter Strip
   ========================================================== */
.conn-filter-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.conn-scroll-container {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
    flex: 1;
    min-width: 0;
    padding: 2px 0;
}

.conn-filter-fade-left,
.conn-filter-fade-right {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 24px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.conn-filter-fade-left {
    left: 0;
    background: linear-gradient(90deg, var(--bg-card, #0f172a) 0%, transparent 100%);
}

.conn-filter-fade-right {
    right: 0;
    background: linear-gradient(270deg, var(--bg-card, #0f172a) 0%, transparent 100%);
}

[data-theme='light'] .conn-filter-fade-left {
    background: linear-gradient(90deg, #ffffff 0%, transparent 100%);
}

[data-theme='light'] .conn-filter-fade-right {
    background: linear-gradient(270deg, #ffffff 0%, transparent 100%);
}

.conn-filter-fade-left.visible,
.conn-filter-fade-right.visible {
    opacity: 1;
}

.conn-pills-scroll {
    display: flex;
    gap: 6px;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 4px 6px;
    white-space: nowrap;
    width: 100%;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}

.conn-pills-scroll:active {
    cursor: grabbing;
}

.conn-pills-scroll::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

.conn-filter-btn {
    flex-shrink: 0;
    transition: all 0.18s ease;
    white-space: nowrap;
    cursor: pointer;
}

/* ==========================================================
   Responsive Control Bars, Search Inputs & Table Utilities
   ========================================================== */
.conn-controls-bar,
.flow-controls-bar,
.log-controls-bar {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
}

.conn-search-box {
    flex: 1;
    min-width: 240px;
    max-width: 400px;
    position: relative;
    display: flex;
    align-items: center;
}

.conn-search-box input.node-input,
.conn-search-box input {
    width: 100%;
    padding: 8px 12px 8px 36px !important;
    font-size: 0.84rem;
    box-sizing: border-box;
}

.conn-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.conn-filter-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.conn-filter-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    flex-shrink: 0;
}

.conn-filter-badge {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: 8px;
    flex-shrink: 0;
}

.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}

table:not(.dashboard-widget-table) {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 780px;
}

table.dashboard-widget-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 0 !important;
    table-layout: fixed !important;
}

.dashboard-split-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 36px;
    width: 100%;
}

.dashboard-split-grid>div {
    min-width: 0;
}

@media (max-width: 1400px) {
    .dashboard-split-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

th,
td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.86rem;
    white-space: nowrap;
}

th {
    background: var(--bg-card);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Checkbox column constraints */
th.col-checkbox,
td.col-checkbox,
th:has(input[type='checkbox']),
td:has(input[type='checkbox']) {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    text-align: center !important;
    padding: 10px 4px !important;
    white-space: nowrap !important;
}

/* Flow Name & Text-heavy column wrapping */
.col-flow-name,
td.col-flow-name,
th.col-flow-name,
.flow-row-name,
.flow-name-cell,
.table-wrap-cell {
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    line-height: 1.35 !important;
    min-width: 160px;
    max-width: 220px;
}

.col-entity-record,
td.col-entity-record,
th.col-entity-record {
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
    line-height: 1.35 !important;
    min-width: 150px;
    max-width: 190px;
}

#flowsTableBody td:first-child {
    white-space: normal !important;
    word-break: break-word !important;
    min-width: 190px;
    max-width: 280px;
}

.dashboard-widget-table th:first-child,
.dashboard-widget-table td:first-child {
    min-width: 0 !important;
}

/* Dashboard overview widget table constraints: clean single-line rows with ellipsis */
.dashboard-widget-table .flow-row-name {
    white-space: nowrap !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    min-width: 0 !important;
    display: block;
}

.dashboard-widget-table td {
    padding: 11px 12px;
    vertical-align: middle;
}

.dashboard-widget-table .app-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    max-width: 116px;
    padding: 3px 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.dashboard-widget-table .status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    box-sizing: border-box;
    text-align: center;
}

tr:hover td {
    background: var(--bg-card-hover);
}

@media (max-width: 1280px) {
    .conn-filter-wrapper {
        max-width: 100%;
    }
}

/* Fair-Billing Subscription Modal & Live Card Theme Support */
.sub-live-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.9) 100%);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    transition: all 0.2s ease;
}

[data-theme='light'] .sub-live-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 1px solid rgba(245, 158, 11, 0.45) !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04) !important;
}

.sub-live-projection-bar {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

[data-theme='light'] .sub-live-projection-bar {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

.sub-plan-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
}

[data-theme='light'] .sub-plan-title {
    color: #0f172a !important;
}

.sub-plan-price {
    font-size: 1.45rem;
    font-weight: 900;
    color: var(--text-main);
}

[data-theme='light'] .sub-plan-price {
    color: #0f172a !important;
}

.sub-advance-title {
    font-size: 0.68rem;
    color: #38bdf8;
    text-transform: uppercase;
    font-weight: 700;
}

[data-theme='light'] .sub-advance-title {
    color: #0284c7 !important;
}

.sub-advance-val {
    font-size: 0.95rem;
    font-weight: 800;
    color: #38bdf8;
    margin-top: 1px;
}

[data-theme='light'] .sub-advance-val {
    color: #0284c7 !important;
}

/* Modal Backdrop */
#rechargeCreditsModal {
    padding: clamp(8px, 2vh, 24px) clamp(8px, 2vw, 20px) !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Base / Large Desktop (>= 1201px) */
#rechargeCreditsModal .modal-content {
    max-width: 1260px !important;
    width: 95vw !important;
    max-height: 92vh !important;
    border-radius: 18px !important;
    padding: 22px 28px !important;
    box-shadow: 0 30px 80px -15px rgba(0, 0, 0, 0.6) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
}

[data-theme='light'] #rechargeCreditsModal .modal-content {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 25px 65px -15px rgba(15, 23, 42, 0.18) !important;
}

#subscriptionPlansContainer {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
    margin-bottom: 16px !important;
}

/* ==============================================================================
   BREAKPOINT 1: LAPTOP / COMPACT VIEWPORT (1025px - 1280px OR max-height <= 850px)
   Keeps 4 columns compact enough to fit viewport with minimal vertical scrolling
   ============================================================================== */
@media screen and (max-width: 1280px) and (min-width: 901px),
screen and (max-height: 850px) and (min-width: 901px) {
    #rechargeCreditsModal {
        padding: 8px 12px !important;
    }

    #rechargeCreditsModal .modal-content {
        max-width: 1200px !important;
        width: 96vw !important;
        max-height: calc(100vh - 16px) !important;
        padding: 12px 16px !important;
        border-radius: 14px !important;
    }

    #rechargeCreditsModal .modal-header {
        padding-bottom: 8px !important;
        margin-bottom: 8px !important;
    }

    #rechargeCreditsModal .modal-header>div:first-child {
        gap: 10px !important;
    }

    #rechargeCreditsModal .modal-header>div:first-child>div:first-child {
        width: 32px !important;
        height: 32px !important;
        border-radius: 8px !important;
    }

    #rechargeCreditsModal .modal-header h3 {
        font-size: 1.1rem !important;
    }

    #rechargeCreditsModal .modal-header p {
        font-size: 0.72rem !important;
        margin-top: 1px !important;
    }

    #closeRechargeCreditsModal {
        width: 26px !important;
        height: 26px !important;
        font-size: 1.1rem !important;
    }

    #liveSubscriptionCard {
        padding: 8px 12px !important;
        margin-bottom: 8px !important;
        border-radius: 10px !important;
    }

    #liveSubscriptionCard>div:first-child {
        margin-bottom: 6px !important;
        gap: 8px !important;
    }

    .sub-plan-title {
        font-size: 1.05rem !important;
    }

    #subCreditBankValue {
        font-size: 1.25rem !important;
    }

    #subAdvanceStatusPill {
        padding: 4px 10px !important;
        border-radius: 6px !important;
    }

    .sub-advance-title {
        font-size: 0.65rem !important;
    }

    .sub-advance-val {
        font-size: 0.82rem !important;
    }

    .sub-live-projection-bar {
        padding: 6px 10px !important;
        border-radius: 8px !important;
    }

    #subRenewalProjectionText {
        font-size: 0.75rem !important;
    }

    #btnStripePortal,
    #btnRenewEarlyCycle {
        padding: 3px 8px !important;
        font-size: 0.7rem !important;
        border-radius: 6px !important;
    }

    #subscriptionPlansContainer {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 8px !important;
        margin-bottom: 8px !important;
    }

    .plan-tier-card {
        padding: 10px 8px !important;
        border-radius: 10px !important;
    }

    .plan-tier-card>div:first-child>div:first-child,
    .plan-card-name {
        font-size: 0.92rem !important;
        margin-bottom: 2px !important;
    }

    .plan-tier-card>div:first-child>div:nth-child(2),
    .plan-card-desc {
        font-size: 0.68rem !important;
        min-height: 20px !important;
        margin-bottom: 4px !important;
        line-height: 1.25 !important;
    }

    .plan-price-wrapper {
        margin: 6px 0 8px !important;
    }

    .plan-tier-card .sub-plan-price {
        font-size: 1.3rem !important;
    }

    .plan-tier-card .sub-plan-price+span {
        font-size: 0.7rem !important;
    }

    .plan-tier-card .plan-credits-box {
        padding: 5px 6px !important;
        margin-bottom: 6px !important;
        border-radius: 6px !important;
    }

    .plan-tier-card .plan-credits-val {
        font-size: 0.76rem !important;
    }

    .plan-tier-card .plan-advance-text {
        font-size: 0.66rem !important;
        margin-top: 2px !important;
    }

    .plan-tier-card ul,
    .plan-feature-list {
        margin: 0 0 6px !important;
        gap: 3px !important;
        font-size: 0.68rem !important;
    }

    .plan-tier-card ul li {
        gap: 5px !important;
        line-height: 1.25 !important;
    }

    .plan-tier-card ul li span:first-child {
        width: 13px !important;
        height: 13px !important;
    }

    .plan-tier-card ul li span:first-child svg {
        width: 8px !important;
        height: 8px !important;
    }

    .plan-tier-card .select-plan-btn {
        height: 30px !important;
        font-size: 0.74rem !important;
        border-radius: 6px !important;
    }

    .feature-equality-banner {
        padding: 6px 10px !important;
        border-radius: 8px !important;
        gap: 8px !important;
    }

    .feature-equality-banner i,
    .feature-equality-banner svg {
        width: 14px !important;
        height: 14px !important;
    }

    .feature-equality-banner div {
        font-size: 0.7rem !important;
        line-height: 1.3 !important;
    }
}

/* ==============================================================================
   BREAKPOINT 2: TABLET (641px - 900px)
   Gradually reduce to 2 columns with balanced spacing
   ============================================================================== */
@media screen and (max-width: 900px) and (min-width: 601px) {
    #rechargeCreditsModal {
        padding: 12px 14px !important;
    }

    #rechargeCreditsModal .modal-content {
        max-width: 760px !important;
        width: 95vw !important;
        max-height: 90vh !important;
        padding: 18px 20px !important;
        border-radius: 14px !important;
    }

    #rechargeCreditsModal .modal-header h3 {
        font-size: 1.18rem !important;
    }

    #subscriptionPlansContainer {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
        margin-bottom: 14px !important;
    }

    .plan-tier-card {
        padding: 14px 14px !important;
        border-radius: 12px !important;
    }

    .plan-tier-card .sub-plan-price {
        font-size: 1.55rem !important;
    }

    .plan-tier-card .select-plan-btn {
        height: 36px !important;
        font-size: 0.8rem !important;
    }

    #liveSubscriptionCard {
        padding: 12px 16px !important;
        margin-bottom: 14px !important;
    }

    .feature-equality-banner {
        padding: 8px 12px !important;
        font-size: 0.76rem !important;
    }
}

/* ==============================================================================
   BREAKPOINT 3: MOBILE (<= 600px)
   Clean single column layout
   ============================================================================== */
@media screen and (max-width: 600px) {
    #rechargeCreditsModal {
        padding: 6px !important;
    }

    #rechargeCreditsModal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100vh - 12px) !important;
        padding: 14px 12px !important;
        border-radius: 12px !important;
    }

    #subscriptionPlansContainer {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    #liveSubscriptionCard>div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
    }

    #subAdvanceStatusPill {
        text-align: left !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .sub-live-projection-bar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
}

.plan-tier-card {
    background: var(--bg-surface-0);
    border: 1.5px solid var(--border-color);
    border-radius: 16px !important;
    padding: 22px 20px !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
    transition:
        transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.plan-tier-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px -4px rgba(0, 0, 0, 0.16) !important;
}

[data-theme='light'] .plan-tier-card {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05) !important;
}

[data-theme='light'] .plan-tier-card:hover {
    box-shadow: 0 16px 36px -6px rgba(15, 23, 42, 0.12) !important;
}

.plan-credits-box {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

[data-theme='light'] .plan-credits-box {
    background: #fffbeb !important;
    border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

[data-theme='light'] .plan-credits-val {
    color: #b45309 !important;
}

[data-theme='light'] .plan-advance-text {
    color: #0284c7 !important;
}

[data-theme='light'] .feature-equality-banner {
    background: #ecfdf5 !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #065f46 !important;
}

[data-theme='light'] #subAdvanceStatusPill {
    background: rgba(2, 132, 199, 0.08) !important;
    border-color: rgba(2, 132, 199, 0.25) !important;
}

/* ==========================================================================
   Back-to-Top Button - Scroll-Progress Ring + Glassmorphism
   ========================================================================== */
#btt-btn {
    position: fixed;
    bottom: 36px;
    right: 36px;
    z-index: 9999;
    width: 56px;
    height: 56px;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    outline: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.85);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
    will-change: transform, opacity;
}

#btt-btn.btt-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

#btt-inner {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    background: rgba(14, 20, 34, 0.72);
    backdrop-filter: blur(16px) saturate(1.6);
    -webkit-backdrop-filter: blur(16px) saturate(1.6);
    border: 1px solid rgba(56, 189, 248, 0.22);
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0), 0 8px 28px -6px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme='light'] #btt-inner {
    background: rgba(248, 250, 252, 0.88);
    border-color: rgba(2, 132, 199, 0.3);
    box-shadow: 0 8px 28px -6px rgba(15, 23, 42, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

#btt-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.2s;
}

[data-theme='light'] #btt-arrow {
    color: var(--primary-color);
}

#btt-ring {
    position: absolute;
    inset: 0;
    width: 56px;
    height: 56px;
    transform: rotate(-90deg);
    pointer-events: none;
}

#btt-track {
    fill: none;
    stroke: rgba(56, 189, 248, 0.1);
    stroke-width: 2.5;
}

[data-theme='light'] #btt-track {
    stroke: rgba(2, 132, 199, 0.12);
}

#btt-progress {
    fill: none;
    stroke: url(#bttGrad);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-dasharray: 138.23;
    stroke-dashoffset: 138.23;
    transition: stroke-dashoffset 0.1s linear;
    filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.6));
}

#btt-btn:hover #btt-inner {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.55);
    box-shadow: 0 0 0 6px rgba(56, 189, 248, 0.12), 0 12px 32px -6px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    transform: scale(1.08);
}

[data-theme='light'] #btt-btn:hover #btt-inner {
    background: rgba(2, 132, 199, 0.08);
    border-color: rgba(2, 132, 199, 0.5);
    box-shadow: 0 0 0 6px rgba(2, 132, 199, 0.1), 0 12px 32px -6px rgba(15, 23, 42, 0.22);
}

#btt-btn:hover #btt-arrow {
    transform: translateY(-3px);
    color: #38bdf8;
}

#btt-btn:active #btt-inner {
    transform: scale(0.94);
}

#btt-ripple {
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, 0.6);
    pointer-events: none;
    opacity: 0;
}

#btt-ripple.btt-burst {
    animation: bttBurst 0.55s cubic-bezier(0.2, 0.8, 0.4, 1) forwards;
}

@keyframes bttBurst {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

@keyframes bttGlowPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(56, 189, 248, 0), 0 8px 28px -6px rgba(0, 0, 0, 0.55);
    }

    50% {
        box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.08), 0 8px 28px -6px rgba(0, 0, 0, 0.55);
    }
}

#btt-btn.btt-visible #btt-inner {
    animation: bttGlowPulse 3s ease-in-out infinite;
}

#btt-btn:hover #btt-inner,
#btt-btn:active #btt-inner {
    animation: none;
}

/* ==========================================================================
   Connection How-To Guide Panel
   ========================================================================== */
.conn-guide {
    display: block;
}

.conn-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.conn-guide-step:last-of-type {
    border-bottom: none;
}

.conn-guide-step strong {
    color: var(--text-main);
}

.conn-guide-step code {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent-color);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    word-break: break-all;
}

[data-theme='light'] .conn-guide-step code {
    background: rgba(2, 132, 199, 0.07);
    color: var(--primary-color);
    border-color: rgba(2, 132, 199, 0.18);
}

.conn-guide-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.14);
    color: var(--accent-color);
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

[data-theme='light'] .conn-guide-num {
    background: rgba(2, 132, 199, 0.1);
    color: var(--primary-color);
}

.conn-guide-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    opacity: 0.9;
    transition: opacity 0.15s;
}

.conn-guide-link:hover {
    opacity: 1;
    text-decoration: underline;
}

[data-theme='light'] .conn-guide-link {
    color: var(--primary-color);
}

/* ==========================================================================
   SALESFORCE FLOW BUILDER LOOP ELEMENT & BRANCHES
   ========================================================================== */
.flow-node.step-type-loop,
.flow-node.step-type-decision {
    background: var(--bg-card, #ffffff);
    border: 1.5px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    position: relative;
    padding: 12px 16px;
    width: 410px !important;
    max-width: min(410px, calc(100vw - 32px)) !important;
    box-sizing: border-box;
    transition: all 0.22s ease;
    cursor: pointer;
}

.flow-node.step-type-loop:hover {
    border-color: #f97316;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.18);
}

.flow-node.step-type-decision:hover {
    border-color: #f59e0b;
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.18);
}

.flow-node.step-type-loop.active-node-selected {
    border-color: #ea580c !important;
    box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.3) !important;
}

.flow-node.step-type-decision.active-node-selected {
    border-color: #f59e0b !important;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3) !important;
}

.loop-status-badge {
    display: none !important;
}

.loop-header-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.loop-chevron-btn {
    background: none;
    border: none;
    padding: 4px;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: transform 0.2s ease, color 0.15s ease;
}

.loop-chevron-btn:hover {
    color: var(--text-main);
    background: rgba(100, 116, 139, 0.12);
}

.action-step-wrapper.is-collapsed .loop-chevron-btn i {
    transform: rotate(-90deg);
}

.loop-icon-square {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
}

.loop-title-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.loop-title-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.loop-subtitle-row {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 2px;
}

.loop-count-highlight {
    font-weight: 600;
    color: #ea580c;
}

.loop-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.loop-element-count-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(234, 88, 12, 0.12);
    color: #ea580c;
    border: 1px solid rgba(234, 88, 12, 0.3);
    white-space: nowrap;
}

.loop-menu-btn {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.loop-menu-btn:hover {
    color: var(--text-main);
    background: rgba(100, 116, 139, 0.15);
}

.loop-action-dropdown {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
    padding: 6px;
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.loop-action-item {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    text-align: left;
    width: 100%;
    transition: all 0.15s ease;
}

.loop-action-item:hover {
    background: rgba(100, 116, 139, 0.12);
}

.loop-action-divider {
    height: 1px;
    background: var(--border-color, #e2e8f0);
    margin: 4px 0;
}

/* Loop Branch Tree Container */
.loop-branch-tree {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0;
    position: relative;
}

.loop-stem-center {
    width: 2px;
    height: 18px;
    background: #64748b;
    opacity: 0.6;
    margin: 0;
}

.loop-branches-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    width: auto;
    min-width: 100%;
    max-width: none;
    padding: 24px 60px 80px 60px;
    margin: 0 auto;
}

.loop-foreach-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 285px;
    min-width: 260px;
    position: relative;
    z-index: 2;
    margin: 0 auto;
}

.loop-afterlast-col {
    position: absolute;
    left: calc(50% + 155px);
    top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px;
    z-index: 2;
}

.loop-afterlast-spacer {
    display: none;
}

.loop-branch-pill {
    background: var(--bg-card, #ffffff);
    border: 1.5px solid #64748b;
    border-radius: 999px;
    padding: 5px 18px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    transition: all 0.2s ease;
    cursor: default;
}

.loop-branch-pill.foreach-pill {
    border-color: #64748b;
    color: var(--text-main);
}

.loop-branch-pill.afterlast-pill {
    border-color: #64748b;
    color: var(--text-main);
}

.loop-branch-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.loop-afterlast-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    flex: 1;
}

.loop-branch-line {
    width: 2px;
    height: 14px;
    background: #64748b;
    opacity: 0.75;
    margin: 0;
}

.loop-afterlast-line {
    width: 2px;
    height: 14px;
    background: #64748b;
    opacity: 0.75;
    margin: 0;
}

.loop-branch-add-btn {
    width: 28px !important;
    height: 28px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.75rem !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
    border-style: solid !important;
}

/* Loop Child Step Card inside For Each */
.loop-child-step-card {
    width: 320px;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 2;
}

.loop-child-step-card:hover {
    border-color: #ea580c;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(234, 88, 12, 0.2);
}

.loop-child-header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.loop-child-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.85rem;
}

.loop-child-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.loop-child-name {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loop-child-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loop-child-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.loop-child-actions button {
    background: none;
    border: none;
    padding: 4px;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.loop-child-actions button:hover {
    color: var(--text-main);
    background: rgba(100, 116, 139, 0.2);
}

.loop-child-delete-btn:hover {
    color: #ef4444 !important;
}

/* Loop SVG Wire Canvas */
.loop-branch-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: visible;
    z-index: 1;
}

.loop-branch-svg path.loop-track {
    stroke: #64748b;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.75;
}

/* Collapsed mode */
.action-step-wrapper.is-collapsed .loop-stem-center,
.action-step-wrapper.is-collapsed .loop-branches-container,
.action-step-wrapper.is-collapsed .decision-stem-top,
.action-step-wrapper.is-collapsed .decision-branches-container,
.action-step-wrapper.is-collapsed .decision-branch-tree {
    display: none !important;
}

.nested-decision-block.is-collapsed .loop-decision-branches-wrapper,
.nested-decision-block.is-collapsed .loop-decision-merge-wrapper,
.nested-decision-block.is-collapsed .loop-decision-branch-svg {
    display: none !important;
}

/* =========================================================================
   POPOVER ELEVATION & NESTED DECISION / LOOP ARCHITECTURE
   ========================================================================= */

.action-step-wrapper.has-active-popover,
.pipeline-connector-wrapper.has-active-popover,
.decision-branch-col.has-active-popover,
.decision-branch-body.has-active-popover,
.loop-decision-col.has-active-popover,
.loop-decision-col-body.has-active-popover,
.loop-child-decision-node.has-active-popover,
.nested-loop-block.has-active-popover,
.nested-loop-foreach-col.has-active-popover,
.nested-loop-foreach-body.has-active-popover,
.loop-foreach-col.has-active-popover,
.loop-branch-body.has-active-popover,
.add-step-connector.has-active-popover {
    position: relative !important;
    z-index: 99999 !important;
}

/* Branch Step Action buttons (Delete & Reorder) */
.branch-step-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
}

.branch-step-actions button,
.nested-loop-actions button,
.branch-step-delete-btn,
.nested-step-delete-btn,
.loop-decision-step-delete-btn {
    background: none;
    border: none;
    padding: 3px 5px;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.branch-step-delete-btn:hover,
.nested-step-delete-btn:hover,
.loop-decision-step-delete-btn:hover {
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.15);
}

/* Loop inside Decision Branch - Canvas graph alignment (transparent container) */
.decision-branch-loop-card {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    max-width: none !important;
}

.decision-branch-loop-card:hover {
    border-color: transparent !important;
    box-shadow: none !important;
}

.branch-loop-header {
    cursor: pointer;
}

.branch-loop-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #ea580c;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.branch-loop-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.branch-loop-title {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-loop-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.branch-loop-actions {
    display: flex;
    align-items: center;
    gap: 2px;
}

.branch-loop-body {
    padding: 8px 10px 10px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-surface-0);
}

/* =========================================================================
   SALESFORCE FLOW NESTED LOOP (SLDS GRAPH NODE ALIGNMENT)
   ========================================================================= */

.nested-loop-block {
    width: 100%;
    min-width: 440px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin: 8px 0 24px 0;
    overflow: visible;
}

.nested-loop-card {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    background: var(--bg-card, #ffffff);
    border: 1.5px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 3;
    padding: 8px 12px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.nested-loop-card:hover {
    border-color: #ea580c;
    box-shadow: 0 4px 14px rgba(234, 88, 12, 0.18);
    transform: translateY(-1px);
}

.nested-loop-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nested-loop-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: linear-gradient(135deg, #ea580c 0%, #c2410c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(234, 88, 12, 0.3);
}

.nested-loop-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.nested-loop-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nested-loop-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.nested-loop-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.nested-loop-branches-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    width: 100%;
    min-width: 420px;
    padding: 20px 24px 36px 24px;
    margin: 0 auto;
    overflow: visible;
}

.nested-loop-branch-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible !important;
}

.nested-loop-branch-svg path.loop-track {
    stroke: #64748b;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.75;
}

.nested-loop-foreach-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 260px;
    min-width: 250px;
    position: relative;
    z-index: 2;
    margin: 0 auto;
}

.nested-loop-foreach-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Step Card inside Nested Loop */
.nested-loop-step-card {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    background: var(--bg-card, #ffffff);
    border: 1.5px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease;
    text-align: left;
    position: relative;
    z-index: 2;
    box-sizing: border-box;
    flex-shrink: 0;
}

.nested-loop-step-card:hover {
    border-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.nested-step-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.82rem;
}

.nested-step-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nested-step-name {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nested-step-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nested-step-actions {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;
}

.nested-step-move-btn {
    background: none;
    border: none;
    padding: 3px;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.nested-step-move-btn:hover {
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.12);
}

.nested-step-delete-btn {
    background: none;
    border: none;
    padding: 3px;
    border-radius: 4px;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.nested-step-delete-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
}

.nested-loop-connector-line {
    width: 2px;
    height: 8px;
    background: #64748b;
    opacity: 0.75;
    margin: 0 auto;
    flex-shrink: 0;
}

.nested-intermediate-add-btn {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    border: 1.5px solid var(--border-color, #cbd5e1) !important;
    background: var(--bg-card, #ffffff) !important;
    color: var(--text-muted, #64748b) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
    cursor: pointer !important;
    position: relative !important;
    z-index: 3 !important;
    margin: 0 auto !important;
}

.nested-intermediate-add-btn:hover {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
    transform: scale(1.18) !important;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25) !important;
}

.nested-intermediate-add-btn i {
    width: 11px !important;
    height: 11px !important;
    stroke-width: 2.2px !important;
}

.nested-loop-afterlast-col {
    position: absolute;
    left: calc(50% + 140px);
    top: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    z-index: 2;
}

.nested-loop-afterlast-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.nested-loop-reconnect-line,
.nested-loop-block+.loop-decision-line,
.nested-loop-block+.loop-branch-line,
.nested-loop-block+.decision-branch-line,
.nested-loop-block+.nested-loop-connector-line,
.nested-loop-block+.decision-branch-add-btn,
.nested-loop-block+.loop-decision-add-step-btn,
.nested-loop-block+.nested-decision-outcome-add-btn,
.nested-decision-block+.loop-decision-line,
.nested-decision-block+.loop-branch-line,
.nested-decision-block+.decision-branch-line,
.nested-decision-block+.nested-loop-connector-line,
.nested-decision-block+.decision-branch-add-btn,
.nested-decision-block+.loop-decision-add-step-btn,
.nested-decision-block+.nested-intermediate-add-btn,
.nested-decision-block+.loop-child-nested-loop-add-btn,
.loop-child-decision-node+.nested-intermediate-add-btn,
.loop-child-decision-node+.loop-child-nested-loop-add-btn,
.decision-branch-add-btn+.decision-branch-line,
.loop-decision-add-step-btn+.loop-decision-line,
.loop-decision-add-step-btn+.decision-branch-line,
.nested-decision-outcome-add-btn+.loop-decision-line,
.nested-decision-outcome-add-btn+.decision-branch-line {
    display: none !important;
}

/* Allow columns to expand when containing nested loops or nested decisions */
.loop-decision-col:has(.nested-loop-block),
.loop-decision-col:has(.loop-child-decision-node),
.loop-decision-col:has(.nested-decision-block),
.decision-branch-col:has(.nested-loop-block),
.decision-branch-col:has(.loop-child-decision-node),
.decision-branch-col:has(.nested-decision-block),
.nested-loop-foreach-col:has(.nested-loop-block),
.nested-loop-foreach-col:has(.nested-decision-block),
.nested-loop-foreach-col:has(.loop-child-decision-node) {
    width: auto !important;
    min-width: 520px !important;
    max-width: none !important;
    flex: 0 0 auto !important;
}

.nested-loop-branches-container:has(.nested-loop-block),
.nested-loop-branches-container:has(.nested-decision-block),
.nested-loop-branches-container:has(.loop-child-decision-node) {
    max-width: none !important;
    width: auto !important;
}

.nested-loop-block:has(.nested-decision-block),
.nested-loop-block:has(.loop-child-decision-node) {
    width: auto !important;
    min-width: 480px !important;
    max-width: none !important;
}

.decision-branches-container:has(.nested-decision-block),
.decision-branches-container:has(.nested-loop-block),
.decision-branches-container:has(.loop-child-decision-node) {
    max-width: none !important;
    width: auto !important;
    gap: 90px !important;
}

.loop-decision-branches-wrapper:has(.nested-decision-block) {
    width: auto !important;
    min-width: 100% !important;
}

.loop-foreach-col:has(.nested-loop-block),
.loop-foreach-col:has(.loop-child-decision-node),
.loop-foreach-col:has(.nested-decision-block),
.loop-foreach-col:has(.loop-child-decision-container) {
    width: auto !important;
    min-width: 480px !important;
    max-width: none !important;
}

.loop-decision-top-bar {
    display: none !important;
}

.loop-decision-branches-wrapper::before {
    display: none !important;
}

.loop-decision-branch-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: visible !important;
}

.loop-decision-branch-svg path.decision-branch-track {
    stroke: #64748b;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: 0.75;
}

/* =========================================================================
   SALESFORCE FLOW NESTED DECISION (SLDS GRAPH NODE ALIGNMENT)
   ========================================================================= */
.loop-child-decision-node {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 4px 0;
    position: relative;
    z-index: 2;
}

.loop-child-decision-card {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    background: var(--bg-card, #ffffff);
    border: 1.5px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    box-sizing: border-box;
    flex-shrink: 0;
    text-align: left;
}

.loop-child-decision-card:hover {
    border-color: #f59e0b;
    box-shadow: 0 6px 18px rgba(245, 158, 11, 0.18);
    transform: translateY(-1px);
}

.loop-decision-branches-wrapper {
    display: flex;
    gap: 44px;
    justify-content: center;
    align-items: flex-start;
    padding: 14px 20px 0 20px;
    position: relative;
    width: max-content;
    margin: 0 auto;
}

.loop-decision-merge-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 36px;
    position: relative;
    z-index: 2;
    width: 100%;
}

.loop-decision-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 320px;
    width: auto;
    flex: 0 0 auto;
}

.loop-decision-pill {
    background: var(--bg-card, #ffffff);
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.15s ease;
}

.loop-decision-pill:hover {
    border-color: #f59e0b;
    color: #f59e0b;
    transform: translateY(-1px);
}

.loop-decision-col-body {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loop-decision-line {
    width: 2px;
    height: 12px;
    background: #64748b;
    opacity: 0.75;
    margin: 0;
}

.loop-decision-step-card {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--bg-card, #ffffff);
    border: 1.5px solid var(--border-color, #cbd5e1);
    border-radius: 8px;
    cursor: pointer;
    box-sizing: border-box;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.15s ease;
    text-align: left;
}

.loop-decision-step-credit-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.loop-decision-step-card:hover {
    border-color: #f59e0b;
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.18);
}

.loop-decision-step-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.loop-decision-step-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.loop-decision-step-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.loop-decision-step-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.loop-decision-step-delete-btn,
.nested-decision-child-delete-btn,
.nested-decision-delete-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    padding: 3px;
    cursor: pointer;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.65;
    transition: all 0.15s ease;
}

.loop-decision-step-delete-btn:hover,
.nested-decision-child-delete-btn:hover,
.nested-decision-delete-btn:hover {
    color: #ef4444;
    opacity: 1;
    background: rgba(239, 68, 68, 0.1);
}

.loop-decision-add-step-btn,
.nested-decision-outcome-add-btn,
.nested-decision-intermediate-add-btn,
.nested-decision-merge-add-btn {
    width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.7rem !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #0176d3 !important;
    background: var(--bg-card, #ffffff) !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08) !important;
    transition: all 0.15s ease !important;
}

.loop-decision-add-step-btn:hover,
.nested-decision-outcome-add-btn:hover,
.nested-decision-merge-add-btn:hover {
    border-color: #0176d3 !important;
    background: rgba(1, 118, 211, 0.08) !important;
    transform: scale(1.08) !important;
}

/* Bottom Merge Junction for Decision Outcomes */
.loop-decision-merge-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-top: 14px;
    z-index: 2;
}

.loop-decision-merge-bracket {
    display: none !important;
}

/* Responsive container flow */
#actionStepsContainer {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.action-step-wrapper {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Allow containers to expand naturally when containing wide decision branches or nested loops */
.action-step-wrapper:has(.decision-branch-tree),
.action-step-wrapper:has(.loop-branch-tree),
#actionStepsContainer:has(.decision-branch-tree),
#actionStepsContainer:has(.loop-branch-tree) {
    width: auto !important;
    max-width: none !important;
}

.loop-branch-tree {
    width: auto !important;
    max-width: 100%;
}

.loop-foreach-col:has(.loop-child-decision-node),
.loop-foreach-col:has(.loop-child-decision-container),
.loop-foreach-col:has(.nested-loop-block) {
    width: auto !important;
    min-width: 380px !important;
    max-width: none !important;
}

/* ====================================================
   PREMIUM CUSTOM SELECT COMPONENT
   ==================================================== */
.custom-select-container {
    position: relative;
    width: 100%;
    user-select: none;
    font-family: var(--font-sans, inherit);
}

.custom-select-native-hidden {
    position: absolute !important;
    opacity: 0 !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
}

.custom-select-trigger {
    width: 100%;
    min-height: 42px;
    padding: 9px 13px;
    background: var(--bg-input, #0f172a);
    border: 1px solid var(--border-color, #334155);
    border-radius: var(--radius-sm, 6px);
    color: var(--text-main, #f8fafc);
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.custom-select-trigger:hover {
    border-color: var(--border-hover, #64748b);
    background: var(--bg-surface-0, #1e293b);
}

.custom-select-trigger:focus,
.custom-select-trigger.is-open {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
    background: var(--bg-input, #0f172a);
}

.custom-select-trigger.is-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
    border-color: var(--border-color, #334155);
}

.custom-select-trigger-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.custom-select-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
}

.custom-select-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-main, #f8fafc);
}

.custom-select-placeholder {
    color: var(--text-muted, #94a3b8);
    font-weight: 400;
}

.custom-select-chevron {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted, #94a3b8);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s;
    flex-shrink: 0;
}

.custom-select-trigger.is-open .custom-select-chevron {
    transform: rotate(180deg);
    color: #38bdf8;
}

.custom-select-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 5px);
    z-index: 1050;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    max-height: 250px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px;
    display: none;
    scrollbar-width: thin;
}

.custom-select-menu.is-open {
    display: block;
    animation: customSelectFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

.custom-select-search-wrapper {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-card, #1e293b);
    padding: 4px 4px 8px;
    border-bottom: 1px solid var(--border-color, #334155);
    margin-bottom: 4px;
}

.custom-select-search-input {
    width: 100%;
    padding: 6px 10px 6px 30px;
    font-size: 0.8rem;
    background: var(--bg-input, #0f172a);
    border: 1px solid var(--border-color, #334155);
    border-radius: 5px;
    color: var(--text-main, #f8fafc);
    outline: none;
    box-sizing: border-box;
}

.custom-select-search-input:focus {
    border-color: #38bdf8;
}

.custom-select-search-icon {
    position: absolute;
    left: 12px;
    top: 13px;
    color: var(--text-muted, #94a3b8);
    pointer-events: none;
    font-size: 0.75rem;
}

.custom-select-group-header {
    background: #0f172a;
    color: #f8fafc;
    border-radius: 5px;
    padding: 5px 9px;
    margin: 8px 4px 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
    cursor: default;
    user-select: none;
}

.custom-select-group-header:first-child {
    margin-top: 4px;
}

.custom-select-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.84rem;
    color: var(--text-main, #f8fafc);
    transition: background 0.12s ease, color 0.12s ease;
}

.custom-select-option:hover,
.custom-select-option.is-focused {
    background: rgba(56, 189, 248, 0.14);
    color: #38bdf8;
}

.custom-select-option.is-selected {
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    font-weight: 600;
}

.custom-select-option.is-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.custom-select-option-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.custom-select-option-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-select-check {
    display: none;
    color: #38bdf8;
    flex-shrink: 0;
}

.custom-select-option.is-selected .custom-select-check {
    display: inline-flex;
}

.custom-select-menu.opens-up {
    top: auto;
    bottom: calc(100% + 5px);
    box-shadow: 0 -12px 28px rgba(0, 0, 0, 0.35);
}

.custom-select-option[data-value="__custom__"] {
    border-top: 1px dashed var(--border-color, #334155);
    margin-top: 4px;
    padding-top: 8px;
    color: #c084fc;
    font-weight: 600;
}

.custom-select-option[data-value="__custom__"]:hover {
    background: rgba(168, 85, 247, 0.16);
    color: #e9d5ff;
}

.custom-select-empty {
    padding: 12px 10px;
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    text-align: center;
    font-style: italic;
}

/* Light mode overrides */
[data-theme='light'] .custom-select-trigger {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme='light'] .custom-select-trigger:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

[data-theme='light'] .custom-select-menu {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

[data-theme='light'] .custom-select-option {
    color: #1e293b;
}

[data-theme='light'] .custom-select-option:hover {
    background: rgba(2, 132, 199, 0.08);
    color: #0284c7;
}

[data-theme='light'] .custom-select-option.is-selected {
    background: rgba(2, 132, 199, 0.14);
    color: #0284c7;
}


/* ====================================================
   SALESFORCE FLOW BUILDER: LOOP & CUSTOM DROPDOWN STYLES
   ==================================================== */
.custom-select-trigger.is-compact {
    min-height: 30px !important;
    padding: 4px 8px !important;
    font-size: 0.78rem !important;
    border-radius: 5px !important;
}

.custom-select-menu.is-floating {
    position: fixed !important;
    z-index: 999999 !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45) !important;
}

/* Loop Canvas Node Warning matching Salesforce */
.flow-node.action-step-node.step-type-loop.sf-loop-warning {
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3) !important;
}

.sf-loop-warning-pill {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 0.64rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Salesforce Loop Config Panel */
.sf-loop-card {
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm, 8px);
    padding: 16px;
    margin-bottom: 16px;
}

.sf-section-header {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 16px 0 8px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sf-help-text {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.45;
    margin-bottom: 14px;
}

.sf-tooltip-icon {
    display: inline-flex;
    align-items: center;
    color: var(--text-muted);
    cursor: help;
}

.sf-tooltip-icon:hover {
    color: #38bdf8;
}

/* Salesforce Combobox for Collection Variable */
.sf-combobox-wrapper {
    position: relative;
    width: 100%;
}

.sf-combobox-trigger {
    width: 100%;
    min-height: 38px;
    padding: 7px 12px;
    background: var(--bg-input, #0f172a);
    border: 1px solid var(--border-color, #334155);
    border-radius: var(--radius-sm, 6px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.18s ease;
    outline: none;
}

.sf-combobox-trigger:hover {
    border-color: var(--border-hover, #64748b);
    background: var(--bg-surface-0, #1e293b);
}

.sf-combobox-trigger:focus,
.sf-combobox-trigger.is-open {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.sf-combobox-trigger.has-error {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

.sf-combobox-trigger.has-error:focus,
.sf-combobox-trigger.has-error.is-open {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

.sf-combobox-trigger-content {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1;
}

.sf-combobox-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.sf-combobox-text {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text-main, #f8fafc);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sf-combobox-text.sf-placeholder {
    color: var(--text-muted, #94a3b8);
    font-weight: 400;
}

.sf-combobox-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.sf-combobox-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sf-combobox-clear-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.sf-combobox-chevron {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s;
}

.sf-combobox-trigger.is-open .sf-combobox-chevron {
    transform: rotate(180deg);
    color: #38bdf8;
}

.sf-validation-text {
    color: #ef4444;
    font-size: 0.74rem;
    font-weight: 600;
    margin-top: 4px;
}

/* Salesforce Combobox Popover */
.sf-combobox-popover {
    position: fixed;
    z-index: 999999;
    min-width: 340px;
    max-width: 480px;
    max-height: 340px;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: sfPopIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.sf-combobox-search-wrap {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 10px;
    background: var(--bg-card, #1e293b);
    border-bottom: 1px solid var(--border-color, #334155);
}

.sf-combobox-search-input {
    width: 100%;
    padding: 6px 10px 6px 30px;
    font-size: 0.82rem;
    background: var(--bg-input, #0f172a);
    border: 1px solid var(--border-color, #334155);
    border-radius: 6px;
    color: var(--text-main, #f8fafc);
    outline: none;
    box-sizing: border-box;
}

.sf-combobox-search-input:focus {
    border-color: #38bdf8;
}

.sf-combobox-header {
    background: #0f172a;
    color: #f8fafc;
    border-radius: 5px;
    padding: 5px 10px;
    margin: 6px 6px 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
    cursor: default;
    user-select: none;
}

.sf-combobox-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 6px;
    max-height: 220px;
}

.sf-combobox-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-main, #f8fafc);
    transition: all 0.12s;
}

.sf-combobox-item:hover {
    background: rgba(56, 189, 248, 0.14);
    color: #38bdf8;
}

.sf-combobox-item.is-selected {
    background: rgba(56, 189, 248, 0.22);
    color: #38bdf8;
    font-weight: 600;
}

.sf-combobox-empty {
    padding: 16px 12px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted, #94a3b8);
    font-style: italic;
}

.sf-combobox-footer {
    padding: 6px 10px;
    border-top: 1px solid var(--border-color, #334155);
    background: var(--bg-surface-0, #1e293b);
}

.sf-combobox-new-btn {
    width: 100%;
    padding: 6px 10px;
    background: none;
    border: 1px dashed var(--border-color, #334155);
    border-radius: 6px;
    color: #38bdf8;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.15s;
}

.sf-combobox-new-btn:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: #38bdf8;
}

/* Salesforce Radio Cards */
.sf-radio-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--border-color, #334155);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    background: var(--bg-input, #0f172a);
    user-select: none;
}

.sf-radio-card:hover {
    border-color: var(--border-hover, #64748b);
    background: var(--bg-surface-0, #1e293b);
}

.sf-radio-card.is-selected {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.08);
}

.sf-radio-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.sf-radio-custom {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--border-color, #64748b);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.sf-radio-card.is-selected .sf-radio-custom {
    border-color: #f97316;
    background: #f97316;
    box-shadow: inset 0 0 0 3px var(--bg-card, #1e293b);
}

.sf-radio-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-main, #f8fafc);
}

/* ====================================================
   SALESFORCE FLOW BUILDER: ASSIGNMENT ELEMENT
   ==================================================== */
.sf-assignment-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ea580c;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 800;
    font-size: 1.15rem;
    line-height: 1;
    flex-shrink: 0;
}

.sf-assignment-warning {
    border: 2px solid #ef4444 !important;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.3) !important;
}

.sf-add-assignment-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-surface-0, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 999px;
    color: var(--text-main, #f8fafc);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.sf-add-assignment-btn:hover {
    border-color: #38bdf8;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}

/* Variable / Resource Pill in Table Cells */
.sf-pill-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 36px;
    padding: 4px 8px;
    background: var(--bg-input, #0f172a);
    border: 1px solid var(--border-color, #334155);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.sf-pill-box:hover {
    border-color: var(--border-hover, #64748b);
    background: var(--bg-surface-0, #1e293b);
}

.sf-pill-box:focus,
.sf-pill-box.is-open {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.sf-pill-box.has-error {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

.sf-pill-content {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.sf-pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--text-main, #f8fafc);
    font-size: 0.78rem;
    font-weight: 500;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sf-pill-tag.is-variable {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.3);
}

.sf-pill-tag.is-loop {
    background: rgba(249, 115, 22, 0.12);
    border-color: rgba(249, 115, 22, 0.3);
}

.sf-pill-tag.is-literal {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.3);
    font-family: monospace;
}

.sf-pill-type-icon {
    font-size: 0.74rem;
    font-weight: 800;
    flex-shrink: 0;
    color: var(--text-muted);
}

.sf-pill-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sf-pill-clear-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: color 0.15s;
}

.sf-pill-clear-btn:hover {
    color: #ef4444;
}

.sf-pill-placeholder {
    color: var(--text-muted, #94a3b8);
    font-size: 0.8rem;
    font-weight: 400;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ====================================================
   CUSTOM RESOURCE PICKER (DECISION & CONDITIONS)
   ==================================================== */
.cr-picker-wrapper {
    position: relative;
    width: 100%;
    min-width: 0;
}

.cr-picker-trigger {
    width: 100%;
    min-height: 32px;
    padding: 4px 8px;
    background: var(--bg-input, #0f172a);
    border: 1px solid var(--border-color, #334155);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
    box-sizing: border-box;
    transition: all 0.15s;
    outline: none;
}

.cr-picker-trigger:hover {
    border-color: var(--border-hover, #64748b);
    background: var(--bg-surface-0, #1e293b);
}

.cr-picker-trigger:focus,
.cr-picker-trigger.is-open {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.cr-trigger-content {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}

.cr-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.cr-trigger-text {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-main, #f8fafc);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cr-trigger-text.cr-placeholder {
    color: var(--text-muted, #94a3b8);
    font-weight: 400;
}

.cr-trigger-chevron {
    color: var(--text-muted, #94a3b8);
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.cr-picker-trigger.is-open .cr-trigger-chevron {
    transform: rotate(180deg);
    color: #38bdf8;
}

/* Custom Resource Dropdown Panel */
.cr-dropdown-panel {
    position: fixed;
    z-index: 999999;
    min-width: 320px;
    max-width: 460px;
    max-height: 360px;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: sfPopIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.cr-search-wrap {
    padding: 8px;
    border-bottom: 1px solid var(--border-color, #334155);
    background: var(--bg-card, #1e293b);
    position: sticky;
    top: 0;
    z-index: 2;
}

.cr-search-input {
    width: 100%;
    padding: 6px 10px 6px 28px;
    font-size: 0.8rem;
    background: var(--bg-input, #0f172a);
    border: 1px solid var(--border-color, #334155);
    border-radius: 5px;
    color: var(--text-main, #f8fafc);
    outline: none;
    box-sizing: border-box;
}

.cr-search-input:focus {
    border-color: #38bdf8;
}

.cr-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 6px;
    max-height: 280px;
}

.cr-group-header {
    background: #0f172a;
    color: #f8fafc;
    border-radius: 5px;
    padding: 5px 9px;
    margin: 8px 2px 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
    cursor: default;
    user-select: none;
}

.cr-group-header:first-child {
    margin-top: 3px;
}

.cr-group-header span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cr-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.79rem;
    color: var(--text-main, #f8fafc);
    transition: all 0.12s;
}

.cr-item:hover {
    background: rgba(56, 189, 248, 0.14);
    color: #38bdf8;
}

.cr-item.is-selected {
    background: rgba(56, 189, 248, 0.22);
    color: #38bdf8;
    font-weight: 600;
}

.cr-item-custom {
    border-top: 1px dashed var(--border-color, #334155);
    margin-top: 4px;
    padding-top: 8px;
    color: #c084fc;
    font-weight: 600;
}

.cr-item-custom:hover {
    background: rgba(168, 85, 247, 0.15);
    color: #e9d5ff;
}

/* Light Theme overrides */
[data-theme='light'] .sf-combobox-trigger,
[data-theme='light'] .sf-radio-card,
[data-theme='light'] .cr-picker-trigger {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme='light'] .sf-combobox-popover,
[data-theme='light'] .cr-dropdown-panel {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

[data-theme='light'] .sf-combobox-item,
[data-theme='light'] .cr-item {
    color: #1e293b;
}

[data-theme='light'] .sf-combobox-search-input,
[data-theme='light'] .cr-search-input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme='light'] .cr-group-header,
[data-theme='light'] .custom-select-group-header,
[data-theme='light'] .sf-combobox-header {
    background: #0f172a !important;
    color: #f8fafc !important;
    border: 1px solid #1e293b !important;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22) !important;
}

[data-theme='light'] .cr-search-wrap,
[data-theme='light'] .sf-combobox-search-wrap {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

[data-theme='light'] .sf-add-assignment-btn {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme='light'] .sf-add-assignment-btn:hover {
    border-color: #0284c7;
    color: #0284c7;
    background: #f0f9ff;
}

[data-theme='light'] .sf-pill-box {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme='light'] .sf-pill-tag {
    color: #0f172a;
}

/* ==========================================================================
   Salesforce Flow Resources Manager & Resource Modal Styles
   ========================================================================== */
.sf-resource-card {
    background: var(--bg-surface-0, rgba(15, 23, 42, 0.6));
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.15s ease;
}

.sf-resource-card:hover {
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.04);
}

.sf-resource-type-pill {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.sf-resource-type-pill.type-variable {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.sf-resource-type-pill.type-constant {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.sf-resource-type-pill.type-formula {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.sf-resource-type-pill.type-text-template {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.sf-resource-col-badge {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    font-size: 0.66rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.25);
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.sf-resource-action-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.sf-resource-action-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.sf-resource-action-btn.delete-btn:hover {
    color: #f87171;
    background: rgba(239, 68, 68, 0.15);
}

[data-theme='light'] .sf-resource-card {
    background: #ffffff;
    border-color: #cbd5e1;
}

[data-theme='light'] .sf-resource-card:hover {
    background: #f0f9ff;
    border-color: #0284c7;
}

[data-theme='light'] .flow-modal-card {
    background: #ffffff !important;
    border-color: #cbd5e1 !important;
}

[data-theme='light'] #newResourceModal .flow-modal-card > div:first-child,
[data-theme='light'] #flowResourcesModal .flow-modal-card > div:first-child,
[data-theme='light'] #newResourceModal .flow-modal-card > div:last-child,
[data-theme='light'] #flowResourcesModal .flow-modal-card > div:last-child {
    background: #f8fafc !important;
}

/* ==========================================================================
   Salesforce Flow Builder: Sub-Header Toolbar (Mini Header Below)
   ========================================================================== */
.canvas-sub-header {
    height: 44px;
    flex-shrink: 0;
    background: var(--bg-surface-0, #0f172a);
    border-bottom: 1px solid var(--border-color, #334155);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    z-index: 1050;
    box-sizing: border-box;
    position: relative;
    user-select: none;
}

.canvas-sub-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
    flex: 1;
    overflow: hidden;
}

.sf-subbar-res-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #334155);
    color: var(--text-main, #f8fafc);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.sf-subbar-res-btn:hover {
    border-color: #c084fc;
    background: rgba(168, 85, 247, 0.08);
}

.sf-subbar-badge {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 999px;
    line-height: 1.2;
}

.sf-subbar-new-res-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    background: #0284c7;
    border: 1px solid #0284c7;
    color: #ffffff;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.sf-subbar-new-res-btn:hover {
    background: #0369a1;
    border-color: #0369a1;
}

.sf-subbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color, #334155);
    flex-shrink: 0;
    margin: 0 4px;
}

.sf-subbar-chips-container {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex: 1;
    min-width: 0;
    padding: 2px 0;
}

.sf-subbar-chips-container::-webkit-scrollbar {
    display: none;
}

.sf-subbar-res-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    background: var(--bg-card, rgba(30, 41, 59, 0.75));
    border: 1px solid var(--border-color, #334155);
    border-radius: 999px;
    font-size: 0.74rem;
    color: var(--text-main, #f8fafc);
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.sf-subbar-res-chip:hover {
    border-color: #a855f7;
    background: rgba(168, 85, 247, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.sf-subbar-res-chip .chip-name {
    font-family: monospace;
    font-weight: 600;
    font-size: 0.76rem;
}

.sf-subbar-res-chip .chip-val {
    color: var(--text-muted, #94a3b8);
    font-size: 0.7rem;
    opacity: 0.85;
}

.sf-chip-col-tag {
    font-size: 0.65rem;
    font-weight: 800;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.12);
    padding: 0 3px;
    border-radius: 3px;
}

.sf-subbar-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.sf-subbar-search-wrap i {
    position: absolute;
    left: 8px;
    pointer-events: none;
}

.sf-subbar-search-input {
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #334155);
    color: var(--text-main, #f8fafc);
    border-radius: 6px;
    font-size: 0.76rem;
    padding: 4px 8px 4px 26px;
    width: 130px;
    transition: width 0.2s ease, border-color 0.2s ease;
}

.sf-subbar-search-input:focus {
    width: 190px;
    outline: none;
    border-color: #38bdf8;
    background: var(--bg-surface-0, #0f172a);
}

.sf-subbar-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted, #94a3b8);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color, #334155);
    border-radius: 6px;
}

.sf-subbar-icon-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 6px;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    transition: all 0.15s ease;
}

.sf-subbar-icon-btn:hover {
    color: var(--text-main, #f8fafc);
    border-color: #38bdf8;
    background: rgba(56, 189, 248, 0.08);
}

/* Light Theme Overrides */
[data-theme='light'] .canvas-sub-header {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme='light'] .sf-subbar-res-btn,
[data-theme='light'] .sf-subbar-icon-btn,
[data-theme='light'] .sf-subbar-search-input {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme='light'] .sf-subbar-res-chip {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme='light'] .sf-subbar-res-chip:hover {
    background: #faf5ff;
    border-color: #c084fc;
}

[data-theme='light'] .sf-subbar-divider {
    background: #e2e8f0;
}

/* ==========================================================================
   Salesforce Flow Builder: Formula Builder Component
   ========================================================================== */
.sf-formula-builder-card {
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    background: var(--bg-surface-0, #0f172a);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    overflow: visible;
}

.sf-formula-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.45fr) minmax(0, 1.15fr);
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-color, #334155);
}

@media (max-width: 620px) {
    .sf-formula-toolbar {
        grid-template-columns: 1fr 1fr;
    }
    .sf-formula-toolbar-res {
        grid-column: span 2;
    }
}

.sf-formula-toolbar select,
.sf-formula-toolbar button {
    height: 34px;
    box-sizing: border-box;
    font-size: 0.78rem;
    min-width: 0;
    max-width: 100%;
}

.sf-formula-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #475569);
    border-radius: 6px;
    color: var(--text-main, #f8fafc);
    cursor: pointer;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}

.sf-formula-btn:hover {
    border-color: #38bdf8;
}

.sf-formula-select {
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #475569);
    border-radius: 6px;
    color: var(--text-main, #f8fafc);
    padding: 6px 8px;
    cursor: pointer;
    box-sizing: border-box;
    width: 100%;
    outline: none;
    min-width: 0;
}

.sf-formula-select:hover,
.sf-formula-select:focus {
    border-color: #38bdf8;
}

.sf-formula-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 340px;
    max-width: calc(100vw - 40px);
    max-height: 280px;
    overflow-y: auto;
    background: var(--bg-card, #1e293b);
    border: 1px solid var(--border-color, #475569);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
    z-index: 2600;
    padding: 6px 0;
    box-sizing: border-box;
}

[data-theme='light'] .sf-formula-builder-card {
    background: #ffffff;
    border-color: #cbd5e1;
}

[data-theme='light'] .sf-formula-toolbar {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme='light'] .sf-formula-btn,
[data-theme='light'] .sf-formula-select {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #0f172a;
}

[data-theme='light'] .sf-formula-dropdown {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   LEFT-SIDE FLOW RESOURCES & USAGE DRAWER
   ========================================================================== */
.flow-resources-drawer {
    position: fixed;
    top: var(--total-header-height, 108px);
    left: -430px;
    width: 410px;
    max-width: calc(100vw - 32px);
    height: calc(100vh - var(--total-header-height, 108px));
    background: var(--bg-card, #0f172a);
    border-right: 1px solid var(--border-color, #334155);
    box-shadow: 14px 0 35px rgba(0, 0, 0, 0.55);
    z-index: 998;
    display: flex;
    flex-direction: column;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.flow-resources-drawer.open {
    left: 0;
}

.sf-subbar-res-btn.is-active {
    background: rgba(168, 85, 247, 0.18) !important;
    border-color: #c084fc !important;
    color: #f8fafc !important;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.35);
}

.fr-drawer-header {
    padding: 14px 16px;
    background: var(--bg-surface-0, #1e293b);
    border-bottom: 1px solid var(--border-color, #334155);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.fr-drawer-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.fr-drawer-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(168, 85, 247, 0.14);
    border: 1px solid rgba(168, 85, 247, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fr-drawer-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main, #f8fafc);
}

.fr-drawer-count-badge {
    background: rgba(168, 85, 247, 0.2);
    color: #c084fc;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    line-height: 1.2;
}

.fr-drawer-subtitle {
    font-size: 0.72rem;
    color: var(--text-muted, #94a3b8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fr-drawer-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #0284c7;
    border: 1px solid #0284c7;
    color: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fr-drawer-add-btn:hover {
    background: #0369a1;
    border-color: #0369a1;
}

.fr-drawer-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fr-drawer-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main, #f8fafc);
}

.fr-drawer-controls {
    padding: 10px 14px 8px 14px;
    background: var(--bg-card, #0f172a);
    border-bottom: 1px solid var(--border-color, #334155);
    flex-shrink: 0;
}

.fr-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.fr-search-icon {
    position: absolute;
    left: 9px;
    color: var(--text-muted, #94a3b8);
    pointer-events: none;
}

.fr-search-input {
    width: 100%;
    background: var(--bg-surface-0, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 6px;
    padding: 6px 10px 6px 30px;
    font-size: 0.78rem;
    color: var(--text-main, #f8fafc);
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.fr-search-input:focus {
    outline: none;
    border-color: #c084fc;
}

.fr-filter-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.fr-filter-tabs::-webkit-scrollbar {
    display: none;
}

.fr-filter-tab {
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 5px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.fr-filter-tab:hover {
    color: var(--text-main, #f8fafc);
    background: rgba(255, 255, 255, 0.05);
}

.fr-filter-tab.active {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.35);
    color: #c084fc;
    font-weight: 600;
}

.fr-drawer-summary-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    background: rgba(0, 0, 0, 0.18);
    border-bottom: 1px solid var(--border-color, #334155);
    font-size: 0.72rem;
    flex-shrink: 0;
}

.fr-summary-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted, #94a3b8);
}

.fr-summary-divider {
    width: 1px;
    height: 12px;
    background: var(--border-color, #334155);
}

.fr-open-modal-link {
    margin-left: auto;
    font-size: 0.7rem;
    color: #38bdf8;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
}

.fr-open-modal-link:hover {
    text-decoration: underline;
    color: #7dd3fc;
}

.fr-drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fr-card {
    background: var(--bg-surface-0, #1e293b);
    border: 1px solid var(--border-color, #334155);
    border-radius: 8px;
    padding: 10px 12px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fr-card:hover {
    border-color: rgba(168, 85, 247, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
}

.fr-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.fr-card-name {
    font-family: monospace;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main, #f8fafc);
    word-break: break-all;
}

.fr-card-type-tag {
    font-size: 0.66rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted, #94a3b8);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    text-transform: capitalize;
}

.fr-card-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.fr-card-action-btn {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: transparent;
    border: none;
    color: var(--text-muted, #94a3b8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fr-card-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main, #f8fafc);
}

.fr-card-action-btn.delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.fr-card-val-preview {
    font-size: 0.72rem;
    color: #38bdf8;
    margin-top: 4px;
    font-family: monospace;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    opacity: 0.9;
}

.fr-usage-section {
    margin-top: 8px;
    border-top: 1px dashed rgba(255, 255, 255, 0.08);
    padding-top: 7px;
}

.fr-usage-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.fr-usage-badge {
    font-size: 0.69rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.fr-usage-badge.is-used {
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.fr-usage-badge.is-unused {
    background: rgba(245, 158, 11, 0.14);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.fr-usage-toggle-chevron {
    color: var(--text-muted, #94a3b8);
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.fr-usage-section.collapsed .fr-usage-toggle-chevron {
    transform: rotate(-90deg);
}

.fr-usage-section.collapsed .fr-usage-list {
    display: none;
}

.fr-usage-list {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.fr-usage-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fr-usage-item:hover {
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.4);
    transform: translateX(2px);
}

.fr-usage-item-info {
    min-width: 0;
    flex: 1;
}

.fr-usage-item-title {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-main, #f8fafc);
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fr-usage-target-text {
    font-weight: 600;
    color: var(--text-main, #f8fafc);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fr-usage-item-breadcrumb {
    font-size: 0.65rem;
    color: var(--text-muted, #94a3b8);
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fr-usage-item-breadcrumb span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fr-usage-item-desc {
    font-size: 0.68rem;
    color: var(--text-muted, #94a3b8);
    margin-top: 2px;
    word-break: break-all;
}

.fr-usage-locate-btn {
    font-size: 0.65rem;
    font-weight: 700;
    color: #38bdf8;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 4px;
    padding: 2px 6px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    margin-top: 2px;
}

.fr-usage-item:hover .fr-usage-locate-btn {
    background: #0284c7;
    border-color: #0284c7;
    color: #ffffff;
}

/* Clean Minimal Border Highlight - Node Only */
@keyframes nodeBorderOnlyHighlight {
    0% {
        border-color: #c084fc !important;
        outline-color: #c084fc !important;
        box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.25) !important;
    }
    50% {
        border-color: #38bdf8 !important;
        outline-color: #38bdf8 !important;
        box-shadow: 0 0 0 5px rgba(56, 189, 248, 0.35) !important;
    }
    100% {
        border-color: #c084fc !important;
        outline-color: #c084fc !important;
        box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.25) !important;
    }
}

.canvas-workspace .flow-node.node-focus-pulse,
.flow-node.node-focus-pulse,
.nested-loop-step-card.node-focus-pulse,
.loop-child-step-card.node-focus-pulse,
.loop-child-decision-node.node-focus-pulse,
.decision-branch-step-card.node-focus-pulse,
.loop-decision-step-card.node-focus-pulse {
    border-color: #c084fc !important;
    outline: 2.5px solid #c084fc !important;
    outline-offset: 1px !important;
    animation: nodeBorderOnlyHighlight 0.8s ease-in-out 4 !important;
    z-index: 50 !important;
    position: relative !important;
    border-radius: inherit;
    box-shadow: 0 0 0 2px rgba(192, 132, 252, 0.25) !important;
}

/* Guard: Never let outer full-width row wrappers animate or show borders */
.action-step-wrapper.node-focus-pulse,
.pipeline-stage-wrapper.node-focus-pulse {
    animation: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
    outline: none !important;
    transform: none !important;
}

/* ==========================================================================
   LIGHT THEME ADJUSTMENTS FOR FLOW RESOURCES & USAGE DRAWER
   ========================================================================== */
[data-theme='light'] .sf-subbar-res-btn,
[data-theme='light'] #openFlowResourcesBtn {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    color: #1e293b !important;
}

[data-theme='light'] .sf-subbar-res-btn span,
[data-theme='light'] #openFlowResourcesBtn span {
    color: inherit !important;
}

[data-theme='light'] .sf-subbar-res-btn i,
[data-theme='light'] #openFlowResourcesBtn i {
    color: #7c3aed !important;
}

[data-theme='light'] .sf-subbar-res-btn.is-active,
[data-theme='light'] #openFlowResourcesBtn.is-active {
    background: #ede9fe !important;
    border-color: #7c3aed !important;
    color: #5b21b6 !important;
    box-shadow: 0 0 0 1px #7c3aed !important;
}

[data-theme='light'] .sf-subbar-res-btn.is-active span,
[data-theme='light'] #openFlowResourcesBtn.is-active span {
    color: #5b21b6 !important;
}

[data-theme='light'] .sf-subbar-res-btn.is-active i,
[data-theme='light'] #openFlowResourcesBtn.is-active i {
    color: #7c3aed !important;
}

[data-theme='light'] .sf-subbar-res-btn .sf-subbar-badge,
[data-theme='light'] #openFlowResourcesBtn .sf-subbar-badge {
    background: #ede9fe !important;
    color: #6d28d9 !important;
}

[data-theme='light'] .sf-subbar-res-btn.is-active .sf-subbar-badge,
[data-theme='light'] #openFlowResourcesBtn.is-active .sf-subbar-badge {
    background: #7c3aed !important;
    color: #ffffff !important;
}

[data-theme='light'] .sf-subbar-quick-summary,
[data-theme='light'] #subbarUsageSummaryText {
    color: #475569 !important;
}

[data-theme='light'] .flow-resources-drawer {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.12);
}

[data-theme='light'] .fr-drawer-header {
    background: #f8fafc;
    border-color: #e2e8f0;
}

[data-theme='light'] .fr-drawer-title {
    color: #0f172a;
}

[data-theme='light'] .fr-drawer-subtitle {
    color: #64748b;
}

[data-theme='light'] .fr-drawer-icon-box {
    background: #ede9fe;
    border-color: #ddd6fe;
}

[data-theme='light'] .fr-drawer-icon-box i {
    color: #7c3aed !important;
}

[data-theme='light'] .fr-drawer-count-badge {
    background: #ede9fe;
    color: #6d28d9;
}

[data-theme='light'] .fr-drawer-close-btn {
    color: #64748b;
}

[data-theme='light'] .fr-drawer-close-btn:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme='light'] .fr-drawer-controls {
    background: #ffffff;
    border-color: #e2e8f0;
}

[data-theme='light'] .fr-search-input {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #0f172a;
}

[data-theme='light'] .fr-search-input::placeholder {
    color: #94a3b8;
}

[data-theme='light'] .fr-search-input:focus {
    background: #ffffff;
    border-color: #7c3aed;
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.15);
}

[data-theme='light'] .fr-search-icon {
    color: #94a3b8;
}

[data-theme='light'] .fr-filter-tab {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
}

[data-theme='light'] .fr-filter-tab:hover {
    background: #e2e8f0;
    color: #0f172a;
}

[data-theme='light'] .fr-filter-tab.active {
    background: #7c3aed !important;
    border-color: #7c3aed !important;
    color: #ffffff !important;
    font-weight: 700;
}

[data-theme='light'] .fr-filter-tab.active span {
    color: #ffffff !important;
}

[data-theme='light'] .fr-drawer-summary-banner {
    background: #f8fafc !important;
    border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme='light'] .fr-summary-stat {
    color: #334155 !important;
    font-weight: 600;
}

[data-theme='light'] .fr-summary-divider {
    background: #cbd5e1 !important;
}

[data-theme='light'] .fr-open-modal-link {
    color: #0284c7;
    font-weight: 600;
}

[data-theme='light'] .fr-open-modal-link:hover {
    color: #0369a1;
}

[data-theme='light'] .fr-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

[data-theme='light'] .fr-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.08);
}

[data-theme='light'] .fr-card-name {
    color: #0f172a;
}

[data-theme='light'] .fr-card-type-tag {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    color: #475569;
}

[data-theme='light'] .fr-card-val-preview {
    color: #0284c7;
    font-weight: 500;
}

[data-theme='light'] .fr-card-action-btn {
    color: #64748b;
}

[data-theme='light'] .fr-card-action-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

[data-theme='light'] .fr-card-action-btn.delete-btn:hover {
    background: #fee2e2;
    color: #dc2626;
}

[data-theme='light'] .fr-usage-section {
    border-top-color: #e2e8f0;
}

[data-theme='light'] .fr-usage-badge.is-used {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

[data-theme='light'] .fr-usage-badge.is-unused {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

[data-theme='light'] .fr-usage-toggle-chevron {
    color: #94a3b8;
}

[data-theme='light'] .fr-usage-target-text {
    color: #0f172a !important;
}

[data-theme='light'] .fr-usage-item-breadcrumb {
    color: #64748b !important;
}

[data-theme='light'] .fr-usage-item {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
}

[data-theme='light'] .fr-usage-item:hover {
    background: #f5f3ff !important;
    border-color: #c4b5fd !important;
}

[data-theme='light'] .fr-usage-item-desc {
    color: #64748b;
}

[data-theme='light'] .fr-usage-locate-btn {
    background: #ede9fe;
    border: 1px solid #c4b5fd;
    color: #6d28d9;
}

[data-theme='light'] .fr-usage-item:hover .fr-usage-locate-btn {
    background: #7c3aed;
    border-color: #7c3aed;
    color: #ffffff;
}




/* ==========================================================================
   Step Retry Policies & Dead Letter Queue (DLQ)
   ========================================================================== */
.step-retry-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.35);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.step-retry-badge:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
}

.dlq-filter-pill {
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-1, rgba(255, 255, 255, 0.04));
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dlq-filter-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-main);
}

.dlq-filter-pill.active {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border-color: rgba(244, 63, 94, 0.4);
}

.dlq-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: capitalize;
}

.dlq-status-badge.unresolved {
    background: rgba(244, 63, 94, 0.15);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.35);
}

.dlq-status-badge.replayed {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.dlq-status-badge.discarded {
    background: rgba(100, 116, 139, 0.15);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.3);
}

.retry-policy-container input[type="checkbox"]:checked + .toggle-slider {
    background-color: #6366f1 !important;
}

.retry-policy-container input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(18px);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

/* ==========================================================================
   Feature 4: Visual Drag-to-Connect Field Mapper
   ========================================================================== */
.vm-wrapper {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface-0, #0f172a);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.vm-inline-mode {
    max-height: 480px;
    min-height: 380px;
}

.vm-modal-mode {
    height: 75vh;
    min-height: 540px;
}

.vm-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    flex-shrink: 0;
}

.vm-stats-badge {
    font-size: 0.76rem;
    font-weight: 700;
    color: #10b981;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 3px 9px;
    border-radius: 999px;
}

.vm-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vm-layout-columns {
    display: grid;
    grid-template-columns: 240px 100px 1fr;
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.vm-modal-mode .vm-layout-columns {
    grid-template-columns: 320px 140px 1fr;
}

.vm-col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    background: var(--bg-surface-0);
}

.vm-col-sources {
    border-right: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.vm-col-targets {
    border-left: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
}

.vm-col-header {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.02);
    flex-shrink: 0;
}

.vm-col-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
}

.vm-search-input {
    width: 100%;
    padding: 5px 9px;
    font-size: 0.76rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.25);
    color: var(--text-main);
    outline: none;
    box-sizing: border-box;
}

.vm-search-input:focus {
    border-color: var(--accent-color);
}

.vm-col-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vm-source-group {
    margin-bottom: 10px;
}

.vm-group-title {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 5px;
    padding-left: 2px;
}

.vm-group-items {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Draggable Source Chip */
.vm-source-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: grab;
    user-select: none;
    transition: all 0.2s ease;
    position: relative;
}

.vm-source-chip:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateX(2px);
}

.vm-source-chip.is-dragging {
    opacity: 0.4;
    border-style: dashed;
}

.vm-chip-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vm-type-badge {
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 4px;
    line-height: 1.2;
    flex-shrink: 0;
}

/* Connector Pins */
.vm-pin {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid #38bdf8;
    background: var(--bg-surface-0);
    cursor: crosshair;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    box-sizing: border-box;
}

.vm-pin:hover,
.vm-pin.active-pin-selected {
    transform: scale(1.35);
    background: #38bdf8;
    box-shadow: 0 0 8px #38bdf8;
}

.vm-target-pin {
    border-color: #10b981;
}

.vm-target-pin.is-connected {
    background: #10b981;
    border-color: #10b981;
}

.vm-target-pin:hover {
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
}

/* Target Row & Drop Target */
.vm-target-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.vm-target-row:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-hover);
}

.vm-target-row.drag-over {
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: #10b981 !important;
    transform: scale(1.02);
}

.vm-target-row.is-mapped {
    border-color: rgba(16, 185, 129, 0.35);
}

.vm-target-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.vm-target-info {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vm-target-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vm-req-star {
    color: #ef4444;
    font-weight: 700;
    font-size: 0.85rem;
}

.vm-drop-slot {
    min-height: 24px;
    display: flex;
    align-items: center;
}

.vm-drop-placeholder {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.65;
}

.vm-mapped-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: 6px;
    font-size: 0.74rem;
    color: #10b981;
    max-width: 100%;
}

.vm-mapped-text {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vm-unlink-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.vm-unlink-btn:hover {
    color: #ef4444;
}

/* Center Canvas & SVG Wires */
.vm-canvas-middle {
    position: relative;
    background: rgba(0, 0, 0, 0.15);
    pointer-events: none;
}

.vm-svg-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: auto;
}

.vm-wire {
    fill: none;
    stroke: url(#vmWireGradient);
    stroke-width: 2.2;
    stroke-linecap: round;
    transition: stroke-width 0.2s, stroke 0.2s;
    cursor: pointer;
}

.vm-wire:hover {
    stroke: #ef4444 !important;
    stroke-width: 3.5 !important;
    filter: drop-shadow(0 0 6px #ef4444);
}

.vm-canvas-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    opacity: 0.6;
    pointer-events: none;
}

.vm-empty-hint {
    padding: 24px 12px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

/* View Switcher Pill Buttons */
.vm-view-toggle {
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.vm-toggle-btn {
    padding: 4px 10px;
    font-size: 0.74rem;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.vm-toggle-btn.active {
    background: var(--primary-color, #0284c7);
    color: #ffffff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.vm-toggle-btn:hover:not(.active) {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}


/* ==========================================================================
   Flow Version Visual Diff Inspector
   ========================================================================== */
.vdiff-modal-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    max-width: 1120px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.vdiff-toolbar {
    padding: 12px 22px;
    background: var(--bg-surface-0);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.vdiff-selectors-group {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.vdiff-select {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    transition: border-color 0.15s ease;
}

.vdiff-select:focus {
    border-color: var(--accent-color);
}

.vdiff-swap-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vdiff-swap-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

.vdiff-filters-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 4px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.vdiff-filter-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.74rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.vdiff-filter-btn:hover {
    color: var(--text-main);
}

.vdiff-filter-btn.active {
    background: var(--primary-color);
    color: #fff;
}

.vdiff-stat-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    margin-bottom: 12px;
    gap: 12px;
}

.vdiff-stat-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vdiff-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.74rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 6px;
}

.vdiff-badge-added {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.vdiff-badge-modified {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.vdiff-badge-removed {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.vdiff-badge-unchanged {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.vdiff-search-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 4px 10px;
}

.vdiff-search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-main);
    font-size: 0.76rem;
    width: 140px;
}

.vdiff-section-card {
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
}

.vdiff-section-card.is-modified {
    border-left: 4px solid var(--warning-color);
}

.vdiff-section-card.is-unchanged {
    border-left: 4px solid var(--accent-color);
}

.vdiff-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 6px;
}

.vdiff-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 4px;
}

.pill-added {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
}

.pill-modified {
    background: rgba(245, 158, 11, 0.18);
    color: #f59e0b;
}

.pill-removed {
    background: rgba(239, 68, 68, 0.18);
    color: #ef4444;
}

.pill-unchanged {
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-muted);
}

/* Side by Side layout */
.vdiff-side-by-side-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vdiff-column-headers {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    background: var(--bg-surface-0);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    font-size: 0.82rem;
}

.vdiff-col-hdr {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vdiff-col-hdr-divider {
    width: 40px;
    text-align: center;
    color: var(--text-muted);
}

.vdiff-col-tag {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.08);
    padding: 1px 6px;
    border-radius: 4px;
    color: var(--text-muted);
}

.vdiff-pipeline-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vdiff-row {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.vdiff-row-left,
.vdiff-row-right {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.vdiff-row-center {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.vdiff-row-center::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--border-color);
}

.vdiff-connector-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-color);
    z-index: 1;
}

.vdiff-row.is-added .vdiff-connector-dot {
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}

.vdiff-row.is-removed .vdiff-connector-dot {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.5);
}

.vdiff-row.is-modified .vdiff-connector-dot {
    background: #f59e0b;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.5);
}

.vdiff-step-card {
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vdiff-step-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.vdiff-step-card.is-added {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.05);
}

.vdiff-step-card.is-removed {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.05);
}

.vdiff-step-card.is-modified {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.04);
}

.vdiff-step-card.is-unchanged {
    border-color: var(--border-color);
    opacity: 0.85;
}

.vdiff-card-placeholder {
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    height: 100%;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.78rem;
    gap: 4px;
    background: rgba(255, 255, 255, 0.01);
}

.vdiff-card-placeholder.is-removed-placeholder {
    border-color: rgba(239, 68, 68, 0.25);
    background: rgba(239, 68, 68, 0.02);
}

.vdiff-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.vdiff-step-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.vdiff-card-title {
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-main);
}

.vdiff-card-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.vdiff-card-tag-old {
    font-size: 0.66rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    padding: 1px 5px;
    border-radius: 4px;
}

.vdiff-card-footer-info {
    font-size: 0.72rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.vdiff-changes-mini {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.vdiff-change-badge {
    font-size: 0.68rem;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
}

.vdiff-changes-table {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.vdiff-change-row {
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.vdiff-prop-label {
    font-weight: 600;
    color: var(--text-muted);
    min-width: 100px;
}

.vdiff-val-old {
    color: #ef4444;
    text-decoration: line-through;
    background: rgba(239, 68, 68, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: var(--font-mono);
    font-size: 0.73rem;
}

.vdiff-val-new {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 1px 5px;
    border-radius: 3px;
    font-weight: 600;
    font-family: var(--font-mono);
    font-size: 0.73rem;
}

/* Mapping deep diff */
.vdiff-mapping-deep-container {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    padding: 8px 10px;
    margin-top: 8px;
}

.vdiff-mapping-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    padding: 3px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    margin-bottom: 3px;
}

.vdiff-mapping-row.added {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.vdiff-mapping-row.modified {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.vdiff-mapping-row.removed {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.vdiff-mapping-target {
    font-weight: 700;
}

.vdiff-mapping-tag {
    margin-left: auto;
    font-size: 0.64rem;
    text-transform: uppercase;
    font-weight: 700;
    opacity: 0.8;
}

/* Unified Ledger */
.vdiff-ledger-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vdiff-ledger-item {
    background: var(--bg-surface-0);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.vdiff-ledger-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.vdiff-ledger-item.is-added {
    border-left: 4px solid #10b981;
    background: rgba(16, 185, 129, 0.04);
}

.vdiff-ledger-item.is-modified {
    border-left: 4px solid #f59e0b;
    background: rgba(245, 158, 11, 0.04);
}

.vdiff-ledger-item.is-removed {
    border-left: 4px solid #ef4444;
    background: rgba(239, 68, 68, 0.04);
}

.vdiff-ledger-item.is-unchanged {
    border-left: 4px solid rgba(148, 163, 184, 0.3);
    opacity: 0.85;
}

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

.vdiff-step-idx-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
}

.vdiff-step-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vdiff-expand-btn {
    color: var(--text-muted);
    cursor: pointer;
}

.vdiff-mapping-pill-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.vdiff-mapping-pill {
    font-size: 0.7rem;
    font-family: var(--font-mono);
    padding: 2px 7px;
    border-radius: 4px;
}

.vdiff-mapping-pill.added {
    background: rgba(16, 185, 129, 0.14);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.vdiff-empty-state {
    text-align: center;
    padding: 40px 16px;
    background: var(--bg-surface-0);
    border-radius: 10px;
    border: 1px dashed var(--border-color);
}


/* Tree Hierarchy / Branch Breadcrumb Badge in Version Diff */
.vdiff-branch-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent-color, #38bdf8);
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.22);
    padding: 2px 7px;
    border-radius: 4px;
    margin-bottom: 5px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vdiff-card-meta {
    font-size: 0.76rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 3px;
    margin-bottom: 3px;
    min-width: 0;
}

.vdiff-app-chip {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--accent-color, #38bdf8);
    background: rgba(56, 189, 248, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid rgba(56, 189, 248, 0.2);
    flex-shrink: 0;
}

.vdiff-op-text {
    font-family: var(--font-mono, monospace);
    font-size: 0.72rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}


.vdiff-app-chip.logic-chip {
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.25);
}


/* ==========================================================================
   Feature 6: Canvas Mini-Map Radar Navigation Widget
   ========================================================================== */
.canvas-minimap-widget {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 256px;
    background: var(--bg-surface-0, #0f172a);
    border: 1px solid var(--border-color, #334155);
    border-radius: 12px;
    box-shadow:
        0 14px 34px -4px rgba(0, 0, 0, 0.55),
        0 0 20px var(--accent-glow, rgba(56, 189, 248, 0.1));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 95;
    user-select: none;
    overflow: hidden;
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.minimap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
    background: var(--bg-card, rgba(30, 41, 59, 0.7));
    border-bottom: 1px solid var(--border-color, #334155);
}

.minimap-title-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.minimap-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-main, #f8fafc);
}

.minimap-badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.12);
    color: var(--accent-color, #38bdf8);
}

.minimap-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.minimap-action-btn {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted, #94a3b8);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.minimap-action-btn:hover {
    background: var(--bg-card-hover, rgba(51, 65, 85, 0.6));
    color: var(--accent-color, #38bdf8);
    border-color: var(--border-color, #475569);
}

.minimap-body {
    position: relative;
    width: 100%;
    height: 140px;
    background: rgba(0, 0, 0, 0.22);
    overflow: hidden;
    cursor: crosshair;
}

#canvasMinimapCanvas {
    display: block;
    width: 100%;
    height: 100%;
}

.minimap-lens {
    position: absolute;
    border: 1.5px solid #38bdf8;
    background: rgba(56, 189, 248, 0.16);
    border-radius: 3px;
    cursor: grab;
    pointer-events: auto;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
    transition: box-shadow 0.15s ease, background 0.15s ease;
    box-sizing: border-box;
}

.minimap-lens:hover {
    background: rgba(56, 189, 248, 0.24);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.5);
}

.minimap-lens.is-dragging {
    cursor: grabbing !important;
    background: rgba(56, 189, 248, 0.32) !important;
    border-color: #7dd3fc !important;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.65) !important;
}

.minimap-tooltip {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -100%) translateY(-6px);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--border-color, #334155);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.68rem;
    font-weight: 600;
    color: #f8fafc;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.minimap-tooltip.show {
    opacity: 1;
    transform: translate(-50%, -100%) translateY(-8px);
}

/* Collapsed Mini-Map Floating Pill */
.canvas-minimap-pill {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 95;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--radius-md, 10px);
    background: var(--bg-surface-0, #0f172a);
    border: 1px solid var(--border-color, #334155);
    box-shadow:
        0 10px 28px -4px rgba(0, 0, 0, 0.45),
        0 0 16px var(--accent-glow, rgba(56, 189, 248, 0.1));
    color: var(--text-main, #f8fafc);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.canvas-minimap-pill:hover {
    background: var(--bg-card-hover, #1e293b);
    border-color: var(--accent-color, #38bdf8);
    transform: translateY(-2px);
    box-shadow:
        0 14px 32px -4px rgba(0, 0, 0, 0.55),
        0 0 20px rgba(56, 189, 248, 0.25);
}

.minimap-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color, #334155);
    border-radius: 3px;
    padding: 1px 4px;
    font-size: 0.65rem;
    font-family: var(--font-mono, monospace);
    font-weight: 700;
    color: var(--text-muted, #94a3b8);
}

/* Light Mode Overrides for Mini-Map */
[data-theme='light'] .canvas-minimap-widget {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow:
        0 12px 30px -4px rgba(0, 0, 0, 0.12),
        0 0 16px rgba(2, 132, 199, 0.1);
}

[data-theme='light'] .minimap-header {
    background: #f8fafc;
    border-bottom-color: #e2e8f0;
}

[data-theme='light'] .minimap-body {
    background: #f1f5f9;
}

[data-theme='light'] .minimap-tooltip {
    background: rgba(15, 23, 42, 0.92);
    color: #ffffff;
}

[data-theme='light'] .canvas-minimap-pill {
    background: #ffffff;
    border-color: #cbd5e1;
    box-shadow:
        0 8px 24px -4px rgba(0, 0, 0, 0.1),
        0 0 14px rgba(2, 132, 199, 0.1);
}


/* ==========================================================================
   Canvas Crisp Vector Rendering & Anti-Blur Engine
   ========================================================================== */
.canvas-stage,
.canvas-workspace {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
}

.flow-node,
.decision-branch-step-card,
.loop-child-step-card,
.nested-loop-card,
.nested-decision-block {
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    text-rendering: optimizeLegibility !important;
    transform-style: flat !important;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
}

.pipeline-connector-line,
.decision-branch-svg,
.loop-branch-svg,
.loop-decision-branch-svg,
.canvas-stage svg {
    shape-rendering: geometricPrecision !important;
    text-rendering: geometricPrecision !important;
}

/* ==========================================================
   Phase 2: Enterprise UI Ergonomics & Component Refinements
   ========================================================== */

/* Enterprise Toggle Switch for Flow Rows */
.enterprise-switch {
    width: 32px;
    height: 18px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    position: relative;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    flex-shrink: 0;
}
.enterprise-switch.active {
    background: #10b981;
    border-color: #10b981;
}
.enterprise-switch-handle {
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    position: absolute;
    top: 1px;
    left: 2px;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.enterprise-switch.active .enterprise-switch-handle {
    transform: translateX(14px);
}
[data-theme='light'] .enterprise-switch {
    background: #cbd5e1;
    border-color: #94a3b8;
}
[data-theme='light'] .enterprise-switch.active {
    background: #10b981;
    border-color: #10b981;
}

/* Spinner Animation for Inflight Health Checks & Async Actions */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.icon-spin {
    display: inline-block;
    animation: spin 0.8s linear infinite !important;
}

/* Dropdown Menu & Hover States */
.dropdown-item:hover {
    background: var(--bg-card-hover) !important;
}
[data-theme='light'] .dropdown-menu {
    background: #ffffff !important;
    border-color: #e2e8f0 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1) !important;
}
[data-theme='light'] .dropdown-item:hover {
    background: #f1f5f9 !important;
}

/* ==========================================================
   Phase 3: Workflow Canvas & Drawer Component Enhancements
   ========================================================== */

/* Canvas Header Navigation & Controls */
.canvas-nav-separator {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
    flex-shrink: 0;
}

.canvas-credit-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 999px;
    color: #f59e0b;
    font-weight: 700;
    font-size: 0.78rem;
    white-space: nowrap;
    user-select: none;
}

/* Distinct Trigger vs Action Node Styling */
.flow-node.is-trigger-node,
#sourceNode {
    border-top: 3px solid #6366f1;
}

.flow-node.action-step-node {
    border-top: 3px solid #38bdf8;
}

/* Connection Port Rings and Handles */
.node-port {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-surface-0);
    border: 2px solid var(--accent-color);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.node-port:hover {
    transform: scale(1.3);
    box-shadow: 0 0 8px var(--accent-glow);
}

/* Drawer Tab Modern Bottom Border Indicator */
.node-tabs-nav .node-tab-btn.active {
    color: var(--accent-color) !important;
    border-bottom: 2px solid var(--accent-color) !important;
    font-weight: 600 !important;
    background: transparent !important;
}

.node-tabs-nav .node-tab-btn:hover:not(:disabled) {
    color: var(--text-main) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

[data-theme='light'] .node-tabs-nav .node-tab-btn:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.04) !important;
}

/* ==========================================================
   Phase 4: Responsive Breakpoint & Accessibility Polish
   ========================================================== */

/* Prevent Mini-Map from obscuring canvas or colliding with Drawer */
.canvas-viewport.drawer-active ~ .canvas-minimap-widget,
body.drawer-open .canvas-minimap-widget {
    right: calc(var(--drawer-width) + 20px) !important;
}

.canvas-viewport.drawer-active ~ .canvas-minimap-pill,
body.drawer-open .canvas-minimap-pill {
    right: calc(var(--drawer-width) + 20px) !important;
}

@media (max-width: 1024px) {
    .canvas-minimap-widget {
        display: none !important;
    }
}
