/* ============================================
   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 (.notice_54df) is a descendant of
   .small_fbdc (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.dirty-f436 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".thumbnail-90a9" 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.dark_6491 so it can't cause
   horizontal overflow anyway. */
.breadcrumb-2869,
.grid_e377,
.surface_2444,
.light_8f31,
.under_a699,
.module-south-12a2,
.light-6abb,
.background-full-1a4a,
.info_327e,
.purple_45ca,
.fresh-658e {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .row_3c35 {
    padding: 8px 0;
  }
  
  .logo-under-2bdb img {
    height: 28px;
    width: auto;
  }
  
  .notice_f93c {
    display: none !important;
  }
  
  .basic-3948 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .basic-3948 svg {
    width: 14px;
    height: 14px;
  }
  
  .main-1aaf {
    padding: 6px;
  }
  
  .background-2f3c {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .surface_2444,
  .grid_e377,
  .light_8f31,
  .under_a699,
  .top-fb38,
  .upper_e291,
  .list_last_f0ca,
  .sort_0ea5,
  .container-paper-99f8,
  .table-fcea,
  .thick-18f0,
  .fixed_6424 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .content-tall-0b9d,
  .module-3381 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .link-action-b792,
  .rough-3c82,
  .shade-warm-f239,
  .under-1155,
  .pattern-831a,
  .fixed_d1f0,
  .block_smooth_fa12 {
    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 */
  .shadow-thick-c81f,
  .chip-3d31,
  .link-short-f74e,
  .logo_06a8,
  .header-lite-f813 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .banner-df56,
  .lower_abd4,
  .gas_c86a,
  .east_93a9 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .basic-8663,
  .tooltip_fluid_8dbf {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .paper_ecb7,
  .picture_easy_5614,
  .cold_32c1,
  .block-4181 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .picture-glass-ceb9,
  .filter-1b65,
  .label_under_94bc,
  .dropdown-bright-6712,
  .rough_4179,
  .block-south-1699 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .shadow-thick-c81f,
  .chip-3d31,
  .logo_06a8 {
    max-width: none !important;
  }
  
  .thumbnail-90a9 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .banner-df56 {
    font-size: 1.5rem !important;
  }
  
  .lower_abd4 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .card-c1c6,
  .background-bottom-aa79 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .gas_c86a {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .active_2ba2 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .notice-ba81 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .shadow-thick-c81f,
  .logo_06a8 {
    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: 6429 */
.phantom-card-t7 {
  padding: 0.2rem;
  font-size: 10px;
  line-height: 1.3;
}
