/* ============================================
   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 (.card-c55e) is a descendant of
   .orange_f49f (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.simple_5d86 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".video-59a8" 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.label_642c so it can't cause
   horizontal overflow anyway. */
.large-66fa,
.iron_f131,
.east-c9d5,
.button_4a59,
.table-tall-8533,
.thick-04a8,
.accent_363c,
.nav-blue-d1e9,
.module_5d6c,
.header-dark-2492,
.gold-6032 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .sidebar_1778 {
    padding: 8px 0;
  }
  
  .hover_3dd1 img {
    height: 28px;
    width: auto;
  }
  
  .fluid-8580 {
    display: none !important;
  }
  
  .gallery_huge_035b {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .gallery_huge_035b svg {
    width: 14px;
    height: 14px;
  }
  
  .module_red_1c71 {
    padding: 6px;
  }
  
  .feature-eb66 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .east-c9d5,
  .iron_f131,
  .button_4a59,
  .table-tall-8533,
  .sidebar-2410,
  .module_light_fb28,
  .aside_copper_c89e,
  .active-upper-a2f9,
  .border-4ba3,
  .backdrop-huge-b1ea,
  .modal-54a5 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .hard-2921,
  .dropdown-232c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .top_31f3,
  .breadcrumb_stone_585e,
  .shadow-pink-f0c3,
  .avatar_plasma_b461,
  .tertiary-large-bad1,
  .steel_62d7,
  .gradient-94db {
    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 */
  .large_469e,
  .alert-bf4f,
  .aside-5e6a,
  .text-basic-b750,
  .media_b7f4 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .brown-ff05,
  .button-e112,
  .overlay_33a0,
  .accent-selected-1a49 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .full_5678,
  .soft-9040 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .fluid-d474,
  .frame_3164,
  .active-bf7c,
  .container_a90b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .focused_84b0,
  .orange-fbf1,
  .complex_3dc2,
  .middle_f946,
  .component_wide_4fbc,
  .component-9656 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .large_469e,
  .alert-bf4f,
  .text-basic-b750 {
    max-width: none !important;
  }
  
  .video-59a8 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .brown-ff05 {
    font-size: 1.5rem !important;
  }
  
  .button-e112 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .disabled_dirty_9e87,
  .border_pink_3e69 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .overlay_33a0 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .inner_4009 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .old_ab19 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .large_469e,
  .text-basic-b750 {
    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: 5184 */
.phantom-card-d6 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.0;
}
