/* ============================================
   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 (.widget-975f) is a descendant of
   .soft-31bb (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.focused_2119 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".layout-blue-6797" 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.upper_7cf6 so it can't cause
   horizontal overflow anyway. */
.full_334e,
.lite_502d,
.rough_f1f6,
.panel_1bb0,
.steel-fc19,
.tag_first_cd9e,
.outline_8e24,
.gallery_bf70,
.breadcrumb_silver_c6e6,
.under-27da,
.icon-ffed {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .top_1fab {
    padding: 8px 0;
  }
  
  .clean_5248 img {
    height: 28px;
    width: auto;
  }
  
  .white-6edc {
    display: none !important;
  }
  
  .primary-fast-cb25 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .primary-fast-cb25 svg {
    width: 14px;
    height: 14px;
  }
  
  .lower-d39d {
    padding: 6px;
  }
  
  .selected-a29d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .rough_f1f6,
  .lite_502d,
  .panel_1bb0,
  .steel-fc19,
  .message_wood_111c,
  .easy-02eb,
  .thick-49f1,
  .photo-warm-e0f0,
  .gallery-complex-757a,
  .hero-cool-5f4b,
  .pro_3b11,
  .module-active-4297 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .sidebar-new-6845,
  .west-06c0 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .fluid_17e5,
  .easy_6906,
  .pagination-5ca8,
  .next_081c,
  .overlay-pro-7f36,
  .outer-f217,
  .basic-02db {
    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 */
  .notification_next_fec5,
  .backdrop-new-7fc0,
  .frame-58fd,
  .texture_73e2,
  .progress-fresh-f6d9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .sort-under-ec62,
  .short-cbce,
  .table-orange-2002,
  .image-complex-621e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .surface_static_724f,
  .new-3071 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .summary-797f,
  .picture_48b5,
  .modal_061b,
  .outline-south-4254 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .old_7ad4,
  .footer_920c,
  .outline_glass_62dc,
  .rough_82e9,
  .heading-gas-32ed,
  .logo-139e {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .notification_next_fec5,
  .backdrop-new-7fc0,
  .texture_73e2 {
    max-width: none !important;
  }
  
  .layout-blue-6797 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .sort-under-ec62 {
    font-size: 1.5rem !important;
  }
  
  .short-cbce {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .menu-light-b3e7,
  .stale_1a0b {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .table-orange-2002 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .popup_yellow_7e4e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .modal-short-a6e4 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .notification_next_fec5,
  .texture_73e2 {
    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: 3867 */
.widget-item-x0 {
  padding: 0.5rem;
  font-size: 13px;
  line-height: 1.1;
}
