:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: #edf2f8;
  color: #142641;
  font-synthesis: none;
  --ink: #142641;
  --muted: #4f627e;
  --navy: #153a75;
  --blue: #1456b8;
  --line: #d9e3f0;
  --sheet: #f3f6fb;
  --warning: #914606;
  --warning-bg: #fff4e1;
  --success: #116147;
  --success-bg: #e1f5ec;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #2871cf;
  outline-offset: 3px;
}
h1, h2, h3, p { margin: 0; }
button, input { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

.workspace {
  width: min(100%, 1000px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 38px 36px;
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(320px, 430px);
  gap: clamp(35px, 8vw, 118px);
  justify-content: center;
  align-items: start;
}

.demo-panel { padding: 25px 0 0; }
.demo-heading { margin-bottom: 32px; }
.project-label {
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.project-mark {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  background: var(--navy);
  position: relative;
}
.project-mark::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-top: 2px solid #fff;
  border-bottom: 2px solid #fff;
}
.demo-heading h1 {
  margin: 13px 0 8px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.16;
  letter-spacing: -.05em;
}
.demo-heading p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 9px;
}
.scenario-header h2, .guide h2 { font-size: 14px; }
.scenarios { display: grid; gap: 8px; }
.scenario {
  width: 100%;
  min-height: 62px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  text-align: left;
  background: #f9fbfe;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 13px;
}
.scenario[aria-pressed="true"] {
  color: #0e4599;
  background: #e9f1ff;
  border-color: #87afe9;
}
.scenario:hover { border-color: #6598dc; }
.scenario b, .scenario small { display: block; }
.scenario b { font-size: 15px; }
.scenario small { font-size: 12px; color: var(--muted); margin-top: 3px; }
.scenario-arrow { font-size: 24px; line-height: 1; color: var(--blue); }
.guide { margin-top: 26px; border-top: 1px solid #cfdcec; padding-top: 17px; }
.guide ol { padding-left: 1.4em; margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.guide li { padding-left: .18em; margin-bottom: 4px; }
.reset-button {
  margin-top: 8px;
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: #104b9e;
  font-size: 13px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.device {
  overflow: hidden;
  background: var(--sheet);
  border-radius: 23px;
  border: 1px solid #c7d5e8;
  box-shadow: 0 24px 55px #1e3d6817, 0 2px 10px #1e3d6810;
}
.app {
  min-height: clamp(585px, 80dvh, 728px);
  display: flex;
  flex-direction: column;
}
.app-bar {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  min-height: 56px;
  gap: 5px;
  padding: 0 8px;
  background: var(--navy);
  color: #fff;
}
.app-bar h2 { text-align: center; font-size: 17px; letter-spacing: .01em; }
.icon-button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 7px;
  color: inherit;
  background: transparent;
  font-size: 29px;
  line-height: 1;
}
.icon-button:hover { background: #ffffff1d; }
.icon-button:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.app-body { flex: 1; display: grid; align-content: start; gap: 12px; padding: 15px; min-width: 0; }
.card {
  min-width: 0;
  padding: 15px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 11px;
}
.info-top, .metrics-row, .task-heading, .quantity-line, .basket-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}
.muted-label { font-size: 12px; color: var(--muted); }
.batch-id, .sku, .package-id, .location {
  font-family: ui-monospace, "SF Mono", "Menlo", monospace;
  font-variant-numeric: tabular-nums;
}
.batch-id { display: block; font-size: 16px; font-weight: 700; margin-top: 5px; overflow-wrap: anywhere; }
.state-chip {
  flex-shrink: 0;
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 12px;
  font-weight: 650;
  color: #165199;
  background: #e8f1ff;
  white-space: nowrap;
}
.state-chip.success { color: var(--success); background: var(--success-bg); }
.state-chip.warning { color: var(--warning); background: var(--warning-bg); }
.metrics-row { margin-top: 13px; font-size: 13px; color: var(--muted); }
.metrics-row b { font-size: 15px; color: var(--ink); }
.progress-track { display: block; appearance: none; border: 0; width: 100%; margin-top: 7px; height: 5px; border-radius: 6px; background: #e5edf8; overflow: hidden; }
.progress-track::-webkit-progress-bar { background: #e5edf8; }
.progress-track::-webkit-progress-value { background: #1d60c2; border-radius: 6px; }
.progress-track::-moz-progress-bar { background: #1d60c2; border-radius: 6px; }
.shortage-link {
  min-height: 63px;
  width: 100%;
  border: 1px solid #ebca92;
  border-radius: 10px;
  background: var(--warning-bg);
  color: var(--warning);
  padding: 10px 12px;
  text-align: left;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.shortage-link b { display: block; font-size: 16px; }
.shortage-link small { display: block; color: #795530; font-size: 12px; margin-top: 3px; }
.shortage-link .chevron { font-size: 27px; line-height: 1; }
.notice, .feedback { font-size: 13px; line-height: 1.45; }
.notice { color: var(--success); padding-inline: 3px; }
.feedback { color: #8f2730; padding-top: 4px; }
.task-heading .muted-label { font-weight: 650; }
.location { font-size: 13px; font-weight: 750; }
.sku { font-size: 21px; letter-spacing: -.035em; margin-top: 11px; overflow-wrap: anywhere; }
.sku-name { font-size: 13px; margin-top: 4px; color: var(--muted); line-height: 1.5; }
.quantity-line { margin-top: 14px; font-size: 14px; }
.quantity-line + .quantity-line { border-top: 1px solid #e7eef7; padding-top: 12px; margin-top: 12px; }
.quantity-line strong { font-size: 19px; }
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button, .stepper input {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  border: 1px solid #bbcde6;
  background: #f6f9fe;
  color: var(--navy);
  text-align: center;
  font-size: 21px;
}
.stepper button:disabled { opacity: .55; }
.stepper input {
  width: 58px;
  background: #fff;
  appearance: textfield;
  font-size: 18px;
  font-weight: 750;
}
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.app-footer { display: grid; gap: 9px; padding: 12px 15px 15px; border-top: 1px solid var(--line); background: #fafcff; }
.app-footer.two-buttons { grid-template-columns: 1fr 1.15fr; }
.button {
  min-height: 45px;
  padding: 9px 12px;
  border: 1px solid #b8cbea;
  border-radius: 8px;
  background: #fff;
  color: #164e9a;
  font-weight: 700;
  font-size: 14px;
  line-height: 1.32;
}
.button.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.button.primary:hover { background: #10499f; }
.button:not(.primary):hover { background: #ebf2fe; }
.button:disabled { opacity: .6; }
.list-heading {
  padding: 13px 15px;
  border-radius: 10px;
  border: 1px solid #ebca92;
  background: var(--warning-bg);
}
.list-heading p:first-child { color: var(--warning); font-size: 15px; font-weight: 750; }
.list-heading b { font-size: 20px; font-variant-numeric: tabular-nums; }
.list-heading .muted-label { margin-top: 5px; line-height: 1.35; }
.basket-list { display: grid; gap: 8px; }
.basket-card {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}
.basket-card summary {
  min-height: 75px;
  list-style: none;
  cursor: pointer;
  padding: 11px;
}
.basket-card summary::-webkit-details-marker { display: none; }
.basket-card summary:focus-visible { outline-offset: -4px; }
.basket-summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 10px; width: 100%; }
.basket-summary.no-basket { grid-template-columns: minmax(0, 1fr) auto 10px; }
.basket-no {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1px;
  width: 47px;
  min-height: 46px;
  border-radius: 7px;
  color: #143e80;
  background: #e9f0fc;
  font-weight: 750;
}
.basket-no b { font-size: 21px; line-height: 1.06; }
.basket-no small { font-size: 10px; }
.package-id { font-size: 13px; font-weight: 750; overflow-wrap: anywhere; }
.basket-summary .package-id { display: block; margin-bottom: 5px; }
.basket-summary .state-chip { font-size: 11px; padding: 3px 5px; }
.count-missing { color: var(--warning); font-weight: 750; font-size: 13px; white-space: nowrap; }
.count-missing b { font-size: 18px; }
.expand-icon { color: var(--muted); font-size: 19px; line-height: 1; }
.basket-card[open] .expand-icon { transform: rotate(90deg); }
.item-lines { border-top: 1px solid #e7eef7; padding: 3px 11px; }
.item-lines li {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  font-size: 13px;
}
.item-lines li + li { border-top: 1px solid #eef2f7; }
.item-lines ul { margin: 0; padding: 0; }
.item-lines .muted-label { display: block; margin-top: 3px; }
.completed-title { display: flex; align-items: center; gap: 10px; }
.completed-title h3 { font-size: 22px; line-height: 1.2; }
.completed-check {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success);
  font-size: 22px;
  font-weight: 750;
}
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.stat {
  padding: 11px;
  background: #f0f5fd;
  border-radius: 8px;
  font-size: 12px;
  color: var(--navy);
}
.stat.warning { background: var(--warning-bg); color: var(--warning); }
.stat strong { display: block; font-size: 25px; margin-top: 4px; line-height: 1.1; }
.stat small { font-size: 12px; margin-left: 3px; }
.instructions { color: var(--muted); font-size: 13px; line-height: 1.55; }
.plan-list { padding: 0; margin: 0; list-style: none; display: grid; gap: 8px; }
.plan-list li { padding: 11px; min-height: 58px; }
.scan-form { display: grid; gap: 9px; }
.scan-form label, .dialog label { color: var(--muted); font-weight: 650; font-size: 13px; }
.scan-form input, .dialog select {
  min-width: 0;
  min-height: 45px;
  border-radius: 8px;
  border: 1px solid #b8cbea;
  background: #fff;
  padding: 8px 10px;
  color: var(--ink);
  font-size: 16px;
}
.scan-samples { display: grid; gap: 5px; }
.scan-samples .button { text-align: left; }
.dialog {
  width: min(calc(100% - 34px), 370px);
  max-width: 370px;
  padding: 17px;
  border-radius: 12px;
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 24px 55px #1229502d;
}
.dialog::backdrop { background: #12254280; }
.dialog h3 { font-size: 20px; margin-bottom: 9px; }
.dialog form { display: grid; gap: 12px; }
.dialog-kpis { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 5px; }
.dialog-kpis p { background: #eff4fc; border-radius: 6px; padding: 9px; color: var(--muted); font-size: 12px; }
.dialog-kpis p:last-child { color: var(--warning); background: var(--warning-bg); }
.dialog-kpis b { display: block; font-size: 19px; margin-top: 2px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.2fr; gap: 8px; }
.screen-reader { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 720px) {
  .workspace { padding: 16px 12px 22px; gap: 15px; grid-template-columns: minmax(0, 430px); }
  .demo-panel { display: contents; }
  .demo-heading { margin: 3px 2px 0; grid-row: 1; }
  .demo-heading h1 { margin: 4px 0 0; font-size: 27px; }
  .demo-heading p, .scenario-header, .guide { display: none; }
  .project-label { font-size: 11px; gap: 6px; }
  .project-mark { width: 14px; height: 14px; border-radius: 4px; }
  .project-mark::before { inset: 4px; }
  .device { grid-row: 3; border-radius: 15px; }
  .scenarios { grid-row: 2; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .scenario { justify-content: center; min-height: 44px; border-radius: 8px; padding: 5px 3px; }
  .scenario b { font-size: 12px; white-space: nowrap; }
  .scenario small, .scenario-arrow { display: none; }
  .app { min-height: min(600px, calc(100dvh - 140px)); }
  .reset-button { grid-row: 4; justify-self: end; margin: -6px 3px 0 0; }
}

@media (max-width: 360px) {
  .workspace { padding-inline: 7px; }
  .app-body, .app-footer { padding-inline: 10px; }
  .basket-summary { gap: 6px; }
  .basket-no { width: 40px; }
}
