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

/* Fix for any potential overflow elements */
/* NOTE: ".main-9fa3" 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.medium_f8a6 so it can't cause
   horizontal overflow anyway. */
.list_hard_a824,
.hover-ae7d,
.texture-mini-159e,
.up_c7fa,
.west-6ef8,
.text-dirty-d772,
.smooth_48f2,
.sort-33a6,
.mask_2cc1,
.input-paper-feab,
.new-4c1a {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .container-north-d484 {
    padding: 8px 0;
  }
  
  .slider_3e42 img {
    height: 28px;
    width: auto;
  }
  
  .stale_0b18 {
    display: none !important;
  }
  
  .orange_e9ee {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .orange_e9ee svg {
    width: 14px;
    height: 14px;
  }
  
  .dark_62d7 {
    padding: 6px;
  }
  
  .action_b8d1 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .texture-mini-159e,
  .hover-ae7d,
  .up_c7fa,
  .west-6ef8,
  .caption-wide-0506,
  .east_166d,
  .notification_lower_342c,
  .thumbnail-cool-7370,
  .button_wide_569f,
  .tag-first-ed0a,
  .pagination_dirty_7609,
  .container-3a46 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .popup_purple_c068,
  .outline_in_8cde {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .frame-32a8,
  .tall_c604,
  .footer_0cf1,
  .slider-1741,
  .blue_3dd5,
  .picture_hot_151c,
  .gallery-92d6 {
    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 */
  .detail-bfb5,
  .notice_pink_e8f3,
  .avatar_first_3804,
  .red_caeb,
  .border_dirty_4aaf {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .small_bc01,
  .progress_yellow_3e50,
  .upper_34f2,
  .box-fast-f7e2 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .layout_6b72,
  .lite_7c00 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .article_dim_d0a9,
  .main_83c1,
  .popup_pressed_09f7,
  .gradient-cold-17f3 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .bright_0e69,
  .content_e13d,
  .stale-d070,
  .notice-4483,
  .photo-b628,
  .summary-ee24 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .detail-bfb5,
  .notice_pink_e8f3,
  .red_caeb {
    max-width: none !important;
  }
  
  .main-9fa3 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .small_bc01 {
    font-size: 1.5rem !important;
  }
  
  .progress_yellow_3e50 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .yellow_e0bd,
  .table-2c57 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .upper_34f2 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .overlay_fresh_32f2 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .lite_c082 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .detail-bfb5,
  .red_caeb {
    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: 4fb2 */
.widget-item-h8 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.1;
}
