/* SYGNAL admin: css/sales.css — the sales track.
 *
 * The sales and money screens on the kit (ui.css): the quote and invoice bodies
 * of the drawer (#pipeline-modal, the frame is S4's), the money forms inside it,
 * the quote composer (artboards/NewQuote.dc.html) and the Discount codes,
 * Trial, Invitation and Upgrade pages. Drawn by index.html's templates and
 * /js/pages/sales-ui.js.
 *
 * Rules for this file (the same as ui.css):
 *   - Mobile-first: the base rules are the phone (< 768 px), then
 *     @media (min-width: 768px), (min-width: 1024px), (min-width: 1280px).
 *     No max-width query.
 *   - Only the kit's tokens (--ui-*); no colour is typed here, except inside the
 *     switch's two data-URI pictures (a url() cannot read a custom property),
 *     which use the kit's own values as ui.css's check does: #C9D1DC
 *     (--ui-line-strong), #2D5FAF (--ui-brand) and white.
 *   - Every target is at least 44 x 44 px; inputs are 16 px below 768.
 *   - Prefixes: ui-sm-* the drawer bodies (sales money), ui-qc-* the composer,
 *     ui-cp-* the create pages, ui-sx-* the shared controls (radio segmented
 *     control, checkbox switch, stepper).
 */

/* Anything this track hides with the hidden attribute stays hidden, whatever
   display its kit class gives it (.ui-btn, .ui-banner and .ui-field set one). */
.ui-sm [hidden], .ui-qc [hidden], .ui-cp [hidden] { display: none !important; }

/* ══ Shared controls ═════════════════════════════════════════════════════ */

/* A segmented control made of radios (a fieldset's value is its checked radio).
   The radio covers its whole option, so the option is the 44 px target. */
.ui-sx-seg .ui-seg__opt > input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.ui-sx-seg .ui-seg__opt > span { position: relative; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ui-sx-seg .ui-seg__opt:has(> input:checked) { color: var(--ui-on-fill); }
.ui-sx-seg .ui-seg__opt:has(> input:checked)::before { background: var(--ui-ink); }
.ui-sx-seg .ui-seg__opt:has(> input:focus-visible) { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.ui-sx-seg .ui-seg__opt:has(> input:disabled) { color: var(--ui-muted); cursor: not-allowed; }
.ui-sx-seg .ui-seg__opt:has(> input:disabled) > input { cursor: not-allowed; }
.ui-sx-seg .ui-seg__opt:has(> input:checked:disabled)::before { background: var(--ui-line-strong); }
.ui-sx-seg .ui-seg__opt:has(> input:checked:disabled) { color: var(--ui-ink); }
@media (hover: hover) {
  .ui-sx-seg .ui-seg__opt:has(> input:checked):hover { color: var(--ui-on-fill); }
  .ui-sx-seg .ui-seg__opt:has(> input:checked:disabled):hover { color: var(--ui-ink); }
}

/* A checkbox drawn as the kit's switch: a 44 x 26 track in a 60 x 44 target. */
input.ui-sx-switch {
  flex: none;
  width: 60px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--ui-radius-control);
  background: transparent no-repeat center / 44px 26px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 26'%3E%3Crect width='44' height='26' rx='13' fill='%23C9D1DC'/%3E%3Ccircle cx='13' cy='13' r='11' fill='%23FFFFFF'/%3E%3C/svg%3E");
  box-shadow: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
input.ui-sx-switch:checked { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 26'%3E%3Crect width='44' height='26' rx='13' fill='%232D5FAF'/%3E%3Ccircle cx='31' cy='13' r='11' fill='%23FFFFFF'/%3E%3C/svg%3E"); }
input.ui-sx-switch:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
input.ui-sx-switch:disabled { cursor: not-allowed; opacity: .5; }

/* A stepper whose value is an input: minus 44 | value 56 | plus 44. */
.ui-sx-stepper { flex: none; }
.ui-sx-stepper .ui-btn--icon { color: var(--ui-slate); }
input.ui-sx-stepper__input {
  width: 56px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--ui-line);
  border-right: 1px solid var(--ui-line);
  border-radius: 0;
  background: var(--ui-surface);
  box-shadow: none;
  color: var(--ui-ink);
  font-family: var(--ui-font);
  font-size: var(--ui-input-size);
  line-height: var(--ui-input-line);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}
input.ui-sx-stepper__input::-webkit-outer-spin-button, input.ui-sx-stepper__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input.ui-sx-stepper__input:focus { outline: 2px solid var(--ui-focus); outline-offset: -2px; border-color: var(--ui-line); box-shadow: none; }
input.ui-sx-stepper__input:disabled, input.ui-sx-stepper__input[readonly] { background: var(--ui-surface-2); color: var(--ui-slate); }

/* ══ The drawer bodies: quote, invoice and the money forms ═══════════════ */
.ui-sm { display: flex; flex-direction: column; gap: 16px; margin: 0; font-family: var(--ui-font); color: var(--ui-ink); }
.ui-sm-head { display: flex; flex-direction: column; gap: 8px; }
.ui-sm-who { margin: 0; font-size: 14px; line-height: 20px; color: var(--ui-slate); overflow-wrap: anywhere; }
.ui-sm-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ui-sm-amount { margin: 0; font-size: 32px; line-height: 40px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ui-sm-code { font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: 0; color: var(--ui-slate); }
.ui-sm-split, .ui-sm-desc { margin: 0; overflow-wrap: anywhere; }
.ui-sm-help { margin: 0; }
.ui-sm-banner { font-size: 14px; line-height: 20px; }
.ui-sm-banner .ui-banner__text { overflow-wrap: anywhere; }
.ui-sm-loading { display: flex; align-items: center; gap: 8px; margin: 0; }

/* Actions: one Primary, a 2 x 2 grid of Secondary (the fourth is More), More's list. */
.ui-sm-acts { display: flex; flex-direction: column; gap: 8px; }
.ui-sm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ui-sm-cell { justify-content: flex-start; min-height: 44px; padding: 6px 12px; font-size: 14px; line-height: 20px; text-align: left; }
.ui-sm-cell .ui-i { width: 18px; height: 18px; }
.ui-sm-cell[aria-expanded="true"] { background: var(--ui-brand-50); border-color: var(--ui-brand); color: var(--ui-ink); }
.ui-sm-more { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 6px; background: var(--ui-surface); border: 1px solid var(--ui-line); border-radius: var(--ui-radius-pop); box-shadow: var(--ui-shadow-1); }
.ui-sm-more > .ui-help { padding: 4px 12px 6px; }
.ui-sm-row { width: 100%; min-height: 56px; color: var(--ui-ink); }
.ui-sm-row .ui-i { color: var(--ui-slate); }
.ui-sm-row > span { overflow-wrap: anywhere; }
/* A link in a cell or a row starts its icon and words at the left like the buttons
   beside it (the drawer's own rule, .ui-pm__body a[href], centres every link). */
.ui-sm a.ui-sm-row[href], .ui-sm a.ui-sm-cell[href] { justify-content: flex-start; }

/* Cards in the body: items, notes, record, commission. */
.ui-sm-card { display: flex; flex-direction: column; gap: 8px; }
.ui-sm-card__title { margin: 0; }
.ui-sm-card--owed { border-color: var(--ui-danger-line); }
.ui-sm-notes { margin: 0; overflow-wrap: anywhere; }
.ui-sm-items { width: 100%; margin: 0; border-collapse: collapse; font-family: var(--ui-font); font-size: 15px; line-height: 22px; color: var(--ui-ink); }
.ui-sm-items th { padding: 0 0 6px; border-bottom: 1px solid var(--ui-line); font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ui-slate); text-align: left; }
.ui-sm-items td { padding: 8px 0; vertical-align: top; overflow-wrap: anywhere; }
.ui-sm-items tbody td { border-bottom: 1px solid var(--ui-line); }
.ui-sm-items tfoot td { padding: 6px 0; }
.ui-sm-items th.ui-sm-num, .ui-sm-items td.ui-sm-num { padding-left: 12px; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; overflow-wrap: normal; }
.ui-sm-items .ui-sm-strong td { font-weight: 600; }
.ui-sm-items .ui-sm-rule td { padding-top: 10px; border-top: 1px solid var(--ui-line); }
.ui-sm-items .ui-sm-quiet td { font-size: 13px; line-height: 18px; color: var(--ui-muted); }
.ui-sm-items .ui-sm-good td { color: var(--ui-success); }
.ui-sm-items .ui-sm-total td { padding-top: 10px; border-top: 2px solid var(--ui-ink); font-weight: 700; }
.ui-sm-dl { display: grid; grid-template-columns: minmax(0, max-content) minmax(0, 1fr); gap: 6px 16px; margin: 0; font-size: 14px; line-height: 20px; }
.ui-sm-dl__row { display: contents; }
.ui-sm-dl dt { margin: 0; font-weight: 600; color: var(--ui-slate); }
.ui-sm-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.ui-sm-id { font-size: 13px; line-height: 18px; overflow-wrap: anywhere; }

/* The dealer's commission on a won quote. */
.ui-sm-comm { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.ui-sm-comm-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--ui-line); }
.ui-sm-comm-row:first-child { padding-top: 4px; border-top: 0; }
.ui-sm-comm-who { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; overflow-wrap: anywhere; }
.ui-sm-comm-amt { font-weight: 600; }
.ui-sm-settle { width: 100%; }
.ui-sm-commission:empty { display: none; }

.ui-sm-danger .ui-btn { width: 100%; }

/* The money forms. */
.ui-sm-fields { display: flex; flex-direction: column; gap: 16px; }
.ui-sm-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.ui-sm-fieldset > legend:not(.ui-sr-only) { float: left; width: 100%; padding: 0; }
.ui-sm-fieldset > legend + * { clear: both; }
.ui-sm-opt { font-weight: 500; color: var(--ui-muted); }
.ui-sm-readonly { display: flex; align-items: center; min-height: 44px; margin: 0; padding: 0 14px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-control); background: var(--ui-surface-2); color: var(--ui-ink); overflow-wrap: anywhere; }
textarea.ui-input.ui-sm-message { min-height: 220px; }
.ui-sm-checkrow { padding-right: 0; }
.ui-sm-override { display: flex; align-items: flex-start; gap: 0; padding: 0 12px 0 12px; border: 1px solid var(--ui-warning); border-radius: var(--ui-radius-control); background: var(--ui-warning-50); font-size: 14px; line-height: 20px; color: var(--ui-ink); cursor: pointer; }
.ui-sm-override > span { padding: 12px 0 12px 8px; }
.ui-sm-error { white-space: pre-wrap; font-size: 14px; line-height: 20px; }
.ui-sm-back { align-self: flex-start; margin-left: -12px; }
.ui-sm-doc { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 14px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-control); background: var(--ui-surface-2); }
.ui-sm-doc__title { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.ui-sm-doc .ui-sm-items { font-size: 14px; line-height: 20px; }
.ui-sm-doc__foot { margin: 0; padding-top: 8px; border-top: 1px solid var(--ui-line); font-size: 13px; line-height: 18px; color: var(--ui-muted); }
.ui-sm-result { display: flex; flex-direction: column; gap: 12px; }
.ui-sm-links { display: flex; flex-direction: column; gap: 8px; }

/* The sticky footer of a form: Cancel and the action, always in reach. It bleeds to
   the drawer's edges (the drawer body pads 16 / 24 and keeps the home indicator). */
.ui-sm-foot {
  position: sticky;
  bottom: calc(-24px - var(--ui-safe-bottom));
  z-index: 2;
  display: grid;
  /* Cancel a third, the action two: a money action names its amount and needs the room. */
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 8px;
  margin: 8px -16px calc(-24px - var(--ui-safe-bottom));
  padding: 12px 16px calc(12px + var(--ui-safe-bottom));
  background: var(--ui-surface);
  border-top: 1px solid var(--ui-line);
}
.ui-sm-foot .ui-btn { width: 100%; min-width: 0; }
.ui-sm-why { grid-column: 1 / -1; margin: 0; }
.ui-sm-why:empty { display: none; }

@media (min-width: 768px) {
  .ui-sm-amount { font-size: 28px; line-height: 34px; }
  .ui-sm-row { min-height: 44px; }
  .ui-sm-comm-row { flex-direction: row; align-items: center; justify-content: space-between; }
  .ui-sm-settle { width: auto; flex: none; }
  .ui-sm-foot { bottom: calc(-24px - var(--ui-safe-bottom)); margin: 8px -24px calc(-24px - var(--ui-safe-bottom)); padding: 16px 24px calc(16px + var(--ui-safe-bottom)); }
}

/* ══ The quote composer ═════════════════════════════════════════════════ */
/* Phone and tablet: one column, a sticky total + Send above the tab bar.
   From 1024: the form beside a sticky summary card that holds Send. */
.ui-qc { display: flex; flex-direction: column; gap: 16px; padding-bottom: calc(96px + var(--ui-safe-bottom)); font-family: var(--ui-font); color: var(--ui-ink); }
.ui-qc-banner .ui-banner__text { overflow-wrap: anywhere; }
.ui-qc-layout { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.ui-qc-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ui-qc-sec { display: flex; flex-direction: column; gap: 20px; min-width: 0; padding: 16px; }
.ui-qc-sec__head { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.ui-qc-sec__head--wrap { flex-wrap: wrap; }
.ui-qc-no { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: var(--ui-radius-pill); background: var(--ui-brand-50); color: var(--ui-brand); font-size: 14px; line-height: 20px; font-weight: 700; }
.ui-qc-title { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.ui-qc-cover { flex: 1 1 100%; }
.ui-qc-cover .ui-seg { display: flex; width: 100%; }
.ui-qc-cover .ui-seg__opt { flex: 1 1 0; min-width: 0; padding: 0 8px; }
.ui-qc-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.ui-qc-full { grid-column: 1 / -1; }
.ui-qc-fs { min-width: 0; margin: 0; padding: 0; border: 0; }
/* (a visually hidden legend keeps the kit's 1 px box: a 100% float would push the
   page sideways from a narrow fieldset) */
.ui-qc-fs > legend:not(.ui-sr-only) { float: left; width: 100%; padding: 0; }
.ui-qc-fs > legend + * { clear: both; }
.ui-qc-fs > .ui-help { display: block; }
.ui-qc-opt { font-weight: 500; color: var(--ui-muted); }
.ui-qc-seg2 { display: flex; width: 100%; }
.ui-qc-seg2 .ui-seg__opt { flex: 1 1 0; min-width: 0; padding: 0 8px; }
.ui-qc-lock { display: flex; align-items: flex-start; gap: 6px; }
.ui-qc-lock .ui-i { margin-top: 2px; color: var(--ui-slate); }
textarea.ui-input.ui-qc-domains { min-height: 72px; }
.ui-qc-block { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ui-qc-block > .ui-h3, .ui-qc-block > .ui-help { margin: 0; }
.ui-qc-good { color: var(--ui-success); font-weight: 600; }

/* Tier: three radio cards (two across the phone keeps rows full: three are a column). */
.ui-qc-tiers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ui-qc-rc { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 104px; margin: 0; padding: 12px 16px; border: 1.5px solid var(--ui-line-strong); border-radius: var(--ui-radius-pop); background: var(--ui-surface); color: var(--ui-ink); cursor: pointer; }
.ui-qc-rc:has(input:checked) { border-color: var(--ui-brand); background: var(--ui-brand-50); box-shadow: inset 0 0 0 0.5px var(--ui-brand); }
.ui-qc-rc:has(input:focus-visible) { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.ui-qc-rc:has(input:disabled) { cursor: not-allowed; }
.ui-qc-rc__top { display: flex; align-items: center; gap: 8px; }
.ui-qc-rc__name { font-size: 16px; line-height: 24px; font-weight: 600; }
/* The radio covers the whole card (its target); the dot draws its state. */
.ui-qc-rc__input { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.ui-qc-rc__input:disabled { cursor: not-allowed; }
.ui-qc-rc__dot { flex: none; width: 20px; height: 20px; margin-left: auto; border-radius: var(--ui-radius-pill); background: var(--ui-surface); box-shadow: inset 0 0 0 1.5px var(--ui-input); }
.ui-qc-rc:has(.ui-qc-rc__input:checked) .ui-qc-rc__dot { box-shadow: inset 0 0 0 6px var(--ui-brand); }
.ui-qc-rc__price { font-size: 20px; line-height: 28px; font-weight: 700; }
.ui-qc-rc__per { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--ui-slate); }
.ui-qc-rc__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 24px; }
@media (hover: hover) { .ui-qc-rc:hover { border-color: var(--ui-brand); } }

/* The department-size guide: four 44 px buttons in a 2 x 2 grid. */
.ui-qc-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.ui-qc-guide__btn { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; min-height: 44px; margin: 0; padding: 0 12px; border: 1.5px solid var(--ui-line-strong); border-radius: var(--ui-radius-control); background: var(--ui-surface); color: var(--ui-ink); font-family: var(--ui-font); font-size: 14px; line-height: 20px; font-weight: 600; cursor: pointer; }
.ui-qc-guide__btn:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.ui-qc-guide__size { min-width: 0; font-weight: 500; color: var(--ui-slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (hover: hover) { .ui-qc-guide__btn:hover { border-color: var(--ui-brand); } }

/* Add-on and hardware rows. On the phone each row stacks: name, then its controls. */
.ui-qc-list { display: flex; flex-direction: column; margin: 0; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-control); background: var(--ui-surface); }
.ui-qc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; padding: 12px; }
.ui-qc-row + .ui-qc-row { border-top: 1px solid var(--ui-line); }
.ui-qc-row__text { display: flex; flex-direction: column; flex: 1 1 160px; min-width: 0; margin: 0; cursor: default; }
label.ui-qc-row__text { cursor: pointer; }
.ui-qc-row__name { font-size: 15px; line-height: 22px; font-weight: 600; color: var(--ui-ink); }
.ui-qc-row--addon .ui-sx-switch { margin-left: -8px; }
.ui-qc-row--addon .ui-qc-row__text { flex: 1 1 0; }
.ui-qc-row--hw .ui-qc-row__text, .ui-qc-row--ship .ui-qc-row__text { flex: 1 1 100%; }
.ui-qc-row--hw .ui-qc-fs { flex: 1 1 100%; }
.ui-qc-row--ship .ui-qc-fs { flex: 1 1 100%; }
.ui-qc-price { flex: 1 1 120px; min-width: 120px; }
.ui-qc-hold { display: inline-flex; align-items: center; gap: 0; flex: 1 1 100%; min-height: 44px; margin: 0; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ui-ink); cursor: pointer; }
/* The kit's 44 px check box with its 20 px glyph flush left and 8 px before the words. */
.ui-qc-hold > input.ui-check { margin: 0 -4px 0 -12px; }
/* On the phone an add-on is two lines: the switch and its name, then its price
   across the row (beside the name it squeezed the words into a column). */
.ui-qc-row--addon .ui-qc-price { flex: 1 1 100%; }

/* Term and price. */
.ui-qc-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ui-qc-readout { display: flex; align-items: center; min-height: 44px; font-size: 20px; line-height: 28px; font-weight: 700; }
.ui-qc-labelrow { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; margin: 0 0 6px; }
.ui-qc-labelrow > .ui-label { margin: 0; }
.ui-qc-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ui-muted); }
.ui-qc-tag.is-set { font-weight: 600; color: var(--ui-brand); }
input.ui-input.ui-qc-disc { flex: 1 1 96px; width: auto; min-width: 96px; text-align: right; }

/* The summary: the client's lines and totals, then Send. */
.ui-qc-aside { min-width: 0; }
.ui-qc-summary { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.ui-qc-sum__head { display: flex; flex-direction: column; gap: 2px; }
.ui-qc-sum__head .ui-small { overflow-wrap: anywhere; }
.ui-qc-sum__note { margin: 0; }
.ui-qc-lines, .ui-qc-totals { display: flex; flex-direction: column; gap: 6px; }
.ui-qc-totals { padding-top: 12px; border-top: 1px solid var(--ui-line); }
.ui-qc-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0; font-size: 14px; line-height: 20px; color: var(--ui-slate); }
.ui-qc-line > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.ui-qc-amt { flex: none; font-weight: 600; color: var(--ui-ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ui-qc-line--good, .ui-qc-line--good .ui-qc-amt { color: var(--ui-success); }
.ui-qc-line--strong { font-weight: 600; color: var(--ui-ink); }
.ui-qc-line--strong .ui-qc-amt { font-weight: 700; }
.ui-qc-line--empty { margin: 0; }
.ui-qc-saved { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--ui-line); }
.ui-qc-saved > * { margin: 0; }
.ui-qc-saved__title { display: flex; align-items: flex-start; gap: 8px; }
.ui-qc-saved__title .ui-i { margin-top: 2px; color: var(--ui-success); }
.ui-qc-saved__title--danger, .ui-qc-saved__title--danger .ui-i { color: var(--ui-danger); }
.ui-qc .msg { margin-top: 0; }

/* Send: below 1024 a bar fixed above the tab bar (and the home indicator). */
.ui-qc-send {
  position: fixed;
  z-index: 34;
  left: calc(var(--ui-nav-w) + var(--ui-safe-left));
  right: 0;
  /* (the tab bar is its height plus a 1 px top rule) */
  bottom: calc(var(--ui-tabbar-h) + 1px + var(--ui-safe-bottom));
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 12px calc(16px + var(--ui-safe-right)) 12px 16px;
  background: var(--ui-surface);
  border-top: 1px solid var(--ui-line);
  box-shadow: 0 -1px 0 var(--ui-line);
}
.ui-qc-total { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; flex: 1 1 auto; min-width: 0; min-height: 44px; margin: 0; padding: 0 8px; border: 0; border-radius: var(--ui-radius-control); background: transparent; color: var(--ui-ink); font-family: var(--ui-font); text-align: left; cursor: pointer; }
.ui-qc-total:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.ui-qc-total__label { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--ui-slate); }
.ui-qc-total__value { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; line-height: 24px; font-weight: 700; }
.ui-qc-total__go { display: none; }
.ui-qc-submit { flex: none; }
.ui-qc-send__help { display: none; }
@media (hover: hover) { .ui-qc-total:hover { background: var(--ui-bg); } }

@media (min-width: 768px) {
  .ui-qc { gap: 24px; padding-bottom: calc(88px + var(--ui-safe-bottom)); }
  .ui-qc-layout, .ui-qc-main { gap: 24px; }
  .ui-qc-sec { padding: 24px; }
  .ui-qc-title { font-size: 18px; }
  .ui-qc-sec__head--wrap { flex-wrap: nowrap; }
  .ui-qc-cover { flex: 0 1 auto; margin-left: auto; }
  .ui-qc-cover .ui-seg { display: inline-flex; width: auto; }
  .ui-qc-cover .ui-seg__opt { flex: none; padding: 0 14px; }
  .ui-qc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
  .ui-qc-tiers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ui-qc-row { flex-wrap: nowrap; min-height: 64px; padding: 10px 16px; }
  .ui-qc-row--hw .ui-qc-row__text, .ui-qc-row--ship .ui-qc-row__text { flex: 1 1 auto; }
  .ui-qc-row--hw .ui-qc-fs, .ui-qc-row--ship .ui-qc-fs { flex: none; }
  .ui-qc-row--hw .ui-qc-seg2, .ui-qc-row--ship .ui-qc-seg2 { width: auto; }
  .ui-qc-row--hw .ui-qc-seg2 .ui-seg__opt, .ui-qc-row--ship .ui-qc-seg2 .ui-seg__opt { flex: none; padding: 0 14px; }
  /* room for $ 9,999.99 between the $ and the unit (140 cut the cents off) */
  .ui-qc-price, .ui-qc-row--addon .ui-qc-price { flex: none; width: 168px; min-width: 168px; }
  .ui-qc-price input.ui-input { padding-right: 44px; }
  .ui-qc-hold { flex: none; white-space: nowrap; }
  .ui-qc-send { bottom: 0; padding: 12px calc(24px + var(--ui-safe-right)) calc(12px + var(--ui-safe-bottom)) 24px; }
  /* The total at the left, what Send will do beside Send at the right. */
  .ui-qc-total { flex: none; flex-direction: row; align-items: center; justify-content: flex-start; gap: 8px; }
  .ui-qc-total__label { font-size: 14px; line-height: 20px; }
  .ui-qc-send__help { display: block; order: 1; flex: 1 1 0; min-width: 0; margin: 0; text-align: right; }
  .ui-qc-submit { order: 2; }
}
/* 1024 up: two columns, the summary sticky beside the form, Send inside it. */
@media (min-width: 1024px) {
  .ui-qc { padding-bottom: 0; }
  .ui-qc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .ui-qc-aside { position: sticky; top: calc(var(--ui-topbar-h) + 24px); }
  .ui-qc-summary { padding: 20px; gap: 16px; }
  .ui-qc-send { position: static; z-index: auto; flex-direction: column; align-items: stretch; gap: 8px; padding: 16px 0 0; border-top: 1px solid var(--ui-line); background: transparent; box-shadow: none; }
  .ui-qc-total { flex-direction: column; align-items: flex-start; gap: 2px; padding: 0; cursor: default; }
  .ui-qc-total__label { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--ui-muted); }
  .ui-qc-total__value { font-size: 28px; line-height: 34px; letter-spacing: -0.01em; white-space: normal; overflow-wrap: anywhere; }
  .ui-qc-submit { order: 0; width: 100%; }
  .ui-qc-send__help { order: 0; text-align: center; }
}
@media (min-width: 1024px) and (hover: hover) { .ui-qc-total:hover { background: transparent; } }
@media (min-width: 1280px) {
  .ui-qc-layout { grid-template-columns: minmax(0, 1fr) 360px; }
}

/* ══ The create pages: Discount codes, Trial, Invitation, Upgrade ═══════ */
.ui-cp { display: flex; flex-direction: column; gap: 16px; max-width: 760px; font-family: var(--ui-font); color: var(--ui-ink); }
.ui-cp-card { display: flex; flex-direction: column; gap: 20px; min-width: 0; margin: 0; padding: 16px; }
.ui-cp-card > .ui-h3 { margin: 0; }
.ui-cp-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.ui-cp-full { grid-column: 1 / -1; }
.ui-cp-fs { min-width: 0; margin: 0; padding: 0; border: 0; }
.ui-cp-fs > legend:not(.ui-sr-only) { float: left; width: 100%; padding: 0; }
.ui-cp-fs > legend + * { clear: both; }
.ui-cp-opt { font-weight: 500; color: var(--ui-muted); }
input.ui-input.ui-cp-code { text-transform: uppercase; font-family: var(--ui-font-mono); letter-spacing: 0.04em; }
input.ui-input.ui-cp-code::placeholder { text-transform: none; font-family: var(--ui-font); letter-spacing: 0; }
.ui-cp-foot { display: flex; flex-direction: column; gap: 8px; }
.ui-cp-submit { width: 100%; }
.ui-cp-note .ui-banner__text { font-size: 14px; line-height: 20px; }
.ui-cp-list { margin: 4px 0 0; padding-left: 18px; }
.ui-cp-switches { display: flex; flex-direction: column; }
.ui-cp-switchrow { display: flex; align-items: center; gap: 4px; min-height: 64px; padding: 8px 0; }
.ui-cp-switches > .ui-cp-switchrow + .ui-cp-switchrow { border-top: 1px solid var(--ui-line); }
.ui-cp-switchrow .ui-sx-switch { margin-left: -8px; }
.ui-cp-switchrow__text { display: flex; flex-direction: column; min-width: 0; margin: 0; cursor: pointer; }
.ui-cp-file { display: none; }
.ui-cp-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 120px; padding: 16px; border: 1.5px dashed var(--ui-line-strong); border-radius: var(--ui-radius-control); background: var(--ui-surface-2); text-align: center; }
.ui-cp-drop.is-over, .ui-cp-drop.is-set { border-color: var(--ui-brand); background: var(--ui-brand-50); }
.ui-cp-drop__img { display: block; max-width: 120px; max-height: 80px; border-radius: 8px; }
.ui-cp .msg { margin-top: 0; }
.ui-cp-result__head { display: flex; align-items: center; gap: 12px; }
.ui-cp-result__head > .ui-h3 { margin: 0; }
.ui-cp-key { overflow-wrap: anywhere; }
.ui-cp-result > .ui-btn { align-self: flex-start; }
.ui-cp-pct { max-width: 160px; }

/* Discount codes: chips, then a card per code. */
.ui-cp-codes { display: flex; flex-direction: column; gap: 12px; }
.ui-cp-codes__head { display: flex; flex-direction: column; gap: 12px; }
.ui-cp-codes__head > .ui-h3 { margin: 0; }
.ui-cp-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ui-cp-chips[hidden] { display: none; }
.ui-cp-chips .ui-chip { width: 100%; min-width: 0; padding: 0 10px; }
.ui-cp-loading { display: flex; align-items: center; gap: 8px; font-size: 14px; line-height: 20px; color: var(--ui-slate); }
.ui-cp-codelist { display: flex; flex-direction: column; gap: 12px; }
.ui-cp-codelist[data-show="active"] > [data-promo-state="inactive"],
.ui-cp-codelist[data-show="inactive"] > [data-promo-state="active"] { display: none; }
.ui-cp-code { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.ui-cp-code__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.ui-cp-code__name { font-size: 16px; line-height: 24px; font-weight: 700; overflow-wrap: anywhere; }
.ui-cp-code__discount { margin-left: auto; font-size: 15px; line-height: 22px; font-weight: 600; }
.ui-cp-code__meta { margin: 0; overflow-wrap: anywhere; }
.ui-cp-code__act { align-self: stretch; }
.ui-cp-empty { margin: 0; text-align: center; }
.ui-cp-retry { align-self: flex-start; margin-top: 12px; }

/* Upgrade: search, results, the chosen customer. */
.ui-cp-search { width: 100%; }
.ui-cp-search + .ui-help { margin-top: -12px; }
.ui-cp-results:empty { display: none; }
.ui-cp-results__note { margin: 0; }
.ui-cp-resultlist { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ui-cp-result { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin: 0; padding: 8px 12px; border: 1px solid var(--ui-line); border-radius: var(--ui-radius-control); background: var(--ui-surface); color: var(--ui-ink); font-family: var(--ui-font); text-align: left; cursor: pointer; }
.ui-cp-result:focus-visible { outline: 2px solid var(--ui-focus); outline-offset: 2px; }
.ui-cp-result__text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.ui-cp-result__name { font-size: 15px; line-height: 22px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-cp-result__text .ui-small { overflow-wrap: anywhere; }
@media (hover: hover) { .ui-cp-result:hover { border-color: var(--ui-brand); background: var(--ui-bg); } }
.ui-cp-org { gap: 12px; }
.ui-cp-org__head { display: flex; align-items: center; gap: 12px; }
.ui-cp-org__logo { flex: none; width: 40px; height: 40px; border-radius: 8px; object-fit: contain; }
.ui-cp-org__text { display: flex; flex-direction: column; min-width: 0; }
.ui-cp-org__text > p { margin: 0; overflow-wrap: anywhere; }

/* The legacy result messages (.msg) on these screens, in the kit's banner look. */
.ui-cp .msg, .ui-qc .msg { padding: 12px 16px; border-radius: var(--ui-radius-control); font-family: var(--ui-font); font-size: 15px; line-height: 22px; overflow-wrap: anywhere; }
.ui-cp .msg.success, .ui-qc .msg.success { border: 1px solid transparent; background: var(--ui-success-50); color: var(--ui-ink); }
.ui-cp .msg.error, .ui-qc .msg.error { border: 1px solid var(--ui-danger-line); background: var(--ui-danger-50); color: var(--ui-ink); }
.ui-cp .msg.info, .ui-qc .msg.info { border: 1px solid transparent; background: var(--ui-brand-50); color: var(--ui-ink); }

@media (min-width: 768px) {
  .ui-cp { gap: 24px; }
  .ui-cp-card { padding: 24px; }
  .ui-cp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
  .ui-cp-foot { flex-direction: row; justify-content: flex-end; }
  .ui-cp-submit { width: auto; }
  .ui-cp-codes__head { flex-direction: row; align-items: center; justify-content: space-between; }
  .ui-cp-chips { display: flex; }
  .ui-cp-chips .ui-chip { width: auto; padding: 0 16px; }
  .ui-cp-code { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 16px; padding: 16px 20px; }
  .ui-cp-code__head { flex: 1 1 320px; }
  .ui-cp-code__meta { flex: 1 1 100%; order: 3; }
  .ui-cp-code__act { align-self: center; order: 2; }
}
