/* ============================================
   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 (.notice-right-3dd3) is a descendant of
   .clean_b188 (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.
   Two site templates coexist: legacy obfuscated-class (header.main-98a1)
   and the redesigned template (header.solid_baf1). Keep both selectors. */
header.main-98a1,
header.solid_baf1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".lower_0fdb" 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.yellow_7f84 so it can't cause
   horizontal overflow anyway. */
.overlay_6b55,
.green_6d25,
.overlay_east_d969,
.carousel_ddbe,
.right_701a,
.article-76c2,
.notice_23d1,
.primary_fast_45d0,
.blue_4151,
.old-abaa,
.info_easy_3174 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .tiny_2fe7 {
    padding: 8px 0;
  }
  
  .blue-167e img {
    height: 28px;
    width: auto;
  }
  
  .module-bb0e {
    display: none !important;
  }
  
  .tag-85ef {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tag-85ef svg {
    width: 14px;
    height: 14px;
  }
  
  .heading-white-e7df {
    padding: 6px;
  }
  
  .gallery-bottom-3f34 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .overlay_east_d969,
  .green_6d25,
  .carousel_ddbe,
  .right_701a,
  .tertiary-d6f2,
  .filter_8f47,
  .item-blue-df06,
  .dropdown-0a9a,
  .motion_8f2c,
  .tiny_5604,
  .hard_65c3,
  .container-8f39 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .content_1881,
  .feature-9ab7 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .breadcrumb_77bc,
  .easy-8e04,
  .gradient-prev-7085,
  .photo-inner-e82e,
  .right_db55,
  .item_64e5,
  .component_narrow_278a {
    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 */
  .menu_bottom_1b05,
  .input-upper-4711,
  .list-505c,
  .primary-east-ce13,
  .down_c0c0 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .grid-selected-2f8f,
  .gallery_e17a,
  .icon-fixed-d7f1,
  .pro-6a42 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .frame_c7aa,
  .info_lite_1874 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .notice-active-dd6f,
  .main-d013,
  .border-bright-5355,
  .breadcrumb-21ab {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .south-a33c,
  .wide_9360,
  .row-f6b8,
  .avatar-704c,
  .message_7944,
  .glass-5a39 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .menu_bottom_1b05,
  .input-upper-4711,
  .primary-east-ce13 {
    max-width: none !important;
  }
  
  .lower_0fdb {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .grid-selected-2f8f {
    font-size: 1.5rem !important;
  }
  
  .gallery_e17a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .new-48b0,
  .image_down_6c44 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .icon-fixed-d7f1 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .box_tiny_b03d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .notification_c411 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .menu_bottom_1b05,
  .primary-east-ce13 {
    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: 94a5 */
.tooltip_fluid_4583 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: c513 */
.shadow-element-m4 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.3;
}
