/* Global mobile optimizations for all screen views (print-safe via media query) */
@media screen {
    html,
    body {
        max-width: 100%;
        overflow-x: clip;
        -webkit-text-size-adjust: 100%;
    }

    img,
    svg,
    video,
    canvas,
    iframe {
        max-width: 100%;
        height: auto;
    }

    .table-responsive,
    .overflow-x-auto,
    .mobile-scroll-x {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-stack {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .mobile-stack > * {
        width: 100%;
    }
}

@media screen and (max-width: 1024px) {
    main,
    .container,
    .max-w-7xl,
    .max-w-6xl,
    .max-w-5xl,
    .max-w-4xl,
    .max-w-3xl,
    .max-w-2xl {
        min-width: 0;
    }

    main .flex.items-center.justify-between,
    main .flex.justify-between {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    main form .flex.gap-2,
    main form .flex.gap-3,
    main form .flex.gap-4 {
        flex-wrap: wrap;
    }

    main form .flex.gap-2 > *,
    main form .flex.gap-3 > *,
    main form .flex.gap-4 > * {
        min-width: 0;
    }
}

@media screen and (max-width: 768px) {
    input[type='text'],
    input[type='search'],
    input[type='email'],
    input[type='number'],
    input[type='password'],
    input[type='date'],
    input[type='time'],
    select,
    textarea {
        font-size: 16px;
    }

    button,
    .btn,
    a.inline-flex,
    a[role='button'] {
        min-height: 2.5rem;
    }

    main table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    main th,
    main td {
        vertical-align: middle;
    }

    .table-responsive > table {
        min-width: 640px;
    }

    #global-toast-host {
        left: 0.75rem;
        right: 0.75rem;
        top: 0.75rem;
    }
}
