.mobile-user-menu {
    position: fixed !important;
    top: 76px !important;
    right: 30px !important;
    left: auto !important;
    margin: 0 !important;
    padding: 24px !important;
    width: 320px !important;
    max-width: calc(100vw - 32px) !important;
    transform-origin: top right !important;
    z-index: 99999 !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, sans-serif;
    -webkit-tap-highlight-color: transparent;
    min-width: 800px;
    overflow-x: auto;
    overflow-y: hidden;
}

.mobile-input-group {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
    margin-bottom: 12px;
}

html.dark .mobile-input-group {
    background: rgba(40, 40, 40, 0.6);
    border-color: rgba(255, 255, 255, 0.05);
}

.mobile-list-btn {
    height: 64px !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    font-size: 18px !important;
    font-weight: 600;
    width: 100%;
    border-radius: 20px !important;
    transition: background 0.2s;
    margin-bottom: 12px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.mobile-list-btn:active {
    background-color: rgba(0, 0, 0, 0.05);
    transform: scale(0.98);
}

html.dark .mobile-list-btn:active {
    background-color: rgba(255, 255, 255, 0.1);
}

.mobile-tab-bar {
    position: fixed;
    bottom: 24px;
    left: 20px;
    right: 20px;
    height: 70px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(25px) saturate(180%);
    border-radius: 35px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255, 255, 255, 0.2);
    z-index: 900;
    padding: 0 10px;
}

html.dark .mobile-tab-bar {
    background: rgba(30, 30, 30, 0.85);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.mobile-tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    color: #8e8e93;
}

.mobile-tab-item.active {
    color: #fff;
    background: #007aff;
    transform: translateY(-10px);
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.4);
}

.mobile-tab-item i {
    font-size: 22px;
    margin-bottom: 2px;
}

.mobile-tab-item span {
    font-size: 10px;
    font-weight: 600;
}

.mobile-tab-item.active span {
    display: none;
}

.mobile-tab-item.active i {
    font-size: 26px;
    margin-bottom: 0;
}

.mobile-stat-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 16px 20px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.4);
    position: relative;
    overflow: hidden;
}

html.dark .mobile-stat-card {
    background: rgba(40, 40, 40, 0.6);
    border-color: rgba(255, 255, 255, 0.05);
}

.mobile-header-nav {
    height: 56px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 100px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 16px 16px;
}

html.dark .mobile-header-nav {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.15);
}

.mobile-resize-handle {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 24px;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 4px;
    cursor: ns-resize;
    opacity: 1;
    touch-action: none;
}

.mobile-resize-bar {
    width: 32px;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 2px;
}

html.dark .mobile-resize-bar {
    background-color: rgba(255, 255, 255, 0.2);
}

@media (max-width: 800px) and (hover: none) {
    html,
    body {
        position: fixed !important;
        width: 100%;
        height: 100%;
        height: 100dvh;
        overflow: hidden !important;
        overscroll-behavior: none;
        touch-action: none;
    }

    #app {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    body {
        min-width: 0 !important;
        overflow: hidden !important;
        overflow-x: hidden !important;
    }

    .cursor-ew-resize {
        display: none !important;
    }

    .liquid-window {
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    #sidebar {
        position: fixed !important;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0 !important;
        padding-bottom: calc(80px + env(safe-area-inset-bottom)) !important;
        z-index: 40;
        width: 100% !important;
        background: rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(30px) saturate(150%) !important;
        -webkit-backdrop-filter: blur(30px) saturate(150%) !important;
        overflow-y: auto !important;
    }

    html.dark #sidebar {
        background: rgba(30, 30, 30, 0.4) !important;
    }

    #main-content {
        position: fixed !important;
        top: 64px;
        left: 0;
        right: 0;
        bottom: 0 !important;
        padding-bottom: calc(60px + env(safe-area-inset-bottom)) !important;
        z-index: 30;
        overflow-y: auto !important;
    }

    .task-block {
        padding: 2px 4px !important;
        border-left-width: 3px !important;
    }

    .stat-card {
        padding: 8px !important;
        border-left-width: 3px !important;
    }

    .is-zooming-now .task-block {
        transition: none !important;
    }

    :root {
        --time-col-width: 40px;
    }

    .pb-safe {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .time-label-slot {
        font-size: 10px !important;
        padding-right: 4px !important;
        justify-content: center !important;
    }

    .fixed.bottom-0 {
        margin-bottom: 0;
        background-color: transparent;
    }

    html.dark .fixed.bottom-0 {
        background-color: rgba(28, 28, 30, 0.95);
    }

    #sidebar,
    #main-content {
        padding-bottom: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .mobile-user-menu {
        top: calc(50px + env(safe-area-inset-top) + 8px) !important;
        right: 16px !important;
        left: auto !important;
        transform-origin: top right !important;
        max-width: calc(100vw - 32px) !important;
        margin-top: 0 !important;
    }

    .flex-1.flex.justify-center .custom-dropdown-menu {
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        transform-origin: top center !important;
    }

    .grid-cols-7 .p-3.text-right {
        padding: 4px !important;
        text-align: center !important;
        font-size: 10px !important;
        height: 24px !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .grid-cols-7 .droppable-slot {
        height: auto !important;
        min-height: 50px !important;
        aspect-ratio: 0.5;
        padding: 2px !important;
    }

    .grid-cols-7 .text-right.mb-1 {
        text-align: center !important;
        margin-bottom: 2px !important;
    }

    .grid-cols-7 .text-sm.font-bold.w-7.h-7 {
        width: 20px !important;
        height: 20px !important;
        font-size: 12px !important;
        line-height: 20px !important;
    }

    .grid-cols-7 .space-y-1 .text-\[11px\] {
        font-size: 8px !important;
        padding: 1px 3px !important;
        height: 14px !important;
        border-radius: 2px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
    }

    .grid-cols-7 .space-y-1 .w-1\.5.h-1\.5 {
        display: none !important;
    }

    .grid-cols-7 .space-y-1 .font-mono.opacity-80 {
        display: none !important;
    }

    :root {
        --header-base-height: 50px;
        --safe-top: env(safe-area-inset-top);
        --header-total-height: calc(var(--header-base-height) + var(--safe-top));
    }

    header {
        padding-left: 16px !important;
        padding-right: 16px !important;
        height: var(--header-total-height) !important;
        padding-top: env(safe-area-inset-top) !important;
        background-color: transparent !important;
        backdrop-filter: none !important;
        border-bottom: none !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 50;
    }

    html.dark header {
        background-color: rgba(0, 0, 0, 0.3) !important;
        backdrop-filter: blur(20px) !important;
        border-bottom: none !important;
    }

    @media (max-width: 800px) {
        #sidebar,
        #main-content {
            top: var(--header-total-height) !important;
        }

        #global-loader {
            padding-top: var(--safe-top);
        }
    }
}

#app .mobile-user-menu {
    padding: 24px !important;
    position: fixed !important;
    top: calc(50px + env(safe-area-inset-top) + 12px) !important;
    right: 16px !important;
    left: auto !important;
    margin: 0 !important;
    width: 320px !important;
    max-width: calc(100vw - 32px) !important;
    transform-origin: top right !important;
    z-index: 99999 !important;
}

@media (max-width: 800px) {
    .mobile-stat-card {
        padding: 12px 14px !important;
        border-radius: 24px !important;
        margin-bottom: 6px !important;
    }

    .mobile-stat-card .font-bold.text-2xl {
        font-size: 18px !important;
        line-height: 1.2 !important;
    }

    .mobile-stat-card .font-mono.text-2xl {
        font-size: 18px !important;
    }

    .mobile-stat-card .text-\[14px\] {
        font-size: 13px !important;
        opacity: 0.7 !important;
    }

    .mobile-stat-card span.rounded-md {
        font-size: 12px !important;
        padding: 2px 6px !important;
        height: auto !important;
    }

    .mobile-stat-card button.rounded-md {
        font-size: 12px !important;
        padding: 2px 6px !important;
    }

    .mobile-stat-card .mt-2.pt-2 .p-1\.5 {
        padding: 4px 2px !important;
    }

    .mobile-stat-card .mt-2.pt-2 .text-xs {
        font-size: 11px !important;
    }
}
