/* ============================================
   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 (.banner-huge-c826) is a descendant of
   .pressed_b541 (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.description-f3ae {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".menu-up-c34c" 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.picture_dynamic_2003 so it can't cause
   horizontal overflow anyway. */
.cool_2e12,
.logo-north-ac56,
.smooth_317e,
.link_hard_57e3,
.preview-23db,
.block_31c4,
.modal_a85d,
.overlay_0a4d,
.surface_c75e,
.caption_d3b5,
.pattern-fresh-846f {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .gas-dae9 {
    padding: 8px 0;
  }
  
  .hard_4fd1 img {
    height: 28px;
    width: auto;
  }
  
  .content_fb0c {
    display: none !important;
  }
  
  .input_lite_54a4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .input_lite_54a4 svg {
    width: 14px;
    height: 14px;
  }
  
  .orange_2ee6 {
    padding: 6px;
  }
  
  .old_5e38 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .smooth_317e,
  .logo-north-ac56,
  .link_hard_57e3,
  .preview-23db,
  .accent_3a80,
  .grid-489e,
  .modal-bf0e,
  .cool-978a,
  .fast_2be6,
  .accordion-98e1,
  .frame_prev_49ca {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .blue-694d,
  .card_warm_02b6 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .highlight_1572,
  .surface_16cb,
  .grid-9606,
  .section-0468,
  .down_a893,
  .steel-41ec,
  .paragraph_paper_7080 {
    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 */
  .focused-3b82,
  .item_stone_a095,
  .info-64ba,
  .medium-0ee9,
  .preview_d451 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .static_3354,
  .button_old_a96f,
  .popup_rough_12a1,
  .search-2aae {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .aside_28ba,
  .footer_slow_4de6 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .title_pro_9858,
  .shadow_98a6,
  .panel_lower_1d96,
  .simple-1fbf {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .tertiary_center_9945,
  .short-4560,
  .plasma_5bc0,
  .simple-413a,
  .dropdown_fluid_1e75,
  .button_e67d {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .focused-3b82,
  .item_stone_a095,
  .medium-0ee9 {
    max-width: none !important;
  }
  
  .menu-up-c34c {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .static_3354 {
    font-size: 1.5rem !important;
  }
  
  .button_old_a96f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .tiny_c772,
  .summary-steel-20eb {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .popup_rough_12a1 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .fresh-72b9 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .slow_9f19 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .focused-3b82,
  .medium-0ee9 {
    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: cbff */
.widget-item-b8 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.1;
}
