/* Shared QA repairs for mobile layout, contrast, focus, and form states. */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

footer p,
footer li {
  color: rgba(255, 255, 255, 0.72) !important;
}

footer a {
  color: rgba(255, 255, 255, 0.92) !important;
  text-decoration-color: rgba(197, 165, 90, 0.75);
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--gold, #c5a55a);
  outline-offset: 4px;
}

.form-alert,
.purchase-error {
  border: 1px solid rgba(255, 190, 120, 0.75);
  background: rgba(120, 48, 24, 0.32);
  color: #fff2dc;
  font-size: 0.76rem;
  line-height: 1.7;
  margin: 0 0 18px;
  padding: 14px 16px;
}

.form-alert[hidden],
.purchase-error[hidden] {
  display: none !important;
}

.page-message {
  background: rgba(25, 40, 66, 0.98);
  border: 1px solid rgba(197, 165, 90, 0.65);
  bottom: 22px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
  color: #fff;
  font-size: 0.78rem;
  left: 50%;
  line-height: 1.7;
  max-width: min(92vw, 520px);
  padding: 14px 18px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 1000;
}

.purchase-ack {
  align-items: flex-start;
  color: rgba(255, 255, 255, 0.74);
  display: flex;
  font-size: 0.68rem;
  gap: 10px;
  line-height: 1.65;
  margin: 16px 0 0;
}

.purchase-ack input {
  flex: 0 0 auto;
  margin-top: 4px;
}

.purchase-ack a,
.micro a {
  color: var(--gold-light, #d9c580);
}

@media (max-width: 900px) {
  nav,
  nav.scrolled {
    gap: 12px;
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  .nav-logo {
    min-width: 0;
    max-width: calc(100% - 56px);
  }

  .nav-brand {
    display: block;
    font-size: 0.52rem !important;
    letter-spacing: 1.1px !important;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hamburger {
    flex: 0 0 auto;
    margin-left: auto;
    z-index: 101;
  }

  .hero,
  .section {
    max-width: 100vw;
  }

  .hero-content,
  .about-content,
  .wrap,
  .panel,
  .card,
  .contact-grid,
  .contact-info,
  .contact-form,
  .contact-content,
  .section-head,
  .about-content p,
  .contact-info p,
  .toolkit-paid-actions,
  .support-products-grid,
  .detail-grid,
  .three,
  .two-col,
  .hero p,
  .panel p,
  .contact-detail p,
  .contact-detail h4,
    .portal-link {
    box-sizing: border-box;
    max-width: calc(100vw - 48px) !important;
    width: calc(100vw - 48px) !important;
  }

  .contact-grid > *,
  .support-products-grid > *,
  .detail-grid > *,
  .three > *,
  .two-col > * {
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .contact-grid,
  .support-products-grid,
  .detail-grid,
  .three,
  .two-col {
    grid-template-columns: 1fr !important;
  }

  .hero-content,
  .about-content,
  .hero-content h1,
  h1 {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal !important;
  }

  .hero-content h1,
  h1 {
    font-size: clamp(1.12rem, 6.4vw, 1.52rem) !important;
    letter-spacing: 0.5px !important;
    line-height: 1.18 !important;
  }

  h1 em,
  .hero-content h1 em {
    overflow-wrap: anywhere;
    white-space: normal !important;
  }

  p,
  li,
  span,
  .panel,
  .panel p,
  .card,
  .contact-detail,
  .contact-detail *,
  .portal-link,
  .wrap,
  .detail-grid {
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
    white-space: normal !important;
    word-break: normal;
  }

  .overline {
    flex-wrap: wrap;
    gap: 10px;
    letter-spacing: 2px !important;
    line-height: 1.6;
  }

  .overline::before,
  .overline::after {
    width: 24px !important;
  }

  .hero p {
    max-width: min(100%, 34rem);
  }

  .hero-content,
  .about-content,
  .hero-content p,
  .about-content p,
  .contact-info p,
  .hero p {
    max-width: 310px !important;
  }

  .panel p,
  .contact-content p,
  .contact-detail,
  .toolkit-card-fit {
    max-width: 300px !important;
  }

  .btn-primary,
  .btn-secondary,
  .btn-ghost,
  .buy-placeholder,
  .toolkit-card-link {
    min-height: 44px;
  }
}

@media (max-width: 420px) {
  .nav-brand {
    max-width: 170px;
  }

  .hero-content,
  .hero-content p,
  .hero p {
    max-width: 310px !important;
  }

  .panel p,
  .contact-content p,
  .contact-detail,
  .toolkit-card-fit {
    max-width: 300px !important;
  }

  .hero-content h1,
  h1 {
    font-size: clamp(1.04rem, 6vw, 1.34rem) !important;
    letter-spacing: 0.35px !important;
  }
}
