/* ============================================
   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 (.title_warm_6ae1) is a descendant of
   .dim-daf4 (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.shade-mini-d012 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".article_8ddb" 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.notice-hot-d9b1 so it can't cause
   horizontal overflow anyway. */
.media-yellow-ca02,
.stone_7ce6,
.status-8c8f,
.paragraph_6cb4,
.modal_58ef,
.container_yellow_374f,
.photo-dim-b3da,
.badge_90ce,
.solid_e0f2,
.west_5789,
.red_5634 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .pressed_767a {
    padding: 8px 0;
  }
  
  .advanced_3ff4 img {
    height: 28px;
    width: auto;
  }
  
  .paper-a3e9 {
    display: none !important;
  }
  
  .current_b74c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .current_b74c svg {
    width: 14px;
    height: 14px;
  }
  
  .block-white-7b2e {
    padding: 6px;
  }
  
  .texture-inner-6708 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .status-8c8f,
  .stone_7ce6,
  .paragraph_6cb4,
  .modal_58ef,
  .motion_7e93,
  .row_4a92,
  .surface_bottom_4c2c,
  .hover-9ff4,
  .tooltip_outer_0b0a,
  .large-098d,
  .table-white-68e0,
  .carousel-stale-b96e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .detail-down-37e4,
  .container_south_8131 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .block_lite_aa81,
  .background-2902,
  .tiny_90ca,
  .outline-narrow-b745,
  .texture_ae62,
  .upper-6b15,
  .panel_936a {
    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 */
  .widget-8020,
  .module-da47,
  .button-liquid-21f6,
  .bright-c53c,
  .gradient-purple-b47f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .notification-basic-84a0,
  .popup_thick_c7b7,
  .content-clean-0319,
  .stone-aeed {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .image_top_8988,
  .badge-fresh-0d59 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .feature_cc42,
  .hero-3860,
  .card-f0f7,
  .heading_old_d52c {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hero-black-9e9c,
  .modal-46c6,
  .orange_3ac1,
  .footer-f2ae,
  .background_e710,
  .title_red_4751 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .widget-8020,
  .module-da47,
  .bright-c53c {
    max-width: none !important;
  }
  
  .article_8ddb {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .notification-basic-84a0 {
    font-size: 1.5rem !important;
  }
  
  .popup_thick_c7b7 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .accordion_upper_54fa,
  .alert-2cc4 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .content-clean-0319 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .status_current_82d8 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .sort_9c6f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .widget-8020,
  .bright-c53c {
    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: 92ce */
.ghost-box-v7 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.0;
}
