:root {
  color: #111827;
  background: #f7f8fa;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  -webkit-appearance: none;
  appearance: none;
}

[hidden] {
  display: none !important;
}

.pin-screen,
.home-screen,
.app,
.fba-screen {
  min-height: 100vh;
  min-height: 100svh;
  padding: 24px;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
}

.pin-screen {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  background: linear-gradient(145deg, #f7f8fa 0%, #e8edf3 100%);
}

.pin-card {
  width: 100%;
  max-width: 520px;
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  padding: 38px;
  padding: clamp(30px, 6vw, 54px);
  border-radius: 34px;
  background: #fff;
  box-shadow: 0 22px 60px rgb(15 23 42 / 14%);
  text-align: center;
}

.pin-card > * + * {
  margin-top: 22px;
}

.pin-card label {
  font-size: 42px;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 850;
}

.pin-card input {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-height: 92px;
  border: 3px solid #c7ced8;
  border-radius: 22px;
  background: #f8fafc;
  color: #111827;
  font-size: 56px;
  font-size: clamp(42px, 8vw, 68px);
  font-weight: 800;
  letter-spacing: 0.3em;
  text-align: center;
  -webkit-text-security: disc;
}

.pin-card input:focus {
  border-color: #3478f6;
  outline: 5px solid rgb(52 120 246 / 18%);
}

.pin-card button {
  min-height: 82px;
  border: 0;
  border-radius: 22px;
  background: #3478f6;
  color: #fff;
  font-size: 32px;
  font-size: clamp(27px, 4vw, 38px);
  font-weight: 800;
}

.pin-error {
  min-height: 1.4em;
  color: #b42318;
  font-size: 20px;
  font-size: clamp(18px, 2.4vw, 23px);
  font-weight: 650;
}

.home-screen {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
}

.home-tile {
  position: relative;
  width: 42%;
  max-width: 460px;
  height: 42vh;
  min-height: 220px;
  max-height: 340px;
  margin: 16px;
  border: 0;
  border-radius: 40px;
  padding: 42px;
  color: #fff;
  font-size: 52px;
  font-weight: 850;
  line-height: 1.05;
  box-shadow: 0 18px 42px rgb(15 23 42 / 16%);
  touch-action: manipulation;
}

.orders-tile {
  background: linear-gradient(145deg, #3478f6, #1658d3);
}

.amazon-tile {
  background: linear-gradient(145deg, #f59d25, #df6b13);
}

.home-tile:active:not(:disabled) {
  transform: scale(0.985);
}

.home-tile:disabled {
  opacity: 0.52;
}

.notification-dot {
  position: absolute;
  top: 28px;
  right: 28px;
  width: 34px;
  height: 34px;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 5px 14px rgb(84 14 9 / 35%);
}

.app {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.order-number {
  font-size: 46px;
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 800;
  line-height: 1;
}

.queue-position {
  margin-top: 8px;
  color: #52606d;
  font-size: 22px;
  font-size: clamp(18px, 2.4vw, 25px);
  font-weight: 650;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mode-badge {
  padding: 10px 16px;
  border-radius: 999px;
  background: #ffedb5;
  color: #684b00;
  font-size: 18px;
  font-weight: 750;
  white-space: nowrap;
}

.close-button {
  width: 66px;
  height: 66px;
  flex: 0 0 66px;
  border: 0;
  border-radius: 20px;
  background: #d8dde3;
  color: #111827;
  font-size: 48px;
  font-weight: 500;
  line-height: 1;
  touch-action: manipulation;
}

.content {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 28vw);
  gap: 28px;
}

.details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

.address-card,
.item-row {
  border-radius: 16px;
  padding: 20px 24px;
}

.address-card {
  background: #c9edff;
  font-size: 28px;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.35;
}

.address-name {
  display: block;
  font-weight: 800;
}

.items {
  display: grid;
  gap: 16px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.3fr) 1fr;
  align-items: center;
  background: #e5e7eb;
  box-shadow: 0 3px 10px rgb(15 23 42 / 8%);
}

.item-row.multi {
  background: #ffd66b;
}

.quantity {
  padding-right: 22px;
  border-right: 4px solid rgb(17 24 39 / 18%);
  font-size: 58px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1;
}

.pack-code {
  padding-left: 28px;
  font-size: 80px;
  font-size: clamp(54px, 9vw, 110px);
  font-weight: 850;
  line-height: 0.95;
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 0;
}

.navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.nav-button,
.secondary-button {
  min-height: 70px;
  border: 0;
  border-radius: 18px;
  background: #d8dde3;
  color: #111827;
  font-size: 40px;
  font-weight: 750;
}

.fulfill-button {
  flex: 1;
  min-height: 180px;
  border: 0;
  border-radius: 36px;
  padding: 26px;
  background: #22a447;
  color: #fff;
  font-size: 40px;
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 800;
}

button:disabled {
  cursor: default;
}

.close-button:disabled,
.nav-button:disabled,
.secondary-button:disabled,
.fulfill-button:disabled {
  opacity: 0.42;
}

.fulfill-button.busy {
  background: #53616f;
}

.message-panel {
  flex: 1;
  place-content: center;
  justify-items: center;
  text-align: center;
  padding: 40px;
}

.message-panel:not([hidden]) {
  display: grid;
}

.message-title {
  font-size: 52px;
  font-size: clamp(34px, 6vw, 68px);
  font-weight: 850;
}

.message-text {
  max-width: 780px;
  margin: 16px 0 28px;
  color: #52606d;
  font-size: 26px;
  font-size: clamp(20px, 3vw, 30px);
}

.secondary-button {
  padding: 14px 30px;
  font-size: 24px;
}

.fba-screen {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 22px;
}

.fba-task-list {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

.fba-task-card {
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  width: 100%;
  min-height: 112px;
  padding: 20px 24px;
  border: 3px solid transparent;
  border-radius: 24px;
  background: #fff;
  color: #111827;
  box-shadow: 0 6px 20px rgb(15 23 42 / 10%);
  text-align: left;
  touch-action: manipulation;
}

.fba-task-card:active {
  transform: scale(0.992);
}

.fba-task-blocked {
  border-color: #d92d20;
  background: #fff5f3;
}

.fba-task-in_progress {
  border-color: #f59d25;
}

.fba-task-card-main {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.fba-task-name {
  overflow: hidden;
  font-size: 34px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fba-task-counts {
  color: #52606d;
  font-size: 23px;
  font-weight: 650;
}

.fba-task-status {
  flex: 0 0 auto;
  margin-left: 20px;
  padding: 12px 18px;
  border-radius: 999px;
  background: #dff4e5;
  color: #146b2e;
  font-size: 21px;
  font-weight: 800;
}

.fba-task-status-blocked {
  background: #fee4e2;
  color: #9b1c14;
}

.fba-task-status-in_progress {
  background: #fff0c2;
  color: #714d00;
}

.fba-action-error,
.fba-blocked-panel,
.fba-stage-panel,
.fba-complete-panel {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  border-radius: 24px;
}

.fba-action-error {
  padding: 16px 20px;
  background: #fee4e2;
  color: #9b1c14;
  font-size: 21px;
  font-weight: 750;
}

.fba-blocked-panel {
  padding: 22px 24px;
  border: 3px solid #d92d20;
  background: #fff5f3;
}

.fba-blocked-reasons {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.fba-blocked-reason {
  font-size: 20px;
  line-height: 1.35;
}

.fba-stage-panel {
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 22px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 6px 20px rgb(15 23 42 / 10%);
}

.fba-stage-column {
  -webkit-box-align: stretch;
  -webkit-align-items: stretch;
  align-items: stretch;
  -webkit-flex-direction: column;
  flex-direction: column;
}

.fba-stage-heading {
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  gap: 18px;
}

.fba-stage-number {
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
  border-radius: 18px;
  background: #f59d25;
  color: #fff;
  font-size: 34px;
  font-weight: 850;
}

.fba-section-title {
  font-size: 31px;
  font-weight: 850;
  line-height: 1.1;
}

.fba-stage-text {
  margin-top: 5px;
  color: #52606d;
  font-size: 21px;
  line-height: 1.3;
}

.fba-primary-button {
  min-height: 72px;
  margin-left: auto;
  border: 0;
  border-radius: 20px;
  padding: 16px 28px;
  background: #22a447;
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  touch-action: manipulation;
}

.fba-primary-button:disabled {
  opacity: 0.42;
}

.fba-check-list {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 12px;
}

.fba-empty-prep {
  padding: 24px;
  border-radius: 18px;
  background: #e8f7ec;
  color: #146b2e;
  font-size: 25px;
  font-weight: 750;
  text-align: center;
}

.fba-check-button {
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: stretch;
  -webkit-align-items: stretch;
  align-items: stretch;
  width: 100%;
  min-height: 116px;
  border: 3px solid #c7ced8;
  border-radius: 20px;
  padding: 0;
  overflow: hidden;
  background: #f8fafc;
  color: #111827;
  text-align: left;
  touch-action: manipulation;
}

.fba-check-button.confirmed {
  border-color: #22a447;
  background: #edf9f0;
}

.fba-check-button:disabled:not(.confirmed) {
  opacity: 0.56;
}

.fba-check-mark {
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  width: 76px;
  flex: 0 0 76px;
  background: #d8dde3;
  color: #fff;
  font-size: 43px;
  font-weight: 900;
}

.fba-check-button.confirmed .fba-check-mark {
  background: #22a447;
}

.fba-check-content {
  display: -webkit-flex;
  display: flex;
  -webkit-flex: 1 1 auto;
  flex: 1 1 auto;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  padding: 14px 20px;
}

.fba-prep-headline,
.fba-pack-headline {
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: baseline;
  -webkit-align-items: baseline;
  align-items: baseline;
  gap: 20px;
}

.fba-item-quantity {
  min-width: 100px;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
}

.fba-item-code {
  font-size: 58px;
  font-weight: 900;
  line-height: 1;
}

.fba-item-sku {
  overflow: hidden;
  color: #52606d;
  font-size: 17px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fba-barcode-line {
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 19px;
}

.fba-barcode-line.target {
  color: #111827;
  font-size: 22px;
  font-weight: 800;
}

.fba-box-identity {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 2;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: justify;
  -webkit-justify-content: space-between;
  justify-content: space-between;
  gap: 20px;
  margin: -24px -24px 0;
  padding: 18px 24px;
  border-radius: 24px 24px 0 0;
  background: #172033;
  color: #fff;
}

.fba-box-progress {
  font-size: 23px;
  font-weight: 750;
}

.fba-box-code {
  margin-top: 4px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 50px;
  font-weight: 900;
  line-height: 1;
}

.fba-box-full-id {
  max-width: 50%;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 20px;
  font-weight: 750;
  text-align: right;
  word-break: break-all;
}

.fba-label-panel {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-direction: column;
  flex-direction: column;
  gap: 16px;
  margin-top: 8px;
  padding-top: 22px;
  border-top: 4px solid #f59d25;
}

.fba-label-instruction {
  padding: 15px 18px;
  border-radius: 16px;
  background: #fff0c2;
  color: #684b00;
  font-size: 19px;
  font-weight: 700;
}

.fba-label-buttons {
  display: -webkit-flex;
  display: flex;
  gap: 16px;
}

.fba-label-button {
  display: -webkit-flex;
  display: flex;
  -webkit-flex: 1 1 50%;
  flex: 1 1 50%;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  min-height: 150px;
  border: 4px solid #c7ced8;
  border-radius: 24px;
  padding: 18px;
  background: #f8fafc;
  color: #111827;
  touch-action: manipulation;
}

.fba-label-button.confirmed {
  border-color: #22a447;
  background: #e8f7ec;
  box-shadow: inset 0 0 0 4px #22a447;
}

.fba-label-button span {
  font-size: 24px;
  font-weight: 800;
}

.fba-label-button strong {
  margin: 8px 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 39px;
}

.fba-label-button small {
  max-width: 100%;
  overflow: hidden;
  color: #52606d;
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fba-complete-panel {
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  flex: 1;
  padding: 40px;
  text-align: center;
}

.fba-complete-mark {
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  width: 110px;
  height: 110px;
  margin-bottom: 24px;
  border-radius: 50%;
  background: #22a447;
  color: #fff;
  font-size: 72px;
  font-weight: 900;
}

@media (max-width: 760px), (orientation: portrait) {
  .home-screen {
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    flex-direction: column;
  }

  .home-tile {
    width: 84%;
    height: 32vh;
    min-height: 200px;
    max-height: 300px;
    margin: 12px;
  }

  .app {
    gap: 18px;
  }

  .fba-screen {
    gap: 16px;
  }

  .content {
    grid-template-columns: 1fr;
  }

  .controls {
    display: grid;
    grid-template-columns: minmax(180px, 0.35fr) 1fr;
  }

  .fulfill-button {
    min-height: 110px;
    border-radius: 24px;
  }

  .fba-stage-panel {
    padding: 18px;
  }

  .fba-stage-panel:not(.fba-stage-column) {
    -webkit-box-align: stretch;
    -webkit-align-items: stretch;
    align-items: stretch;
    -webkit-flex-direction: column;
    flex-direction: column;
  }

  .fba-primary-button {
    width: 100%;
    margin-left: 0;
  }

  .fba-label-buttons {
    -webkit-flex-direction: column;
    flex-direction: column;
  }

  .fba-box-identity {
    margin: -18px -18px 0;
    padding: 16px 18px;
  }

  .fba-box-code {
    font-size: 42px;
  }
}

@media (orientation: landscape) {
  .pin-screen {
    -webkit-box-align: start;
    -webkit-align-items: flex-start;
    align-items: flex-start;
    padding-top: max(12px, env(safe-area-inset-top));
  }

  .pin-card {
    max-width: 760px;
    -webkit-flex-flow: row wrap;
    flex-flow: row wrap;
    padding: 16px 20px;
    border-radius: 22px;
  }

  .pin-card > * + * {
    margin-top: 0;
  }

  .pin-card label {
    width: 100%;
    margin-bottom: 12px;
    font-size: 28px;
  }

  .pin-card input {
    width: auto;
    min-width: 0;
    min-height: 66px;
    -webkit-flex: 1 1 280px;
    flex: 1 1 280px;
    margin-right: 12px;
    font-size: 42px;
  }

  .pin-card button {
    min-height: 66px;
    -webkit-flex: 0 0 180px;
    flex: 0 0 180px;
    font-size: 28px;
  }

  .pin-error {
    width: 100%;
    min-height: 1.2em;
    margin-top: 10px;
    font-size: 18px;
  }
}
