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

body {
  min-width: 320px;
  overflow-x: clip;
}

p:empty {
  display: none;
}

@supports not (overflow-x: clip) {
  body {
    overflow-x: hidden;
  }
}

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

button,
a[href],
input,
select,
textarea,
[role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(196, 155, 82, 0.22);
}

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

:focus-visible {
  outline: 2px solid hsl(var(--accent));
  outline-offset: 2px;
}

.overflow-x-auto,
.overflow-auto {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

@supports (min-height: 100dvh) {
  .min-h-screen {
    min-height: 100dvh;
  }
}

@media (pointer: coarse) {
  button,
  a[href],
  input,
  select,
  textarea,
  [role="button"] {
    min-height: 44px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
}

@media (max-width: 767px) {
  .container {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  header.sticky {
    top: 0;
    padding-top: env(safe-area-inset-top);
  }

  h1 {
    overflow-wrap: anywhere;
    hyphens: auto;
    letter-spacing: 0;
  }

  h2,
  h3,
  p,
  a,
  button {
    overflow-wrap: break-word;
  }

  a.inline-flex,
  button {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  table {
    min-width: 560px;
  }

  th,
  td {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .prose {
    max-width: 100%;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: clamp(1.9rem, 9vw, 2.5rem) !important;
    line-height: 1.08 !important;
  }

  .container {
    padding-left: max(0.875rem, env(safe-area-inset-left));
    padding-right: max(0.875rem, env(safe-area-inset-right));
  }
}

@media (min-width: 768px) and (max-width: 1180px) {
  h1 {
    overflow-wrap: balance;
  }
}

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