/* ============================================
   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 (.outer_c7e2) is a descendant of
   .dynamic-cdaf (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.wrapper_hard_a521 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".detail-826f" 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.label_first_c15a so it can't cause
   horizontal overflow anyway. */
.main-fresh-a1a9,
.hard_c858,
.caption-bottom-1230,
.thick-8a1e,
.caption-large-3610,
.fresh_4ba2,
.hard_0f96,
.right_32d1,
.brown-f8d7,
.pressed-65b4,
.notification_copper_2273 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .component-full-37a2 {
    padding: 8px 0;
  }
  
  .clean-7504 img {
    height: 28px;
    width: auto;
  }
  
  .tabs_easy_c5e1 {
    display: none !important;
  }
  
  .content-4909 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .content-4909 svg {
    width: 14px;
    height: 14px;
  }
  
  .simple-d5a9 {
    padding: 6px;
  }
  
  .content_large_2469 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .caption-bottom-1230,
  .hard_c858,
  .thick-8a1e,
  .caption-large-3610,
  .breadcrumb_cool_4c3e,
  .tabs-0d6d,
  .dim_1818,
  .medium_39fd,
  .primary-a1fd,
  .selected-11ac,
  .tabs_fresh_f7ed,
  .gold_f52e {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .new_6790,
  .status_2750 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .highlight_north_5081,
  .link-4d85,
  .video_cf34,
  .medium_da0a,
  .new-d994,
  .form-16dd,
  .box-current-f415 {
    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 */
  .shade-1976,
  .gold_ae45,
  .highlight-ff26,
  .banner-8d7a,
  .menu_left_c2bd {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .status-old-47ce,
  .accordion-784a,
  .sidebar-fast-924f,
  .search-last-a836 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .mini_51c8,
  .tertiary_6322 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .gradient_hard_c64a,
  .accordion-active-c873,
  .list_red_ceac,
  .picture-over-1415 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .input_upper_22c4,
  .sort_3422,
  .mask_f5a9,
  .table-b36d,
  .plasma_58fb,
  .background-a1db {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .shade-1976,
  .gold_ae45,
  .banner-8d7a {
    max-width: none !important;
  }
  
  .detail-826f {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .status-old-47ce {
    font-size: 1.5rem !important;
  }
  
  .accordion-784a {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .frame-9402,
  .list_large_f5b5 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .sidebar-fast-924f {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .column-8dc4 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .panel_7f63 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .shade-1976,
  .banner-8d7a {
    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: a150 */
.widget-item-r3 {
  padding: 0.1rem;
  font-size: 12px;
  line-height: 1.3;
}
