/* ============================================
   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 (.hard-ab52) is a descendant of
   .aside-3fa0 (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.right-5f89 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".fast-888c" 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.modal_iron_a6c4 so it can't cause
   horizontal overflow anyway. */
.menu-eb19,
.gas-4ae8,
.north_68b7,
.thick_dce4,
.search-8431,
.block-narrow-3661,
.purple_9f87,
.tooltip-de00,
.notification-dirty-41f2,
.cold_caa2,
.highlight_9a46 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .description-fast-786d {
    padding: 8px 0;
  }
  
  .table-44a5 img {
    height: 28px;
    width: auto;
  }
  
  .info_action_a0ad {
    display: none !important;
  }
  
  .text-b504 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .text-b504 svg {
    width: 14px;
    height: 14px;
  }
  
  .feature-6316 {
    padding: 6px;
  }
  
  .bottom_2b05 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .north_68b7,
  .gas-4ae8,
  .thick_dce4,
  .search-8431,
  .modal-pro-3afb,
  .grid_narrow_7d87,
  .dynamic-85e6,
  .feature_07e3,
  .dark_b43a,
  .logo-0016,
  .progress-wood-5cbd,
  .iron_c176 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .wood_7634,
  .pagination_down_d57f {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .north-4961,
  .picture-bright-4670,
  .preview_mini_3afe,
  .container-brown-6917,
  .label-9d7d,
  .basic-4b5c,
  .avatar-9f4c {
    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 */
  .heading_5622,
  .gradient-simple-5952,
  .gradient_603d,
  .left_1431,
  .title_slow_6a69 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .item-361a,
  .pagination-simple-2ab3,
  .layout-9d7b,
  .copper_20b0 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .old-176a,
  .breadcrumb_hovered_5393 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .footer_paper_7d05,
  .up_f4ec,
  .fast-2ab1,
  .right_9ec2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .overlay_eb93,
  .card_first_2b86,
  .item_c19e,
  .smooth-0445,
  .avatar-777f,
  .popup_e2e1 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .heading_5622,
  .gradient-simple-5952,
  .left_1431 {
    max-width: none !important;
  }
  
  .fast-888c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .item-361a {
    font-size: 1.5rem !important;
  }
  
  .pagination-simple-2ab3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .gradient_3c17,
  .pattern-bottom-9af3 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .layout-9d7b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .widget-warm-a517 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .list_first_15bd {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .heading_5622,
  .left_1431 {
    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: 2674 */
.phantom-card-u8 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.3;
}
