@media (max-width: 1023px) {
    :root {
        --cell-height: 60px;
        --time-column-width: 50px;
    }

    .app-header {
        padding: 10px 15px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        border-bottom: 1px solid var(--color-border);
    }

    .schedule-dropdown-wrapper {
        flex: 0 0 auto;
    }

    .schedule-dropdown-btn {
        font-size: 12px;
        padding: 6px 10px;
    }

    .mobile-day-indicator {
        display: block;
        text-align: center;
        font-size: 14px;
        font-weight: 600;
        flex: 1;
        padding: 0;
        margin: 0;
        border: none;
    }

    .share-btn {
        padding: 6px;
        position: static;
        flex: 0 0 auto;
        min-width: 36px;
    }

    .share-btn .material-icons {
        font-size: 20px;
        color: #999;
    }

    .login-btn {
        padding: 6px;
        position: static;
        flex: 0 0 auto;
        min-width: 36px;
        border: none;
        background-color: transparent;
    }

    .login-btn .material-icons {
        font-size: 20px;
        color: #999;
    }

    .login-btn:hover {
        background-color: #f5f5f5;
    }

    .login-btn:hover .material-icons {
        color: #666;
    }

    .app-container {
        padding: 10px 15px;
        height: calc(100% - 50px);
        display: flex;
        flex-direction: column;
    }

    .schedule-grid {
        grid-template-columns: var(--time-column-width) 1fr;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        flex: 1;
        transition: opacity 0.4s ease-in-out;
        background-color: var(--color-background) !important;
    }

    /* Smooth fade transition during day swipe */
    .schedule-grid.swipe-transition {
        opacity: 0.3;
    }

    .grid-time-header {
        display: none !important;
    }

    .grid-day-header {
        display: none !important;
    }

    .grid-time-label {
        display: block;
        height: var(--cell-height);
        font-size: 11px;
    }

    .grid-cell {
        visibility: hidden;
        width: 0;
        min-width: 0;
        padding: 0;
        border: none;
    }

    .grid-cell.mobile-active {
        visibility: visible;
        width: auto;
        min-width: auto;
        height: var(--cell-height);
        display: flex !important;
        grid-column: 2 !important;
        border-right: 1px solid var(--color-border);
        border-bottom: 1px solid var(--color-border);
    }

    /* Hide all blocks by default on mobile */
    .schedule-block {
        display: none;
    }

    /* Only show blocks for the current mobile day */
    .schedule-block.mobile-active {
        display: flex;
        grid-column: 2 !important; /* Force all blocks to column 2 on mobile */
    }

    .block-name {
        font-size: 15px;
    }

    .block-controls {
        top: 0;
        right: 0;
    }

    .delete-btn,
    .copy-btn {
        top: 6px;
    }

    .block-btn {
        width: 26px;
        height: 26px;
        font-size: 13px;
    }

    /* Make resize handles touch-friendly on mobile - no visible background, arrows appear on hover */
    .resize-handle {
        height: 20px;
        background-color: transparent;
        bottom: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    .resize-handle-top {
        height: 20px;
        background-color: transparent;
        top: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
    }

    /* Arrow styling for resize zones - hidden by default */
    .arrow-expand-up,
    .arrow-shrink-down,
    .arrow-shrink-up,
    .arrow-expand-down {
        font-weight: bold;
        font-size: 14px;
        color: #666;
        cursor: pointer;
        user-select: none;
        transition: color 0.15s, opacity 0.15s;
        opacity: 0;
        pointer-events: none;
    }

    /* Show arrows on block hover */
    .schedule-block:hover .arrow-expand-up,
    .schedule-block:hover .arrow-shrink-down,
    .schedule-block:hover .arrow-shrink-up,
    .schedule-block:hover .arrow-expand-down {
        opacity: 1;
        pointer-events: auto;
    }

    /* Hover effect for arrows */
    .arrow-expand-up:hover,
    .arrow-shrink-down:hover,
    .arrow-shrink-up:hover,
    .arrow-expand-down:hover {
        color: #333;
    }
}
