#page-imports .product-search-select .cotiqa-select-menu{display:flex;flex-direction:column;gap:6px;z-index:160;min-width:0;max-height:400px;padding:10px;border:1px solid var(--line);border-radius:16px;background:#fff;box-shadow:0 12px 32px var(--ink-soft);overflow:hidden;box-sizing:border-box}
#page-imports .product-search-select .cotiqa-select-menu.hidden{display:none!important}
#page-imports .product-search-select .product-search-input{flex:0 0 auto;width:100%;min-width:0;min-height:44px;margin:0;padding:9px 12px;border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--ink);font:400 13px 'DM Sans',sans-serif;box-sizing:border-box}
#page-imports .product-search-select .product-search-input:focus{outline:2px solid var(--green-soft);border-color:var(--green)}
#page-imports .product-search-select .product-search-actions{display:flex;gap:4px;flex:0 0 auto;padding-bottom:6px;border-bottom:1px solid var(--line)}
#page-imports .product-search-select .product-search-results{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin}
#page-imports .product-search-select .cotiqa-select-menu button{display:block;width:100%;min-height:44px;padding:8px 10px;border:0;border-radius:10px;background:#fff;color:var(--ink);font:500 12px/1.4 'DM Sans',sans-serif;text-align:left;white-space:normal;overflow-wrap:anywhere}
#page-imports .product-search-select .cotiqa-select-menu button:is(:hover,:focus-visible,.selected){background:var(--green-soft);color:var(--green)}
#page-imports .product-search-select .cotiqa-select-menu button small{display:block;margin-top:3px;color:var(--muted);font-size:10px;font-weight:400;line-height:1.4}
#page-imports .product-search-select .product-search-summary{flex:0 0 auto;padding:0 4px;color:var(--muted);font:400 10px 'DM Sans',sans-serif}
#page-imports .product-search-select .product-search-create{flex:0 0 auto;padding-top:6px;border-top:1px solid var(--line)}
#page-imports .product-search-select .product-search-create button{color:var(--green);background:var(--green-soft)}
#page-imports .product-search-select .product-search-empty{margin:10px 4px;color:var(--muted);font:400 12px/1.5 'DM Sans',sans-serif}
@media(max-width:767px){#page-imports .product-search-select .product-search-input{font-size:16px}}
/* One fixed dialog surface, one scrolling result list. Geometry follows visualViewport via the shared modal manager. */
#modal.product-match-modal,#modal.product-match-modal[data-cotiqa-dialog]{width:min(680px,100%);height:min(740px,calc(var(--cotiqa-dialog-height,100dvh) - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px)));padding:0;border:1px solid var(--line);border-radius:20px;overflow:hidden;background:#fff;box-shadow:0 20px 60px rgba(20,42,33,.24);box-sizing:border-box}
#modal.product-match-modal .modal-close{top:10px;right:10px;width:32px;height:32px;min-height:32px;display:grid;place-items:center;border-radius:50%;background:var(--green-soft);font-size:20px;z-index:1}
#productMatchDialog{display:flex;flex-direction:column;height:100%;min-height:0;overflow:hidden;font-family:'DM Sans',sans-serif;color:var(--ink)}
#productMatchDialog header{flex:none;padding:12px 50px 9px 14px;border-bottom:1px solid var(--line)}
#productMatchDialog h2{font:600 19px/1.25 'DM Sans',sans-serif;margin:0;outline:none}
#productMatchDialog .product-match-line{font:400 12px/1.35 'DM Sans',sans-serif;color:var(--muted);margin:4px 0 0;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
#productMatchDialog .product-match-dialog-body{display:flex;flex:1 1 0;flex-direction:column;gap:6px;padding:9px 12px;min-height:0;overflow:hidden}
#productMatchDialog .product-search-input{box-sizing:border-box;width:100%;height:42px;min-height:42px;flex:none;margin:0;border:1px solid var(--line);border-radius:10px;background:#f3f8f5;padding:8px 10px;font:400 16px/1.3 'DM Sans',sans-serif;color:var(--ink)}
#productMatchDialog .product-search-actions{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px;flex:none}
#productMatchDialog .product-search-results{flex:1 1 0;min-height:0;max-height:none;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch;scrollbar-width:thin;scroll-padding-bottom:8px;padding-bottom:6px}
#productMatchDialog [data-select-value]{display:block;width:100%;min-height:42px;padding:7px 9px;border:1px solid transparent;border-radius:10px;background:#fff;text-align:left;font:500 13px/1.3 'DM Sans',sans-serif;color:var(--ink);white-space:normal;overflow-wrap:anywhere;box-sizing:border-box}
#productMatchDialog [data-select-value] small{display:block;font:400 11px/1.3 'DM Sans',sans-serif;color:var(--muted);margin-top:2px}
#productMatchDialog [data-select-value]:is(:hover,:focus-visible,.selected){background:var(--green-soft);border-color:var(--line)}
#productMatchDialog .product-search-actions [data-select-value]{min-height:36px;padding:6px 8px;font-size:12px;text-align:center;background:var(--green-soft)}
#productMatchDialog .product-search-summary{flex:none;font:400 11px/1.25 'DM Sans',sans-serif;color:var(--muted)}
#productMatchDialog .product-search-create{flex:none;border-top:1px solid var(--line);padding-top:6px}
#productMatchDialog .product-search-create button{min-height:36px;padding:6px 9px;background:var(--green-soft);color:var(--green);font-size:12px}
#productMatchDialog .product-search-empty{font-size:12px;color:var(--muted);padding:8px}
#productMatchDialog footer{flex:none;padding:7px 12px;display:flex;justify-content:flex-end;border-top:1px solid var(--line)}
#productMatchDialog footer button{min-height:36px;padding:6px 12px;font-size:12px}
#productMatchDialog.compact-viewport header{padding-top:7px;padding-bottom:6px}
#productMatchDialog.compact-viewport h2{font-size:16px}
#productMatchDialog.compact-viewport .product-match-line{-webkit-line-clamp:1;font-size:11px;margin-top:2px}
#productMatchDialog.compact-viewport .product-match-dialog-body{padding:6px 10px;gap:4px}
#productMatchDialog.compact-viewport .product-search-input{height:38px;min-height:38px}
#productMatchDialog.compact-viewport :is(.product-search-actions,.product-search-create) button,#productMatchDialog.compact-viewport footer button{min-height:30px;padding:4px 8px}
#productMatchDialog.compact-viewport footer{padding:4px 10px}
@media(max-width:767px){#productMatchDialog h2{font-size:18px}#productMatchDialog.compact-viewport h2{font-size:16px}#modal.product-match-modal{border-radius:16px}#productMatchDialog .product-match-line{font-size:11px}}
/* Carry the bounded height through the modal's intermediate content wrapper. */
#modal.product-match-modal{display:flex;flex-direction:column}
#modal.product-match-modal #modalContent{display:flex;flex-direction:column;flex:1 1 0;min-height:0;height:100%;width:100%;overflow:hidden}
#modal.product-match-modal #productMatchDialog{flex:1 1 0;min-height:0;width:100%;height:auto}
