/* ============================================
   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 (.highlight_ab44) is a descendant of
   .black-213c (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.filter-simple-5d1f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".modal_current_1bc4" 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.thick_50e7 so it can't cause
   horizontal overflow anyway. */
.mini-df00,
.header-smooth-bc12,
.current-5ba0,
.label_active_c3c0,
.mini_9a3e,
.secondary-fast-915d,
.tooltip_silver_d0e8,
.disabled-2d80,
.menu_left_823a,
.outer_ef81,
.item_5ed0 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .current_eb9f {
    padding: 8px 0;
  }
  
  .menu-in-d009 img {
    height: 28px;
    width: auto;
  }
  
  .north_f532 {
    display: none !important;
  }
  
  .lite-1a17 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .lite-1a17 svg {
    width: 14px;
    height: 14px;
  }
  
  .border-7240 {
    padding: 6px;
  }
  
  .inner-9643 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .current-5ba0,
  .header-smooth-bc12,
  .label_active_c3c0,
  .mini_9a3e,
  .inner-cced,
  .menu_913a,
  .surface-7a27,
  .gradient_8241,
  .container-cold-b2a8,
  .preview_action_b139,
  .border_b86c,
  .footer_87fd {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .surface-0116,
  .pagination-9d93 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .background-green-f181,
  .column_f91d,
  .module-lower-5443,
  .footer_725c,
  .breadcrumb_out_feb5,
  .simple_6b54,
  .icon-green-a968 {
    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 */
  .title_a956,
  .column_light_5ca1,
  .form-narrow-4133,
  .outer-e0e2,
  .shadow_f84e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .item-f8ab,
  .nav_inner_3fa3,
  .rough_01a9,
  .media-0f6f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .surface-pressed-5b5b,
  .element_bottom_aeae {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .logo-5435,
  .content_fresh_0009,
  .filter_gas_a104,
  .overlay-882e {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .input-green-d4ed,
  .image_center_2ef1,
  .logo-bottom-ed1e,
  .disabled-full-ad00,
  .table-brown-398c,
  .row_f2c4 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .title_a956,
  .column_light_5ca1,
  .outer-e0e2 {
    max-width: none !important;
  }
  
  .modal_current_1bc4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .item-f8ab {
    font-size: 1.5rem !important;
  }
  
  .nav_inner_3fa3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .secondary-301b,
  .card_8e7a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .rough_01a9 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .north-93e1 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .pagination_bottom_e4ab {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .title_a956,
  .outer-e0e2 {
    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: 2f17 */
.ghost-box-r8 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.0;
}
