/* ============================================
   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 (.down-ce3f) is a descendant of
   .lite-77ca (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.
   Two site templates coexist: legacy obfuscated-class (header.border-cde4)
   and the redesigned template (header.article_538f). Keep both selectors. */
header.border-cde4,
header.article_538f {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".aside_full_7f7e" 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.status_bottom_3944 so it can't cause
   horizontal overflow anyway. */
.warm_ea40,
.notice-1bf8,
.filter_copper_dcf2,
.breadcrumb-fresh-4679,
.blue_f1ca,
.progress_1844,
.widget-upper-4d2e,
.modal_out_25c5,
.gold_12a4,
.fresh-0f95,
.complex-5476 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .short-0a88 {
    padding: 8px 0;
  }
  
  .soft-3dea img {
    height: 28px;
    width: auto;
  }
  
  .hero_last_63ac {
    display: none !important;
  }
  
  .fresh_f517 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .fresh_f517 svg {
    width: 14px;
    height: 14px;
  }
  
  .table-0aef {
    padding: 6px;
  }
  
  .widget-83ba {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .filter_copper_dcf2,
  .notice-1bf8,
  .breadcrumb-fresh-4679,
  .blue_f1ca,
  .cool_049e,
  .border_3373,
  .row-e5af,
  .north-686e,
  .alert_68f1,
  .north_3b2c,
  .large_236a,
  .mask_down_18cf {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .notice_silver_4b2d,
  .heading-88d5 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .iron_9693,
  .heading_cold_68df,
  .label_7a29,
  .white_5888,
  .tertiary_03a3,
  .static-cac3,
  .prev_fce6 {
    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 */
  .paper_2ea9,
  .media_dacf,
  .component_3c4f,
  .dim-296e,
  .secondary-green-8768 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .hidden_6ca8,
  .module-a100,
  .outline_fac5,
  .title_9f5e {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .notification-narrow-7097,
  .primary_pink_3d8b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .summary_hot_98aa,
  .bright_d4df,
  .content-cool-89d7,
  .preview-slow-ee74 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .background-9e4e,
  .component-41a6,
  .pink_d99b,
  .hovered_1b74,
  .background-6446,
  .thick-5377 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .paper_2ea9,
  .media_dacf,
  .dim-296e {
    max-width: none !important;
  }
  
  .aside_full_7f7e {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .hidden_6ca8 {
    font-size: 1.5rem !important;
  }
  
  .module-a100 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .photo_5cda,
  .grid_glass_286e {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .outline_fac5 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .new_ccde {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .button_905c {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .paper_2ea9,
  .dim-296e {
    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: 94a5 */
.outline-fast-6310 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}

/* css-noise: 470c */
.ghost-box-y2 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.2;
}
