/* =================================================================
   SMARTCEMIC GLOBAL ALIGNMENT FIX v2.1
   Full width for page content, NOT for modals/popups
   ================================================================= */

/* =================================================================
   EXCLUDE MODALS, POPUPS, DIALOGS FROM FULL WIDTH
   ================================================================= */
.modal,
.modal-dialog,
.modal-content,
.popup,
.dialog,
.toast,
.toast-container,
.notification,
.alert-popup,
.dropdown,
.dropdown-menu,
.user-dropdown,
.tooltip,
.popover,
[id*="modal"],
[id*="popup"],
[id*="dialog"],
[id*="install-prompt"],
#pwa-install-prompt,
.pwa-install-prompt,
.install-prompt,
.install-banner {
    max-width: none !important;
    width: auto !important;
    padding-left: initial !important;
    padding-right: initial !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* PWA Install Prompt specific fix */
#pwa-install-prompt,
[id*="pwa-install"],
div[style*="position: fixed"][style*="bottom"] {
    max-width: 400px !important;
    width: calc(100% - 40px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    padding: 20px 24px !important;
}

/* =================================================================
   FULL WIDTH FOR PAGE CONTENT ONLY
   ================================================================= */

/* Force page containers to full width */
.container,
main .container,
.main-container,
.content-container,
.page-container,
.app-container,
section > .container,
div.container:not(.modal-container):not(.toast-container) {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* Main element full width - NO horizontal padding (container handles it) */
main {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

/* Main direct children */
main > div:not(.modal):not(.popup):not(.toast-container),
main > section {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Page headers */
.page-header,
.page-title-row,
.title-row,
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
    max-width: 100%;
}

/* All grids and card sections */
.stats-row,
.sensor-diagnostics,
.smart-discovery-card,
.device-discovery-section,
.devices-section,
.category-tabs,
.dashboard-grid,
.wellness-grid,
.analytics-grid,
.reports-grid,
.settings-grid,
.cards-grid,
.metrics-grid,
.biomarker-grid,
.analytes-grid,
.quick-access-bar,
.search-bar-container,
.measure-grid,
.measurement-grid,
.history-grid,
.history-content,
.biomarker-categories,
.biomarker-list,
.filter-section,
.content-grid,
.two-column-grid,
.sidebar-layout {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Footer */
.footer-container-new,
.footer-enhanced,
footer .container {
    width: 100%;
    max-width: 100% !important;
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
    margin: 0 !important;
    box-sizing: border-box;
}

/* =================================================================
   MODAL & POPUP SPECIFIC STYLES
   ================================================================= */

/* Ensure modals stay centered and properly sized */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal-dialog {
    max-width: 500px;
    margin: 2rem auto;
}

.modal-content {
    width: 100%;
    max-width: 100%;
}

/* Large modals */
.modal-lg .modal-dialog {
    max-width: 800px;
}

/* Small modals */
.modal-sm .modal-dialog {
    max-width: 350px;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 350px !important;
    width: auto !important;
    z-index: 1100;
}

.toast {
    max-width: 350px !important;
    width: auto !important;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */
@media (max-width: 992px) {
    .container:not(.modal-container):not(.toast-container),
    main .container,
    main,
    .footer-container-new {
        padding-left: 1.25rem !important;
        padding-right: 1.25rem !important;
    }
}

@media (max-width: 768px) {
    .container:not(.modal-container):not(.toast-container),
    main .container,
    .footer-container-new {
        padding-left: 16px !important;
        padding-right: 1rem !important;
    }
    
    .page-header {
        flex-direction: column;
    }
    
    #pwa-install-prompt,
    [id*="pwa-install"] {
        max-width: calc(100% - 32px) !important;
        left: 16px !important;
        right: 16px !important;
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .container:not(.modal-container):not(.toast-container),
    main .container,
    main,
    .footer-container-new {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

/* global-alignment-v2.1-ux-aware */

/* =================================================================
   HEADER STYLE FIX - Softer, Blended Dark Theme
   ================================================================= */

/* Tone down the blue header to a subtle dark gradient */
.header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    position: relative;
}

/* Subtle accent line at bottom of header */
.header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        var(--norcemic-green, #2E8B57), 
        var(--smartcemic-cyan, #06B6D4), 
        var(--smartcemic-blue-light, #3B82F6)
    );
    opacity: 0.5;
}

/* Navigation links - subtle styling */
.header .nav-link {
    color: rgba(255, 255, 255, 0.75);
    transition: all 0.2s ease;
}

.header .nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.header .nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* Header brand text */
.header-title-main {
    color: #f8fafc;
}

.header-title-sub {
    color: rgba(255, 255, 255, 0.6);
}

/* Measure button in header - keep it prominent */
.header .btn-primary,
.header .btn[onclick*="measure"] {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    border: none;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.header .btn-primary:hover,
.header .btn[onclick*="measure"]:hover {
    background: linear-gradient(135deg, #16a34a, #15803d) !important;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* Theme toggle and user menu */
.header .theme-toggle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header .user-avatar,
.header .user-avatar-img {
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* header-style-fix-v1.0 */

/* =================================================================
   RESPONSIVE SIDE PADDING & VISUAL DEMARCATION
   Creates breathing room between content and screen edges
   ================================================================= */

/* Base body styling */
body {
    background: #0a0f1a;
    min-height: 100vh;
}

/* Content wrapper - add side margins on large screens */
main {
    background: linear-gradient(180deg, #0f172a 0%, #111827 100%);
    min-height: calc(100vh - 70px);
    margin-left: auto;
    margin-right: auto;
}

/* Progressive padding based on screen size */

/* Extra large screens (1920px+) - generous padding */
@media (min-width: 1920px) {
    main,
    .header,
    .health-bar,
    .ai-health-bar,
    .smart-health-bar,
    footer,
    .footer-enhanced {
        padding-left: 5rem !important;
        padding-right: 5rem !important;
    }
    
    main .container,
    .container:not(.modal-container):not(.toast-container) {
        padding-left: 5rem !important;
        padding-right: 5rem !important;
    }
}

/* Large screens (1440px - 1919px) */
@media (min-width: 1440px) and (max-width: 1919px) {
    main,
    .header,
    .health-bar,
    .ai-health-bar,
    .smart-health-bar,
    footer,
    .footer-enhanced {
        padding-left: 3.5rem !important;
        padding-right: 3.5rem !important;
    }
    
    main .container,
    .container:not(.modal-container):not(.toast-container) {
        padding-left: 3.5rem !important;
        padding-right: 3.5rem !important;
    }
}

/* Medium-large screens (1200px - 1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
    main,
    .header,
    .health-bar,
    .ai-health-bar,
    .smart-health-bar,
    footer,
    .footer-enhanced {
        padding-left: 2.5rem !important;
        padding-right: 2.5rem !important;
    }
    
    main .container,
    .container:not(.modal-container):not(.toast-container) {
        padding-left: 2.5rem !important;
        padding-right: 2.5rem !important;
    }
}

/* Medium screens (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    main,
    .header,
    .health-bar,
    .ai-health-bar,
    .smart-health-bar,
    footer,
    .footer-enhanced {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
    
    main .container,
    .container:not(.modal-container):not(.toast-container) {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    main,
    .header,
    .health-bar,
    .ai-health-bar,
    .smart-health-bar,
    footer,
    .footer-enhanced {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
    
    main .container,
    .container:not(.modal-container):not(.toast-container) {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }
}

/* Mobile (< 768px) */
@media (max-width: 767px) {
    main,
    .header,
    .health-bar,
    .ai-health-bar,
    .smart-health-bar,
    footer,
    .footer-enhanced {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    main .container,
    .container:not(.modal-container):not(.toast-container) {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Small mobile (< 480px) */
@media (max-width: 479px) {
    main,
    .header,
    .health-bar,
    .ai-health-bar,
    .smart-health-bar,
    footer,
    .footer-enhanced {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
    
    main .container,
    .container:not(.modal-container):not(.toast-container) {
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }
}

/* =================================================================
   VISUAL POLISH & SUBTLE EFFECTS
   ================================================================= */

/* Subtle side borders/glow on large screens */
@media (min-width: 1440px) {
    main {
        border-left: 1px solid rgba(59, 130, 246, 0.08);
        border-right: 1px solid rgba(59, 130, 246, 0.08);
        box-shadow: 
            inset 2px 0 20px rgba(0, 0, 0, 0.1),
            inset -2px 0 20px rgba(0, 0, 0, 0.1);
    }
}

/* Card hover improvements */
.stat-card,
.metric-card,
.device-card,
.wellness-card,
.analytics-card,
.biomarker-card,
.smart-discovery-card,
.sensor-diagnostics {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover,
.metric-card:hover,
.device-card:hover,
.wellness-card:hover,
.analytics-card:hover,
.biomarker-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Better focus states for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--smartcemic-cyan, #06B6D4);
    outline-offset: 2px;
}

/* Section spacing consistency */
.page-header {
    margin-bottom: 1.5rem;
}

.stats-row,
.sensor-diagnostics,
.smart-discovery-card,
.devices-section,
.dashboard-grid,
.wellness-grid {
    margin-bottom: 1.5rem;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Skeleton loading animation */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, 
        rgba(255,255,255,0.05) 25%, 
        rgba(255,255,255,0.1) 50%, 
        rgba(255,255,255,0.05) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

/* responsive-padding-v1.0 */

/* =================================================================
   HEADER-TO-CONTENT SPACING - MORE BREATHING ROOM
   ================================================================= */

/* Override previous spacing - add proper gap after header */
main {
    padding-top: 1.5rem !important;
    margin-top: 0.5rem !important;
}

/* Space after header before first content */
.header {
    margin-bottom: 0 !important;
}

/* First content area needs top margin */
main > .container:first-child,
main > div:first-child,
main > section:first-child {
    padding-top: 1rem !important;
    margin-top: 0 !important;
}

/* Health bar / Search bar - add vertical padding */
.health-bar,
.ai-health-bar,
.smart-health-bar,
.assistant-bar,
.search-bar-container,
.quick-search-container {
    padding-top: 1.25rem !important;
    padding-bottom: 1rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 1rem !important;
}

/* Quick access bar spacing */
.quick-access-bar,
.biomarker-quick-access,
[class*="quick-access"] {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
    margin-top: 0.75rem !important;
    margin-bottom: 1.25rem !important;
}

/* Page header spacing */
.page-header,
.page-title-section {
    padding-top: 0.75rem !important;
    margin-top: 0.5rem !important;
    margin-bottom: 1.5rem !important;
}

/* header-content-spacing-v1.1 */

/* =================================================================
   HEADER HEIGHT ENHANCEMENT - Subtle Increase
   ================================================================= */

/* Increase header vertical padding for more presence */
.header {
    padding-top: 0.875rem !important;
    padding-bottom: 0.875rem !important;
    min-height: 70px !important;
}

/* Adjust header brand area */
.header-brand {
    padding: 0.25rem 0;
}

/* Navigation links - slightly more padding */
.header .nav-link {
    padding: 0.625rem 0.875rem !important;
}

/* Header actions spacing */
.header-actions {
    gap: 0.75rem;
}

/* Measure button in header - slightly larger */
.header .btn-primary,
.header .btn[onclick*="measure"] {
    padding: 0.625rem 1.25rem !important;
    font-size: 0.9rem;
}

/* User avatar - slightly larger */
.header .user-avatar,
.header .user-avatar-img {
    width: 38px !important;
    height: 38px !important;
}

/* Logo size */
.header-logo {
    width: 44px !important;
    height: 44px !important;
}

/* header-height-v1.0 */

/* =================================================================
   PUBLIC PAGES HEADER FIX (index, login, register, etc.)
   ================================================================= */

/* Public header - softer styling */
.public-header,
.landing-header,
.navbar,
nav.navbar,
header.navbar,
[class*="public"] .header,
[class*="landing"] .header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%) !important;
    border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
    min-height: 65px !important;
}

/* Public header accent line */
.public-header::after,
.landing-header::after,
nav.navbar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        #2E8B57, 
        #06B6D4, 
        #3B82F6
    );
    opacity: 0.5;
}

/* Public nav links */
.public-header .nav-link,
.landing-header .nav-link,
.navbar .nav-link,
.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.75) !important;
    transition: all 0.2s ease;
    padding: 0.5rem 0.875rem !important;
}

.public-header .nav-link:hover,
.landing-header .nav-link:hover,
.navbar .nav-link:hover,
.navbar-nav .nav-link:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
}

/* =================================================================
   PUBLIC PAGES RESPONSIVE PADDING
   ================================================================= */

/* Landing page hero section */
.hero,
.hero-section,
[class*="hero"] {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Public page containers */
.public-container,
.landing-container,
.auth-container,
.login-container,
.register-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Progressive padding for public pages */
@media (min-width: 1920px) {
    .public-header,
    .landing-header,
    .navbar,
    .hero,
    .hero-section,
    section,
    .public-container,
    .landing-container {
        padding-left: 5rem !important;
        padding-right: 5rem !important;
    }
}

@media (min-width: 1440px) and (max-width: 1919px) {
    .public-header,
    .landing-header,
    .navbar,
    .hero,
    .hero-section,
    section,
    .public-container,
    .landing-container {
        padding-left: 3.5rem !important;
        padding-right: 3.5rem !important;
    }
}

@media (min-width: 1200px) and (max-width: 1439px) {
    .public-header,
    .landing-header,
    .navbar,
    .hero,
    .hero-section,
    section,
    .public-container,
    .landing-container {
        padding-left: 2.5rem !important;
        padding-right: 2.5rem !important;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .public-header,
    .landing-header,
    .navbar,
    .hero,
    .hero-section,
    section,
    .public-container,
    .landing-container {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

/* =================================================================
   AUTH PAGES (Login, Register, Forgot Password)
   ================================================================= */

/* Auth form container - keep centered, not full width */
.auth-card,
.login-card,
.register-card,
.auth-form-container,
.login-form,
.register-form,
form[action*="login"],
form[action*="register"],
.card.auth,
[class*="auth-"] .card {
    max-width: 500px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 2rem !important;
}

/* Auth page wrapper */
.auth-wrapper,
.login-wrapper,
.register-wrapper,
.auth-page,
[class*="auth-page"] {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 70px);
    padding: 2rem 1.5rem;
}

/* =================================================================
   PWA INSTALL PROMPT - UNIVERSAL FIX
   ================================================================= */

/* Target all possible PWA prompt variations */
#pwa-install-prompt,
[id*="pwa-install"],
[id*="install-prompt"],
.pwa-install-prompt,
.install-prompt,
.install-banner,
div[style*="position: fixed"][style*="bottom"]:not(.toast-container):not(.accessibility-widget) {
    max-width: 420px !important;
    width: calc(100% - 40px) !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    padding: 16px 20px !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4) !important;
}

/* PWA prompt on mobile */
@media (max-width: 480px) {
    #pwa-install-prompt,
    [id*="pwa-install"],
    .pwa-install-prompt,
    .install-prompt {
        max-width: calc(100% - 24px) !important;
        left: 12px !important;
        right: 12px !important;
        transform: none !important;
    }
}

/* =================================================================
   LANDING PAGE SPECIFIC FIXES
   ================================================================= */

/* Hero section full width but with padding */
.hero-content,
.hero-text,
.hero-cta {
    max-width: 100%;
}

/* Feature sections */
.features-section,
.benefits-section,
.pricing-section,
.testimonials-section,
.faq-section,
[class*="section"] {
    width: 100%;
    box-sizing: border-box;
}

/* Cards in public pages should not be full width */
.feature-card,
.benefit-card,
.pricing-card,
.testimonial-card {
    max-width: none;
    width: auto;
}

/* =================================================================
   FOOTER CONSISTENCY
   ================================================================= */

/* All footers - consistent styling */
footer,
.footer,
.footer-enhanced,
.public-footer,
.landing-footer {
    background: linear-gradient(135deg, #0a0f1a 0%, #111827 100%) !important;
    border-top: 1px solid rgba(59, 130, 246, 0.1);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

/* Footer responsive padding */
@media (min-width: 1440px) {
    footer,
    .footer,
    .footer-enhanced {
        padding-left: 3.5rem !important;
        padding-right: 3.5rem !important;
    }
}

@media (min-width: 1920px) {
    footer,
    .footer,
    .footer-enhanced {
        padding-left: 5rem !important;
        padding-right: 5rem !important;
    }
}

/* Footer container */
.footer-container,
.footer-container-new,
footer .container {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
}

/* =================================================================
   ACCESSIBILITY WIDGET - Keep in corner
   ================================================================= */

/* Accessibility widget toggle button only - DO NOT target all buttons inside widget */
.acc-widget-toggle {
    /* Styles controlled by accessibility-widget.css */
}

/* universal-fixes-v1.0 */

/* =================================================================
   OVERRIDE: Fix ALL Fixed Position Elements
   ================================================================= */

/* Reset all fixed position elements that aren't main layout */
div[style*="position: fixed"],
div[style*="position:fixed"] {
    max-width: initial;
    width: auto;
    padding-left: initial;
    padding-right: initial;
}

/* PWA Install Prompt - Very specific targeting */
#pwa-install-prompt {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    max-width: 400px !important;
    width: calc(100% - 40px) !important;
    padding: 16px 20px !important;
    margin: 0 !important;
    z-index: 9999 !important;
}

/* Any element with install-related IDs or classes */
[id*="install"],
[class*="install-prompt"],
[class*="pwa-prompt"],
[class*="app-install"] {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    max-width: 400px !important;
    width: calc(100% - 40px) !important;
    padding: 16px 20px !important;
    margin: 0 !important;
}

/* API Connected / Status indicators */
.api-status,
.connection-status,
.status-indicator,
[class*="api-connected"],
[class*="connection-indicator"],
.api-badge,
.status-badge-fixed {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    right: auto !important;
    transform: none !important;
    max-width: 200px !important;
    width: auto !important;
    padding: 8px 16px !important;
    margin: 0 !important;
    font-size: 0.8rem !important;
    z-index: 100 !important;
}

/* Toast notifications - keep small */
.toast,
.toast-notification,
[class*="toast"] {
    max-width: 350px !important;
    width: auto !important;
    padding: 12px 16px !important;
}

.toast-container {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    transform: none !important;
    max-width: 350px !important;
    width: auto !important;
    z-index: 9998 !important;
}

/* Floating action button */
.fab,
.floating-action-button,
[class*="fab-"],
.measure-fab {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    left: auto !important;
    transform: none !important;
    max-width: 64px !important;
    width: 64px !important;
    height: 64px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    z-index: 900 !important;
}

/* Accessibility widget - keep in corner */
/* Accessibility widget - styles in accessibility-widget.css */
.acc-widget {
    /* position controlled by accessibility-widget.css */
}
.a11y-widget {
    position: fixed !important;
    bottom: 20px !important;
    left: 20px !important;
    right: auto !important;
    transform: none !important;
    max-width: 56px !important;
    width: 56px !important;
    height: 56px !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 999 !important;
}

/* Dropdown menus */
.dropdown-menu,
.user-dropdown,
[class*="dropdown"] {
    max-width: 280px !important;
    width: auto !important;
    min-width: 160px !important;
}

/* Tooltips */
.tooltip,
[role="tooltip"],
[class*="tooltip"] {
    max-width: 250px !important;
    width: auto !important;
    padding: 8px 12px !important;
}

/* Modal overlays - full screen for background */
.modal-overlay,
.modal-backdrop,
.overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
}

/* Modal dialogs - centered, not full width */
.modal-dialog,
.modal-content,
.modal-body,
.dialog-content {
    max-width: 500px !important;
    width: calc(100% - 40px) !important;
    margin: 2rem auto !important;
    padding: 1.5rem !important;
}

/* Large modals */
.modal-lg .modal-dialog,
.modal-large .modal-dialog {
    max-width: 800px !important;
}

/* Small modals */
.modal-sm .modal-dialog,
.modal-small .modal-dialog {
    max-width: 350px !important;
}

/* Scan modal, device modal - medium size */
#scanModal .modal-dialog,
#deviceModal .modal-dialog,
#addDeviceModal .modal-dialog {
    max-width: 600px !important;
}

/* Mobile adjustments for popups */
@media (max-width: 480px) {
    #pwa-install-prompt,
    [id*="install"],
    [class*="install-prompt"] {
        left: 12px !important;
        right: 12px !important;
        transform: none !important;
        max-width: calc(100% - 24px) !important;
        width: calc(100% - 24px) !important;
    }
    
    .modal-dialog,
    .modal-content {
        max-width: calc(100% - 24px) !important;
        width: calc(100% - 24px) !important;
        margin: 1rem auto !important;
    }
    
    .toast-container {
        right: 12px !important;
        left: 12px !important;
        max-width: calc(100% - 24px) !important;
    }
}

/* popup-fixes-v2.0 */

/* =================================================================
   OVERRIDE CORRECTIONS - Don't break index.html styles
   ================================================================= */

/* API Status - keep original positioning from index.html */
.api-status {
    position: fixed !important;
    bottom: 1.5rem !important;
    left: 1.5rem !important;
    right: auto !important;
    transform: none !important;
    max-width: 180px !important;
    width: auto !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.8rem !important;
    z-index: 100 !important;
    background: rgba(15, 23, 42, 0.95) !important;
    border: 1px solid rgba(59, 130, 246, 0.2) !important;
    border-radius: 12px !important;
    color: #e2e8f0 !important;
}

/* API status dot */
.api-status-dot {
    width: 8px !important;
    height: 8px !important;
}

/* PWA Install Prompt - ensure it stays centered and small */
.pwa-install-prompt,
#pwaInstallPrompt {
    position: fixed !important;
    bottom: 20px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    max-width: 400px !important;
    width: 90% !important;
    z-index: 10000 !important;
}

/* Ensure sections in index.html are NOT full width for certain elements */
body.landing-page section,
body.public-page section,
#pricing .container,
#features .container,
#biomarkers .container,
#faq .container,
#how-it-works .container {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* But ensure proper side padding */
body.landing-page section,
body.public-page section {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

@media (min-width: 1440px) {
    body.landing-page section,
    body.public-page section {
        padding-left: 3.5rem;
        padding-right: 3.5rem;
    }
}

@media (min-width: 1920px) {
    body.landing-page section,
    body.public-page section {
        padding-left: 5rem;
        padding-right: 5rem;
    }
}

/* override-corrections-v1.0 */

/* =================================================================
   FIX: Font Awesome Brand Icons (.fab) Conflict
   .fab is used by Font Awesome for brand icons - don't override!
   ================================================================= */

/* Reset Font Awesome brand icons to normal behavior */
i.fab,
.fa-brands,
a > i.fab,
.social-icon-new i,
.footer-social-new i,
[class*="social"] i.fab {
    position: static !important;
    bottom: auto !important;
    right: auto !important;
    left: auto !important;
    transform: none !important;
    max-width: none !important;
    width: auto !important;
    height: auto !important;
    padding: 0 !important;
    border-radius: 0 !important;
    z-index: auto !important;
    display: inline-block !important;
}

/* Social icons in footer - ensure they display */
.footer-social-new {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap;
}

.social-icon-new {
    width: 38px !important;
    height: 38px !important;
    border-radius: 8px !important;
    background: rgba(255,255,255,0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: rgba(255,255,255,0.65) !important;
    font-size: 1rem !important;
    text-decoration: none !important;
    position: static !important;
    transform: none !important;
}

.social-icon-new:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a) !important;
    color: #ffffff !important;
}

/* Rename floating action button selector to avoid .fab conflict */
.floating-action-btn,
.measure-floating-btn,
button.fab-button,
[data-fab="true"] {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    width: 64px !important;
    height: 64px !important;
    border-radius: 50% !important;
    z-index: 900 !important;
}

/* fab-icon-fix-v1.0 */

/* =================================================================
   COMPREHENSIVE RESPONSIVE DESIGN SYSTEM v1.0
   Mobile-first approach for all screen sizes
   ================================================================= */

/* =================================================================
   BREAKPOINT REFERENCE:
   - Mobile:       < 480px
   - Mobile L:     480px - 767px
   - Tablet:       768px - 991px
   - Desktop:      992px - 1199px
   - Desktop L:    1200px - 1439px
   - Desktop XL:   1440px+
   ================================================================= */

/* =================================================================
   1. TYPOGRAPHY - Responsive Font Sizes
   ================================================================= */

html {
    font-size: 16px;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.25rem, 3vw, 2rem);
    line-height: 1.25;
}

h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.5rem);
    line-height: 1.3;
}

h4, h5, h6 {
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.4;
}

p, li, span, a {
    font-size: clamp(0.875rem, 1.5vw, 1rem);
    line-height: 1.6;
}

/* =================================================================
   2. GRID SYSTEMS - Responsive Layouts
   ================================================================= */

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
}

/* Dashboard Grid */
.dashboard-grid,
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .dashboard-grid,
    .main-grid {
        grid-template-columns: 1fr 350px;
    }
}

@media (min-width: 1200px) {
    .dashboard-grid,
    .main-grid {
        grid-template-columns: 1fr 380px;
    }
}

/* Device Grid */
.devices-grid,
.device-grid,
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

@media (min-width: 768px) {
    .devices-grid,
    .device-grid,
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 1.25rem;
    }
}

@media (min-width: 1200px) {
    .devices-grid,
    .device-grid,
    .cards-grid {
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 1.5rem;
    }
}

/* Biomarker/Analyte Grid */
.biomarker-grid,
.analyte-grid,
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .biomarker-grid,
    .analyte-grid,
    .metrics-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
}

/* Health Platform Integration Grid */
.integration-grid,
.platform-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .integration-grid,
    .platform-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 1rem;
    }
}

/* =================================================================
   3. CARDS - Responsive Sizing
   ================================================================= */

.card,
.stat-card,
.device-card,
.metric-card,
.wellness-card,
.analytics-card {
    padding: 1rem;
    border-radius: 12px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .card,
    .stat-card,
    .device-card,
    .metric-card,
    .wellness-card,
    .analytics-card {
        padding: 1.25rem;
        border-radius: 14px;
    }
}

@media (min-width: 1200px) {
    .card,
    .stat-card,
    .device-card,
    .metric-card,
    .wellness-card,
    .analytics-card {
        padding: 1.5rem;
        border-radius: 16px;
    }
}

/* Large feature cards */
.smart-discovery-card,
.sensor-diagnostics,
.glucose-card,
.main-card {
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .smart-discovery-card,
    .sensor-diagnostics,
    .glucose-card,
    .main-card {
        padding: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .smart-discovery-card,
    .sensor-diagnostics,
    .glucose-card,
    .main-card {
        padding: 2rem;
    }
}

/* =================================================================
   4. NAVIGATION - Responsive Header
   ================================================================= */

/* Hide desktop nav on mobile */
.header-nav {
    display: none;
}

@media (min-width: 992px) {
    .header-nav {
        display: flex;
        gap: 0.25rem;
    }
    
    .mobile-toggle {
        display: none !important;
    }
}

/* Mobile menu toggle */
.mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
}

/* Header responsive padding */
.header {
    padding: 0.5rem 1rem;
}

@media (min-width: 768px) {
    .header {
        padding: 0.625rem 1.5rem;
    }
}

@media (min-width: 1200px) {
    .header {
        padding: 0.75rem 2rem;
    }
}

/* Logo responsive sizing */
.header-logo {
    width: 36px;
    height: 36px;
}

@media (min-width: 768px) {
    .header-logo {
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 1200px) {
    .header-logo {
        width: 44px;
        height: 44px;
    }
}

/* Brand text responsive */
.header-title-main {
    font-size: 0.95rem;
}

.header-title-sub {
    font-size: 0.65rem;
}

@media (min-width: 768px) {
    .header-title-main {
        font-size: 1.05rem;
    }
    
    .header-title-sub {
        font-size: 0.7rem;
    }
}

/* =================================================================
   5. BUTTONS - Responsive Sizing
   ================================================================= */

.btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .btn {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
        border-radius: 10px;
    }
}

@media (min-width: 1200px) {
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Button groups stack on mobile */
.btn-group,
.button-group,
.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

@media (max-width: 767px) {
    .page-actions {
        width: 100%;
    }
    
    .page-actions .btn {
        flex: 1 1 auto;
        min-width: 120px;
        justify-content: center;
    }
}

/* =================================================================
   6. PAGE HEADER - Responsive Layout
   ================================================================= */

.page-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .page-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.page-title h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .page-title h1 {
        font-size: 1.75rem;
    }
}

@media (min-width: 1200px) {
    .page-title h1 {
        font-size: 2rem;
    }
}

/* =================================================================
   7. FORMS - Responsive Inputs
   ================================================================= */

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 10px;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    input,
    select,
    textarea {
        padding: 0.875rem 1.25rem;
    }
}

/* Form layouts */
.form-row,
.form-group-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media (min-width: 768px) {
    .form-row,
    .form-group-row {
        flex-direction: row;
    }
    
    .form-row > *,
    .form-group-row > * {
        flex: 1;
    }
}

/* Search inputs */
.search-input,
.search-bar input,
[type="search"] {
    width: 100%;
    max-width: 100%;
}

@media (min-width: 768px) {
    .search-input,
    .search-bar input,
    [type="search"] {
        max-width: 400px;
    }
}

/* =================================================================
   8. TABLES - Responsive Tables
   ================================================================= */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 600px;
}

@media (max-width: 767px) {
    table {
        font-size: 0.85rem;
    }
    
    th, td {
        padding: 0.5rem;
    }
}

/* =================================================================
   9. MODALS - Responsive Dialogs
   ================================================================= */

.modal-dialog {
    margin: 1rem;
    max-width: calc(100% - 2rem);
}

@media (min-width: 576px) {
    .modal-dialog {
        margin: 2rem auto;
        max-width: 500px;
    }
}

@media (min-width: 992px) {
    .modal-lg .modal-dialog {
        max-width: 800px;
    }
}

.modal-content {
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .modal-content {
        padding: 1.5rem;
    }
}

/* =================================================================
   10. TABS & CATEGORY BUTTONS - Responsive
   ================================================================= */

.category-tabs,
.tab-list,
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 0.5rem;
}

.category-tabs::-webkit-scrollbar,
.tab-list::-webkit-scrollbar,
.filter-tabs::-webkit-scrollbar {
    display: none;
}

.category-tab,
.tab-btn,
.filter-tab {
    flex-shrink: 0;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .category-tab,
    .tab-btn,
    .filter-tab {
        padding: 0.625rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* =================================================================
   11. SENSOR DIAGNOSTICS - Responsive Grid
   ================================================================= */

.sensor-diag-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .sensor-diag-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }
}

.sensor-diag-item {
    padding: 0.75rem;
    text-align: center;
}

@media (min-width: 768px) {
    .sensor-diag-item {
        padding: 1rem;
    }
}

/* =================================================================
   12. QUICK ACCESS BAR - Responsive
   ================================================================= */

.quick-access-bar,
.biomarker-quick-access {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
    scrollbar-width: none;
}

.quick-access-bar::-webkit-scrollbar {
    display: none;
}

.quick-access-btn,
.biomarker-pill {
    flex-shrink: 0;
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
    white-space: nowrap;
}

@media (min-width: 768px) {
    .quick-access-btn,
    .biomarker-pill {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

/* =================================================================
   13. FOOTER - Responsive Layout
   ================================================================= */

.footer-main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .footer-main {
        grid-template-columns: 1.5fr repeat(2, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 992px) {
    .footer-main {
        grid-template-columns: 1.5fr repeat(4, 1fr);
        gap: 2.5rem;
    }
}

.footer-brand-new {
    max-width: 100%;
}

@media (min-width: 768px) {
    .footer-brand-new {
        max-width: 300px;
    }
}

.footer-social-new {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.footer-bottom-new {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom-new {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
}

.footer-badges-new {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

@media (min-width: 768px) {
    .footer-badges-new {
        justify-content: flex-end;
    }
}

/* =================================================================
   14. GLUCOSE/MEASUREMENT DISPLAY - Responsive
   ================================================================= */

.glucose-value,
.measurement-value,
.big-number {
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 700;
    line-height: 1;
}

.glucose-unit,
.measurement-unit {
    font-size: clamp(1rem, 3vw, 1.5rem);
}

/* =================================================================
   15. WELLNESS SCORE RING - Responsive
   ================================================================= */

.wellness-ring,
.score-ring {
    width: 80px;
    height: 80px;
}

@media (min-width: 768px) {
    .wellness-ring,
    .score-ring {
        width: 100px;
        height: 100px;
    }
}

@media (min-width: 1200px) {
    .wellness-ring,
    .score-ring {
        width: 120px;
        height: 120px;
    }
}

/* =================================================================
   16. TWO-COLUMN LAYOUTS - Responsive
   ================================================================= */

.two-column,
.split-layout,
.content-with-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 992px) {
    .two-column,
    .split-layout,
    .content-with-sidebar {
        flex-direction: row;
    }
    
    .two-column > *:first-child,
    .split-layout > *:first-child,
    .content-with-sidebar > .main-content {
        flex: 1;
    }
    
    .two-column > *:last-child,
    .split-layout > *:last-child,
    .content-with-sidebar > .sidebar {
        width: 350px;
        flex-shrink: 0;
    }
}

/* =================================================================
   17. LANDING PAGE HERO - Responsive
   ================================================================= */

/* Landing page hero - exclude index.html which has custom 2-column grid */
.hero-section:not(#hero),
body.public-page .hero {
    padding: 3rem 1rem;
    text-align: center;
}

/* Index.html hero keeps its grid layout */
#hero.hero {
    text-align: left;
}

@media (min-width: 768px) {
    .hero-section,
    .hero {
        padding: 4rem 2rem;
        text-align: left;
    }
}

@media (min-width: 1200px) {
    .hero-section,
    .hero {
        padding: 5rem 3rem;
    }
}

/* Hero content - exclude index.html which uses grid */
.public-page .hero-content,
.hero-section .hero-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 992px) {
    .hero-content {
        flex-direction: row;
        align-items: center;
    }
    
    .hero-text {
        flex: 1;
    }
    
    .hero-image,
    .hero-visual {
        flex: 1;
    }
}

.hero-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

@media (min-width: 480px) {
    .hero-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

/* =================================================================
   18. PRICING CARDS - Responsive
   ================================================================= */

.pricing-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .pricing-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .pricing-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.pricing-card {
    padding: 1.5rem;
}

@media (min-width: 768px) {
    .pricing-card {
        padding: 2rem;
    }
}

/* =================================================================
   19. HIDE/SHOW ELEMENTS - Responsive Utilities
   ================================================================= */

.hide-mobile {
    display: none !important;
}

@media (min-width: 768px) {
    .hide-mobile {
        display: initial !important;
    }
    
    .hide-desktop {
        display: none !important;
    }
}

.hide-tablet-down {
    display: none !important;
}

@media (min-width: 992px) {
    .hide-tablet-down {
        display: initial !important;
    }
}

/* =================================================================
   20. SPACING UTILITIES - Responsive
   ================================================================= */

.section-spacing {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

@media (min-width: 768px) {
    .section-spacing {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

@media (min-width: 1200px) {
    .section-spacing {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}

/* Gap utilities */
.gap-responsive {
    gap: 1rem;
}

@media (min-width: 768px) {
    .gap-responsive {
        gap: 1.5rem;
    }
}

@media (min-width: 1200px) {
    .gap-responsive {
        gap: 2rem;
    }
}

/* responsive-design-system-v1.0 */

/* =================================================================
   UNIVERSAL MOBILE MENU STYLES
   Ensures all mobile menus work across all templates
   ================================================================= */

/* =================================================================
   1. MOBILE TOGGLE BUTTON - Universal
   ================================================================= */

.mobile-toggle,
.mobile-menu-btn,
.nav-mobile-toggle,
.hamburger-btn,
.menu-toggle,
[class*="mobile-toggle"],
[class*="menu-btn"] {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1001;
}

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

/* Hide on desktop */
@media (min-width: 992px) {
    .mobile-toggle,
    .mobile-menu-btn,
    .nav-mobile-toggle,
    .hamburger-btn,
    .menu-toggle {
        display: none !important;
    }
}

/* =================================================================
   2. MOBILE MENU PANEL - Universal
   ================================================================= */

/* Mobile menu base - respects template-specific visibility control */
.mobile-menu,
.nav-mobile-menu,
.mobile-nav,
.mobile-sidebar,
#mobileMenu {
    position: fixed;
    /* top: 0; - Let templates set this */
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain;
    /* NOTE: Templates control visibility and positioning */
}

/* Active state - slide in */
/* Active state - supports both display and transform approaches */
.mobile-menu.active,
.nav-mobile-menu.active,
.mobile-nav.active,
.mobile-sidebar.active,
#mobileMenu.active {
    display: flex !important;
    flex-direction: column !important;
    transform: translateX(0);
    visibility: visible !important;
    opacity: 1 !important;
}

/* Alternative: slide from right */
.mobile-menu.slide-right,
.nav-mobile-menu.slide-right {
    left: auto;
    right: 0;
    transform: translateX(100%);
}

.mobile-menu.slide-right.active,
.nav-mobile-menu.slide-right.active {
    transform: translateX(0);
}

/* =================================================================
   3. MOBILE MENU CONTENT
   ================================================================= */

.mobile-menu-content,
.mobile-section,
.mobile-nav-content {
    padding: 1rem 1.5rem;
}

.mobile-section {
    margin-bottom: 1.5rem;
}

.mobile-section-header {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* =================================================================
   4. MOBILE MENU LINKS
   ================================================================= */

.mobile-menu a,
.nav-mobile-menu a,
.mobile-nav a,
.mobile-grid-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.875rem 1rem;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.mobile-menu a:hover,
.nav-mobile-menu a:hover,
.mobile-nav a:hover,
.mobile-grid-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.mobile-menu a.active,
.nav-mobile-menu a.active,
.mobile-nav a.active,
.mobile-grid-link.active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(6, 182, 212, 0.15));
    color: #22c55e;
    border-left: 3px solid #22c55e;
}

.mobile-menu a i,
.nav-mobile-menu a i,
.mobile-grid-link i {
    width: 20px;
    font-size: 1rem;
    text-align: center;
    opacity: 0.8;
}

/* =================================================================
   5. MOBILE GRID LAYOUT (App Base Style)
   ================================================================= */

.mobile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 400px) {
    .mobile-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.mobile-grid-link {
    flex-direction: column;
    padding: 1rem 0.5rem;
    text-align: center;
    gap: 0.5rem;
    font-size: 0.75rem;
}

.mobile-grid-link i {
    font-size: 1.25rem;
    width: auto;
}

.mobile-grid-link span {
    font-size: 0.7rem;
}

/* =================================================================
   6. MOBILE MENU CLOSE BUTTON
   ================================================================= */

.mobile-close,
.mobile-menu-close,
.nav-mobile-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1002;
}

/* =================================================================
   7. MOBILE MENU OVERLAY
   ================================================================= */

.mobile-overlay,
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-overlay.active,
.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* =================================================================
   8. BODY LOCK WHEN MENU OPEN
   ================================================================= */

body.menu-open,
body.mobile-menu-open {
    /* All scroll-blocking removed - menu handles its own scroll */
    /* overflow: hidden; - REMOVED: blocks menu scrolling */
    /* position: fixed; - REMOVED: prevents menu scrolling */
    /* width: 100%; - REMOVED */
}

/* =================================================================
   9. PUBLIC PAGES MOBILE NAV (Landing, Login, Register)
   ================================================================= */

.nav-mobile-toggle {
    position: relative;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.nav-mobile-toggle .hamburger,
.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    position: relative;
    transition: all 0.3s ease;
}

.nav-mobile-toggle .hamburger::before,
.nav-mobile-toggle .hamburger::after,
.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: white;
    transition: all 0.3s ease;
}

.nav-mobile-toggle .hamburger::before,
.hamburger::before {
    top: -8px;
}

.nav-mobile-toggle .hamburger::after,
.hamburger::after {
    bottom: -8px;
}

/* Hamburger animation - X shape */
.nav-mobile-toggle.active .hamburger,
.hamburger.active {
    background: transparent;
}

.nav-mobile-toggle.active .hamburger::before,
.hamburger.active::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-mobile-toggle.active .hamburger::after,
.hamburger.active::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* =================================================================
   10. THEME TOGGLE IN MOBILE MENU
   ================================================================= */

.mobile-theme-toggle {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* =================================================================
   11. HIDE DESKTOP NAV ON MOBILE
   ================================================================= */

@media (max-width: 991px) {
    .header-nav,
    .nav-desktop,
    .desktop-nav,
    nav.desktop-only {
        display: none !important;
    }
    
    .mobile-toggle,
    .mobile-menu-btn,
    .nav-mobile-toggle {
        display: flex !important;
    }
}

/* mobile-menu-universal-v1.0 */

/* Fix duplicate chat widget - hide left positioned chat */
.chat-bubble[style*="left"],
div[style*="position: fixed"][style*="left: 20px"][style*="bottom"] {
    display: none !important;
}

/* Ensure main chat is on the right */
.sc-chatbot-trigger,
#scChatbotTrigger,
#smartcemic-chatbot-container {
    position: fixed !important;
    right: 20px !important;
    bottom: 20px !important;
    left: auto !important;
}

/* ============================================
   UNIFIED PADDING FIX - Build 40177 v16
   Ensure header and content have MATCHING horizontal padding
   Remove padding from main to avoid stacking with child containers
   ============================================ */

/* Reset ALL main padding first */
main {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ALL BREAKPOINTS: Same padding for header and content containers */
.header,
.measure-container,
div.connection-status-bar,
.analyte-bar {
    padding-left: 24px !important;
    padding-right: 24px !important;
}

@media (min-width: 1200px) {
    .header,
    .measure-container,
    div.connection-status-bar,
    .analyte-bar {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

@media (min-width: 1440px) {
    .header,
    .measure-container,
    div.connection-status-bar,
    .analyte-bar {
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }
}

@media (min-width: 1920px) {
    .header,
    .measure-container,
    div.connection-status-bar,
    .analyte-bar {
        padding-left: 4rem !important;
        padding-right: 4rem !important;
    }
}

@media (max-width: 768px) {
    .header,
    .measure-container,
    div.connection-status-bar,
    .analyte-bar {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

@media (max-width: 480px) {
    .header,
    .measure-container,
    div.connection-status-bar,
    .analyte-bar {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* unified-padding-v16 */

/* ============================================
   MEASURE PAGE LAYOUT SYMMETRY FIX - Build 40177 v18
   ============================================ */

/* Page header - side by side layout */
.page-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 24px !important;
    margin-bottom: 1.5rem !important;
    flex-wrap: wrap !important;
}

.page-header h1 {
    margin-bottom: 0.25rem !important;
}

.page-header p {
    margin: 0 !important;
}

/* Device status bar */
.device-status-bar {
    display: flex !important;
    align-items: center !important;
    gap: 16px !important;
    background: rgba(30, 41, 59, 0.6) !important;
    padding: 12px 20px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    flex-wrap: wrap !important;
    margin-bottom: 1rem !important;
}

/* Sensor tabs */
.sensor-tabs {
    display: flex !important;
    gap: 12px !important;
    margin-bottom: 1.5rem !important;
    flex-wrap: wrap !important;
    align-items: center !important;
}

.sensor-tab {
    padding: 10px 18px !important;
    border-radius: 10px !important;
    font-size: 0.9rem !important;
}

/* Measure grid */
.measure-grid {
    display: grid !important;
    grid-template-columns: 1fr 380px !important;
    gap: 24px !important;
}

/* TABLET 1024px */
@media (max-width: 1024px) {
    .measure-grid {
        grid-template-columns: 1fr 320px !important;
        gap: 20px !important;
    }
}

/* MOBILE 768px */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 16px !important;
    }
    
    .device-status-bar {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
        padding: 14px 16px !important;
    }
    
    .sensor-tabs {
        justify-content: center !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    
    .sensor-tab {
        padding: 8px 14px !important;
        font-size: 0.8rem !important;
    }
    
    .measure-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    .measure-cat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

/* SMALL MOBILE 480px */
@media (max-width: 480px) {
    .page-header h1 {
        font-size: 1.5rem !important;
    }
    
    .sensor-tab {
        padding: 6px 10px !important;
        font-size: 0.75rem !important;
    }
    
    .measure-cat-grid {
        grid-template-columns: 1fr !important;
    }
}

/* measure-layout-symmetry-v18 */

/* ============================================
   PAGE HEADER TEXT IMPROVEMENTS - Build 40177 v19
   ============================================ */

/* Make subtitle smaller and lighter */
.page-header p {
    font-size: 0.9rem !important;
    color: rgba(148, 163, 184, 0.8) !important;
    max-width: 300px !important;
}

/* Hide subtitle on mobile */
@media (max-width: 768px) {
    .page-header p {
        display: none !important;
    }
}

/* page-header-text-v19 */

/* ============================================
   PLATFORM BADGE FIXES - Build 40177 v20-v22
   ============================================ */

#platform-badge,
.platform-badge {
    opacity: 0.6 !important;
    font-size: 0.7rem !important;
    padding: 3px 8px !important;
    display: inline-flex !important;
    width: auto !important;
    max-width: fit-content !important;
}

@media (max-width: 768px) {
    #platform-badge,
    .platform-badge {
        opacity: 0.4 !important;
        font-size: 0.65rem !important;
        padding: 2px 6px !important;
        margin: 8px auto 0 auto !important;
    }
}

/* platform-badge-v22 */

/* ============================================
   QUICK ACCESS BAR REDESIGN - Build 40177 v29
   Label on top, everything centered below
   ============================================ */

/* Analyte bar - stacked, centered layout */
.analyte-bar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 14px 24px !important;
    background: var(--bg-card) !important;
    border-bottom: 1px solid var(--border-color) !important;
}

/* Label - small, subtle, centered at top */
.analyte-bar-label {
    font-size: 0.75rem !important;
    color: rgba(148, 163, 184, 0.6) !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* Pills and button container - all in one row, centered */
#quickAnalyteBar {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    max-width: 100% !important;
}

/* Biomarkers button - inline with pills */
.analyte-bar-right {
    display: flex !important;
    align-items: center !important;
}

.more-analytes-btn {
    padding: 8px 16px !important;
    border-radius: 25px !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
}

/* MOBILE < 768px */
@media (max-width: 767px) {
    .analyte-bar {
        padding: 12px 16px !important;
        gap: 8px !important;
    }
    
    .analyte-bar-label {
        font-size: 0.7rem !important;
    }
    
    #quickAnalyteBar {
        gap: 6px !important;
    }
    
    .analyte-pill {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
    }
    
    .more-analytes-btn {
        padding: 6px 12px !important;
        font-size: 0.75rem !important;
    }
}

/* SMALL MOBILE < 480px */
@media (max-width: 479px) {
    .analyte-bar {
        padding: 10px 12px !important;
    }
    
    .analyte-pill {
        padding: 5px 10px !important;
        font-size: 0.7rem !important;
    }
    
    .more-analytes-btn {
        padding: 5px 10px !important;
        font-size: 0.7rem !important;
    }
}

/* quick-access-redesign-v29 */

/* ============================================
   HORIZONTAL BADGES FINAL FIX - Build 40177 v34
   All 5 status badges in single horizontal row
   ============================================ */

/* Desktop & Tablet: horizontal row */
div.connection-status-bar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 10px 60px !important; /* Extra right padding for FAB */
}

/* Flatten status-section wrappers */
div.connection-status-bar > div.status-section {
    display: contents !important;
}

/* Individual badge items - compact */
div.connection-status-bar .status-item,
div.connection-status-bar button.sync-btn {
    display: inline-flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    margin: 0 !important;
    white-space: nowrap !important;
    padding: 5px 10px !important;
    font-size: 0.75rem !important;
    gap: 5px !important;
}

div.connection-status-bar .status-item i,
div.connection-status-bar button.sync-btn i {
    font-size: 0.8rem !important;
}

/* Mobile: even more compact */
@media screen and (max-width: 768px) {
    div.connection-status-bar {
        gap: 6px !important;
        padding: 8px 16px !important;
        flex-wrap: wrap !important;
        overflow-x: visible !important;
        justify-content: center !important;
    }
    
    div.connection-status-bar .status-item,
    div.connection-status-bar button.sync-btn {
        padding: 4px 8px !important;
        font-size: 0.68rem !important;
        gap: 4px !important;
    }
    
    div.connection-status-bar .status-item i,
    div.connection-status-bar button.sync-btn i {
        font-size: 0.7rem !important;
    }
    
    /* Hide status dot on mobile to save space */
    div.connection-status-bar .status-dot {
        width: 6px !important;
        height: 6px !important;
    }
}

@media screen and (max-width: 400px) {
    div.connection-status-bar {
        gap: 4px !important;
        padding: 6px 12px !important;
    }
    
    div.connection-status-bar .status-item,
    div.connection-status-bar button.sync-btn {
        padding: 3px 6px !important;
        font-size: 0.6rem !important;
    }
}

/* horizontal-badges-final-v34 */


/* ============================================
   MOBILE LAYOUT REFINEMENTS - Build 40177 v37
   1. Taller navbar
   2. Status bar spacing
   3. Unified padding symmetry
   ============================================ */

/* 1. TALLER NAVBAR */
@media (max-width: 768px) {
    .header {
        min-height: 70px !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
    
    .header-logo {
        width: 40px !important;
        height: 40px !important;
    }
}

/* 2. STATUS BAR - More spacing from header */
div.connection-status-bar {
    margin-top: 8px !important;
}

@media (max-width: 768px) {
    div.connection-status-bar {
        margin-top: 0 !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
}

/* 3. UNIFIED MOBILE PADDING - All sections same padding */
@media (max-width: 768px) {
    .header,
    div.connection-status-bar,
    .analyte-bar {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    
    /* Cards inside container need no extra margin */
    main .container .card,
    main .container .hero-card {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Grid-2col on mobile is single column */
    .grid-2col {
        padding: 0 !important;
    }
    
    .main-col, .side-col {
        padding: 0 !important;
    }
}

@media (max-width: 480px) {
    .header,
    div.connection-status-bar,
    .analyte-bar {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
}

/* mobile-layout-refinements-v37 */
/* ============================================
   DASHBOARD SYMMETRY FIX - v45
   Container padding matches header/status bar
   ============================================ */
main .container,
main > .container,
div.container:not(.modal-container):not(.toast-container) {
    padding-left: 24px !important;
    padding-right: 24px !important;
}

@media (min-width: 1200px) {
    main .container,
    main > .container,
    div.container:not(.modal-container):not(.toast-container) {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
    }
}

@media (min-width: 1440px) {
    main .container,
    main > .container,
    div.container:not(.modal-container):not(.toast-container) {
        padding-left: 3rem !important;
        padding-right: 3rem !important;
    }
}

@media (max-width: 768px) {
    main .container,
    main > .container,
    div.container:not(.modal-container):not(.toast-container) {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }
}

@media (max-width: 480px) {
    main .container,
    main > .container,
    div.container:not(.modal-container):not(.toast-container) {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}
