/* ============================================
   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 (.filter_a62f) is a descendant of
   .media_stone_adb0 (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.card_9ce0 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".surface-first-64c3" 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.advanced-d62e so it can't cause
   horizontal overflow anyway. */
.blue-9da4,
.clean-2a96,
.panel_easy_0745,
.detail_9157,
.copper_38dd,
.shade_2937,
.icon_tiny_8975,
.current_804d,
.focus-red-3477,
.fresh_9553,
.section_e842 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .tertiary-fast-df55 {
    padding: 8px 0;
  }
  
  .rough_228a img {
    height: 28px;
    width: auto;
  }
  
  .inner_6a10 {
    display: none !important;
  }
  
  .advanced_c1f4 {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .advanced_c1f4 svg {
    width: 14px;
    height: 14px;
  }
  
  .soft_2ee2 {
    padding: 6px;
  }
  
  .yellow_4ec9 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .panel_easy_0745,
  .clean-2a96,
  .detail_9157,
  .copper_38dd,
  .iron_9afe,
  .hidden-e16e,
  .action-e967,
  .active-dc32,
  .hidden_fresh_4a3b,
  .fast_7530,
  .image-hard-3cba,
  .table_smooth_67f6 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .row-5ed0,
  .list-f405 {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .column-fast-174f,
  .sidebar_4953,
  .sort_narrow_4956,
  .icon_e5d2,
  .text-motion-056c,
  .badge_def7,
  .preview-b1f3 {
    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 */
  .description_2872,
  .pagination-active-a77a,
  .menu-first-a220,
  .caption_e498,
  .paragraph_99b1 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .item_6acf,
  .notification-brown-0953,
  .aside_9bbe,
  .popup_inner_4bbd {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .icon_paper_8503,
  .header-iron-47fa {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .status-basic-4a55,
  .list-bca6,
  .surface-paper-0c53,
  .fresh_098a {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .first-796c,
  .description_hovered_2b3e,
  .progress_8b7f,
  .title-first-2246,
  .gradient_purple_0464,
  .wrapper_7860 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .description_2872,
  .pagination-active-a77a,
  .caption_e498 {
    max-width: none !important;
  }
  
  .surface-first-64c3 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .item_6acf {
    font-size: 1.5rem !important;
  }
  
  .notification-brown-0953 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .shade_b233,
  .menu-upper-3476 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .aside_9bbe {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .widget-center-1297 {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .advanced_7ff7 {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .description_2872,
  .caption_e498 {
    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: 536e */
.phantom-card-i6 {
  padding: 0.1rem;
  font-size: 10px;
  line-height: 1.2;
}
