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

/* Fix for any potential overflow elements */
/* NOTE: ".status_purple_cb08" 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.button_hard_261d so it can't cause
   horizontal overflow anyway. */
.old_856e,
.over-29b1,
.prev-db8c,
.wood-4462,
.black_02c5,
.glass-83c1,
.soft-80b2,
.article-new-dc95,
.image-cbb3,
.chip-purple-dcf9,
.status_3099 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .notification_dirty_4244 {
    padding: 8px 0;
  }
  
  .detail_7d01 img {
    height: 28px;
    width: auto;
  }
  
  .gold-84e0 {
    display: none !important;
  }
  
  .block_fast_8435 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .block_fast_8435 svg {
    width: 14px;
    height: 14px;
  }
  
  .image-f155 {
    padding: 6px;
  }
  
  .paragraph_d0c2 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .prev-db8c,
  .over-29b1,
  .wood-4462,
  .black_02c5,
  .preview-bfc6,
  .selected-27ea,
  .motion_6068,
  .focus_first_4c9b,
  .dynamic_9b06,
  .widget_pressed_e0ce,
  .wrapper-9f63,
  .info-pro-a248 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .thumbnail-cool-7c80,
  .hidden-easy-9636 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .notice_2727,
  .picture_a3d7,
  .focused-4257,
  .fluid_2d85,
  .icon-black-8815,
  .element-81d7,
  .detail-motion-3773 {
    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 */
  .first-63d4,
  .pattern-1922,
  .dynamic_a2ec,
  .highlight-d923,
  .breadcrumb-e9f7 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .column_3d39,
  .header_north_7352,
  .fixed-765e,
  .chip_top_6990 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .picture-331e,
  .wrapper_ab22 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .frame-0b91,
  .header-yellow-330b,
  .label-707d,
  .left-c9f7 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .search_plasma_ffa2,
  .chip-tall-a960,
  .secondary_bottom_c359,
  .grid_237c,
  .tertiary_43a4,
  .carousel-inner-7a0f {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .first-63d4,
  .pattern-1922,
  .highlight-d923 {
    max-width: none !important;
  }
  
  .status_purple_cb08 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .column_3d39 {
    font-size: 1.5rem !important;
  }
  
  .header_north_7352 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .large_a34a,
  .highlight-tiny-d7b2 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .fixed-765e {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .status-full-198e {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .badge_north_60cb {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .first-63d4,
  .highlight-d923 {
    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: 0214 */
.shadow-element-s8 {
  padding: 0.3rem;
  font-size: 10px;
  line-height: 1.2;
}
