/* ============================================
   CRITICAL MOBILE FIXES
   Additional layer to ensure perfect mobile display
   ============================================ */

/* Prevent horizontal scroll at all costs */
html {
  width: 100%;
  scroll-behavior: smooth;
  /* NO position:relative - it breaks sticky! */
  /* NO overflow-x here either - mixed with body's overflow-x: hidden
     it makes <html> its own scroll container and breaks sticky too! */
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  /* NO position:relative - it breaks sticky! */
}

/* Ensure all major containers respect viewport */
/* NOTE: "nav" is intentionally excluded here. Giving a <nav> element
   overflow-x: hidden makes its overflow-y auto-compute to "auto" (per the
   CSS overflow spec), turning it into a clipping/scroll container. Since
   the header's dropdown submenu (.backdrop-slow-2564) is a descendant of
   .info-last-323a (a <nav>), it was getting clipped and forced into a tiny
   internal scrollbar instead of opening naturally below the nav link. */
main,
section,
article,
footer {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header must NOT have max-width restriction for sticky to work */
header.focus_liquid_975b {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".link-4388" is intentionally excluded here for the same reason as
   "nav" above — the header's <div class="container"> wraps the nav and
   must not clip the dropdown submenu with an auto-computed overflow-y.
   It's already width-capped via max-width in style.popup-pro-d630 so it can't cause
   horizontal overflow anyway. */
.outline-over-a8e7,
.banner-white-4548,
.steel-6781,
.tooltip_0102,
.content_clean_29e2,
.red_307b,
.grid-copper-395a,
.north-e97d,
.thick-839d,
.copper-6655,
.thumbnail-2b0e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .preview_20b2 {
    padding: 8px 0;
  }
  
  .simple-d23e img {
    height: 28px;
    width: auto;
  }
  
  .wood-020b {
    display: none !important;
  }
  
  .icon-glass-6a60 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .icon-glass-6a60 svg {
    width: 14px;
    height: 14px;
  }
  
  .pink-c5ab {
    padding: 6px;
  }
  
  .shade-d8a4 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .steel-6781,
  .banner-white-4548,
  .tooltip_0102,
  .content_clean_29e2,
  .south_6778,
  .feature_mini_ee5a,
  .motion_a5ff,
  .breadcrumb-7f75,
  .purple-258d,
  .preview_warm_82f2,
  .header_bright_dcba,
  .notification_fast_f984 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .steel-85ce,
  .button-1ea9 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .text-in-8c98,
  .dynamic-bb46,
  .glass-af95,
  .advanced_1349,
  .pattern-hovered-c823,
  .photo_purple_ca24,
  .solid-eab3 {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  
  /* Ensure images are responsive */
  img,
  svg,
  picture {
    max-width: 100% !important;
    height: auto !important;
  }
  
  /* Better padding for mobile */
  .tiny-035c,
  .layout-0a8b,
  .header_purple_ca36,
  .layout-glass-36d9,
  .primary_bd3d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .modal-motion-99b5,
  .rough_9bba,
  .container-fresh-c982,
  .tooltip-89c9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .focus-a7dd,
  .form-light-ff31 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tertiary_29af,
  .blue-115d,
  .pink_415d,
  .steel-1566 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .light_5055,
  .tag_3435,
  .surface-b1e5,
  .mini-d6a8,
  .complex_66e0,
  .white-5016 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .tiny-035c,
  .layout-0a8b,
  .layout-glass-36d9 {
    max-width: none !important;
  }
  
  .link-4388 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .modal-motion-99b5 {
    font-size: 1.5rem !important;
  }
  
  .rough_9bba {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .header_white_0d7d,
  .hovered-02f2 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .container-fresh-c982 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .grid_7c97 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .progress_2715 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .tiny-035c,
  .layout-glass-36d9 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

/* iPhone X and notch devices */
@supports (padding: max(0px)) {
  body {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
}

/* css-noise: bd89 */
.widget-item-b8 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.0;
}
