/* Touch tablets retain the existing phone and mouse/trackpad layouts. */
@media screen and (min-width: 768px) and (pointer: coarse) {
    #auth-section .btn,
    #auth-section .nav-link,
    #auth-section .form-control,
    #dashboard-section .btn,
    #dashboard-section .nav-link,
    #dashboard-section .form-control,
    #dashboard-section .form-select,
    .modal .btn,
    .modal .form-control,
    .modal .form-select,
    .booking-mode-toggle button,
    .rs-slot {
        min-height: 44px;
    }

    #auth-section .btn,
    #dashboard-section .btn,
    .modal .btn,
    .modal .btn-close {
        min-width: 44px;
    }

    .modal .btn-close {
        width: 44px;
        height: 44px;
        padding: 12px;
        box-sizing: border-box;
        flex-shrink: 0;
    }

    .sidebar .nav-link {
        display: flex;
        align-items: center;
    }

    .sidebar .nav-link,
    .clickable-slot,
    .rs-slot,
    .ops-open {
        touch-action: manipulation;
    }

    .calendar-grid {
        width: 100%;
        min-width: 0;
        gap: 6px;
    }

    .calendar-day {
        min-width: 0;
        min-height: 128px;
        padding: 5px;
    }

    .slot-badge {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 44px;
        padding: 5px 3px;
        font-size: 13px;
        line-height: 1.35;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .clickable-slot:hover {
        transform: none;
    }

    .ops-action-grid,
    .ops-slots,
    .ops-booking-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media screen and (min-width: 768px) and (max-width: 1024px) and (pointer: coarse) {
    .sidebar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px 16px;
        padding: 12px 16px;
    }

    .sidebar h5 {
        grid-column: 1;
        grid-row: 1;
        margin: 0 !important;
    }

    .sidebar-user,
    .sidebar hr,
    #sidebar-venue .text-center,
    #sidebar-venue p:first-of-type {
        display: none;
    }

    #sidebar-venue {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
        margin: 0 !important;
    }

    #sidebar-venue-name {
        flex: 0 1 40%;
        min-width: 0;
    }

    #sidebar-venue-select {
        flex: 1;
        width: 0;
        min-width: 160px;
        margin-top: 0 !important;
    }

    .sidebar > .d-flex.gap-2 {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: center;
        margin: 0;
        padding: 0;
    }

    .sidebar nav {
        grid-column: 1 / -1;
        grid-row: 3;
        min-width: 0;
        margin: 0;
        padding-bottom: 4px;
    }

    .sidebar .nav-link {
        padding-inline: 12px;
    }

    #section-calendar > .d-flex {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center !important;
    }
}

@media screen and (min-width: 1025px) and (pointer: coarse) {
    .sidebar {
        padding: 16px;
    }

    .sidebar-user,
    #sidebar-venue {
        margin-bottom: 8px !important;
    }

    #sidebar-venue-logo {
        max-width: 56px !important;
        max-height: 56px !important;
    }

    .sidebar hr {
        margin-block: 12px;
    }

    .main-content {
        padding: 24px;
    }
}
