/* Shared browsing behaviour only. Each material keeps its own sample size and grid. */
body [data-palette-scroll="true"]{
 height:var(--palette-window)!important;
 max-height:var(--palette-window)!important;
 min-height:0!important;
 box-sizing:border-box;
 overflow-y:auto!important;
 overflow-x:hidden;
 align-content:start;
 scrollbar-width:thin;
 scrollbar-color:#999 transparent;
 scrollbar-gutter:stable;
 overscroll-behavior-y:contain;
 padding:6px 10px 6px 6px;
 -webkit-overflow-scrolling:touch;
}
body [data-palette-scroll="true"]:focus-visible{outline:1px solid #555;outline-offset:3px}
body [data-palette-scroll="true"]::-webkit-scrollbar{width:5px}
body [data-palette-scroll="true"]::-webkit-scrollbar-thumb{background:#999;border-radius:3px}

.kmew-reference-choices>.gallery-track.palette-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:16px 12px}
.kmew-reference-choices>.gallery-track.palette-grid>button{width:100%;height:auto;min-width:0;flex:none}
@media(max-width:760px){.kmew-reference-choices>.gallery-track.palette-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* A short palette must never inherit an old viewport limit that clips its second row. */
body [data-palette-short="true"]{height:auto!important;max-height:none!important;overflow:visible!important}
