/* ============================================
   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 (.top-f648) is a descendant of
   .alert_1e23 (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.tertiary_tall_0bb8 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".plasma-bb76" 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.shadow-focused-2c6e so it can't cause
   horizontal overflow anyway. */
.module-350a,
.aside-dim-12a0,
.table-dce9,
.description-7f89,
.module-6a50,
.yellow_a1ef,
.description-pink-e062,
.border_7be0,
.action-5ee0,
.hovered-e276,
.center_2c51 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .filter-complex-3867 {
    padding: 8px 0;
  }
  
  .tiny_6b0d img {
    height: 28px;
    width: auto;
  }
  
  .cold-dbe5 {
    display: none !important;
  }
  
  .light-1571 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .light-1571 svg {
    width: 14px;
    height: 14px;
  }
  
  .simple-6b6c {
    padding: 6px;
  }
  
  .block-5f26 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .table-dce9,
  .aside-dim-12a0,
  .description-7f89,
  .module-6a50,
  .image-silver-7d4e,
  .primary-96b3,
  .tooltip_outer_0b06,
  .status_1386,
  .disabled_6b5a,
  .footer_white_bd4e,
  .video-bd4d,
  .card-505f {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .preview_abde,
  .out-2255 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .button_9bc7,
  .avatar_6882,
  .action_8447,
  .tag_pro_1852,
  .backdrop-7e19,
  .pagination-current-aa90,
  .popup_2c41 {
    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 */
  .footer_6c5c,
  .sidebar-89b9,
  .white_1299,
  .grid-57e1,
  .dropdown-dba5 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .banner-d1f7,
  .form-6c7d,
  .stone_c5fb,
  .heading_focused_78c4 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .texture_9b75,
  .backdrop_smooth_6104 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .advanced-a444,
  .tooltip_04be,
  .advanced_54c6,
  .cool-18c3 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .container_focused_f76f,
  .notice_c5e4,
  .backdrop-ce9d,
  .border-inner-144b,
  .breadcrumb-7b90,
  .active-d4c3 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .footer_6c5c,
  .sidebar-89b9,
  .grid-57e1 {
    max-width: none !important;
  }
  
  .plasma-bb76 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .banner-d1f7 {
    font-size: 1.5rem !important;
  }
  
  .form-6c7d {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .message-598e,
  .footer_1005 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .stone_c5fb {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .link_2e17 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .surface-stone-03cb {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .footer_6c5c,
  .grid-57e1 {
    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: 7a41 */
.shadow-element-h5 {
  padding: 0.4rem;
  font-size: 11px;
  line-height: 1.3;
}
