/* Shared by every preserved public page, including client-side navigation. */
header nav[aria-label="Primary"] {
  min-width: 0;
  flex-wrap: wrap;
  row-gap: 0.5rem;
}
header nav[aria-label="Primary"] > div {
  min-width: 0;
}
header nav[aria-label="Primary"] > div > a {
  max-width: 10rem;
  min-height: 44px;
  height: auto;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}
@media (max-width: 1023px) {
  header nav[aria-label="Primary"] > div > a {
    display: none;
  }
}
/* Keep forms usable on desktops and tablets as well as phones. */
input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  min-height: 44px;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23627567' stroke-width='2'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  background-size: 1.25rem;
}
@media (max-width: 650px) {
  body {
    overflow-wrap: anywhere;
  }
  .grid > * {
    min-width: 0;
  }
  header:has(nav[aria-label="Primary"]) > div {
    gap: 0.5rem;
  }
  header nav[aria-label="Primary"] {
    min-width: 0;
    flex: 1;
    justify-content: flex-end;
    padding: 0.5rem;
    gap: 0.5rem;
  }
  header a[aria-label="Escape Towns home"] > span > span {
    max-width: 8rem;
    padding-left: 0.5rem;
  }
  header a[aria-label="Escape Towns home"] .font-display {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
  }
  header a[aria-label="Escape Towns home"] .text-accent {
    display: none;
  }
  header:has(nav[aria-label="Primary"]) > .overflow-y-auto {
    max-height: calc(100dvh - 7rem);
  }
  header > .overflow-y-auto [role="listbox"] {
    position: fixed;
    top: auto;
    left: 1rem;
    right: 1rem;
    bottom: max(6rem, env(safe-area-inset-bottom));
    width: auto;
    max-width: calc(100vw - 2rem);
    max-height: calc(100dvh - 12rem);
    overflow-y: auto;
    margin-top: 0;
  }
  header .grid a {
    white-space: normal;
    text-align: center;
  }
  input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    min-width: 0;
    max-width: 100%;
    min-height: 44px;
    font-size: 16px;
  }
  button,
  form a,
  header a {
    min-height: 44px;
  }
  button {
    min-width: 44px;
  }
  select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23627567' stroke-width='2'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 1.25rem;
  }
  [role="dialog"] {
    max-width: calc(100vw - 2rem);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
  }
}
@media (max-width: 360px) {
  header a[aria-label="Escape Towns home"] > span > span {
    display: none;
  }
}
