/* Keep shared custom pickers in document flow on narrow and touch layouts.
   Embedded tools resize with their body; absolute/fixed menus cannot do that. */
@media (max-width: 1023px), (hover: none) and (pointer: coarse) {
  html body .cerakote-picker[open] {
    position: relative !important;
    min-width: 0;
    max-width: 100%;
    overflow: visible !important;
  }
  html body .cerakote-picker[open] > .picker-panel,
  html[data-tool-mode] body .cerakote-picker[open] > .picker-panel {
    position: relative !important;
    inset: auto !important;
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px;
    overflow: visible !important;
    border-radius: 0 0 8px 8px;
    box-shadow: none;
  }
  html body .cerakote-picker[open] > .picker-panel .picker-results,
  html[data-tool-mode] body .cerakote-picker[open] > .picker-panel .picker-results {
    flex: 0 1 auto !important;
    min-height: 0;
    max-height: 340px !important;
    overflow-y: auto !important;
    overflow-x: hidden;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
  html body .cerakote-picker .picker-panel input[type="search"] {
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    font-size: 16px !important;
    flex: none;
    scroll-margin-block: 16px;
  }
  html body .cerakote-picker .picker-panel .picker-count { flex: none; }
  html body .cerakote-picker .picker-panel .picker-option { min-height: 54px; }
  html body .cerakote-picker .picker-panel .picker-option-text { min-width: 0; overflow-wrap: anywhere; }
  html body .cerakote-picker > summary { min-width: 0; min-height: 48px; }
  html body .cerakote-picker .picker-panel :focus-visible { outline-offset: -2px; }
}
