
/* New Inline Mobile Toggles - Reinstated per User Request */
.mobile-header-btn-inline { display: none; }

/* HARD REMOVE ROCKET FROM DESKTOP (User Request: "Remove it, don't just hide it") */
/* We use display:none to remove it from the visual tree on desktop */
#headerRocketRow2_Secure, #appLauncherBtn {
    display: none !important;
}

/* Sidebar Search & Widget Integration (Declutter Point 4 & 6) */
@media (min-width: 981px) {
    /* SEARCH BAR RESTORED PER USER REQUEST */
    #headerMiddlePanel .hamburger-search-wrapper {
        display: flex !important;
    }
    /* Logo should still align properly without the search row space */
    #headerMiddlePanel .header-row1 {
        min-height: 48px !important;
        justify-content: center !important;
    }
}

@media (max-width: 980px) {
    .mobile-header-btn-inline { display: flex !important; background:transparent; border:none; padding:8px; font-size:24px; color:#333; cursor:pointer; min-width:40px; justify-content:center; align-items:center; z-index: 10005; }
    .header-row1 { justify-content: space-between !important; gap: 4px !important; padding: 0 8px !important; }
    
    /* Move Rocket Button to Bottom Right Corner AND FORCE VISIBLE ON MOBILE */
    #headerRocketRow2_Secure {
        /* DISABLED: User reported this is "out in the content area". We use #mobileToolsBtn in the flex container instead. */
        display: none !important; 
        position: absolute !important;
        bottom: 0 !important;
        right: 8px !important;
        top: auto !important;
        z-index: 10006 !important;
        visibility: hidden !important;
        opacity: 0 !important;
    }
    
    /* HARD HIDE: Crypto-Lock the panel on mobile so it cannot flash or double-open */
    /* User Request: "delete the right Gtrado Panel and panel cover" on mobile */
    #ufoControlPanel:not(.mobile-summoned),
    .ufo-right-control-panel:not(.mobile-summoned),
    #ufoControlPanel:not(.mobile-summoned) .ufo-cover-screen,
    .ufo-right-control-panel:not(.mobile-summoned) .ufo-cover-screen,
    /* ADDED: Explicitly hide the right cover elements */
    #ufoRightCover,
    .ufo-right-cover,
    .ufo-panel-cover-right,
    .right-panel-cover {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
        pointer-events: none !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* Ensure the new mobile rocket button is visible */
    #mobileToolsBtn, #mobileToolsBtnContainer {
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    /* Remove mobile-only command center/UFO icon strip path */
    #sidebarToggleBtn,
    #mobileToolsBtn,
    #mobileToolsBtnContainer,
    .ufo-header-icons-row,
    .mobile-ufo-wrapper,
    #ufoSafeContainer_Inline,
    #ufoUnifiedStrip {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
    }

    /* Keep mobile header in one clean flow and prevent overlap */
    #headerSecondRow {
        left: 0 !important;
        padding: 0 2px 8px 40px !important;
        margin-top: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .hamburger-search-wrapper {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .search-filter-container {
        min-width: 0 !important;
        max-width: 100% !important;
    }
    .header-top-bar {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 4px !important;
        padding: 2px 4px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
        position: relative !important;
        min-height: 30px !important;
        max-height: 32px !important;
    }
    .header-top-bar .top-bar-left,
    .header-top-bar .top-bar-right {
        display: flex !important;
        align-items: center !important;
        min-width: 0 !important;
        gap: 3px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
    }
    .header-top-bar .top-bar-left::-webkit-scrollbar,
    .header-top-bar .top-bar-right::-webkit-scrollbar {
        display: none !important;
        height: 0 !important;
    }
    .header-top-bar .top-bar-left {
        justify-content: flex-start !important;
        flex: 1 1 auto !important;
    }
    .header-top-bar .top-bar-right {
        justify-content: flex-end !important;
        margin-left: 0 !important;
        flex: 0 0 auto !important;
    }
    .header-top-bar .top-bar-right > span,
    .header-top-bar .cell.right,
    .header-top-bar #bookmarkWrapper {
        display: flex !important;
        align-items: center !important;
        gap: 2px !important;
        flex-wrap: nowrap !important;
        flex-shrink: 0 !important;
    }
    .header-top-bar .sep,
    .header-top-bar span.sep {
        display: none !important;
    }
    .header-top-bar .top-bar-dropdown-wrap {
        display: inline-flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }
    .header-top-bar .top-bar-left > a,
    .header-top-bar .top-bar-left .top-bar-dropdown-wrap > a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        flex: 0 0 auto !important;
        min-width: auto !important;
        min-height: 26px !important;
        max-width: none !important;
        max-height: 26px !important;
        padding: 2px 5px !important;
        margin: 0 !important;
        font-size: 11px !important;
        line-height: 1 !important;
        gap: 3px !important;
        white-space: nowrap !important;
    }
    .header-top-bar .top-bar-right .top-bar-dropdown-wrap > a {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex: 0 0 auto !important;
        min-width: 26px !important;
        min-height: 26px !important;
        max-width: 26px !important;
        max-height: 26px !important;
        padding: 2px !important;
        margin: 0 !important;
        font-size: 0 !important;
        line-height: 1 !important;
        gap: 0 !important;
    }
    .header-top-bar .top-bar-left > a i,
    .header-top-bar .top-bar-left .top-bar-dropdown-wrap > a > i {
        font-size: 12px !important;
        margin: 0 !important;
        opacity: 1 !important;
    }
    .header-top-bar .top-bar-left .top-bar-dropdown-wrap > a .fa-caret-down {
        display: inline-block !important;
        font-size: 8px !important;
        margin-left: 2px !important;
    }
    .header-top-bar .top-bar-left .top-bar-link-label {
        display: inline !important;
        font-size: 11px !important;
    }
    .header-top-bar .desktop-only-inline {
        display: none !important;
    }
    .header-top-bar .top-bar-right a[title="Open Right Sidebar"],
    .header-top-bar .top-bar-right > span {
        display: none !important;
    }
    .header-top-bar .header-icon-btn {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        min-height: 26px !important;
        max-width: 26px !important;
        max-height: 26px !important;
        padding: 0 !important;
        flex-shrink: 0 !important;
        border-radius: 8px !important;
    }
    .header-top-bar .header-icon-btn i {
        font-size: 13px !important;
    }
    /* restored top brand */
    .header-top-bar .top-bar-brand-mobile .brand-mobile-inc {
        display: none !important;
    }
    .header-top-bar .header-icon-btn .badge-count {
        top: -2px !important;
        right: -2px !important;
        min-width: 12px !important;
        height: 12px !important;
        font-size: 7px !important;
    }
}

/* DESKTOP SAFETY: Hide mobile-only buttons by default on DESKTOP ONLY */
@media (min-width: 981px) {
    #headerHamburgerRow2, 
    #mobileToolsBtnContainer,
    #mobileToolsBtn {
        display: none !important;
    }
}
