/* ==========================================================================
   LUXA ECOSYSTEM - CENTRAL THEME DESIGN TOKENS
   Supports: Light Mode (Porcelain), Dark Mode (Antigravity Obsidian), & System
   ========================================================================== */

:root,
[data-theme="light"] {
    color-scheme: light;
    /* Surfaces & Backgrounds */
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-header: #ffffff;
    --bg-elevated: #ffffff;
    --bg-surface-secondary: #f1f5f9;
    --bg-surface-tertiary: #e2e8f0;
    --bg-dock: #ffffff;
    --bg-canvas: #F0EEF8;
    --bg-input: #ffffff;
    --bg-input-hover: #f8fafc;
    --bg-overlay: rgba(15, 23, 42, 0.45);
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-surface: #ffffff;
    --bg-primary: #f8fafc;

    /* Text & Content */
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-inverse: #ffffff;

    /* Borders & Dividers */
    --border-subtle: #e2e8f0;
    --border-card: #cbd5e1;
    --border-color: #e2e8f0;
    --border-focus: #5C32E4;
    --border-glass: rgba(255, 255, 255, 0.5);

    /* Shadows & Elevation */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-card: 0 4px 14px rgba(0, 0, 0, 0.05);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-elevated: 0 12px 32px rgba(0, 0, 0, 0.12);
    --shadow-glow: rgba(92, 50, 228, 0.25);

    /* LUXA Signature Purple Accents (Preserved) */
    --luxa-purple: #4A2D84;
    --luxa-purple-hover: #4a24c7;
    --luxa-purple-deep: #2a1b54;
    --luxa-purple-light: #ece8ff;
    --luxa-purple-pill-bg: #f3f0ff;
    --luxa-purple-pill-text: #5C32E4;
    --luxa-purple-glow: rgba(92, 50, 228, 0.25);

    /* Status Colors */
    --status-success-bg: #ecfdf5;
    --status-success-text: #059669;
    --status-warning-bg: #fffbeb;
    --status-warning-text: #d97706;
    --status-danger-bg: #fef2f2;
    --status-danger-text: #dc2626;

    /* Guideline Preservation (Always Vibrant) */
    --guide-smart-magenta: #e11d48;
    --guide-fold-blue: #2563eb;
    --guide-dimension-tag: #0284c7;
}

[data-theme="dark"] {
    color-scheme: dark;
    /* Surfaces & Backgrounds - Antigravity Obsidian Theme */
    --bg-page: #0d0d12;
    --bg-card: #181524;
    --bg-card-hover: #211c33;
    --bg-header: #13111c;
    --bg-elevated: #1e1a2f;
    --bg-surface-secondary: #1a1728;
    --bg-surface-tertiary: #27223c;
    --bg-dock: #13111c;
    --bg-canvas: #0d0d12;
    --bg-input: #151221;
    --bg-input-hover: #1c182d;
    --bg-overlay: rgba(5, 4, 8, 0.75);
    --bg-glass: rgba(19, 17, 28, 0.88);
    --bg-surface: #181524;
    --bg-primary: #1a1728;

    /* Text & Content - PURE WHITE TYPOGRAPHY IN DARK MODE */
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #cbd5e1;
    --text-inverse: #0d0d12;

    /* Borders & Dividers */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-card: rgba(255, 255, 255, 0.12);
    --border-color: rgba(255, 255, 255, 0.12);
    --border-focus: #7c4dff;
    --border-glass: rgba(255, 255, 255, 0.15);

    /* Shadows & Elevation */
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.35);
    --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.45);
    --shadow-card-hover: 0 8px 28px rgba(0, 0, 0, 0.6);
    --shadow-elevated: 0 16px 40px rgba(0, 0, 0, 0.65);
    --shadow-glow: rgba(124, 77, 255, 0.35);

    /* LUXA Signature Purple Accents (Glowing in Dark Mode) */
    --luxa-purple: #4A2D84;
    --luxa-purple-hover: #7047f0;
    --luxa-purple-deep: #7c4dff;
    --luxa-purple-light: rgba(92, 50, 228, 0.25);
    --luxa-purple-pill-bg: rgba(92, 50, 228, 0.25);
    --luxa-purple-pill-text: #a78bfa;
    --luxa-purple-glow: rgba(92, 50, 228, 0.45);

    /* Status Colors */
    --status-success-bg: rgba(5, 150, 105, 0.2);
    --status-success-text: #34d399;
    --status-warning-bg: rgba(217, 119, 6, 0.2);
    --status-warning-text: #fbbf24;
    --status-danger-bg: rgba(220, 38, 38, 0.2);
    --status-danger-text: #f87171;

    /* Guideline Preservation (Always Vibrant) */
    --guide-smart-magenta: #f43f5e;
    --guide-fold-blue: #38bdf8;
    --guide-dimension-tag: #38bdf8;
}

/* ==========================================================================
   GLOBAL DARK MODE TEXT ENFORCEMENT (ALL TEXT MUST BE WHITE)
   ========================================================================== */
[data-theme="dark"] body,
[data-theme="dark"] p,
[data-theme="dark"] span:not([class*="badge"]):not([class*="tag"]):not([class*="dot"]):not([class*="highlight"]):not([class*="purple"]):not([class*="accent"]),
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h3,
[data-theme="dark"] h4,
[data-theme="dark"] h5,
[data-theme="dark"] h6,
[data-theme="dark"] label,
[data-theme="dark"] strong,
[data-theme="dark"] b,
[data-theme="dark"] .merch-username,
[data-theme="dark"] .merch-dropdown-item,
[data-theme="dark"] .merch-nav-links a,
[data-theme="dark"] .merch-sidepanel a,
[data-theme="dark"] .font-headline-lg,
[data-theme="dark"] .font-body-md,
[data-theme="dark"] .dash-card-title,
[data-theme="dark"] .build-title,
[data-theme="dark"] .build-name,
[data-theme="dark"] .build-meta,
[data-theme="dark"] .cart-page-title,
[data-theme="dark"] .cart-item-title,
[data-theme="dark"] .item-price,
[data-theme="dark"] .checkout-main-title,
[data-theme="dark"] .checkout-section-heading,
[data-theme="dark"] .ws-panel-title,
[data-theme="dark"] .ws-form-label,
[data-theme="dark"] .ws-layers-title,
[data-theme="dark"] .ws-mobile-sheet-title,
[data-theme="dark"] .ws-mobile-tool-item span,
[data-theme="dark"] .ws-tool-btn span,
[data-theme="dark"] .ws-sidebar-label {
    color: #ffffff !important;
}

/* Purple Accents / Highlights in Dark Mode */
[data-theme="dark"] .highlight-text,
[data-theme="dark"] .highlight-purple,
[data-theme="dark"] [class*="highlight"],
[data-theme="dark"] .text-purple,
[data-theme="dark"] .text-accent,
[data-theme="dark"] .merch-small-heading,
[data-theme="dark"] .build-taxonomy {
    color: #7c57ff !important;
}

/* Secondary muted text in dark mode */
[data-theme="dark"] .build-subtitle,
[data-theme="dark"] .ws-panel-subtitle,
[data-theme="dark"] .text-on-surface-variant,
[data-theme="dark"] .cart-subtotal-label,
[data-theme="dark"] .cart-item-attr {
    color: #cbd5e1 !important;
}

/* Modals & Dialogs in dark mode */
[data-theme="dark"] .build-modal,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dash-modal,
[data-theme="dark"] .dash-card,
[data-theme="dark"] .cart-item-card,
[data-theme="dark"] .cart-summary-card,
[data-theme="dark"] .checkout-card,
[data-theme="dark"] .build-card {
    background-color: var(--bg-card) !important;
    border-color: var(--border-subtle) !important;
    color: #ffffff !important;
}

/* Form Inputs in dark mode */
[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not(.newsletter-form input):not(.merch-footer-newsletter input),
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background-color: var(--bg-input) !important;
    border-color: var(--border-subtle) !important;
    color: #ffffff !important;
}

/* Newsletter Input Explicit Transparent */
.newsletter-form input,
.merch-footer-newsletter .newsletter-form input,
[data-theme="dark"] .newsletter-form input,
[data-theme="dark"] .merch-footer-newsletter .newsletter-form input {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    outline: none !important;
    color: #ffffff !important;
}

[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder {
    color: #94a3b8 !important;
}

/* Navbars & Footers in dark mode */
[data-theme="dark"] .merch-navbar {
    background-color: var(--bg-header) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
}

[data-theme="dark"] .merch-dropdown-menu,
[data-theme="dark"] .merch-sidepanel {
    background-color: var(--bg-card) !important;
    border-color: var(--border-subtle) !important;
}

/* SVGs in dark mode */
[data-theme="dark"] .merch-dropdown-item svg,
[data-theme="dark"] .merch-action svg,
[data-theme="dark"] .ws-layers-actions svg,
[data-theme="dark"] .ws-mobile-dock-btn svg,
[data-theme="dark"] .ws-sidebar-tool-btn svg,
[data-theme="dark"] .ws-canvas-edge-flap svg,
[data-theme="dark"] .ws-dock-overhang-flap svg,
[data-theme="dark"] .ws-float-tab svg {
    stroke: #ffffff;
}

/* 3D Camera Controls Container - Fully Transparent in all themes */
.ws-camera-controls,
[data-theme="dark"] .ws-camera-controls,
[data-theme="light"] .ws-camera-controls {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

/* ==========================================================================
   GLOBAL ACCENT BUTTON TEXT PROTECTION RULE
   All colored/accent buttons strictly retain pure white text (#ffffff)
   ========================================================================== */
.btn-primary,
.btn-accent,
.btn-danger,
.merch-btn-primary,
.merch-btn-signup,
.merch-btn-save,
.merch-cta-btn,
.merch-place-order-btn,
.dash-btn-primary,
.ws-btn-save-project,
.ws-btn-place-order,
.ws-mobile-dock-btn--order,
.ws-sidebar-btn-order,
[style*="background: #5C32E4"],
[style*="background:#5C32E4"],
[style*="background: #2a1b54"],
[style*="background:#2a1b54"],
[style*="background: rgb(92, 50, 228)"] {
    color: #ffffff !important;
}

.btn-primary *,
.btn-accent *,
.btn-danger *,
.merch-btn-primary *,
.merch-btn-signup *,
.merch-btn-save *,
.merch-cta-btn *,
.merch-place-order-btn *,
.dash-btn-primary *,
.ws-btn-save-project *,
.ws-btn-place-order *,
.ws-mobile-dock-btn--order *,
.ws-sidebar-btn-order * {
    color: #ffffff !important;
}

/* ==========================================================================
   DYNAMIC LUXA LOGO COMPONENT
   ========================================================================== */
.luxa-logo-component {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    vertical-align: middle;
}

.luxa-logo-component .luxa-logo-text-dark {
    display: none !important;
}

.luxa-logo-component .luxa-logo-text-light {
    display: block !important;
}

[data-theme="dark"] .luxa-logo-component .luxa-logo-text-dark {
    display: block !important;
}

[data-theme="dark"] .luxa-logo-component .luxa-logo-text-light {
    display: none !important;
}

/* Footer always renders white logo text with purple swoosh */
.merch-footer .luxa-logo-component .luxa-logo-text-dark,
.merch-footer-logo .luxa-logo-component .luxa-logo-text-dark {
    display: block !important;
}

.merch-footer .luxa-logo-component .luxa-logo-text-light,
.merch-footer-logo .luxa-logo-component .luxa-logo-text-light {
    display: none !important;
}

/* ==========================================================================
   GLOBAL QUICK VIEW WALLET FLOATING PANEL & FAB (DARK THEME)
   ========================================================================== */
[data-theme="dark"] .merch-wallet-fab {
    background: #181524 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45) !important;
}

[data-theme="dark"] .merch-wallet-fab svg {
    color: #a78bfa !important;
}

[data-theme="dark"] .merch-wallet-panel {
    background-color: #181524 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .merch-wp-header,
[data-theme="dark"] .merch-wp-footer {
    background-color: #13111c !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .merch-wp-title,
[data-theme="dark"] .merch-wp-header h4 {
    color: #ffffff !important;
}

[data-theme="dark"] .merch-wp-subtitle,
[data-theme="dark"] .merch-wp-header span {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .merch-wp-icon-badge {
    background: #24194c !important;
    color: #c4b5fd !important;
}

[data-theme="dark"] .merch-wp-close {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .merch-wp-close:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .merch-wp-item {
    background-color: #13111c !important;
    border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .merch-wp-item:hover {
    background-color: #1e1933 !important;
    border-color: rgba(124, 87, 255, 0.3) !important;
}

/* Wallet Balance Amount (Big bold text) */
[data-theme="dark"] .merch-wp-balance-val {
    color: #ffffff !important;
}

[data-theme="dark"] .merch-wp-currency {
    color: #cbd5e1 !important;
}

/* Locked & Pending sub values */
[data-theme="dark"] .merch-wp-sub-val,
[data-theme="dark"] .merch-wp-sub-val span,
[data-theme="dark"] .merch-wp-sub-val strong {
    color: #cbd5e1 !important;
}

/* Badges */
[data-theme="dark"] .merch-wp-type-badge.badge-cust {
    background: rgba(37, 99, 235, 0.2) !important;
    color: #60a5fa !important;
    border: 1px solid rgba(37, 99, 235, 0.35) !important;
}

[data-theme="dark"] .merch-wp-type-badge.badge-vend {
    background: rgba(217, 119, 6, 0.2) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(217, 119, 6, 0.35) !important;
}

[data-theme="dark"] .merch-wp-type-badge.badge-des {
    background: rgba(124, 87, 255, 0.2) !important;
    color: #c4b5fd !important;
    border: 1px solid rgba(124, 87, 255, 0.35) !important;
}

[data-theme="dark"] .merch-wp-type-badge.badge-aff {
    background: rgba(245, 158, 11, 0.2) !important;
    color: #fbbf24 !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}

[data-theme="dark"] .merch-wp-type-badge.badge-cour {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #34d399 !important;
    border: 1px solid rgba(16, 185, 129, 0.35) !important;
}

[data-theme="dark"] .merch-wp-action-link {
    color: #a78bfa !important;
}

[data-theme="dark"] .merch-wp-action-link:hover {
    color: #c4b5fd !important;
}

/* Buttons in Footer */
[data-theme="dark"] .merch-wp-btn-primary {
    background: #5C32E4 !important;
    border: 1px solid #7c57ff !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(92, 50, 228, 0.35) !important;
}

[data-theme="dark"] .merch-wp-btn-primary:hover {
    background: #4e27cc !important;
}

[data-theme="dark"] .merch-wp-btn-secondary {
    background: #181524 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .merch-wp-btn-secondary:hover {
    background: #211c33 !important;
    border-color: #7c57ff !important;
    color: #ffffff !important;
}

/* ==========================================================================
   GLOBAL LIBRARY & DASHBOARD EMPTY STATES (DARK THEME)
   ========================================================================== */
[data-theme="dark"] .build-empty-state,
[data-theme="dark"] .build-search-no-results,
[data-theme="dark"] .dash-lib-empty {
    background: #181524 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35) !important;
}

[data-theme="dark"] .build-empty-title,
[data-theme="dark"] .build-search-no-results .build-empty-title,
[data-theme="dark"] .dash-lib-empty h3 {
    color: #ffffff !important;
}

[data-theme="dark"] .build-empty-desc,
[data-theme="dark"] .build-search-no-results .build-empty-desc,
[data-theme="dark"] #buildSearchNoResultsMsg,
[data-theme="dark"] .dash-lib-empty p {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .build-empty-icon,
[data-theme="dark"] .build-search-no-results .build-empty-icon,
[data-theme="dark"] .dash-lib-empty span.material-symbols-outlined {
    color: #a78bfa !important;
}

/* ==========================================================================
   MOBILE NAVBAR SEARCH & MOBILE DRAWER SIDEPANEL (DARK THEME)
   ========================================================================== */
[data-theme="dark"] .merch-search-toggle-btn {
    background: #181524 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

[data-theme="dark"] .merch-search-toggle-btn:active,
[data-theme="dark"] .merch-search-toggle-btn:hover {
    background: #211c33 !important;
    color: #ffffff !important;
    border-color: #7c57ff !important;
}

[data-theme="dark"] .merch-search-toggle-btn svg,
[data-theme="dark"] .merch-search-icon {
    color: #cbd5e1 !important;
    stroke: currentColor !important;
}

[data-theme="dark"] .merch-search-toggle-btn:hover svg {
    color: #ffffff !important;
}

/* Mobile Expanded Search Bar */
[data-theme="dark"] .merch-search-container.is-expanded {
    background: #13111c !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

[data-theme="dark"] .merch-search-container.is-expanded .merch-search-input {
    background: #181524 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .merch-search-close-btn {
    color: #cbd5e1 !important;
}

/* Mobile Drawer Sidepanel */
[data-theme="dark"] .merch-sidepanel {
    background-color: #100e17 !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.6) !important;
}

[data-theme="dark"] .merch-sidepanel .sidepanel-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .merch-sidepanel .close-menu {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .merch-sidepanel .close-menu:hover {
    color: #ffffff !important;
}

[data-theme="dark"] .merch-sidepanel .mobile-nav-links a {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .merch-sidepanel .mobile-nav-links a:hover,
[data-theme="dark"] .merch-sidepanel .mobile-nav-links a.active {
    color: #7c57ff !important;
}

/* Mobile Profile Card in Drawer */
[data-theme="dark"] .merch-user-profile-mobile {
    background: #181524 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .merch-user-profile-mobile:hover {
    background: #211c33 !important;
    border-color: #7c57ff !important;
}

[data-theme="dark"] .merch-user-profile-mobile span {
    color: #ffffff !important;
}

[data-theme="dark"] .merch-sidepanel .btn-secondary {
    background: #181524 !important;
    border: 1.5px solid rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .merch-sidepanel .btn-secondary:hover {
    background: #211c33 !important;
    border-color: #7c57ff !important;
    color: #ffffff !important;
}

/* ==========================================================================
   GLOBAL SYSTEM & LOCK MODALS (DARK THEME)
   ========================================================================== */
[data-theme="dark"] .system-modal-card,
[data-theme="dark"] .delete-modal-card,
[data-theme="dark"] .share-modal-card,
[data-theme="dark"] .error-modal-card {
    background: #181524 !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55) !important;
}

[data-theme="dark"] .system-modal-title,
[data-theme="dark"] .delete-modal-title,
[data-theme="dark"] .share-modal-title,
[data-theme="dark"] .error-modal-title {
    color: #ffffff !important;
}

[data-theme="dark"] .system-modal-desc,
[data-theme="dark"] .delete-modal-desc,
[data-theme="dark"] .share-modal-desc,
[data-theme="dark"] .error-modal-desc {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .system-modal-icon-wrap,
[data-theme="dark"] .delete-modal-icon-wrap {
    background: rgba(239, 68, 68, 0.15) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
}

[data-theme="dark"] .btn-system-modal-ok,
[data-theme="dark"] .btn-system-modal-primary {
    background: #5C32E4 !important;
    border: 1px solid #7c57ff !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(92, 50, 228, 0.35) !important;
}

[data-theme="dark"] .btn-system-modal-ok:hover,
[data-theme="dark"] .btn-system-modal-primary:hover {
    background: #4e27cc !important;
}

[data-theme="dark"] .btn-system-modal-ignore {
    background: rgba(245, 158, 11, 0.12) !important;
    border: 1px solid rgba(245, 158, 11, 0.25) !important;
    color: #FCD34D !important;
}

[data-theme="dark"] .btn-system-modal-ignore:hover {
    background: rgba(245, 158, 11, 0.22) !important;
    border-color: rgba(245, 158, 11, 0.45) !important;
    color: #FDE68A !important;
}

[data-theme="dark"] .btn-system-modal-cancel {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #cbd5e1 !important;
}

[data-theme="dark"] .btn-system-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.12) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   PROFILE DROPDOWN LOGOUT LINK (DARK THEME PRESERVES CRISP RED)
   ========================================================================== */
[data-theme="dark"] .merch-dropdown-logout,
[data-theme="dark"] .merch-dropdown-item.merch-dropdown-logout,
[data-theme="dark"] .merch-dropdown-item.merch-dropdown-logout *,
[data-theme="dark"] .merch-dropdown-item[href*="logout"],
[data-theme="dark"] .merch-dropdown-item[href*="logout"] * {
    color: #ff4757 !important;
    stroke: #ff4757 !important;
}

[data-theme="dark"] .merch-dropdown-logout:hover,
[data-theme="dark"] .merch-dropdown-item.merch-dropdown-logout:hover,
[data-theme="dark"] .merch-dropdown-item.merch-dropdown-logout:hover *,
[data-theme="dark"] .merch-dropdown-item[href*="logout"]:hover,
[data-theme="dark"] .merch-dropdown-item[href*="logout"]:hover * {
    color: #ff6b81 !important;
    stroke: #ff6b81 !important;
    background: rgba(255, 71, 87, 0.12) !important;
}

/* ==========================================================================
   WORKSPACE MOBILE TOOL DRAWER - DARK MODE ICONS
   ========================================================================== */
[data-theme="dark"] .ws-mobile-tool-item .ws-mobile-tool-icon,
[data-theme="dark"] .ws-mobile-tool-item svg,
[data-theme="dark"] .ws-mobile-tool-item path,
[data-theme="dark"] .ws-mobile-tool-item line,
[data-theme="dark"] .ws-mobile-tool-item polyline,
[data-theme="dark"] .ws-mobile-tool-item rect,
[data-theme="dark"] .ws-mobile-tool-item circle {
    color: #ffffff !important;
    stroke: #ffffff !important;
}

[data-theme="dark"] .ws-mobile-tool-item--export-layout .ws-mobile-tool-icon,
[data-theme="dark"] .ws-mobile-tool-item--export-layout svg,
[data-theme="dark"] .ws-mobile-tool-item--export-layout path,
[data-theme="dark"] .ws-mobile-tool-item--export-layout rect,
[data-theme="dark"] .ws-mobile-tool-item--export-layout circle,
[data-theme="dark"] .ws-mobile-tool-item--export-layout polyline {
    color: #60a5fa !important;
    stroke: #60a5fa !important;
}

/* ==========================================================================
   WORKSPACE PAPER VIEW CONTRAST TOGGLE (DARK MODE ONLY)
   Allows switching canvas sheet surface between White Sheet & Dark Sheet
   ========================================================================== */
.ws-paper-view-toggle {
    display: none !important; /* Strictly hidden in Light Mode */
    position: absolute;
    top: 16px;
    left: 20px;
    z-index: 120 !important; /* Always visible above canvas layers without clipping */
    background: #181524;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 3px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    gap: 3px;
    align-items: center;
    box-sizing: border-box;
    max-width: calc(100vw - 40px);
    overflow: hidden;
    pointer-events: auto !important;
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.3, 1), left 0.3s cubic-bezier(0.2, 0.9, 0.3, 1);
}

[data-theme="dark"] .ws-paper-view-toggle {
    display: flex !important; /* Visible only in Dark Mode */
}

.ws-paper-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent;
    border: none;
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 0.74rem;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    transition: all 0.18s ease;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    box-sizing: border-box;
    pointer-events: auto !important;
}

.ws-paper-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.ws-paper-btn.active {
    background: #5C32E4 !important;
    color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(92, 50, 228, 0.45) !important;
}

.ws-paper-btn svg {
    stroke: currentColor;
    flex-shrink: 0;
}

/* Tablet & Mobile Responsiveness for Paper View Toggle */
@media (max-width: 1199px) {
    .ws-paper-view-toggle {
        top: 14px !important;
        left: 14px !important;
        padding: 2.5px !important;
        gap: 2.5px !important;
    }

    .ws-paper-btn {
        padding: 4px 10px !important;
        font-size: 0.7rem !important;
        gap: 5px !important;
    }
}

@media (max-width: 768px) {
    .ws-paper-view-toggle {
        top: 10px !important;
        left: 10px !important;
        padding: 2px !important;
        gap: 2px !important;
        max-width: calc(100vw - 20px) !important;
    }

    .ws-paper-btn {
        padding: 3.5px 8px !important;
        font-size: 0.65rem !important;
        gap: 4px !important;
    }

    .ws-paper-btn svg {
        width: 11px !important;
        height: 11px !important;
    }
}

@media (max-width: 480px) {
    .ws-paper-view-toggle {
        top: 8px !important;
        left: 8px !important;
    }

    .ws-paper-btn {
        padding: 3px 6px !important;
        font-size: 0.62rem !important;
        gap: 3px !important;
    }
}

/* --------------------------------------------------------------------------
   DARK THEME: WHITE SHEET MODE
   Directly mirrors the Light Theme canvas: Soft lavender sheet (#F0EEF8),
   crisp lilac dashed guidelines (#A38CF4), purple spine, and legible overlays.
   -------------------------------------------------------------------------- */
[data-theme="dark"] .ws-book-spread-canvas.paper-view-white {
    background: #F0EEF8 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
}

/* Outer dashed guideline handled by SVG canvas-guidelines-overlay */
.ws-book-spread-canvas::after,
[data-theme="dark"] .ws-book-spread-canvas:not(.interior-mode)::after,
.ws-book-spread-canvas.paper-view-white:not(.interior-mode)::after {
    display: none !important;
    border: none !important;
}

/* Leaf Labels & Dimensions (Matching Light Theme) */
[data-theme="dark"] .ws-book-spread-canvas.paper-view-white .ws-spread-leaf .ws-leaf-label,
[data-theme="dark"] .ws-book-spread-canvas.paper-view-white .ws-leaf-label {
    color: #7C57FF !important;
    opacity: 0.65 !important;
    font-size: 1.25rem !important;
    font-weight: 700 !important;
}

[data-theme="dark"] .ws-book-spread-canvas.paper-view-white .ws-spread-leaf .ws-leaf-dim-bottom,
[data-theme="dark"] .ws-book-spread-canvas.paper-view-white .ws-leaf-dim-bottom {
    color: #A38CF4 !important;
    opacity: 0.85 !important;
    font-weight: 600 !important;
}

/* Spine Strip (Matching Light Theme) */
[data-theme="dark"] .ws-book-spread-canvas.paper-view-white .ws-spread-spine {
    background-color: rgba(124, 87, 255, 0.15) !important;
    border: none !important;
}

[data-theme="dark"] .ws-book-spread-canvas.paper-view-white .ws-spread-spine .ws-spine-label,
[data-theme="dark"] .ws-book-spread-canvas.paper-view-white .ws-spine-label {
    color: #5C32E4 !important;
    opacity: 0.85 !important;
    font-weight: 800 !important;
}

[data-theme="dark"] .ws-book-spread-canvas.paper-view-white .ws-spread-spine .ws-spine-dim-bottom,
[data-theme="dark"] .ws-book-spread-canvas.paper-view-white .ws-spine-dim-bottom {
    color: #7C57FF !important;
    opacity: 0.85 !important;
    font-weight: 600 !important;
}

/* Interior Pages with White/Light Sheet Mode */
[data-theme="dark"] .ws-book-spread-canvas.interior-mode.paper-view-white {
    background: transparent !important;
    box-shadow: none !important;
}

[data-theme="dark"] .ws-book-spread-canvas.interior-mode.paper-view-white #leftLeafElement,
[data-theme="dark"] .ws-book-spread-canvas.interior-mode.paper-view-white #rightLeafElement {
    background-color: #F0EEF8 !important;
    box-shadow: none !important;
    border: none !important;
    z-index: auto !important;
}

/* --------------------------------------------------------------------------
   DARK THEME: DARK SHEET MODE (Default - High contrast for white text & light art)
   -------------------------------------------------------------------------- */
[data-theme="dark"] .ws-book-spread-canvas:not(.paper-view-white) {
    background: #13111c !important;
}

[data-theme="dark"] .ws-book-spread-canvas:not(.paper-view-white) .ws-spread-spine {
    background-color: rgba(124, 87, 255, 0.15) !important;
    border: none !important;
}

[data-theme="dark"] .ws-book-spread-canvas:not(.paper-view-white) .ws-spread-leaf .ws-leaf-label {
    color: rgba(255, 255, 255, 0.38) !important;
    font-size: 1.15rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.5px !important;
}

[data-theme="dark"] .ws-book-spread-canvas:not(.paper-view-white) .ws-spread-leaf .ws-leaf-dim-bottom {
    color: rgba(255, 255, 255, 0.42) !important;
    font-weight: 600 !important;
}

[data-theme="dark"] .ws-book-spread-canvas:not(.paper-view-white) .ws-spread-spine .ws-spine-label,
[data-theme="dark"] .ws-book-spread-canvas:not(.paper-view-white) .ws-spread-spine .ws-spine-dim-bottom {
    color: rgba(163, 140, 244, 0.65) !important;
}

[data-theme="dark"] .ws-book-spread-canvas.interior-mode:not(.paper-view-white) #leftLeafElement,
[data-theme="dark"] .ws-book-spread-canvas.interior-mode:not(.paper-view-white) #rightLeafElement {
    background-color: #13111c !important;
    border: none !important;
    box-shadow: none !important;
    z-index: auto !important;
}

/* Strictly hide outer dashed ::after border across all modes */
[data-theme="dark"] .interior-mode.ws-book-spread-canvas::after,
[data-theme="dark"] .ws-book-spread-canvas.interior-mode::after,
.interior-mode.ws-book-spread-canvas::after {
    display: none !important;
    border: none !important;
    border-color: transparent !important;
}

/* ==========================================================================
   STRICT CANVAS LAYERING & Z-INDEX HIERARCHY (LIGHT & DARK MODE)
   Ensures the paper sheet stays at the back, user images/objects in the middle,
   and guidelines/smart guides/text overlays (Back Cover, Front Cover, Back Leaf,
   Front Leaf, Spine, and Dimensions) float ON TOP of every object on the canvas.
   ========================================================================== */
.ws-spread-leaf,
.ws-spread-spine {
    z-index: auto !important;
    pointer-events: none !important;
}

.ws-spread-leaf svg,
.ws-spread-leaf .ruling-svg {
    z-index: 2 !important;
    pointer-events: none !important;
}

.canvas-object {
    z-index: 10;
}

.canvas-object.is-behind-ruling {
    z-index: 1 !important;
}

.canvas-object.active:not(.is-behind-ruling) {
    z-index: 999 !important;
}

.canvas-object.active.is-behind-ruling {
    z-index: 1 !important;
}

/* Watermark Text & Dimension Overlays (Watermark text is rendered at constant scale inside SVG #canvasGuidelinesOverlay) */
.ws-spread-leaf .ws-leaf-label,
.ws-spread-spine .ws-spine-label,
.ws-leaf-label,
.ws-spine-label,
#leftLeafText,
#rightLeafText,
#spineElement .ws-spine-label {
    display: none !important;
}

.ws-leaf-dim-bottom,
.ws-spine-dim-bottom,
#leftLeafDim,
#rightLeafDim,
#spineDim {
    position: absolute !important;
    z-index: 5000 !important;
    pointer-events: none !important;
}

.single-leaf-mode .ws-leaf-dim-bottom,
.single-leaf-mode #rightLeafDim,
.single-leaf-mode #leftLeafDim {
    display: none !important;
}

/* Guidelines & Borders Overlay (Managed via SVG vector-effect for constant screen width) */
.canvas-guidelines-overlay,
#canvasGuidelinesOverlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none !important;
    z-index: 8000 !important;
    overflow: visible;
}

.canvas-guidelines-overlay line,
.canvas-guidelines-overlay rect,
.canvas-guidelines-overlay path,
#canvasGuidelinesOverlay line,
#canvasGuidelinesOverlay rect,
#canvasGuidelinesOverlay path {
    vector-effect: non-scaling-stroke !important;
}

.ws-spread-spine::after {
    display: none !important;
    border: none !important;
}

.interior-mode #leftLeafElement::after,
.interior-mode #rightLeafElement::after,
#leftLeafElement::after,
#rightLeafElement::after {
    display: none !important;
    border: none !important;
}

.ws-book-spread-canvas::after,
.ws-book-spread-canvas:not(.interior-mode)::after,
.ws-book-spread-canvas.single-leaf-mode::after {
    display: none !important;
    border: none !important;
}

.ws-book-spread-canvas,
.ws-spread-leaf,
.ws-spread-spine,
#leftLeafElement,
#rightLeafElement,
#spineElement,
.ws-book-spread-canvas.zero-spine #spineElement,
.ws-book-spread-canvas.single-leaf-mode #rightLeafElement,
.interior-mode #leftLeafElement,
.interior-mode #rightLeafElement {
    border: none !important;
    border-left: none !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
}

.ws-book-spread-canvas.zero-spine #spineElement,
.ws-book-spread-canvas.single-leaf-mode #spineElement,
.ws-book-spread-canvas.interior-mode #spineElement {
    display: none !important;
    width: 0 !important;
    min-width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    background-color: transparent !important;
}

#smart-guides-overlay {
    z-index: 9000 !important;
    pointer-events: none !important;
}

#smart-guides-overlay line,
#smart-guides-overlay path {
    vector-effect: non-scaling-stroke !important;
}

html[data-ghost-mode] #canvasGuidelinesOverlay {
    display: none !important;
}

.ws-dim-tag-top,
.ws-dim-tag-left {
    z-index: 9500 !important;
    pointer-events: none !important;
}

/* ==========================================================================
   GLOBAL CANVAS EXPORT & GHOST SNAPSHOT TRANSPARENCY OVERRIDES
   ========================================================================== */
html[data-canvas-exporting] .ws-book-spread-canvas,
html[data-canvas-exporting] .ws-spread-leaf,
html[data-canvas-exporting] .ws-spread-spine,
html[data-canvas-exporting] #leftLeafElement,
html[data-canvas-exporting] #rightLeafElement,
html[data-canvas-exporting] #spineElement,
html[data-ghost-mode] .ws-book-spread-canvas,
html[data-ghost-mode] .ws-spread-leaf,
html[data-ghost-mode] .ws-spread-spine,
html[data-ghost-mode] #leftLeafElement,
html[data-ghost-mode] #rightLeafElement,
html[data-ghost-mode] #spineElement {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

html[data-canvas-exporting] .ws-spread-spine::after,
html[data-canvas-exporting] #spineElement::after,
html[data-ghost-mode] .ws-spread-spine::after,
html[data-ghost-mode] #spineElement::after {
    background: transparent !important;
    background-color: transparent !important;
}

html[data-ghost-mode] .ws-leaf-label,
html[data-ghost-mode] .ws-leaf-dim-bottom,
html[data-ghost-mode] .ws-spine-label,
html[data-ghost-mode] .ws-spine-dim-bottom,
html[data-ghost-mode] .ws-dim-tag-top,
html[data-ghost-mode] .ws-dim-tag-left,
html[data-ghost-mode] .resize-handle,
html[data-ghost-mode] .rotate-handle,
html[data-ghost-mode] .move-handle,
html[data-ghost-mode] .smart-guide-line,
html[data-ghost-mode] #smart-guides-overlay,
html[data-ghost-mode] .ws-book-spread-canvas::after,
html[data-ghost-mode] .ws-spread-spine::after,
html[data-ghost-mode] .ws-spread-leaf::after,
html[data-ghost-mode] #leftLeafElement::after,
html[data-ghost-mode] #rightLeafElement::after,
html[data-ghost-mode] #spineElement::after {
    display: none !important;
}

html[data-ghost-mode] .ws-book-spread-canvas,
html[data-ghost-mode] .ws-spread-leaf,
html[data-ghost-mode] #spineElement,
html[data-ghost-mode] .ws-spread-spine,
html[data-ghost-mode] #leftLeafElement,
html[data-ghost-mode] #rightLeafElement {
    border: none !important;
    border-color: transparent !important;
}

/* ==========================================================================
   THEME-AWARE OBJECT TRANSFORM HANDLES (Bright Purple Light / White Dark)
   ========================================================================== */

/* Light Mode (Default) */
.resize-handle {
    background-color: #7B52FF;
    border: 1.5px solid #FFFFFF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
    border-radius: 2px;
}
.rotate-handle {
    background: #7B52FF;
    border: 2px solid #FFFFFF;
    color: #FFFFFF;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.rotate-handle:hover {
    background: #5C32E4;
    color: #FFFFFF;
}
.shape-radius-handle {
    background: #7B52FF !important;
    border: 2px solid #FFFFFF !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25) !important;
}
.line-node-handle {
    background: #7B52FF !important;
    border: 2.5px solid #FFFFFF !important;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35) !important;
}

/* Dark Mode Overrides */
[data-theme="dark"] .resize-handle,
html[data-theme="dark"] .resize-handle {
    background-color: #FFFFFF !important;
    border: 1.5px solid #7B52FF !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="dark"] .rotate-handle,
html[data-theme="dark"] .rotate-handle {
    background: #FFFFFF !important;
    border: 2px solid #7B52FF !important;
    color: #7B52FF !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="dark"] .rotate-handle:hover,
html[data-theme="dark"] .rotate-handle:hover {
    background: #7B52FF !important;
    color: #FFFFFF !important;
}
[data-theme="dark"] .shape-radius-handle,
html[data-theme="dark"] .shape-radius-handle {
    background: #FFFFFF !important;
    border: 2px solid #7B52FF !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
}
[data-theme="dark"] .line-node-handle,
html[data-theme="dark"] .line-node-handle {
    background: #FFFFFF !important;
    border: 2.5px solid #7B52FF !important;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.4) !important;
}

/* ==========================================================================
   MULTI-SELECT & GROUPING ENGINE STYLES
   ========================================================================== */

/* Universal Floating Multi-Select Pill Indicator */
.ws-multi-select-pill {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9200 !important;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 4px 10px;
    height: 28px;
    box-sizing: border-box;
    white-space: nowrap;
    background: rgba(22, 20, 34, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.45);
    border-radius: 9999px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 0 10px rgba(125, 42, 232, 0.2);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    animation: pillSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pillSlideDown {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

.ws-multi-select-pill .pill-dot {
    width: 6px;
    height: 6px;
    flex-shrink: 0;
    border-radius: 50%;
    background: #A855F7;
    box-shadow: 0 0 6px #A855F7;
    animation: pillPulse 1.8s infinite;
}

.ws-multi-select-pill .pill-text {
    white-space: nowrap;
    line-height: 1;
}

.ws-multi-select-pill .pill-close-btn {
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #D1D5DB;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    cursor: pointer;
    line-height: 1;
    margin-left: 2px;
    padding: 0;
    transition: background 0.15s, color 0.15s;
}

.ws-multi-select-pill .pill-close-btn:hover {
    background: rgba(239, 68, 68, 0.4);
    color: #FFFFFF;
}

/* Tablet & Mobile Responsiveness for Multi-Select Pill */
@media (max-width: 1199px) {
    .ws-multi-select-pill {
        top: 14px !important;
        font-size: 0.70rem !important;
        padding: 3px 8px !important;
        height: 26px !important;
    }
}

@media (max-width: 768px) {
    .ws-multi-select-pill {
        top: 46px !important;
        left: 10px !important;
        right: auto !important;
        transform: none !important;
        font-size: 0.65rem !important;
        padding: 3px 8px !important;
        height: 24px !important;
        max-width: calc(100vw - 140px) !important;
    }
}

@media (max-width: 480px) {
    .ws-multi-select-pill {
        top: 42px !important;
        left: 8px !important;
        font-size: 0.62rem !important;
        padding: 2.5px 7px !important;
        height: 22px !important;
        max-width: calc(100vw - 120px) !important;
    }
}

/* Floating Tap-to-Place Guidance Banner / Pill */
.ws-placement-helper {
    position: absolute;
    top: 135px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10100 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    height: 32px;
    box-sizing: border-box;
    white-space: nowrap;
    background: rgba(22, 20, 34, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1.5px solid rgba(168, 85, 247, 0.55);
    border-radius: 9999px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(125, 42, 232, 0.3);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0.01em;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
    animation: pillSlideDown 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.ws-placement-helper .ws-placement-icon {
    font-size: 0.85rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

.ws-placement-helper .ws-placement-text {
    white-space: nowrap;
    line-height: 1;
    color: #FFFFFF;
    font-weight: 600;
}

.ws-placement-helper .ws-placement-cancel-btn {
    background: rgba(239, 68, 68, 0.22);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #FCA5A5;
    height: 20px;
    padding: 0 8px;
    flex-shrink: 0;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    margin-left: 4px;
    transition: all 0.15s ease;
}

.ws-placement-helper .ws-placement-cancel-btn:hover {
    background: rgba(239, 68, 68, 0.45);
    border-color: rgba(239, 68, 68, 0.75);
    color: #FFFFFF;
}

/* Tablet & Mobile Responsiveness for Placement Helper */
@media (max-width: 1199px) {
    .ws-placement-helper {
        top: 130px !important;
        font-size: 0.72rem !important;
        padding: 5px 12px !important;
        height: 30px !important;
    }
}

@media (max-width: 768px) {
    .ws-placement-helper {
        top: 125px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        font-size: 0.68rem !important;
        padding: 4px 10px !important;
        height: 28px !important;
        max-width: calc(100vw - 32px) !important;
    }
}

@media (max-width: 480px) {
    .ws-placement-helper {
        top: 110px !important;
        font-size: 0.65rem !important;
        padding: 3px 8px !important;
        height: 26px !important;
        max-width: calc(100vw - 20px) !important;
    }
}

/* Floating Toolbar Fixed Viewport Positioning & Bounds Protection */
.floating-toolbar {
    position: fixed !important;
    z-index: 9500 !important;
    max-height: calc(100vh - 120px) !important;
    overflow-y: auto !important;
    scrollbar-width: thin;
    box-sizing: border-box !important;
}

.floating-toolbar:not(.visible) {
    display: none !important;
    left: -9999px !important;
    top: -9999px !important;
}

/* Active Multi-Select Tool Button States */
.ws-tool-btn.active-tool,
.ws-sidebar-tool-btn.active-tool,
.ws-mobile-tool-item.active-tool {
    background: rgba(125, 42, 232, 0.16) !important;
    border-color: #7D2AE8 !important;
    color: #7D2AE8 !important;
}

.ws-tool-btn.active-tool svg,
.ws-sidebar-tool-btn.active-tool svg,
.ws-mobile-tool-item.active-tool svg {
    stroke: #7D2AE8 !important;
}

/* SVG Selection Overlay & Elements (Constant 1.5px screen width via vector-effect) */
.canvas-selection-overlay,
#canvasSelectionOverlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none !important;
    z-index: 9100 !important;
    overflow: visible;
}

.canvas-selection-overlay rect,
#canvasSelectionOverlay rect {
    vector-effect: non-scaling-stroke !important;
}

/* Multi-Selected Object (Outlines rendered crisply in SVG #canvasSelectionOverlay) */
.canvas-object.multi-selected {
    outline: none !important;
}

/* Group Object Styling */
.canvas-object.group-object {
    cursor: move;
}

html[data-ghost-mode] .canvas-selection-overlay,
html[data-ghost-mode] #canvasSelectionOverlay,
html[data-ghost-mode] .ws-multi-select-pill,
html[data-ghost-mode] .ws-placement-helper,
html[data-canvas-exporting] .canvas-selection-overlay,
html[data-canvas-exporting] #canvasSelectionOverlay,
html[data-canvas-exporting] .ws-multi-select-pill,
html[data-canvas-exporting] .ws-placement-helper {
    display: none !important;
}

/* Canvas Strict Touch & Context Menu Callout Suppression */
.ws-book-spread-canvas,
.ws-canvas-container,
.ws-viewport-center,
.canvas-object {
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    user-select: none !important;
}

/* Tablet Icon Rail Responsiveness */
@media (max-width: 1199px) and (min-width: 768px) {
    .ws-tablet-rail-tools {
        max-height: calc(100vh - 110px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        gap: 6px !important;
        padding-bottom: 8px !important;
        scrollbar-width: thin;
    }
    .ws-sidebar-left:not(.is-expanded) .ws-tablet-rail-tools .ws-sidebar-tool-btn {
        padding: 7px 0 !important;
        min-height: 38px !important;
    }
    .ws-sidebar-left.is-expanded .ws-tablet-rail-tools .ws-sidebar-tool-btn {
        padding: 8px 14px !important;
        min-height: 38px !important;
        justify-content: flex-start !important;
        gap: 12px !important;
    }
    .ws-floating-toggles {
        z-index: 9800 !important;
    }
}

/* ==========================================================================
   GLISTENING LUXA AI ART DIRECTOR BUTTONS (DESKTOP, TABLET & MOBILE)
   ========================================================================== */

@keyframes aiGlistenSweep {
    0% { transform: translateX(-160%) rotate(25deg); opacity: 0; }
    20% { opacity: 0.9; }
    60% { opacity: 0.9; }
    100% { transform: translateX(260%) rotate(25deg); opacity: 0; }
}

@keyframes aiGlowPulse {
    0%, 100% {
        box-shadow: 0 0 14px rgba(124, 58, 237, 0.4), 0 0 4px rgba(6, 182, 212, 0.3), inset 0 0 8px rgba(124, 58, 237, 0.2);
        border-color: rgba(168, 85, 247, 0.65);
    }
    50% {
        box-shadow: 0 0 22px rgba(168, 85, 247, 0.65), 0 0 10px rgba(6, 182, 212, 0.5), inset 0 0 12px rgba(6, 182, 212, 0.3);
        border-color: rgba(6, 182, 212, 0.85);
    }
}

@keyframes aiSparkleRotate {
    0% { transform: rotate(0deg) scale(1); filter: drop-shadow(0 0 6px #A855F7); }
    50% { transform: rotate(15deg) scale(1.12); filter: drop-shadow(0 0 10px #00D2FF); }
    100% { transform: rotate(0deg) scale(1); filter: drop-shadow(0 0 6px #A855F7); }
}

/* 1. Desktop Featured Glistening AI Button */
.ws-btn-glistening-ai {
    position: relative !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, rgba(30, 20, 58, 0.95), rgba(18, 12, 40, 0.95)) !important;
    border: 1.5px solid rgba(168, 85, 247, 0.65) !important;
    overflow: hidden !important;
    cursor: pointer !important;
    user-select: none !important;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    animation: aiGlowPulse 3.5s infinite ease-in-out !important;
}

[data-theme="light"] .ws-btn-glistening-ai,
html[data-theme="light"] .ws-btn-glistening-ai {
    background: linear-gradient(135deg, #FAF8FF, #F3EEFF) !important;
    border: 1.5px solid rgba(124, 58, 237, 0.55) !important;
}

.ws-btn-glistening-ai::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25) 0%, rgba(6, 182, 212, 0.18) 50%, rgba(236, 72, 153, 0.18) 100%);
    pointer-events: none;
    z-index: 1;
}

.ws-btn-glistening-ai::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -40%;
    width: 35%;
    height: 200%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
    transform: rotate(25deg);
    animation: aiGlistenSweep 3.6s infinite cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 2;
}

.ws-btn-glistening-ai:hover {
    transform: translateY(-1.5px) scale(1.015) !important;
    border-color: #00D2FF !important;
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.45), 0 0 16px rgba(0, 210, 255, 0.5) !important;
}

.ws-btn-glistening-ai:active,
.ws-btn-glistening-ai.active-tool,
.ws-btn-glistening-ai.is-active {
    background: linear-gradient(135deg, #5C32E4, #7C3AED) !important;
    border-color: #00D2FF !important;
    box-shadow: 0 0 20px rgba(92, 50, 228, 0.7), 0 0 10px rgba(0, 210, 255, 0.6) !important;
}

.ws-ai-btn-content-left {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ws-ai-glow-sparkle-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5C32E4, #00D2FF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.6);
    animation: aiSparkleRotate 3s infinite ease-in-out;
}

.ws-ai-glow-sparkle-icon svg {
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

.ws-ai-btn-text-group {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.ws-ai-btn-title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: var(--text-primary, #FFFFFF);
    line-height: 1.15;
}

[data-theme="light"] .ws-ai-btn-title {
    color: #1E1B4B;
}

.ws-btn-glistening-ai.active-tool .ws-ai-btn-title,
.ws-btn-glistening-ai.is-active .ws-ai-btn-title {
    color: #FFFFFF !important;
}

.ws-ai-btn-subtitle {
    font-size: 0.62rem;
    font-weight: 600;
    color: #A855F7;
    letter-spacing: 0.2px;
}

.ws-btn-glistening-ai.active-tool .ws-ai-btn-subtitle,
.ws-btn-glistening-ai.is-active .ws-ai-btn-subtitle {
    color: rgba(255, 255, 255, 0.85) !important;
}

.luxa-ai-credit-pill-mini {
    position: relative;
    z-index: 3;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 9999px;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(6, 182, 212, 0.35));
    border: 1px solid rgba(168, 85, 247, 0.6);
    color: #FFFFFF;
    text-shadow: 0 0 6px rgba(168, 85, 247, 0.7);
    box-shadow: 0 0 8px rgba(124, 58, 237, 0.3);
    letter-spacing: 0.3px;
    white-space: nowrap;
}

/* 2. Tablet Rail Glistening AI Button */
.ws-rail-glistening-ai {
    position: relative !important;
    background: linear-gradient(135deg, rgba(92, 50, 228, 0.2), rgba(0, 210, 255, 0.15)) !important;
    border: 1.5px solid rgba(168, 85, 247, 0.6) !important;
    border-radius: 10px !important;
    animation: aiGlowPulse 3.5s infinite ease-in-out !important;
}

.ws-rail-glistening-ai:hover {
    transform: scale(1.05) !important;
    border-color: #00D2FF !important;
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.5) !important;
}

.ws-rail-ai-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #A855F7;
    animation: aiSparkleRotate 3s infinite ease-in-out;
}

.ws-rail-ai-icon-wrapper svg {
    color: #A855F7 !important;
    stroke: #A855F7 !important;
}

.ws-rail-glistening-ai.active-tool .ws-rail-ai-icon-wrapper svg,
.ws-rail-glistening-ai.is-active .ws-rail-ai-icon-wrapper svg {
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

/* 3. Mobile Dock Glistening AI Button */
.ws-mobile-glistening-ai {
    position: relative !important;
}

.ws-mobile-ai-icon-halo {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.25), rgba(6, 182, 212, 0.25));
    border: 1px solid rgba(168, 85, 247, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.4);
    animation: aiSparkleRotate 3s infinite ease-in-out;
    margin: 0 auto;
}

.ws-mobile-ai-icon-halo svg {
    color: #A855F7 !important;
    stroke: #A855F7 !important;
}

.ws-mobile-glistening-ai .ws-mobile-dock-label {
    color: #A855F7 !important;
    font-weight: 800 !important;
    letter-spacing: 0.2px !important;
}

.ws-mobile-glistening-ai.active-tool .ws-mobile-ai-icon-halo,
.ws-mobile-glistening-ai.is-active .ws-mobile-ai-icon-halo {
    background: linear-gradient(135deg, #5C32E4, #00D2FF) !important;
    box-shadow: 0 0 14px rgba(0, 210, 255, 0.6) !important;
}

.ws-mobile-glistening-ai.active-tool .ws-mobile-ai-icon-halo svg,
.ws-mobile-glistening-ai.is-active .ws-mobile-ai-icon-halo svg {
    color: #FFFFFF !important;
    stroke: #FFFFFF !important;
}

/* ==========================================================================
   WORKSPACE LAYER STACK - DRAG & DROP & ACTIVE HIGHLIGHT STATES
   ========================================================================== */
.ws-layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle, #e2e8f0);
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #1e293b);
    cursor: default;
    user-select: none;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    margin-bottom: 6px;
    position: relative;
}

.ws-layer-item:hover {
    background: var(--bg-card-hover, #f8fafc);
    border-color: rgba(92, 50, 228, 0.3);
}

.ws-layer-item.highlighted {
    background: rgba(92, 50, 228, 0.08) !important;
    border-color: #5C32E4 !important;
    box-shadow: 0 0 0 1px #5C32E4;
}

.ws-layer-item.is-pointer-dragging {
    background: #ffffff !important;
    border-color: #5C32E4 !important;
    box-shadow: 0 12px 30px rgba(92, 50, 228, 0.28), 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    z-index: 9999 !important;
    opacity: 0.95;
}

[data-theme="dark"] .ws-layer-item {
    background: #181524 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .ws-layer-item:hover {
    background: #211c33 !important;
    border-color: rgba(124, 77, 255, 0.4) !important;
}

[data-theme="dark"] .ws-layer-item.highlighted {
    background: rgba(124, 77, 255, 0.22) !important;
    border-color: #7c4dff !important;
    box-shadow: 0 0 0 1px #7c4dff, 0 0 14px rgba(124, 77, 255, 0.25) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .ws-layer-item.is-pointer-dragging {
    background: #27223c !important;
    border-color: #7c4dff !important;
    box-shadow: 0 16px 36px rgba(124, 77, 255, 0.45), 0 4px 16px rgba(0, 0, 0, 0.7) !important;
    z-index: 9999 !important;
    opacity: 0.96;
}

[data-theme="dark"] .ws-layer-item .layer-drag-handle {
    color: #cbd5e1 !important;
}

[data-theme="dark"] .ws-layer-item .layer-target-icon {
    color: #cbd5e1 !important;
}

.layer-drag-handle {
    touch-action: none !important;
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    border-radius: 4px;
    user-select: none;
    -webkit-user-select: none;
    flex-shrink: 0;
}

.layer-drag-handle:active {
    cursor: grabbing;
}

.ws-layer-item {
    touch-action: pan-y;
}

.ws-layer-item.is-pointer-dragging {
    touch-action: none !important;
}

/* Mobile Bottom Sheets & Drawers in Dark Mode */
[data-theme="dark"] .ws-mobile-sheet {
    background: #13111c !important;
    border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.85) !important;
}

[data-theme="dark"] .ws-mobile-sheet-drag-bar {
    background: rgba(255, 255, 255, 0.25) !important;
}

[data-theme="dark"] .ws-mobile-sheet-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}

[data-theme="dark"] .ws-mobile-sheet-close {
    background: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

[data-theme="dark"] .ws-mobile-sheet-close:hover {
    background: rgba(255, 255, 255, 0.16) !important;
    color: #ffffff !important;
}

[data-theme="dark"] #btnMobileAddLayer,
[data-theme="dark"] #btnMobileDeleteLayer {
    color: #ffffff !important;
}

[data-theme="dark"] #mobileLayerListContainer .ws-layer-item {
    background: #181524 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
}

[data-theme="dark"] #mobileLayerListContainer .ws-layer-item:hover {
    background: #211c33 !important;
    border-color: rgba(124, 77, 255, 0.4) !important;
}

[data-theme="dark"] #mobileLayerListContainer .ws-layer-item.highlighted {
    background: rgba(124, 77, 255, 0.22) !important;
    border-color: #7c4dff !important;
    box-shadow: 0 0 0 1px #7c4dff, 0 0 14px rgba(124, 77, 255, 0.25) !important;
    color: #ffffff !important;
}

[data-theme="dark"] #mobileLayerListContainer .ws-layer-item.is-pointer-dragging {
    background: #27223c !important;
    border-color: #7c4dff !important;
    box-shadow: 0 16px 36px rgba(124, 77, 255, 0.55), 0 4px 16px rgba(0, 0, 0, 0.8) !important;
    z-index: 9999 !important;
    opacity: 0.96;
}

/* Canva-Style 100+ Font Picker Popover */
.luxa-font-picker-popover {
    position: fixed;
    z-index: 10005;
    width: 290px;
    background: #1e1e24;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(92, 50, 228, 0.25);
    color: #ffffff;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
}

.luxa-font-picker-popover.visible {
    display: flex;
}

.luxa-font-search-wrap {
    padding: 8px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 6px;
    background: #17171c;
}

.luxa-font-search-input {
    flex: 1;
    background: #282832;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 6px 10px;
    color: #fff;
    font-size: 13px;
    outline: none;
}

.luxa-font-search-input:focus {
    border-color: #5C32E4;
    box-shadow: 0 0 0 2px rgba(92, 50, 228, 0.25);
}

.luxa-font-pills-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 5px;
    padding: 6px 8px;
    background: #141419;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.luxa-font-pill {
    background: #242430;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #a8a8b8;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.luxa-font-pill:hover {
    background: #353545;
    color: #fff;
}

.luxa-font-pill.active {
    background: #5C32E4;
    color: #ffffff;
    border-color: #8C52FF;
}

.luxa-font-list {
    max-height: 280px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) rgba(255, 255, 255, 0.05);
}

.luxa-font-list::-webkit-scrollbar {
    width: 6px;
}
.luxa-font-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}
.luxa-font-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}
.luxa-font-list::-webkit-scrollbar-thumb:hover {
    background: #5C32E4;
}

.luxa-font-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    color: #e4e4eb;
    transition: background 0.15s ease, transform 0.1s ease;
    user-select: none;
}

.luxa-font-item:hover {
    background: #313140;
    color: #ffffff;
}

.luxa-font-item.selected {
    background: rgba(92, 50, 228, 0.25);
    color: #ffffff;
    font-weight: bold;
}

.luxa-font-item .luxa-font-check {
    color: #00C4CC;
    font-size: 13px;
    font-weight: bold;
    display: none;
}

.luxa-font-item.selected .luxa-font-check {
    display: inline-block;
}

/* Custom Font Import & Upload */
.luxa-font-import-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 10px;
    background: rgba(92, 50, 228, 0.15);
    border: 1px dashed rgba(92, 50, 228, 0.4);
    color: #A887FF;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    border-radius: 6px;
    margin: 6px 8px 2px 8px;
    transition: all 0.15s ease;
}

.luxa-font-import-toggle:hover {
    background: rgba(92, 50, 228, 0.28);
    color: #ffffff;
    border-color: #7D2AE8;
}

.luxa-font-import-panel {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 8px 10px;
    background: #16161c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.luxa-font-import-panel.open {
    display: flex;
}

.luxa-font-import-input {
    background: #252530;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 5px;
    padding: 5px 8px;
    color: #fff;
    font-size: 12px;
    outline: none;
}
.luxa-font-import-input:focus {
    border-color: #5C32E4;
}

.luxa-font-import-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.luxa-font-import-submit {
    width: 100%;
    background: linear-gradient(135deg, #6E3AFF 0%, #4D1ED4 100%);
    border: 1px solid #7D4CFF;
    border-radius: 6px;
    color: #ffffff;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
    box-shadow: 0 2px 8px rgba(92, 50, 228, 0.35);
}
.luxa-font-import-submit:hover {
    background: linear-gradient(135deg, #7E4DFF 0%, #5D2AE4 100%);
    box-shadow: 0 4px 14px rgba(92, 50, 228, 0.5);
    transform: translateY(-1px);
}
.luxa-font-import-submit:active {
    transform: translateY(0);
}

.luxa-font-file-upload-btn {
    background: #2b2b38;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #e4e4eb;
    padding: 7px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    user-select: none;
    box-sizing: border-box;
    transition: all 0.15s ease;
}
.luxa-font-file-upload-btn:hover {
    background: #3a3a4c;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   CANVAS BASE COLOR POPOVER & SWATCH CONTROLS
   ========================================================================== */
.ws-color-popover {
    transition: opacity 0.18s ease, transform 0.18s ease;
    backdrop-filter: blur(12px);
}

[data-theme="dark"] .ws-color-popover {
    background: #1e1b2e !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55) !important;
}

[data-theme="dark"] .ws-color-popover span {
    color: #f1f5f9 !important;
}

[data-theme="dark"] .ws-canvas-color-btn {
    background: #181524 !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
}

[data-theme="dark"] .ws-canvas-color-btn:hover {
    border-color: #5C32E4 !important;
}

.ws-color-swatch-circle {
    outline: none;
}

.ws-color-swatch-circle:focus-visible {
    box-shadow: 0 0 0 2px #5C32E4 !important;
}

/* ==========================================================================
   DYNAMIC LUXA LOGO SVG & COMPONENT THEME ADAPTER
   - Light Mode: Black text layer visible, white text hidden
   - Dark Mode: White text layer visible, black text hidden
   - Swoosh: Always signature LUXA purple
   ========================================================================== */
.luxa-logo-svg,
.luxa-logo-component {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
}

/* Light Mode Defaults */
.luxa-logo-svg .luxa-logo-text-layer,
.luxa-logo-component .luxa-logo-text-light {
    display: block !important;
}

.luxa-logo-svg .luxa-logo-text-white-layer,
.luxa-logo-component .luxa-logo-text-dark {
    display: none !important;
}

/* Antigravity Obsidian Dark Mode Overrides */
[data-theme="dark"] .luxa-logo-svg .luxa-logo-text-layer,
:root[data-theme="dark"] .luxa-logo-svg .luxa-logo-text-layer,
body[data-theme="dark"] .luxa-logo-svg .luxa-logo-text-layer,
[data-theme="dark"] .luxa-logo-component .luxa-logo-text-light,
:root[data-theme="dark"] .luxa-logo-component .luxa-logo-text-light,
body[data-theme="dark"] .luxa-logo-component .luxa-logo-text-light {
    display: none !important;
}

[data-theme="dark"] .luxa-logo-svg .luxa-logo-text-white-layer,
:root[data-theme="dark"] .luxa-logo-svg .luxa-logo-text-white-layer,
body[data-theme="dark"] .luxa-logo-svg .luxa-logo-text-white-layer,
[data-theme="dark"] .luxa-logo-component .luxa-logo-text-dark,
:root[data-theme="dark"] .luxa-logo-component .luxa-logo-text-dark,
body[data-theme="dark"] .luxa-logo-component .luxa-logo-text-dark {
    display: block !important;
}

/* ==========================================================================
   GLOBAL BROWSER AUTOFILL DARK MODE ENGINE OVERRIDES
   Prevents browser autofill from rendering white backgrounds in Dark Mode
   ========================================================================== */
[data-theme="dark"] input:-webkit-autofill,
[data-theme="dark"] input:-webkit-autofill:hover, 
[data-theme="dark"] input:-webkit-autofill:focus, 
[data-theme="dark"] input:-webkit-autofill:active,
[data-theme="dark"] select:-webkit-autofill,
[data-theme="dark"] textarea:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 1000px #151221 inset !important;
    box-shadow: 0 0 0 1000px #151221 inset !important;
    -webkit-text-fill-color: #ffffff !important;
    caret-color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.16) !important;
    transition: background-color 5000s ease-in-out 0s;
}

[data-theme="dark"] input:-webkit-autofill:focus,
[data-theme="dark"] select:-webkit-autofill:focus,
[data-theme="dark"] textarea:-webkit-autofill:focus {
    border-color: #7c4dff !important;
    -webkit-box-shadow: 0 0 0 1000px #1c182d inset, 0 0 0 3px rgba(124, 77, 255, 0.25) !important;
    box-shadow: 0 0 0 1000px #1c182d inset, 0 0 0 3px rgba(124, 77, 255, 0.25) !important;
}














