/* ============================================
   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 (.full_9d1e) is a descendant of
   .static-8bc6 (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.photo_glass_6f0e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".clean-22a2" 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.frame-5e61 so it can't cause
   horizontal overflow anyway. */
.text_e71f,
.element_small_b37a,
.info-26b4,
.module-up-db4e,
.focused-cdbf,
.modal_a600,
.wrapper_current_2a1c,
.mask-25b6,
.green_acb3,
.warm-bf6c,
.component-hot-7a5c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .avatar-517b {
    padding: 8px 0;
  }
  
  .hard_48a4 img {
    height: 28px;
    width: auto;
  }
  
  .backdrop_yellow_bfb1 {
    display: none !important;
  }
  
  .shadow_8a13 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .shadow_8a13 svg {
    width: 14px;
    height: 14px;
  }
  
  .caption_complex_ac37 {
    padding: 6px;
  }
  
  .mask_3c93 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .info-26b4,
  .element_small_b37a,
  .module-up-db4e,
  .focused-cdbf,
  .paragraph_soft_7b66,
  .button_896e,
  .pro-9794,
  .over_2420,
  .info_532d,
  .filter_61d7,
  .table_tiny_6535,
  .outline-stale-4d44 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tabs-553d,
  .content_up_e8c3 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .aside_cold_4f66,
  .avatar-19de,
  .video-3481,
  .article-576a,
  .summary-cold-6e4b,
  .warm-1584,
  .section-paper-c3c0 {
    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 */
  .mask_over_f015,
  .stale-4fed,
  .layout_hovered_9891,
  .complex-3ef3,
  .bright-7cfa {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .large-0b18,
  .panel_0a75,
  .middle-b357,
  .small-6ef7 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .alert-8f43,
  .lower-d8cc {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .picture-eada,
  .fixed-711e,
  .overlay-cold-dd14,
  .copper-4306 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .old_f9a0,
  .silver-d598,
  .smooth-4ccb,
  .feature_static_1b54,
  .warm-9558,
  .pink_99f3 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .mask_over_f015,
  .stale-4fed,
  .complex-3ef3 {
    max-width: none !important;
  }
  
  .clean-22a2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .large-0b18 {
    font-size: 1.5rem !important;
  }
  
  .panel_0a75 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .light-4f87,
  .chip-0556 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .middle-b357 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .notification-c25a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tertiary_short_5331 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .mask_over_f015,
  .complex-3ef3 {
    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: 6ad2 */
.widget-item-l4 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.3;
}
