/* Shared small-screen refinements. Desktop art direction stays in each page. */
@media (max-width: 900px) {
  :root {
    --llt-safe-top: env(safe-area-inset-top, 0px);
    --llt-safe-bottom: env(safe-area-inset-bottom, 0px);
    --llt-nav-height: calc(64px + var(--llt-safe-top));
  }
  html { width: 100%; max-width: 100%; overflow-x: clip; scroll-padding-top: calc(var(--llt-nav-height) + 16px); }
  body { width: 100%; min-width: 0; padding-top: var(--llt-safe-top); }
  main, section, .wrap, .pv-wrap, .v11-wrap, .v12-wrap, .finder-page, .workspace { min-width: 0; }
  main :where(div, article, figure) { min-width: 0; }
  .global-nav { height: var(--llt-nav-height); padding-top: var(--llt-safe-top); }
  .nav-inner { padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); gap: 12px; }
  .nav-utility { min-width: 0; gap: 10px; }
  .mobile-toggle, .menu-toggle { min-width: 44px; min-height: 44px; flex: 0 0 44px; }
  .mobile-menu { inset: var(--llt-nav-height) 0 0; padding-bottom: calc(24px + var(--llt-safe-bottom)); overscroll-behavior: contain; }
  .mobile-menu a { min-height: 44px; }
  .pv-subnav, .product-local-nav, .product-subnav { top: var(--llt-nav-height); }
  .product-subnav-links { min-width: 0; gap: 8px; }
  .product-subnav-links .pill { min-width: 0; white-space: normal; line-height: 1.3; text-align: center; flex-shrink: 1; }
  .pv-subnav .pv-wrap, .product-local-nav { min-width: 0; }
  .pv-subnav .pv-wrap > div { min-width: 0; gap: 8px !important; }
  .pv-subnav .pill { min-width: 0; white-space: normal; line-height: 1.3; text-align: center; flex-shrink: 1; }
  .pv-subnav strong { flex-shrink: 1; min-width: 0; overflow-wrap: anywhere; }
  .actions { flex-wrap: wrap; gap: 12px 16px; }
  .finder-series { min-width: 0; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
  .finder-series > * { flex-shrink: 0; }
  .finder-more-series select { max-width: 170px; }
  .finder-more-series { position: relative; }
  .selector-callout .text-link { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .application-entry { min-width: 0; flex-wrap: wrap; }
  .application-entry .text-link { min-width: 0; max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .config-table { table-layout: fixed; }
  .config-table th, .config-table td, .catalog-property-grid dd { overflow-wrap: anywhere; }
  .llt-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
  .llt-table-scroll:focus-visible { outline: 2px solid #0071e3; outline-offset: 3px; }
  .scenario-picker {
    left: max(16px, env(safe-area-inset-left)); right: auto;
    bottom: max(18px, var(--llt-safe-bottom));
    width: min(228px, calc(100vw - 164px - env(safe-area-inset-right)));
  }
  .scenario-options { max-height: calc(var(--llt-viewport-height, 100dvh) - var(--llt-nav-height) - 150px); overflow-y: auto; overscroll-behavior: contain; }
  .compare-tray { bottom: max(12px, var(--llt-safe-bottom)); width: calc(100% - 24px); max-width: 900px; min-width: 0; }
  .compare-tray .tray-items { min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; }
  html.llt-compare-open body { padding-bottom: calc(var(--llt-dock-height, 0px) + 24px + var(--llt-safe-bottom)); }
  html.llt-chat-open .scenario-picker, html.llt-chat-open .compare-tray { visibility: hidden; pointer-events: none; }
  .site-footer, .v11-footer { padding-bottom: max(28px, var(--llt-safe-bottom)); }
  .site-footer a, .v11-footer a { overflow-wrap: anywhere; }
  .v12-dialog, #product-dialog, #mobile-navigation {
    max-width: calc(100vw - 20px);
    max-height: calc(var(--llt-viewport-height, 100dvh) - max(12px, var(--llt-safe-top)) - max(12px, var(--llt-safe-bottom)));
    overscroll-behavior: contain;
  }
  .v12-dialog-head, .v12-dialog-tools { min-width: 0; }
  .v12-dialog-head h3 { overflow-wrap: anywhere; }
  .v12-dialog-close { flex: 0 0 44px; width: 44px; height: 44px; }
}

@media (max-width: 600px) {
  :root { --gutter: max(20px, env(safe-area-inset-left), env(safe-area-inset-right)); }
  .nav-utility .pill { min-height: 40px; padding: 10px 14px; }
  .scene-copy { padding-inline: 20px; }
  .scene-copy h1, .scene-copy h2 { font-size: clamp(36px, 10.3vw, 43px); overflow-wrap: break-word; }
  .scene-copy .scene-description { max-width: 100%; }
  .scene-mobile-actions { left: 20px; right: 20px; flex-wrap: wrap; gap: 10px; }
  .scene-mobile-actions a { min-height: 44px; white-space: normal; }
  .scene-caption { left: 20px; right: 20px; max-width: calc(100% - 40px); }
  .finder-search, .finder-search input, .finder-result-heading, .guide-pair > *, .field-pair > * { min-width: 0; }
  .finder-page .workspace h1, .finder-header h1 { font-size: clamp(30px, 9vw, 38px); overflow-wrap: break-word; }
  .finder-result-list, .pv-application-grid, .pv-next-grid { grid-template-columns: minmax(0, 1fr); }
  .pv-mount-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pv-config-filter { flex-wrap: wrap; }
  .pv-config-filter label { min-width: 0; flex-basis: calc(50% - 8px); }
  .v12-filterbar label { min-width: 0; flex-basis: calc(50% - 8px); }
  .v12-dialog-tools label { flex-wrap: wrap; }
  .v12-dialog-tools p { min-width: 0; }
  .pv-section, .v11-section, .v12-section { scroll-margin-top: calc(var(--llt-nav-height) + 64px); }
  .pv-key-facts strong { font-size: clamp(18px, 5vw, 26px); overflow-wrap: anywhere; line-height: 1.25; }
  .v12-protection-tabs { max-width: calc(100% - 32px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v12-protection-tabs button { min-width: 0; white-space: normal; line-height: 1.3; }
  .compare-tray { gap: 8px; padding: 10px; }
  .compare-tray .tray-label { display: none; }
  .compare-tray .pill { min-height: 44px; flex-shrink: 0; }
}

@media (pointer: coarse) and (max-width: 900px) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]), textarea, select { font-size: 16px; }
  :where(.pv-tabs button, .v11-segments button, .v11-install-tabs button, .v12-protection-tabs button, .finder-choice, .finder-search button, .guide-next, .guide-back) { min-height: 44px; }
  .global-nav { backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
