/* ============================================
   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 (.banner-basic-dfc2) is a descendant of
   .modal_1a31 (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.accent-397a {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".notification-fresh-e09f" 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.smooth-2d41 so it can't cause
   horizontal overflow anyway. */
.badge_72c9,
.selected-58f1,
.table_hard_c001,
.search-clean-4a3b,
.frame-b693,
.photo-narrow-8183,
.list_99d4,
.static-cce2,
.highlight_iron_946f,
.west-994a,
.wide-b354 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .icon-4cc7 {
    padding: 8px 0;
  }
  
  .box_right_0bfc img {
    height: 28px;
    width: auto;
  }
  
  .tag_d210 {
    display: none !important;
  }
  
  .tall_f872 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .tall_f872 svg {
    width: 14px;
    height: 14px;
  }
  
  .prev_7a30 {
    padding: 6px;
  }
  
  .notice_ef9f {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .table_hard_c001,
  .selected-58f1,
  .search-clean-4a3b,
  .frame-b693,
  .detail_steel_e0a0,
  .action-ab60,
  .summary-3708,
  .pagination_steel_22b5,
  .cool_42f6,
  .center_aa43,
  .media-1aaa {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .search_4dc2,
  .hidden-1daf {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .status_005c,
  .west-fcb6,
  .cool_5f1e,
  .wide_02ee,
  .tall-bc1e,
  .top-5785,
  .avatar_5f99 {
    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 */
  .video-basic-8f3c,
  .filter-1eef,
  .form-40ce,
  .progress-bottom-86de,
  .pagination_b62d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .description-out-1c7e,
  .simple_77bc,
  .aside_8394,
  .orange_6ad1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .inner_a07b,
  .overlay_66ef {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .soft-29e6,
  .summary_23d1,
  .paragraph_hovered_ce28,
  .banner-basic-b332 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .up_e8e6,
  .dark-c347,
  .wide_217d,
  .hard-a5e8,
  .tertiary_a69f,
  .overlay_77b2 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .video-basic-8f3c,
  .filter-1eef,
  .progress-bottom-86de {
    max-width: none !important;
  }
  
  .notification-fresh-e09f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .description-out-1c7e {
    font-size: 1.5rem !important;
  }
  
  .simple_77bc {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .popup_upper_7b27,
  .outline_099d {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .aside_8394 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pagination_2bbc {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .input-e0ef {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .video-basic-8f3c,
  .progress-bottom-86de {
    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: 1a6b */
.phantom-card-d1 {
  padding: 0.4rem;
  font-size: 10px;
  line-height: 1.1;
}
