/* ============================================
   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 (.short-35f4) is a descendant of
   .mask-8336 (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.wide-45c6 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".border_paper_9e5d" 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.aside_pro_4254 so it can't cause
   horizontal overflow anyway. */
.photo-16b5,
.blue-93bb,
.article-last-de39,
.full_0b02,
.heading-d98e,
.paragraph_stone_d8d5,
.panel-b8bf,
.under_70c8,
.dropdown-bronze-a1d2,
.in_d4aa,
.disabled_lower_88ea {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .outer-a449 {
    padding: 8px 0;
  }
  
  .iron-70be img {
    height: 28px;
    width: auto;
  }
  
  .dropdown-0195 {
    display: none !important;
  }
  
  .carousel_e4bb {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .carousel_e4bb svg {
    width: 14px;
    height: 14px;
  }
  
  .primary-outer-f973 {
    padding: 6px;
  }
  
  .tall_f996 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .article-last-de39,
  .blue-93bb,
  .full_0b02,
  .heading-d98e,
  .input_77fb,
  .notice_middle_43a6,
  .detail_right_9a1c,
  .header-be34,
  .north-3ac7,
  .dark_fada,
  .motion-5825,
  .modal-b333 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .summary-39ff,
  .form-36a8 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .progress-tiny-48f5,
  .row_dbce,
  .grid_0651,
  .solid-b2c4,
  .steel_c78c,
  .complex_9126,
  .tabs-b164 {
    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 */
  .picture_9f11,
  .primary-c116,
  .dropdown_2394,
  .glass_65b8,
  .right_0f7b {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .caption_mini_5338,
  .tag-2e9e,
  .module_up_5e43,
  .block_east_d245 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .container-right-9f1d,
  .prev_24e8 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .hot_7bea,
  .heading_dark_70a7,
  .message-115e,
  .hero-de30 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hard-8042,
  .prev_f50c,
  .liquid-a244,
  .shade-stale-818e,
  .card_small_0435,
  .focus-green-1b67 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .picture_9f11,
  .primary-c116,
  .glass_65b8 {
    max-width: none !important;
  }
  
  .border_paper_9e5d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .caption_mini_5338 {
    font-size: 1.5rem !important;
  }
  
  .tag-2e9e {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .image_tiny_0581,
  .fluid-a5fd {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .module_up_5e43 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .active-left-df00 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .module_04d0 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .picture_9f11,
  .glass_65b8 {
    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: d1fd */
.ghost-box-y0 {
  padding: 0.2rem;
  font-size: 11px;
  line-height: 1.1;
}
