/* Hide scroll dots by default (shown only on mobile) */
.scroll-dots {
    display: none;
}

/* ============================================
   DARK MODE CUSTOMIZATIONS
   ============================================ */

/* Remove chat gradient - solid black background */
[data-theme="dark"] .chat-container,
[data-theme="dark"] #chatbox,
[data-theme="dark"] .chat-area,
[data-theme="dark"] .main-chat {
    background: #000000 !important;
    background-image: none !important;
}

/* Logo colors in username */
[data-theme="dark"] .message.assistant .logo-loan {
    color: #2563eb !important;
}

[data-theme="dark"] .message.assistant .logo-space {
    color: #f97316 !important;
}

/* Remove light backgrounds from list items (fixes white boxes) */
[data-theme="dark"] .message-content div,
[data-theme="dark"] .message-content ol,
[data-theme="dark"] .message-content ul,
[data-theme="dark"] .message-content li,
[data-theme="dark"] .message-content > * {
    background: transparent !important;
    background-image: none !important;
}

/* Navy text selection */
html[data-theme="dark"] body *::selection {
    background: #1e3a5f !important;
    color: #ffffff !important;
}

html[data-theme="dark"] body *::-moz-selection {
    background: #1e3a5f !important;
    color: #ffffff !important;
}

/* Logo swap for dark mode - all screen sizes including desktop */
[data-theme="dark"] .sidebar-logo {
    content: url("/static/loanspace.ai-logo-dark.png") !important;
    width: 100% !important;
    height: auto !important;
}

/* ============================================
   INPUT BOX - SUBTLE STYLING (ALL DEVICES)
   ============================================ */

/* LIGHT MODE: Light gray background with dark text (scoped to chat input area) */
#userInput,
body #userInput,
.input-area #userInput,
.input-area input[type="text"],
.input-area textarea {
    border: 1px solid #e5e7eb !important; /* Light gray border */
    box-shadow: none !important;
    outline: none !important;
    background: #f3f4f6 !important; /* Gray background */
    background-color: #f3f4f6 !important;
    border-radius: 8px !important; /* Rounded corners */
    color: #1f2937 !important; /* Dark text color */
}

/* Light mode placeholder */
#userInput::placeholder,
.input-area input::placeholder,
.input-area textarea::placeholder {
    color: #9ca3af !important; /* Medium gray for placeholder */
}

/* DARK MODE: Sidebar-matching background with white text (scoped to chat input area) */
[data-theme="dark"] #userInput,
[data-theme="dark"] body #userInput,
[data-theme="dark"] .input-area #userInput,
[data-theme="dark"] .input-area input[type="text"],
[data-theme="dark"] .input-area textarea {
    border: 1px solid #374151 !important; /* Darker border for dark mode */
    background: #1f2937 !important; /* Dark gray - matches sidebar */
    background-color: #1f2937 !important;
    color: #ffffff !important; /* White text */
}

/* Dark mode placeholder */
[data-theme="dark"] #userInput::placeholder,
[data-theme="dark"] .input-area input::placeholder,
[data-theme="dark"] .input-area textarea::placeholder {
    color: #9ca3af !important; /* Medium gray placeholder */
}

/* Keep input area container clean */
.input-area {
    border: none !important;
    border-top: none !important;
    box-shadow: none !important;
    /* Removed background: transparent - was conflicting with mobile solid backgrounds */
}

/* ============================================
   DARK MODE TOGGLE BUTTON
   ============================================ */

.dark-mode-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-bg-secondary);
    border: 2px solid var(--color-border-primary);
    color: var(--color-text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.dark-mode-toggle:hover {
    background: var(--color-bg-hover);
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.dark-mode-toggle:active {
    transform: scale(0.95);
}

/* ============================================
   THINKING ORB - ALL DEVICES
   ============================================ */

/* Container — pill shape with orb + text */
.thinking,
.message.thinking {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 14px 22px 14px 18px !important;
    background: #f8f9fb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    width: auto !important;
    max-width: 220px !important;
    height: auto !important;
    min-height: 52px !important;
    max-height: 64px !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: visible !important;
    font-size: 14px !important;
    color: #4b5563 !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
    white-space: nowrap !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06) !important;
}

/* The orb — 18px, orange brand color, with glow. Placed AFTER text via ::after + order */
.thinking::after,
.message.thinking::after {
    content: '' !important;
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    min-height: 8px !important;
    background: radial-gradient(circle at 36% 30%, #ffb074, #ff8c42 55%, #d96b20) !important;
    border-radius: 50% !important;
    animation: orbPulse 2s ease-in-out infinite !important;
    display: block !important;
    flex-shrink: 0 !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    transform: scale(1);
    box-shadow: 0 0 6px 2px rgba(255, 140, 66, 0.35),
                0 0 2px 1px rgba(255, 140, 66, 0.5);
    z-index: 2 !important;
    order: 2 !important;
    border: none !important;
    padding: 0 !important;
}

/* Hide ::before — not needed */
.thinking::before,
.message.thinking::before {
    content: none !important;
    display: none !important;
}

@keyframes orbPulse {
    0%, 100% {
        box-shadow: 0 0 6px 2px rgba(255, 140, 66, 0.35),
                    0 0 2px 1px rgba(255, 140, 66, 0.5);
        transform: scale(1);
        opacity: 0.85;
    }
    50% {
        box-shadow: 0 0 18px 8px rgba(255, 140, 66, 0.6),
                    0 0 6px 3px rgba(255, 140, 66, 0.8);
        transform: scale(1.8);
        opacity: 1;
    }
}

/* Dark Mode */
[data-theme="dark"] .thinking,
[data-theme="dark"] .message.thinking {
    background: #1f2937 !important;
    border-color: #374151 !important;
    color: #9ca3af !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .thinking::after,
[data-theme="dark"] .message.thinking::after {
    background: radial-gradient(circle at 36% 30%, #ffc799, #ff9d5c 55%, #e88040) !important;
    box-shadow: 0 0 12px 4px rgba(255, 157, 92, 0.5),
                0 0 3px 1px rgba(255, 157, 92, 0.7);
}

/* NUCLEAR HIDE - Kill the old .spinner element and text */
.thinking .spinner,
.message.thinking .spinner,
.thinking span,
.message.thinking span {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    position: absolute !important;
    pointer-events: none !important;
    animation: none !important;
}

/* Also target legacy selectors in case they're used elsewhere */
.thinking-indicator,
.message .spinner,
.message-content .spinner,
.loading-spinner,
#thinkingSpinner,
.thinking-spinner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 14px 22px 14px 18px !important;
    background: #f8f9fb !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    width: auto !important;
    max-width: 200px !important;
    height: auto !important;
    min-height: 48px !important;
    box-sizing: border-box !important;
    position: relative !important;
    overflow: visible !important;
}

.thinking-indicator::after,
.message .spinner::after,
.message-content .spinner::after,
.loading-spinner::after,
#thinkingSpinner::after {
    content: '' !important;
    width: 18px !important;
    height: 18px !important;
    background: radial-gradient(circle at 36% 30%, #ffb074, #ff8c42 55%, #d96b20) !important;
    border-radius: 50% !important;
    animation: orbPulse 3s ease-in-out infinite !important;
    display: block !important;
    box-shadow: 0 0 10px 3px rgba(255, 140, 66, 0.4),
                0 0 3px 1px rgba(255, 140, 66, 0.6) !important;
}

/* Hide children of legacy selectors */
.thinking-indicator *:not(.thinking-text),
.message .spinner *:not(.thinking-text),
.message-content .spinner *:not(.thinking-text),
.loading-spinner *:not(.thinking-text),
#thinkingSpinner *:not(.thinking-text) {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* Protect button spinners from chat spinner overrides */
.btn-calculate .spinner {
    display: none !important;
    background: transparent !important;
    padding: 0 !important;
    width: 20px !important;
    height: 20px !important;
    max-width: 20px !important;
    border: 2px solid rgba(255,255,255,0.3) !important;
    border-top-color: white !important;
    border-radius: 50% !important;
    animation: spin 0.8s linear infinite !important;
    gap: 0 !important;
}
.btn-calculate .spinner::after {
    display: none !important;
    content: none !important;
}
.btn-calculate.loading .spinner {
    display: block !important;
}
.btn-calculate.loading .btn-text {
    display: none !important;
}

/* ============================================
   TABLET OPTIMIZATIONS (768px - 1024px)
   ============================================ */

@media (min-width: 768px) and (max-width: 1024px) {
    /* Keep mobile header on tablets */
    .mobile-header {
        display: flex !important;
        height: 70px !important; /* Slightly taller for better proportions */
        padding: 12px 20px !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        margin: 0 !important; /* Remove any top margin */
        z-index: 1000 !important; /* Stay above scrolling content */
        background: var(--bg-primary, #ffffff) !important; /* Solid background so content doesn't show through */
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important; /* Subtle shadow for depth */
    }

    /* Dark mode tablet header - match body background (#000000) */
    [data-theme="dark"] .mobile-header,
    [data-theme="dark"] body .mobile-header,
    html[data-theme="dark"] .mobile-header,
    html[data-theme="dark"] body .mobile-header {
        background: #000000 !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4) !important;
    }
    
    .mobile-logo-img {
        height: 45px !important; /* Bigger logo to fill header space */
    }

    /* Dark mode: swap tablet logo to black background version */
    [data-theme="dark"] .mobile-logo-img {
        content: url("/static/loanspace.ai-logo-mobile-dark.png") !important;
        background: #000000 !important;
        background-color: #000000 !important;
    }

    /* Dark mode toggle on tablet - pill style to match other buttons */
    .input-area .dark-mode-toggle,
    .input-area #darkModeToggle,
    .dark-mode-toggle {
        position: static !important;
        top: auto !important;
        bottom: auto !important;
        right: auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        height: auto !important;
        border-radius: 50px !important;
        box-shadow: none !important;
        margin: 0 !important;
    }
    
    /* FORCE SHOW full desktop welcome banner AND feature cards on tablets */
    /* Must override style-polish.css which hides these at max-width: 1024px */
    .welcome-banner,
    .welcome-hero,
    .welcome-title,
    .welcome-subtitle,
    .welcome-cta,
    .features-grid,
    .feature-cards,
    .feature-card-modern,
    .feature-card,
    .feature-icon-wrapper,
    .feature-icon,
    .feature-title,
    .feature-description {
        display: block !important; /* Override any hiding rules */
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important; /* Override height: 0 */
        overflow: visible !important; /* Override overflow: hidden */
    }
    
    .features-grid {
        display: grid !important; /* Grid layout for cards - not block! */
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 20px !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Add padding between header and welcome message */
    .welcome-banner {
        margin-top: 20px !important; /* Space below header */
    }
    
    /* Adjust body padding - less top space, account for fixed header */
    body {
        padding-top: 70px !important; /* Match header height exactly - no extra space */
        margin-top: 0 !important; /* Remove any top margin */
    }
    
    /* Keep input area at bottom */
    .input-area {
        min-height: 150px !important;
    }
    
    body {
        padding-bottom: 170px !important;
    }
    
    /* Thinking spinner positioning for tablets */
    .thinking,
    .message.thinking {
        margin-top: 90px !important; /* Clear mobile header */
        position: relative !important;
        z-index: 50 !important;
    }
}

/* ============================================
   MOBILE OPTIMIZATIONS (phones only, up to 767px)
   ============================================ */

@media (max-width: 767px) { /* Changed from 1024px to 767px - MOBILE ONLY */
    /* CRITICAL: Reset html only (not html body to avoid specificity conflict) */
    html {
        margin: 0 !important;
        padding: 0 !important;
    }
    
    body {
        margin: 0 !important;
        padding: 85px 24px 176px 12px !important; /* Bottom matches fixed input area height (~164px + buffer) */
        max-width: 100vw !important;
        overflow-x: hidden !important;
        overflow-y: auto !important; /* Enable scrolling */
        -webkit-overflow-scrolling: touch !important; /* Smooth momentum scrolling on iOS */
        min-height: auto !important; /* Remove any min-height */
        height: auto !important; /* Remove fixed height */
    }
    
    /* FORCE .mobile-header to absolute top of viewport (NOT sticky!) */
    .mobile-header,
    body .mobile-header,
    html body .mobile-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        background: var(--bg-primary, #ffffff) !important;
        padding: 8px 24px 8px 12px !important; /* Reduced bottom padding to 8px (was 16px) */
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    [data-theme="dark"] .mobile-header,
    [data-theme="dark"] body .mobile-header {
        background: #000000 !important;
    }
    
    /* Remove ALL top spacing from mobile-header children */
    .mobile-header,
    .mobile-header *,
    .mobile-header > *,
    .mobile-header div,
    .mobile-header button {
        margin-top: 0 !important;
    }
    
    /* Main content - add top padding to ensure it clears header */
    .main-content,
    body .main-content,
    html body .main-content {
        padding-top: 0px !important; /* Minimized to maximize chat space */
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-top: 0 !important;
        max-width: 100vw !important;
        overflow-x: hidden !important; /* Prevent horizontal scroll */
        overflow-y: auto !important; /* Enable vertical scrolling */
        -webkit-overflow-scrolling: touch !important; /* Smooth momentum scrolling on iOS */
        min-height: auto !important; /* Remove any min-height */
        height: auto !important; /* Remove fixed height */
    }
    
    /* Chat container - no extra spacing */
    /* Chat container - no extra padding/margin + smooth iOS scrolling */
    .chat-container,
    body .chat-container,
    html body .chat-container,
    .main-content .chat-container {
        margin-top: 0 !important;
        padding-top: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: 100vw !important;
        overflow-x: hidden !important; /* Prevent horizontal scroll */
        overflow-y: auto !important; /* Enable vertical scrolling */
        -webkit-overflow-scrolling: touch !important; /* Smooth momentum scrolling on iOS */
        min-height: auto !important; /* Remove any min-height */
        height: auto !important; /* Remove fixed height */
    }
    
    /* Chatbox - clean spacing with side padding */
    #chatbox,
    body #chatbox,
    html body #chatbox,
    .main-content #chatbox,
    .chat-container #chatbox {
        padding-top: 4px !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
        padding-bottom: 20px !important; /* Increased from 10px to 20px for better spacing */
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        -webkit-overflow-scrolling: touch !important; /* Smooth momentum scrolling on iOS */
        min-height: auto !important; /* Remove any min-height */
        height: auto !important; /* Remove fixed height */
    }
    
    /* Add extra margin to first message in chatbox */
    #chatbox > *:first-child,
    #chatbox .message:first-child,
    #chatbox > div:first-child {
        margin-top: 4px !important; /* Minimized to maximize chat space */
    }
    
    /* First message - no extra top margin */
    .message:first-child,
    #chatbox .message:first-child {
        margin-top: 0 !important;
    }
    
    /* Input area - anchor to bottom of screen with solid background */
    .input-area {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        background: #ffffff !important;
        background-color: #ffffff !important; /* Explicit for iOS */
        padding: 12px 12px 12px 12px !important;
        padding-bottom: 56px !important; /* Chrome/Android: clears ~56px browser toolbar */
        margin: 0 !important;
        box-sizing: border-box !important;
        border-top: none !important;
        overflow: visible !important; /* Ensure buttons are not cut off */
        display: flex !important;
        flex-direction: column !important;
        /* iOS Safari specific fixes */
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        -webkit-transform: translateZ(0) !important; /* Force GPU rendering */
        transform: translateZ(0) !important;
        isolation: isolate !important; /* Create new stacking context */
    }

    /* iOS-only override: JS adds .ios-device to <html> on iOS devices.
       Safari/Chrome-iOS exclude the browser toolbar from viewport, so only
       the home indicator (safe-area-inset-bottom ~34px) needs clearance. */
    html.ios-device .input-area,
    html.ios-device [data-theme="dark"] .input-area {
        padding-bottom: max(16px, env(safe-area-inset-bottom, 16px)) !important;
    }
    
    /* Add solid background layer using pseudo-element for extra coverage */
    .input-area::before {
        content: "" !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: #ffffff !important;
        z-index: -1 !important;
    }
    
    /* Dark mode input area - solid black background */
    [data-theme="dark"] .input-area {
        background: #000000 !important;
        background-color: #000000 !important; /* Explicit for iOS */
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1000 !important;
        border-top: none !important;
        padding: 12px 12px 12px 12px !important;
        padding-bottom: 56px !important; /* Chrome/Android: clears ~56px browser toolbar */
        overflow: visible !important; /* Ensure buttons are not cut off */
        display: flex !important;
        flex-direction: column !important;
        /* iOS Safari specific fixes */
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        -webkit-transform: translateZ(0) !important;
        transform: translateZ(0) !important;
        isolation: isolate !important;
    }
    
    /* Dark mode pseudo-element background */
    [data-theme="dark"] .input-area::before {
        content: "" !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: #000000 !important;
        z-index: -1 !important;
    }
    
    /* Orange Pulsing Dot Spinner - Mobile-Specific Positioning */
    .thinking-indicator,
    .spinner,
    .loading-spinner,
    #thinkingSpinner,
    .thinking-spinner {
        margin-top: 90px !important; /* Clear fixed mobile header */
        position: relative !important;
        z-index: 50 !important;
    }
    
    /* Input box on mobile */
    #userInput,
    #input,
    .input-area #userInput,
    .input-area #input,
    .input-area input[type="text"],
    .input-area textarea {
        height: 60px !important; /* 2 rows: (22px line-height × 2) + 16px padding */
        min-height: 60px !important;
        max-height: 60px !important;
        width: calc(100% - 20px) !important; /* Narrower - 20px total margin */
        max-width: calc(100% - 20px) !important;
        margin-left: 10px !important; /* Center with margins */
        margin-right: 10px !important;
        padding: 8px 12px !important;
        line-height: 22px !important;
        font-size: 16px !important; /* 16px prevents iOS zoom */
        box-sizing: border-box !important;
    }

    /* Smaller placeholder on mobile so it doesn't get cut off */
    .input-area textarea::placeholder,
    .input-area #input::placeholder {
        font-size: 14px !important;
        line-height: 20px !important;
    }
    
    /* Dark mode toggle in input area - pill style to match other buttons */
    .input-area .dark-mode-toggle,
    .dark-mode-toggle {
        position: static !important;
        margin: 0 !important;
        width: auto !important;
        height: auto !important;
        display: inline-flex !important;
        vertical-align: middle !important;
        border-radius: 50px !important;
        box-shadow: none !important;
        top: auto !important;
        right: auto !important;
        left: auto !important;
    }
    
    /* Prevent horizontal scroll + enable smooth iOS scrolling */
    body, html {
        overflow-x: hidden !important;
        max-width: 100vw !important;
        -webkit-overflow-scrolling: touch !important; /* Smooth momentum scrolling on iOS */
        touch-action: pan-y !important; /* Allow vertical scrolling, prevent gesture conflicts */
    }
    
    /* Position Login/Register below rate widget on mobile/tablet */
    .sidebar,
    .sidebar-content {
        display: flex !important;
        flex-direction: column !important;
    }
    
    .sidebar-logo {
        order: 1 !important; /* Logo first */
    }
    
    .rate-widget {
        order: 2 !important; /* Rate widget second */
        border-bottom: none !important; /* Remove white line below */
        margin-bottom: 0 !important;
        padding-bottom: 12px !important;
    }
    
    .sidebar-footer {
        order: 3 !important; /* Login/Register third (after rate widget) */
        border-top: none !important; /* Remove white line above */
        padding-top: 0 !important;
        margin-top: 0 !important;
    }
    
    /* Everything else comes after */
    .sidebar-item,
    .sidebar-section {
        order: 4 !important;
    }

    /* Center the action buttons on mobile */
    .button-group {
        justify-content: center !important;
    }

    /* Smaller buttons on mobile */
    #sendButton {
        padding: 10px 18px !important;
        font-size: 14px !important;
        gap: 6px !important;
    }

    .upload-button,
    #speechButton,
    #darkModeToggle {
        padding: 10px 13px !important;
        font-size: 15px !important;
    }

    /* ---- Compact welcome text so cards are visible ---- */
    .welcome-banner {
        padding: 12px 14px 4px 14px !important;
        margin: 0 10px 10px 10px !important;
    }

    .welcome-hero {
        margin-bottom: 4px !important;
    }

    .welcome-title,
    h1.welcome-title {
        font-size: 17px !important;
        font-weight: 700 !important;
        line-height: 1.25 !important;
        margin-bottom: 0 !important;
    }

    /* Hide subtitle on mobile — saves ~60px of height */
    .welcome-subtitle {
        display: none !important;
    }

    /* ---- Mobile feature cards: horizontal scroll strip ---- */
    .welcome-banner {
        position: relative !important;
    }

    .features-grid {
        display: grid !important;
        visibility: visible !important;
        height: auto !important;
        opacity: 1 !important;
        overflow: visible !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        margin: 14px 0 0 0 !important;
        padding: 4px 4px 12px 4px !important;
        -webkit-mask-image: none !important;
        mask-image: none !important;
    }

    .features-grid::-webkit-scrollbar {
        display: none !important;
    }

    .feature-card-modern,
    .feature-card {
        display: flex !important;
        visibility: visible !important;
        height: auto !important;
        overflow: visible !important;
        opacity: 1 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex-shrink: 1 !important;
        min-width: unset !important;
        max-width: unset !important;
        width: 100% !important;
        padding: 12px 10px !important;
        text-align: center !important;
        border-radius: 14px !important;
        border: 1.5px solid rgba(74, 144, 226, 0.15) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06) !important;
        background: var(--white, #ffffff) !important;
    }

    .feature-card-modern .feature-icon-wrapper,
    .feature-card .feature-icon-wrapper {
        display: flex !important;
        margin-bottom: 6px !important;
    }

    .feature-card-modern .feature-icon,
    .feature-card .feature-icon {
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
    }

    .feature-card-modern .feature-icon i,
    .feature-card .feature-icon i {
        font-size: 16px !important;
    }

    .feature-card-modern .feature-title,
    .feature-card .feature-title {
        font-size: 13px !important;
        font-weight: 700 !important;
        line-height: 1.3 !important;
        margin: 0 !important;
    }

    /* Hide descriptions on mobile cards — title + icon is enough */
    .feature-card-modern .feature-description,
    .feature-card .feature-description {
        display: none !important;
    }

    /* Scroll indicator dots below feature cards */
    .scroll-dots {
        display: flex !important;
        justify-content: center !important;
        gap: 6px !important;
        padding: 6px 0 2px 0 !important;
    }

    .scroll-dots .dot {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: rgba(0, 0, 0, 0.15);
        transition: background 0.3s ease, transform 0.3s ease;
    }

    .scroll-dots .dot.active {
        background: rgba(74, 144, 226, 0.8);
        transform: scale(1.3);
    }

    [data-theme="dark"] .scroll-dots .dot {
        background: rgba(255, 255, 255, 0.2);
    }

    [data-theme="dark"] .scroll-dots .dot.active {
        background: rgba(74, 144, 226, 0.9);
    }

    /* Dark mode: swap mobile logo to black-background version */
    [data-theme="dark"] .mobile-logo-img {
        content: url("/static/loanspace.ai-logo-mobile-dark.png") !important;
        background: #000000 !important;
        background-color: #000000 !important;
    }
}

/* ============================================
   LIGHT-MODE-ONLY PAGES OVERRIDE
   Pages that don't support dark mode use body.light-mode-only
   to force white header & light logo at all breakpoints.
   ============================================ */
[data-theme="dark"] .light-mode-only .mobile-header,
[data-theme="dark"] body.light-mode-only .mobile-header,
html[data-theme="dark"] .light-mode-only .mobile-header,
html[data-theme="dark"] body.light-mode-only .mobile-header {
    background: #ffffff !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
}

[data-theme="dark"] .light-mode-only .mobile-logo-img,
html[data-theme="dark"] .light-mode-only .mobile-logo-img,
html[data-theme="dark"] body.light-mode-only .mobile-logo-img {
    content: none !important;
    background: transparent !important;
    background-color: transparent !important;
}

[data-theme="dark"] .light-mode-only .mobile-menu-btn span,
html[data-theme="dark"] body.light-mode-only .mobile-menu-btn span {
    background: #1e293b !important;
}

[data-theme="dark"] .light-mode-only .mobile-rate-label,
[data-theme="dark"] .light-mode-only .mobile-rate-value,
[data-theme="dark"] .light-mode-only .mobile-rate-divider,
html[data-theme="dark"] body.light-mode-only .mobile-rate-label,
html[data-theme="dark"] body.light-mode-only .mobile-rate-value,
html[data-theme="dark"] body.light-mode-only .mobile-rate-divider {
    color: #1e293b !important;
}

/* Also override sidebar on light-mode-only pages */
[data-theme="dark"] .light-mode-only .sidebar,
html[data-theme="dark"] body.light-mode-only .sidebar {
    background: var(--bg-primary, #ffffff) !important;
    color: #1e293b !important;
}

[data-theme="dark"] .light-mode-only .sidebar-logo,
html[data-theme="dark"] body.light-mode-only .sidebar-logo {
    content: none !important;
}
