/* Catalogue cards share one hierarchy: identity / price, state, stock / location. */
@media screen {
  html[data-theme] #content .inventory-page .product-card.catalog-card.inventory-reference-card {
    grid-template-columns:42px minmax(0,1fr);grid-template-rows:auto auto minmax(36px,1fr);
    align-content:stretch;gap:8px;min-height:150px;padding:12px;border-radius:20px;
    border-color:color-mix(in srgb,var(--erp-line) 42%,transparent);
    background:radial-gradient(ellipse at 0 100%,color-mix(in srgb,var(--erp-warning) 7%,transparent),transparent 70%),radial-gradient(ellipse at 100% 0,var(--erp-glow-lilac),transparent 70%),color-mix(in srgb,var(--erp-raised) 55%,transparent);color:var(--erp-ink);
  }
  html[data-theme] #content .inventory-page .product-card.catalog-card.inventory-reference-card :is(.catalog-media,.asset-card-visual) {
    grid-column:1;grid-row:1;width:42px;height:42px;border-radius:12px;
  }
  html[data-theme] #content .inventory-page .product-card.catalog-card.inventory-reference-card .catalog-card-body {
    grid-column:2;grid-row:1;gap:4px;padding:0;min-width:0;background:none;
  }
  html[data-theme] #content .inventory-page .product-card.catalog-card.inventory-reference-card h3 {
    min-height:0;margin:0;padding:0;font-size:14px;line-height:1.3;font-weight:500;letter-spacing:-.2px;
  }
  html[data-theme] #content .inventory-page .inventory-reference-price {
    display:block;min-width:0;color:var(--erp-ink);font-size:12px;font-weight:400;line-height:1.45;
    font-variant-numeric:tabular-nums;overflow-wrap:anywhere;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .inventory-item-category {
    position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;
  }
  html[data-theme] #content .inventory-page .inventory-reference-state {
    grid-column:1/-1;grid-row:2;display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between;gap:4px 8px;
    min-width:0;min-height:18px;margin:0;padding:0;pointer-events:none;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .inventory-reference-state>.catalog-status {
    position:static;display:inline-flex;align-items:center;gap:6px;max-width:100%;font-size:11px;line-height:1.4;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .catalog-status::before {
    content:"";display:block;flex:none;width:5px;height:5px;border-radius:50%;background:currentColor;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .inventory-tile-cost {
    position:relative;inset:auto;display:block;margin:-10px -8px -10px auto;pointer-events:auto;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .inventory-tile-cost .mo-status-trigger {
    align-items:center;justify-items:center;padding:0;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .asset-item-alerts {
    display:flex;flex-wrap:wrap;gap:5px;margin:0;min-width:0;max-width:100%;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .asset-item-alert {
    max-width:100%;margin:0;font-size:12px;line-height:1.4;white-space:normal;overflow-wrap:anywhere;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .inventory-tile-footer {
    grid-column:1/-1;grid-row:3;align-self:end;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);
    align-items:end;gap:8px;min-height:36px;margin:0;padding:0 36px 0 0;border:0;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .quantity {
    gap:5px;font-size:32px;line-height:1.05;font-weight:400;letter-spacing:-1.1px;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .quantity small {
    font-size:11px;line-height:1.4;letter-spacing:0;
  }
  html[data-theme] #content .inventory-page .inventory-reference-warehouse {
    display:block;min-width:0;max-width:100%;color:var(--erp-muted);font-size:11px;line-height:1.4;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .inventory-reference-warehouse {
    padding-bottom:3px;text-align:right;
  }
  html[data-theme] #content .inventory-page .product-card.catalog-card.inventory-reference-card .catalog-item-action-handle {
    inset:auto 8px 8px auto;width:44px;height:44px;border:0;border-radius:50%;background:transparent;color:var(--erp-muted);
  }
  html[data-theme] #content .inventory-page .product-card.catalog-card.inventory-reference-card .catalog-item-action-handle>svg {
    width:22px;height:22px;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .catalog-item-action-handle:is(:hover,[aria-expanded="true"]) {
    background:var(--erp-soft);color:var(--erp-ink);
  }
  /* Hidden controls retain the existing guarded QR flow, invoked by the one visible menu. */
  html[data-theme] #content .inventory-page .inventory-reference-qr[hidden] {display:none!important}
  html[data-theme] #content .inventory-page .inventory-reference-card .inventory-quick-category {
    margin-top:0;border:0;background:transparent;backdrop-filter:none;-webkit-backdrop-filter:none;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .inventory-quick-category select {
    padding-left:0;font-size:12px;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card>.inventory-item-select {
    top:11px;left:11px;
  }
  html[data-theme] #content .inventory-page :is(.inventory-reference-card,.inventory-reference-row)>.inventory-item-select>input {
    width:44px;height:44px;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card>.inventory-item-select>span[aria-hidden="true"] {
    width:30px;height:30px;
  }

  /* List mode uses the same name / price pairing and a single action handle. */
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row {
    grid-template-columns:minmax(0,1fr) 44px;gap:4px;padding:12px 8px;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-mobile-link {
    grid-column:1;grid-row:1;grid-template-columns:44px minmax(0,1fr) minmax(76px,.5fr) minmax(80px,.5fr);
    align-items:center;gap:8px 14px;min-height:88px;padding:4px;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-mobile-image {
    grid-column:1;grid-row:1/3;align-self:start;width:44px;height:44px;border-radius:13px;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-mobile-copy {
    grid-column:2;grid-row:1/3;gap:4px;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-mobile-name {
    font-size:15px;line-height:1.35;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .inventory-list-procurement {
    grid-column:3;grid-row:1;align-self:end;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .inventory-reference-warehouse {
    grid-column:3;grid-row:2;align-self:start;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-mobile-stock {
    grid-column:4;grid-row:1/3;align-self:center;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-mobile-stock>strong {
    font-size:30px;line-height:1.1;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-item-action-handle {
    position:static;grid-column:2;grid-row:1;align-self:center;border:0;background:transparent;color:var(--erp-muted);
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-item-action-handle>svg {
    width:22px;height:22px;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row>.inventory-item-select {
    top:16px;left:12px;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .inventory-list-category {
    grid-column:1/-1;grid-row:2;padding:0 4px 0 62px;
  }
}

@container (max-width:240px) {
  html[data-theme] #content .inventory-page .inventory-reference-card .inventory-tile-footer {
    grid-template-columns:minmax(0,1fr);gap:4px;min-height:0;padding:0;
  }
  html[data-theme] #content .inventory-page .inventory-reference-card .quantity {padding-right:36px;font-size:32px}
  html[data-theme] #content .inventory-page .inventory-reference-card .inventory-reference-warehouse {
    min-height:24px;padding:3px 36px 0 0;text-align:left;
  }
}

@media screen and (max-width:700px) {
  html[data-theme] #content .inventory-page .product-card.catalog-card.inventory-reference-card {
    grid-template-columns:32px minmax(0,1fr);gap:8px;min-height:170px;padding:12px;border-radius:18px;
  }
  html[data-theme] #content .inventory-page .product-card.catalog-card.inventory-reference-card :is(.catalog-media,.asset-card-visual) {
    width:32px;height:32px;border-radius:10px;
  }
  html[data-theme] #content .inventory-page .product-card.catalog-card.inventory-reference-card h3 {font-size:14px}
  html[data-theme] #content .inventory-page .inventory-reference-price {font-size:13px}
  html[data-theme] #content .inventory-page .inventory-reference-card>.inventory-item-select {top:6px;left:6px}
  html[data-theme] #content .inventory-page .inventory-reference-card>.inventory-item-select>span[aria-hidden="true"] {
    width:28px;height:28px;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row {padding:10px 6px}
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-mobile-link {
    grid-template-columns:36px minmax(0,1fr) 62px;gap:5px 10px;min-height:88px;padding:4px;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-mobile-image {
    width:36px;height:36px;border-radius:11px;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-mobile-copy {grid-row:1}
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-mobile-name {font-size:14px}
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-mobile-stock {
    grid-column:3;grid-row:1/3;align-self:center;
  }
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .catalog-mobile-stock>strong {font-size:26px}
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .inventory-list-procurement {display:none}
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .inventory-reference-warehouse {grid-column:2;grid-row:2}
  html[data-theme] #content .inventory-page .inventory-list .inventory-reference-row .inventory-list-category {padding-left:4px}
}
