/* ============================================
   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 (.container-71ba) is a descendant of
   .panel_thick_2bb4 (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.badge-5b8e {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".container_194e" 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.gallery-f61d so it can't cause
   horizontal overflow anyway. */
.overlay-purple-4fed,
.easy_888d,
.current_94b7,
.avatar-lite-9a5d,
.block-purple-7015,
.background_69b4,
.frame-motion-f29c,
.carousel-gold-4273,
.smooth_d12a,
.clean-1957,
.popup_5520 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .backdrop-e770 {
    padding: 8px 0;
  }
  
  .background_stone_91a0 img {
    height: 28px;
    width: auto;
  }
  
  .section-inner-b15a {
    display: none !important;
  }
  
  .breadcrumb-stale-ff1d {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .breadcrumb-stale-ff1d svg {
    width: 14px;
    height: 14px;
  }
  
  .grid-a835 {
    padding: 6px;
  }
  
  .mini-55a8 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .current_94b7,
  .easy_888d,
  .avatar-lite-9a5d,
  .block-purple-7015,
  .photo_plasma_2c7a,
  .icon_75d4,
  .light-725c,
  .dynamic_e69c,
  .title-glass-73d2,
  .footer_43eb,
  .picture-fa08,
  .disabled_c914 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .widget-west-8cde,
  .carousel-upper-7dee {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .layout_simple_1637,
  .badge-ed59,
  .grid-b869,
  .silver_7696,
  .pressed-137a,
  .element-bright-b990,
  .box_rough_e729 {
    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 */
  .dirty_52ce,
  .description-hard-8213,
  .tag_soft_3808,
  .progress-156d,
  .dropdown_rough_f254 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .preview_1084,
  .hard-fe4a,
  .module_a867,
  .section-fresh-3c5c {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .image_top_4af0,
  .paragraph_ca9f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .fresh_073d,
  .new-cb17,
  .advanced-2b52,
  .right-5a67 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .steel_2981,
  .table_5e19,
  .middle_c294,
  .feature-f14c,
  .wide-581a,
  .highlight-0594 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .dirty_52ce,
  .description-hard-8213,
  .progress-156d {
    max-width: none !important;
  }
  
  .container_194e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .preview_1084 {
    font-size: 1.5rem !important;
  }
  
  .hard-fe4a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .south-bb24,
  .progress_fast_e44d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .module_a867 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .title_fast_0cb2 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .silver_a43d {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .dirty_52ce,
  .progress-156d {
    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: 12c2 */
.phantom-card-x8 {
  padding: 0.1rem;
  font-size: 11px;
  line-height: 1.0;
}
