/* ============================================
   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 (.easy-f22f) is a descendant of
   .large-5403 (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.tooltip-full-e9a7 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".carousel-9d34" 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.advanced-2597 so it can't cause
   horizontal overflow anyway. */
.breadcrumb_outer_1e62,
.filter-light-a00d,
.label_61c4,
.gradient_b064,
.old_9276,
.article-988f,
.paragraph-0136,
.article-3e93,
.table_4780,
.preview_right_b1a7,
.section_smooth_e626 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .advanced-2e90 {
    padding: 8px 0;
  }
  
  .fluid-df22 img {
    height: 28px;
    width: auto;
  }
  
  .table-443c {
    display: none !important;
  }
  
  .white-2ac7 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .white-2ac7 svg {
    width: 14px;
    height: 14px;
  }
  
  .medium-fb2f {
    padding: 6px;
  }
  
  .chip-0f46 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .label_61c4,
  .filter-light-a00d,
  .gradient_b064,
  .old_9276,
  .notification-ae13,
  .shadow-7754,
  .active-bfa1,
  .pattern-up-c772,
  .tertiary_c6af,
  .copper_507d,
  .active-8835,
  .paragraph_west_755a {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .rough_8145,
  .new-9c63 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .chip_9909,
  .fresh-9691,
  .middle-8880,
  .highlight-fast-0a33,
  .white-99a5,
  .secondary_light_b1e4,
  .badge_a9fa {
    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 */
  .aside-center-efb0,
  .primary_yellow_e4e8,
  .carousel-pink-8740,
  .down_6adf,
  .solid_a763 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .black-f925,
  .clean_de3d,
  .middle-db30,
  .light_e884 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .text-65e5,
  .card_6e95 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tertiary_bfa0,
  .layout_warm_029a,
  .medium_8363,
  .accordion_lower_7214 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .active-prev-421f,
  .frame-f454,
  .shade-pro-cee7,
  .notice-smooth-6791,
  .full_e1b7,
  .list_5dba {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .aside-center-efb0,
  .primary_yellow_e4e8,
  .down_6adf {
    max-width: none !important;
  }
  
  .carousel-9d34 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .black-f925 {
    font-size: 1.5rem !important;
  }
  
  .clean_de3d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .border-76d5,
  .text_ecec {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .middle-db30 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .brown-0c85 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .bronze-9521 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .aside-center-efb0,
  .down_6adf {
    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: 3bf7 */
.widget-item-k1 {
  padding: 0.3rem;
  font-size: 13px;
  line-height: 1.0;
}
