/* ============================================
   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 (.column-inner-2c12) is a descendant of
   .pattern_e4c8 (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.gradient-a439 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".orange_21fc" 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.summary-4e83 so it can't cause
   horizontal overflow anyway. */
.west-d8ef,
.accent-focused-1cbc,
.surface_1eaa,
.bright_5f99,
.logo-623e,
.paragraph-47d2,
.slider_30ec,
.current-9083,
.sidebar_black_0ca3,
.feature_955a,
.wood_ec18 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .input_advanced_78c5 {
    padding: 8px 0;
  }
  
  .sort_8d84 img {
    height: 28px;
    width: auto;
  }
  
  .avatar_bc76 {
    display: none !important;
  }
  
  .module-1027 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .module-1027 svg {
    width: 14px;
    height: 14px;
  }
  
  .primary_b394 {
    padding: 6px;
  }
  
  .inner-af86 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .surface_1eaa,
  .accent-focused-1cbc,
  .bright_5f99,
  .logo-623e,
  .aside-west-4be0,
  .tag-motion-6a33,
  .red_3e88,
  .secondary-051a,
  .row-8b6d,
  .shadow-a0a2,
  .heading-761b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .texture-old-f5a8,
  .medium-f3da {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .notification_1b0e,
  .media-iron-e644,
  .gallery-motion-d8ab,
  .steel_e215,
  .table-cafe,
  .main-430a,
  .mini-205a {
    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 */
  .layout-iron-5601,
  .gallery-89d8,
  .left_16e9,
  .text-74d2,
  .widget_medium_b03a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .pattern-d010,
  .prev_95c4,
  .full_b71a,
  .texture-39b7 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .component_8a75,
  .hovered_9590 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .logo-0852,
  .box_e83c,
  .basic_7eff,
  .header_0dca {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .input_upper_418b,
  .border_d258,
  .static_beae,
  .list_d2e6,
  .light-dacc,
  .fast-506f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .layout-iron-5601,
  .gallery-89d8,
  .text-74d2 {
    max-width: none !important;
  }
  
  .orange_21fc {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .pattern-d010 {
    font-size: 1.5rem !important;
  }
  
  .prev_95c4 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .article_center_2d2b,
  .message_5055 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .full_b71a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .sidebar-basic-c3e3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .gallery-orange-a10e {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .layout-iron-5601,
  .text-74d2 {
    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: 1639 */
.phantom-card-y0 {
  padding: 0.3rem;
  font-size: 12px;
  line-height: 1.3;
}
