/* ============================================
   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 (.brown-2459) is a descendant of
   .icon-ffb8 (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.detail-b413 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".content-blue-a106" 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.progress_3b07 so it can't cause
   horizontal overflow anyway. */
.gradient_warm_f965,
.notification_8703,
.border-93a5,
.banner_focused_bf47,
.heading-25a5,
.pink-bf6a,
.table_ee82,
.brown-6873,
.summary-south-d034,
.avatar-action-4cc1,
.button_1409 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .first-f658 {
    padding: 8px 0;
  }
  
  .accent-6647 img {
    height: 28px;
    width: auto;
  }
  
  .module-inner-3f0c {
    display: none !important;
  }
  
  .top-254c {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .top-254c svg {
    width: 14px;
    height: 14px;
  }
  
  .panel_orange_3907 {
    padding: 6px;
  }
  
  .feature_paper_478a {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .border-93a5,
  .notification_8703,
  .banner_focused_bf47,
  .heading-25a5,
  .search_3c72,
  .secondary_full_6f10,
  .heading_wide_3d31,
  .highlight_7d5e,
  .steel-e460,
  .message-35f9,
  .secondary-5afb,
  .hovered_54d7 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .paragraph_eebd,
  .over_f041 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .card_2f31,
  .green-f940,
  .thumbnail_gas_d423,
  .aside_iron_01cf,
  .center_584a,
  .chip-stone-cd0f,
  .warm_83e6 {
    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 */
  .full-a6fb,
  .message_iron_a07f,
  .video-0b5a,
  .under_5042,
  .hover_new_72ff {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .plasma_7dc7,
  .section-0fd3,
  .picture-dd61,
  .texture_short_07e3 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .icon-fresh-4f4f,
  .label_cool_1680 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .breadcrumb_7351,
  .action-7438,
  .paper_b261,
  .preview_2313 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .primary-0ec8,
  .article-top-09fd,
  .detail-b7f0,
  .photo_c678,
  .brown_abf5,
  .cold-c733 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .full-a6fb,
  .message_iron_a07f,
  .under_5042 {
    max-width: none !important;
  }
  
  .content-blue-a106 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .plasma_7dc7 {
    font-size: 1.5rem !important;
  }
  
  .section-0fd3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .modal-595a,
  .overlay-pro-55c2 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .picture-dd61 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .overlay_7b78 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .notification_prev_80aa {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .full-a6fb,
  .under_5042 {
    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: aaac */
.widget-item-l7 {
  padding: 0.2rem;
  font-size: 13px;
  line-height: 1.1;
}
