/* ============================================
   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 (.lower_7a85) is a descendant of
   .box-2e0e (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.thumbnail_light_ea14 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".avatar_bf3e" 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.layout-green-863b so it can't cause
   horizontal overflow anyway. */
.background_wood_20cb,
.description_static_f116,
.border-c7c3,
.primary-stale-8b8a,
.title-wood-2abe,
.over-9a4e,
.plasma-b7c3,
.advanced-31d2,
.avatar_3a08,
.notice_e9d0,
.stale-79c8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .slider-iron-2d72 {
    padding: 8px 0;
  }
  
  .gradient-7960 img {
    height: 28px;
    width: auto;
  }
  
  .pattern-large-70b6 {
    display: none !important;
  }
  
  .tabs-e1db {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tabs-e1db svg {
    width: 14px;
    height: 14px;
  }
  
  .secondary-c935 {
    padding: 6px;
  }
  
  .blue_5245 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .border-c7c3,
  .description_static_f116,
  .primary-stale-8b8a,
  .title-wood-2abe,
  .heading-cc4b,
  .outline_under_8c82,
  .module-fresh-1987,
  .shadow_03a8,
  .column_easy_495c,
  .hidden_d355,
  .hidden_red_d762,
  .sidebar-a736 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .easy-5049,
  .frame-white-02b4 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .plasma_5c55,
  .grid_hot_6175,
  .tag_silver_721d,
  .panel-0962,
  .tabs-basic-003b,
  .surface-dark-e3e1,
  .purple_bcc6 {
    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 */
  .pagination-921d,
  .lower-b3ba,
  .texture_lite_4254,
  .mini_24df,
  .module_over_9acb {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .middle-19eb,
  .north-3efe,
  .highlight-west-051a,
  .iron-e744 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .mini_fa1f,
  .image-first-e0b5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .info_912e,
  .hard-b69a,
  .column-bright-95d1,
  .preview-fixed-5166 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .heading-1d0e,
  .accordion_d4bd,
  .black_991a,
  .picture-f97d,
  .caption-aea4,
  .header_smooth_51b1 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .pagination-921d,
  .lower-b3ba,
  .mini_24df {
    max-width: none !important;
  }
  
  .avatar_bf3e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .middle-19eb {
    font-size: 1.5rem !important;
  }
  
  .north-3efe {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .static-0a5e,
  .rough_3ec6 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .highlight-west-051a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .old_f419 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .narrow_0c34 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .pagination-921d,
  .mini_24df {
    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: cabb */
.shadow-element-s6 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.2;
}
