/* ============================================
   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 (.photo_short_d602) is a descendant of
   .table_8279 (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.list-6ea3 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".accent_2701" 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.aside-new-53c6 so it can't cause
   horizontal overflow anyway. */
.message_7aaf,
.middle_41de,
.tiny_7d21,
.gallery-fresh-a863,
.glass-8e7e,
.text-0243,
.light-7787,
.complex-5e13,
.solid-6561,
.inner-7037,
.frame_complex_e2a8 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .preview-pressed-762f {
    padding: 8px 0;
  }
  
  .cool_4ba6 img {
    height: 28px;
    width: auto;
  }
  
  .item-purple-be21 {
    display: none !important;
  }
  
  .tag-c9ac {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tag-c9ac svg {
    width: 14px;
    height: 14px;
  }
  
  .component-top-e5af {
    padding: 6px;
  }
  
  .block_fluid_01e2 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .tiny_7d21,
  .middle_41de,
  .gallery-fresh-a863,
  .glass-8e7e,
  .focus_fluid_ca85,
  .disabled-7432,
  .box-warm-cbbd,
  .sort-yellow-9a7a,
  .pro_cd3f,
  .sidebar-paper-aba9,
  .layout-dacc,
  .notification-47da {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .mini-2cae,
  .active_4166 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .component-7379,
  .row_mini_339e,
  .menu-3394,
  .over_d866,
  .steel-c5bf,
  .middle-60f1,
  .tiny-d068 {
    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 */
  .red_d2a7,
  .grid_b9fc,
  .element_outer_5385,
  .progress-77f7,
  .pagination_right_d472 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hover_ac97,
  .paper-5985,
  .paragraph_7c6d,
  .dropdown_227e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .menu-0e0d,
  .rough-9a36 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .upper-8841,
  .title_e7f2,
  .input_65ea,
  .dim-aaa0 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .out_29dc,
  .table-stone-e88b,
  .thick_7fe4,
  .last_839f,
  .modal-b765,
  .secondary_basic_3e29 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .red_d2a7,
  .grid_b9fc,
  .progress-77f7 {
    max-width: none !important;
  }
  
  .accent_2701 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hover_ac97 {
    font-size: 1.5rem !important;
  }
  
  .paper-5985 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .caption_c58f,
  .active_out_03c1 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .paragraph_7c6d {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .focused_2675 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .old-e890 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .red_d2a7,
  .progress-77f7 {
    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: fbff */
.widget-item-n7 {
  padding: 0.2rem;
  font-size: 14px;
  line-height: 1.0;
}
