/* ============================================
   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 (.surface_small_7681) is a descendant of
   .alert_ef02 (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.mini-8bc5 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".simple_7d41" 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.north-bbdc so it can't cause
   horizontal overflow anyway. */
.section-pressed-63ca,
.column_slow_be33,
.section_2677,
.simple-1c7b,
.purple-08b1,
.tiny-1414,
.rough_86d3,
.hovered_eb80,
.disabled-hot-2957,
.thumbnail_brown_43be,
.solid-0be0 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .motion-97fe {
    padding: 8px 0;
  }
  
  .dirty-4fb1 img {
    height: 28px;
    width: auto;
  }
  
  .heading_brown_d9f6 {
    display: none !important;
  }
  
  .detail-6517 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .detail-6517 svg {
    width: 14px;
    height: 14px;
  }
  
  .purple_c382 {
    padding: 6px;
  }
  
  .gallery-a45d {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .section_2677,
  .column_slow_be33,
  .simple-1c7b,
  .purple-08b1,
  .tooltip-1bc4,
  .last_c054,
  .orange-acbd,
  .dim-1411,
  .motion_39fa,
  .sort_abb4,
  .picture_385b,
  .preview-552b {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .tabs-e446,
  .chip-5370 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .south_7c7f,
  .cool_c363,
  .iron-7104,
  .gallery_0ed5,
  .widget-slow-ada4,
  .wrapper-4c3b,
  .accent-fluid-531f {
    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 */
  .form-a268,
  .button-steel-9354,
  .slider-thick-b611,
  .thumbnail-f803,
  .primary-4a23 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .message-green-627a,
  .status-south-bd59,
  .heading_d7fc,
  .copper-8858 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .tiny_4d2b,
  .media_0956 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .black-a2dc,
  .dark_e23f,
  .logo-light-485d,
  .focused_6696 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .hero_b570,
  .basic_54d5,
  .preview-over-7bd2,
  .mask-0975,
  .full_e3e0,
  .notification_static_4da1 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .form-a268,
  .button-steel-9354,
  .thumbnail-f803 {
    max-width: none !important;
  }
  
  .simple_7d41 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .message-green-627a {
    font-size: 1.5rem !important;
  }
  
  .status-south-bd59 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .text_b301,
  .heading_dim_3e8a {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .heading_d7fc {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .description_green_f922 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .tooltip-2b26 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .form-a268,
  .thumbnail-f803 {
    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: 0cb8 */
.widget-item-e6 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.2;
}
