#s5RoundBar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.s5-rb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 0.88rem;
  line-height: 1.5;
}
.s5-rb-pk {
  font-weight: 700;
  white-space: nowrap;
}
.s5-rb-msg {
  flex: 1 1 260px;
  min-width: 0;
}
.s5-rb.closing {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}
.s5-rb.done {
  border-color: #86efac;
  background: #f0fdf4;
  color: #14532d;
}
.s5-spin {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 4px;
  vertical-align: -2px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: s5spin 0.8s linear infinite;
}
@keyframes s5spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .s5-spin {
    animation: none;
  }
}
.s5-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.s5-chip-i {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  font-size: 0.76rem;
  font-weight: 600;
}
.s5-chip-i.warn {
  background: #fef3c7;
  color: #92400e;
}
.s5-chip-i.info {
  background: #dbeafe;
  color: #1d4ed8;
}
.s5-hint {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
  margin: -2px 0 10px;
  line-height: 1.55;
}
.s5-item {
  border: 1px solid var(--border, #e2e8f0);
  border-left: 4px solid #f59e0b;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fff;
}
.s5-item.ok {
  border-left-color: #16a34a;
}
.s5-item.zero {
  border-left-color: #94a3b8;
  background: #f8fafc;
}
.s5-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.s5-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-main, #1e293b);
  line-height: 1.45;
  min-width: 0;
  word-break: break-word;
}
.s5-code {
  display: block;
  font-family:
    ui-monospace,
    "Cascadia Mono",
    Consolas,
    monospace;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--primary, #1e3a8a);
  letter-spacing: 0.3px;
}
.s5-flag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.74rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.s5-flag.ok {
  background: #dcfce7;
  color: #15803d;
}
.s5-flag.need {
  background: #fef3c7;
  color: #b45309;
}
.s5-flag.zero {
  background: #e2e8f0;
  color: #475569;
}
.s5-qty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-top: 8px;
}
.s5-req {
  font-size: 0.85rem;
  color: var(--text-muted, #64748b);
}
.s5-req b {
  color: var(--text-main, #1e293b);
  font-size: 0.98rem;
}
.s5-stock {
  flex-basis: 100%;
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}
.s5-stock b {
  color: var(--text-main, #1e293b);
}
.s5-stock b.neg {
  color: #b91c1c;
}
.s5-stock.short {
  color: #991b1b;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 6px 9px;
  line-height: 1.45;
}
.s5-stock.short b {
  color: #b91c1c;
}
.s5-act {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.s5-act-lbl {
  font-size: 0.82rem;
  font-weight: 700;
  color: #0f172a;
  margin-right: 2px;
}
.s5-step {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
  background: #f8fafc;
  color: #0f172a;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.s5-step:hover {
  background: #eef2f7;
}
.s5-act-in {
  width: 84px;
  height: 36px;
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 0 6px;
  font-family: inherit;
}
.s5-act-in:focus {
  outline: none;
  border-color: var(--primary-light, #3b82f6);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
.s5-act-unit {
  font-size: 0.8rem;
  color: var(--text-muted, #64748b);
}
.s5-range {
  flex-basis: 100%;
  font-size: 0.74rem;
  color: var(--text-muted, #64748b);
}
.s5-over {
  margin-top: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #b45309;
}
.s5-reason {
  margin-top: 8px;
}
.s5-reason input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid #fca5a5;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  background: #fff7f7;
}
.s5-reason input:focus {
  outline: none;
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}
.s5-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.s5-chip {
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.s5-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}
.s5-reason-lbl {
  font-size: 0.8rem;
  font-weight: 700;
  color: #b91c1c;
}
.s5-reason-lbl span {
  font-weight: 500;
  color: var(--text-muted, #64748b);
}
.s5-reason-pick .s5-chip {
  padding: 8px 14px;
  font-size: 0.86rem;
  min-height: 38px;
  border-color: #fca5a5;
  background: #fff7f7;
  color: #991b1b;
}
.s5-reason-pick .s5-chip.on {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}
.s5-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.s5-thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border, #e2e8f0);
}
.s5-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.s5-thumb-x {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 0.95rem;
  line-height: 22px;
  padding: 0;
  cursor: pointer;
}
.s5-add {
  width: 72px;
  height: 72px;
  border-radius: 10px;
  border: 1.5px dashed #93c5fd;
  background: #f8fbff;
  color: var(--primary, #1e3a8a);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.7rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
}
.s5-add i {
  font-size: 1.15rem;
}
.s5-add.cam {
  background: var(--primary, #1e3a8a);
  color: #fff;
  border: 0;
}
.s5-add input {
  display: none;
}
.s5-add.busy {
  opacity: 0.55;
  pointer-events: none;
}
.s5-err {
  font-size: 0.78rem;
  font-weight: 600;
  color: #b91c1c;
  margin-top: 6px;
  min-height: 0;
}
.s5-err:empty {
  display: none;
}
.s5-save-wrap {
  position: sticky;
  bottom: 0;
  z-index: 5;
  padding-top: 6px;
  padding-right: 56px;
}
.s5-save {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.08);
}
.s5-save-hint {
  flex: 1 1 220px;
  min-width: 0;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.5;
}
.s5-save.ready .s5-save-hint {
  color: #15803d;
}
.s5-save.wait .s5-save-hint {
  color: #b45309;
}
.s5-save .btn {
  min-height: 44px;
  border-radius: 12px;
}
.s5-save .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
@media (max-width: 768px) {
  .s5-step {
    width: 44px;
    height: 44px;
    font-size: 1.3rem;
  }
  .s5-act-in {
    width: 88px;
    height: 44px;
    font-size: 16px;
  }
  .s5-reason input {
    height: 44px;
    font-size: 16px;
  }
  .s5-thumb,
  .s5-add {
    width: calc((100% - 16px) / 3);
    height: auto;
    aspect-ratio: 1 / 1;
  }
  .s5-save .btn {
    flex: 1 1 100%;
  }
}
.s5-bypass {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-size: 0.68rem;
  font-weight: 700;
  vertical-align: 1px;
}
.s5-dc-reason {
  font-size: 0.7rem;
  font-weight: 500;
  color: #b45309;
  line-height: 1.3;
  margin-top: 2px;
}
#s5Alerts {
  margin-bottom: 1rem;
}
.s5-alert-card {
  background: var(--surface, #fff);
  border-radius: 16px;
  box-shadow: var(--shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.1));
  border: 1px solid #fde68a;
  padding: 14px 16px;
}
.s5-alert-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #92400e;
  font-size: 0.98rem;
}
.s5-alert-site {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted, #64748b);
}
.s5-alert-sec {
  margin-top: 12px;
}
.s5-alert-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #b91c1c;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.s5-alert-title.warn {
  color: #c2410c;
}
.s5-cnt {
  display: inline-block;
  min-width: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 0.72rem;
  text-align: center;
}
.s5-alert-list {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.s5-alert-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 12px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 0.8rem;
  line-height: 1.45;
}
.s5-g {
  font-family:
    ui-monospace,
    Consolas,
    monospace;
  font-weight: 700;
  color: var(--primary, #1e3a8a);
}
.s5-mat {
  flex: 1 1 240px;
  min-width: 0;
  word-break: break-word;
}
.s5-mat b {
  font-family:
    ui-monospace,
    Consolas,
    monospace;
  font-size: 0.74rem;
}
.s5-short {
  font-weight: 700;
  color: #b91c1c;
  white-space: nowrap;
}
.s5-onhand,
.s5-when {
  color: var(--text-muted, #64748b);
  white-space: nowrap;
}
.s5-why {
  flex-basis: 100%;
  color: #92400e;
  font-size: 0.74rem;
}
.s5-alert-note {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
}
