/* ==========================================================================
   ALPHACARE REVENUE SOLUTIONS - COMPREHENSIVE RESPONSIVE DESIGN SYSTEM
   Covers ALL grids and layouts from reference-theme.css + components.css
   Breakpoints:
   - Tablet & Small Laptops (<= 1024px)
   - Mobile & Phablet (<= 768px)
   - Small Smartphones (<= 480px)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Global Responsive Safeguards (always active)
   -------------------------------------------------------------------------- */
html {
  overflow-x: clip !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 0 !important;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: clip !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative;
}

.responsive-overflow-guard {
  overflow-x: hidden;
}

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

main,
header,
footer,
section {
  max-width: 100vw;
  overflow-x: clip;
}

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

/* Default desktop grid definitions for class-based grids */
.specialties-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.workflow-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.software-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.about-info-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.values-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

/* --------------------------------------------------------------------------
   1b. Ultra-wide PC & 4K Display Safeguards (min-width: 1440px)
   -------------------------------------------------------------------------- */
@media (min-width: 1440px) {
  .container,
  .section-container,
  .header-inner,
  .footer-container-ref,
  .us-map-container,
  .page-hero-container {
    max-width: 1400px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* --------------------------------------------------------------------------
   2. Tablet & Smaller Laptops (<= 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root {
    --header-height: 72px;
  }

  /* Hide top announcement strip on tablet/mobile */
  .top-strip-cyan,
  .top-strip,
  .top-bar {
    display: none !important;
  }

  .container,
  .section-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    max-width: 100% !important;
  }

  .site-header .header-inner {
    padding: 0 1.5rem;
    max-width: 100% !important;
  }

  /* Hero — collapse 2-column to stacked */
  .hero-container,
  .ref-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
    max-width: 100% !important;
  }

  .hero-content,
  .ref-hero-grid > *:first-child {
    text-align: center;
    max-width: 750px;
    margin: 0 auto;
  }

  .hero-cta-group,
  .hero-trust-row {
    justify-content: center;
  }

  .hero-visual,
  .hero-dashboard-composite {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }

  /* Feature Bar — 4col to 2col */
  .feature-bar-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  /* Clinical Section — 2col to stacked */
  .clinical-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  /* Workflow & RCM — 2col to stacked (supplements reference-theme rule) */
  .workflow-content-grid,
  .rcm-solutions-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* Comparison Matrix — 2col to stacked */
  .comparison-matrix-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* EHR Logo Grid — 4col to 3col */
  .ehr-logo-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.25rem !important;
  }

  /* Testimonials — 3col to 2col */
  .testimonial-card-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  /* Metric Cards — 4col to 2col */
  .metric-cards-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }

  /* Map Layout — 2col to stacked */
  .map-layout-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* Services Grid — 3col to 2col */
  .services-grid-redesigned {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  /* Services KPI Strip — 4col to 2col */
  .services-kpi-strip {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }

  /* Pricing Grid — 3col to stacked */
  .pricing-tier-grid {
    grid-template-columns: 1fr !important;
    max-width: 540px !important;
    margin: 0 auto !important;
    gap: 2rem !important;
  }

  .pricing-tier-featured {
    transform: none !important;
  }

  .pricing-tier-featured:hover {
    transform: translateY(-6px) !important;
  }

  /* Calculator — 2col to stacked */
  .calculator-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  .calculator-card {
    padding: 2.5rem 1.5rem !important;
  }

  /* Contact Grid */
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  /* Leadership Card */
  .leadership-card {
    grid-template-columns: 1fr !important;
    text-align: center !important;
    gap: 2rem !important;
    padding: 2.5rem !important;
  }

  .leader-avatar-col {
    margin: 0 auto;
  }

  /* Audit Form — 2col to stacked */
  .audit-form {
    grid-template-columns: 1fr !important;
  }

  /* Workflow Grid */
  .workflow-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  /* Lead CTA Card */
  .lead-cta-card {
    flex-direction: column !important;
    text-align: center !important;
    padding: 2.5rem 1.75rem !important;
  }

  .lead-cta-action {
    width: 100% !important;
  }

  .btn-white-pill {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Comparison Table scroll wrapper */
  .pricing-table-wrapper,
  .pricing-comparison-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: block;
    margin: 0 auto;
    padding-bottom: 0.5rem;
  }

  .pricing-comparison-table {
    min-width: 680px;
  }

  /* Footer — 4col to 2col */
  .footer-grid,
  .footer-grid-ref {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2.5rem !important;
  }

  /* Footer CTA Banner */
  .footer-cta-banner {
    flex-direction: column !important;
    text-align: center !important;
    padding: 2.5rem 1.5rem !important;
  }

  .footer-cta-actions {
    justify-content: center !important;
  }

  /* Inline style overrides for pages with hardcoded grid-template-columns */
  [style*="grid-template-columns: repeat(auto-fit, minmax(320px"] {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  }

  [style*="grid-template-columns: repeat(auto-fit, minmax(300px"] {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)) !important;
  }

  [style*="grid-template-columns: repeat(auto-fit, minmax(260px"] {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
  }

  /* Workflow Pill Tabs — scroll horizontally */
  .workflow-pill-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start !important;
    padding-bottom: 0.5rem;
    gap: 0.5rem !important;
  }

  .workflow-pill-tabs .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* RCM Vertical Tabs — horizontal on tablet */
  .rcm-vertical-tabs {
    flex-direction: row !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.75rem !important;
    gap: 0.5rem !important;
  }

  .rcm-vertical-tabs .tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    min-width: max-content;
  }
}

/* --------------------------------------------------------------------------
   3. Mobile Devices & Standard Smartphones (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  :root {
    --space-3xl: 3.5rem;
  }

  /* Top Bar — hide for clean mobile */
  .top-strip,
  .top-bar,
  .top-strip-cyan {
    display: none !important;
  }

  /* Prevent text overflow on mobile without breaking sticky header */
  body,
  main,
  section {
    overflow-x: clip;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Single-Tier Mobile Sticky Header */
  .site-header {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 10000 !important;
    height: 68px !important;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .header-inner {
    padding: 0 1rem !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .nav-links,
  nav[aria-label="Main Navigation"],
  .nav-actions .nav-cta {
    display: none !important;
  }

  .hamburger {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    padding: 8px !important;
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    z-index: 1002 !important;
  }

  /* Mobile Navigation Drawer */
  .mobile-drawer {
    display: none;
    position: fixed !important;
    top: 68px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: calc(100vh - 68px) !important;
    background: rgba(255, 255, 255, 0.98) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    padding: 1.5rem 1.25rem !important;
    flex-direction: column !important;
    gap: 1rem !important;
    z-index: 99999 !important;
    border-top: 1px solid #E2E8F0 !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  .mobile-drawer.open {
    display: flex !important;
  }

  /* Brand logo — smaller on mobile */
  .brand-name {
    font-size: 1.1rem !important;
  }

  .brand-tagline {
    font-size: 0.6rem !important;
  }

  .brand-emblem {
    width: 36px !important;
    height: 36px !important;
  }

  /* Typography Scaling */
  h1,
  .hero-title,
  .page-title,
  .ref-hero-title {
    font-size: clamp(1.85rem, 5.5vw, 2.3rem) !important;
    line-height: 1.25 !important;
  }

  h2,
  .section-title,
  .clinical-content h2 {
    font-size: 1.65rem !important;
    line-height: 1.3 !important;
  }

  h3 {
    font-size: 1.15rem !important;
  }

  .hero-description,
  .page-subtitle,
  .ref-hero-desc {
    font-size: 0.98rem !important;
    line-height: 1.6 !important;
  }

  /* Section Paddings */
  section,
  .section,
  .page-hero-section,
  .ref-hero-section,
  .clinical-section,
  .workflow-section-ref,
  .rcm-solutions-section,
  .comparison-section-ref,
  .ehr-compatibility-section,
  .metric-cards-section,
  .us-map-section,
  .pricing-table-section {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
    max-width: 100vw !important;
    overflow-x: clip !important;
  }

  /* Hero Section — fully stacked & fluid */
  .ref-hero-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    padding: 0 1rem !important;
    max-width: 100% !important;
    width: 100% !important;
  }

  .ref-hero-content {
    max-width: 100% !important;
    width: 100% !important;
    text-align: center;
  }

  .ref-hero-grid > *:first-child {
    text-align: center;
    max-width: 100% !important;
    width: 100% !important;
  }

  .hero-pill-badge {
    margin-left: auto;
    margin-right: auto;
    font-size: 0.78rem !important;
    padding: 0.35rem 0.85rem !important;
    max-width: 100% !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.4 !important;
  }

  /* Hero Lead Search Pill */
  .hero-search-pill {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    margin-bottom: 1.5rem !important;
    box-sizing: border-box !important;
  }

  /* Hero KPI Row */
  .hero-kpi-row {
    justify-content: center !important;
    width: 100% !important;
    gap: 0.75rem !important;
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .hero-kpi-pill {
    font-size: 0.78rem !important;
    padding: 0.35rem 0.75rem !important;
  }

  /* Hero Dashboard Composite - make fully fluid, no overflow */
  .hero-dashboard-composite,
  .hero-dashboard-composite * {
    transform: none !important;
  }

  .hero-dashboard-composite {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 1rem !important;
    margin: 1.5rem auto 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .dash-card-main {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 1.25rem 1rem !important;
    border-radius: 16px !important;
    box-sizing: border-box !important;
  }

  .floating-dash-card {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    animation: none !important;
    transform: none !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 15px rgba(10, 37, 64, 0.08) !important;
  }

  .float-gauge-card {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 0.85rem 1.25rem !important;
    border-radius: 12px !important;
    text-align: left !important;
  }

  .float-gauge-card .gauge-val {
    font-size: 1.4rem !important;
  }

  .float-doctor-card {
    display: flex !important;
    align-items: center !important;
    gap: 0.85rem !important;
    padding: 0.85rem 1.25rem !important;
    border-radius: 12px !important;
  }

  /* Hero Action Buttons — stacked */
  .hero-cta-group,
  .hero-actions {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .hero-cta-group .btn,
  .hero-actions .btn,
  .hero-actions a {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* Specialties Blue Banner */
  .specialties-blue-banner {
    padding: 3.5rem 1rem !important;
  }

  .specialties-blue-banner h2 {
    font-size: 1.75rem !important;
  }

  .specialty-tag-cloud {
    max-width: 100% !important;
    gap: 0.5rem !important;
  }

  .specialty-tag-item {
    font-size: 0.82rem !important;
    padding: 0.4rem 0.85rem !important;
  }

  /* Feature Bar — 2col to stacked */
  .feature-bar-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
    padding: 0 1rem !important;
    max-width: 100% !important;
  }

  .feature-bar-card {
    padding: 1rem !important;
  }

  /* Clinical Grid — already stacked from 1024, ensure padding */
  .clinical-grid {
    padding: 0 1.25rem !important;
  }

  .clinical-content h2 {
    font-size: 1.65rem !important;
  }

  /* Dashboard Card in Clinical Section */
  .dash-stat-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .collections-mini-stats {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* Metrics Strip & KPI cards */
  .metrics-strip,
  .kpi-grid,
  .dashboard-stats-row {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .kpi-strip-card {
    padding: 1.25rem !important;
  }

  /* Services Grid — stacked */
  .services-grid,
  .services-grid-redesigned {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  /* Services KPI Strip — stacked */
  .services-kpi-strip {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Workflow Grid */
  .workflow-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Specialties Grid */
  .specialties-grid,
  .about-info-grid,
  .values-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
  }

  /* Software Grid — 2 columns on mobile */
  .software-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }

  .specialty-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .spec-tab {
    white-space: nowrap;
  }

  /* EHR Logo Grid — 3col to 2col */
  .ehr-logo-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
    padding: 0 1rem !important;
  }

  .ehr-item-card {
    padding: 1rem 0.75rem !important;
  }

  /* Testimonials — 2col to stacked */
  .testimonial-card-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem !important;
    padding: 0 1rem !important;
  }

  /* Metric Cards — 2col to stacked */
  .metric-cards-row {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
    padding: 0 1rem !important;
  }

  .metric-val {
    font-size: 2.2rem !important;
  }

  /* Map Layout — stacked */
  .map-layout-grid {
    padding: 0 1rem !important;
  }

  /* Pricing Comparison Table */
  .pricing-table-wrapper,
  .pricing-comparison-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    border: 1px solid #E2E8F0;
  }

  .pricing-comparison-table {
    min-width: 620px;
    font-size: 0.9rem;
  }

  .pricing-comparison-table th,
  .pricing-comparison-table td {
    padding: 0.85rem 1rem !important;
  }

  /* Calculator Section */
  .calculator-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .calc-slider-box {
    padding: 1.25rem;
  }

  .calculator-result-card,
  .calculator-card {
    padding: 1.75rem 1.25rem !important;
  }

  .result-metrics-grid {
    grid-template-columns: 1fr;
  }

  .result-row-split {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  /* Audit Form */
  .audit-form {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Form Rows */
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Contact Grid */
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    padding: 0 1rem !important;
  }

  /* Leadership Card */
  .leadership-card {
    grid-template-columns: 1fr !important;
    text-align: center !important;
    gap: 1.5rem !important;
    padding: 2rem 1.5rem !important;
  }

  /* Pre-footer Consultation Banner */
  .footer-cta-banner {
    flex-direction: column !important;
    text-align: center !important;
    gap: 1.5rem !important;
    padding: 2rem 1.25rem !important;
  }

  .footer-cta-actions {
    flex-direction: column !important;
    width: 100% !important;
  }

  .footer-cta-actions .btn {
    width: 100% !important;
    text-align: center !important;
  }

  /* Lead CTA Card */
  .lead-cta-card {
    flex-direction: column !important;
    text-align: center !important;
    padding: 2rem 1.25rem !important;
    gap: 1.5rem !important;
  }

  .lead-cta-content {
    max-width: 100% !important;
  }

  /* Footer — stacked */
  .footer-grid,
  .footer-grid-ref {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  .footer-bottom,
  .footer-bottom-ref {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-bottom-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  /* Inline style overrides — force single column on mobile */
  [style*="grid-template-columns: repeat(auto-fit, minmax(320px"] {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: repeat(auto-fit, minmax(300px"] {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: repeat(auto-fit, minmax(260px"] {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: repeat(auto-fit, minmax(220px"] {
    grid-template-columns: 1fr !important;
  }

  [style*="grid-template-columns: repeat(auto-fit, minmax(160px"] {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
  }

  /* Page hero max-width constraint */
  .ref-hero-grid,
  .feature-bar-grid,
  .clinical-grid,
  .workflow-content-grid,
  .rcm-solutions-grid,
  .comparison-matrix-grid,
  .ehr-logo-grid,
  .testimonial-card-grid,
  .metric-cards-row,
  .us-map-container,
  .footer-container-ref {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* RCM Vertical Tabs — stacked on mobile */
  .rcm-vertical-tabs {
    flex-direction: row !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem !important;
    gap: 0.5rem !important;
  }

  .rcm-vertical-tabs .tab-btn {
    font-size: 0.85rem !important;
    padding: 0.65rem 0.85rem !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Workflow pill tabs on mobile */
  .workflow-pill-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start !important;
    flex-wrap: nowrap !important;
    padding: 0 1rem 0.5rem !important;
    gap: 0.5rem !important;
  }

  .workflow-pill-tabs .tab-btn {
    font-size: 0.85rem !important;
    padding: 0.5rem 1.1rem !important;
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Service card modern — reduce padding */
  .service-card-modern {
    padding: 1.75rem 1.5rem !important;
  }

  /* Pricing guarantee bar */
  .pricing-guarantee-bar {
    flex-direction: column !important;
    text-align: center !important;
    gap: 0.5rem !important;
    padding: 0.75rem 1rem !important;
    font-size: 0.85rem !important;
  }

  /* Pricing tier card — reduce padding */
  .pricing-tier-card {
    padding: 2rem 1.5rem !important;
  }

  /* Hero badge centering on mobile */
  .hero-pill-badge {
    display: inline-flex;
    margin-left: auto;
    margin-right: auto;
  }

  /* Ensure all max-width containers don't overflow */
  .container,
  .section-container,
  .footer-container-ref,
  .us-map-container {
    max-width: 100% !important;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* Calculator value display */
  .calc-value-display {
    font-size: 1.2rem !important;
  }

  /* Comparison cards — full width */
  .comparison-card-red,
  .comparison-card-green {
    padding: 2rem 1.5rem !important;
  }

  /* Austin HQ card */
  .austin-card {
    padding: 1.5rem !important;
  }

  /* About page avatar */
  [style*="width: 200px; height: 200px; border-radius: 50%"] {
    width: 150px !important;
    height: 150px !important;
    font-size: 3rem !important;
  }
}

/* --------------------------------------------------------------------------
   4. Small Smart Phones (<= 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  /* Ultra-compact Section Spacing */
  section,
  .section,
  .page-hero-section,
  .ref-hero-section,
  .clinical-section,
  .workflow-section-ref,
  .rcm-solutions-section,
  .comparison-section-ref,
  .ehr-compatibility-section,
  .metric-cards-section,
  .us-map-section {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }

  .container,
  .section-container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  /* Typography */
  h1,
  .hero-title,
  .page-title,
  .ref-hero-title {
    font-size: 1.75rem !important;
  }

  /* Hero search pill stack on mobile */
  .hero-search-pill {
    flex-direction: column !important;
    border-radius: 16px !important;
    padding: 0.5rem !important;
    gap: 0.5rem !important;
  }

  .hero-search-pill input {
    width: 100% !important;
    text-align: center !important;
    padding: 0.65rem 0.5rem !important;
    font-size: 0.9rem !important;
  }

  .hero-search-pill .btn-search-audit {
    width: 100% !important;
    text-align: center !important;
    padding: 0.75rem 1rem !important;
    border-radius: 12px !important;
    font-size: 0.9rem !important;
  }

  /* Dual CTA buttons stack */
  .ref-hero-content > div[style*="display: flex"] {
    flex-direction: column !important;
    width: 100% !important;
    gap: 0.75rem !important;
  }

  .ref-hero-content > div[style*="display: flex"] .btn {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  h2,
  .section-title,
  .clinical-content h2 {
    font-size: 1.35rem !important;
  }

  h3 {
    font-size: 1.05rem !important;
  }

  .section-tag,
  .section-eyebrow {
    font-size: 0.72rem !important;
  }

  /* Feature bar — smaller text */
  .feature-bar-text strong {
    font-size: 0.82rem !important;
  }

  .feature-bar-text small {
    font-size: 0.68rem !important;
  }

  .feature-bar-icon {
    width: 38px !important;
    height: 38px !important;
    font-size: 1.1rem !important;
  }

  /* EHR Grid — 2col stays, smaller cards */
  .ehr-logo-grid {
    gap: 0.75rem !important;
  }

  .ehr-item-card {
    padding: 0.85rem 0.5rem !important;
    border-radius: 10px !important;
  }

  /* Forms Stack on Small Screens */
  .form-row {
    grid-template-columns: 1fr !important;
    gap: 0.85rem !important;
    margin-bottom: 0.85rem !important;
  }

  .audit-form-wrap {
    padding: 1.5rem !important;
  }

  /* Calculator Result */
  .result-row-split {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .result-amount,
  .result-number,
  .result-stat {
    font-size: 1.8rem !important;
  }

  /* Guarantee Bar */
  .pricing-guarantee-bar {
    flex-direction: column !important;
    text-align: center !important;
    gap: 0.5rem !important;
    padding: 0.65rem 0.75rem !important;
    font-size: 0.8rem !important;
  }

  /* Tier Cards */
  .pricing-tier-card {
    padding: 1.75rem 1rem !important;
  }

  .tier-rate-number {
    font-size: 2.75rem !important;
  }

  /* Metric cards */
  .metric-val {
    font-size: 2rem !important;
  }

  .metric-card-box {
    padding: 1.5rem 1rem !important;
  }

  /* Clinical checklist */
  .clinical-checklist li {
    font-size: 0.88rem !important;
  }

  /* RCM detail card */
  .rcm-detail-card {
    padding: 1.5rem !important;
  }

  .rcm-detail-actions {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }

  .rcm-detail-actions .btn {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
  }

  /* Comparison cards */
  .comparison-card-red,
  .comparison-card-green {
    padding: 1.5rem 1rem !important;
  }

  /* Calculator card */
  .calculator-card {
    padding: 1.5rem 1rem !important;
  }

  .calc-label {
    font-size: 0.95rem !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
  }

  /* Lead CTA */
  .lead-cta-card {
    padding: 1.75rem 1rem !important;
  }

  .lead-cta-title {
    font-size: 1.5rem !important;
  }

  .lead-cta-desc {
    font-size: 0.95rem !important;
  }

  /* Footer */
  .footer-deep-blue {
    padding: 3rem 0 1.5rem !important;
  }

  .footer-col-ref h4 {
    font-size: 0.95rem !important;
  }

  .footer-links-ref a {
    font-size: 0.85rem !important;
  }

  /* Testimonial cards */
  .ref-testi-card {
    padding: 1.5rem !important;
  }

  /* Service cards */
  .service-card-modern {
    padding: 1.5rem 1.25rem !important;
  }

  /* Hero trust badges */
  .hero-trust-row {
    flex-wrap: wrap !important;
    gap: 0.5rem !important;
  }

  /* Contact form inputs & iOS auto-zoom prevention */
  input,
  select,
  textarea,
  input[style*="width: 100%; padding: 0.75rem"],
  select[style*="width: 100%; padding: 0.75rem"],
  textarea[style*="width: 100%; padding: 0.75rem"] {
    font-size: 16px !important; /* Prevents iOS zoom on focus */
  }

  /* Inline style overrides — force 2col on small grids */
  [style*="grid-template-columns: repeat(auto-fit, minmax(160px"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.75rem !important;
  }
}

/* --------------------------------------------------------------------------
   5. Very Small Screens (<= 360px)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  h1,
  .hero-title,
  .page-title,
  .ref-hero-title {
    font-size: 1.5rem !important;
  }

  h2,
  .section-title {
    font-size: 1.2rem !important;
  }

  .container,
  .section-container {
    padding-left: 0.625rem !important;
    padding-right: 0.625rem !important;
  }

  /* EHR Grid — single column on very small */
  .ehr-logo-grid {
    grid-template-columns: 1fr !important;
  }

  .feature-bar-grid {
    padding: 0 0.625rem !important;
  }

  .brand-tagline {
    display: none !important;
  }
}
