/* ============================================
   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 (.basic_c90a) is a descendant of
   .aside-purple-d484 (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.image_tiny_8958 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".black_64d2" 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.filter-fast-4e9a so it can't cause
   horizontal overflow anyway. */
.outer_fd00,
.input-cc9e,
.header-cool-f22e,
.border-0659,
.middle-1766,
.status_979a,
.tabs_liquid_681f,
.steel_d416,
.section-3a9c,
.accent-advanced-0fce,
.simple-e8ef {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .chip-fa22 {
    padding: 8px 0;
  }
  
  .outline-outer-0948 img {
    height: 28px;
    width: auto;
  }
  
  .card_out_a400 {
    display: none !important;
  }
  
  .gas-707c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .gas-707c svg {
    width: 14px;
    height: 14px;
  }
  
  .lower_8e37 {
    padding: 6px;
  }
  
  .avatar-steel-b270 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .header-cool-f22e,
  .input-cc9e,
  .border-0659,
  .middle-1766,
  .mini-0e78,
  .pattern-west-a736,
  .accent_b7f1,
  .content_dim_b327,
  .notice-active-ee1a,
  .up-fa73,
  .hover-c9b6,
  .silver-2cad {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .link-493e,
  .purple_9512 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .south_71cc,
  .slider-d4e7,
  .alert-west-27d9,
  .menu-884c,
  .purple_b0f2,
  .black_25b0,
  .fluid-6129 {
    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 */
  .heading-0747,
  .paragraph_1a8e,
  .icon_left_a6a4,
  .media_22ae,
  .left-b40b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .fixed_cbda,
  .copper-73c8,
  .logo-b610,
  .grid_11d8 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hidden-paper-779c,
  .image_right_7dee {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .button_753a,
  .layout-stale-87a8,
  .card-east-df38,
  .list-wide-2623 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .layout_solid_97f4,
  .preview-light-d559,
  .over-c0cf,
  .preview_middle_80c3,
  .thumbnail-gold-8e1c,
  .grid-4ac9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .heading-0747,
  .paragraph_1a8e,
  .media_22ae {
    max-width: none !important;
  }
  
  .black_64d2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .fixed_cbda {
    font-size: 1.5rem !important;
  }
  
  .copper-73c8 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .new-6d9e,
  .white_5ecb {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .logo-b610 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .main_warm_0cb3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .bright_cd3a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .heading-0747,
  .media_22ae {
    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: bbf3 */
.widget-item-w1 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}
