/* Aureon Point Group: phone and tablet layout.
   The page designs use inline styles. The page runtime re-serialises them
   ("font-size: 72px", "minmax(0px, 1fr)"), so these rules match that form and
   use !important to win over the inline values. Desktop is untouched. */

/* ------------------------------------------------------------ Tablet and below */
@media (max-width: 900px) {
  /* Stacked sticky panels (home): on small screens a panel is taller than the
     viewport, so sticking would let the next panel cover unread content. */
  .panel { position: relative !important; min-height: 0 !important; }

  /* A card spanning two columns falls back to one column once the grid collapses */
  [style*="grid-column: span 2"] { grid-column: auto !important; }

  /* Three-up columns divided by vertical rules (principles, steps, values) would
     wrap 2 + 1: stack them and divide with horizontal rules instead */
  [style*="minmax(260px, 1fr)); gap: 0px"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="minmax(260px, 1fr)); gap: 0px"] > * {
    padding: 20px 0 !important; border-left: 0 !important; border-right: 0 !important;
  }
  [style*="minmax(260px, 1fr)); gap: 0px"] > * + * { border-top: 1px solid rgba(128, 140, 160, .3) !important; }
}

/* ------------------------------------------------------------ Phones */
@media (max-width: 640px) {
  .wrap { padding-left: 20px !important; padding-right: 20px !important; }

  /* Display type: scale the large serif sizes down to fit a phone */
  [style*="font-size: 90px"], [style*="font-size: 88px"], [style*="font-size: 84px"],
  [style*="font-size: 76px"], [style*="font-size: 72px"] { font-size: 46px !important; line-height: 1.05 !important; }
  [style*="font-size: 66px"], [style*="font-size: 62px"], [style*="font-size: 60px"],
  [style*="font-size: 56px"] { font-size: 40px !important; line-height: 1.08 !important; }
  [style*="font-size: 52px"], [style*="font-size: 48px"], [style*="font-size: 46px"] { font-size: 34px !important; line-height: 1.1 !important; }
  [style*="font-size: 44px"], [style*="font-size: 42px"] { font-size: 32px !important; line-height: 1.12 !important; }
  [style*="font-size: 40px"], [style*="font-size: 38px"] { font-size: 30px !important; }
  [style*="font-size: 36px"]:not(.ap-ml) { font-size: 28px !important; }

  /* Section rhythm: trim the big desktop paddings */
  [style*="padding-top: 96px"] { padding-top: 64px !important; }
  [style*="padding-bottom: 96px"] { padding-bottom: 64px !important; }
  [style*="padding-top: 88px"] { padding-top: 60px !important; }
  [style*="padding-bottom: 88px"] { padding-bottom: 60px !important; }

  /* Roomy desktop card padding squeezes text on a phone */
  [style*="padding: 56px;"], [style*="padding: 48px;"], [style*="padding: 48px 44px"],
  [style*="padding: 44px 40px"], [style*="padding: 40px;"] { padding: 28px 24px !important; }

  /* Wide minimum columns would overflow a phone: go single column */
  [style*="minmax(280px"], [style*="minmax(300px"], [style*="minmax(320px"] { grid-template-columns: minmax(0, 1fr) !important; }

  /* Footer philosophy columns: drop the side rules once they stack */
  [style*="minmax(200px, 1fr)); gap: 0px"] > * {
    padding-left: 0 !important; padding-right: 0 !important;
    border-left: 0 !important; border-right: 0 !important;
  }
  [style*="minmax(200px, 1fr)); gap: 0px"] > * { padding-bottom: 18px !important; }

  /* Track record figures: two per row instead of one long column */
  [style*="minmax(170px, 1fr)"] { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
  [style*="minmax(170px, 1fr)"] > * { padding: 18px 16px !important; }

  /* Three-across stat rows: one per line */
  [style*="repeat(3, minmax(0px, 1fr))"] { grid-template-columns: minmax(0, 1fr) !important; }
  [style*="repeat(3, minmax(0px, 1fr)); gap: 1px"] > * { padding: 18px 20px !important; }
  [style*="repeat(3, minmax(0px, 1fr)); gap: 24px"] { gap: 14px !important; }

  /* Header and footer use their own 32px gutters: match the 20px page gutter */
  [data-ap-row] { padding-left: 20px !important; padding-right: 20px !important; gap: 12px !important; }
  footer [style*="padding: 96px 32px 72px"] { padding: 72px 20px 56px !important; }
  footer [style*="padding: 56px 32px 32px"] { padding: 48px 20px 28px !important; }

  /* Header wordmark stays on one line */
  .ap-word { white-space: nowrap; }
  .ap-word > :first-child { letter-spacing: .1em !important; font-size: 13px !important; }
  .ap-word > :last-child { letter-spacing: .3em !important; font-size: 10px !important; }

  /* "Who this site is for" chips */
  .who { font-size: 18px !important; padding: 6px 20px 6px 6px !important; margin-right: 10px !important; }
}

@media (max-width: 380px) {
  [style*="font-size: 90px"], [style*="font-size: 88px"], [style*="font-size: 84px"],
  [style*="font-size: 76px"], [style*="font-size: 72px"] { font-size: 40px !important; }
  .wrap, [data-ap-row] { padding-left: 16px !important; padding-right: 16px !important; }
}
