/* ==========================================================================
   UA Living Spec Book: change orders (section type change-orders, sb-co).
   Decision cards with signed cost-delta chips plus a summary strip of
   pending count and approved running total. Mirrors the approvals card
   look; the pending actions row keeps the shared .sb-approval__actions
   class so it inherits its layout from sections.css and stays strippable
   for studio users. Consumes tokens from css/tokens.css only.
   ========================================================================== */

.sb-co {
  display: grid;
  gap: var(--ua-s5);
}

/* ---------------------------- summary strip ---------------------------- */

.sb-co__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ua-s4);
  max-width: 540px;
}

.sb-co__note {
  margin: 0;
  max-width: 64ch;
  font-weight: 200;
  line-height: 1.6;
}

/* ------------------------------- cards ------------------------------- */

.sb-co__cards {
  display: grid;
  gap: var(--ua-s4);
}

.sb-co__card {
  display: grid;
  gap: var(--ua-s3);
  padding: var(--ua-s5) var(--ua-s6);
}

.sb-co__body {
  display: grid;
  gap: var(--ua-s3);
}

.sb-co__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--ua-s2) var(--ua-s3);
}

.sb-co__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: var(--ua-font-display);
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ua-text-strong);
}

.sb-co__card p {
  margin: 0;
  max-width: 64ch;
  font-weight: 200;
  line-height: 1.6;
}

.sb-co__card .u-muted {
  font-size: var(--ua-fs-small);
}

.sb-co__img,
.sb-co__thumb {
  display: block;
  width: 140px;
  height: 100px;
  object-fit: cover;
  border-radius: var(--ua-radius);
  background: var(--ua-line-soft);
}

.sb-co__thumb {
  padding: 0;
  border: 0;
  cursor: zoom-in;
}

/* --------------------------- amount chip --------------------------- */

.sb-co__amount {
  --co-tone: var(--ua-text-muted);
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.22rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--co-tone) 45%, transparent);
  border-radius: var(--ua-radius-pill);
  background: color-mix(in srgb, var(--co-tone) 9%, transparent);
  color: var(--co-tone);
  /* Lato, not the body face: the Montblanc trial watermarks its tabular
     numeral forms (see the tokens.css note), and this chip is all digits. */
  font-family: 'Lato', 'Helvetica Neue', Arial, sans-serif;
  font-size: var(--ua-fs-small);
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
  white-space: nowrap;
}

.sb-co__amount--alert {
  --co-tone: var(--ua-status-changes);
}

.sb-co__amount--calm {
  --co-tone: var(--ua-status-approved);
}

/* --------------------- pending actions and decision --------------------- */

/* The outer row (.sb-approval__actions) is styled in sections.css; only
   the button pair inside it is ours. */
.sb-co__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ua-s2);
}

.sb-co__decision {
  display: grid;
  gap: var(--ua-s2);
  justify-items: start;
  margin-top: var(--ua-s2);
}

.sb-co__decision-line {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ua-text-strong);
}

/* ------------------------------ responsive ------------------------------ */

@media (max-width: 768px) {
  .sb-co__img,
  .sb-co__thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 560px) {
  .sb-co__summary {
    grid-template-columns: 1fr;
    gap: var(--ua-s3);
    max-width: none;
  }
}

@media (max-width: 480px) {
  .sb-co__card {
    padding: var(--ua-s4);
  }
}
