/* Mobile refinements for the institutional site. Desktop retains its own rules. */
@media (max-width: 768px) {
  :is(main, .container, .bento-item, .price-card, .chem-inputs, .chem-results) { min-width: 0; }
  :is(main, .legal-card, .help-main, .handoff-card) :is(p, li, h1, h2, h3) { overflow-wrap: break-word; }
  :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="hidden"]), textarea, select) { font-size: max(1rem, 16px); min-width: 0; }
  :is(a, button, input, textarea, select, summary):focus-visible { outline: 2px solid #e8bd8f; outline-offset: 3px; }

  .glass-navbar .nav-brand { min-height: 44px; }

  /* Let grids shrink with enlarged text instead of hiding their overflow. */
  .bento-grid, body:has(.mastery-product-preview) .pricing-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .bento-grid > .bento-item { grid-column: auto !important; min-width: 0; }
  .bento-item > div { min-width: 0; }
  .price-card { min-width: 0; overflow-wrap: anywhere; }
  .price-card .plan-price { white-space: normal; overflow-wrap: anywhere; }
  .article-actions-bar { flex-wrap: wrap; gap: 12px; }
  .article-actions-bar button { max-width: 100%; min-height: 44px; white-space: normal; }
  .article-container .btn-back { display: inline-flex; align-items: center; min-height: 44px; }
  .article-container .related-desc { font-size: .875rem; line-height: 1.6; }
  #blog-content .blog-excerpt { font-size: 1rem; line-height: 1.6; }

  /* Body text and safeguards remain readable on the Iris demonstrations. */
  #iris-content :is(.wa-feature p, .benefit-card p, .learn-desc, .campaign-iris-insight p, .wapp-bubble p) { font-size: 1rem; line-height: 1.6; }
  #iris-content :is(.section-disclaimer, .roi-disclaimer, .iris-compare-footer) { font-size: .875rem; line-height: 1.65; }
  #iris-content .section-disclaimer a { display: inline-flex; align-items: center; min-height: 44px; }
  #iris-content .chem-calc-card { grid-template-columns: minmax(0, 1fr); }
  #iris-content :is(.chem-inputs, .chem-results, .chem-field, .roi-slider-wrap, .roi-slider) { min-width: 0; }
  #iris-content .roi-slider { min-height: 44px; }

  /* Reading surfaces use the same ordinary body scale. */
  #legal-content .legal-card :is(p, li) { font-size: 1rem; line-height: 1.7; overflow-wrap: anywhere; }
  #help-content :is(.help-start p, .help-faq p) { font-size: 1rem; line-height: 1.65; }
  #help-content .help-consent { min-height: 44px; align-items: flex-start; gap: 10px; font-size: .875rem; line-height: 1.6; }
  #help-content .help-consent input { flex: none; width: 24px; height: 24px; margin-top: 2px; }
  .pricing-page .pricing-notes p, .integration-offer-description, .not-found-sub { font-size: 1rem; line-height: 1.6; }
  .pricing-page .plan-info p { font-size: .875rem; }
  .pricing-page .back-link, .not-found-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; }
  .community-resources > li > a { display: inline-flex; align-items: center; min-height: 44px; }

  /* The lightweight help shell needs the full search dialog on mobile too. */
  .help-page .global-search-modal { position: fixed; inset: 0; z-index: 10050; display: flex; align-items: flex-start; justify-content: center; padding: 76px 16px 16px; opacity: 0; visibility: hidden; pointer-events: none; }
  .help-page .global-search-modal.active { opacity: 1; visibility: visible; pointer-events: auto; }
  .help-page .global-search-overlay { position: absolute; inset: 0; background: #050505e6; }
  .help-page .global-search-box { position: relative; width: min(100%, 640px); max-height: calc(100dvh - 96px); display: flex; flex-direction: column; padding: 16px; border: 1px solid #d9a17155; border-radius: 12px; background: #17130f; color: #f7f3ec; }
  .help-page .global-search-header { display: flex; align-items: center; gap: 8px; }
  .help-page .global-search-header input { flex: 1; width: 100%; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid #d9a17155; border-radius: 6px; color: #f7f3ec; background: #0b0a08; }
  .help-page .close-search { flex: none; width: 44px; min-height: 44px; background: transparent; color: #f7f3ec; font-size: 1.75rem; }
  .help-page .global-search-results { overflow-y: auto; min-height: 0; margin-top: 12px; }
  .help-page .search-result-item { display: block; min-height: 44px; padding: 12px 4px; border-bottom: 1px solid #d9a17133; }
  .help-page .search-result-title { color: #f7f3ec; font-size: 1rem; }
  .help-page :is(.search-result-category, .search-result-description) { color: #cec2b5; font-size: .875rem; line-height: 1.5; }

  /* Standalone links in the shared footer need comfortable hit areas. */
  #dynamic-footer .footer-grid > div:first-child > a { display: inline-flex; align-items: center; min-height: 44px; }
  #dynamic-footer .footer-links a, #dynamic-footer .footer-bottom a { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  #dynamic-footer .footer-bottom { overflow-wrap: anywhere; }

  /* Repair legacy class collisions within the older institutional sales page. */
  .lp-sales .hero .grid-2 { display: grid !important; grid-template-columns: minmax(0, 1fr); gap: 24px !important; margin-top: 0; padding: 0 20px; color: #f7f3ec; background: transparent; border: 0; border-radius: 0; cursor: auto; font-weight: 400; }
  .lp-sales .hero .grid-2 > div:first-child { padding: 0; border-top: 0; }
  .lp-sales .hero h1 { color: #f7f3ec; font-size: clamp(1.75rem, 8vw, 2.5rem) !important; line-height: 1.2 !important; }
  .lp-sales .hero .btn-primary { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; margin-bottom: 12px; padding: 12px 16px; color: #17110c; font-size: 1rem; line-height: 1.5; }
  .lp-sales .hero .inline-style-63 { padding: 8px 0; border-radius: 0; background: transparent; }
  .final-page.lp-sales .hero .inline-style-63, .final-page.lp-sales .hero .inline-style-63 span { color: #e4b88b; }
  .lp-sales .hero .hero-image { width: 100%; margin: 0; }
  .lp-sales .hero .inline-style-64 { padding: 0; }
  .lp-sales .bento-item { padding: 24px 20px; }
  .lp-sales .bento-item .card-icon.inline-style-30 { padding: 0; border: 0; }
  .lp-sales #lp-content p { font-size: 1rem; line-height: 1.6; }
  .lp-sales .pricing-grid.inline-style-59 { display: grid; grid-template-columns: minmax(0, 1fr); width: 100%; height: auto; margin: 24px 0 0; background: transparent; border-radius: 0; }
  .lp-sales .price-card.inline-style-60 { width: 100%; max-width: 450px; margin: 0 auto; padding: 28px 20px; font-family: 'DM Sans', sans-serif; font-size: 1rem; }
  .lp-sales .billing-note { width: 100%; max-width: 100%; font-size: .875rem !important; line-height: 1.65; }
  .lp-sales .price-card .feature-list.inline-style-30 { padding: 0; border: 0; }
  .lp-sales .author-info { min-width: 0; flex: 1; }
  .lp-sales .author-info { min-width: 0; flex: 1; }
  .lp-sales .author-info { min-width: 0; flex: 1; }
  .lp-sales .price-card .btn-plan { width: 100%; min-height: 48px; }
  .lp-master :is(.hero-sub, .pain-card p, .feature-card p, .benefit-item p, .obj-body p, .faq-a p) { font-size: 1rem; line-height: 1.6; }
}
