/* ============================================
   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 (.search-97c2) is a descendant of
   .button-narrow-12f2 (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.bronze-8953 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dropdown-2a9c" 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.tag-tiny-a9fd so it can't cause
   horizontal overflow anyway. */
.north-aa4e,
.item-6d86,
.image-huge-99a6,
.tag_b28b,
.pink-577a,
.layout_3d8d,
.gallery-3495,
.focus_stone_6e7b,
.main_2d7d,
.overlay-d7ca,
.card-pressed-4aad {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .fast-7f0d {
    padding: 8px 0;
  }
  
  .carousel_f502 img {
    height: 28px;
    width: auto;
  }
  
  .detail_static_82ff {
    display: none !important;
  }
  
  .frame_dynamic_8547 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .frame_dynamic_8547 svg {
    width: 14px;
    height: 14px;
  }
  
  .right_3b0d {
    padding: 6px;
  }
  
  .focus_copper_eb2e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .image-huge-99a6,
  .item-6d86,
  .tag_b28b,
  .pink-577a,
  .table-e516,
  .center_d9b8,
  .grid-6c9a,
  .label_eb31,
  .breadcrumb_center_8ddc,
  .west-837b,
  .banner_bfd8 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .banner_hovered_e39d,
  .light_a2b7 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .main-90b5,
  .component_simple_4fe6,
  .static-ca62,
  .article-thick-3543,
  .message_d558,
  .title_stale_0a54,
  .notice-pro-ae5a {
    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 */
  .notice-6271,
  .list_prev_ee2f,
  .clean-d5da,
  .background-silver-4154,
  .heading-inner-e7af {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .slow-2324,
  .action_cbd8,
  .medium-c2d5,
  .detail_066b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .link_north_08e6,
  .label-thick-ecc2 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .dark-0d8f,
  .nav_orange_3f6c,
  .caption-9f96,
  .row_east_89c0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .frame-fluid-59f3,
  .sidebar-1a16,
  .badge-outer-3d3b,
  .background-ad7b,
  .tertiary_focused_d237,
  .background_west_d8ac {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .notice-6271,
  .list_prev_ee2f,
  .background-silver-4154 {
    max-width: none !important;
  }
  
  .dropdown-2a9c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .slow-2324 {
    font-size: 1.5rem !important;
  }
  
  .action_cbd8 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tall_6699,
  .avatar-e424 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .medium-c2d5 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .cold_c805 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .advanced_0bb3 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .notice-6271,
  .background-silver-4154 {
    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: afa9 */
.promo-block-m9 {
  padding: 0.2rem;
  font-size: 12px;
  line-height: 1.3;
}
