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

img, svg, video {
  max-inline-size: 100%;
}

fieldset, input, select, textarea {
  min-inline-size: 0;
  max-inline-size: 100%;
}

button:focus-visible, a:focus-visible, summary:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

body > header {
  flex-wrap: wrap;
  gap: .75rem 1rem;
}

body > main h1 {
  overflow-wrap: anywhere;
}

.frame :is(.config, .hero, .four, .gallery, .journal-grid, .footer-top) > * {
  min-width: 0;
}

.frame :is(.footer-links, .section-head, .modal-inner, .config-summary) {
  overflow-wrap: break-word;
}

.frame #customPreview {
  align-self: start;
  padding: clamp(12px, 2.5vw, 35px);
}

#bagStudy {
  max-height: 65vh;
  max-height: 65svh;
}

.frame .modal-inner, .piece-detail {
  max-height: 90vh;
  max-height: 90dvh;
  overscroll-behavior: contain;
}

@media (min-width: 761px) and (max-width: 1100px) {
  .frame > header {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 8px;
  }

  .frame > header .nav { display: none; }
  .frame > header .menu-toggle { display: grid; }

  .mobile-nav.open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .frame > header .menu-toggle {
    display: grid;
    place-items: center;
    min-height: 44px;
    padding: 0;
  }

  .mobile-nav.open > :is(a, button) {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: .65rem 1rem;
    text-align: left;
    border-bottom: 1px solid #ad967c55;
  }

  .frame #explorePanel {
    left: 0;
    right: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    overflow: auto;
    max-height: 70vh;
    max-height: 70dvh;
  }

  #explorePanel .menuPhoto { display: none; }
}

@media (max-width: 900px) {
  .frame #customPreview { position: relative; top: auto; }
  .frame :is(.config-controls, #contact) :is(select, input:not([type="checkbox"]):not([type="radio"]), textarea) {
    font-size: 16px;
  }
}

@media (max-width: 760px) {
  .frame > header {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    gap: 4px;
    padding-inline: 8px;
  }

  .frame > header .brand {
    font-size: clamp(1.25rem, 5.3vw, 2.35rem);
    letter-spacing: .16em;
  }

  .frame .hero h1 {
    font-size: clamp(2.85rem, 10.5vw, 5rem);
    line-height: .96;
  }

  .frame .footer-top > :first-child { grid-column: 1 / -1; }
  .frame .footer-top .brand { font-size: clamp(1.5rem, 7vw, 2.5rem); }
  .frame .escaleref div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .frame .escaleref .escale-square-reference { grid-column: auto; }
  .frame .step-actions > :is(button, a) { max-width: 100%; white-space: normal; }
}

@media (max-width: 420px) {
  .frame .tile-title {
    right: 7px;
    left: 7px;
    font-size: clamp(.85rem, 4vw, 1.15rem);
    letter-spacing: .035em;
    overflow-wrap: anywhere;
  }

  .frame .tile-title small { font-size: .53rem; letter-spacing: .07em; }
  .frame .section h2 { font-size: clamp(2.1rem, 10vw, 2.75rem); }
  .frame .journal-grid { grid-template-columns: minmax(0, 1fr); }
  .frame .journal-grid article:first-child { grid-column: auto; }
  .frame .handle-options label { padding: .4rem; overflow-wrap: anywhere; }
  .frame .config-summary dl { grid-template-columns: minmax(70px, 1fr) minmax(0, 2fr); }
  .frame .extraRow { flex-wrap: wrap; }
  .frame .extraRow select { max-width: 100%; }
  .frame .modal { padding: 10px; }
}

@media (any-pointer: coarse) {
  .frame :is(.config-step .choice, #colors .swatch, .accessory-palette summary, .preview-jump),
  .piece-detail form button { min-height: 44px; }
  .frame .threadChip { min-width: 36px; min-height: 36px; }
}

@media (max-height: 650px) {
  .frame #customPreview { position: relative; top: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .frame .is-entering { animation: none; }
}
