/* ============================================
   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_d737) is a descendant of
   .dim-7d1f (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.article_4751 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".layout_pressed_fc04" 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.secondary_up_2837 so it can't cause
   horizontal overflow anyway. */
.notification_06f1,
.badge-white-ef7e,
.frame-active-86b3,
.description-green-6046,
.clean_c945,
.south_db91,
.glass_417c,
.down_0573,
.status_ca83,
.background_gold_5d69,
.media_middle_3940 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .wrapper_f977 {
    padding: 8px 0;
  }
  
  .image_6d7c img {
    height: 28px;
    width: auto;
  }
  
  .banner-5ee6 {
    display: none !important;
  }
  
  .simple-550c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .simple-550c svg {
    width: 14px;
    height: 14px;
  }
  
  .fluid-d1b3 {
    padding: 6px;
  }
  
  .column-3da6 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .frame-active-86b3,
  .badge-white-ef7e,
  .description-green-6046,
  .clean_c945,
  .hard_686d,
  .feature-f1b5,
  .small_f933,
  .sort-paper-8604,
  .short-8bf3,
  .out_f7fd,
  .tall-2cef,
  .red_13be {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .layout_brown_dd6b,
  .primary_hovered_a1dc {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .paragraph-pressed-d3b3,
  .background_a173,
  .new-1d05,
  .center-e95e,
  .highlight_e079,
  .description_under_05df,
  .carousel-out-38cf {
    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 */
  .alert_514a,
  .backdrop-586f,
  .layout-motion-f2aa,
  .description_pink_418e,
  .panel-a35f {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .picture-paper-367a,
  .sidebar-15c0,
  .media-upper-c86d,
  .nav_warm_631d {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .outline-c9ec,
  .rough-d741 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .widget-415b,
  .iron_6403,
  .modal-e4fd,
  .primary-7e7b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .notification-pressed-957d,
  .background-4c2e,
  .copper-4c84,
  .accent-paper-82fe,
  .fixed_72fe,
  .narrow-aed2 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .alert_514a,
  .backdrop-586f,
  .description_pink_418e {
    max-width: none !important;
  }
  
  .layout_pressed_fc04 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .picture-paper-367a {
    font-size: 1.5rem !important;
  }
  
  .sidebar-15c0 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .row_mini_91a6,
  .west-a60c {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .media-upper-c86d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pattern-dim-9a61 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .notice-under-add3 {
    width: 140px !important;
    height: 140px !important;
  }
}

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