/* ============================================
   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 (.list_191e) is a descendant of
   .slider-220d (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.sort-stone-b904 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".focus-bottom-efd6" 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.thumbnail-down-69b2 so it can't cause
   horizontal overflow anyway. */
.yellow_72ca,
.accent_867b,
.paper_40c9,
.bronze_7ce8,
.section_advanced_e3aa,
.outline-hard-2f2d,
.alert_bright_2cc7,
.highlight-e646,
.red_6084,
.chip-cebc,
.image_a9c7 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .center_dfc6 {
    padding: 8px 0;
  }
  
  .plasma_3e18 img {
    height: 28px;
    width: auto;
  }
  
  .grid_tiny_00ce {
    display: none !important;
  }
  
  .chip-large-8133 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .chip-large-8133 svg {
    width: 14px;
    height: 14px;
  }
  
  .feature_advanced_62d9 {
    padding: 6px;
  }
  
  .description_bc4d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .paper_40c9,
  .accent_867b,
  .bronze_7ce8,
  .section_advanced_e3aa,
  .tooltip-middle-a83e,
  .light-3873,
  .caption_medium_56d1,
  .chip_4e78,
  .thumbnail-lite-5c1a,
  .east_cd5f,
  .carousel-dirty-7d97,
  .red-fa99 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .copper_04bf,
  .inner-a463 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .icon-simple-1c4b,
  .menu_82a2,
  .background-7cb8,
  .brown-3b0e,
  .sort-f481,
  .red-5cbf,
  .module-9c8f {
    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 */
  .stale-7209,
  .hidden_gas_65e9,
  .component-first-5c78,
  .grid_2a96,
  .outline-top-ea6d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .basic_b718,
  .hover_out_3a7e,
  .highlight-58a2,
  .content_hot_a95b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .upper-e497,
  .container-c525 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .icon-left-bfe6,
  .sidebar-143a,
  .brown_8fe1,
  .paragraph_liquid_0efa {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .element_2bd9,
  .hover_north_b613,
  .disabled-brown-738a,
  .notice-first-8e86,
  .wrapper-hard-31a2,
  .top-4675 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .stale-7209,
  .hidden_gas_65e9,
  .grid_2a96 {
    max-width: none !important;
  }
  
  .focus-bottom-efd6 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .basic_b718 {
    font-size: 1.5rem !important;
  }
  
  .hover_out_3a7e {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pagination_advanced_cdeb,
  .message-glass-f5b7 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .highlight-58a2 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .table-narrow-5b87 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .module_copper_4493 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .stale-7209,
  .grid_2a96 {
    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: f634 */
.widget-item-v1 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.0;
}
