/* Shared responsive stabilization layer for the Aguwa project.
   Keep this file focused on layout safety so individual page styling remains intact. */

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

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

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

a,
button,
.btn,
.chip,
.pill,
.tag,
.badge,
.lang-btn {
  min-width: 0;
}

.container,
.shell,
.wrap,
.app,
.page,
.main,
.content,
.footer-shell,
.hero,
.section,
.panel,
.card,
.modal-card {
  min-width: 0;
}

.stats,
.stats-grid,
.summary-grid,
.reference-band,
.quick-facts,
.signature-row,
.quick-grid,
.profile-grid,
.grid,
.content-grid,
.info-grid,
.split-grid,
.eligibility-grid,
.process-grid,
.stage-grid,
.overview-grid,
.cards-grid {
  min-width: 0;
}

.field,
.card,
.panel,
.stat-card,
.quick-card,
.summary-card,
.fact,
.profile-option,
.footer-grid > div,
.footer-bottom > * {
  min-width: 0;
}

.title,
.hero-title,
.section-title,
.brand-title,
.modal-title,
h1,
h2,
h3,
h4 {
  overflow-wrap: anywhere;
}

.dk-main,
.dk-sub,
.logo-text,
.nav-links a,
.topbar-copy,
.footer-title,
.footer-text,
.footer-bottom span,
.meta-card,
.toolbar,
.action-row,
.header-actions,
.hero-pills,
.chips {
  min-width: 0;
}

table {
  width: 100%;
  max-width: 100%;
}

.table-wrap,
.table-scroll,
.results-table-wrap,
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1280px) {
  body {
    overflow-x: hidden;
  }

  .hero,
  .shell,
  .wrap,
  .app,
  .page,
  .main,
  .content {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 1100px) {
  .main,
  .content,
  .summary-top,
  .reference-band,
  .signature-row,
  .quick-facts,
  .hero-form-rail,
  .hero-grid,
  .split-grid,
  .info-grid,
  .footer-grid,
  .profile-grid,
  .topbar,
  .toolbar,
  .header,
  .action-row,
  .header-actions,
  .main-grid,
  .content-grid,
  .layout-grid {
    grid-template-columns: 1fr !important;
  }

  .sidebar,
  .sticky,
  .stage-sidebar,
  .summary-side,
  .hero-side {
    position: static !important;
    top: auto !important;
  }

  .top-meta,
  .hero-side {
    width: 100%;
    min-width: 0;
  }

  .hero-inner,
  .hero-form-rail,
  .hero-form-body,
  .hero-metrics,
  .footer-grid,
  .hero-stats,
  .hero-right-grid,
  .manifesto-grid,
  .frame-grid,
  .mission-grid,
  .summary-top {
    min-width: 0;
  }
}

@media (max-width: 900px) {
  .stats,
  .stats-grid,
  .summary-grid,
  .quick-grid,
  .overview-grid,
  .process-grid,
  .eligibility-grid,
  .cards-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .nav-links,
  .header-actions,
  .toolbar,
  .action-row,
  .topbar {
    flex-wrap: wrap;
  }

  .hero-inner,
  .hero-showcase,
  .hero-copy,
  .hero-form-card,
  .hero-right-card,
  .hero-right-inner,
  .footer-grid > div,
  #nav-links,
  .nav-links {
    min-width: 0;
  }

  .nav-links a,
  .btn,
  .lang-btn {
    white-space: normal !important;
  }

  .hero-title,
  .hero-subtitle,
  .hero-sub,
  .brand-title,
  .modal-title,
  .footer-title,
  .footer-text {
    max-width: 100% !important;
  }

  .hero-metrics,
  .hero-stats,
  .hero-right-grid,
  .footer-grid {
    gap: 14px !important;
  }

  .hero-form-card,
  .hero-showcase,
  .hero-right-card {
    max-width: 100% !important;
  }

  .hero::after,
  .hero::before {
    max-width: 100%;
  }
}

@media (max-width: 640px) {
  body {
    overflow-x: hidden;
  }

  .stats,
  .stats-grid,
  .summary-grid,
  .quick-grid,
  .overview-grid,
  .process-grid,
  .eligibility-grid,
  .cards-grid,
  .footer-grid,
  .quick-facts,
  .reference-band,
  .signature-row {
    grid-template-columns: 1fr !important;
  }

  .topbar,
  .toolbar,
  .header,
  .action-row,
  .header-actions,
  .nav-links,
  .hero-pills,
  .chips,
  .footer-bottom {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  .btn,
  button,
  .lang-btn,
  .action-row .btn,
  .header-actions .btn {
    width: 100%;
  }

  .hero,
  .hero-inner,
  .hero-copy,
  .hero-showcase,
  .hero-form-card,
  .hero-right-card,
  .wrap,
  main,
  .footer-grid,
  .footer-bottom,
  #nav-links,
  .nav-links {
    width: 100%;
    max-width: 100% !important;
  }

  .hero-title,
  .hero h1,
  .brand-title {
    font-size: clamp(1.9rem, 7vw, 2.5rem) !important;
    line-height: 1.08;
  }

  .hero-subtitle,
  .hero-sub,
  .hero p,
  .lead {
    font-size: 14px !important;
    line-height: 1.65;
  }

  .hero-metrics,
  .hero-stats,
  .hero-right-grid,
  .footer-grid {
    gap: 12px !important;
  }

  .hero-form-rail,
  .hero-badges,
  .hero-tags,
  .chips {
    grid-template-columns: 1fr !important;
  }

  .dk-main,
  .dk-sub,
  .nav-links a,
  .chip,
  .pill,
  .tag,
  .badge,
  .footer-bottom span {
    white-space: normal !important;
  }

  .dk-main,
  .dk-sub {
    text-align: center;
  }

  #nav-links,
  .nav-links {
    display: flex;
    gap: 10px;
  }
}

@media (max-width: 420px) {
  body {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .hero,
  .content,
  .panel,
  .card,
  .shell,
  .wrap,
  .app,
  .page {
    padding-left: min(18px, 4vw) !important;
    padding-right: min(18px, 4vw) !important;
  }

  .modal-card,
  .hero-form-card {
    max-width: 100% !important;
  }

  .hero,
  .hero-showcase,
  .hero-form-card,
  .hero-right-card,
  .card,
  .panel,
  .tier-box {
    border-radius: 18px !important;
  }

  .footer-grid > div,
  .footer-bottom {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

@media (max-width: 1180px) {
  .hero-inner {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr) !important;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .hero-metrics,
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .dk-main,
  .dk-sub,
  .nav-links a,
  #nav-links li a,
  .footer-bottom span,
  .hero-note,
  .hero-form-footer {
    white-space: normal !important;
  }

  .nav-links,
  #nav-links,
  .header-actions,
  .topbar,
  .toolbar,
  .hero-actions {
    flex-wrap: wrap !important;
  }
}

@media (max-width: 1024px) {
  .hero-inner,
  .hero-form-rail,
  .hero-form-body,
  .hero-right-grid,
  .footer-grid,
  .summary-top,
  .reference-band,
  .quick-facts {
    grid-template-columns: 1fr !important;
  }

  .hero-left,
  .hero-copy,
  .hero-showcase,
  .hero-form-card,
  .hero-right-card {
    max-width: 100% !important;
  }

  .nav-links,
  #nav-links {
    gap: 10px !important;
  }

  .wrap,
  .container,
  main,
  .page,
  .shell {
    max-width: 100% !important;
  }
}
