/* Shared catalogue and US execution views. */
.cat-root{container-type:inline-size;container-name:catalog;min-width:0}
.cat-root h2,.cat-root h3{margin:0}
.cat-root p{margin:0}
.cat-root small{display:block;overflow-wrap:anywhere}
.cat-root .stack{min-width:0}
.cat-root input,.cat-root select,.cat-root textarea{min-width:0;max-width:100%;box-sizing:border-box}
.cat-root button{overflow-wrap:anywhere}
.cat-root figure{margin:0}
.cat-root summary{cursor:pointer;min-height:32px;display:list-item;align-content:center}
.cat-root details[open]>summary{margin-bottom:12px}
.cat-root .field{width:100%}
.cat-root .cat-top{margin-top:14px}
.cat-root .cat-check{display:flex;align-items:center;gap:8px;min-height:40px}
.cat-root input[type=checkbox]{width:18px;height:18px;flex:none;accent-color:var(--brand)}
.cat-root .cat-search-row{display:flex;gap:10px;align-items:end;flex-wrap:wrap}
.cat-root .cat-search-row>input{flex:1;min-width:150px}
.cat-root .cat-search-row>label{flex:1;min-width:140px}
.cat-root .cat-filter-row{display:flex;gap:12px;flex-wrap:wrap}
.cat-root .cat-filter-row>label{flex:1;min-width:130px}
.cat-root .cat-product-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.cat-root .cat-product-card{display:flex;flex-direction:column;min-width:0;overflow:hidden;border:1px solid var(--line);border-radius:12px;background:var(--surface)}
.cat-root .cat-product-open{display:flex;flex-direction:column;appearance:none;text-align:left;font:inherit;color:inherit;border:0;background:transparent;padding:0;width:100%;cursor:pointer;flex:1;min-width:0}
.cat-root .product-image{width:100%;aspect-ratio:1/1;min-height:0;overflow:hidden;background:var(--tint);display:flex;align-items:center;justify-content:center}
.cat-root .product-image img,.cat-root .product-image video{width:100%;height:100%;object-fit:contain;display:block}
.cat-root .product-image>div{max-width:100%;max-height:100%}
.cat-root .cat-product-info{display:flex;flex-direction:column;gap:5px;padding:12px 12px 8px;min-width:0;width:100%;box-sizing:border-box}
.cat-root .cat-product-name{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}
.cat-root .cat-sale{font-size:18px}
.cat-root .cat-product-card>.button{margin:4px 12px 12px;min-height:40px}
.cat-root .cat-pagination{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.cat-root .cat-prices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.cat-root .cat-prices>div{display:flex;flex-direction:column;gap:5px;min-width:0}
.cat-root .cat-prices span{color:var(--muted);font-size:13px}
.cat-root .cat-prices strong{overflow-wrap:anywhere}
.cat-root .cat-detail{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:28px}
.cat-root .cat-detail-media{min-width:0}
.cat-root .cat-detail-media>img,.cat-root .cat-detail-media>video,.cat-root .cat-detail-media>.product-image{width:100%;height:auto;max-height:520px;object-fit:contain;aspect-ratio:1/1}
.cat-root .cat-media-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-top:12px}
.cat-root .cat-media-gallery img,.cat-root .cat-media-gallery video{width:100%;aspect-ratio:1/1;object-fit:contain;border:1px solid var(--line);border-radius:8px}
.cat-root .cat-description{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.65}
.cat-root .cat-history-row{display:flex;flex-direction:column;gap:5px;padding:12px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.cat-root .cat-history-row:last-child{border-bottom:0}
.cat-root .cat-check-list{display:flex;flex-direction:column;gap:8px}
.cat-root .cat-check-list>label{display:flex;gap:8px;align-items:center;min-height:40px}
.cat-root .cat-source-row{display:grid;grid-template-columns:70px minmax(0,1fr) auto;gap:14px;align-items:center}
.cat-root .cat-source-image{width:70px;height:85px;overflow:hidden;border-radius:8px;background:var(--tint)}
.cat-root .cat-source-image img,.cat-root .cat-source-image video,.cat-root .cat-source-image>div{width:100%;height:100%;object-fit:contain}
.cat-root .cat-spec-row{margin:0;padding:14px;border:1px solid var(--line);border-radius:10px;min-width:0}
.cat-root .cat-spec-row legend{padding:0 6px;font-weight:600}
.cat-root .cat-spec-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.cat-root .cat-uploaded-media{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.cat-root .cat-uploaded-media img,.cat-root .cat-uploaded-media video{width:100%;aspect-ratio:1/1;object-fit:contain;border-radius:8px;background:var(--tint)}
.cat-root .cat-uploaded-media figcaption{font-size:12px;overflow-wrap:anywhere;display:flex;flex-direction:column;gap:6px}
.cat-root .cat-batch-notice{background:var(--tint);display:flex;flex-direction:column;gap:12px}
.cat-root .cat-proc-row{display:grid;grid-template-columns:24px minmax(0,1fr) auto;gap:14px;align-items:center}
.cat-root .cat-order-text{display:flex;flex-direction:column;gap:5px;overflow-wrap:anywhere}
.cat-root .cat-cost-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(110px,150px);gap:16px;border-top:1px solid var(--line);padding-top:16px;align-items:center}
.cat-root .cat-cost-row>div{display:flex;flex-direction:column;gap:5px;overflow-wrap:anywhere;min-width:0}
.cat-root .cat-receipt{display:block;max-width:250px;max-height:260px;object-fit:contain}
.cat-root .cat-ready-group{display:flex;justify-content:space-between;gap:16px;align-items:center}
.cat-root .cat-ready-group>div{display:flex;flex-direction:column;gap:6px;min-width:0;overflow-wrap:anywhere}
.cat-root .cat-address{background:var(--tint);padding:14px;border-radius:8px;line-height:1.7;overflow-wrap:anywhere}
.cat-root .cat-pack-row{display:flex;gap:12px;align-items:flex-start;padding:12px 0;border-top:1px solid var(--line)}
.cat-root .cat-pack-row>span{display:flex;flex-direction:column;gap:4px;min-width:0;overflow-wrap:anywhere}
.cat-root .cat-pack-row input{margin-top:4px}
.cat-root .cat-parcel{display:flex;flex-direction:column;gap:9px}
.cat-root .cat-tracking{display:flex;flex-direction:column;gap:5px;overflow-wrap:anywhere;word-break:break-word}
.cat-root .cat-leg{display:flex;flex-direction:column;gap:10px;border-top:1px solid var(--line);padding-top:14px}
.cat-root .cat-void{color:var(--muted)}
.cat-root .cat-success{background:var(--tint);border-left:3px solid var(--brand);padding:12px;border-radius:6px}
@container catalog (min-width:1400px){.cat-root .cat-product-grid{grid-template-columns:repeat(6,minmax(0,1fr))}}
@container catalog (max-width:760px){.cat-root .cat-detail{grid-template-columns:1fr;gap:20px}.cat-root .cat-detail-media>img,.cat-root .cat-detail-media>video{max-height:340px}.cat-root .cat-spec-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.cat-root .cat-uploaded-media{grid-template-columns:repeat(3,minmax(0,1fr))}}
@container catalog (max-width:699px){
 .cat-root .cat-product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
 .cat-root .cat-product-info{padding:10px 9px 5px;gap:4px}
 .cat-root .cat-product-info small{font-size:12px}
 .cat-root .cat-product-card>.button{margin:5px 9px 9px;min-height:44px;padding:8px}
 .cat-root .cat-source-row{grid-template-columns:56px minmax(0,1fr);gap:10px}
 .cat-root .cat-source-row>.button{grid-column:1 / -1}
 .cat-root .cat-source-image{width:56px;height:68px}
 .cat-root .cat-proc-row{grid-template-columns:24px minmax(0,1fr);gap:10px}
 .cat-root .cat-proc-row>.button{grid-column:2;justify-self:start}
 .cat-root .cat-ready-group{flex-wrap:wrap}
 .cat-root .cat-ready-group>.button{width:100%}
 .cat-root .cat-prices{gap:8px}
 .cat-root .cat-cost-row{grid-template-columns:minmax(0,1fr) 100px;gap:12px}
 .cat-root .cat-filter-row{gap:10px}
 .cat-root .cat-filter-row>label{min-width:100px}
 .cat-root .cat-pagination{justify-content:center}
 .cat-root .cat-uploaded-media{grid-template-columns:repeat(2,minmax(0,1fr))}
 .cat-root .button,.cat-root .field{min-height:44px}
 .cat-root input,.cat-root select,.cat-root textarea{font-size:16px}
}
@media(max-width:700px){.cat-root .cat-product-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.cat-root .cat-detail{grid-template-columns:1fr}.cat-root .cat-spec-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.cat-root .cat-ready-group{flex-wrap:wrap}}
/* V02: direct filters, grouped variant entry, and fewer procurement actions. */
.cat-root .cat-quick-filter{display:grid;grid-template-columns:44px minmax(0,1fr);gap:8px;align-items:start}
.cat-root .cat-quick-filter>strong{font-size:13px;padding-top:10px}
.cat-root .cat-chips{display:flex;gap:7px;overflow-x:auto;align-items:center;padding:2px 0 5px;min-width:0;scrollbar-width:thin}
.cat-root .cat-chip{flex:none;border:1px solid var(--line);background:var(--surface);color:inherit;font:inherit;font-size:13px;padding:8px 12px;min-height:38px;border-radius:8px;cursor:pointer}
.cat-root .cat-chip.active{background:var(--brand);border-color:var(--brand);color:white}
.cat-root .cat-chips>.button{flex:none;white-space:nowrap;min-height:38px;padding:8px 11px}
.cat-root .cat-variant-builder{display:flex;flex-direction:column;gap:12px;padding:14px;background:var(--tint);border-radius:10px}
.cat-root .cat-bulk-cost{display:grid;grid-template-columns:minmax(100px,180px) minmax(160px,220px) auto;gap:10px;align-items:end;justify-content:start}
.cat-root .cat-spec-group{border:1px solid var(--line);border-radius:10px;padding:10px;min-width:0}
.cat-root .cat-spec-group>summary{font-weight:600;padding:3px 4px}
.cat-root .cat-spec-group-head{display:flex;align-items:end;justify-content:space-between;gap:10px;background:var(--tint);padding:8px;border-radius:6px;margin-bottom:8px}
.cat-root .cat-spec-group-head label{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:600}
.cat-root .cat-spec-group-head input{width:150px;min-height:34px}
.cat-root .cat-compact-specs{display:flex;flex-direction:column;gap:5px}
.cat-root .cat-spec-row{display:grid;grid-template-columns:22px minmax(55px,1fr) minmax(85px,1fr) minmax(65px,1fr) 66px 58px;gap:9px;align-items:end;padding:6px 4px;border:0;border-bottom:1px solid var(--line);border-radius:0}
.cat-root .cat-spec-row:last-child{border-bottom:0}
.cat-root .cat-spec-row>label:not(.cat-check):not(.cat-spec-select){font-size:11px;gap:4px}
.cat-root .cat-spec-row .field{min-height:35px;padding:7px 8px}
.cat-root .cat-spec-row .button{min-height:35px;padding:7px 8px;font-size:12px}
.cat-root .cat-spec-select{display:flex;align-items:center;height:36px}
.cat-root .cat-spec-stock{font-size:12px;gap:5px;min-height:36px}
.cat-root .cat-spec-cost{display:flex;flex-direction:column;gap:8px;padding-bottom:8px;font-size:13px}
.cat-root .cat-spec-cost>span{font-size:11px;color:var(--muted)}
.cat-root[data-role=ADMIN] .cat-spec-row{grid-template-columns:minmax(55px,1fr) minmax(85px,1fr) minmax(65px,1fr) 66px 58px}
.cat-root .cat-proc-bulk{display:flex;flex-wrap:wrap;align-items:center;gap:10px;justify-content:space-between}
.cat-root .cat-proc-row{grid-template-columns:22px 70px minmax(0,1fr) minmax(150px,auto);gap:12px}
.cat-root .cat-proc-actions{justify-content:flex-end;max-width:310px}
.cat-root .cat-order-thumb{width:70px;height:84px;overflow:hidden;border-radius:7px;background:var(--tint);flex:none}
.cat-root .cat-order-thumb img,.cat-root .cat-order-thumb video,.cat-root .cat-order-thumb>div{width:100%;height:100%;object-fit:contain}
.cat-root .cat-cost-product{display:flex!important;flex-direction:row!important;gap:10px;align-items:center}
.cat-root .cat-cost-product>div:last-child{min-width:0;display:flex;flex-direction:column;gap:4px}
@container catalog (max-width:699px){
 .cat-root .cat-chip,.cat-root .cat-chips>.button{min-height:44px}
 .cat-root .cat-quick-filter{grid-template-columns:34px minmax(0,1fr)}
 .cat-root .cat-variant-builder{padding:10px}
 .cat-root .cat-bulk-cost{grid-template-columns:minmax(90px,1fr) minmax(0,1.4fr)}
 .cat-root .cat-bulk-cost>.button{grid-column:1 / -1}
 .cat-root .cat-spec-group{padding:7px}
 .cat-root .cat-spec-group-head{padding:7px;flex-wrap:wrap}
 .cat-root .cat-spec-group-head input{width:120px}
 .cat-root .cat-spec-row{grid-template-columns:20px minmax(44px,1fr) minmax(66px,1.2fr) minmax(44px,1fr);gap:7px;padding:5px 0 8px}
 .cat-root .cat-spec-row .field,.cat-root .cat-spec-row .button{min-height:40px;font-size:14px;padding:7px 6px}
 .cat-root .cat-spec-row .cat-spec-stock{grid-column:2 / 4;min-height:36px}
 .cat-root .cat-spec-row>.button{grid-column:4;min-height:36px}
 .cat-root[data-role=ADMIN] .cat-spec-row{grid-template-columns:minmax(44px,1fr) minmax(66px,1.2fr) minmax(44px,1fr)}
 .cat-root[data-role=ADMIN] .cat-spec-stock{grid-column:1 / 3}
 .cat-root[data-role=ADMIN] .cat-spec-row>.button{grid-column:3}
 .cat-root .cat-proc-row{grid-template-columns:22px 58px minmax(0,1fr);gap:9px}
 .cat-root .cat-proc-row>.cat-proc-actions{grid-column:2 / -1;max-width:none;justify-content:flex-start}
 .cat-root .cat-order-thumb{width:58px;height:72px}
 .cat-root .cat-cost-product{flex-direction:column!important;align-items:flex-start}
 .cat-root .cat-cost-product .cat-order-thumb{width:45px;height:54px}
 .cat-root .cat-proc-bulk>.actions{width:100%}
}
.cat-root .cat-chips{position:relative}
/* V04: short review path, visible operations and recoverable conflicts. */
.cat-root .cat-edit-actions{position:sticky;top:8px;z-index:8;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:10px 12px;display:flex;align-items:center;justify-content:space-between;gap:12px;box-shadow:0 2px 8px #0000000a}
.cat-root .cat-edit-actions>div:first-child{min-width:0}.cat-root .cat-edit-actions small{color:var(--muted);font-size:12px}.cat-root .cat-edit-actions .actions{flex-shrink:0}
.cat-root[data-role=ADMIN] .cat-review-head{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:start}
.cat-root .cat-spec-summary{display:inline;color:var(--muted);font-weight:400;font-size:12px;margin-left:10px}
.cat-root .cat-pricing{border-top:3px solid var(--brand)}
.cat-root .cat-variant-builder{background:var(--bg);padding:10px;gap:9px;border:1px solid var(--line)}
.cat-root .cat-spec-group-head,.cat-root .cat-batch-notice,.cat-root .cat-address{background:var(--bg)}
.cat-root .cat-spec-group{border-radius:7px;padding:8px}.cat-root .cat-spec-group-head{margin-bottom:5px}
.cat-root .cat-cost-blocked{border-left:3px solid var(--danger);padding-left:10px;background:var(--danger-tint)}
.cat-root .cat-success{background:var(--success-tint);border-left-color:var(--success);color:var(--success)}
.cat-root [data-category-suggestion]:empty{display:none}.cat-root [data-category-suggestion] .button{font-size:12px;min-height:28px;padding:3px 7px;margin:0 5px}
@container catalog (max-width:699px){.cat-root[data-role=ADMIN] .cat-review-head{grid-template-columns:1fr;gap:10px}.cat-root .cat-edit-actions{top:4px;padding:8px;flex-wrap:wrap;gap:7px}.cat-root .cat-edit-actions>div:first-child{width:100%}.cat-root .cat-edit-actions .actions{width:100%;gap:5px;display:flex}.cat-root .cat-edit-actions .actions button{flex:1;min-width:0;padding:8px 5px;font-size:13px;min-height:44px}.cat-root .cat-spec-summary{display:block;margin-left:0;margin-top:3px}.cat-root .cat-cost-row{grid-template-columns:minmax(0,1fr) 105px}.cat-root .cat-cost-row>.cat-cost-product{min-width:0}.cat-root .cat-cost-blocked{padding-left:7px}}

/* Keep active choices and the next execution step visible. */
.cat-root .cat-active-filters{display:flex;flex-wrap:wrap;align-items:center;gap:6px;border-top:1px solid var(--line);padding-top:10px}
.cat-root .cat-active-filters .button{font-size:12px;padding:6px 9px;min-height:34px;max-width:100%;white-space:normal;text-align:left}
.cat-root .cat-empty-recovery{display:flex;flex-direction:column;align-items:flex-start;gap:12px}
.cat-root .cat-next-step{display:flex;align-items:center;justify-content:space-between;gap:14px;border-left:3px solid var(--brand)}
.cat-root .cat-next-step>div{display:flex;flex-direction:column;gap:6px;min-width:0;overflow-wrap:anywhere}
.cat-root .cat-next-step>.button{flex-shrink:0}
@container catalog (max-width:699px){.cat-root .cat-active-filters .button{min-height:44px}.cat-root .cat-next-step{flex-direction:column;align-items:stretch}.cat-root .cat-next-step>.button{align-self:flex-start}}
