/* Shared small-screen interaction layer. Desktop composition stays unchanged. */
/* Opt-in list batching keeps all source items in the HTML and desktop view. */
.mobile-list-more[hidden], .mobile-list-more button[hidden],
[data-mobile-batch] > [hidden] { display: none !important; }
.mobile-list-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 16px; margin-top: 20px; }
.mobile-list-more p { margin: 0; color: #475569; font-size: 13px; line-height: 1.5; }
.mobile-list-more button { min-height: 44px; font-size: 14px; }
@media (max-width: 700px) {
  .home-page .search-scope-note, .home-page .hero-disclosure,
  .catalog-meta .catalog-scope, .catalog-extra-panel p,
  .source-sheet-table .sheet-image-kind, .source-sheet-table .source-qc-status,
  .source-product .source-qc-status,
  .secondary-page .qc-single-example .qc-variant-name,
  .secondary-page .qc-single-example .source-caption,
  .secondary-page .qc-single-example .source-disclosure summary,
  .secondary-page .qc-single-example .source-disclosure p { font-size: 13px; }
}
@media (max-width: 1050px) {
  .nav { gap: 12px; }
  /* Do not inherit the 10px gap and implicit grid rows from generic buttons. */
  .mobile-menu-toggle {
    display: flex;
    flex: 0 0 44px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    gap: 5px;
    padding: 0;
    line-height: 1;
    touch-action: manipulation;
  }
  .mobile-menu-toggle span { flex: 0 0 2px; width: 22px; height: 2px; margin: 0; }
  .mobile-menu-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
  .main-nav {
    max-height: calc(100vh - 84px);
    max-height: calc(100dvh - 84px - env(safe-area-inset-bottom, 0px));
    overscroll-behavior-y: contain;
    scroll-padding-block: 8px;
  }
  .main-nav .dropdown-menu a { display: flex; align-items: center; min-height: 44px; font-size: 14px; line-height: 1.4; }
  .main-nav .nav-category-trigger { justify-content: flex-start; text-align: left; padding-right: 44px; }
  .main-nav .nav-category-trigger::before { right: 16px; }
  .nav-dropdown.is-open > .nav-category-trigger::before { transform: translateY(-35%) rotate(225deg); }
  .nav-dropdown.is-open .dropdown-menu { pointer-events: auto; }
  .main-nav a:focus-visible, .main-nav .nav-category-trigger:focus-visible { outline: 2px solid #ffb077; outline-offset: -3px; }

  .home-search-row input,
  .secondary-page .resource-search input,
  .secondary-page .search-box input,
  .catalog-field input,
  .catalog-field select,
  .uk-budget-fields input { font-size: 16px; }
}
@media (max-width: 680px) {
  :where(main) section[id], :where(main) article[id], :where(main) nav[id], :where(main) details[id] { scroll-margin-top: 84px; }
  .secondary-page .page-hero p { font-size: 15px; line-height: 1.65; }
  .secondary-page .page-hero .page-btn { min-height: 48px; padding: 10px 12px; font-size: 14px; line-height: 1.4; white-space: normal; }
  .catalog-field input, .catalog-field select { min-height: 48px; }
  .catalog-actions { gap: 12px; }
  .catalog-extra-filters { flex: 1 1 auto; }
  .catalog-extra-filters > summary {
    min-height: 44px;
    padding: 8px 12px;
    justify-content: space-between;
    border: 1px solid #bdcada;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    line-height: 1.4;
  }
  .catalog-controls .qc-reset { min-height: 44px; font-size: 14px; }
  .source-sheet-table .sheet-notes, .source-product .find-check { font-size: 14px; line-height: 1.65; }
  .source-product h3 { font-size: 16px; line-height: 1.45; }
  .source-product-details, .source-product > .source-alternative { font-size: 13px; }
  .faq-page .faq-nav a { font-size: 13px; }
  .chapter-button { font-size: 13px; line-height: 1.5; }
  .footer .footer-brand { min-height: 44px; }
  .footer .footer-grid > div:not(:first-child) > a { min-width: 44px; }

  /* Keep the dismiss action visible when a tall source photo is open. */
  .qc-image-dialog .dialog-top {
    position: sticky;
    top: -14px;
    z-index: 1;
    padding-block: 8px;
    background: #fff;
  }
  .qc-image-dialog .dialog-top h2 { min-width: 0; overflow-wrap: anywhere; font-size: 16px; }
  .qc-image-dialog [data-close-dialog] { flex: 0 0 auto; min-width: 60px; min-height: 44px; }
}
@media (max-width: 380px) {
  .secondary-page .page-hero .page-actions:not(.hero-text-actions) { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .mobile-menu-toggle span { transition: none; }
}
