:root {
  --ink: #132238;
  --ink-soft: #536174;
  --ink-faint: #8691a0;
  --canvas: #f2f4f3;
  --surface: #ffffff;
  --surface-warm: #f8f8f5;
  --line: #dfe3e3;
  --line-strong: #cbd1d1;
  --accent: #e84c2f;
  --accent-dark: #c73820;
  --accent-soft: #fff0eb;
  --safety: #f2a900;
  --safety-soft: #fff6dd;
  --success: #15845c;
  --success-soft: #e6f5ef;
  --danger: #c43b2a;
  --danger-soft: #fdece8;
  --navy: #132238;
  --navy-light: #243854;
  --shadow-sm: 0 1px 2px rgba(19, 34, 56, 0.06), 0 5px 18px rgba(19, 34, 56, 0.04);
  --shadow-lg: 0 20px 54px rgba(19, 34, 56, 0.16);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html {
  background: #dfe3e2;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.88), transparent 28rem),
    #dfe3e2;
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(232, 76, 47, 0.26);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.icon {
  width: 22px;
  height: 22px;
  display: inline-block;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--canvas);
}

.app-header {
  position: sticky;
  z-index: 20;
  top: 0;
  min-height: 74px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 16px 10px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(var(--navy), var(--navy));
  box-shadow: 0 4px 18px rgba(19, 34, 56, 0.18);
}

.header-copy {
  min-width: 0;
}

.brand-kicker,
.eyebrow {
  display: block;
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-transform: uppercase;
}

.brand-kicker {
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.53);
}

.app-header h1 {
  overflow: hidden;
  margin: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.icon-button {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.header-back {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.app-header .header-back[hidden] {
  display: inline-grid !important;
  visibility: hidden;
  pointer-events: none;
}

.header-back .icon {
  width: 24px;
  height: 24px;
}

.demo-badge {
  height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.08);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.demo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5fe0a7;
  box-shadow: 0 0 0 4px rgba(95, 224, 167, 0.1);
}

.app-main {
  min-height: calc(100dvh - 74px);
}

.page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 20px 16px calc(100px + var(--safe-bottom));
}

.page h2,
.page h3,
.page p {
  margin-top: 0;
}

.page h2,
.page h3 {
  letter-spacing: -0.02em;
}

.page-intro {
  padding: 7px 2px 18px;
}

.page-intro h2 {
  margin: 5px 0 5px;
  font-size: 25px;
  line-height: 1.2;
}

.page-intro p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-heading h3 {
  margin: 4px 0 0;
  font-size: 18px;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 5px 0;
  border: 0;
  color: var(--accent);
  background: none;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.text-button .icon {
  width: 16px;
  height: 16px;
}

.shift-banner {
  position: relative;
  min-height: 175px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 22px;
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 42%),
    repeating-linear-gradient(-45deg, transparent 0 9px, rgba(255, 255, 255, 0.018) 9px 10px),
    var(--navy);
  box-shadow: var(--shadow-lg);
}

.shift-banner::after {
  position: absolute;
  width: 190px;
  height: 190px;
  right: -75px;
  top: -85px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.025), 0 0 0 58px rgba(255, 255, 255, 0.018);
  content: "";
}

.shift-banner .eyebrow {
  margin-bottom: 8px;
  color: #f4b29f;
}

.shift-banner h2 {
  max-width: 270px;
  margin: 0 0 7px;
  font-size: 24px;
  line-height: 1.16;
}

.shift-banner p {
  max-width: 260px;
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 12px;
}

.shift-mark {
  position: relative;
  z-index: 1;
  width: 66px;
  height: 66px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  transform: rotate(3deg);
  background: rgba(255, 255, 255, 0.06);
}

.shift-mark span {
  position: absolute;
  left: 7px;
  top: 5px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 10px;
  font-weight: 800;
}

.shift-mark strong {
  color: #fff;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 28px;
}

.active-job,
.start-card,
.overview-section,
.task-card,
.sku-card,
.scan-panel,
.handoff-card,
.result-summary,
.result-detail,
.line-results,
.tip-card,
.unload-load {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.active-job {
  position: relative;
  z-index: 2;
  margin: -12px 8px 0;
  padding: 18px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.status-available {
  color: #846100;
  background: var(--safety-soft);
}

.status-in_progress {
  color: #20528f;
  background: #eaf2fc;
}

.status-completed {
  color: var(--success);
  background: var(--success-soft);
}

.job-route {
  display: grid;
  grid-template-columns: 1fr 32px 1fr;
  align-items: center;
  gap: 7px;
  margin: 20px 0;
}

.route-node {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.route-node > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
}

.route-node.destination > span {
  color: var(--success);
  background: var(--success-soft);
}

.route-node .icon {
  width: 18px;
  height: 18px;
}

.route-node div {
  min-width: 0;
}

.route-node small,
.route-node strong {
  display: block;
}

.route-node small {
  color: var(--ink-faint);
  font-size: 10px;
}

.route-node strong {
  overflow: hidden;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-line {
  height: 1px;
  background: repeating-linear-gradient(90deg, var(--line-strong) 0 4px, transparent 4px 8px);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
}

.progress-row.compact {
  margin: 16px 0;
}

.progress-row strong {
  color: var(--ink-soft);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  white-space: nowrap;
}

.progress-track {
  height: 7px;
  flex: 1;
  overflow: hidden;
  border-radius: 99px;
  background: #e8ebea;
}

.progress-track span {
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--accent);
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button,
.camera-button,
.simulate-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 17px;
  border-radius: 12px;
  font-weight: 750;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  border: 1px solid var(--accent);
  color: #fff;
  background: var(--accent);
  box-shadow: 0 7px 16px rgba(232, 76, 47, 0.18);
}

.primary-button:active {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  transform: translateY(1px);
}

.primary-button .icon,
.secondary-button .icon {
  width: 19px;
  height: 19px;
}

.primary-button.large {
  min-height: 56px;
  font-size: 16px;
}

.secondary-button {
  width: 100%;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: var(--surface);
}

.start-card {
  display: grid;
  grid-template-columns: 54px 1fr;
  align-items: center;
  gap: 14px;
  margin: 15px 0 0;
  padding: 18px;
}

.start-card .primary-button {
  grid-column: 1 / -1;
}

.start-visual {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: var(--accent);
  background: var(--accent-soft);
}

.start-visual .icon {
  width: 28px;
  height: 28px;
}

.start-card h3 {
  margin: 4px 0 3px;
  font-size: 18px;
}

.start-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.overview-section {
  margin-top: 16px;
  padding: 18px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.stat-grid article {
  min-width: 0;
  padding: 12px 8px;
  border: 1px solid #eceeed;
  border-radius: 12px;
  background: var(--surface-warm);
  text-align: center;
}

.stat-icon {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  margin: 0 auto 7px;
  border-radius: 9px;
}

.stat-icon .icon {
  width: 17px;
  height: 17px;
}

.stat-icon.waiting {
  color: #846100;
  background: var(--safety-soft);
}

.stat-icon.doing {
  color: #20528f;
  background: #eaf2fc;
}

.stat-icon.done {
  color: var(--success);
  background: var(--success-soft);
}

.stat-grid strong,
.stat-grid small {
  display: block;
}

.stat-grid strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 20px;
  line-height: 1.2;
}

.stat-grid small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 10px;
}

.tip-card {
  display: flex;
  gap: 11px;
  margin-top: 16px;
  padding: 14px 15px;
  color: #745300;
  border-color: #ead9a7;
  background: var(--safety-soft);
}

.tip-card > .icon {
  width: 19px;
  height: 19px;
  margin-top: 1px;
}

.tip-card strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}

.tip-card p {
  margin: 0;
  color: #8b742e;
  font-size: 11px;
}

.bottom-nav {
  position: fixed;
  z-index: 18;
  right: 0;
  bottom: 0;
  left: 0;
  min-height: calc(67px + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 7px max(16px, calc((100vw - 760px) / 2)) var(--safe-bottom);
  border-top: 1px solid rgba(203, 209, 209, 0.84);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 -8px 24px rgba(19, 34, 56, 0.06);
  backdrop-filter: blur(16px);
}

.nav-item {
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 4px 12px;
  border: 0;
  color: #8a949f;
  background: transparent;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
}

.nav-item .icon {
  width: 21px;
  height: 21px;
}

.nav-item.active {
  color: var(--accent);
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-bottom: 15px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #e9eceb;
}

.segmented button {
  min-height: 36px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.segmented button.active {
  color: var(--ink);
  background: #fff;
  box-shadow: 0 2px 7px rgba(19, 34, 56, 0.08);
}

.task-list {
  display: grid;
  gap: 12px;
}

.task-card {
  position: relative;
  overflow: hidden;
  padding: 17px;
}

.task-card.is-active::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  background: #3a73b7;
  content: "";
}

.task-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.task-card-top > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.task-number {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  font-weight: 800;
}

.priority {
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
}

.priority-urgent {
  color: var(--danger);
  background: var(--danger-soft);
}

.priority-normal {
  color: var(--ink-soft);
  background: #eef0ef;
}

.task-path {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 18px 0 14px;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--surface-warm);
  font-size: 12px;
}

.task-path > .icon {
  width: 17px;
  height: 17px;
  color: var(--accent);
}

.task-path strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.path-arrow {
  color: var(--ink-faint);
}

.task-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 13px;
}

.task-meta span {
  padding: 0 12px;
  border-left: 1px solid var(--line);
}

.task-meta span:first-child {
  padding-left: 0;
  border-left: 0;
}

.task-meta small,
.task-meta strong {
  display: block;
}

.task-meta small,
.next-location small {
  color: var(--ink-faint);
  font-size: 10px;
}

.task-meta strong {
  margin-top: 3px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
}

.next-location {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.next-location strong {
  color: var(--accent);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.empty-state {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  color: var(--ink-faint);
  text-align: center;
}

.empty-state > span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border-radius: 50%;
  background: #e6e9e8;
}

.empty-state > span .icon {
  width: 28px;
  height: 28px;
}

.empty-state h3 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 17px;
}

.empty-state p {
  margin: 0;
  font-size: 12px;
}

.work-page {
  padding-top: 12px;
}

.work-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.work-context > div:first-child {
  display: flex;
  align-items: center;
  gap: 9px;
}

.work-context > div:first-child > strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.line-counter {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.line-counter small {
  color: var(--ink-faint);
  font-size: 10px;
}

.line-counter strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 20px;
}

.line-counter strong span {
  color: var(--ink-faint);
  font-size: 11px;
}

.scan-rail {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0 0 15px;
  padding: 12px 2px 8px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
}

.scan-rail::before {
  position: absolute;
  top: 25px;
  right: 10%;
  left: 10%;
  height: 2px;
  background: var(--line);
  content: "";
}

.rail-step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--ink-faint);
}

.rail-step > span {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
}

.rail-step > span .icon {
  width: 14px;
  height: 14px;
}

.rail-step small {
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
}

.rail-step.done {
  color: var(--success);
}

.rail-step.done > span {
  border-color: var(--success);
  color: #fff;
  background: var(--success);
}

.rail-step.current {
  color: var(--accent);
}

.rail-step.current > span {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.location-callout {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
  margin-bottom: 12px;
  padding: 14px 15px;
  border-radius: var(--radius);
  color: #fff;
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.04)),
    var(--navy);
}

.location-icon {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: #ff8a6c;
  background: rgba(255, 255, 255, 0.06);
}

.location-callout div:nth-child(2) {
  min-width: 0;
}

.location-callout small,
.location-callout strong,
.location-callout div > span {
  display: block;
}

.location-callout small {
  color: rgba(255, 255, 255, 0.55);
  font-size: 10px;
}

.location-callout strong {
  margin: 2px 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 22px;
}

.location-callout div > span {
  color: rgba(255, 255, 255, 0.63);
  font-size: 10px;
}

.verified-mark {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  margin-left: auto;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
}

.verified-mark .icon {
  width: 16px;
  height: 16px;
}

.sku-card {
  margin-bottom: 12px;
  padding: 16px;
}

.sku-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sequence,
.lot {
  padding: 4px 7px;
  border-radius: 5px;
  color: var(--ink-soft);
  background: #eef0ef;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 800;
}

.lot {
  color: #6b551b;
  background: var(--safety-soft);
}

.sku-card h2 {
  margin: 14px 0;
  font-size: 18px;
  line-height: 1.35;
}

.sku-details {
  display: grid;
  grid-template-columns: 1.25fr 1fr 0.65fr;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.sku-details small,
.sku-details strong {
  display: block;
}

.sku-details small {
  margin-bottom: 3px;
  color: var(--ink-faint);
  font-size: 9px;
}

.sku-details strong {
  overflow: hidden;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sku-details .qty-accent {
  color: var(--accent);
  font-size: 20px;
  line-height: 1;
}

.scan-panel {
  padding: 17px;
  border-color: var(--line-strong);
}

.scan-panel.has-error {
  border-color: #e0998e;
  box-shadow: 0 0 0 3px rgba(196, 59, 42, 0.07);
}

.scan-panel-title {
  display: flex;
  align-items: center;
  gap: 11px;
}

.stage-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
}

.stage-icon .icon {
  width: 23px;
  height: 23px;
}

.scan-panel-title h3 {
  margin: 3px 0 0;
  font-size: 19px;
}

.stage-helper {
  margin: 10px 0 14px;
  color: var(--ink-soft);
  font-size: 12px;
}

.scan-form label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.scan-input-wrap {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  overflow: hidden;
  min-height: 52px;
  padding-left: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: var(--surface-warm);
}

.scan-input-wrap > .icon {
  width: 19px;
  height: 19px;
  color: var(--ink-faint);
}

.scan-input-wrap input {
  min-width: 0;
  height: 50px;
  padding: 0 8px;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  text-transform: uppercase;
}

.scan-input-wrap input::placeholder {
  color: #a0a8af;
  font-family: Inter, "PingFang SC", sans-serif;
  text-transform: none;
}

.scan-input-wrap button {
  align-self: stretch;
  min-width: 65px;
  border: 0;
  color: #fff;
  background: var(--navy);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.scan-feedback {
  min-height: 29px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 3px 0;
  color: var(--ink-faint);
  font-size: 10px;
}

.scan-feedback code {
  color: var(--ink-soft);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.scan-feedback.error {
  justify-content: flex-start;
  color: var(--danger);
}

.scan-feedback.error .icon {
  width: 15px;
  height: 15px;
}

.simulate-button {
  width: 100%;
  min-height: 50px;
  justify-content: flex-start;
  margin-top: 8px;
  padding: 0 13px;
  border: 1px dashed #e2a393;
  color: var(--accent-dark);
  background: var(--accent-soft);
  font-size: 12px;
}

.camera-button {
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 28px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  justify-content: stretch;
  margin-top: 10px;
  padding: 8px 13px;
  border: 1px solid var(--navy);
  color: #fff;
  background: var(--navy);
  text-align: left;
  box-shadow: 0 7px 16px rgba(19, 34, 56, 0.14);
}

.camera-button > .icon {
  grid-row: 1 / 3;
  align-self: center;
  width: 23px;
  height: 23px;
  color: #ff8a6c;
}

.camera-button span {
  align-self: end;
  font-size: 13px;
  line-height: 1.25;
}

.camera-button small {
  align-self: start;
  color: rgba(255, 255, 255, 0.58);
  font-size: 9px;
  font-weight: 600;
  line-height: 1.25;
}

.simulate-button span {
  flex: 1;
  text-align: left;
}

.simulate-button strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.simulate-button .icon {
  width: 19px;
  height: 19px;
}

.work-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.work-actions > span {
  color: var(--ink-faint);
  font-size: 10px;
}

.ghost-button {
  min-height: 39px;
  padding: 0 10px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
}

.ghost-button .icon {
  width: 16px;
  height: 16px;
  color: var(--safety);
}

.quantity-control {
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  align-items: stretch;
  gap: 8px;
}

.quantity-control > button {
  min-height: 62px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface-warm);
  font-size: 24px;
  cursor: pointer;
}

.quantity-control label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--ink);
  border-radius: 11px;
}

.quantity-control label span {
  color: var(--ink-faint);
  font-size: 9px;
}

.quantity-control input {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 25px;
  font-weight: 800;
  text-align: center;
  -moz-appearance: textfield;
}

.quantity-control input::-webkit-inner-spin-button,
.quantity-control input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.quantity-summary {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin: 12px 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.quantity-summary strong {
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
}

.ready-page,
.result-page {
  padding-top: 30px;
}

.completion-hero,
.result-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.completion-ring,
.result-stamp {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  margin-bottom: 17px;
  border: 1px solid #a9d7c6;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  box-shadow: 0 0 0 9px var(--success-soft);
}

.completion-ring .icon,
.result-stamp .icon {
  width: 35px;
  height: 35px;
  stroke-width: 2.2;
}

.completion-hero h2,
.result-hero h2 {
  margin: 7px 0 7px;
  font-size: 25px;
}

.completion-hero p {
  max-width: 335px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.handoff-card {
  margin: 25px 0 18px;
  padding: 18px;
}

.handoff-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px minmax(0, 1fr);
  align-items: center;
}

.handoff-route > div {
  min-width: 0;
  text-align: center;
}

.handoff-route > div > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  border-radius: 12px;
  color: var(--accent);
  background: var(--accent-soft);
}

.handoff-route > div:last-child > span {
  color: var(--success);
  background: var(--success-soft);
}

.handoff-route small,
.handoff-route strong {
  display: block;
}

.handoff-route small {
  color: var(--ink-faint);
  font-size: 9px;
}

.handoff-route strong {
  overflow: hidden;
  margin-top: 4px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.handoff-line {
  color: var(--ink-faint);
}

.handoff-line .icon {
  width: 20px;
  height: 20px;
}

.handoff-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.handoff-stats span {
  text-align: center;
}

.handoff-stats small,
.handoff-stats strong {
  display: block;
}

.handoff-stats small {
  color: var(--ink-faint);
  font-size: 9px;
}

.handoff-stats strong {
  margin-top: 3px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 16px;
}

.sticky-action {
  position: sticky;
  bottom: calc(15px + var(--safe-bottom));
}

.unload-page {
  padding-top: 16px;
}

.unload-map {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  color: #fff;
  background: var(--navy);
  text-align: center;
}

.map-grid {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(rgba(255, 255, 255, 0.11) 1px, transparent 1px) 0 0 / 28px 28px;
  transform: perspective(220px) rotateX(52deg) scale(1.5) translateY(25px);
  transform-origin: center bottom;
}

.map-pin {
  position: relative;
  z-index: 1;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  margin-bottom: 9px;
  border-radius: 50% 50% 50% 8px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 12px 22px rgba(0, 0, 0, 0.22);
  transform: rotate(-45deg);
}

.map-pin .icon {
  width: 27px;
  height: 27px;
  transform: rotate(45deg);
}

.unload-map .eyebrow,
.unload-map h2,
.unload-map p {
  position: relative;
  z-index: 1;
}

.unload-map .eyebrow {
  color: rgba(255, 255, 255, 0.55);
}

.unload-map h2 {
  margin: 5px 0 2px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 25px;
}

.unload-map p {
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 11px;
}

.unload-load {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
  margin: -10px 12px 13px;
  padding: 14px;
  position: relative;
  z-index: 2;
}

.unload-load > div {
  min-width: 0;
}

.unload-load > div:first-child {
  display: grid;
  grid-template-columns: 32px 1fr;
  column-gap: 8px;
}

.unload-load > div:first-child > span {
  grid-row: 1 / 3;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background: var(--accent-soft);
}

.unload-load .icon {
  width: 17px;
  height: 17px;
}

.unload-load small,
.unload-load strong {
  display: block;
}

.unload-load small {
  color: var(--ink-faint);
  font-size: 9px;
}

.unload-load strong {
  overflow: hidden;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unload-scan {
  margin-top: 0;
}

.result-hero p {
  margin: 0;
  color: var(--ink-soft);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 24px 0 13px;
  padding: 16px 8px;
}

.result-summary div {
  min-width: 0;
  padding: 0 8px;
  border-left: 1px solid var(--line);
  text-align: center;
}

.result-summary div:first-child {
  border-left: 0;
}

.result-summary small,
.result-summary strong {
  display: block;
}

.result-summary small {
  color: var(--ink-faint);
  font-size: 9px;
}

.result-summary strong {
  margin-top: 3px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 22px;
}

.warning-text {
  color: var(--danger);
}

.result-detail,
.line-results {
  margin-bottom: 13px;
  padding: 17px;
}

.sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--success);
  background: var(--success-soft);
  font-size: 9px;
  font-weight: 700;
}

.sync-badge .icon {
  width: 13px;
  height: 13px;
}

.result-detail dl {
  margin: 15px 0 0;
}

.result-detail dl div {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.result-detail dt {
  color: var(--ink-faint);
  font-size: 11px;
}

.result-detail dd {
  min-width: 0;
  margin: 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  overflow-wrap: anywhere;
  text-align: right;
}

.line-results .section-heading {
  margin-bottom: 12px;
}

.line-results article {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.line-result-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--success);
  background: var(--success-soft);
}

.line-result-icon.exception {
  color: var(--danger);
  background: var(--danger-soft);
}

.line-result-icon .icon {
  width: 15px;
  height: 15px;
}

.line-results article > div {
  min-width: 0;
}

.line-results article strong,
.line-results article small {
  display: block;
}

.line-results article > div strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.line-results article small {
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 9px;
}

.line-results article > span:last-child {
  text-align: right;
}

.line-results article > span:last-child strong {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.result-actions {
  display: grid;
  gap: 9px;
}

.logs-page {
  padding-top: 18px;
}

.log-list {
  display: grid;
  gap: 8px;
}

.log-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.log-status {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--success);
  background: var(--success-soft);
}

.log-status.failed {
  color: var(--danger);
  background: var(--danger-soft);
}

.log-status .icon {
  width: 17px;
  height: 17px;
}

.log-row > div {
  min-width: 0;
}

.log-row strong,
.log-row code,
.log-row small {
  display: block;
}

.log-row strong {
  font-size: 11px;
}

.log-row code {
  overflow: hidden;
  margin: 2px 0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-row small {
  color: var(--ink-faint);
  font-size: 9px;
}

.log-result {
  color: var(--ink-faint);
  font-size: 10px;
  font-weight: 700;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 16px;
  bottom: calc(82px + var(--safe-bottom));
  left: 16px;
  max-width: 420px;
  margin: auto;
  padding: 12px 15px;
  border-radius: 11px;
  color: #fff;
  background: rgba(19, 34, 56, 0.96);
  box-shadow: 0 12px 30px rgba(19, 34, 56, 0.24);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  animation: toast-in 160ms ease-out;
}

.toast[data-tone="success"] {
  background: rgba(21, 132, 92, 0.97);
}

.toast[data-tone="warning"] {
  background: rgba(132, 97, 0, 0.97);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
}

.sheet-open {
  overflow: hidden;
}

.sheet-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  background: rgba(10, 20, 35, 0.55);
  backdrop-filter: blur(2px);
  animation: fade-in 160ms ease-out;
}

.bottom-sheet {
  position: fixed;
  z-index: 61;
  right: 0;
  bottom: 0;
  left: 0;
  max-width: 620px;
  max-height: 85vh;
  overflow-y: auto;
  margin: auto;
  padding: 10px 18px calc(22px + var(--safe-bottom));
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 50px rgba(19, 34, 56, 0.2);
  animation: sheet-in 190ms ease-out;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  margin: 0 auto 16px;
  border-radius: 99px;
  background: var(--line-strong);
}

.sheet-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.sheet-heading h2 {
  margin: 5px 0 0;
  font-size: 21px;
}

.sheet-heading .icon-button {
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--surface-warm);
}

.exception-list {
  display: grid;
  gap: 8px;
}

.exception-list button {
  min-height: 67px;
  display: grid;
  grid-template-columns: 40px 1fr 20px;
  align-items: center;
  gap: 11px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.exception-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--danger);
  background: var(--danger-soft);
}

.exception-icon .icon {
  width: 19px;
  height: 19px;
}

.exception-list button > span:nth-child(2) strong,
.exception-list button > span:nth-child(2) small {
  display: block;
}

.exception-list button > span:nth-child(2) strong {
  margin-bottom: 2px;
  font-size: 13px;
}

.exception-list button > span:nth-child(2) small {
  color: var(--ink-faint);
  font-size: 10px;
}

.exception-list button > .icon {
  width: 17px;
  height: 17px;
  color: var(--ink-faint);
}

.sheet-note,
.reset-copy {
  margin: 13px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  text-align: center;
}

.shortage-product {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px;
  border-radius: 11px;
  background: var(--surface-warm);
}

.shortage-product strong {
  font-size: 12px;
}

.shortage-product span {
  color: var(--ink-soft);
  font-size: 10px;
  white-space: nowrap;
}

.sheet-input {
  display: block;
  margin: 15px 0;
}

.sheet-input span {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.sheet-input input {
  width: 100%;
  height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface-warm);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 18px;
  font-weight: 800;
}

.danger-button {
  width: 100%;
  border: 1px solid var(--danger);
  color: #fff;
  background: var(--danger);
}

.danger-button .icon {
  width: 18px;
  height: 18px;
}

.reset-copy {
  margin: 0 0 16px;
  padding: 13px;
  border-radius: 11px;
  color: var(--ink-soft);
  background: var(--surface-warm);
  line-height: 1.6;
  text-align: left;
}

.camera-sheet-heading {
  margin-bottom: 12px;
}

.camera-preview {
  position: relative;
  min-height: 290px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at center, #25364d, #0c1726 70%);
}

.camera-preview video {
  width: 100%;
  height: 320px;
  display: block;
  object-fit: cover;
  background: #0c1726;
}

.scan-frame {
  position: absolute;
  inset: 20px;
  pointer-events: none;
}

.scan-frame i {
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: #ff6c4c;
  border-style: solid;
}

.scan-frame i:nth-child(1) {
  top: 0;
  left: 0;
  border-width: 3px 0 0 3px;
  border-radius: 8px 0 0;
}

.scan-frame i:nth-child(2) {
  top: 0;
  right: 0;
  border-width: 3px 3px 0 0;
  border-radius: 0 8px 0 0;
}

.scan-frame i:nth-child(3) {
  right: 0;
  bottom: 0;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 8px;
}

.scan-frame i:nth-child(4) {
  bottom: 0;
  left: 0;
  border-width: 0 0 3px 3px;
  border-radius: 0 0 0 8px;
}

.scan-frame > span {
  position: absolute;
  right: 12px;
  left: 12px;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #ff6c4c 16%, #ff6c4c 84%, transparent);
  box-shadow: 0 0 12px rgba(255, 108, 76, 0.75);
  animation: scan-line 2s ease-in-out infinite;
}

.camera-status {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 10px;
  color: #fff;
  background: rgba(7, 16, 29, 0.76);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
  backdrop-filter: blur(8px);
}

.camera-status.ready {
  color: #8fe7c2;
}

.camera-status.success {
  color: #fff;
  background: rgba(21, 132, 92, 0.9);
}

.camera-status.error {
  color: #ffd3ca;
  background: rgba(127, 35, 25, 0.92);
}

.camera-status .icon {
  width: 16px;
  height: 16px;
}

.camera-loader {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: camera-spin 0.85s linear infinite;
}

.camera-target {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-warm);
}

.camera-target span {
  color: var(--ink-faint);
  font-size: 10px;
}

.camera-target code {
  overflow: hidden;
  color: var(--accent-dark);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.camera-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.camera-tool {
  min-height: 42px;
  padding: 0 10px;
  font-size: 11px;
}

.camera-tool .icon {
  width: 17px;
  height: 17px;
}

.camera-tip {
  margin: 10px 4px 0;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.5;
  text-align: center;
}

@keyframes camera-spin {
  to { transform: rotate(360deg); }
}

@keyframes scan-line {
  0%, 100% { transform: translateY(-82px); opacity: 0.45; }
  50% { transform: translateY(82px); opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes sheet-in {
  from { transform: translateY(100%); }
}

@media (min-width: 760px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    max-width: 760px;
    min-height: calc(100vh - 48px);
    margin: auto;
    overflow: hidden;
    border-radius: 24px;
    box-shadow: 0 22px 70px rgba(19, 34, 56, 0.18);
  }

  .app-header {
    border-radius: 24px 24px 0 0;
  }

  .bottom-nav {
    right: 50%;
    left: auto;
    width: 760px;
    transform: translateX(50%);
  }

  .page {
    padding-right: 26px;
    padding-left: 26px;
  }

  .task-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 359px) {
  .page {
    padding-right: 12px;
    padding-left: 12px;
  }

  .app-header {
    padding-right: 12px;
    padding-left: 12px;
  }

  .demo-badge {
    padding: 0 8px;
    font-size: 10px;
  }

  .shift-banner {
    padding: 18px;
  }

  .shift-mark {
    width: 56px;
    height: 56px;
  }

  .scan-rail {
    padding-right: 0;
    padding-left: 0;
  }

  .rail-step small {
    font-size: 8px;
  }

  .simulate-button {
    padding: 0 10px;
  }

  .simulate-button strong {
    display: none;
  }

  .camera-preview video {
    height: 270px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
