:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

html {
    min-height: 100%;
    background: #271c16;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overscroll-behavior-y: none;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

input,
textarea,
select,
img,
svg,
video {
    max-width: 100%;
}

@media (max-width: 767px) {
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        min-height: 48px;
        font-size: 16px !important;
    }

    button,
    [role="button"],
    input[type="submit"],
    input[type="button"] {
        min-height: 44px;
    }

    table {
        display: block;
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }

    [role="dialog"],
    dialog {
        max-height: calc(100dvh - var(--safe-top) - var(--safe-bottom) - 1rem);
        overscroll-behavior: contain;
    }

    .fixed.top-0 {
        top: var(--safe-top) !important;
    }

    .fixed.bottom-0 {
        bottom: var(--safe-bottom) !important;
    }

    .overflow-x-auto {
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
    }
}

@media (display-mode: fullscreen), (display-mode: standalone) {
    html {
        background: #17110c;
    }

    body {
        padding-right: var(--safe-right);
        padding-left: var(--safe-left);
    }

    body > header,
    .sticky.top-0 {
        top: var(--safe-top) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
