/* ============================================
   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 (.sidebar-middle-7f67) is a descendant of
   .green_a3df (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.article-cold-5959 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dim-c382" 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.solid_9d53 so it can't cause
   horizontal overflow anyway. */
.hidden_4062,
.complex-c928,
.caption_slow_8b7e,
.alert_b5b9,
.soft_ff30,
.link_daac,
.up-cfdb,
.down-d394,
.list_f78b,
.label-f6fb,
.overlay_b843 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .sidebar_7b2a {
    padding: 8px 0;
  }
  
  .row_gold_c870 img {
    height: 28px;
    width: auto;
  }
  
  .background-purple-7439 {
    display: none !important;
  }
  
  .nav-simple-fbd1 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .nav-simple-fbd1 svg {
    width: 14px;
    height: 14px;
  }
  
  .lower_e029 {
    padding: 6px;
  }
  
  .orange_2842 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .caption_slow_8b7e,
  .complex-c928,
  .alert_b5b9,
  .soft_ff30,
  .next_b5eb,
  .photo_clean_f98f,
  .info_stone_30e6,
  .logo_small_8000,
  .message_3c5c,
  .focus_tall_152e,
  .panel-static-7daf,
  .modal_top_0c77 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .detail_3933,
  .carousel-79ff {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .backdrop-stale-da4f,
  .in-c61e,
  .texture-ecef,
  .texture-hot-763e,
  .image_88c3,
  .west-7845,
  .current_67cf {
    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 */
  .shade_9d33,
  .dropdown_huge_d731,
  .element-dynamic-6e18,
  .component-6457,
  .first_2a9f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .under-02c9,
  .link-13a6,
  .tabs-fast-02de,
  .modal-3c35 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .over_249f,
  .center-b92d {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tag_lite_f8ab,
  .mini_e89a,
  .filter-5312,
  .liquid_8af7 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .chip_1f04,
  .layout_complex_1cd4,
  .hidden_right_54f3,
  .message_230a,
  .carousel-7991,
  .message_ee5c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .shade_9d33,
  .dropdown_huge_d731,
  .component-6457 {
    max-width: none !important;
  }
  
  .dim-c382 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .under-02c9 {
    font-size: 1.5rem !important;
  }
  
  .link-13a6 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .current_baf3,
  .column_d4b9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .tabs-fast-02de {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .block_db7a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .static_8619 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .shade_9d33,
  .component-6457 {
    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: cd0e */
.widget-item-b8 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.1;
}
