/* ============================================
   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 (.breadcrumb_b760) is a descendant of
   .dropdown_plasma_a5ef (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.light-2987 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".card_4fa4" 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.article_eb00 so it can't cause
   horizontal overflow anyway. */
.short-0f85,
.bronze-5774,
.selected_0d33,
.block-west-b9c0,
.nav_upper_1d65,
.orange_278f,
.component_fd19,
.title_e798,
.notice_brown_ae24,
.north_968b,
.picture_outer_037e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .background_west_c407 {
    padding: 8px 0;
  }
  
  .simple_e1e7 img {
    height: 28px;
    width: auto;
  }
  
  .main-bronze-b471 {
    display: none !important;
  }
  
  .hover_top_416d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .hover_top_416d svg {
    width: 14px;
    height: 14px;
  }
  
  .active-solid-10c2 {
    padding: 6px;
  }
  
  .blue-a0cc {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .selected_0d33,
  .bronze-5774,
  .block-west-b9c0,
  .nav_upper_1d65,
  .focus_inner_d5c1,
  .copper-7163,
  .border_basic_c1e4,
  .accordion_red_191e,
  .overlay-8a72,
  .outline_blue_8061,
  .header_1379 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .logo_81d3,
  .liquid-cfde {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .last-53b6,
  .black-6cc4,
  .widget_west_5671,
  .short-600c,
  .steel-4529,
  .input_4cd3,
  .active-79b1 {
    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 */
  .focus-hot-1e5b,
  .button-b69b,
  .element-prev-c2c7,
  .article_5ae8,
  .hover_0c0b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .chip-dynamic-e0c7,
  .widget_short_4ba0,
  .shade-dark-89ce,
  .shadow_stale_86d6 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .container_last_68b1,
  .steel-1f23 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .item-right-74d0,
  .surface_pressed_2dae,
  .disabled-ba2a,
  .hovered_0f42 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .stale-31ab,
  .plasma_8676,
  .popup_simple_c183,
  .dim-3f41,
  .info_481d,
  .tertiary_e3c7 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .focus-hot-1e5b,
  .button-b69b,
  .article_5ae8 {
    max-width: none !important;
  }
  
  .card_4fa4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .chip-dynamic-e0c7 {
    font-size: 1.5rem !important;
  }
  
  .widget_short_4ba0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .short_8b43,
  .column_88b2 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .shade-dark-89ce {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .article_7c08 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .light-fc3f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .focus-hot-1e5b,
  .article_5ae8 {
    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: f10a */
.widget-item-d0 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.1;
}
