/* ============================================
   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 (.border-selected-debe) is a descendant of
   .label-dd40 (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.old_5eb7 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".texture_light_1ffe" 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.video_bee5 so it can't cause
   horizontal overflow anyway. */
.copper_c12a,
.top-c692,
.medium-d60e,
.sidebar_0fac,
.paper_a464,
.gallery-dynamic-f820,
.accordion-e188,
.input-4ae3,
.video-7c51,
.avatar_39f2,
.narrow-3c04 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .complex_f210 {
    padding: 8px 0;
  }
  
  .info-rough-c487 img {
    height: 28px;
    width: auto;
  }
  
  .dynamic_6e06 {
    display: none !important;
  }
  
  .aside-4e68 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .aside-4e68 svg {
    width: 14px;
    height: 14px;
  }
  
  .main-fab2 {
    padding: 6px;
  }
  
  .status-fast-231b {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .medium-d60e,
  .top-c692,
  .sidebar_0fac,
  .paper_a464,
  .old_3646,
  .summary-complex-5631,
  .panel_07be,
  .plasma-4137,
  .accent_complex_2a7f,
  .east_d417,
  .column_brown_6ada,
  .detail_e45e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .text-64e7,
  .hero-3947 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .picture-hard-876d,
  .wide-6504,
  .slow-fe51,
  .layout-a0d4,
  .table-stale-1194,
  .preview-3eeb,
  .content-a277 {
    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 */
  .south-6afe,
  .up-1bd2,
  .gallery-2fea,
  .widget-first-e34c,
  .layout_1c58 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .solid-7055,
  .stale-ffcc,
  .black-f6c7,
  .dark_31f8 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .hero-7c71,
  .thumbnail_cee6 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .pattern_9ad8,
  .main-lite-bf92,
  .fast-d827,
  .silver-d99b {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .gold_2a39,
  .short-45b8,
  .photo_c568,
  .dark-4fc1,
  .popup_99d4,
  .media-action-c783 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .south-6afe,
  .up-1bd2,
  .widget-first-e34c {
    max-width: none !important;
  }
  
  .texture_light_1ffe {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .solid-7055 {
    font-size: 1.5rem !important;
  }
  
  .stale-ffcc {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .widget_adda,
  .notification-tall-2b77 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .black-f6c7 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .card-pro-dc6d {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .focus_hovered_d5e6 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .south-6afe,
  .widget-first-e34c {
    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: 6088 */
.ghost-box-v4 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.3;
}
