/* ============================================
   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 (.outline_pressed_e816) is a descendant of
   .sort-4d9e (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.icon_8fbd {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dynamic_3abc" 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.orange-77fa so it can't cause
   horizontal overflow anyway. */
.notice-inner-efdb,
.nav_easy_7f16,
.feature-first-5097,
.box_9e51,
.action-3661,
.first-cb3c,
.module-wide-a8a7,
.video_6f1b,
.block-middle-72fe,
.container-6882,
.dropdown-focused-3311 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .dim-ef3d {
    padding: 8px 0;
  }
  
  .caption_5a5c img {
    height: 28px;
    width: auto;
  }
  
  .modal-green-bff4 {
    display: none !important;
  }
  
  .panel-prev-ce03 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .panel-prev-ce03 svg {
    width: 14px;
    height: 14px;
  }
  
  .list-b6f6 {
    padding: 6px;
  }
  
  .media-f4dc {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .feature-first-5097,
  .nav_easy_7f16,
  .box_9e51,
  .action-3661,
  .static_90e5,
  .block-b512,
  .info-upper-e295,
  .east_7b6f,
  .mask-bottom-a7e4,
  .sidebar_698c,
  .fixed-348d,
  .down_4524 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .table-orange-30e4,
  .hard_91bb {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .popup_lite_9e49,
  .sort-3949,
  .tertiary_ff86,
  .frame-pink-85e5,
  .bronze-c623,
  .preview_south_ac6f,
  .link_out_1768 {
    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 */
  .fresh_82cd,
  .hard-adff,
  .west-a768,
  .description_b7b5,
  .full-b8aa {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .title_c5a8,
  .fresh-4e0c,
  .texture_0379,
  .content_635b {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .primary_purple_fc2d,
  .black-7609 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .container-bright-16e4,
  .slow_5e54,
  .surface_a4c4,
  .thumbnail_huge_a4a0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .purple-496d,
  .backdrop-40aa,
  .article-c64c,
  .column-19db,
  .pink_fe17,
  .easy_5f0b {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .fresh_82cd,
  .hard-adff,
  .description_b7b5 {
    max-width: none !important;
  }
  
  .dynamic_3abc {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .title_c5a8 {
    font-size: 1.5rem !important;
  }
  
  .fresh-4e0c {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .hidden-fixed-2e1e,
  .overlay_west_32cc {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .texture_0379 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .panel-b047 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .bottom_2d6b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .fresh_82cd,
  .description_b7b5 {
    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: 48e6 */
.shadow-element-c8 {
  padding: 0.3rem;
  font-size: 11px;
  line-height: 1.1;
}
