/* Camada responsiva global - Recarga TV */
html {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

*, *::before, *::after {
    box-sizing: border-box;
}

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

form, fieldset, label, .container, .content, .wrap, main, section, article {
    min-width: 0;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
button,
.input,
.form-control {
    max-width: 100%;
}

textarea {
    resize: vertical;
}

.table-responsive,
.overflow-x-auto,
.table-wrap {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    body {
        min-height: 100dvh;
    }

    main,
    .container,
    .content,
    .wrap {
        width: 100%;
        max-width: 100%;
    }

    .grid > *,
    .flex > *,
    [class*="grid-template-columns"] > * {
        min-width: 0;
    }

    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    select,
    textarea {
        width: 100%;
        min-height: 44px;
        font-size: 16px; /* evita zoom automático no iPhone */
    }

    input[type="file"] {
        height: auto;
        white-space: normal;
    }

    button,
    a.btn,
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
        white-space: normal;
    }

    /* Modais curtos continuam utilizáveis e nunca ultrapassam a tela. */
    .fixed.inset-0 {
        max-width: 100vw;
        max-height: 100dvh;
        padding: 0 !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        align-items: flex-end !important;
    }

    .fixed.inset-0 > div {
        width: 100% !important;
        max-width: 100% !important;
        max-height: calc(100dvh - env(safe-area-inset-top)) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        border-bottom-left-radius: 0 !important;
        border-bottom-right-radius: 0 !important;
        padding-bottom: max(1rem, env(safe-area-inset-bottom)) !important;
    }

    table {
        max-width: 100%;
    }

    .desktop-table,
    .table-scroll,
    .table-container {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}
