.bp-dialog {
  width: min(620px, calc(100% - 24px));
  max-width: calc(100% - 24px);
  max-height: min(760px, calc(100vh - 24px));
  max-height: min(760px, calc(100dvh - 24px));
  padding: 18px;
  border: 1px solid #596b50;
  border-radius: 12px;
  background: var(--panel, #192220);
  color: var(--paper, #f0f1e9);
  box-shadow: 0 18px 70px #0009;
  overflow: hidden;
}
.bp-dialog[open] { display:flex; flex-direction:column; gap:12px; }
.bp-dialog::backdrop { background:#07100dd9; }
.bp-header,.bp-filters,.bp-footer { display:flex; align-items:center; gap:12px; flex:none; }
.bp-header { justify-content:space-between; }
.bp-title { margin:0; line-height:1.33; font-size:1.1rem; }
.bp-title:focus { outline:none; }
.bp-close,.bp-clear {
  min-height:44px; background:#233026; color:var(--paper); border:1px solid #435340; border-radius:6px;
}
.bp-close { flex:none; display:grid; place-items:center; width:44px; font-size:1.5rem; line-height:1; }
.bp-clear { padding:7px 13px; font-size:.875rem; }
.bp-close:hover,.bp-clear:hover { border-color:#a0b77d; background:#2e3d2d; }
.bp-search {
  flex:1; width:0; min-width:0; min-height:44px; padding:8px 12px;
  font:inherit; font-size:1rem; color:var(--paper); background:var(--inset);
  border:1px solid #4c5e48; border-radius:6px;
}
.bp-count { min-width:3ch; font-size:.85rem; color:var(--dim); font-variant-numeric:tabular-nums; }
.bp-grid {
  display:grid; grid-template-columns:repeat(auto-fill,minmax(58px,1fr));
  min-height:0; gap:6px; overflow:auto; overscroll-behavior:contain;
  scrollbar-width:thin; scrollbar-color:#60755a #1b2722; padding:3px;
}
.bp-choice {
  position:relative; display:grid; place-items:center; min-width:0; min-height:54px; padding:2px;
  appearance:none; border:1px solid #40503f; border-radius:6px; background:linear-gradient(150deg,#344635,#1b2721);
  color:var(--paper); touch-action:manipulation;
}
.bp-choice:hover:not(:disabled),.bp-choice[aria-pressed="true"] { border-color:var(--accent); background:#3e5037; }
.bp-choice:focus-visible { outline-offset:0; }
.bp-choice:disabled { opacity:.42; }
.bp-portrait { display:block; width:100%; height:56px; object-fit:contain; }
.bp-current {
  position:absolute; right:1px; bottom:1px; display:grid; place-items:center; width:19px; height:19px;
  border-radius:50%; color:#23301d; background:var(--accent); font-size:.78rem; font-weight:700;
}
.bp-fallback { display:block; overflow-wrap:anywhere; font-size:.75rem; }
.bp-empty { grid-column:1/-1; margin:8px 0; color:var(--dim); }
.bp-footer { padding-top:2px; justify-content:flex-start; }
@media(max-width:500px){
  .bp-dialog{padding:12px}.bp-dialog[open]{gap:9px}.bp-grid{grid-template-columns:repeat(auto-fill,minmax(47px,1fr));gap:5px}
  .bp-portrait{height:47px}.bp-choice{min-height:52px}
}
@media(orientation:landscape) and (max-height:540px){
  .bp-dialog{padding:8px 12px;max-height:calc(100dvh - 12px)}.bp-dialog[open]{gap:5px}
  .bp-grid{grid-template-columns:repeat(auto-fill,minmax(48px,1fr));gap:4px}
  .bp-portrait{height:46px}.bp-choice{min-height:50px}.bp-title{font-size:1rem}
}
