.mp-picker {
  --mp-ink: #263b32;
  --mp-green: #225b48;
  --mp-border: #d7ded9;
  --mp-muted: #617069;
  color: var(--mp-ink);
  min-width: 0;
  width: 100%;
}
.mp-picker *, .mp-picker *::before, .mp-picker *::after { box-sizing: border-box; letter-spacing: 0; }
.mp-picker [hidden] { display: none !important; }
.memora-custom-product[hidden] { display: none !important; }
.memora-custom-layout:has(> .memora-custom-product[hidden]) { grid-template-columns: minmax(0, 1fr); }
.mp-picker .mp-current { display: flex; align-items: center; gap: 16px; }
.mp-current > img { width: 88px; height: 88px; object-fit: contain; background: #f5f7f6; flex: 0 0 88px; }
.mp-current-description { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.mp-current-description strong { font-size: 16px; line-height: 1.4; font-weight: 650; overflow-wrap: anywhere; }
.mp-current-description span, .mp-current-description small { color: var(--mp-muted); font-size: 12px; overflow-wrap: anywhere; }
.mp-current-actions, .mp-browser-actions { display: flex; align-items: center; gap: 8px; }
.mp-current-actions { flex-wrap: wrap; }
.mp-picker[aria-busy="true"] .mp-current-actions { opacity: .5; }
.mp-icon, .mp-command { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; background: #fff; color: var(--mp-green); border: 1px solid var(--mp-border); border-radius: 4px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.mp-icon { width: 44px; height: 44px; padding: 0; flex: 0 0 44px; font-size: 17px; }
.mp-command { padding: 9px 14px; font-weight: 600; }
.mp-icon:hover, .mp-command:hover { background: #edf4ef; border-color: #739780; }
.mp-icon:disabled { opacity: .4; cursor: default; }
.mp-picker button:focus-visible, .mp-picker input:focus-visible, .mp-picker select:focus-visible { outline: 2px solid #217eae; outline-offset: 2px; }
.mp-browser { padding-top: 20px; min-width: 0; }
.mp-browser-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.mp-browser-heading h3 { margin: 0; font-size: 18px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.mp-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 16px 0; border-top: 1px solid var(--mp-border); border-bottom: 1px solid var(--mp-border); }
.mp-filters > label { display: flex; flex-direction: column; gap: 6px; flex: 1 1 165px; min-width: 0; font-size: 12px; }
.mp-filters > .mp-search { flex: 2 1 260px; }
.mp-picker input, .mp-picker select { min-width: 0; min-height: 44px; border: 1px solid #c9d3cd; border-radius: 4px; background-color: #fff; color: var(--mp-ink); font-size: 13px; padding: 9px 10px; line-height: 1.4; }
.mp-picker select { max-width: 100%; padding-right: 24px; }
.mp-search > div { position: relative; }
.mp-search i { position: absolute; left: 12px; top: 12px; color: var(--mp-muted); pointer-events: none; }
.mp-search input { width: 100%; padding-left: 36px; }
.mp-results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; min-height: 68px; font-size: 12px; color: var(--mp-muted); }
.mp-results-toolbar > div { display: flex; align-items: center; gap: 8px; }
.mp-results-toolbar label { min-width: 0; }
.mp-results { min-height: 230px; }
.mp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; gap: 16px; }
.mp-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 0; text-align: left; background: #fff; border: 1px solid var(--mp-border); border-radius: 4px; overflow: hidden; cursor: pointer; color: var(--mp-ink); }
.mp-card:hover { border-color: #658b75; }
.mp-card[aria-pressed="true"] { border-color: var(--mp-green); box-shadow: inset 0 0 0 1px var(--mp-green); }
.mp-card > img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; padding: 10px; background: #f5f7f6; }
.mp-card-body { display: flex; flex-direction: column; gap: 5px; padding: 12px; min-height: 128px; flex: 1; }
.mp-card-type { color: #507866; font-size: 11px; }
.mp-card strong { display: block; font-size: 14px; line-height: 1.45; font-weight: 650; overflow-wrap: anywhere; }
.mp-card-code, .mp-card-material { color: var(--mp-muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.mp-card-code { margin-top: auto; padding-top: 4px; }
.mp-card-selected { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--mp-green); color: #fff; font-size: 16px; }
.mp-message { display: flex; min-height: 230px; align-items: center; justify-content: center; flex-wrap: wrap; align-content: center; gap: 10px; text-align: center; color: var(--mp-muted); font-size: 14px; }
.mp-message p { flex-basis: 100%; margin: 0; padding: 0 16px; }
.mp-pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--mp-border); font-size: 12px; color: var(--mp-muted); }
.mp-pagination > div, .mp-pagination label { display: flex; align-items: center; gap: 8px; margin: 0; }
.mp-pagination input { width: 64px; padding: 8px 4px 8px 8px; }
.mp-pagination select { width: 70px; }
.mp-dialog { position: fixed; inset: 0; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; border: 0; padding: 0; background: #fff; color: var(--mp-ink); }
.mp-dialog::backdrop { background: #152b2480; }
.mp-dialog .mp-browser { display: flex; flex-direction: column; width: 100%; max-width: 1680px; height: 100%; margin: 0 auto; padding: 24px 32px; }
.mp-dialog .mp-browser-heading, .mp-dialog .mp-filters, .mp-dialog .mp-results-toolbar, .mp-dialog .mp-pagination { flex-shrink: 0; }
.mp-dialog .mp-results { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 4px 8px 2px; scrollbar-gutter: stable; }
.mp-dialog .mp-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.mp-dialog .mp-pagination { padding-bottom: env(safe-area-inset-bottom); }
.mp-dialog-open { overflow: hidden !important; }
@media (min-width: 1450px) { .mp-dialog .mp-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  .mp-grid, .mp-dialog .mp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .mp-current { flex-wrap: wrap; }
  .mp-current-actions { margin-left: auto; }
  .mp-dialog .mp-browser { padding: 20px; }
}
@media (max-width: 600px) {
  .mp-picker .mp-current { gap: 12px; }
  .mp-current > img { width: 72px; height: 72px; flex-basis: 72px; }
  .mp-current-description { flex-basis: calc(100% - 84px); }
  .mp-current-description strong { font-size: 14px; }
  .mp-current-actions { width: 100%; margin-top: 2px; }
  .mp-current-actions .mp-command { flex: 1; }
  .mp-grid, .mp-dialog .mp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mp-filters { gap: 8px; padding: 12px 0; }
  .mp-filters > label { flex: 1 1 calc(50% - 8px); }
  .mp-filters > .mp-search { flex-basis: 100%; }
  .mp-browser-heading h3 { font-size: 16px; }
  .mp-browser-heading { margin-bottom: 8px; }
  .mp-card-body { padding: 9px; min-height: 145px; }
  .mp-card strong { font-size: 13px; }
  .mp-results-toolbar { gap: 8px; }
  .mp-results-toolbar select { width: 145px; }
  .mp-results-toolbar > span { min-width: 0; line-height: 1.5; }
  .mp-pagination { gap: 8px; }
  .mp-pagination > div { gap: 4px; margin-left: auto; }
  .mp-pagination input { width: 50px; }
  .mp-page-number { gap: 4px !important; }
  .mp-dialog .mp-browser { padding: max(12px, env(safe-area-inset-top)) 12px 12px; }
}
@media (max-height: 550px) and (min-width: 601px) {
  .mp-dialog .mp-browser { padding: 8px 20px; }
  .mp-dialog .mp-browser-heading { margin-bottom: 4px; }
  .mp-dialog .mp-filters { padding: 6px 0; }
  .mp-dialog .mp-results-toolbar { padding: 4px 0; min-height: 48px; }
  .mp-dialog .mp-pagination { padding-top: 6px; margin-top: 6px; }
}
