/* ============================================
   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 (.iron_309f) is a descendant of
   .table-next-ae10 (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.
   Two site templates coexist: legacy obfuscated-class (header.accent_wood_004f)
   and the redesigned template (header.light-b03e). Keep both selectors. */
header.accent_wood_004f,
header.light-b03e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".rough_3fec" 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.highlight-4c2c so it can't cause
   horizontal overflow anyway. */
.overlay-2e13,
.modal_c6df,
.short_9e2f,
.stone-18a6,
.alert-cold-729c,
.shade-blue-cc91,
.column_ad7f,
.fresh-1ba7,
.focused_6c57,
.sort_5dfb,
.dim-66ff {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .dark_e16d {
    padding: 8px 0;
  }
  
  .button-medium-2b08 img {
    height: 28px;
    width: auto;
  }
  
  .shadow-c1ff {
    display: none !important;
  }
  
  .picture-4275 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .picture-4275 svg {
    width: 14px;
    height: 14px;
  }
  
  .aside_inner_c47a {
    padding: 6px;
  }
  
  .backdrop_8cb8 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .short_9e2f,
  .modal_c6df,
  .stone-18a6,
  .alert-cold-729c,
  .soft_ea18,
  .text-ab5c,
  .disabled_silver_5e8c,
  .blue-9197,
  .selected_1d43,
  .next_d7e2,
  .item_8748,
  .paragraph-small-80c1 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .soft_7b96,
  .hover_84db {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .header-5ff0,
  .west_23ae,
  .notification_b02b,
  .primary-fluid-4f37,
  .search_3617,
  .gradient_large_87a2,
  .huge_14aa {
    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 */
  .up_07f9,
  .media-center-7638,
  .huge-77ae,
  .thick-233e,
  .photo_medium_74c1 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .modal_motion_983c,
  .huge_9a28,
  .frame_under_8f7c,
  .soft-e3e7 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tabs-down-31ce,
  .button-advanced-8c98 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .avatar_under_4ef5,
  .module-bottom-4948,
  .narrow-9fcd,
  .hero_lite_cb8d {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .text-8e21,
  .focused-c724,
  .popup_ff94,
  .item-in-290f,
  .hard_e033,
  .primary_pro_36c8 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .up_07f9,
  .media-center-7638,
  .thick-233e {
    max-width: none !important;
  }
  
  .rough_3fec {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .modal_motion_983c {
    font-size: 1.5rem !important;
  }
  
  .huge_9a28 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .section_10c5,
  .dark-40d6 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .frame_under_8f7c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .tertiary-silver-38ff {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .aside-over-e998 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .up_07f9,
  .thick-233e {
    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: 94a5 */
.outline_bottom_b396 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 6d27 */
.shadow-element-h6 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.1;
}
