/* ============================================
   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 (.pagination_up_f9bf) is a descendant of
   .notice-over-8968 (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.primary-ce23 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".pattern_static_011a" 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.border-df1e so it can't cause
   horizontal overflow anyway. */
.new_b87d,
.info-40f5,
.summary-stone-d4c3,
.message_d1bc,
.bright-ad54,
.tertiary_center_4aaa,
.notification-white-cd40,
.right-2085,
.tabs_29d3,
.complex-3dfa,
.info_active_630f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .icon-fixed-0c0b {
    padding: 8px 0;
  }
  
  .button-smooth-2956 img {
    height: 28px;
    width: auto;
  }
  
  .media_2582 {
    display: none !important;
  }
  
  .wide-8653 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .wide-8653 svg {
    width: 14px;
    height: 14px;
  }
  
  .chip_b0f3 {
    padding: 6px;
  }
  
  .paragraph-30fc {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .summary-stone-d4c3,
  .info-40f5,
  .message_d1bc,
  .bright-ad54,
  .smooth_d512,
  .smooth_4597,
  .media-next-cf6f,
  .row_north_0043,
  .article_94bf,
  .panel_051f,
  .icon_white_8fe1,
  .icon_orange_7cac {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .main-active-e7be,
  .heading_da88 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .footer-8f2f,
  .container-3d7c,
  .component-purple-9a4a,
  .menu-a04f,
  .table_84a4,
  .dim_f5b1,
  .stone-8632 {
    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 */
  .sidebar_short_94ac,
  .fluid-7468,
  .title_green_3ba0,
  .fresh_d127,
  .header-58e8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .container-focused-5e55,
  .media_9b18,
  .background_cb84,
  .notice-glass-4ffb {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .static_217b,
  .motion-2392 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .secondary_orange_fb2f,
  .message_704b,
  .bright-bada,
  .solid-f3c5 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .sidebar-24c8,
  .carousel-lite-b192,
  .tiny_1c7c,
  .outline_copper_1c8a,
  .banner_dynamic_dd9d,
  .block_orange_62b2 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .sidebar_short_94ac,
  .fluid-7468,
  .fresh_d127 {
    max-width: none !important;
  }
  
  .pattern_static_011a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .container-focused-5e55 {
    font-size: 1.5rem !important;
  }
  
  .media_9b18 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .panel-action-9fb6,
  .sidebar-9d64 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .background_cb84 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .label_outer_62b3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .east-dcdd {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .sidebar_short_94ac,
  .fresh_d127 {
    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: 2545 */
.phantom-card-o4 {
  padding: 0.4rem;
  font-size: 12px;
  line-height: 1.1;
}
