.inventory-guide {
  overflow-x: hidden;
  background: #fff;
}

.inventory-hero h1 {
  max-width: 840px;
  font-size: clamp(2.45rem, 4.8vw, 4.65rem);
}

.inventory-calculator-section {
  padding-top: 72px;
  padding-bottom: 78px;
}

.inventory-calculator {
  overflow: hidden;
  border-radius: 22px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 22px 65px rgba(0, 0, 0, .25);
}

.inventory-table-scroll {
  overflow-x: auto;
  scrollbar-gutter: stable;
  background: #fff;
}

.inventory-table-scroll:focus {
  outline: 3px solid #72d8e0;
  outline-offset: -3px;
}

.inventory-table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.inventory-table caption {
  padding: 11px 14px;
  color: #40516a;
  background: #f2f6fb;
  font-size: .78rem;
  font-weight: 760;
  text-align: left;
}

.inventory-table th,
.inventory-table td {
  padding: 15px 13px;
  border-right: 1px solid #e1e8f1;
  border-bottom: 1px solid #d9e2ee;
  text-align: left;
  vertical-align: middle;
}

.inventory-table thead th {
  color: #fff;
  background: #0b4f66;
  font-size: .82rem;
  letter-spacing: .02em;
  white-space: nowrap;
}

.inventory-table tbody th {
  min-width: 168px;
  color: var(--navy);
  background: #f8fafc;
}

.inventory-table tbody tr:last-child th,
.inventory-table tbody tr:last-child td {
  border-bottom: 0;
}

.inventory-table input {
  width: 92px;
  min-height: 44px;
  padding: 8px 9px;
  border: 1px solid #aebed1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.inventory-table input:focus,
.period-fields input:focus {
  outline: 3px solid rgba(7, 92, 241, .22);
  border-color: var(--blue);
}

.inventory-table input[aria-invalid="true"],
.period-fields input[aria-invalid="true"] {
  border-color: #b42318;
  background: #fff3f2;
}

.inventory-table [data-row-value] {
  color: #0b3f33;
  font-weight: 900;
  white-space: nowrap;
}

.stock-status {
  display: inline-block;
  min-width: 104px;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.stock-status.low {
  color: #8b2417;
  background: #fee4e2;
}

.stock-status.ready {
  color: #14532d;
  background: #dcfce7;
}

.stock-status.warning {
  color: #6b4b00;
  background: #fff1b8;
}

.stock-status.invalid {
  color: #fff;
  background: #b42318;
}

.inventory-period-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(330px, .8fr);
  border-top: 6px solid #e7eef7;
}

.inventory-period-grid fieldset {
  margin: 0;
  padding: 30px 32px 32px;
  border: 0;
}

.inventory-period-grid legend {
  width: 100%;
  padding: 30px 0 11px;
  border-bottom: 1px solid var(--line);
  color: var(--navy);
  font-size: 1.06rem;
  font-weight: 900;
}

.period-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 20px;
}

.period-fields label {
  color: #263953;
  font-size: .86rem;
  font-weight: 820;
}

.period-fields label span {
  float: right;
  color: var(--muted);
  font-size: .74rem;
  font-weight: 700;
}

.period-fields input {
  width: 100%;
  min-height: 46px;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid #aebed1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.inventory-status {
  min-height: 1.35em;
  margin: 16px 0 0;
  color: #a51d18;
  font-size: .86rem;
  font-weight: 780;
}

.inventory-status.success {
  color: #166534;
}

.inventory-status.warning {
  color: #7a5600;
}

.inventory-summary {
  padding: 34px;
  background: linear-gradient(145deg, #edf9f9, #f3f7ff);
}

.inventory-summary dl {
  margin: 0;
}

.inventory-summary dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(7, 31, 73, .12);
}

.inventory-summary dt {
  color: #40516a;
  font-size: .9rem;
}

.inventory-summary dd {
  margin: 0;
  color: var(--navy);
  font-weight: 900;
  white-space: nowrap;
}

.inventory-summary .result-emphasis {
  margin: 14px -12px 0;
  padding: 18px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--navy);
}

.inventory-summary .result-emphasis dt {
  color: #d7e1f0;
}

.inventory-summary .result-emphasis dd {
  color: var(--gold);
  font-size: 1.5rem;
}

.inventory-term-grid {
  margin-top: 24px;
}

.scope-callout {
  margin-top: 24px;
  padding: 20px 22px;
  border-left: 5px solid var(--gold);
  border-radius: 0 12px 12px 0;
  background: #fff8e8;
  color: #5c4612;
}

.connected-inventory-section {
  background: #f7fafc;
}

.inventory-update-callout {
  margin-top: 30px;
}

.mistakes-section {
  background: #eef6ff;
}

.mistake-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.mistake-grid article {
  padding: 22px 18px;
  border: 1px solid #d7e4f5;
  border-radius: 16px;
  background: #fff;
}

.mistake-grid span {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--navy);
  font-size: .78rem;
  font-weight: 900;
}

.mistake-grid h3 {
  margin: 15px 0 8px;
  color: var(--navy);
  font-size: 1rem;
}

.mistake-grid p {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
}

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

@media (max-width: 900px) {
  .inventory-period-grid {
    grid-template-columns: 1fr;
  }

  .inventory-summary {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 700px) {
  .inventory-hero h1 {
    font-size: clamp(2.2rem, 11vw, 3.2rem);
  }

  .inventory-table-scroll::before {
    content: "Swipe the table to see all columns";
    display: block;
    position: sticky;
    left: 0;
    padding: 10px 14px;
    color: #3b4d65;
    background: #f2f6fb;
    font-size: .78rem;
    font-weight: 800;
  }

  .period-fields {
    grid-template-columns: 1fr;
  }

  .inventory-period-grid fieldset,
  .inventory-summary {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 540px) {
  .mistake-grid {
    grid-template-columns: 1fr;
  }

  .inventory-summary dl div {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .inventory-summary .result-emphasis {
    margin-left: 0;
    margin-right: 0;
  }
}
