/* Shared admin smart lookup. `readonly` means searchable/selectable, but the option dictionary is closed. */
/* The component uses the HTML hidden attribute while filtering.  Author-level
   display rules (for example .contractor-smart-option{display:flex}) can otherwise
   override the browser default and make a search look like it does nothing. */
.contractor-smart-select [hidden]{display:none!important}
.contractor-smart-select{position:relative;min-width:0}.contractor-smart-control{position:relative;display:flex;min-width:0}.contractor-smart-control .product-catalog__input,.contractor-smart-control .input,.contractor-smart-control input{width:100%;padding-right:48px}.contractor-smart-toggle,.contractor-smart-edit-selected{position:absolute;top:2px;bottom:2px;width:40px;border:0;background:transparent;line-height:1;cursor:pointer}.contractor-smart-toggle{right:3px;border-left:1px solid #dbe5ea;border-radius:0 8px 8px 0;color:#334155;font-size:18px}.contractor-smart-edit-selected{right:43px;border-left:1px solid #e2e8f0;color:#64748b;font-size:15px}.contractor-smart-toggle:hover,.contractor-smart-edit-selected:not(:disabled):hover,.contractor-smart-edit-selected:not(:disabled):focus-visible{background:#f1f5f9}.contractor-smart-edit-selected:disabled{cursor:not-allowed;opacity:.28}.contractor-smart-edit-selected:focus-visible,.contractor-smart-toggle:focus-visible{outline:2px solid #0891b2;outline-offset:-2px}.contractor-smart-menu{position:absolute;z-index:80;left:0;right:0;top:calc(100% + 5px);max-height:230px;overflow:auto;border:1px solid #cbd5e1;border-radius:12px;background:#fff;padding:5px;box-shadow:0 14px 35px rgba(15,23,42,.18)}.contractor-smart-option{display:flex;width:100%;align-items:center;border-radius:8px;background:transparent;color:#0f172a;font-size:13px}.contractor-smart-option:hover,.contractor-smart-option.is-active{background:#ecfeff;color:#0e7490}.contractor-smart-option-select{min-width:0;width:100%;border:0;background:transparent;padding:10px;text-align:left;color:inherit;font:inherit;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-height:42px}.contractor-smart-editor{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;align-items:center;margin-top:6px;padding:8px;border:1px solid #cbd5e1;border-radius:10px;background:#f8fafc}.contractor-smart-editor__input{min-width:0;width:100%;min-height:36px;padding:7px 9px;border:1px solid #cbd5e1;border-radius:8px;background:#fff;color:#0f172a}.contractor-smart-editor__actions{display:flex;justify-content:flex-end;gap:4px}.contractor-smart-editor__actions button{min-height:29px;padding:4px 8px;border:1px solid var(--admin-shell-border,#dbe3ea);border-radius:7px;background:var(--admin-shell-bg,#fff);color:var(--admin-shell-text,#0f172a);font-weight:800;cursor:pointer}.contractor-smart-editor__actions button:first-child{border-color:#0e7490;background:#0e7490;color:#fff}.contractor-smart-editor__note{color:#64748b;font-size:9px;line-height:1.35;padding:0 2px}.contractor-smart-empty{padding:9px 10px;color:#64748b;font-size:11px;line-height:1.35}
[data-theme="dark"] .contractor-smart-toggle{border-left-color:#34515d;color:#cbd5e1}[data-theme="dark"] .contractor-smart-edit-selected{border-left-color:#34515d;color:#9bb0b8}[data-theme="dark"] .contractor-smart-toggle:hover,[data-theme="dark"] .contractor-smart-edit-selected:not(:disabled):hover,[data-theme="dark"] .contractor-smart-edit-selected:not(:disabled):focus-visible{background:#17313b}[data-theme="dark"] .contractor-smart-menu{border-color:#34515d;background:#10252e;box-shadow:0 16px 36px rgba(0,0,0,.35)}[data-theme="dark"] .contractor-smart-option{color:#dbeafe}[data-theme="dark"] .contractor-smart-option:hover,[data-theme="dark"] .contractor-smart-option.is-active{background:#164e63;color:#ecfeff}[data-theme="dark"] .contractor-smart-editor{border-color:#34515d;background:#0b1d25}[data-theme="dark"] .contractor-smart-editor__input{border-color:#34515d;background:#10252e;color:#e2e8f0}[data-theme="dark"] .contractor-smart-editor__note,[data-theme="dark"] .contractor-smart-empty{color:#9bb0b8}
.contractor-smart-option-select[data-icon-glyph]::before{content:attr(data-icon-glyph);display:inline-grid;place-items:center;flex:0 0 25px;width:25px;height:25px;margin-right:7px;border:1px solid color-mix(in srgb,var(--admin-shell-border,#dbe3ea) 88%,transparent);border-radius:7px;background:var(--admin-shell-soft,#f8fafc);color:#0e7490;font:900 16px/1 ui-monospace,SFMono-Regular,Menlo,monospace}.contractor-smart-option-select[data-icon-glyph]{display:flex;align-items:center;min-width:0}[data-theme="dark"] .contractor-smart-option-select[data-icon-glyph]::before{border-color:#34515d;background:#17313b;color:#67e8f9}
.contractor-smart-select[readonly] .contractor-smart-edit-selected{display:none}.contractor-smart-select.has-smart-edit-action .contractor-smart-control .product-catalog__input,.contractor-smart-select.has-smart-edit-action .contractor-smart-control .input,.contractor-smart-select.has-smart-edit-action .contractor-smart-control input{padding-right:88px}.contractor-smart-select[readonly] .contractor-smart-control .product-catalog__input,.contractor-smart-select[readonly] .contractor-smart-control .input,.contractor-smart-select[readonly] .contractor-smart-control input{padding-right:48px}
@media(max-width:760px){.contractor-smart-option-select{min-height:44px;white-space:normal;overflow-wrap:anywhere}.contractor-smart-editor__actions button{min-height:40px;padding-inline:12px}.contractor-smart-menu{max-height:min(260px,45dvh)}}
/* The selected product type uses the exact same glyph carried by its menu option. */
.contractor-smart-selected-icon{position:absolute;z-index:1;left:10px;top:50%;transform:translateY(-50%);display:inline-grid;place-items:center;width:25px;height:25px;border:1px solid color-mix(in srgb,var(--admin-shell-border,#dbe3ea) 88%,transparent);border-radius:7px;background:var(--admin-shell-soft,#f8fafc);color:#0e7490;font:900 16px/1 ui-monospace,SFMono-Regular,Menlo,monospace;pointer-events:none}
.contractor-smart-selected-icon[hidden]{display:none!important}.contractor-smart-control.has-smart-icon .product-catalog__input,.contractor-smart-control.has-smart-icon .input,.contractor-smart-control.has-smart-icon input{padding-left:44px}
[data-theme="dark"] .contractor-smart-selected-icon{border-color:#34515d;background:#17313b;color:#67e8f9}
/* Multi-select extension: selected values stay visible as removable chips while
   the same input continues to search remaining options. */
.contractor-smart-select[data-smart-multiple]{display:grid;gap:5px}.contractor-smart-select[data-smart-multiple] .contractor-smart-selected-list{display:flex;flex-wrap:wrap;gap:5px;min-width:0}.contractor-smart-selected-chip{display:inline-flex;align-items:center;gap:5px;max-width:100%;min-height:28px;padding:3px 4px 3px 8px;border:1px solid var(--admin-shell-border,#dbe3ea);border-radius:999px;background:var(--admin-shell-bg,#fff);color:var(--admin-shell-text,#0f172a);font-size:11px;font-weight:750}.contractor-smart-selected-chip>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.contractor-smart-selected-chip button{display:inline-grid;place-items:center;width:20px;height:20px;padding:0;border:0;border-radius:50%;background:transparent;color:var(--admin-shell-muted,#64748b);font:800 15px/1 system-ui;cursor:pointer}.contractor-smart-selected-chip button:hover,.contractor-smart-selected-chip button:focus-visible{background:var(--admin-shell-soft,#f1f5f9);color:var(--admin-shell-text,#0f172a);outline:none}.contractor-smart-option.is-selected{background:#ecfeff;color:#0e7490}.contractor-smart-option.is-selected .contractor-smart-option-select::after{content:'✓';margin-left:auto;padding-left:8px;font-weight:900}.contractor-smart-select[data-smart-multiple] .contractor-smart-option-select{display:flex;align-items:center}.contractor-smart-select[data-smart-multiple] .contractor-smart-edit-selected{display:none!important}.contractor-smart-select[data-smart-multiple] .contractor-smart-control input{padding-right:48px}
[data-theme="dark"] .contractor-smart-selected-chip{border-color:#34515d;background:#10252e;color:#e2e8f0}[data-theme="dark"] .contractor-smart-option.is-selected{background:#164e63;color:#ecfeff}
/* Optional add-on-no-match action. On compact screens we reserve input width
   only while the + / edit action is actually visible, so hidden actions never
   steal placeholder space. */
.contractor-smart-add-new{position:absolute;top:2px;bottom:2px;right:43px;width:40px;border:0;border-left:1px solid #e2e8f0;background:transparent;color:#0e7490;font:900 19px/1 system-ui;cursor:pointer}.contractor-smart-add-new:hover,.contractor-smart-add-new:focus-visible{background:#ecfeff}.contractor-smart-add-new:focus-visible{outline:2px solid #0891b2;outline-offset:-2px}.contractor-smart-select.is-smart-add-visible.has-smart-edit-action .contractor-smart-edit-selected{right:83px}.contractor-smart-select.is-smart-add-visible .contractor-smart-control .product-catalog__input,.contractor-smart-select.is-smart-add-visible .contractor-smart-control .input,.contractor-smart-select.is-smart-add-visible .contractor-smart-control input{padding-right:88px}.contractor-smart-select.is-smart-add-visible.has-smart-edit-action .contractor-smart-control .product-catalog__input,.contractor-smart-select.is-smart-add-visible.has-smart-edit-action .contractor-smart-control .input,.contractor-smart-select.is-smart-add-visible.has-smart-edit-action .contractor-smart-control input{padding-right:128px}[data-theme="dark"] .contractor-smart-add-new{border-left-color:#34515d;color:#67e8f9}[data-theme="dark"] .contractor-smart-add-new:hover,[data-theme="dark"] .contractor-smart-add-new:focus-visible{background:#164e63}
.contractor-smart-select.is-smart-add-visible .contractor-smart-add-new{right:3px;border-radius:0 8px 8px 0}.contractor-smart-select.is-smart-add-visible .contractor-smart-toggle{right:43px;border-radius:0}
/* Inline multi-select mode keeps selected chips inside the input frame. */
.contractor-smart-select[data-smart-inline-selected]{display:block}
.contractor-smart-select[data-smart-inline-selected] .contractor-smart-control{min-height:40px;align-items:center;flex-wrap:wrap;gap:4px;padding:4px 46px 4px 6px;border:1px solid var(--admin-shell-border,#dbe3ea);border-radius:10px;background:var(--admin-shell-bg,#fff)}
.contractor-smart-select[data-smart-inline-selected] .contractor-smart-selected-list{display:contents}
.contractor-smart-select[data-smart-inline-selected] .contractor-smart-selected-chip{min-height:28px;max-width:min(180px,70vw)}
.contractor-smart-select[data-smart-inline-selected] .contractor-smart-control input{flex:1 1 140px;width:auto!important;min-width:120px;height:30px!important;padding:0 6px!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;outline:none!important}
.contractor-smart-select[data-smart-inline-selected] .contractor-smart-toggle{top:1px;bottom:1px}
[data-theme="dark"] .contractor-smart-select[data-smart-inline-selected] .contractor-smart-control{border-color:#34515d;background:#10252e}
@media(max-width:760px){.contractor-smart-select[data-smart-inline-selected] .contractor-smart-control{min-height:44px}.contractor-smart-select[data-smart-inline-selected] .contractor-smart-selected-chip{max-width:65vw}}
