/* ============================================
   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 (.fluid-ac4f) is a descendant of
   .selected_0a14 (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.thumbnail-e304 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".nav-4df0" 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.sidebar-middle-b0de so it can't cause
   horizontal overflow anyway. */
.steel_7cd4,
.focus-static-f83b,
.table-warm-9055,
.alert-7880,
.label-0cb0,
.secondary_0acd,
.sort_smooth_2184,
.fluid_5452,
.down-ddff,
.content_f93b,
.feature-lower-4116 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .alert_ebf7 {
    padding: 8px 0;
  }
  
  .dropdown-in-5fff img {
    height: 28px;
    width: auto;
  }
  
  .info-d215 {
    display: none !important;
  }
  
  .paragraph-cool-d619 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .paragraph-cool-d619 svg {
    width: 14px;
    height: 14px;
  }
  
  .section-b522 {
    padding: 6px;
  }
  
  .mini_6031 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .table-warm-9055,
  .focus-static-f83b,
  .alert-7880,
  .label-0cb0,
  .east-604c,
  .small_fc3c,
  .dynamic_0def,
  .slider-f9f7,
  .tabs_8448,
  .middle_a4fb,
  .box-863c,
  .gas_cf50 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .upper_4557,
  .info_c933 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .shade-bronze-66ff,
  .breadcrumb-basic-78ab,
  .inner-575e,
  .text-2ee6,
  .description_new_daf0,
  .focus_focused_e590,
  .status-4d93 {
    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 */
  .row-inner-2993,
  .dirty_2087,
  .selected_df7a,
  .border-606e,
  .black_fc2f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .advanced_dd36,
  .header_huge_22ca,
  .widget-af94,
  .solid_ddda {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .full-9195,
  .row_out_973e {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .popup-thick-0b8e,
  .row-fresh-69be,
  .mini_0b5b,
  .accent-short-ba52 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .sort-4fe7,
  .outline-pressed-9d1e,
  .section-copper-c6cc,
  .link-over-35bb,
  .hidden-f72d,
  .hero_105d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .row-inner-2993,
  .dirty_2087,
  .border-606e {
    max-width: none !important;
  }
  
  .nav-4df0 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .advanced_dd36 {
    font-size: 1.5rem !important;
  }
  
  .header_huge_22ca {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .logo-2b4c,
  .smooth-a301 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .widget-af94 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pattern_700d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .stone_e412 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .row-inner-2993,
  .border-606e {
    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: b275 */
.widget-item-i0 {
  padding: 0.2rem;
  font-size: 12px;
  line-height: 1.0;
}
