/*
 * ISO Metrik Therapy — final phone/tablet responsive layer.
 * File 93.9 / Theme 1.4.3.
 *
 * IMPORTANT: Every rule in this file is limited to <=1024px so the approved
 * desktop design remains unchanged. The file is loaded last so it can safely
 * contain overflow, collapse wide grids, and preserve usable touch targets.
 */

@media (max-width: 1024px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  body,
  main,
  .site-header,
  .site-footer,
  .shell,
  .wp-content-shell,
  .iso-portal-shell,
  .iso-dashboard-v2,
  .iso-dashboard-frame,
  .iso-dashboard-content,
  .iso-dashboard-card,
  .iso-commerce-shell,
  .iso-library-module,
  .iso-course-shell {
    min-width: 0;
    max-width: 100%;
  }

  main :where(img, picture, video, iframe, embed, object, canvas, svg),
  .site-header img,
  .site-footer img {
    max-width: 100%;
  }

  main :where(img, video, iframe, embed, object, canvas) {
    height: auto;
  }

  :where(h1, h2, h3, h4, h5, h6, p, li, a, button, label, td, th, strong, small, span) {
    overflow-wrap: anywhere;
  }

  :where(input, select, textarea, button) {
    min-width: 0;
    max-width: 100%;
  }

  :where(pre, code) {
    max-width: 100%;
  }

  pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Header: switch to the compact menu before the desktop links can crowd. */
  .site-header .header-inner {
    width: calc(100% - 32px) !important;
    max-width: 992px !important;
    height: 68px;
    min-height: 68px;
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 12px;
    margin-inline: auto;
  }

  .site-header .desktop-nav,
  .site-header .header-actions {
    display: none !important;
  }

  .site-header .mobile-menu {
    display: block !important;
    margin-left: auto;
  }

  .site-header .mobile-menu nav {
    right: 0;
    left: auto;
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100dvh - 120px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .site-header .mobile-menu nav a,
  .site-header .mobile-menu summary {
    min-height: 44px;
  }

  .header-utility-inner {
    width: calc(100% - 32px) !important;
    max-width: 992px;
    gap: 6px 18px;
  }

  .header-utility-contact,
  .header-utility-nav {
    min-width: 0;
    flex-wrap: wrap;
  }

  .header-utility-link {
    min-width: 0;
  }

  /* Public site frame. */
  .shell,
  main .shell,
  .provider-network-shell,
  .science-innovation-section > .shell,
  .dental-structure-home > section > .shell,
  .dental-structure-home > aside > .shell,
  .dental-structure-home > .page-hero .hero-grid {
    width: min(100% - 32px, 960px) !important;
    max-width: 960px !important;
    margin-inline: auto;
  }

  :where(
    .hero-grid,
    .intro-grid,
    .split-grid,
    .value-grid,
    .card-grid,
    .benefit-grid,
    .mode-grid,
    .pathway-grid,
    .page-cta-inner,
    .footer-grid,
    .dental-how-grid,
    .dental-service-grid,
    .dental-benefit-grid,
    .device-platform-layout,
    .device-component-list,
    .dental-difference-grid,
    .human-impact-layout,
    .human-impact-grid,
    .therapy-foundations-grid,
    .connected-pathway-layout,
    .connected-discipline-grid,
    .science-innovation-layout,
    .science-innovation-copy,
    .science-highlight-grid,
    .provider-network-grid,
    .provider-network-action,
    .provider-network-facts,
    .contact-hero-grid,
    .contact-quick-grid,
    .contact-main-grid,
    .support-track-grid,
    .support-contact-cta-inner,
    .support-faq-layout,
    .support-policy-grid,
    .support-return-layout,
    .hipaa-incident-layout,
    .legal-layout,
    .resources-hero-grid
  ) > * {
    min-width: 0;
    max-width: 100%;
  }

  .button-row,
  .provider-network-buttons,
  .support-contact-actions,
  .contact-ai-help-actions,
  .iso-form-actions,
  .iso-inline-form,
  .iso-dashboard-actions,
  .iso-commerce-navigation,
  .iso-library-footer-nav,
  .iso-implementation-action-row {
    max-width: 100%;
    flex-wrap: wrap;
  }

  /* Two-column tablet layout for dense card sets. */
  :where(
    .columns-3,
    .columns-4,
    .benefit-grid,
    .mode-grid,
    .pathway-grid,
    .dental-how-grid,
    .dental-service-grid,
    .dental-benefit-grid,
    .dental-difference-grid,
    .human-impact-grid,
    .therapy-foundations-grid,
    .connected-discipline-grid,
    .science-highlight-grid,
    .provider-network-facts,
    .support-topic-grid,
    .support-process-grid,
    .support-quick-links,
    .support-two-column,
    .support-policy-cards,
    .hipaa-rule-grid
  ) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* Contact and public form containment. */
  .contact-form-card,
  .contact-details-card,
  .support-form-card,
  .support-panel,
  .wp-content-card {
    min-width: 0;
    max-width: 100%;
  }

  .contact-form :is(input, select, textarea),
  .iso-portal-form :is(input, select, textarea),
  .woocommerce :is(input, select, textarea) {
    max-width: 100%;
  }

  /* Provider/Clinic dashboards. */
  .page-provider-portal main .shell,
  .page-clinic-portal main .shell,
  .page-provider-registration main .shell,
  .page-provider-login main .shell {
    width: min(100% - 28px, 980px) !important;
    max-width: 980px !important;
  }

  .iso-dashboard-frame {
    grid-template-columns: minmax(0, 1fr) !important;
    min-width: 0;
  }

  .iso-dashboard-nav {
    position: static !important;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .iso-dashboard-nav ul {
    display: flex;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .iso-dashboard-nav li {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .iso-dashboard-nav li a {
    min-height: 42px;
    white-space: nowrap;
  }

  .iso-dashboard-content,
  .iso-dashboard-card,
  .iso-dashboard-ai-workspace,
  .ai-help-card,
  .iso-training-workspace,
  .iso-training-workspace-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  :where(
    .iso-dashboard-kpis,
    .iso-dashboard-main-grid,
    .iso-resource-grid,
    .iso-team-grid,
    .iso-support-grid,
    .iso-account-grid,
    .iso-device-commerce-grid,
    .iso-band-catalog-grid,
    .iso-mini-stats,
    .iso-account-choice,
    .iso-form-grid,
    .iso-login-grid,
    .iso-training-profile-grid,
    .iso-training-safety-grid,
    .iso-training-plan-grid,
    .iso-training-session-grid,
    .iso-no-phi-demo-grid,
    .iso-no-phi-pathways,
    .iso-dashboard-ai-layout
  ) > * {
    min-width: 0;
  }

  .iso-dashboard-ai-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .iso-dashboard-ai-guide nav {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .iso-dashboard-ai-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ai-help-card-header,
  .ai-help-voice-bar,
  .ai-help-form,
  .ai-help-suggestions,
  .iso-dashboard-ai-suggestions {
    min-width: 0;
    max-width: 100%;
  }

  .ai-help-messages {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .ai-help-message,
  .ai-help-bubble {
    max-width: 94%;
  }

  /* Clinical workflow and forms. */
  :where(
    .iso-clinical-table-wrap,
    .iso-order-table-wrap,
    .iso-library-table-wrap,
    .iso-library-spec-table-wrap,
    .iso-commerce-shell .woocommerce,
    .woocommerce-cart-form,
    .woocommerce-checkout-review-order,
    .woocommerce .shop_table_responsive
  ) {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
  }

  .iso-clinical-table,
  .iso-order-table,
  .iso-library-table,
  .iso-library-spec-table {
    max-width: none;
  }

  /* Clinical Library modules. */
  .iso-library-module,
  .iso-neuro-module,
  .iso-modes-module,
  .iso-evidence-module,
  .iso-referral-module,
  .iso-implementation-module {
    overflow-x: clip;
  }

  :where(
    .iso-library-hero,
    .iso-neuro-hero,
    .iso-modes-hero,
    .iso-evidence-hero,
    .iso-referral-hero,
    .iso-implementation-hero,
    .iso-library-learning-hero
  ) > * {
    min-width: 0;
  }

  :where(
    .iso-library-material-grid,
    .iso-library-detail-grid,
    .iso-neuro-domain-grid,
    .iso-neuro-status-grid,
    .iso-modes-summary-grid,
    .iso-modes-selection-grid,
    .iso-evidence-map-grid,
    .iso-evidence-quality-grid,
    .iso-evidence-device-grid,
    .iso-evidence-boundary-grid,
    .iso-evidence-measure-grid,
    .iso-evidence-language-grid,
    .iso-evidence-research-grid,
    .iso-referral-info-grid,
    .iso-referral-discipline-grid,
    .iso-referral-alert-grid,
    .iso-referral-home-grid,
    .iso-referral-report-grid,
    .iso-implementation-stage-grid,
    .iso-implementation-competency-grid,
    .iso-implementation-readiness-grid,
    .iso-implementation-session-grid,
    .iso-implementation-practical-grid,
    .iso-implementation-scale-grid,
    .iso-library-learning-jump
  ) > * {
    min-width: 0;
  }

  .iso-library-jump,
  .iso-neuro-jump,
  .iso-modes-jump,
  .iso-evidence-jump,
  .iso-referral-jump,
  .iso-implementation-jump,
  .iso-library-learning-jump {
    max-width: 100%;
  }

  /* Training & Certification. */
  .iso-course-layout,
  .iso-course-hero {
    min-width: 0;
  }

  .iso-course-toc {
    position: static !important;
  }

  .iso-course-content,
  .iso-course-lesson,
  .iso-course-objectives,
  .iso-course-summary,
  .iso-course-assessment,
  .iso-training-ai-coach {
    min-width: 0;
    max-width: 100%;
  }

  /* Commerce. */
  .iso-product-card,
  .iso-band-product-card,
  .iso-band-catalog-hero,
  .iso-band-purchase-form,
  .iso-device-commerce-grid {
    min-width: 0;
    max-width: 100%;
  }

  .woocommerce form .form-row-first,
  .woocommerce form .form-row-last,
  .woocommerce-page form .form-row-first,
  .woocommerce-page form .form-row-last {
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  :where(
    .hero-grid,
    .intro-grid,
    .split-grid,
    .device-feature-grid,
    .page-cta-inner,
    .device-platform-layout,
    .human-impact-layout,
    .connected-pathway-layout,
    .science-innovation-layout,
    .provider-network-grid,
    .provider-network-action,
    .contact-hero-grid,
    .contact-main-grid,
    .support-track-grid,
    .support-contact-cta-inner,
    .support-faq-layout,
    .support-policy-grid,
    .support-return-layout,
    .hipaa-incident-layout,
    .legal-layout,
    .resources-hero-grid,
    .iso-login-grid,
    .iso-dashboard-columns,
    .iso-product-card,
    .iso-library-hero,
    .iso-neuro-hero,
    .iso-modes-hero,
    .iso-evidence-hero,
    .iso-referral-hero,
    .iso-implementation-hero,
    .iso-library-learning-hero,
    .iso-course-hero,
    .iso-course-layout
  ) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  :where(
    .contact-quick-grid,
    .iso-dashboard-kpis,
    .iso-resource-grid,
    .iso-team-grid,
    .iso-support-grid,
    .iso-account-grid,
    .iso-device-commerce-grid,
    .iso-band-catalog-grid,
    .iso-mini-stats,
    .iso-training-profile-grid,
    .iso-training-safety-grid,
    .iso-training-plan-grid,
    .iso-training-session-grid,
    .iso-no-phi-demo-grid,
    .iso-no-phi-pathways,
    .iso-library-material-grid,
    .iso-library-detail-grid,
    .iso-neuro-domain-grid,
    .iso-neuro-status-grid,
    .iso-modes-summary-grid,
    .iso-modes-selection-grid,
    .iso-evidence-map-grid,
    .iso-evidence-quality-grid,
    .iso-evidence-device-grid,
    .iso-evidence-boundary-grid,
    .iso-evidence-measure-grid,
    .iso-evidence-language-grid,
    .iso-evidence-research-grid,
    .iso-referral-info-grid,
    .iso-referral-discipline-grid,
    .iso-referral-alert-grid,
    .iso-referral-home-grid,
    .iso-referral-report-grid,
    .iso-implementation-stage-grid,
    .iso-implementation-competency-grid,
    .iso-implementation-readiness-grid,
    .iso-implementation-session-grid,
    .iso-implementation-practical-grid,
    .iso-implementation-scale-grid
  ) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .contact-hero-media,
  .contact-hero-media img,
  .hero-media,
  .hero-media img,
  .split-media,
  .split-media img {
    min-height: 0 !important;
  }

  .contact-hero-media,
  .hero-media,
  .split-media {
    width: 100%;
  }

  .contact-hero-media img,
  .hero-media img,
  .split-media img {
    width: 100%;
    height: auto;
  }

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

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .shell,
  main .shell,
  .provider-network-shell,
  .science-innovation-section > .shell,
  .dental-structure-home > section > .shell,
  .dental-structure-home > aside > .shell,
  .dental-structure-home > .page-hero .hero-grid,
  .page-provider-portal main .shell,
  .page-clinic-portal main .shell,
  .page-provider-registration main .shell,
  .page-provider-login main .shell {
    width: calc(100% - 24px) !important;
    max-width: none !important;
  }

  .header-utility-inner,
  .site-header .header-inner {
    width: calc(100% - 24px) !important;
  }

  .header-utility-inner {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 2px;
    padding-block: 5px;
  }

  .header-utility-contact,
  .header-utility-nav {
    width: 100%;
    justify-content: space-between;
    gap: 4px 10px;
  }

  .header-utility-link {
    min-height: 30px;
    font-size: 10.5px;
    white-space: normal;
  }

  .brand > a,
  .brand img {
    width: 150px !important;
    height: 50px !important;
  }

  .mobile-menu nav {
    top: 48px;
  }

  main .section,
  .dental-how-section,
  .dental-services-section,
  .device-platform-section,
  .dental-difference-section {
    padding-block: 42px;
  }

  main h1 {
    font-size: clamp(2rem, 9vw, 2.65rem);
  }

  main h2 {
    font-size: clamp(1.55rem, 7vw, 2rem);
  }

  :where(
    .columns-2,
    .columns-3,
    .columns-4,
    .value-grid,
    .benefit-grid,
    .mode-grid,
    .pathway-grid,
    .dental-how-grid,
    .dental-service-grid,
    .dental-benefit-grid,
    .dental-difference-grid,
    .human-impact-grid,
    .therapy-foundations-grid,
    .connected-discipline-grid,
    .science-highlight-grid,
    .provider-network-facts,
    .support-topic-grid,
    .support-process-grid,
    .support-quick-links,
    .support-two-column,
    .support-policy-cards,
    .hipaa-rule-grid,
    .contact-quick-grid,
    .contact-form-grid,
    .iso-account-choice,
    .iso-form-grid,
    .iso-dashboard-kpis,
    .iso-dashboard-main-grid,
    .iso-resource-grid,
    .iso-team-grid,
    .iso-support-grid,
    .iso-account-grid,
    .iso-device-commerce-grid,
    .iso-band-catalog-grid,
    .iso-mini-stats,
    .iso-training-profile-grid,
    .iso-training-safety-grid,
    .iso-training-plan-grid,
    .iso-training-session-grid,
    .iso-no-phi-demo-grid,
    .iso-no-phi-pathways,
    .iso-dashboard-ai-guide nav,
    .iso-library-material-grid,
    .iso-library-detail-grid,
    .iso-neuro-domain-grid,
    .iso-neuro-status-grid,
    .iso-modes-summary-grid,
    .iso-modes-selection-grid,
    .iso-evidence-map-grid,
    .iso-evidence-quality-grid,
    .iso-evidence-device-grid,
    .iso-evidence-boundary-grid,
    .iso-evidence-measure-grid,
    .iso-evidence-language-grid,
    .iso-evidence-research-grid,
    .iso-referral-info-grid,
    .iso-referral-discipline-grid,
    .iso-referral-alert-grid,
    .iso-referral-home-grid,
    .iso-referral-report-grid,
    .iso-implementation-stage-grid,
    .iso-implementation-competency-grid,
    .iso-implementation-readiness-grid,
    .iso-implementation-session-grid,
    .iso-implementation-practical-grid,
    .iso-implementation-scale-grid,
    .iso-library-learning-jump,
    .iso-course-toc ol,
    .iso-course-concept-grid
  ) {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .iso-dashboard-v2-header,
  .iso-card-heading,
  .iso-dashboard-header,
  .iso-section-title,
  .iso-practical-panel-head,
  .iso-training-ai-coach-head {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  .iso-dashboard-card,
  .iso-dashboard-v2-header,
  .contact-form-card,
  .contact-details-card,
  .support-form-card,
  .support-panel,
  .wp-content-card {
    padding: clamp(16px, 4vw, 24px) !important;
  }

  .button-row,
  .provider-network-buttons,
  .support-contact-actions,
  .contact-ai-help-actions,
  .iso-form-actions,
  .iso-inline-form,
  .iso-dashboard-actions,
  .iso-commerce-navigation,
  .iso-library-footer-nav,
  .iso-implementation-action-row,
  .iso-cert-actions {
    width: 100%;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px;
  }

  :where(
    .button-row,
    .provider-network-buttons,
    .support-contact-actions,
    .contact-ai-help-actions,
    .iso-form-actions,
    .iso-inline-form,
    .iso-dashboard-actions,
    .iso-commerce-navigation,
    .iso-library-footer-nav,
    .iso-implementation-action-row,
    .iso-cert-actions
  ) :where(.button, button, a) {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    justify-content: center;
    text-align: center;
    white-space: normal;
  }

  .iso-dashboard-ai-summary {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .iso-dashboard-ai-summary > div {
    border-right: 0 !important;
    border-bottom: 1px solid var(--dashboard-border);
  }

  .iso-dashboard-ai-summary > div:last-child {
    border-bottom: 0;
  }

  .ai-help-voice-controls,
  .iso-dashboard-ai-chat .ai-help-voice-controls,
  .iso-training-ai-voice .ai-help-voice-controls {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100%;
    gap: 8px;
  }

  .ai-help-voice-controls .button,
  .iso-dashboard-ai-chat .ai-help-voice-controls .button,
  .iso-training-ai-voice .ai-help-voice-controls .button {
    width: 100%;
    min-width: 0;
    min-height: 44px;
  }

  .iso-training-course-row {
    grid-template-columns: 17px 30px minmax(0, 1fr) !important;
  }

  .iso-course-row-action {
    grid-column: 3;
    white-space: normal;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 28px;
  }

  .footer-brand {
    grid-column: auto !important;
  }

  .footer-bottom {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .footer-subscribe-form {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .shell,
  main .shell,
  .provider-network-shell,
  .science-innovation-section > .shell,
  .dental-structure-home > section > .shell,
  .dental-structure-home > aside > .shell,
  .dental-structure-home > .page-hero .hero-grid,
  .page-provider-portal main .shell,
  .page-clinic-portal main .shell,
  .page-provider-registration main .shell,
  .page-provider-login main .shell {
    width: calc(100% - 18px) !important;
  }

  .header-utility-inner,
  .site-header .header-inner {
    width: calc(100% - 18px) !important;
  }

  .brand > a,
  .brand img {
    width: 142px !important;
    height: 48px !important;
  }

  .mobile-menu summary {
    padding: 9px 12px;
    font-size: 13px;
  }

  .header-utility-link {
    font-size: 9.75px;
  }

  .header-utility-icon {
    width: 13px;
    height: 13px;
    flex-basis: 13px;
  }

  .header-utility-nav .header-utility-link:first-child span {
    max-width: 118px;
  }

  main h1 {
    font-size: clamp(1.85rem, 9.5vw, 2.4rem);
  }

  main h2 {
    font-size: clamp(1.45rem, 7.2vw, 1.85rem);
  }

  main .button,
  .button {
    min-height: 44px;
    white-space: normal;
  }

  :where(input, select, textarea) {
    font-size: 16px !important;
  }

  .iso-dashboard-nav li a {
    min-height: 44px;
    padding: 8px 10px;
    font-size: .72rem;
  }

  .iso-dashboard-card,
  .iso-dashboard-v2-header {
    padding: 15px !important;
  }

  .iso-dashboard-v2-header h2 {
    font-size: clamp(1.45rem, 8vw, 1.8rem);
  }

  .ai-help-voice-controls,
  .iso-dashboard-ai-chat .ai-help-voice-controls,
  .iso-training-ai-voice .ai-help-voice-controls {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ai-help-message,
  .ai-help-bubble {
    max-width: 100%;
  }

  .iso-training-workspace-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px;
  }

  .iso-training-workspace-actions .button {
    width: 100%;
  }

  .iso-band-product-card,
  .iso-band-catalog-hero,
  .iso-band-purchase-form,
  .iso-device-commerce-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .iso-band-product-visual,
  .iso-band-product-visual img,
  .iso-device-commerce-visual,
  .iso-device-commerce-visual img {
    width: 100%;
    min-height: 0 !important;
    height: auto !important;
    max-height: 320px;
    object-fit: contain;
  }

  .woocommerce form .form-row-first,
  .woocommerce form .form-row-last,
  .woocommerce-page form .form-row-first,
  .woocommerce-page form .form-row-last {
    width: 100% !important;
    float: none !important;
  }

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

  .footer-subscribe-form input[type="email"],
  .footer-subscribe-form button {
    min-height: 46px;
    border-radius: 7px;
  }
}

@media (max-width: 390px) {
  .header-utility-inner {
    width: calc(100% - 12px) !important;
  }

  .header-utility-contact {
    gap: 2px 6px;
  }

  .header-utility-contact .header-utility-icon {
    display: none;
  }

  .header-utility-link {
    font-size: 9px;
  }

  .brand > a,
  .brand img {
    width: 134px !important;
  }

  .mobile-menu nav {
    width: calc(100vw - 16px);
    right: -4px;
  }
}
