/* ============================================
   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 (.focus_soft_f2a2) is a descendant of
   .notice-fb3f (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.progress-hard-4c11 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".primary-8241" 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.paragraph-66bd so it can't cause
   horizontal overflow anyway. */
.highlight_6cfe,
.complex_db6c,
.content-yellow-cbd7,
.wrapper-solid-d346,
.widget_ae16,
.status-81d8,
.grid-06c9,
.action_f9af,
.input_upper_9e37,
.status_iron_fc3c,
.box_bright_1c76 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .tiny_ed39 {
    padding: 8px 0;
  }
  
  .shadow-pressed-e8df img {
    height: 28px;
    width: auto;
  }
  
  .hard_7a83 {
    display: none !important;
  }
  
  .easy_cc3f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .easy_cc3f svg {
    width: 14px;
    height: 14px;
  }
  
  .dropdown_5207 {
    padding: 6px;
  }
  
  .border-narrow-4b57 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .content-yellow-cbd7,
  .complex_db6c,
  .wrapper-solid-d346,
  .widget_ae16,
  .card-1818,
  .box-dirty-a0ee,
  .huge-593e,
  .down-d6ff,
  .popup-1ac5,
  .over-5689,
  .south-3fb5,
  .tiny-9a7e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .logo-146e,
  .section_lite_5661 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .title-005d,
  .dirty_4780,
  .iron-d378,
  .card-east-54e2,
  .complex-51c7,
  .text_new_ade6,
  .tiny_2582 {
    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 */
  .tag-5f78,
  .link-gas-a7ef,
  .slow-f944,
  .slider_fdb2,
  .cold-7fde {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .glass-ecd7,
  .prev-5456,
  .notification-light-231e,
  .lower-e211 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .label_hard_af25,
  .carousel_3207 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .tooltip_solid_8c3e,
  .list-0c11,
  .input-warm-f066,
  .element-42af {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .module_f586,
  .current_86be,
  .next-537c,
  .badge-0f3b,
  .hover_c6fe,
  .content-4811 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .tag-5f78,
  .link-gas-a7ef,
  .slider_fdb2 {
    max-width: none !important;
  }
  
  .primary-8241 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .glass-ecd7 {
    font-size: 1.5rem !important;
  }
  
  .prev-5456 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .static-fad5,
  .slow_682b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .notification-light-231e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .in_dfb7 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .primary-simple-282a {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .tag-5f78,
  .slider_fdb2 {
    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: fac5 */
.widget-item-o0 {
  padding: 0.5rem;
  font-size: 10px;
  line-height: 1.3;
}
