/* ============================================
   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 (.stone-3990) is a descendant of
   .breadcrumb_a5ea (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.notification_0420 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".advanced-7483" 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.tiny-ad82 so it can't cause
   horizontal overflow anyway. */
.focus_ec44,
.overlay_bac5,
.tooltip_selected_0f7d,
.shadow-17f6,
.focus-c08b,
.bottom-3bf6,
.status-8e8f,
.wide_f947,
.backdrop-8aff,
.item-c104,
.pattern-outer-e399 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hover-72d2 {
    padding: 8px 0;
  }
  
  .chip_pro_1f70 img {
    height: 28px;
    width: auto;
  }
  
  .gradient-6572 {
    display: none !important;
  }
  
  .outline-white-79ba {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .outline-white-79ba svg {
    width: 14px;
    height: 14px;
  }
  
  .glass_79c2 {
    padding: 6px;
  }
  
  .column-old-4ca6 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tooltip_selected_0f7d,
  .overlay_bac5,
  .shadow-17f6,
  .focus-c08b,
  .breadcrumb-center-b16e,
  .tooltip-over-f063,
  .highlight-ad22,
  .secondary_soft_f033,
  .main_f085,
  .grid_iron_7639,
  .widget_7ce0,
  .hover_4030 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .hero-7742,
  .chip-full-03db {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .header_9ffb,
  .content_7fb7,
  .detail_orange_1950,
  .dynamic-8b4a,
  .sidebar_current_0dce,
  .plasma-d653,
  .notice-bronze-2d78 {
    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 */
  .bronze-16aa,
  .stone_4fd5,
  .description-gold-77db,
  .component-422a,
  .narrow_231e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .widget-15b5,
  .east_39d8,
  .sidebar-378e,
  .section_narrow_ef2e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .nav-hot-5769,
  .layout_lite_fc49 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .header-tiny-c866,
  .fast_9ccd,
  .blue_c20b,
  .small_3606 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .advanced-c17c,
  .cold_fc18,
  .feature-active-9880,
  .disabled_2de0,
  .text-copper-8cc6,
  .status-outer-82c9 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .bronze-16aa,
  .stone_4fd5,
  .component-422a {
    max-width: none !important;
  }
  
  .advanced-7483 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .widget-15b5 {
    font-size: 1.5rem !important;
  }
  
  .east_39d8 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .message_outer_2db4,
  .gas-6dec {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .sidebar-378e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .info_085a {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tall_badb {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .bronze-16aa,
  .component-422a {
    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: 1d20 */
.widget-item-q4 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.1;
}
