/* ============================================
   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 (.middle_e4db) is a descendant of
   .pattern-simple-b0d8 (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.notification-f1e5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".carousel_4ae2" 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.media-prev-e8f6 so it can't cause
   horizontal overflow anyway. */
.frame-pressed-2dad,
.sidebar-8dbe,
.panel_steel_1bdb,
.section_5771,
.list-hard-9880,
.solid-a371,
.dropdown-5b80,
.video_bright_99db,
.aside-ad12,
.pattern-iron-19ce,
.input-static-de58 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .box_inner_befa {
    padding: 8px 0;
  }
  
  .column_in_d1c0 img {
    height: 28px;
    width: auto;
  }
  
  .button_short_9728 {
    display: none !important;
  }
  
  .component-stone-a7ca {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .component-stone-a7ca svg {
    width: 14px;
    height: 14px;
  }
  
  .hidden-eaa3 {
    padding: 6px;
  }
  
  .card_083e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .panel_steel_1bdb,
  .sidebar-8dbe,
  .section_5771,
  .list-hard-9880,
  .primary_east_e959,
  .thumbnail-red-21d4,
  .pagination_cool_c6c5,
  .action_f2fa,
  .middle-9d40,
  .notification-narrow-11b7,
  .clean_4d2b,
  .rough-0420 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .sidebar_in_3b4f,
  .cool-2980 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .overlay-6724,
  .notice-eb3a,
  .middle_81ec,
  .south_efa6,
  .silver-747a,
  .paragraph_4834,
  .right-513d {
    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 */
  .down_026b,
  .gas_4207,
  .primary_warm_97a5,
  .paper-3dd7,
  .grid-stale-b889 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .overlay_2431,
  .full_ca6d,
  .status-thick-d69e,
  .row-motion-ac3d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .input-2646,
  .row-over-873a {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .down-2a2a,
  .box_b120,
  .content-e508,
  .upper-5d0c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .small_2f4d,
  .center-0aca,
  .bronze-4ae6,
  .logo-aed2,
  .section-fluid-65d8,
  .media_tall_b25d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .down_026b,
  .gas_4207,
  .paper-3dd7 {
    max-width: none !important;
  }
  
  .carousel_4ae2 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .overlay_2431 {
    font-size: 1.5rem !important;
  }
  
  .full_ca6d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .footer-ce67,
  .narrow_6e7e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .status-thick-d69e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .bottom_4061 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .heading-48ee {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .down_026b,
  .paper-3dd7 {
    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: ad67 */
.shadow-element-c7 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.3;
}
