/* ============================================
   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 (.in_616e) is a descendant of
   .avatar_cdee (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-44d2 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".row_f16d" 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_lower_4882 so it can't cause
   horizontal overflow anyway. */
.tall_f10d,
.tiny_3b98,
.focus-943d,
.gradient-436d,
.media-plasma-93eb,
.west_4263,
.upper-0f5b,
.tertiary-bronze-6276,
.huge_b05d,
.column_ea16,
.summary-7651 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .caption_simple_61f2 {
    padding: 8px 0;
  }
  
  .pressed_86e6 img {
    height: 28px;
    width: auto;
  }
  
  .content-brown-93a1 {
    display: none !important;
  }
  
  .card_4e63 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .card_4e63 svg {
    width: 14px;
    height: 14px;
  }
  
  .photo-silver-c98f {
    padding: 6px;
  }
  
  .fresh-8a03 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .focus-943d,
  .tiny_3b98,
  .gradient-436d,
  .media-plasma-93eb,
  .focused-47b4,
  .section-gold-148f,
  .tertiary-1d3c,
  .yellow_62df,
  .rough-5b8d,
  .detail-hovered-064e,
  .avatar-86f5,
  .grid-upper-7203 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .article_a4c6,
  .breadcrumb-90e0 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .progress_orange_10b3,
  .brown_12be,
  .bronze_de7a,
  .label_active_57cd,
  .mask_left_2925,
  .detail_cd43,
  .detail_ca3a {
    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 */
  .table-1205,
  .fixed_6de9,
  .accordion_steel_767e,
  .grid_3823,
  .silver-b91e {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .fixed_398d,
  .panel-d54e,
  .progress-2006,
  .texture-large-1e2f {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .element_721e,
  .accent_wide_0e73 {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .logo_copper_73f0,
  .static-846a,
  .modal_mini_3188,
  .old-7fbc {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .fast_f813,
  .module_9fd5,
  .hard_3579,
  .badge_glass_4249,
  .mini-b80f,
  .yellow_9914 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .table-1205,
  .fixed_6de9,
  .grid_3823 {
    max-width: none !important;
  }
  
  .row_f16d {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .fixed_398d {
    font-size: 1.5rem !important;
  }
  
  .panel-d54e {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .alert_tall_62d2,
  .tertiary_steel_e0a1 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .progress-2006 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .thumbnail-75e3 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .section_f355 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .table-1205,
  .grid_3823 {
    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: 865b */
.shadow-element-m4 {
  padding: 0.5rem;
  font-size: 14px;
  line-height: 1.1;
}
