/* ============================================
   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 (.highlight_2b9c) is a descendant of
   .icon_advanced_611f (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.menu-tiny-a1e7 {
  max-width: none !important;
}

/* Fix for any potential overflow elements */
/* NOTE: ".left-b400" 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.paragraph_6ea5 so it can't cause
   horizontal overflow anyway. */
.highlight_short_223c,
.element-tall-becc,
.element_copper_fb10,
.short_e96e,
.summary_next_8c7c,
.brown_827a,
.bright-866b,
.table_8bc4,
.box-narrow-bc7f,
.footer-8d92,
.last_cb54 {
  max-width: 100%;
  overflow-x: hidden;
}

/* Header mobile optimizations */
@media (max-width: 768px) {
  .down-1c07 {
    padding: 8px 0;
  }
  
  .column_rough_1262 img {
    height: 28px;
    width: auto;
  }
  
  .texture_0906 {
    display: none !important;
  }
  
  .first_67fc {
    padding: 6px 12px !important;
    font-size: 0.8125rem !important;
    white-space: nowrap;
  }
  
  .first_67fc svg {
    width: 14px;
    height: 14px;
  }
  
  .aside_af19 {
    padding: 6px;
  }
  
  .wide_efe2 {
    width: 20px;
  }
}

/* Mobile-specific fixes (phones) */
@media (max-width: 768px) {
  /* Force single column layout */
  .element_copper_fb10,
  .element-tall-becc,
  .short_e96e,
  .summary_next_8c7c,
  .old-4379,
  .notice-2b79,
  .filter-2c99,
  .sort_left_5c8c,
  .easy_6506,
  .accent-d1bc,
  .complex-2ae5 {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
  }
  
  /* Ensure tables are scrollable */
  .content-old-2f42,
  .short-dcbe {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Fix any fixed-width elements */
  .focused-9c7b,
  .down-f6d9,
  .container-f692,
  .clean-d52d,
  .black_5b23,
  .box_c686,
  .sort-3892 {
    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 */
  .popup_852f,
  .shade-7ae7,
  .chip-white-432f,
  .paragraph_3389,
  .wrapper-bottom-8e7d {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Fix text overflow */
  h1, h2, h3, h4, h5, h6,
  p, span, a, li, td, th,
  .content-0fce,
  .complex_fef9,
  .footer-3eb6,
  .over_cae1 {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    hyphens: auto !important;
  }
  
  /* Fix code blocks */
  pre,
  code,
  .background_a19b,
  .active_2f3b {
    overflow-x: auto !important;
    max-width: 100% !important;
    word-wrap: break-word !important;
  }
  
  /* Fix buttons */
  .gas-b569,
  .copper_5ef5,
  .preview-059b,
  .block-7fc8 {
    width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Fix flex containers */
  .medium-6c90,
  .paper_fa33,
  .motion_f4e8,
  .stone-6ebe,
  .title_north_5d21,
  .main_f628 {
    flex-wrap: wrap !important;
    width: 100% !important;
  }
}

/* Extra small screens (≤480px) */
@media (max-width: 480px) {
  /* Even more aggressive fixes */
  * {
    max-width: 100vw !important;
  }
  
  section,
  .popup_852f,
  .shade-7ae7,
  .paragraph_3389 {
    max-width: none !important;
  }
  
  .left-b400 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  
  /* Reduce font sizes if needed */
  .content-0fce {
    font-size: 1.5rem !important;
  }
  
  .complex_fef9 {
    font-size: 1.375rem !important;
  }
  
  /* Stack everything */
  .white_7e7d,
  .wrapper_78a0 {
    flex-direction: column !important;
  }
  
  /* Smaller stat values */
  .footer-3eb6 {
    font-size: 2rem !important;
  }
  
  /* Ensure score circles fit */
  .frame-paper-14ca {
    width: 100px !important;
    height: 100px !important;
    font-size: 2.5rem !important;
  }
  
  .frame_883b {
    width: 140px !important;
    height: 140px !important;
  }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
  .popup_852f,
  .paragraph_3389 {
    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: 939d */
.phantom-card-u2 {
  padding: 0.1rem;
  font-size: 14px;
  line-height: 1.0;
}
