:root {
  color-scheme: light;
  --ink: #102f2b;
  --muted: #3d645c;
  --line: #c9ddce;
  --paper: #fff;
  --wash: #f3f7f2;
  --success: #9fd1ae;
  --orange: #e99a5b;
  --blue: #b8dcff;
  --purple: #e0c8fa;
  --red: #d6a09a;
  --red-ink: #6a2b28;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wash);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-height: 100%;
  background: var(--wash);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  background: radial-gradient(circle at 82% 20%, #eff9e6 0, transparent 28rem), var(--wash);
  font-size: 16px;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

strong,
b {
  font-weight: var(--weight-semibold);
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:not(:disabled),
a {
  cursor: pointer;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: .75rem 1rem;
  border-radius: .5rem;
  color: white;
  background: var(--ink);
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 72px;
  margin: 0 auto;
  padding-inline: max(16px, calc((100% - 440px) / 2 + 16px));
  background: rgba(255, 255, 255, .96);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  align-content: center;
  gap: 4px;
  width: 32px;
  height: 32px;
  padding: 8px;
  border-radius: 9px;
  background: var(--ink);
}

.brand-mark i {
  display: block;
  height: 3px;
  border-radius: 1rem;
  background: var(--paper);
}

.brand-mark i:nth-child(2) {
  width: 72%;
}

.brand-mark i:nth-child(3) {
  width: 42%;
}

.brand > span:last-child {
  display: grid;
  line-height: 1.05;
}

.brand strong {
  font-size: 13px;
  font-weight: var(--weight-semibold);
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 8px;
  font-weight: var(--weight-medium);
  text-transform: uppercase;
}

.top-reset {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: var(--orange);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  touch-action: manipulation;
}

#app {
  outline: none;
}

.mobile-shell {
  width: min(100%, 440px);
  margin: 0 auto;
  padding: 28px 16px 48px;
}

.page-heading {
  margin-bottom: 20px;
}

.eyebrow {
  display: block;
  color: white;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  line-height: 1.2;
  text-transform: uppercase;
}

.eyebrow--dark {
  margin-bottom: 8px;
  color: var(--muted);
}

h1 {
  margin: 0;
  font-size: clamp(32px, 10vw, 44px);
  font-weight: var(--weight-bold);
  line-height: .98;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.completed-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 4px 8px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: white;
  color: var(--muted);
  font-size: 13px;
  touch-action: manipulation;
}

.completed-toggle span,
.completed-toggle b {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e7f0e7;
}

.completed-toggle.is-active {
  border-color: var(--success);
  color: var(--ink);
}

.picker-overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.picker-overview header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.person-face {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background: #e7f0e7;
}

.picker-overview > div {
  display: flex;
  gap: 22px;
}

.picker-overview > div span {
  display: grid;
  text-align: center;
}

.picker-overview b,
.run-stats strong {
  font-size: 23px;
  line-height: 1;
}

.picker-overview small,
.run-stats small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: var(--weight-medium);
  text-transform: uppercase;
}

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

.order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  text-align: left;
  box-shadow: 0 8px 22px rgba(16, 47, 43, .04);
  touch-action: manipulation;
}

.order-row > span:first-child {
  display: grid;
  gap: 7px;
}

.order-row strong {
  font-size: 22px;
  font-weight: var(--weight-semibold);
}

.order-row small {
  color: var(--muted);
  font-size: 14px;
}

.run-status {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: white;
  background: var(--ink);
  font-weight: var(--weight-bold);
}

.run-status--complete {
  color: var(--ink);
  background: var(--success);
}

.run-status--in-progress {
  color: var(--ink);
  background: var(--blue);
}

.workflow-screen {
  min-height: calc(100vh - 72px);
  min-height: calc(100svh - 72px);
}

.workflow-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: inherit;
}

.flow-masthead {
  width: 100%;
  color: white;
  background: var(--ink);
}

.workflow-toolbar,
.flow-header,
.workflow-body {
  width: min(100%, 440px);
  margin-inline: auto;
}

.workflow-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 0 16px;
}

.back,
.workflow-undo {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: white;
  font-size: 12px;
  font-weight: var(--weight-semibold);
  touch-action: manipulation;
}

.workflow-undo {
  padding: 8px 11px;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.flow-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  padding: 8px 16px 20px;
}

.flow-header h1 {
  margin-top: 6px;
  font-size: 30px;
}

.flow-header > strong {
  padding-bottom: 4px;
  font-size: 13px;
  font-weight: var(--weight-semibold);
}

.workflow-body {
  padding: 18px 16px 28px;
}

.run-body {
  display: grid;
  align-content: start;
  gap: 16px;
}

.run-assignment {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.run-assignment span {
  display: grid;
}

.run-assignment small {
  color: var(--muted);
  font-size: 10px;
  font-weight: var(--weight-medium);
  text-transform: uppercase;
}

.run-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 14px 0;
  border-block: 1px solid var(--line);
}

.run-stats div {
  display: grid;
  text-align: center;
}

.order-summary {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.order-summary div,
.completed-totes article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 13px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.order-summary div:last-child,
.completed-totes article > div:last-child {
  border-bottom: 0;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 10px;
  color: white;
  background: var(--ink);
  font-weight: var(--weight-semibold);
  touch-action: manipulation;
}

.scanner-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 38px auto;
  gap: 10px;
  min-height: 0;
}

.scanner-workflow--item {
  --scan-colour: var(--blue);
}

.scanner-workflow--tote {
  --scan-colour: var(--purple);
}

.scanner-workflow .flow-masthead {
  color: #071b18;
  background: var(--scan-colour);
}

.scanner-workflow .flow-masthead .eyebrow,
.scanner-workflow .flow-masthead .back {
  color: #071b18;
}

.assignment-list {
  align-self: start;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  -webkit-overflow-scrolling: touch;
}

.assignment-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 80px;
  padding: 7px 13px;
  border-bottom: 1px solid var(--line);
}

.assignment-row:last-child {
  border-bottom: 0;
}

.assignment-row > span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e7f0e7;
  font-size: 12px;
  font-weight: var(--weight-bold);
}

.assignment-details {
  display: grid;
  gap: 0;
  margin: 0;
}

.assignment-details > div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 0;
  min-height: 32px;
}

.assignment-details dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: var(--weight-medium);
  text-transform: uppercase;
}

.assignment-details dd {
  margin: 0;
  font-size: 13px;
  font-weight: var(--weight-regular);
}

.assignment-details > div:first-child dd {
  font-weight: var(--weight-medium);
}

.assignment-row.is-active {
  background: var(--purple);
}

.assignment-row.is-active > span {
  color: white;
  background: var(--ink);
}

.assignment-row.is-done > span {
  background: var(--success);
}

.scan-info {
  align-self: start;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.scan-main {
  display: contents;
}

.scan-main > span,
.scan-main > button {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  min-height: 52px;
  padding: 10px 13px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.scan-main small,
.quantity-units > small {
  color: var(--muted);
  font-size: 9px;
  font-weight: var(--weight-medium);
  text-transform: uppercase;
}

.scan-main strong {
  margin-top: 0;
  font-size: 13px;
  font-weight: var(--weight-medium);
}

.quantity-units {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  min-height: 52px;
  padding: 10px 13px;
}

.quantity-units > div {
  display: flex;
  align-items: center;
  gap: 4px;
}

.quantity-unit {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e7f0e7;
  font-size: 10px;
  font-weight: var(--weight-semibold);
  line-height: 0;
}

.quantity-unit--scanned {
  background: var(--success);
}

.quantity-unit--unavailable {
  color: var(--red-ink);
  background: var(--red);
}

.status-mark {
  display: block;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.exception-space {
  display: flex;
  justify-content: center;
  min-height: 38px;
}

.exception-button {
  min-height: 36px;
  padding: 0 18px;
  border: 1px solid var(--red);
  border-radius: 9px;
  background: white;
  color: var(--red-ink);
  font-size: 12px;
  font-weight: var(--weight-semibold);
  touch-action: manipulation;
}

.camera-scanner {
  overflow: hidden;
  border-radius: 15px;
  color: white;
  background: #081c1a;
}

.camera-scanner > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 13px;
  color: #071b18;
  background: var(--scan-colour);
  font-size: 12px;
}

.camera-scanner > header b {
  color: inherit;
}

.camera-frame {
  position: relative;
  height: 150px;
  overflow: hidden;
  background: linear-gradient(135deg, #304a46, #0c2622);
}

.camera-video,
.camera-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-fallback {
  opacity: .35;
  background: repeating-linear-gradient(105deg, transparent 0 35px, rgba(255,255,255,.1) 36px 38px);
}

.barcode-preview {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 14px 16px 10px;
  border-radius: 6px;
  background: white;
  transform: translate(-50%, -50%);
}

.barcode-preview i {
  width: 112px;
  height: 36px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 6px, transparent 6px 9px);
}

.barcode-preview strong {
  padding: 0;
  color: var(--ink);
  font-size: 10px;
}

.camera-target {
  position: absolute;
  inset: 18px;
  border: 2px solid var(--scan-colour);
  border-radius: 8px;
}

.scan-button {
  width: 100%;
  min-height: 44px;
  border: 0;
  background: var(--scan-colour);
  color: #071b18;
  font-weight: var(--weight-semibold);
  touch-action: manipulation;
}

.scan-button.is-loading {
  opacity: .65;
}

.complete-body {
  display: grid;
  align-content: start;
  gap: 18px;
}

.completed-totes {
  display: grid;
  gap: 12px;
}

.completed-totes article {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}

.completed-totes article > header {
  display: flex;
  justify-content: space-between;
  padding: 11px 13px;
  background: var(--purple);
  font-size: 13px;
}

.product-lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(4, 20, 17, .72);
}

.product-lightbox article {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: min(100%, 380px);
  border-radius: 16px;
  background: white;
}

.product-lightbox img {
  display: block;
  width: 100%;
  max-height: 60vh;
  object-fit: contain;
  background: #e7f0e7;
}

.product-lightbox footer {
  display: grid;
  gap: 4px;
  padding: 16px;
}

.product-lightbox footer small {
  color: var(--muted);
}

.lightbox-close {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: white;
  font-size: 22px;
}

@media (max-width: 560px) {
  .workflow-active .site-header {
    display: none;
  }

  .workflow-screen {
    min-height: 100vh;
    min-height: 100svh;
  }

  .flow-masthead {
    min-height: 0;
  }

  .flow-header {
    min-height: 0;
    padding-top: 8px;
    padding-bottom: 18px;
  }

  .workflow-body {
    padding-top: 14px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom));
  }

  .scanner-workflow .workflow-body {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .camera-frame {
    height: clamp(120px, 22vh, 165px);
  }
}

@media (max-width: 380px) {
  .mobile-shell {
    padding-inline: 12px;
  }

  .site-header,
  .workflow-toolbar,
  .flow-header,
  .workflow-body {
    padding-inline: 12px;
  }

  .page-title-row h1 {
    font-size: 36px;
  }

  .completed-toggle {
    gap: 5px;
    font-size: 11px;
  }

  .completed-toggle span,
  .completed-toggle b {
    width: 28px;
    height: 28px;
  }

  .picker-overview > div {
    gap: 12px;
  }
}
