/* ==========================================================================
   RUANG THERAPY — MASTER MOBILE & TABLET RESPONSIVE SYSTEM
   100% Fluid, Bulletproof & Thumb-Friendly from 320px to 1024px
   ========================================================================== */

/* 1. GLOBAL MOBILE RESETS & OVERFLOW GUARDS */
* {
  max-width: 100%;
}

html, body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
  position: relative;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.editorial-grain-overlay {
  width: 100% !important;
  height: 100% !important;
  position: fixed !important;
}

/* 2. TABLET RESPONSIVENESS (1024px and below) */
@media (max-width: 1024px) {
  .hero-sanctuary-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
    text-align: center;
  }
  .hero-status-pill {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-cta-group {
    justify-content: center !important;
  }
  .founder-trust-card {
    margin: 24px auto 0 !important;
    text-align: left;
  }

  .tolerance-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .modalities-cards-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 18px !important;
  }

  .events-cards-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 18px !important;
  }

  .oohc-main-grid {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  .about-main-grid {
    grid-template-columns: 1fr !important;
    gap: 36px !important;
  }

  .timeline-milestones-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }

  .workbook-hub-banner {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .calc-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
}

/* 3. SMARTPHONE RESPONSIVENESS (768px and below) */
@media (max-width: 768px) {
  /* CONTAINER PADDING */
  .container {
    padding: 0 16px !important;
    width: 100% !important;
  }

  /* TYPOGRAPHY */
  h1, .hero-main-title { font-size: 2.2rem !important; line-height: 1.2 !important; }
  h2 { font-size: 1.75rem !important; line-height: 1.25 !important; }
  h3 { font-size: 1.3rem !important; }
  .hero-lead-text { font-size: 0.98rem !important; margin: 16px 0 24px !important; line-height: 1.7 !important; }

  /* HEADER & TOP ACTION BUTTONS */
  .wonder-header {
    padding: 10px 0 !important;
  }
  .nav-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
  .brand-avatar-mini {
    width: 36px !important;
    height: 36px !important;
  }
  .brand-logo-text {
    font-size: 1.6rem !important;
  }
  .brand-subline {
    display: none !important;
  }
  .nav-links-list {
    display: flex !important;
    gap: 8px !important;
    list-style: none !important;
  }
  .nav-links-list li:not(:last-child):not(:nth-last-child(2)) {
    display: none !important;
  }
  .nav-links-list .btn {
    padding: 7px 14px !important;
    font-size: 0.78rem !important;
  }
  .portal-entry-link {
    padding: 5px 10px !important;
    font-size: 0.72rem !important;
  }

  /* HERO SECTION */
  .hero-sanctuary-section {
    padding: 40px 0 50px !important;
  }
  .hero-cta-group {
    flex-direction: column !important;
    width: 100% !important;
  }
  .hero-cta-group .btn {
    width: 100% !important;
  }

  /* SOMATIC BREATH LAB */
  .somatic-wonder-card {
    padding: 24px 16px !important;
    border-radius: 20px !important;
  }
  .somatic-header-bar {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: center !important;
  }
  .somatic-mode-switcher {
    flex-wrap: wrap !important;
    justify-content: center !important;
    width: 100% !important;
  }
  .somatic-mode-btn {
    font-size: 0.7rem !important;
    padding: 5px 10px !important;
  }
  .canvas-breath-wrapper {
    width: 210px !important;
    height: 210px !important;
    margin: 14px auto !important;
  }
  .breath-center-touchpoint {
    width: 115px !important;
    height: 115px !important;
  }
  .touchpoint-title { font-size: 1.25rem !important; }
  .soundscape-console-bar {
    flex-direction: column !important;
    gap: 14px !important;
    align-items: stretch !important;
  }
  .audio-knob-group {
    justify-content: space-between !important;
    width: 100% !important;
  }
  .audio-slider {
    width: 120px !important;
  }

  /* VALUES SECTION */
  .values-showcase-section {
    padding: 60px 0 !important;
  }
  .values-wonder-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .value-wonder-card {
    padding: 24px 20px !important;
  }

  /* 3D REFLECTION DECK */
  .reflection-wonder-section {
    padding: 60px 0 !important;
  }
  .deck-filter-chips-row {
    display: flex !important;
    justify-content: flex-start !important;
    overflow-x: auto !important;
    padding: 4px 0 12px !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
    width: 100% !important;
  }
  .filter-chip-btn {
    flex-shrink: 0 !important;
    white-space: nowrap !important;
    font-size: 0.72rem !important;
    padding: 6px 14px !important;
  }
  .deck-3d-stage {
    width: 100% !important;
  }
  .card-flipper-3d {
    min-height: 480px !important;
  }
  .card-pane {
    padding: 24px 18px !important;
    border-radius: 20px !important;
  }
  .card-quote-display {
    font-size: 1.3rem !important;
    line-height: 1.4 !important;
    margin: 16px 0 !important;
  }
  .somatic-tags-row {
    gap: 4px !important;
  }
  .somatic-tag-btn {
    font-size: 0.68rem !important;
    padding: 4px 10px !important;
  }
  .deck-action-buttons-row {
    flex-direction: column !important;
    gap: 10px !important;
  }
  .deck-action-buttons-row .btn {
    width: 100% !important;
  }
  .deck-bridge-card {
    flex-direction: column !important;
    text-align: center !important;
    padding: 24px 18px !important;
    gap: 16px !important;
  }
  .deck-bridge-card .btn {
    width: 100% !important;
  }

  /* CLINICAL CARE & TRIAGE */
  .clinical-section {
    padding: 60px 0 !important;
  }
  .tolerance-lab-card {
    padding: 24px 16px !important;
    border-radius: 20px !important;
    margin-bottom: 40px !important;
  }
  .tolerance-zone-bar {
    padding: 16px 14px !important;
  }
  .tolerance-detail-panel {
    padding: 22px 16px !important;
  }
  .modalities-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
    margin-bottom: 40px !important;
  }
  .modality-card {
    padding: 24px 18px !important;
  }
  .calculator-box-card {
    padding: 24px 16px !important;
    border-radius: 20px !important;
  }
  .calc-output-display {
    padding: 22px 16px !important;
  }
  .calc-total-badge {
    font-size: 2.2rem !important;
  }

  /* OOHC STATUTORY GATEWAY */
  .oohc-gateway-section {
    padding: 60px 0 !important;
  }
  .oohc-trust-panel {
    padding: 24px 18px !important;
  }
  .caseworker-wizard-card {
    padding: 24px 16px !important;
    border-radius: 20px !important;
  }
  .wizard-step-container {
    min-height: auto !important;
  }
  .concierge-form-row {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* COMMUNITY ENGINE */
  .community-section {
    padding: 60px 0 !important;
  }
  .events-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    margin-bottom: 40px !important;
  }
  .event-wonder-card {
    padding: 24px 18px !important;
  }
  .workbook-hub-banner {
    padding: 24px 18px !important;
    border-radius: 20px !important;
  }
  .workbook-hub-banner div[style*="display: flex; gap: 10px;"] {
    flex-direction: column !important;
    width: 100% !important;
  }
  .workbook-hub-banner .btn {
    width: 100% !important;
  }
  .workshop-qr-bridge-card {
    flex-direction: column !important;
    text-align: center !important;
    padding: 24px 18px !important;
    gap: 20px !important;
  }

  /* MEET ALEXA FOUNDER SECTION */
  .about-founder-section {
    padding: 60px 0 !important;
  }
  .founder-hero-image-box {
    aspect-ratio: 1 / 1 !important;
  }
  .founder-floating-badge {
    position: static !important;
    margin-top: 16px !important;
    justify-content: center !important;
  }
  .founder-thumbnails-row {
    justify-content: center !important;
    gap: 8px !important;
    margin-top: 18px !important;
  }
  .founder-thumb-btn {
    width: 56px !important;
    height: 56px !important;
  }
  .credentials-pills-wrap {
    gap: 6px !important;
  }
  .cred-chip {
    font-size: 0.7rem !important;
    padding: 4px 10px !important;
  }
  .founder-timeline-section {
    padding: 24px 16px !important;
    border-radius: 20px !important;
  }
  .timeline-milestones-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* ALL MODALS (IN-APP CONCIERGE, CONTRACT, PORTAL & RSVP) */
  .concierge-modal-backdrop,
  .supports-contract-modal,
  .practitioner-portal-modal,
  .rsvp-modal-backdrop {
    padding: 0 !important;
    align-items: flex-end !important;
  }
  .concierge-booking-window,
  .contract-document-sheet,
  .portal-workspace-window,
  .portal-login-card,
  .rsvp-window {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    border-radius: 24px 24px 0 0 !important;
    padding: 24px 16px !important;
    overflow-y: auto !important;
    position: fixed !important;
    bottom: 0 !important;
  }
  .concierge-header-strip {
    padding: 16px !important;
  }
  .concierge-body-content {
    padding: 16px !important;
  }
  .concierge-footer-bar {
    padding: 14px 16px !important;
  }
  .services-choice-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .location-options-row {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  .time-slots-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  /* PRACTITIONER PORTAL WORKSPACE */
  .os-metrics-summary {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .os-metric-box {
    padding: 12px 10px !important;
  }
  .os-metric-num {
    font-size: 1.4rem !important;
  }

  /* FLOATING SANCTUARY QUICK DOCK */
  .floating-sanctuary-dock {
    bottom: 12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100% - 24px) !important;
    max-width: 400px !important;
    padding: 6px 8px !important;
    gap: 4px !important;
    justify-content: space-between !important;
    border-radius: 30px !important;
  }
  .dock-item-btn {
    font-size: 0.72rem !important;
    padding: 6px 8px !important;
    gap: 4px !important;
  }
  .dock-divider {
    height: 16px !important;
  }

  /* FOOTER */
  footer {
    padding: 40px 0 100px !important;
    text-align: center !important;
  }
  footer .container {
    flex-direction: column !important;
    text-align: center !important;
    gap: 16px !important;
  }
  footer div {
    text-align: center !important;
  }
}

/* 4. ULTRA-SMALL SCREENS (320px - 375px) */
@media (max-width: 375px) {
  h1, .hero-main-title { font-size: 1.9rem !important; }
  h2 { font-size: 1.55rem !important; }
  .btn { padding: 11px 18px !important; font-size: 0.82rem !important; }
  .day-pill-btn { min-width: 60px !important; padding: 8px 4px !important; }
  .day-pill-num { font-size: 1.15rem !important; }
  .card-quote-display { font-size: 1.15rem !important; }
  .floating-sanctuary-dock .dock-item-btn:nth-child(3) {
    display: none !important;
  }
}
