/* ============================================
   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 (.accent_0cbd) is a descendant of
   .card-fast-4aaa (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.warm_516c {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".row-6e7a" 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.notice-1700 so it can't cause
   horizontal overflow anyway. */
.light-f3e4,
.center-150b,
.secondary_f44b,
.pagination-7fc2,
.over_da36,
.east_3486,
.hot_62ac,
.label_plasma_7e42,
.modal_d769,
.tag_27d0,
.prev_6109 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .notice_8f38 {
    padding: 8px 0;
  }
  
  .banner-in-adf8 img {
    height: 28px;
    width: auto;
  }
  
  .photo_right_a6f3 {
    display: none !important;
  }
  
  .avatar-ae2f {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .avatar-ae2f svg {
    width: 14px;
    height: 14px;
  }
  
  .hot-fe86 {
    padding: 6px;
  }
  
  .accent_iron_86ff {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .secondary_f44b,
  .center-150b,
  .pagination-7fc2,
  .over_da36,
  .green-cc3a,
  .element-abb4,
  .avatar_copper_4084,
  .breadcrumb-fe80,
  .warm_bea3,
  .heading-afd1,
  .panel-c5d8,
  .warm_3bd7 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .hidden-b775,
  .logo-huge-8f88 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .smooth-6024,
  .steel-26d6,
  .gas-4558,
  .article-c877,
  .shade_fast_436d,
  .tertiary-8eab,
  .warm-c8de {
    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 */
  .action-0255,
  .gradient_tiny_f23e,
  .large_415a,
  .main-9a6e,
  .picture-29cf {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .nav-e86f,
  .photo_pro_567d,
  .active_0dcb,
  .link_static_4c7f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .widget_a75b,
  .article_cool_eea2 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .old_11fb,
  .soft-643c,
  .summary_stale_507d,
  .menu_4578 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .card_focused_6f28,
  .overlay-tiny-f038,
  .purple-8696,
  .smooth-c79a,
  .border-d38d,
  .medium-0086 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .action-0255,
  .gradient_tiny_f23e,
  .main-9a6e {
    max-width: none !important;
  }
  
  .row-6e7a {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .nav-e86f {
    font-size: 1.5rem !important;
  }
  
  .photo_pro_567d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .notification-f024,
  .menu_1d61 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .active_0dcb {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .pattern_3cc0 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .wrapper-thick-e6f4 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .action-0255,
  .main-9a6e {
    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: 024c */
.phantom-card-j4 {
  padding: 0.1rem;
  font-size: 13px;
  line-height: 1.0;
}
