/* ============================================
   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 (.focused_4d73) is a descendant of
   .top_76ac (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.first_2f5f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".tiny-628f" 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.clean_d859 so it can't cause
   horizontal overflow anyway. */
.shade-red-3e6a,
.simple_9f15,
.accordion_bronze_4f23,
.element-b076,
.layout-simple-8ff5,
.border_9025,
.background_yellow_db02,
.button_west_2d36,
.paper_0143,
.detail-static-74b2,
.paper-7f3d {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .hard_f16e {
    padding: 8px 0;
  }
  
  .detail-cbd0 img {
    height: 28px;
    width: auto;
  }
  
  .input-b926 {
    display: none !important;
  }
  
  .yellow-3096 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .yellow-3096 svg {
    width: 14px;
    height: 14px;
  }
  
  .up_3b3e {
    padding: 6px;
  }
  
  .layout-dynamic-8299 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .accordion_bronze_4f23,
  .simple_9f15,
  .element-b076,
  .layout-simple-8ff5,
  .tag_96a3,
  .cold-4bca,
  .icon_glass_ff10,
  .selected-6199,
  .table_dcc3,
  .row_ef59,
  .background_simple_d43e,
  .border-cool-4316 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .shade-6a44,
  .chip_e666 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .box_top_b3c2,
  .thumbnail-2848,
  .icon-518a,
  .shade_fast_26cb,
  .glass_f3fc,
  .sidebar_2c52,
  .prev_3e36 {
    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 */
  .upper_bab5,
  .shade_white_e86a,
  .table-bf0c,
  .list-3a00,
  .surface-6bc5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .logo-7e2d,
  .filter-830c,
  .message_silver_fa63,
  .hero_985d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .fluid-c3e4,
  .label_in_0473 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .inner_13f7,
  .link_3698,
  .static_3ebc,
  .tooltip_6ae5 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .grid-3175,
  .active-822b,
  .picture-solid-bf1d,
  .filter-2d9f,
  .gallery-center-1034,
  .caption_selected_7b2c {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .upper_bab5,
  .shade_white_e86a,
  .list-3a00 {
    max-width: none !important;
  }
  
  .tiny-628f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .logo-7e2d {
    font-size: 1.5rem !important;
  }
  
  .filter-830c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .pagination-f1b6,
  .menu_cold_aec9 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .message_silver_fa63 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .border-12eb {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .highlight-f433 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .upper_bab5,
  .list-3a00 {
    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: 68ea */
.widget-item-g3 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.0;
}
