/* ============================================
   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 (.picture-fixed-66b3) is a descendant of
   .simple-3e0b (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.action-d109 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".warm_5065" 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.element-plasma-928a so it can't cause
   horizontal overflow anyway. */
.accordion_234b,
.inner-1cfb,
.primary-cold-b713,
.hot_df12,
.white_d128,
.hover-iron-504e,
.background-b647,
.stale_d901,
.text_in_770b,
.tertiary_fresh_90e6,
.wood-b3be {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .article-bacb {
    padding: 8px 0;
  }
  
  .out-fc81 img {
    height: 28px;
    width: auto;
  }
  
  .dirty_2807 {
    display: none !important;
  }
  
  .image-0ac3 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .image-0ac3 svg {
    width: 14px;
    height: 14px;
  }
  
  .button_south_41d6 {
    padding: 6px;
  }
  
  .wrapper_e3cb {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .primary-cold-b713,
  .inner-1cfb,
  .hot_df12,
  .white_d128,
  .aside_9d81,
  .bright-fb26,
  .bronze-7def,
  .bottom_de01,
  .pink_7e51,
  .focus-f1cb,
  .text_2394,
  .secondary_d727 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .column_left_8ef1,
  .bottom_d505 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .primary_46e9,
  .title_6fe9,
  .banner_6a4d,
  .next-5e17,
  .text_prev_dd06,
  .easy_7da7,
  .outer-9f74 {
    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 */
  .input-next-b593,
  .caption-dirty-2fde,
  .gold-9a30,
  .focused_d481,
  .pattern-7293 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .main-768c,
  .glass-b86f,
  .label-d88c,
  .tertiary-7592 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hero_219a,
  .copper_90b5 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .small-0999,
  .current_df50,
  .content_199e,
  .status-3b54 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .link_4e8b,
  .outer_8a9b,
  .search-center-349c,
  .fast-0a2a,
  .status_854f,
  .detail-small-69bf {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .input-next-b593,
  .caption-dirty-2fde,
  .focused_d481 {
    max-width: none !important;
  }
  
  .warm_5065 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .main-768c {
    font-size: 1.5rem !important;
  }
  
  .glass-b86f {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .info-small-1270,
  .article_44ae {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .label-d88c {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .plasma-e8db {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .grid-41ac {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .input-next-b593,
  .focused_d481 {
    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: c872 */
.widget-item-t4 {
  padding: 0.5rem;
  font-size: 12px;
  line-height: 1.1;
}
