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

/* Fix for any potential overflow elements */
/* NOTE: ".list_a741" 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.dim-d3ce so it can't cause
   horizontal overflow anyway. */
.disabled-3d6c,
.chip-e614,
.image_dark_d30e,
.badge_fb7d,
.highlight-outer-0f03,
.thumbnail-0418,
.north_e5e4,
.preview-6560,
.tabs_3220,
.info_c2d4,
.warm_1d27 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .middle-21a2 {
    padding: 8px 0;
  }
  
  .dynamic_923b img {
    height: 28px;
    width: auto;
  }
  
  .container_south_f7cf {
    display: none !important;
  }
  
  .card_5aba {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .card_5aba svg {
    width: 14px;
    height: 14px;
  }
  
  .grid-dark-7908 {
    padding: 6px;
  }
  
  .paper_1acc {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .image_dark_d30e,
  .chip-e614,
  .badge_fb7d,
  .highlight-outer-0f03,
  .simple_272a,
  .glass_4166,
  .current_0104,
  .overlay_9f57,
  .aside-smooth-52dd,
  .background-dark-4215,
  .grid-0fc7,
  .blue_ab53 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .plasma_d410,
  .light-2126 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .grid_outer_b16b,
  .pro_9aee,
  .table_cool_4073,
  .highlight-3e27,
  .hard-2b63,
  .grid_274a,
  .icon_2ff9 {
    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 */
  .search-99b9,
  .avatar_copper_abe3,
  .grid-b5ac,
  .advanced_2c9c,
  .east_1f9e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .info-soft-4c74,
  .bottom_ee10,
  .summary_5ec2,
  .north-9511 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .sort-23b9,
  .last-1a2a {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .component_5868,
  .black-d650,
  .chip_pressed_9b26,
  .block-paper-f918 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .message-ec00,
  .nav_3c40,
  .card-light-183d,
  .pagination-4111,
  .solid_3441,
  .static_7550 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .search-99b9,
  .avatar_copper_abe3,
  .advanced_2c9c {
    max-width: none !important;
  }
  
  .list_a741 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .info-soft-4c74 {
    font-size: 1.5rem !important;
  }
  
  .bottom_ee10 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .outline_bright_8915,
  .thumbnail_pressed_04d5 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .summary_5ec2 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .background_stone_5ad3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .banner-fixed-0ceb {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .search-99b9,
  .advanced_2c9c {
    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: a172 */
.phantom-card-u9 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.0;
}
