/* MOBILE FAB (Bottom Right) */
.mobile-fab {
    display: none; position: fixed; bottom: 25px; right: 25px; width: 56px; height: 56px;
    border-radius: 50%; background: linear-gradient(135deg, var(--accent-start), var(--accent-end));
    color: white; border: none; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6); z-index: 9990;
    cursor: pointer; align-items: center; justify-content: center; font-size: 1.8rem;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
}
.mobile-fab:active { transform: scale(0.9); }

/* NEW: Hide FAB when any modal is open */
body.modal-open .mobile-fab {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* MENU BACKDROP */
body.menu-open::after {
    content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9980; opacity: 0; animation: fadeInOverlay 0.3s forwards; pointer-events: none;
}
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }

/* DRAG HANDLE */
.mobile-menu-handle { display: none; width: 100%; height: 25px; justify-content: center; align-items: center; cursor: pointer; margin: 0; }
.mobile-menu-handle::after { content: ''; width: 40px; height: 5px; background: #444; border-radius: 10px; }

/* MEDIA QUERIES */
@media (max-width: 768px) {
    /* Page Adjustments */
    .page { padding: 0 15px 100px 15px; margin-top: 10px; }
    .db-grid, .guide-grid { grid-template-columns: 1fr; }
    .header-toggle-strip, #sticky-sentinel { display: none !important; }
    
    /* Force FAB display on mobile only */
    .mobile-fab { display: flex !important; }
    .mobile-menu-handle { display: flex; }
    
    /* 
       Removed old conflicting mobile layout.
       The Sidebar Drawer and Horizontal Top-Bar are now 
       handled correctly in base.css media queries.
    */

    .page { padding: 0 15px 100px 15px; margin-top: 10px; }
    .db-grid, .guide-grid { grid-template-columns: 1fr; }
    
    /* Mobile Toggles */
    .nav-toggle-label { display: flex; justify-content: space-between; padding: 15px; margin: 0; background: rgba(0,0,0,0.4); border: 1px solid #333; font-size: 0.9rem; }
    .mobile-switch-visual { position: relative; width: 40px; height: 20px; background: #333; border-radius: 20px; transition: 0.3s; }
    .mobile-switch-visual::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: 0.3s; }
    input[type="checkbox"]:checked ~ .mobile-switch-visual { background: var(--success); }
    input[type="checkbox"]:checked ~ .mobile-switch-visual::after { transform: translateX(20px); }
}