.inventory-main {
  width: min(1180px, calc(100% - 36px));
}

.inventory-heading > div:first-child {
  max-width: 840px;
}

.inventory-heading .local-state {
  min-width: 138px;
}

.inventory-heading .local-state.save-failed {
  color: #7f4b13;
  background: #fff4dc;
  border-color: #e3c27a;
}

.inventory-heading .local-state.save-failed > span:first-child {
  background: #c17b1d;
}

.inventory-shell {
  background: #ffffff;
  border: 1px solid #cbd7d2;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(24, 33, 31, 0.06);
}

.inventory-toolbar,
.sender-row-heading,
.review-heading,
.inventory-conversion,
.inventory-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.inventory-toolbar {
  min-height: 82px;
  padding: 18px 22px;
}

.inventory-toolbar p,
.review-heading p,
.inventory-conversion p {
  margin: 0 0 4px;
  color: #70807b;
  font-size: 10px;
  font-weight: 800;
}

.inventory-toolbar h2,
.review-heading h2,
.inventory-conversion h2 {
  margin: 0;
  color: #20322c;
  font-size: 18px;
  line-height: 1.3;
}

.inventory-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 7px;
}

.inventory-toolbar button,
.inventory-row-actions button,
.remove-row {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #bdc9c5;
  border-radius: 6px;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  cursor: pointer;
}

.inventory-toolbar button:hover,
.inventory-row-actions .secondary-action:hover {
  background: #edf2f0;
}

.inventory-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #edf3f1;
  border-top: 1px solid #d6e0dc;
  border-bottom: 1px solid #d6e0dc;
}

.inventory-metrics > div {
  min-width: 0;
  min-height: 86px;
  padding: 15px 20px;
  display: grid;
  align-content: center;
}

.inventory-metrics > div + div {
  border-left: 1px solid #d2dcd8;
}

.inventory-metrics strong,
.inventory-metrics span {
  display: block;
}

.inventory-metrics strong {
  color: #0b665e;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 25px;
}

.inventory-metrics span {
  margin-top: 4px;
  color: #52635d;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.inventory-error {
  margin: 16px 22px 0;
}

.sender-row {
  padding: 20px 22px 22px;
  border-bottom: 1px solid #d8e1de;
}

.sender-row-heading {
  min-height: 34px;
  margin-bottom: 14px;
}

.sender-row-heading > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sender-row-heading strong {
  color: #273a34;
  font-size: 12px;
}

.sender-row-heading [data-role="row-gap"] {
  color: #6b7975;
  font-size: 10px;
}

.inventory-status {
  min-height: 26px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #c3ceca;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.status-blank,
.status-retired {
  color: #53625d;
  background: #eff3f1;
}

.status-incomplete {
  color: #8a2929;
  background: #fff0f0;
  border-color: #e1acac;
}

.status-review {
  color: #745408;
  background: #fff6d9;
  border-color: #e5c86c;
}

.status-confirmed {
  color: #205941;
  background: #e5f3eb;
  border-color: #b7d8c5;
}

.remove-row {
  min-height: 30px;
  padding: 0 8px;
  color: #7d3939;
  background: #ffffff;
  border-color: #d9b9b9;
}

.remove-row:hover {
  background: #fff1f1;
}

.sender-field-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.sender-field {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.sender-field.field-wide {
  grid-column: span 2;
}

.sender-field label {
  color: #34443f;
  font-size: 10px;
  font-weight: 800;
}

.sender-field code {
  font-size: 0.95em;
}

.sender-field input,
.sender-field select {
  width: 100%;
  min-height: 42px;
  min-width: 0;
  padding: 0 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #bac8c3;
  border-radius: 6px;
  outline: 0;
  font: inherit;
  font-size: 11px;
  letter-spacing: 0;
}

.sender-field input:focus,
.sender-field select:focus {
  border-color: #238b7e;
  box-shadow: 0 0 0 3px rgba(35, 139, 126, 0.13);
}

.inventory-row-actions {
  min-height: 74px;
  padding: 14px 22px;
  justify-content: start;
  flex-wrap: wrap;
  background: #fafcfb;
}

.inventory-row-actions .primary-action {
  color: #ffffff;
  background: #087e73;
  border-color: #087e73;
}

.inventory-row-actions .primary-action:hover {
  background: #075f58;
}

.inventory-row-actions .danger-action {
  color: #7d3939;
  border-color: #d9b9b9;
}

.inventory-row-actions p {
  min-width: 250px;
  margin: 0 0 0 auto;
  color: #687771;
  font-size: 10px;
  line-height: 1.5;
  text-align: right;
}

.inventory-review {
  padding: 22px;
  background: #f5f8f7;
  border-top: 1px solid #d5dfdb;
}

.review-heading {
  align-items: start;
}

.review-list {
  margin: 16px 0;
  padding: 0;
  display: grid;
  gap: 8px;
  list-style: none;
  counter-reset: review;
}

.review-list li {
  min-height: 38px;
  padding: 9px 11px 9px 38px;
  position: relative;
  color: #3e504a;
  background: #ffffff;
  border-left: 3px solid #d2a93e;
  font-size: 11px;
  line-height: 1.6;
  counter-increment: review;
}

.review-list li::before {
  content: counter(review);
  width: 20px;
  height: 20px;
  position: absolute;
  top: 8px;
  left: 9px;
  display: grid;
  place-items: center;
  color: #604a14;
  background: #fff4cf;
  border-radius: 50%;
  font-size: 9px;
  font-weight: 800;
}

.evidence-boundary {
  margin: 12px 0 0;
  color: #64736e;
  font-size: 10px;
  line-height: 1.6;
}

.inventory-conversion {
  min-height: 118px;
  padding: 22px;
  color: #e6f0ed;
  background: #19342f;
  border-top: 1px solid #24463f;
}

.inventory-conversion > div {
  max-width: 690px;
}

.inventory-conversion p {
  color: #9ec4bb;
}

.inventory-conversion h2 {
  color: #ffffff;
}

.inventory-conversion span {
  margin-top: 6px;
  display: block;
  color: #c1d4cf;
  font-size: 11px;
  line-height: 1.55;
}

.inventory-conversion .full-scan-action {
  min-width: 190px;
  min-height: 44px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: #2873b8;
  border: 1px solid #4d8bc5;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.inventory-conversion .full-scan-action:hover {
  background: #1f5e97;
}

.inventory-reference-grid strong {
  letter-spacing: 0;
}

@media (max-width: 900px) {
  .sender-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-toolbar,
  .inventory-conversion {
    align-items: start;
  }

  .inventory-toolbar {
    display: grid;
  }

  .inventory-toolbar-actions {
    justify-content: start;
  }
}

@media (max-width: 680px) {
  .inventory-main {
    width: min(100% - 24px, 1180px);
  }

  .inventory-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-metrics > div:nth-child(3) {
    border-top: 1px solid #d2dcd8;
    border-left: 0;
  }

  .inventory-metrics > div:nth-child(4) {
    border-top: 1px solid #d2dcd8;
  }

  .sender-row-heading,
  .inventory-conversion {
    display: grid;
  }

  .sender-row-heading > div:last-child {
    justify-content: space-between;
  }

  .inventory-conversion .full-scan-action {
    width: 100%;
  }

  .inventory-row-actions p {
    width: 100%;
    margin-left: 0;
    text-align: left;
  }
}

@media (max-width: 500px) {
  .sender-field-grid {
    grid-template-columns: 1fr;
  }

  .sender-field.field-wide {
    grid-column: auto;
  }

  .inventory-toolbar,
  .sender-row,
  .inventory-review,
  .inventory-conversion,
  .inventory-row-actions {
    padding-right: 16px;
    padding-left: 16px;
  }

  .inventory-toolbar-actions button,
  .inventory-row-actions button {
    flex: 1 1 132px;
  }

  .inventory-metrics > div {
    padding: 13px 15px;
  }

  .review-heading {
    display: grid;
  }

  .review-heading .copy-action {
    width: 100%;
  }
}
