/* Cart and order history: one view, matching the existing restrained purchase UI. */
.workspace-app .robot-feature-list .preview-locked-status:not(:disabled) { pointer-events: auto; cursor: pointer; }
.workspace-cart-history-layout {
  --orders-surface: var(--color-canvas-white, #fff);
  --orders-border: var(--color-ash, #e5e5e5);
  --orders-text: var(--color-charcoal, #171717);
  --orders-muted: var(--color-steel, #525252);
  --orders-font-body: 16px;
  --orders-font-emphasis: 18px;
  --orders-font-heading: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  color: var(--orders-text);
}
.workspace-cart-history-layout .workspace-cart-panel { width: 100%; margin: 0; min-width: 0; }
.workspace-cart-history-layout .workspace-cart-panel > header { min-height: 44px; padding: 2px 0 10px; box-sizing: border-box; align-items: flex-start; }
.workspace-cart-history-layout .workspace-cart-panel > header h3 { font-size: var(--orders-font-heading); font-weight: 600; line-height: 1.3; }
.workspace-cart-history-layout .workspace-cart-item { gap: 12px; padding: 12px 0; }
.workspace-cart-history-layout .workspace-cart-item-copy { align-self: start; }
.workspace-cart-history-layout .workspace-cart-item-copy strong { font-size: var(--orders-font-emphasis); font-weight: 600; }
.workspace-cart-history-layout .workspace-cart-item-copy span { font-size: var(--orders-font-body); color: var(--orders-muted); }
.workspace-cart-history-layout .workspace-cart-item-price { font-size: var(--orders-font-emphasis); font-weight: 600; }
.workspace-cart-history-layout .workspace-cart-quantity { height: 40px; grid-template-columns: 36px 36px 36px; }
.workspace-cart-history-layout .workspace-cart-quantity button { width: 36px; height: 40px; font-size: 20px; color: var(--orders-text); }
.workspace-cart-history-layout .workspace-cart-quantity output { font-size: var(--orders-font-body); color: var(--orders-text); }
.workspace-cart-history-layout .workspace-cart-remove { font-size: var(--orders-font-body); color: var(--orders-muted); }
.workspace-cart-history-layout .workspace-cart-panel > footer { padding-top: 12px; gap: 14px; }
.workspace-cart-history-layout .workspace-cart-panel > footer { flex-wrap: wrap; }
.workspace-cart-history-layout .workspace-cart-panel > footer [data-cart-cancel] { min-width: 76px; background: var(--orders-surface); color: var(--orders-text); border-color: var(--orders-border); }
.workspace-trade-code { flex: 1 0 100%; min-width: 0; display: grid; gap: 10px; }
.workspace-trade-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.workspace-cart-history-layout .workspace-cart-panel > footer .workspace-trade-heading strong { font-size: 16px; font-weight: 600; }
.workspace-cart-history-layout .workspace-trade-heading span { font-size: 16px; color: var(--orders-muted); font-variant-numeric: tabular-nums; }
.workspace-trade-copy-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.workspace-trade-copy-row input { width: 100%; min-width: 0; box-sizing: border-box; min-height: 48px; border: 1px solid var(--orders-border); border-radius: 8px; padding: 6px 12px; background: var(--orders-surface); color: var(--orders-text); font: inherit; font-size: 26px; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.workspace-cart-history-layout .workspace-trade-code button { min-width: 76px; min-height: 48px; padding: 0 14px; background: var(--orders-surface); color: var(--orders-text); border-color: var(--orders-border); }
.workspace-trade-note, .workspace-trade-feedback { margin: 0; color: var(--orders-muted); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.workspace-trade-feedback { color: var(--orders-text); }
.workspace-cart-history-layout .workspace-cart-panel > footer button:disabled { opacity: .5; cursor: not-allowed; }
.workspace-trade-code input:focus-visible { outline: 2px solid var(--color-electric-blue); outline-offset: 2px; }

.workspace-cart-history-layout .workspace-cart-panel > footer span { font-size: var(--orders-font-body); color: var(--orders-muted); }
.workspace-cart-history-layout .workspace-cart-panel > footer strong { font-size: var(--orders-font-heading); font-weight: 600; }
.workspace-cart-history-layout .workspace-cart-panel > footer button { font-size: var(--orders-font-body); font-weight: 600; }
.workspace-cart-history-layout .workspace-cart-panel > footer:has(.workspace-trade-inline) { display: block; padding-top: 12px; }
.workspace-cart-panel > footer:has(.workspace-trade-inline) > :not(.workspace-trade-inline) { display: none !important; }
.workspace-cart-history-layout .workspace-trade-inline { display: block; }
.workspace-trade-sentence { margin: 0; color: var(--orders-text); font-size: 20px; line-height: 28px; overflow-wrap: anywhere; }
.workspace-trade-sentence > span:first-child { display: block; margin-bottom: 2px; line-height: 28px; }
.workspace-cart-history-layout .workspace-cart-panel > footer .workspace-trade-sentence span,
.workspace-cart-history-layout .workspace-cart-panel > footer .workspace-trade-sentence strong { color: inherit; font-size: inherit; }
.workspace-cart-history-layout .workspace-cart-panel > footer .workspace-trade-sentence > span:first-child { font-size: 22px; font-weight: 600; }
.workspace-trade-sentence > span:first-child, .workspace-trade-sentence [data-trade-code] { white-space: nowrap; }
.workspace-cart-history-layout .workspace-cart-panel > footer .workspace-trade-inline [data-trade-code] { display: inline-block; box-sizing: border-box; min-width: 0; height: 26px; min-height: 26px; margin: 0; padding: 0 6px; border: 1px solid var(--orders-border); border-radius: 5px; background: var(--orders-surface); color: inherit; font: inherit; line-height: 24px; font-variant-numeric: tabular-nums; white-space: nowrap; user-select: text; cursor: pointer; }
.workspace-trade-copy-hint { white-space: nowrap; }
.workspace-cart-history-layout .workspace-cart-list { border-top: 0; }
.workspace-cart-history-layout .workspace-cart-empty { min-height: 174px; border-top: 0; }
.workspace-cart-history-layout .workspace-cart-empty span { font-size: var(--orders-font-body); color: var(--orders-muted); }
.workspace-order-history { min-width: 0; border-top: 1px solid var(--orders-border); padding-top: 24px; }
.workspace-order-history > header { min-height: 44px; padding: 2px 0 10px; box-sizing: border-box; }
.workspace-order-history h3 { margin: 0; font-size: var(--orders-font-heading); font-weight: 600; line-height: 1.3; }
[data-commerce-history-controls] button { min-height: 36px; padding: 6px 12px; border: 1px solid var(--orders-border); border-radius: 8px; background: var(--orders-surface); color: var(--orders-text); font: inherit; font-size: var(--orders-font-body); cursor: pointer; }
[data-commerce-history-controls] button:disabled { opacity: .5; cursor: not-allowed; }
[data-commerce-history-controls] button:focus-visible { outline: 2px solid var(--color-electric-blue); outline-offset: 2px; }
.workspace-order-table-wrap { overflow-x: auto; background: var(--orders-surface); }
.workspace-order-table-wrap:focus-visible { outline: 2px solid var(--color-electric-blue, #2563eb); outline-offset: 3px; }
.workspace-order-table { width: 100%; min-width: 480px; border-collapse: collapse; text-align: left; font-size: var(--orders-font-body); font-variant-numeric: tabular-nums; }
.workspace-order-table th { padding: 12px 8px; color: var(--orders-muted); font-size: var(--orders-font-emphasis); line-height: 1.4; font-weight: 600; white-space: nowrap; vertical-align: top; border-bottom: 0; }
.workspace-order-table th:first-child { padding-left: 0; }
.workspace-order-table th:last-child, .workspace-order-table td:last-child { padding-right: 0; }
.workspace-order-table td:first-child:not(.workspace-order-empty) { padding-left: 0; }
.workspace-order-table td { padding: 13px 8px; line-height: 1.5; }
.workspace-order-table td.workspace-order-empty { height: 64px; text-align: center; color: var(--orders-muted); font-size: var(--orders-font-body); }
@media (min-width: 1150px) {
  .workspace-cart-history-layout { grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 20px; min-height: 246px; }
  [data-preview-product-catalog] .workspace-cart-history-layout { min-height: 100%; }
  .workspace-cart-history-layout .workspace-cart-panel { display: flex; flex-direction: column; }
  .workspace-cart-history-layout .workspace-cart-empty { flex: 1; }
  .workspace-cart-history-layout .workspace-cart-panel > footer { margin-top: auto; }
  .workspace-order-history { border-top: 0; padding-top: 0; border-left: 1px solid var(--orders-border); padding-left: 20px; }
  .workspace-cart-history-layout:has(.workspace-cart-empty) .workspace-order-history { display: flex; flex-direction: column; }
  .workspace-cart-history-layout:has(.workspace-cart-empty) .workspace-order-table-wrap { position: relative; flex: 1; }
  .workspace-cart-history-layout:has(.workspace-cart-empty) .workspace-order-empty { position: absolute; top: 50%; left: 0; width: 100%; height: auto; box-sizing: border-box; transform: translateY(-50%); }
}

@media (min-width: 1150px) {
  [data-preview-product-catalog] .workspace-cart-history-layout { height: 100%; min-height: 0; }
  [data-preview-product-catalog] .workspace-cart-panel { min-height: 0; overflow: hidden; }
  [data-preview-product-catalog] .workspace-cart-panel > header,
  [data-preview-product-catalog] .workspace-cart-panel > footer { flex: 0 0 auto; }
  [data-preview-product-catalog] .workspace-cart-list { min-height: 0; flex: 1 1 auto; overflow-y: auto; }
  [data-preview-product-catalog] .workspace-order-history { display: flex; flex-direction: column; min-height: 0; }
  [data-preview-product-catalog] .workspace-order-history > header { flex: 0 0 auto; }
  [data-preview-product-catalog] .workspace-order-table-wrap { min-height: 0; overflow-y: auto; }
}
