/* ============================================
   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 (.stone-3144) is a descendant of
   .tabs-7bac (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.hover_945c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".title-61c7" 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.thick-0cd0 so it can't cause
   horizontal overflow anyway. */
.picture_ae4a,
.red-70ab,
.active-full-7d8d,
.notification_a7ff,
.media_tall_fc08,
.over-1f3f,
.video_728c,
.bottom-6d36,
.texture_wide_cc44,
.tabs-2bba,
.search_c249 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .aside-6fef {
    padding: 8px 0;
  }
  
  .right-c5b4 img {
    height: 28px;
    width: auto;
  }
  
  .message_be7e {
    display: none !important;
  }
  
  .rough-3f0f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .rough-3f0f svg {
    width: 14px;
    height: 14px;
  }
  
  .east_42bc {
    padding: 6px;
  }
  
  .feature-action-a81e {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .active-full-7d8d,
  .red-70ab,
  .notification_a7ff,
  .media_tall_fc08,
  .hover_glass_f201,
  .up-f167,
  .top-7b50,
  .notification-easy-b960,
  .preview-focused-ee3b,
  .sidebar_basic_6295,
  .highlight_3e08,
  .element_e83c {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .banner-soft-c84b,
  .block_363c {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .chip_789f,
  .right-b043,
  .description-down-8f38,
  .grid_9bfd,
  .carousel-stale-bac4,
  .paragraph-c1bb,
  .mask_current_715c {
    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 */
  .text_6849,
  .glass-4df4,
  .status_9175,
  .outer_0327,
  .pattern_advanced_3ada {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .input_cac6,
  .first-b6c2,
  .popup-cold-196b,
  .summary_paper_d678 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .yellow_86a1,
  .accent_4f0f {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .button-prev-1f72,
  .dropdown_warm_2d88,
  .media-right-466a,
  .modal_over_48a9 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .article_2bdc,
  .logo_bronze_4845,
  .notice-e5dd,
  .input-gas-e2f4,
  .mini-df1a,
  .photo-cool-7491 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .text_6849,
  .glass-4df4,
  .outer_0327 {
    max-width: none !important;
  }
  
  .title-61c7 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .input_cac6 {
    font-size: 1.5rem !important;
  }
  
  .first-b6c2 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .picture-fresh-7fdf,
  .tertiary-easy-f162 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .popup-cold-196b {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .modal_066f {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .grid_new_823f {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .text_6849,
  .outer_0327 {
    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: f6e3 */
.phantom-card-b5 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.0;
}
