/* ============================================
   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 (.accent_tall_993a) is a descendant of
   .last_8ed0 (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.grid_narrow_9d58 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".next-1885" 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.hidden-fresh-d27f so it can't cause
   horizontal overflow anyway. */
.solid-ce74,
.prev_2872,
.description_center_96d4,
.dim_d220,
.middle-95b5,
.primary-cool-fbfb,
.tertiary-paper-141b,
.breadcrumb_b48e,
.surface-599a,
.item-simple-c2e1,
.avatar_4a0c {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .status_fresh_3a6b {
    padding: 8px 0;
  }
  
  .current_cb3e img {
    height: 28px;
    width: auto;
  }
  
  .photo-stale-c5aa {
    display: none !important;
  }
  
  .gallery-5181 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .gallery-5181 svg {
    width: 14px;
    height: 14px;
  }
  
  .photo-0f97 {
    padding: 6px;
  }
  
  .slider-next-370a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .description_center_96d4,
  .prev_2872,
  .dim_d220,
  .middle-95b5,
  .form-dim-530b,
  .notification-purple-f404,
  .inner_7e42,
  .nav_2644,
  .short_dd39,
  .gold-bfec,
  .tabs-04ea,
  .cold-6f25 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .right-b898,
  .surface_active_0e08 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .new_8613,
  .prev_77b2,
  .table-936b,
  .fresh_ed61,
  .menu_lower_50a6,
  .hero_1eca,
  .item-cc58 {
    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 */
  .border_dirty_1dff,
  .chip_motion_535a,
  .logo-c640,
  .under_f7b5,
  .notification_narrow_661a {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .button-5a1e,
  .input-9f63,
  .widget-92d8,
  .nav-fixed-4cae {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .shade-dark-fabf,
  .alert_rough_42c8 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .feature-blue-2a0c,
  .article_b15c,
  .accordion_advanced_96d9,
  .text-simple-cb1c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .secondary-e3c0,
  .section_2b64,
  .layout-c5bf,
  .hero_outer_fae2,
  .simple-8034,
  .notification-b081 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .border_dirty_1dff,
  .chip_motion_535a,
  .under_f7b5 {
    max-width: none !important;
  }
  
  .next-1885 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .button-5a1e {
    font-size: 1.5rem !important;
  }
  
  .input-9f63 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .stone_ce8d,
  .glass_76d8 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .widget-92d8 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .west_5958 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .container_old_6d0c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .border_dirty_1dff,
  .under_f7b5 {
    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: 6eac */
.phantom-card-x9 {
  padding: 0.4rem;
  font-size: 14px;
  line-height: 1.2;
}
