/* ============================================
   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 (.shade-a2e7) is a descendant of
   .preview_e548 (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.huge_9dc1 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".dropdown-iron-b05b" 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.motion-0695 so it can't cause
   horizontal overflow anyway. */
.pagination-pro-4338,
.surface-4b66,
.media-2bfb,
.module-4363,
.status_0c8f,
.menu_center_44fd,
.form-right-5190,
.sort_df76,
.silver_cc1b,
.static-0ee5,
.content-501a {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .title_new_4295 {
    padding: 8px 0;
  }
  
  .simple_fabe img {
    height: 28px;
    width: auto;
  }
  
  .grid_264c {
    display: none !important;
  }
  
  .row-rough-635f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .row-rough-635f svg {
    width: 14px;
    height: 14px;
  }
  
  .shade-soft-c016 {
    padding: 6px;
  }
  
  .outline_b66a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .media-2bfb,
  .surface-4b66,
  .module-4363,
  .status_0c8f,
  .hidden-north-22f7,
  .tooltip-red-7bef,
  .motion-7240,
  .title_inner_cb2c,
  .notice_d5d7,
  .hard-1d46,
  .overlay_gold_aab0,
  .chip_b0f5 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .carousel-gas-0cec,
  .section-06a6 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .gradient_fixed_383d,
  .status-09df,
  .short_2f58,
  .thick_327f,
  .block-068b,
  .grid_9cf8,
  .main_9046 {
    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 */
  .red_17d0,
  .component-down-0cbb,
  .clean_f102,
  .outer_86d6,
  .light_8548 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .lower_2e19,
  .soft-9126,
  .focused_5401,
  .block-light-02fc {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .pattern-huge-8537,
  .dim_745b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .text_e960,
  .huge-8ba0,
  .shade-thick-4f17,
  .form-inner-67f2 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .preview_plasma_5172,
  .tertiary-blue-3684,
  .alert-e5d4,
  .accordion_green_8b21,
  .left-db1f,
  .column-ae9b {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .red_17d0,
  .component-down-0cbb,
  .outer_86d6 {
    max-width: none !important;
  }
  
  .dropdown-iron-b05b {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .lower_2e19 {
    font-size: 1.5rem !important;
  }
  
  .soft-9126 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .link-outer-f59f,
  .banner-1870 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .focused_5401 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .text_cold_23d9 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .image_46d9 {
    width: 140px !important;
    height: 140px !important;
  }
}

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