/* CPQ components that sit in the Stream. Tokens only. See DESIGN-NOTES.md for sizes. */

/* ---------- Status mark: icon + words + colour, never colour alone ---------- */
.mark { display: inline-flex; align-items: center; gap: var(--hba-space-1); font-size: var(--hba-type-size-small); line-height: 1.3; white-space: nowrap; }
.mark.ok { color: var(--hba-status-success); }
.mark.est { color: var(--hba-status-warning); }

/* ---------- Link row: a quiet shortcut above a list ---------- */
.link-row {
  width: 100%; min-height: var(--hba-size-touch); padding: 0; background: none; border: 0; text-align: start;
  display: flex; align-items: center; gap: var(--hba-space-2);
  color: var(--hba-action-link); font-size: var(--hba-type-size-small); font-weight: var(--hba-font-weight-bold);
}

/* ---------- Pick row: one thing you can add, with a counter ----------
   Line 1 is the name, full width up to the control, so a long name does not wrap when Add becomes a counter.
   Lines 2 and 3 sit beside the small plan: the status mark, then the size. Height is 72 px in every state. */
.pick {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: var(--hba-space-2);
  grid-template-areas: "name name ctl" "plan mark ctl" "plan size ctl";
  align-items: center; min-height: 72px; padding: var(--hba-space-2) 0;
  border-top: var(--hba-border-thin) solid var(--hba-line-decorative);
}
.pick .name { grid-area: name; font-weight: var(--hba-font-weight-bold); line-height: 1.25; }
.pick .plan { grid-area: plan; width: 40px; height: 24px; color: var(--hba-text-muted); }
.pick.has .plan { color: var(--hba-action-primary); }
.pick .mark { grid-area: mark; }
.pick .size { grid-area: size; font-size: var(--hba-type-size-small); line-height: 1.3; color: var(--hba-text-muted); white-space: nowrap; }
.pick .ctl { grid-area: ctl; display: flex; justify-content: flex-end; }

/* ---------- Add button (secondary) ---------- */
.add {
  height: var(--hba-size-touch); min-width: 76px; padding: 0 var(--hba-space-4);
  background: var(--hba-surface-page); color: var(--hba-action-secondary-text);
  border: var(--hba-border-thin) solid var(--hba-action-secondary-border); border-radius: var(--hba-radius-control);
  font-weight: var(--hba-font-weight-bold);
}
.add:active { background: var(--hba-action-secondary-pressed-surface); }

/* ---------- Stepper: minus, the number (tap it to type), plus. Each part is 44 x 44 ---------- */
.stepper {
  display: inline-flex; align-items: stretch; height: calc(var(--hba-size-touch) + 2 * var(--hba-border-thin));
  border: var(--hba-border-thin) solid var(--hba-line-control); border-radius: var(--hba-radius-control);
  overflow: hidden; background: var(--hba-surface-page);
}
.stepper button { width: var(--hba-size-touch); border: 0; background: none; display: grid; place-items: center; padding: 0; }
.stepper button:active { background: var(--hba-action-secondary-pressed-surface); }
.stepper button:focus-visible, .stepper input:focus-visible { outline-offset: -3px; }
.stepper .n, .stepper input {
  width: var(--hba-size-touch); border-inline: var(--hba-border-thin) solid var(--hba-line-decorative);
  font-weight: var(--hba-font-weight-bold); font-variant-numeric: tabular-nums;
}
.stepper input {
  border-block: 0; border-radius: 0; padding: 0; text-align: center; font-family: inherit; font-size: var(--hba-type-size-input);
  color: inherit; background: var(--hba-surface-selected);
  -moz-appearance: textfield; appearance: textfield;
}
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Go row: opens another screen ---------- */
.go-row {
  width: 100%; min-height: 56px; padding: var(--hba-space-2) 0; background: none; border: 0; text-align: start;
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: var(--hba-space-2); align-items: center;
  border-top: var(--hba-border-thin) solid var(--hba-line-decorative);
}
.go-row .label { font-weight: var(--hba-font-weight-bold); line-height: 1.25; }
.go-row .lead, .go-row .chev { color: var(--hba-text-muted); display: grid; place-items: center; }
.go-row:active { background: var(--hba-surface-alt); }

/* Right to left: arrows that mean "forward" or "back" flip. Ticks, clocks and warnings do not. */
[dir="rtl"] .chev svg, [dir="rtl"] .quiet > svg, [dir="rtl"] .omni-back[aria-label="Back"] svg, [dir="rtl"] .slide .knob svg { transform: scaleX(-1); }

/* ---------- Undo in place ----------
   After a removal the row keeps its height and shows "Removed 5 · Undo" where the status and size were.
   It stays until that row changes again or the person leaves the screen. Never only in a toast. */
.pick .undone { grid-row: 2 / 4; grid-column: 2; display: flex; align-items: center; gap: var(--hba-space-3); font-size: var(--hba-type-size-small); color: var(--hba-text-muted); }
.undo-link {
  min-height: var(--hba-size-touch); min-width: var(--hba-size-touch); margin: -4px 0; padding: 0 var(--hba-space-2); background: none; border: 0;
  color: var(--hba-action-link); font-size: var(--hba-type-size-body); font-weight: var(--hba-font-weight-bold); text-decoration: underline;
}
.summary .undo-link { margin: -10px 0; }
