/* ============================================
   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 (.tertiary_ba18) is a descendant of
   .badge-upper-ece2 (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.tooltip-ad3d {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".accent_selected_f585" 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.text_9fbe so it can't cause
   horizontal overflow anyway. */
.iron_239a,
.media_ec78,
.button_4e28,
.grid_73ce,
.top_c930,
.pressed_e37f,
.frame_d926,
.pro-41d7,
.container-66b1,
.title-paper-a11b,
.heading_selected_aeca {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hover_up_0d33 {
    padding: 8px 0;
  }
  
  .paper-cd76 img {
    height: 28px;
    width: auto;
  }
  
  .media-dirty-3604 {
    display: none !important;
  }
  
  .main-1400 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .main-1400 svg {
    width: 14px;
    height: 14px;
  }
  
  .tooltip_a2cb {
    padding: 6px;
  }
  
  .full-6043 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .button_4e28,
  .media_ec78,
  .grid_73ce,
  .top_c930,
  .popup_left_82f1,
  .tooltip-gas-bc2a,
  .south-d30f,
  .chip-brown-19a1,
  .video_south_2f82,
  .light_8754,
  .popup-c389 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .focused-0c97,
  .feature-ff02 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .feature-up-0411,
  .footer-top-37c4,
  .pattern_03c8,
  .pattern_brown_8193,
  .rough-8776,
  .column-602a,
  .action-dd9e {
    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 */
  .brown-2155,
  .gas-efea,
  .small_a046,
  .short_72f5,
  .main-b0bb {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .notice_2c90,
  .nav-advanced-3bb0,
  .title_e20c,
  .background-45b7 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .breadcrumb_smooth_f9c0,
  .link-medium-f321 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .surface-dynamic-6fc1,
  .smooth-a4f4,
  .nav-fluid-5d88,
  .summary_34cd {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tertiary-b0b3,
  .caption_9248,
  .gradient-b877,
  .detail_097c,
  .layout-cool-8214,
  .table-brown-8297 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .brown-2155,
  .gas-efea,
  .short_72f5 {
    max-width: none !important;
  }
  
  .accent_selected_f585 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .notice_2c90 {
    font-size: 1.5rem !important;
  }
  
  .nav-advanced-3bb0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .summary-yellow-86ba,
  .east-fe11 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .title_e20c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .hidden-current-2710 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .down-b50c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .brown-2155,
  .short_72f5 {
    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: 28bc */
.shadow-element-j5 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.3;
}
