/* Scan Station: big, bright, readable from across the bench. */
:root {
  --bg: #eef1f5;
  --card: #ffffff;
  --ink: #16202b;
  --muted: #5c6b7a;
  --line: #d5dce4;
  --top: #0f2a1d;
  --top-ink: #ffffff;
  --info: #1f5fbf;
  --good: #16803a;
  --good-soft: #e3f5e9;
  --bad: #c92a2a;
  --bad-soft: #fde8e8;
  --warn: #b26a00;
  --warn-soft: #fff4e0;
  --idle: #36414d;
  --idle-ink: #ffffff;
  --accent: #16803a;
  --foot: #cfd6de;
  --foot-ink: #1d2731;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #11161c;
    --card: #1b232c;
    --ink: #eef2f6;
    --muted: #9aa8b6;
    --line: #2c3742;
    --good-soft: #143322;
    --bad-soft: #3a1717;
    --warn-soft: #3a2a10;
    --idle: #1f2730;
    --foot: #2a333d;
    --foot-ink: #e6ebf0;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #11161c;
  --card: #1b232c;
  --ink: #eef2f6;
  --muted: #9aa8b6;
  --line: #2c3742;
  --good-soft: #143322;
  --bad-soft: #3a1717;
  --warn-soft: #3a2a10;
  --idle: #1f2730;
  --foot: #2a333d;
  --foot-ink: #e6ebf0;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
}
body {
  background: var(--bg);
  color: var(--ink);
  font:
    16px/1.35 -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

#app {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: 100%;
}
#main {
  overflow: auto;
}

/* Top bar */
#top {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  background: var(--top);
  color: var(--top-ink);
  padding: 10px 18px;
}
.brand {
  font-weight: 800;
  font-size: 20px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mode {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.06em;
}
.mode.demo {
  background: #7b4fd6;
}
.mode.test {
  background: #e09b00;
  color: #1a1300;
}
.mode.live {
  background: #16803a;
}
#scanForm {
  flex: 1 1 320px;
  min-width: 0;
}
#scan {
  width: 100%;
  font-size: 20px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #3d6b52;
  background: #ffffff;
  color: #111;
}
#scan:focus {
  outline: 3px solid #8fe0ad;
  outline-offset: 1px;
}
#chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.chip {
  font-size: 13px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip.ok {
  background: rgba(80, 200, 120, 0.25);
}
.chip.warn {
  background: rgba(255, 190, 60, 0.25);
}
.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--top-ink);
  padding: 8px 12px;
  border-radius: 10px;
}

/* The next-step bar */
#bar {
  overflow: hidden;
  padding: 18px 24px;
  color: #fff;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
#bar .msg {
  font-size: clamp(22px, 3.2vw, 40px);
  font-weight: 800;
  line-height: 1.15;
}
#bar .last {
  font-size: 15px;
  opacity: 0.9;
}
.tone-info {
  background: var(--info);
}
.tone-good {
  background: var(--good);
}
.tone-bad {
  background: var(--bad);
}
.tone-warn {
  background: var(--warn);
}
.shake .msg {
  animation: shake 0.35s;
}
@keyframes shake {
  0%,
  100% {
    transform: none;
  }
  25% {
    transform: translateX(-8px);
  }
  75% {
    transform: translateX(8px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .shake .msg,
  .line.flash {
    animation: none;
  }
}

/* Idle: the waiting screen with the open orders */
#main.idle {
  display: flex;
}
.idle-screen {
  flex: 1;
  background: var(--idle);
  color: var(--idle-ink);
  display: flex;
  flex-direction: column;
  padding: 28px 16px;
}
.idle-inner {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  width: 100%;
}
.idle-screen .big {
  font-size: clamp(34px, 5.5vw, 68px);
  font-weight: 800;
}
.idle-screen .sub {
  font-size: 20px;
  opacity: 0.85;
}
.open-orders {
  margin-top: 18px;
  width: min(920px, 100%);
  text-align: left;
  display: grid;
  gap: 8px;
}
.ohead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
}
.olist {
  display: grid;
  gap: 8px;
}
.orow {
  display: grid;
  grid-template-columns: 84px minmax(0, 1.3fr) minmax(0, 1.2fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 12px 16px;
  border-radius: 10px;
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 17px;
}
.orow:hover,
.orow:focus-visible {
  background: rgba(255, 255, 255, 0.2);
}
.orow.later {
  opacity: 0.7;
}
.onum {
  font-weight: 800;
  font-size: 20px;
}
.owho {
  display: grid;
  min-width: 0;
}
.owho b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.owho small {
  opacity: 0.75;
  font-size: 14px;
}
.owhere {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.owhere .badge {
  font-size: 11px;
  padding: 3px 7px;
}
.omore {
  white-space: nowrap;
  opacity: 0.85;
  font-size: 15px;
}
.tag {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
}
.tag.held {
  background: var(--warn);
}
.tag.packed {
  background: var(--good);
}
.oempty,
.oerr {
  padding: 16px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}
.oerr {
  background: rgba(201, 42, 42, 0.35);
}
.extra-orders {
  margin-top: 6px;
  display: grid;
  gap: 8px;
  width: min(920px, 100%);
  text-align: left;
}
.extra-orders .hint {
  opacity: 0.8;
}
.extra-orders button {
  text-align: left;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  font-size: 16px;
}
.extra-orders b {
  display: inline-block;
  min-width: 72px;
}
.mini {
  padding: 5px 10px !important;
  font-size: 13px !important;
  border-radius: 8px;
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font-weight: 700;
}
.idle-screen .mini {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

/* Order view */
#main.order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 18px;
  padding: 18px;
  align-items: start;
}
#main.finished {
  grid-template-columns: minmax(0, 760px);
  justify-content: center;
}
.left {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.orderhead {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 4px 14px;
  align-items: center;
  border: 1px solid var(--line);
}
.ordernum {
  font-size: 30px;
  font-weight: 800;
}
.customer {
  font-size: 22px;
  font-weight: 700;
  justify-self: end;
  text-align: right;
}
.method,
.progress {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 16px;
}
.progress {
  font-weight: 700;
  color: var(--ink);
}
.badge {
  font-size: 14px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 8px;
  color: #fff;
  letter-spacing: 0.05em;
}
.badge.ship {
  background: var(--info);
}
.badge.pickup {
  background: #7b4fd6;
}
.badge.local {
  background: #0f8a8a;
}
.warnings {
  margin: 0;
  padding: 12px 16px 12px 34px;
  background: var(--warn-soft);
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  font-weight: 600;
}
.lines {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 96px 96px;
  gap: 14px;
  align-items: center;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  transition:
    background 0.2s,
    border-color 0.2s;
}
.line.complete {
  background: var(--good-soft);
  border-color: var(--good);
}
.line.tappable {
  cursor: pointer;
}
.line.tappable:hover {
  border-color: var(--info);
}
.checks {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.check {
  padding: 8px 16px;
  border-radius: 10px;
  border: 2px solid var(--good);
  background: var(--card);
  color: var(--good);
  font-weight: 800;
  font-size: 16px;
}
.check:hover {
  background: var(--good);
  color: #fff;
}
.check.all {
  border-style: dashed;
}
.progress .hint {
  font-weight: 500;
  color: var(--muted);
}
.line.flash {
  animation: pop 0.5s;
}
@keyframes pop {
  0% {
    transform: scale(1.02);
    box-shadow: 0 0 0 6px rgba(22, 128, 58, 0.35);
  }
  100% {
    transform: none;
    box-shadow: none;
  }
}
.thumb img,
.noimg {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 8px;
  background: #f2f2f2;
  display: grid;
  place-items: center;
  font-size: 40px;
}
.info .title {
  font-size: 21px;
  font-weight: 800;
}
.info .details {
  color: var(--muted);
  font-size: 16px;
  margin-top: 2px;
}
.info .code {
  font-size: 14px;
  margin-top: 6px;
  color: var(--muted);
}
.count {
  text-align: center;
}
.count .lbl {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
.count .num {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.1;
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 4px 0;
  background: var(--card);
}
.line.complete .scanned .num {
  background: var(--good);
  color: #fff;
  border-color: var(--good);
}

/* Done */
.done {
  background: var(--card);
  border: 3px solid var(--good);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  display: grid;
  gap: 10px;
}
.done .tick {
  font-size: 80px;
  color: var(--good);
  line-height: 1;
}
.done .big {
  font-size: 30px;
  font-weight: 800;
}
.done .detail {
  font-size: 18px;
  color: var(--muted);
}
.done .ok {
  color: var(--good);
  font-weight: 700;
  font-size: 18px;
}
.done .warn {
  color: var(--warn);
  font-weight: 700;
  font-size: 18px;
}
.done .actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.done .next {
  font-size: 16px;
  color: var(--muted);
}
.done .actions .primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-size: 20px;
  padding: 12px 26px;
}
.danger.strong {
  background: var(--bad) !important;
  color: #fff !important;
}

/* Right panel */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.panel h3 {
  margin: 6px 0 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.panel h3.split {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.panel h3 .mini {
  text-transform: none;
  letter-spacing: 0;
  color: var(--info);
}
.panel h3 small {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  margin-left: 6px;
}
.panel .explain {
  margin: 0;
  color: var(--muted);
}
.boxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.box {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: 'k n' 'k s';
  column-gap: 8px;
  align-items: center;
  text-align: left;
  padding: 7px 9px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--card);
}
.box .kbd {
  grid-area: k;
}
.box .bname {
  grid-area: n;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.box .bsize {
  grid-area: s;
}
.box.sel {
  border-color: var(--good);
  background: var(--good-soft);
  font-weight: 700;
}
.kbd {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 4px;
  text-align: center;
}
.bname {
  font-size: 13px;
  line-height: 1.2;
}
.bsize {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.weight .wbig {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
}
.weight .wsub {
  color: var(--muted);
  font-size: 14px;
}
#weightForm {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
#weightForm button {
  white-space: nowrap;
}
#weight {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--card);
  font-size: 17px;
}
#weightForm button,
.row button,
.done .actions button,
.modal button,
.btn {
  padding: 9px 14px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--card);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}
.rates {
  display: grid;
  gap: 6px;
}
.rate {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: 'n p' 't p';
  text-align: left;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--card);
}
.rate.sel {
  border-color: var(--good);
  background: var(--good-soft);
}
.rname {
  grid-area: n;
  font-weight: 700;
}
.rname em {
  font-style: normal;
  font-size: 12px;
  background: var(--info);
  color: #fff;
  padding: 1px 6px;
  border-radius: 6px;
  margin-left: 4px;
}
.rtime {
  grid-area: t;
  font-size: 13px;
  color: var(--muted);
}
.rprice {
  grid-area: p;
  font-size: 22px;
  font-weight: 800;
  align-self: center;
}
.loading,
.muted {
  color: var(--muted);
  padding: 6px 2px;
}
.note {
  background: var(--warn-soft);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
}
.customs {
  font-size: 13px;
  color: var(--muted);
}
.buy {
  margin-top: 4px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  display: grid;
  gap: 2px;
}
.buy span {
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.row button {
  flex: 1 1 auto;
  font-size: 14px;
  padding: 8px 10px;
}
.danger {
  border-color: var(--bad) !important;
  color: var(--bad) !important;
}

/* Footer */
#foot {
  padding: 16px 24px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--foot);
  color: var(--foot-ink);
  font-size: 22px;
  font-weight: 800;
}
#foot.verified {
  background: var(--good);
  color: #fff;
}
#foot .muted {
  color: var(--foot-ink);
  opacity: 0.75;
  font-weight: 600;
  font-size: 18px;
}

/* Overlays */
#overlay:empty {
  display: none;
}
#overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 20, 0.55);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 10;
}
.modal {
  background: var(--card);
  color: var(--ink);
  border-radius: 14px;
  padding: 18px;
  width: min(520px, 100%);
  max-height: 92vh;
  overflow: auto;
  display: grid;
  gap: 10px;
}
.modal.wide {
  width: min(760px, 100%);
}
.modal h4 {
  margin: 10px 0 0;
}
.modal h4 small {
  font-weight: 500;
  color: var(--muted);
  margin-left: 6px;
}
.modal .small {
  font-size: 13px;
  padding: 0;
}
.picks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pick {
  padding: 7px 12px !important;
  border-radius: 999px !important;
  font-size: 14px;
}
.pick.on {
  border-color: var(--good) !important;
  background: var(--good-soft) !important;
  font-weight: 800;
}
.sgroup {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 8px;
  align-items: center;
}
.sgroup > span {
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}
.docs {
  display: grid;
  gap: 12px;
}
.docs.two {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.doc {
  margin: 0;
  display: grid;
  gap: 6px;
}
.doc figcaption {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}
.docs.two .pdf {
  height: min(62vh, 560px);
}
.mhead {
  display: grid;
  gap: 4px;
}
.mhead span {
  color: var(--muted);
  font-size: 14px;
}
.mhead .pinerr {
  color: var(--bad);
  font-weight: 700;
}
.mfoot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.pdf {
  width: 100%;
  height: min(70vh, 640px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.opt {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
}
#pinForm {
  display: flex;
  gap: 8px;
}
#pin {
  flex: 1;
  font-size: 22px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 2px solid var(--line);
}

/* Narrow screens (a phone or a small tablet at the bench) */
@media (max-width: 960px) {
  #app {
    height: auto;
    min-height: 100%;
  }
  #main {
    overflow: visible;
  }
  #main.order {
    grid-template-columns: 1fr;
    padding: 12px 16px;
  }
  .boxes {
    grid-template-columns: 1fr;
  }
  .panel {
    position: static;
  }
  .line {
    grid-template-columns: 64px minmax(0, 1fr) 64px 64px;
    gap: 8px;
  }
  .thumb img,
  .noimg {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }
  .count .num {
    font-size: 30px;
  }
  .info .title {
    font-size: 18px;
  }
  .orderhead {
    grid-template-columns: auto 1fr;
  }
  .customer {
    grid-column: 1 / -1;
    justify-self: start;
    text-align: left;
  }
  #top {
    padding: 10px 16px;
  }
  #bar {
    padding: 14px 16px;
  }
  .orow {
    grid-template-columns: auto 1fr;
    gap: 4px 12px;
  }
  .owhere,
  .omore {
    grid-column: 1 / -1;
  }
  .sgroup {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .check {
    padding: 8px 12px;
  }
}

/* On-screen 4 x 6 label (demo) */
.label4x6 {
  width: min(384px, 100%);
  aspect-ratio: 4 / 6;
  margin: 0 auto;
  background: #fff;
  color: #000;
  border: 1px solid #999;
  border-radius: 4px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-family: Helvetica, Arial, sans-serif;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}
.label4x6 .lhead {
  background: #000;
  color: #fff;
  font-weight: 800;
  font-size: 34px;
  text-align: center;
  margin: -16px -16px 6px;
  padding: 10px;
}
.label4x6 .lbox {
  border: 3px solid #000;
  font-weight: 800;
  font-size: 22px;
  text-align: center;
  padding: 8px;
}
.label4x6 .lname {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}
.label4x6 .lorder {
  font-size: 20px;
  font-weight: 800;
}
.label4x6 .lstore,
.label4x6 .lmethod,
.label4x6 .lunits {
  font-size: 13px;
}
.label4x6 .lunits {
  font-weight: 800;
  border-top: 1px solid #000;
  padding-top: 4px;
}
.label4x6 .lto {
  font-size: 11px;
  font-weight: 800;
  margin-top: 8px;
}
.label4x6 .laddr {
  font-size: 15px;
  line-height: 1.3;
}
.label4x6 .litems {
  margin: 0;
  padding-left: 16px;
  font-size: 11px;
  flex: 1;
  overflow: hidden;
}
.label4x6 .lbar {
  margin-top: auto;
  text-align: center;
  font-size: 11px;
}
.label4x6 .lbar svg {
  width: 80%;
  height: 64px;
}
.label4x6 .lfoot {
  text-align: right;
  font-weight: 800;
}
.label4x6 .lthanks {
  text-align: center;
  font-weight: 800;
  font-size: 14px;
  margin-top: 8px;
}
.label4x6 .lthanks small {
  display: block;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.12em;
}
.label4x6 .lhead.small {
  font-size: 22px;
  margin: 0 -16px 4px;
  padding: 6px;
}
.label4x6 .lname.small {
  font-size: 18px;
}
.label4x6.slip .lbar {
  margin-top: 2px;
}
.label4x6.slip .lbar svg {
  height: 44px;
  width: 60%;
}
.slines {
  display: grid;
  gap: 6px;
  align-content: start;
  border-top: 1px solid #000;
  padding-top: 6px;
  overflow: hidden;
  flex: 1;
}
.sline {
  display: grid;
  grid-template-columns: 32px 1fr 110px;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}
.sline b {
  font-size: 16px;
}
.sline small {
  color: #444;
}
.sline svg {
  width: 100%;
  height: 30px;
}

/* On-screen barcode sheet (demo) */
.sheetgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  max-height: 70vh;
  overflow: auto;
}
.sheetcell {
  background: #fff;
  color: #000;
  border: 1px solid #bbb;
  border-radius: 6px;
  padding: 10px;
  display: grid;
  gap: 4px;
  justify-items: center;
  text-align: center;
}
.sheetcell span {
  font-size: 12px;
  color: #444;
}
.sheetcell svg {
  width: 100%;
  height: 56px;
}
.sheetcell code {
  font-size: 11px;
  color: #555;
}

/* Already done for this order (labels, prints, store update) */
.history {
  background: var(--warn-soft);
  border: 2px solid var(--warn);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: grid;
  gap: 6px;
}
.history ul {
  margin: 0;
  padding-left: 20px;
}
.history small {
  color: var(--muted);
}
.history .actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.history button {
  padding: 8px 14px;
  border-radius: 10px;
  border: 2px solid var(--warn);
  background: var(--card);
  font-weight: 700;
}

/* A fulfilled order refused on the waiting screen */
.anyway {
  background: rgba(255, 190, 60, 0.18);
  border: 1px solid rgba(255, 190, 60, 0.6);
  border-radius: 12px;
  padding: 12px 16px;
  display: grid;
  gap: 6px;
  justify-items: center;
  width: min(920px, 100%);
}
.anyway button {
  padding: 8px 16px;
  border-radius: 10px;
  border: 0;
  background: #ffbe3c;
  color: #1a1300;
  font-weight: 800;
}
.anyway small {
  opacity: 0.8;
}

/* Uncheck an item checked by mistake */
.uncheck {
  padding: 8px 14px;
  border-radius: 10px;
  border: 2px solid var(--muted);
  background: var(--card);
  color: var(--muted);
  font-weight: 700;
  font-size: 15px;
}
.uncheck:hover {
  border-color: var(--warn);
  color: var(--warn);
}

/* Packages that have no button */
.otherpkg {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 14px;
}

/* The price on Buy & Print stands out from the green */
.buy .buyline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: inherit;
  opacity: 1;
  font-weight: 800;
}
.buy .price {
  background: #ffffff;
  color: #0b3d1e;
  font-size: 30px;
  font-weight: 900;
  padding: 2px 14px;
  border-radius: 10px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
  letter-spacing: 0.01em;
}
.anyway-buy {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  font-weight: 800;
}

/* Each previewed document gets its own buttons */
.doc figcaption {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.doc figcaption button,
.doc figcaption .btn {
  font-size: 14px;
  padding: 7px 12px;
}

/* Modal footer helpers */
.mfoot .grow {
  flex: 1;
}
.modal .primary,
.mfoot .primary {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

/* Package editor */
.packages .pkglist {
  display: grid;
  gap: 12px;
  max-height: 64vh;
  overflow: auto;
  padding-right: 4px;
}
.pkg {
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin: 0;
  display: grid;
  gap: 8px;
}
.pkghead {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.pkgcode {
  font:
    700 12px ui-monospace,
    Menlo,
    monospace;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 3px 6px;
}
.pkgname {
  flex: 1 1 240px;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 8px;
  border: 2px solid var(--line);
  background: var(--card);
}
.pkgmove {
  display: flex;
  gap: 4px;
}
.pkggrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 12px;
}
.pkggrid label {
  display: grid;
  gap: 3px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}
.pkggrid input,
.pkggrid select {
  font-size: 15px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  min-width: 0;
}
.pkggrid .dims {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pkggrid .dims input {
  width: 100%;
}
.pkggrid label.opt {
  display: flex;
  font-weight: 600;
  color: var(--ink);
}
.pkgflags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
  font-size: 13px;
}
.pkgflags > span {
  color: var(--muted);
  font-weight: 700;
  width: 100%;
}
.pkgerr {
  background: var(--bad-soft);
  border: 1px solid var(--bad);
  color: var(--bad);
  border-radius: 8px;
  padding: 8px 12px;
  font-weight: 700;
}

/* Barcode sheet picker */
.sheetgroups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  max-height: 62vh;
  overflow: auto;
}
.sheetgroup {
  display: grid;
  gap: 2px;
  align-content: start;
}
.sghead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  margin-bottom: 4px;
}
.sheetgroup .opt {
  align-items: flex-start;
  font-size: 14px;
}
.sheetgroup small {
  color: var(--muted);
}
.sheetgroup code {
  font-size: 11px;
  color: var(--muted);
}

/* Keep the shipment panel on one screen of a 13-inch laptop */
.panel {
  gap: 6px;
}
.weight .wbig {
  font-size: 26px;
}
.panel .row button {
  padding: 7px 8px;
}

/* Next order and Order list sit in the order header, always in view */
.ordernav {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: -4px;
}
.ordernav button {
  padding: 6px 12px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--card);
  font-weight: 700;
  font-size: 14px;
}

/* Shipments screen */
#shipBtn .count {
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
  background: var(--bad);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: 4px;
}
.modal.full {
  width: min(1280px, 100%);
  height: min(92vh, 1000px);
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  padding: 16px;
}
.shead {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.stitle {
  display: grid;
  margin-right: auto;
}
.stitle b {
  font-size: 22px;
}
.stitle span {
  color: var(--muted);
  font-size: 13px;
}
.ssearch,
.shead select {
  padding: 9px 12px;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
.ssearch {
  flex: 1 1 240px;
  min-width: 0;
  max-width: 420px;
}
.stabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.modal .stab {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
}
.stab em {
  font-style: normal;
  font-weight: 800;
  margin-left: 4px;
  color: var(--muted);
}
.modal .stab.on {
  border-color: var(--info);
  background: var(--info);
  color: #fff;
}
.stab.on em {
  color: #fff;
}
.stab.hot:not(.on) em {
  color: var(--bad);
}
.sbody {
  display: grid;
  grid-template-columns: minmax(300px, 5fr) minmax(0, 7fr);
  gap: 14px;
  min-height: 0;
}
.slist,
.sdetail {
  overflow: auto;
  min-height: 0;
}
.slist {
  display: grid;
  align-content: start;
  gap: 6px;
  padding-right: 2px;
}
.modal .srow {
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 9px 12px;
  border-radius: 10px;
  font-weight: 400;
  width: 100%;
}
.modal .srow.sel {
  border-color: var(--info);
  box-shadow: 0 0 0 1px var(--info) inset;
}
.modal .srow.attn {
  border-left: 6px solid var(--warn);
}
.stop {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.sord {
  font-weight: 800;
}
.sname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.swhere,
.slast {
  font-size: 13px;
  color: var(--muted);
}
.sattn {
  font-size: 13px;
  font-weight: 700;
  color: var(--warn);
}
.sattn.big {
  background: var(--warn-soft);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 15px;
}
.spill {
  font-size: 12px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  background: var(--line);
  color: var(--ink);
}
.spill.t-moving {
  background: var(--info);
  color: #fff;
}
.spill.t-done {
  background: var(--good);
  color: #fff;
}
.spill.t-problem {
  background: var(--bad);
  color: #fff;
}
.spill.t-voided {
  text-decoration: line-through;
}
.sempty {
  color: var(--muted);
  padding: 24px 8px;
  text-align: center;
}
.sdetail {
  display: grid;
  align-content: start;
  gap: 10px;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.sdetail.empty {
  place-items: center;
  align-content: center;
  color: var(--muted);
  text-align: center;
}
.sdhead {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.sdhead b {
  font-size: 20px;
}
.sdhead span:last-child {
  color: var(--muted);
}
.steps {
  list-style: none;
  margin: 4px 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.steps li {
  display: grid;
  justify-items: center;
  gap: 4px;
  position: relative;
}
.steps li span {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--card);
  z-index: 1;
}
.steps li::before {
  content: '';
  position: absolute;
  top: 7px;
  left: -50%;
  width: 100%;
  height: 3px;
  background: var(--line);
}
.steps li:first-child::before {
  display: none;
}
.steps li.past,
.steps li.now {
  color: var(--ink);
  font-weight: 700;
}
.steps li.past span,
.steps li.now span {
  border-color: var(--good);
  background: var(--good);
}
.steps li.past::before,
.steps li.now::before {
  background: var(--good);
}
.steps li.now span {
  box-shadow: 0 0 0 4px var(--good-soft);
}
.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px 14px;
  margin: 0;
}
.facts dt {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.sactions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.timeline {
  list-style: none;
  margin: 0;
  padding: 0 0 0 18px;
  border-left: 3px solid var(--line);
  display: grid;
  gap: 12px;
}
.timeline li {
  display: grid;
  gap: 1px;
  position: relative;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -26px;
  top: 4px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--line);
}
.timeline li.latest::before {
  background: var(--info);
}
.timeline li.delivered::before {
  background: var(--good);
}
.timeline time {
  font-size: 12px;
  color: var(--muted);
}
.timeline span {
  font-size: 14px;
}
.timeline .place {
  color: var(--muted);
}
@media (max-width: 900px) {
  .modal.full {
    height: auto;
    max-height: 94vh;
    overflow: auto;
    grid-template-rows: none;
  }
  .sbody {
    grid-template-columns: 1fr;
  }
  .slist,
  .sdetail {
    overflow: visible;
  }
  .ssearch {
    max-width: none;
  }
  .steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 10px;
  }
  .steps li::before {
    display: none;
  }
}

/* A shared SKU was scanned: pick the design in hand by its picture */
.choose-ask {
  background: var(--warn-soft);
  border: 2px solid var(--warn);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 17px;
}
.line.choose {
  border-color: var(--warn);
  border-width: 3px;
  grid-template-columns: 160px minmax(0, 1fr) 96px 96px;
}
.line.choose .thumb img,
.line.choose .noimg {
  width: 160px;
  height: 160px;
}
.line.dim {
  opacity: 0.35;
}
@media (max-width: 700px) {
  .line.choose {
    grid-template-columns: 110px minmax(0, 1fr);
  }
  .line.choose .thumb img,
  .line.choose .noimg {
    width: 110px;
    height: 110px;
  }
}

/* Customer contact on pickup and delivery orders */
.orderhead .contact {
  grid-column: 1 / -1;
  font-size: 15px;
  font-weight: 700;
}
.orderhead .contact a {
  color: inherit;
}
.label4x6 .lcontact {
  font-size: 12px;
  display: flex;
  gap: 6px;
}
.label4x6 .lcontact span {
  min-width: 62px;
}
