/* ============================================
   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 (.secondary-2f66) is a descendant of
   .notice-7ef5 (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.pattern-action-0866 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".layout_copper_e714" 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.primary_wide_b617 so it can't cause
   horizontal overflow anyway. */
.gold_4f72,
.mask-e36d,
.preview_95c2,
.article-prev-b207,
.tabs-up-813b,
.element_3b60,
.static_227a,
.west_85a9,
.article-copper-f7b7,
.icon-9857,
.thick-8a69 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .light-20be {
    padding: 8px 0;
  }
  
  .item-basic-80bf img {
    height: 28px;
    width: auto;
  }
  
  .current_3059 {
    display: none !important;
  }
  
  .label-eb99 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .label-eb99 svg {
    width: 14px;
    height: 14px;
  }
  
  .filter-ead0 {
    padding: 6px;
  }
  
  .outer_5274 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .preview_95c2,
  .mask-e36d,
  .article-prev-b207,
  .tabs-up-813b,
  .outline_narrow_1007,
  .accordion_gold_cba4,
  .copper-b7b1,
  .bright_a566,
  .carousel_right_a942,
  .tertiary-focused-90ac,
  .progress_eb37,
  .panel-d50a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .sort-5b02,
  .input_bronze_ad9c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .red_02c7,
  .sort-834e,
  .paragraph_17d5,
  .logo-tall-f797,
  .solid-5d2c,
  .slow_d80e,
  .shadow_action_ae4a {
    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 */
  .hovered_8332,
  .hard-876a,
  .nav_6483,
  .section_543c,
  .picture_7418 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .card-pressed-6a4a,
  .dropdown-over-fed5,
  .block-dirty-b9f9,
  .hidden-short-a702 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .section_fixed_20a1,
  .pagination_eb2a {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .paragraph-b4f5,
  .east_8f69,
  .pagination-silver-a223,
  .bottom_76ee {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .sidebar_b6fb,
  .mask_outer_269c,
  .complex-e43e,
  .paragraph-3a8e,
  .grid_stale_7c71,
  .paragraph-9224 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .hovered_8332,
  .hard-876a,
  .section_543c {
    max-width: none !important;
  }
  
  .layout_copper_e714 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .card-pressed-6a4a {
    font-size: 1.5rem !important;
  }
  
  .dropdown-over-fed5 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .complex-20bb,
  .new_a29a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .block-dirty-b9f9 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .banner-f9ac {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .label_down_6883 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .hovered_8332,
  .section_543c {
    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: 8b8e */
.phantom-card-v3 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.0;
}
