/* Catalogue panel (quote editor). Tokens only: --qe-* resolve to the console's --ds-* tokens (quote-editor-v2.css). */
.qe2-sheet.cg-sheet { width: min(1400px, 100%); }
.cg-head-title { display: flex; align-items: baseline; gap: var(--qe-s-3); min-width: 0; }
.qe2-sheet-body.cg-sheet-body { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.cg-sheet-body > .cg-mount { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cg { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.cg-searchband { flex: none; padding: var(--qe-s-4) var(--qe-s-6); border-bottom: 1px solid var(--qe-hair); }
.cg-searchband .pb2-search { width: 100%; }
.cg-searchband .pb2-search input { width: 100%; padding-right: var(--qe-s-3); }
.cg-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 288px minmax(0, 1fr); overflow: hidden; }

/* Rail */
.cg-rail { overflow-y: auto; background: var(--qe-canvas); border-right: 1px solid var(--qe-line); padding-bottom: var(--qe-s-4); }
.cg-rail-label { padding: var(--qe-s-3) var(--qe-s-3) var(--qe-s-2); color: var(--qe-ink-3); font-size: var(--qe-t-caps); line-height: var(--qe-l-caps); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.cg-rail .pb2-loading, .cg-rail .qe2-banner { margin: var(--qe-s-2) var(--qe-s-3); }
.cg-grp { display: flex; align-items: center; }
.cg-toggle { display: grid; place-items: center; flex: none; width: var(--qe-s-6); min-height: 28px; padding: 0; border: 0; background: transparent; color: var(--qe-ink-3); cursor: pointer; }
.cg-toggle.cg-none { visibility: hidden; }
.cg-toggle:hover { background: var(--qe-hover); }
.cg-node { display: flex; align-items: center; gap: var(--qe-s-2); width: 100%; min-height: 28px; padding: var(--qe-s-1) var(--qe-s-3); border: 0; border-radius: 0; background: transparent; color: var(--qe-ink); font: inherit; font-size: var(--qe-t-body); line-height: var(--qe-l-body); text-align: left; cursor: pointer; }
.cg-node:hover { background: var(--qe-hover); }
.cg-node.is-selected { background: var(--qe-highlight); box-shadow: inset 3px 0 0 var(--qe-action); }
.cg-grp .cg-node { flex: 1; min-width: 0; padding-left: var(--qe-s-2); }
.cg-node-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cg-top .cg-node-name { font-weight: 600; }
.cg-node-n { margin-left: auto; color: var(--qe-ink-3); font-size: var(--qe-t-meta); font-variant-numeric: tabular-nums; }
.cg-sub { padding-left: calc(var(--qe-s-6) + var(--qe-s-6) + var(--qe-s-3)); }
.cg-rail :focus-visible, .cg-main :focus-visible { outline: 2px solid var(--qe-focus); outline-offset: -2px; }

/* Main */
.cg-main { overflow-y: auto; padding: 0 var(--qe-s-6) var(--qe-s-6); min-width: 0; }
.cg-headline { display: flex; align-items: center; flex-wrap: wrap; gap: var(--qe-s-2) var(--qe-s-4); padding: var(--qe-s-4) 0 var(--qe-s-3); }
.cg-crumb { min-height: var(--qe-h-control); display: flex; align-items: center; font-size: var(--qe-t-row); line-height: var(--qe-l-row); font-weight: 600; }
.cg-crumb:empty { display: none; }
.cg-crumb i { font-style: normal; color: var(--qe-ink-3); font-weight: 400; padding: 0 var(--qe-s-1); }
.cg-tools { display: flex; align-items: center; gap: var(--qe-s-4); margin-left: auto; }
.cg-filter { width: 220px; height: 28px; padding: 0 var(--qe-s-2); }
.cg-sort { position: relative; min-width: 0; height: 28px; cursor: pointer; }
.cg-sort select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font: inherit; }
.cg-sort:focus-within { outline: 2px solid var(--qe-focus); outline-offset: -1px; }
.cg-tools .qe2-check-row { min-height: 28px; }
.cg-fits { display: flex; flex-wrap: wrap; align-items: center; gap: var(--qe-s-2); padding-bottom: var(--qe-s-3); }
.cg-fits-label { color: var(--qe-ink-3); font-size: var(--qe-t-meta); margin-right: var(--qe-s-1); }
.cg-fits .qe2-chip { height: 28px; padding: 2px var(--qe-s-3); }
.cg-fits .qe2-chip[aria-pressed="true"] { background: var(--qe-highlight); border-color: var(--qe-ink-2); }

/* Part list: the Part column takes the spare width, so Sell, On hand, the badge and the quantity stay together at the right. */
.cg-cols-a { --cg-cols: minmax(0, 1fr) 152px 192px 88px 72px 80px 128px; }
.cg-cols-b { --cg-cols: minmax(0, 1fr) 152px 88px 72px 80px 128px; }
.cg-sticky { position: sticky; top: 0; z-index: 4; margin: 0 calc(-1 * var(--qe-s-6)); padding: var(--qe-s-2) var(--qe-s-6) 0; background: var(--qe-surface); }
.cg-colhead, .cg-row { display: grid; grid-template-columns: var(--cg-cols); column-gap: var(--qe-s-2); align-items: center; }
.cg-colhead { color: var(--qe-ink-3); font-size: var(--qe-t-caps); line-height: var(--qe-l-caps); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; height: 28px; border-bottom: 1px solid var(--qe-line); }
.cg-colhead .r { text-align: right; }
.cg-colhead > span { white-space: nowrap; }
.cg-row { min-height: 36px; padding: 3px 0; border-bottom: 1px solid var(--qe-hair); }
.cg-row:hover { background: var(--qe-hover); }
.cg-name { display: flex; flex-direction: column; min-width: 0; }
.cg-desc { color: var(--qe-ink); font-size: var(--qe-t-body); line-height: var(--qe-l-body); font-weight: 500; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.cg-where { color: var(--qe-ink-3); font-size: var(--qe-t-meta); line-height: var(--qe-l-meta); }
.cg-pn { font-family: var(--ds-mono); font-size: var(--qe-t-meta); line-height: var(--qe-l-meta); color: var(--qe-ink-2); overflow-wrap: anywhere; }
.cg-fit { color: var(--qe-ink-3); font-size: var(--qe-t-meta); line-height: var(--qe-l-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.cg-num { text-align: right; font-size: var(--qe-t-body); line-height: var(--qe-l-body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cg-stock { text-align: right; font-size: var(--qe-t-meta); color: var(--qe-ink-2); font-variant-numeric: tabular-nums; }
.cg-onq { display: flex; justify-content: flex-end; }
.cg-row .pb2c-act { justify-self: end; }
.cg-filter[hidden] { display: none; }
.cg-gband { color: var(--qe-ink); }
.cg-group { display: flex; align-items: baseline; padding: var(--qe-s-2) var(--qe-s-3); margin-top: var(--qe-s-3); background: var(--qe-canvas); border-bottom: 1px solid var(--qe-hair); color: var(--qe-ink-2); font-size: var(--qe-t-meta); line-height: var(--qe-l-meta); font-weight: 600; }
.cg-group:first-child, .cg-sticky + .cg-group { margin-top: 0; }
.cg-more { display: flex; align-items: center; gap: var(--qe-s-3); padding: var(--qe-s-3) 0 0; }
.cg-more:empty { display: none; }
.cg-more .pb2-showmore { margin-left: 0; border: 1px solid var(--qe-field); color: var(--qe-ink); }
.cg-more span { color: var(--qe-ink-3); font-size: var(--qe-t-meta); font-variant-numeric: tabular-nums; }
.cg-main .pb2-loading, .cg-main .pb2-empty, .cg-main .qe2-banner { margin: var(--qe-s-4) 0; }

@media (max-width: 899px) {
  .cg-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .cg-rail { max-height: 30vh; border-right: 0; border-bottom: 1px solid var(--qe-line); }
  .cg-main { padding: 0 var(--qe-s-3) var(--qe-s-6); }
  .cg-sticky { margin: 0 calc(-1 * var(--qe-s-3)); padding: var(--qe-s-2) var(--qe-s-3) 0; }
  .cg-tools { margin-left: 0; flex-wrap: wrap; }
}

/* Narrower than the full table: Quantity and Add always stay in view, never a sideways scroll.
   Below 1280 the Fits text and the "on quote" badge move to a second line under the part, and the Part column takes the spare width (its name wraps to two lines).
   Below 760 On hand is hidden; below 640 Part no. also goes to a muted second line, so the table is Part, Sell, quantity and Add. */
.cg-main { overflow-x: hidden; }
@media (max-width: 1279px) {
  .cg-cols-a, .cg-cols-b { --cg-cols: minmax(0, 1fr) 112px 76px 60px 128px; }
  .cg-colhead { grid-template-areas: "name pn sell stock act"; }
  .cg-row { grid-template-areas: "name pn sell stock act" "fit onq onq onq act"; row-gap: 0; }
  .cgh-name, .cg-name { grid-area: name; } .cgh-pn, .cg-pn { grid-area: pn; } .cgh-sell, .cg-num { grid-area: sell; } .cgh-stock, .cg-stock { grid-area: stock; }
  .cgh-act, .cg-row .pb2c-act { grid-area: act; } .cg-fit { grid-area: fit; } .cg-onq { grid-area: onq; }
  .cgh-fit, .cgh-onq { display: none; }
  .cg-fit { white-space: normal; padding-top: 1px; }
}
@media (max-width: 759px) {
  .cg-cols-a, .cg-cols-b { --cg-cols: minmax(0, 1fr) 100px 88px 140px; }
  .cg-colhead { grid-template-areas: "name pn sell act"; }
  .cg-row { grid-template-areas: "name pn sell act" "fit onq onq act"; }
  .cgh-stock, .cg-stock { display: none; }
}
@media (max-width: 639px) {
  .cg-cols-a, .cg-cols-b { --cg-cols: minmax(0, 1fr) 88px 140px; }
  .cg-colhead { grid-template-areas: "name sell act"; }
  .cg-row { grid-template-areas: "name sell act" "pn onq act" "fit fit act"; }
  .cgh-pn { display: none; }
  .cg-pn { color: var(--qe-ink-3); }
}
