/* One stable action area per catalogue row, on desktop and mobile. */
#page-admin-catalog #catalogLibraryRows .catalog-library-row.catalog-organized-row{display:grid;grid-template-columns:24px minmax(0,1.6fr) minmax(100px,.65fr) minmax(130px,.65fr) auto;gap:14px;padding:16px 18px;align-items:center}
#catalogLibraryRows .catalog-organized-row>.catalog-select-product{grid-column:1;grid-row:1}
#catalogLibraryRows .catalog-organized-row>.catalog-row-info{grid-column:2;grid-row:1}
#catalogLibraryRows .catalog-organized-row>.catalog-row-source{grid-column:3;grid-row:1}
#catalogLibraryRows .catalog-organized-row>.catalog-row-barcode{grid-column:4;grid-row:1;font:500 12px/1.4 'DM Sans',sans-serif}
#catalogLibraryRows .catalog-organized-row>.catalog-row-actions{grid-column:5;grid-row:1;display:flex;align-items:center;justify-content:flex-end;gap:8px}
#catalogLibraryRows .catalog-organized-row>.workspace-alias-group{grid-column:2/-1}
#catalogLibraryRows .catalog-organized-row .catalog-row-info strong{font:600 14px/1.4 'DM Sans',sans-serif}
#catalogLibraryRows .catalog-organized-row .catalog-row-info small,#catalogLibraryRows .catalog-organized-row .catalog-source{font:400 11px/1.5 'DM Sans',sans-serif;text-transform:none}
.catalog-row-actions button,.catalog-actions-menu summary{min-height:44px;box-sizing:border-box}
.catalog-actions-menu{position:relative}.catalog-actions-menu summary{list-style:none;display:flex;align-items:center;gap:12px;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:#fff;color:var(--ink);font:500 13px 'DM Sans',sans-serif;cursor:pointer}.catalog-actions-menu summary::-webkit-details-marker{display:none}
.catalog-actions-list{position:absolute;right:0;top:calc(100% + 6px);width:250px;max-width:calc(100vw - 36px);padding:6px;background:#fff;border:1px solid var(--line);border-radius:14px;box-shadow:0 10px 32px var(--ink-soft);z-index:30}
.catalog-actions-list>button{display:block!important;text-align:left!important;white-space:normal;width:100%;border:0;box-shadow:none;margin:0;padding:10px 12px;border-radius:9px;font:500 13px/1.4 'DM Sans',sans-serif;background:#fff}
.catalog-actions-list>button:not(:disabled):hover{background:var(--green-soft)}.catalog-actions-list>button:disabled{opacity:1;color:var(--muted);background:#f5f7f6;cursor:not-allowed}.catalog-actions-list small{display:block;font:400 11px/1.4 'DM Sans',sans-serif;margin-top:3px}.catalog-library:has(.catalog-actions-menu[open]),#catalogLibraryRows:has(.catalog-actions-menu[open]){overflow:visible}
#modal.duplicate-merge-modal{width:min(820px,100%);padding:24px;border-radius:24px}
.duplicate-compare-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:18px 0}.duplicate-compare-cards .reference-group-member{padding:16px;border:1px solid var(--line);border-radius:16px;min-width:0}.duplicate-compare-cards .is-kept{border-color:var(--green);background:var(--green-soft)}.duplicate-compare-cards b{display:block;margin:5px 0}.duplicate-compare-cards label{cursor:pointer}.duplicate-compare-cards em{display:block;font:600 12px/1.4 'DM Sans',sans-serif;color:var(--green);margin-top:8px}.duplicate-merge-summary{padding:12px 14px;border-radius:12px;background:var(--green-soft);font:400 13px/1.5 'DM Sans',sans-serif}.duplicate-verification{display:flex;align-items:flex-start;gap:10px;font:400 13px/1.5 'DM Sans',sans-serif;margin-top:16px}.duplicate-verification input{width:18px;height:18px;flex:none;accent-color:var(--green)}
#duplicateProductPicker h2{font:600 21px/1.3 'DM Sans',sans-serif;padding-right:28px}#duplicateProductPicker p{font-size:13px;color:var(--muted)}#duplicateProductPicker input{width:100%;box-sizing:border-box;min-height:44px;font-size:16px}.duplicate-picker-results{max-height:48dvh;overflow:auto;margin-top:12px}.duplicate-picker-results button{display:block;width:100%;text-align:left;min-height:54px;margin-bottom:6px;white-space:normal}.duplicate-picker-results small{display:block;color:var(--muted);margin-top:4px}
@media(max-width:900px){#page-admin-catalog #catalogLibraryRows .catalog-library-row.catalog-organized-row{grid-template-columns:24px minmax(0,1fr);gap:8px;padding:14px 12px}#catalogLibraryRows .catalog-organized-row>.catalog-row-info{grid-column:2;grid-row:1}#catalogLibraryRows .catalog-organized-row>.catalog-row-source{grid-column:2;grid-row:2}#catalogLibraryRows .catalog-organized-row>.catalog-row-barcode{grid-column:2;grid-row:3}#catalogLibraryRows .catalog-organized-row>.catalog-row-actions{grid-column:2;grid-row:4;justify-content:flex-start}.catalog-actions-list{right:auto;left:0;width:min(250px,calc(100vw - 70px))}.duplicate-compare-cards{grid-template-columns:1fr}#modal.duplicate-merge-modal{padding:20px 16px}.duplicate-compare-cards .reference-group-member{padding:12px}#duplicateReferencesDialog footer{display:grid;grid-template-columns:1fr 1fr}#duplicateReferencesDialog footer button{min-width:0;white-space:normal}}
.catalog-actions-list{z-index:90}

/* Legacy panels are replaced by the unified barcode control from first paint. */
#page-admin-catalog .catalog-conflicts,#page-admin-catalog .barcode-proposal-panel{display:none!important}

/* Identity regrouping uses its own choice layout, not text-field label styling. */
#modal.reference-group-modal{width:min(760px,100%);max-height:calc(100dvh - 32px);box-sizing:border-box;overflow:auto;overscroll-behavior:contain}
#referenceIdentityRegroup{min-width:0}
#referenceIdentityRegroup>h2{padding-right:28px;font-size:20px;line-height:1.3}
#referenceIdentityRegroup>p{font-size:13px;line-height:1.5;margin:10px 0 16px}
#referenceIdentityRegroup .duplicate-compare-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0 0 14px}
#referenceIdentityRegroup .reference-source-card{min-width:0;border:1px solid var(--line);border-radius:12px;padding:14px;overflow-wrap:anywhere;background:#fff}
#referenceIdentityRegroup .reference-source-card:has(input:checked){border-color:var(--green);background:var(--green-soft)}
#referenceIdentityRegroup .reference-principal-choice{display:grid;grid-template-columns:18px minmax(0,1fr);align-items:start;gap:10px;margin:0 0 12px;cursor:pointer;font-size:14px;line-height:1.4}
#referenceIdentityRegroup .reference-principal-choice b{display:block;margin:0;font:600 14px/1.4 'DM Sans',sans-serif;color:var(--ink);text-transform:none}
#referenceIdentityRegroup :is(.reference-principal-choice,.reference-group-verification)>input{display:block;box-sizing:border-box;width:18px;min-width:18px;max-width:18px;height:18px;min-height:18px;padding:0;margin:1px 0 0;border:0;border-radius:0;box-shadow:none;accent-color:var(--green);flex:none}
#referenceIdentityRegroup :is(.reference-principal-choice,.reference-group-verification)>input:focus-visible{outline:2px solid var(--green);outline-offset:3px}
#referenceIdentityRegroup .reference-source-card small{display:block;font-size:12px;line-height:1.45;color:var(--muted)}
#referenceIdentityRegroup .reference-source-card p{margin:7px 0;font-size:13px;line-height:1.45}
#referenceIdentityRegroup .reference-identity-summary{padding:12px;border-radius:10px;background:var(--green-soft);font-size:13px;line-height:1.5;overflow-wrap:anywhere}
#referenceIdentityRegroup .reference-group-verification{display:flex;align-items:flex-start;gap:10px;margin:14px 0;font-size:13px;line-height:1.5;cursor:pointer}
#referenceIdentityRegroup [role=status]:empty{display:none}
#referenceIdentityRegroup footer{display:flex;justify-content:flex-end;gap:8px;margin-top:14px}
#referenceIdentityRegroup footer button{min-height:40px;margin:0;white-space:normal}
@media(max-width:560px){
 #modal.reference-group-modal{width:100%;padding:20px 14px;max-height:calc(100dvh - 20px);border-radius:16px}
 #referenceIdentityRegroup .duplicate-compare-cards{grid-template-columns:minmax(0,1fr);gap:10px}
 #referenceIdentityRegroup .reference-source-card{padding:12px}
 #referenceIdentityRegroup footer{display:grid;grid-template-columns:1fr 1fr}
 #referenceIdentityRegroup footer button{min-width:0}
}

#referenceIdentityRegroup>h2{font-family:'DM Sans',sans-serif}
#referenceIdentityRegroup>h2:focus{outline:none!important;box-shadow:none!important}
@media(min-width:561px){#referenceIdentityRegroup .reference-principal-choice{min-height:40px}}
