/* Small-screen safety net shared by every page (phones and tablets).
   Page-specific layout still lives in each page's Tailwind classes; this file only
   catches the things that go wrong everywhere at once. */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Long unbroken strings (emails, ticket numbers, file names) wrap instead of pushing the page wider. */
body { overflow-wrap: break-word; }
img, video { max-width: 100%; }

/* Status pills ("In Progress", "Pending Review") never break across two lines or get squeezed by neighbouring text. */
span.rounded-full.font-bold { white-space: nowrap; flex-shrink: 0; }

/* Popups: stay centered when they fit, scroll from the top when they're taller than the screen
   (plain flex centering would cut off the top of a tall popup with no way to scroll to it). */
.fixed.inset-0.items-center { align-items: flex-start; overflow-y: auto; }
.fixed.inset-0.items-center > * { margin-top: auto; margin-bottom: auto; }

@media (max-width: 767.98px) {
    /* Tables scroll sideways instead of squeezing every column into a one-word-per-line stack. */
    .overflow-x-auto > table,
    .overflow-auto > table,
    .overflow-y-auto > table { min-width: 640px; }
    th { white-space: nowrap; }

    /* Page titles scale down so they don't wrap one word per line.
       (#certificate is a fixed-size printable page that scales as a whole, so it's left alone.) */
    h1.text-4xl, h1.text-5xl { font-size: 1.875rem; line-height: 2.25rem; }
    h1.text-3xl:not(#certificate *), h2.text-3xl:not(#certificate *) { font-size: 1.5rem; line-height: 2rem; }
}

@media (max-width: 639.98px) {
    /* iOS Safari zooms the whole page when focusing a field smaller than 16px.
       !important because Tailwind's CDN injects its text-sm/text-xs rules after this file. */
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]),
    select,
    textarea { font-size: 16px !important; }

    /* Header/back buttons wrap to their own line rather than overlapping the title. */
    .btn-md { padding: 0.5rem 0.875rem; }
}
