:root {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  color: #242539;
  background: #f5f6fa;
  font-size: 16px;
  --red: #e73d40;
  --line: #dfe2eb;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header {
  padding: 16px max(16px, calc((100vw - 1100px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: white;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
header a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
header strong {
  display: block;
  font-size: 13px;
  color: #63677c;
}
.logo {
  display: grid;
  place-items: center;
  background: var(--red);
  color: white;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 27px;
}
#identity {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
}
main {
  max-width: 1100px;
  margin: auto;
  padding: 24px 16px 100px;
}
h1 {
  font-size: clamp(25px, 4vw, 34px);
  margin: 0 0 8px;
}
h2 {
  font-size: 22px;
  margin: 0 0 12px;
}
h3 {
  margin: 0 0 10px;
}
p {
  line-height: 1.5;
}
.muted,
small {
  color: #666b7d;
}
.panel,
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  margin: 18px 0;
}
.narrow {
  max-width: 520px;
  margin: 35px auto;
}
label {
  display: block;
  font-weight: 650;
  margin: 14px 0 8px;
}
input,
select,
textarea,
button {
  font: inherit;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #bec3d0;
  border-radius: 10px;
  padding: 13px;
  background: white;
  color: inherit;
  min-height: 48px;
}
button,
.button {
  border: 1px solid var(--line);
  background: white;
  color: inherit;
  padding: 12px 18px;
  min-height: 48px;
  border-radius: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
button:hover {
  border-color: #9097ac;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary {
  background: var(--red);
  color: white;
  border-color: var(--red);
}
.tabs,
.row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.tabs {
  margin: 22px 0;
}
.tabs .active {
  background: #27283e;
  color: white;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.phase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.phase button {
  padding: 18px 12px;
  text-align: center;
  display: block;
}
.phase .selected {
  border: 2px solid var(--red);
  background: #fff2f2;
}
.phase small {
  display: block;
  font-weight: 400;
  margin-top: 4px;
}
.producthead {
  display: flex;
  gap: 18px;
  align-items: center;
}
.photo {
  width: 96px;
  height: 96px;
  border-radius: 12px;
  object-fit: contain;
  background: #f5f6fa;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 35px;
  color: #a0a3b1;
}
.counts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
}
.good {
  background: #f0faf5;
  border-color: #c8e5d5;
}
.damage {
  background: #fff4ed;
  border-color: #f3d3b8;
}
.counts label {
  margin: 0 0 14px;
}
.stepper {
  display: flex;
  gap: 7px;
  align-items: center;
}
.stepper input {
  text-align: center;
  font-size: 30px;
  font-weight: 750;
  min-width: 0;
  padding: 10px 0;
}
.stepper button {
  font-size: 24px;
  padding: 9px;
  min-width: 44px;
}
.progress {
  height: 7px;
  background: #e4e6ef;
  border-radius: 9px;
  margin: 12px 0 24px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--red);
  width: 0;
}
.actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}
.actions .primary {
  flex: 1;
}
.error {
  color: #a3212e;
  background: #fff0f0;
  padding: 14px;
  border-radius: 10px;
}
.success {
  color: #146642;
  background: #eaf9f1;
  padding: 14px;
  border-radius: 10px;
}
.warning {
  color: #7e5308;
  background: #fff7df;
  padding: 14px;
  border-radius: 10px;
}
.pill {
  display: inline-block;
  border-radius: 20px;
  background: #eef0f7;
  padding: 4px 9px;
  font-size: 13px;
  white-space: normal;
}
.matched {
  background: #e8f7ee;
  color: #146642;
}
.short,
.extra {
  background: #fff0ed;
  color: #a33021;
}
.tablewrap {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  vertical-align: top;
}
th {
  background: #f6f7fb;
}
td small {
  display: block;
  margin-top: 4px;
}
details {
  margin: 18px 0;
}
summary {
  cursor: pointer;
  font-weight: 700;
  padding: 12px 0;
}
.check {
  display: flex;
  gap: 10px;
  align-items: center;
}
.check input {
  width: 22px;
  min-height: 22px;
}
.empty {
  padding: 30px;
  text-align: center;
}
.reviewline {
  display: flex;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  gap: 16px;
}
.reviewline span {
  flex: 1;
}
#notice:not(:empty) {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  padding: 13px 20px;
  border-radius: 12px;
  background: #28293e;
  color: white;
  box-shadow: 0 6px 30px #0002;
  z-index: 5;
}
.wide {
  width: 100%;
}
.compact {
  font-size: 13px;
  padding: 6px 10px;
  min-height: 36px;
}
.draft {
  font-size: 13px;
  margin: 12px 0;
  color: #666b7d;
}
@media (max-width: 650px) {
  main {
    padding: 20px 12px 90px;
  }
  .panel,
  .card {
    padding: 16px;
    border-radius: 14px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .counts {
    gap: 10px;
  }
  .counts .card {
    padding: 12px;
    margin: 0;
  }
  .photo {
    width: 76px;
    height: 76px;
  }
  .producthead {
    gap: 12px;
  }
  .producthead h2 {
    font-size: 20px;
  }
  .stepper {
    gap: 4px;
  }
  .stepper button {
    min-width: 36px;
    padding: 5px;
  }
  .stepper input {
    font-size: 26px;
  }
  .phase button {
    font-size: 15px;
  }
  .tabs {
    gap: 6px;
  }
  .tabs button {
    padding: 10px 12px;
    font-size: 14px;
  }
  .mobile-stack {
    display: block;
  }
  #identity {
    max-width: 45%;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .comparison td:nth-child(n + 3) {
    white-space: nowrap;
  }
  .actions {
    position: sticky;
    bottom: 8px;
    background: #fffef9;
    padding: 8px;
    border-radius: 13px;
    box-shadow: 0 1px 18px #24253915;
  }
  .reviewline {
    font-size: 14px;
  }
}

.logo {
  background: white;
  object-fit: contain;
}
.context {
  padding-top: 8px;
  padding-bottom: 8px;
}
.context details {
  margin: 0;
}
.context summary {
  font-size: 15px;
  line-height: 1.5;
}
.context summary small {
  margin-left: 10px;
  color: #ac2d35;
}
