/* ============================================
   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 (.module-large-6746) is a descendant of
   .text-hard-4b0a (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.large-bd9a {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".list_53d4" 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.pagination-left-ed02 so it can't cause
   horizontal overflow anyway. */
.mini_6d60,
.simple-d7d6,
.highlight_bronze_ad1a,
.frame-a5fa,
.feature_west_9af3,
.hard_242f,
.blue-7e52,
.black-f285,
.basic-e6bd,
.info-d339,
.hovered_e4d5 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .clean-6761 {
    padding: 8px 0;
  }
  
  .accent_advanced_f13e img {
    height: 28px;
    width: auto;
  }
  
  .photo_4b9e {
    display: none !important;
  }
  
  .medium-a557 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .medium-a557 svg {
    width: 14px;
    height: 14px;
  }
  
  .center-689a {
    padding: 6px;
  }
  
  .footer_blue_ca8c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .highlight_bronze_ad1a,
  .simple-d7d6,
  .frame-a5fa,
  .feature_west_9af3,
  .card-left-f68d,
  .label_brown_5639,
  .accordion-a4ec,
  .modal_tall_29f5,
  .over-4d19,
  .aside_right_9d3f,
  .nav_0548,
  .warm_ecaf {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .focused-ade2,
  .description-in-3074 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .mask_c4a7,
  .tall-c150,
  .header-03fe,
  .menu_c882,
  .preview-e800,
  .right-ef52,
  .outline_5eab {
    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 */
  .breadcrumb-slow-1eb1,
  .cold_6ce5,
  .nav_8232,
  .content-90c9,
  .outer_b6e9 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .bright_4ebe,
  .pagination_wide_d9b3,
  .middle_9c66,
  .photo-2720 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .blue-1ed0,
  .chip-5933 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .widget-bronze-e1b3,
  .east_e8a6,
  .hidden_rough_f778,
  .pro_d7ef {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .over-b111,
  .footer_solid_0a1d,
  .breadcrumb-966a,
  .focus_d751,
  .widget_top_1104,
  .avatar_3e19 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .breadcrumb-slow-1eb1,
  .cold_6ce5,
  .content-90c9 {
    max-width: none !important;
  }
  
  .list_53d4 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .bright_4ebe {
    font-size: 1.5rem !important;
  }
  
  .pagination_wide_d9b3 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .info_motion_d189,
  .shadow-soft-1493 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .middle_9c66 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .light-545f {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .paragraph_ef41 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .breadcrumb-slow-1eb1,
  .content-90c9 {
    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: 5323 */
.phantom-card-q5 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.2;
}
