.purchase-figure {
  --purchase-ink: #203333;
  --purchase-teal: #124b4f;
  --purchase-yellow: #ffe36b;
  --purchase-blue: #abdfed;
  --purchase-pink: #f3c7d7;
  --purchase-mint: #e0eee1;
  --purchase-line: #b9b29c;
  display: grid;
  gap: .85rem;
  color: var(--purchase-ink);
}

.supplier-decision {
  display: grid;
  grid-template-columns: 1fr auto minmax(15em, 1.5fr) auto 1fr;
  align-items: center;
  gap: .7rem;
  padding: 1rem 0;
  text-align: center;
}
.supplier-request, .supplier-edge { display: grid; justify-items: center; gap: .35rem; }
.supplier-request img { width: 5.25rem; height: auto; }
.supplier-request strong, .supplier-decision caption { font-size: 1.1em; font-weight: 700; }
.supplier-edge { color: #164e4e; font-weight: 700; }
.supplier-edge [data-diagram-arrow]::before { width: 2.7rem; height: 1rem; }
.supplier-decision table { border-collapse: collapse; background: #fffaf0; }
.supplier-decision caption { margin-bottom: .35rem; }
.supplier-decision :is(td, th) { padding: .45rem .35rem; border: 1px solid #b1a997; }
.supplier-decision thead { background: #c3e5e7; }
.supplier-decision tbody tr:last-child { background: #ffe99b; }
@media (max-width: 56rem) {
  .supplier-decision { grid-template-columns: 1fr; }
  .supplier-edge br { display: none; }
  .supplier-edge i { transform: rotate(90deg); margin: .35rem; }
}

.purchase-figure :is(p, h4, ul, ol) {
  margin: 0;
}

.purchase-scene {
  display: flex;
  align-items: center;
  gap: .75rem;
  line-height: 1.45;
}

.purchase-figure .purchase-art {
  display: block;
  flex: 0 0 auto;
  width: 70px;
  height: auto;
  object-fit: contain;
}

.purchase-takeaway {
  justify-self: center;
  text-align: center;
  font-weight: 700;
}

.purchase-pack-data,
.purchase-cost-build {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .9rem;
  padding: .55rem .75rem;
  border-left: 5px solid var(--purchase-yellow);
  background: #fffdf2;
}

.purchase-cost-build ul {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem 1rem;
  padding: 0;
  list-style: none;
}

.purchase-overflow {
  overflow: auto;
}

.purchase-table {
  width: 100%;
  border-collapse: collapse;
  background: #fffdf7;
}

.purchase-table caption {
  padding: 0 0 .3rem;
  font-weight: 700;
  text-align: left;
}

.purchase-table :is(th, td) {
  padding: .42rem .5rem;
  border-bottom: 1px solid var(--purchase-line);
  text-align: center;
  line-height: 1.3;
}

.purchase-table thead th {
  background: #e6ecdd;
  font-weight: 700;
}

.purchase-table th small {
  display: block;
  color: var(--purchase-teal);
}

.purchase-pack-table th:first-child { width: 9%; }
.purchase-pack-table th:nth-child(2) { width: 39%; }
.purchase-pack-table th:nth-child(3) { width: 12%; }
.purchase-pack-table th:last-child { width: 10%; }
.purchase-pack-table td:nth-child(2) span { white-space: nowrap; }

.purchase-check {
  display: inline-grid;
  place-items: center;
  min-width: 1.55rem;
  min-height: 1.55rem;
  border-radius: 50%;
  line-height: 1;
}

.purchase-yes {
  color: #124c3f;
  background: #dcf0db;
}

.purchase-no {
  color: #8c263c;
  background: #f6e1e9;
}

.purchase-row-selected {
  background: var(--purchase-mint);
}

.purchase-weight-dots {
  display: inline-flex;
  gap: 2px;
  margin-right: .28rem;
  vertical-align: middle;
}

.purchase-weight-dots i,
.purchase-legend i {
  box-sizing: border-box;
  width: .7rem;
  height: .7rem;
  border: 1px solid var(--purchase-ink);
  border-radius: 3px;
  background: var(--purchase-yellow);
}

.purchase-chart,
.purchase-bounds {
  padding: .65rem .85rem .65rem;
  border: 1px solid var(--purchase-line);
  border-radius: 12px;
  background: #fffdf5;
}

.purchase-chart h4,
.purchase-bounds h4 {
  color: var(--purchase-teal);
}

.purchase-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .85rem;
  margin: .35rem 0 .6rem;
}

.purchase-legend span {
  display: inline-flex;
  gap: .3rem;
  align-items: center;
}

.purchase-chart .purchase-fill-0 { background: var(--purchase-yellow); }
.purchase-chart .purchase-fill-1 { background: var(--purchase-blue); }
.purchase-chart .purchase-fill-2 { background: var(--purchase-pink); }

.purchase-plot {
  display: grid;
  grid-template-columns: minmax(6rem, auto) minmax(0, 1fr) minmax(4.5rem, auto);
  gap: .38rem .62rem;
  align-items: center;
}

.purchase-bar-row,
.purchase-axis {
  display: contents;
}

.purchase-bar-row > b {
  text-align: right;
  line-height: 1.3;
}

.purchase-track {
  position: relative;
  display: flex;
  min-height: 1.65rem;
  align-items: center;
  border-left: 2px solid var(--purchase-ink);
  background: #eeece2;
}

.purchase-track span {
  z-index: 1;
  margin-left: .4rem;
  padding: 0 .25rem;
  border-radius: 4px;
  background: #fffdf0;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.purchase-bar {
  position: absolute;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--bar-width);
  overflow: hidden;
  border-radius: 0 6px 6px 0;
  box-shadow: inset 0 0 0 1px var(--purchase-line);
}

.purchase-bar i {
  flex: var(--part) 1 0;
  border-block: 1px solid var(--purchase-ink);
}

.purchase-bar i + i {
  border-left: 1px solid var(--purchase-ink);
}

.purchase-bar i:last-child {
  border-right: 1px solid var(--purchase-ink);
  border-radius: 0 6px 6px 0;
}

.purchase-bar-selected > strong {
  color: #164d3f;
  background: var(--purchase-mint);
  border-radius: 6px;
  padding-inline: .28rem;
}

.purchase-bar-excluded .purchase-bar i {
  background: #e3dfd2;
}

.purchase-axis > span {
  text-align: right;
  font-size: .9em;
}

.purchase-axis > div {
  position: relative;
  min-height: 1.45rem;
  border-top: 2px solid var(--purchase-ink);
  font-variant-numeric: tabular-nums;
}

.purchase-axis > div::after,
.purchase-bounds-axis::after {
  position: absolute;
  content: "";
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--purchase-ink);
  border-right: 2px solid var(--purchase-ink);
  transform: rotate(45deg);
}

.purchase-axis > div::after {
  top: -6px;
  right: -1px;
}

.purchase-axis > div > span {
  position: absolute;
  left: var(--tick);
  top: .24rem;
  transform: translateX(-50%);
  line-height: 1.25;
  white-space: nowrap;
}

.purchase-axis > div > span::before {
  position: absolute;
  left: 50%;
  top: -.24rem;
  height: 4px;
  content: "";
  border-left: 1px solid var(--purchase-ink);
}

.purchase-resources {
  display: grid;
  gap: .28rem;
}

.purchase-resource-head,
.purchase-resource-row {
  display: grid;
  grid-template-columns: 1fr 1.1fr minmax(9rem, .8fr);
  gap: .6rem;
  align-items: center;
  padding: .3rem .65rem;
}

.purchase-resource-head {
  color: var(--purchase-teal);
  font-weight: 700;
}

.purchase-resource-row {
  border-bottom: 1px solid var(--purchase-line);
  background: #fffdf4;
}

.purchase-resource-row > div,
.purchase-resource-result {
  display: flex;
  gap: .45rem;
  align-items: center;
}

.purchase-resource-row .purchase-art {
  width: 50px;
}

.purchase-arrow {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .25rem;
  text-align: center;
  color: var(--purchase-teal);
  line-height: 1.25;
}

.purchase-resource-result i,
.purchase-arrow i {
  display: block;
  flex: 0 0 auto;
  width: 36px;
  height: 17px;
  color: var(--purchase-teal);
}

.purchase-resource-result i::before,
.purchase-arrow i::before {
  width: 32px;
  height: 17px;
}

.purchase-resource-result b {
  padding: .25rem .45rem;
  border-radius: 6px;
  background: var(--purchase-mint);
}

.purchase-resource-row[data-external="true"] .purchase-resource-result b {
  color: #39282b;
  background: var(--purchase-pink);
}

.purchase-pair-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(7rem, .35fr);
  gap: .75rem;
  align-items: center;
}

.purchase-pair-table td {
  color: #59564b;
  background: #f1efe4;
}

.purchase-pair-table td.purchase-pair {
  color: var(--purchase-ink);
  background: #ffefac;
  font-weight: 700;
}

.purchase-pair-count {
  text-align: center;
}

.purchase-pair-count > b {
  display: block;
  margin-bottom: .3rem;
  color: var(--purchase-teal);
  font-size: 1.4em;
}

.purchase-pair-count ul {
  padding: 0;
  list-style: none;
}

.purchase-bounds h4 small {
  margin-left: .7rem;
  font-weight: 500;
}

.purchase-bounds-axis {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--ticks), minmax(0, 1fr));
  padding: .35rem .1rem .2rem;
  list-style: none;
}

.purchase-bounds-axis::before {
  position: absolute;
  inset: 3.18rem 0 auto;
  border-top: 3px solid var(--purchase-ink);
  content: "";
}

.purchase-bounds-axis::after {
  top: 2.96rem;
  right: 0;
}

.purchase-bounds-axis li {
  position: relative;
  display: grid;
  grid-template-rows: 1.45rem 2.85rem 1.7rem;
  justify-items: center;
  align-items: center;
  text-align: center;
}

.purchase-bounds-axis :is(b, small, .purchase-bound-label) {
  z-index: 1;
}

.purchase-bounds-axis b {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  border: 2px solid var(--purchase-ink);
  background: #fffdf5;
  font-size: 1.18em;
}

.purchase-bounds-axis .purchase-bound-ok { background: var(--purchase-yellow); }
.purchase-bounds-axis .purchase-bound-end { border-style: dashed; color: #942c43; }
.purchase-bounds-axis small { font-size: .85em; }

@media (max-width: 600px) {
  .purchase-plot { grid-template-columns: minmax(3rem, auto) minmax(0, 1fr) auto; gap: .4rem; }
  .purchase-pair-layout { grid-template-columns: minmax(0, 1fr); }
  .purchase-resource-head,
  .purchase-resource-row { grid-template-columns: 1fr 1fr; }
  .purchase-resource-row .purchase-resource-result { grid-column: 2; }
  .purchase-resource-head > span:last-child { display: none; }
}
