:root {
  color-scheme: light;
  --page: #eef2f5;
  --surface: #ffffff;
  --surface-soft: #f7f9fa;
  --surface-strong: #17324d;
  --ink: #17212b;
  --muted: #667482;
  --line: #d9e0e5;
  --line-strong: #bec9d1;
  --blue: #246bb2;
  --blue-soft: #e8f1fb;
  --green: #237a57;
  --green-soft: #e5f4ed;
  --orange: #a65b19;
  --orange-soft: #fbebdd;
  --red: #b23b3b;
  --red-soft: #fbe8e8;
  --shadow: 0 10px 30px rgba(21, 38, 54, 0.08);
  --radius: 8px;
  --input-height: 44px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--page);
  font-family:
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    sans-serif;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 0;
}

.auth-gate {
  position: fixed;
  z-index: 200;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: #eef2f5;
}

.auth-gate[hidden] {
  display: none;
}

.auth-panel {
  width: min(430px, 100%);
  padding: 22px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(21, 38, 54, 0.12);
}

.auth-brand {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
}

.auth-brand img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
}

.auth-brand div {
  display: grid;
}

.auth-brand strong {
  font-size: 20px;
}

.auth-brand span {
  color: var(--muted);
  font-size: 12px;
}

.auth-tabs {
  width: 100%;
  margin-bottom: 18px;
}

.auth-tabs .segment {
  flex: 1;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--red);
  font-size: 12px;
}

.account-surface {
  overflow: hidden;
}

.account-list {
  display: grid;
}

.account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 120px auto;
  align-items: center;
  min-height: 76px;
  padding: 13px 16px;
  gap: 12px;
  border-bottom: 1px solid #e9edf0;
}

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

.account-row-main {
  min-width: 0;
}

.account-row-main strong,
.account-row-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-row-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.account-actions .btn {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(36, 107, 178, 0.22);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px 24px;
  color: #f6f9fb;
  background: var(--surface-strong);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 9px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.brand div {
  display: grid;
  min-width: 0;
}

.brand strong {
  font-size: 18px;
  font-weight: 600;
}

.brand span {
  color: #c7d4df;
  font-size: 12px;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 20px;
  color: #e5edf3;
}

.header-install-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  gap: 6px;
  color: #edf5fb;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 6px;
  cursor: pointer;
}

.header-install-button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.header-install-button svg {
  width: 16px;
  height: 16px;
}

.status-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #68d391;
  box-shadow: 0 0 0 3px rgba(104, 211, 145, 0.16);
}

.status-dot.busy {
  background: #f0ad4e;
  box-shadow: 0 0 0 3px rgba(240, 173, 78, 0.16);
}

.status-dot.offline {
  background: #ef6b6b;
  box-shadow: 0 0 0 3px rgba(239, 107, 107, 0.16);
}

#clock {
  min-width: 52px;
  color: #ffffff;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.app-nav {
  display: flex;
  min-height: 58px;
  padding: 0 24px;
  gap: 6px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  min-height: 58px;
  padding: 0 18px;
  gap: 8px;
  color: var(--muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.nav-item::after {
  position: absolute;
  right: 18px;
  bottom: 0;
  left: 18px;
  height: 3px;
  content: "";
  background: transparent;
  border-radius: 3px 3px 0 0;
}

.nav-item:hover {
  color: var(--ink);
  background: #f5f8fa;
}

.nav-item.active {
  color: var(--blue);
  font-weight: 600;
}

.nav-item.active::after {
  background: var(--blue);
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.app-main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: 24px;
}

.view {
  animation: view-in 160ms ease-out;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  min-height: 50px;
  margin-bottom: 18px;
  gap: 18px;
}

.view-head h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
}

.view-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  gap: 8px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: #f4f7f9;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  color: #9aa5ae;
  background: #edf0f2;
  border-color: #dfe4e8;
  cursor: not-allowed;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.btn-primary:hover:not(:disabled) {
  background: #1f5f9e;
}

.btn-secondary {
  color: #214056;
  background: #f7f9fa;
  border-color: #cfd8df;
}

.btn-ghost {
  color: var(--blue);
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--blue-soft);
}

.btn-danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: #efc5c5;
}

.btn-block {
  width: 100%;
}

.btn-danger-outline {
  color: var(--red);
  background: var(--surface);
  border-color: #e2b6b6;
}

.tool-surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.scan-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.inbound-scan-strip {
  grid-template-columns: minmax(0, 1fr) auto auto;
}

.pickup-scan-strip {
  grid-template-columns: minmax(0, 1fr) 112px;
}

.field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.field > span {
  color: #53616e;
  font-size: 13px;
  font-weight: 600;
}

.field input,
.field select,
.compact-field select {
  width: 100%;
  min-width: 0;
  height: var(--input-height);
  padding: 0 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.field input::placeholder {
  color: #98a3ac;
}

.field input:focus,
.field select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(36, 107, 178, 0.13);
  outline-offset: 0;
}

.scan-field input {
  height: 50px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.scan-submit {
  min-height: 50px;
  padding-right: 22px;
  padding-left: 22px;
}

.surface-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 12px 16px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.surface-head h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.surface-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.surface-head > .btn {
  flex: 0 0 auto;
}

.inbound-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: start;
  gap: 18px;
}

.allocation-surface {
  min-width: 0;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 16px;
  gap: 10px;
}

.slot-button {
  position: relative;
  display: grid;
  min-height: 74px;
  padding: 9px 8px;
  gap: 4px;
  text-align: left;
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.slot-button:hover:not(:disabled) {
  border-color: #8eb2d4;
  box-shadow: inset 0 0 0 1px #8eb2d4;
}

.slot-button.selected {
  color: #163c5d;
  background: var(--blue-soft);
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.slot-button.occupied {
  color: #355363;
  background: #eef4f2;
  border-color: #cadbd4;
}

.slot-button:disabled {
  cursor: not-allowed;
}

.slot-label {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.slot-sub {
  align-self: end;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-button.selected .slot-sub {
  color: #3d6a91;
}

.confirm-surface {
  position: sticky;
  top: 18px;
  padding: 16px;
}

.confirm-surface .surface-head {
  min-height: auto;
  padding: 0 0 14px;
}

.package-summary {
  display: grid;
  margin: 0 0 16px;
  gap: 12px;
}

.package-summary > div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.package-summary dt {
  color: var(--muted);
  font-size: 13px;
}

.package-summary dd {
  min-width: 0;
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.slot-value {
  color: var(--blue);
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.confirm-button {
  min-height: 48px;
  margin-top: 16px;
}

.photo-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.photo-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  margin-bottom: 8px;
  gap: 10px;
}

.photo-section-head > span {
  color: #53616e;
  font-size: 13px;
  font-weight: 600;
}

.photo-add-button {
  min-height: 34px;
  padding: 0 8px;
}

.photo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
}

.photo-strip:empty {
  display: block;
  min-height: 46px;
}

.photo-strip:empty::before {
  display: grid;
  min-height: 46px;
  place-items: center;
  color: #8d99a3;
  content: "暂无照片";
  background: #f6f8f9;
  border: 1px dashed #cdd6dc;
  border-radius: 6px;
  font-size: 12px;
}

.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  overflow: hidden;
  background: #eef2f4;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-thumb-open {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  cursor: zoom-in;
}

.photo-thumb-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  padding: 0;
  color: #ffffff;
  background: rgba(25, 35, 43, 0.76);
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.photo-thumb-remove svg {
  width: 14px;
  height: 14px;
}

.pickup-photo-block {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.pickup-photo-block .photo-section-head {
  margin-bottom: 8px;
}

.photo-group {
  display: grid;
  gap: 10px;
}

.photo-group + .photo-group {
  margin-top: 22px;
}

.photo-group h3 {
  margin: 0;
  color: #4c5a66;
  font-size: 13px;
  font-weight: 600;
}

.inline-feedback {
  min-height: 20px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.inline-feedback.error {
  color: var(--red);
}

.pickup-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: start;
  gap: 18px;
}

.pickup-result-surface {
  min-height: 300px;
  padding: 18px;
}

.empty-state {
  display: flex;
  min-height: 260px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: #7b8893;
  text-align: center;
}

.empty-state svg {
  width: 34px;
  height: 34px;
  color: #95a4af;
}

.empty-state strong {
  font-size: 15px;
  font-weight: 500;
}

.empty-state.compact {
  min-height: 150px;
}

.empty-state.error-state svg {
  color: var(--red);
}

.pickup-card {
  display: grid;
  min-height: 100%;
  align-content: start;
  gap: 18px;
}

.pickup-hero {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  align-items: center;
  gap: 20px;
}

.slot-display {
  display: grid;
  min-height: 116px;
  place-items: center;
  align-content: center;
  gap: 2px;
  color: #164b75;
  background: var(--blue-soft);
  border: 1px solid #b9d4e9;
  border-radius: 7px;
}

.slot-display span {
  color: #52728b;
  font-size: 12px;
}

.slot-display strong {
  font-size: 42px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.pickup-main {
  min-width: 0;
}

.pickup-main h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.pickup-main p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
}

.pickup-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.issue-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.issue-fields .field > span {
  font-size: 12px;
}

.issue-fields .field input {
  height: 42px;
}

.issue-fields .span-2 {
  grid-column: 1 / -1;
}

.pickup-actions .btn-primary {
  min-width: 180px;
  min-height: 48px;
}

.pickup-options {
  display: grid;
  gap: 10px;
}

.pickup-option {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  padding: 12px;
  gap: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 7px;
}

.pickup-option .slot-chip {
  color: #1c577f;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pickup-option strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pickup-option span {
  color: var(--muted);
  font-size: 12px;
}

.waiting-surface {
  overflow: hidden;
}

.waiting-list {
  max-height: 510px;
  overflow: auto;
}

.waiting-row {
  display: grid;
  width: 100%;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 66px;
  padding: 10px 14px;
  gap: 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #edf0f2;
  cursor: pointer;
}

.waiting-row:hover {
  background: #f8fafb;
}

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

.waiting-row .slot-chip {
  color: var(--blue);
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.waiting-row strong,
.waiting-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.waiting-row strong {
  font-size: 13px;
}

.waiting-row span {
  color: var(--muted);
  font-size: 11px;
}

.waiting-row time {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.shelf-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-size: 12px;
}

.view-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 14px;
}

.view-head-actions .btn {
  min-width: 150px;
}

.shelf-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border: 1px solid transparent;
  border-radius: 3px;
}

.legend-swatch.available {
  background: #f4f7f9;
  border-color: var(--line-strong);
}

.legend-swatch.stored {
  background: var(--green-soft);
  border-color: #a9cdbf;
}

.legend-swatch.aging {
  background: var(--orange-soft);
  border-color: #e8c49e;
}

.legend-swatch.returned {
  background: #e9eef8;
  border-color: #bdcbe3;
}

.shelf-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  align-items: start;
  gap: 18px;
}

.shelf-surface {
  padding: 16px;
}

.shelf-head-row,
.shelf-row {
  display: grid;
  grid-template-columns: 28px repeat(6, minmax(44px, 1fr));
  gap: 8px;
}

.shelf-head-row {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.shelf-row {
  margin-bottom: 8px;
}

.shelf-row:last-child {
  margin-bottom: 0;
}

.shelf-row-label {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.shelf-slot {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 94px;
  align-content: space-between;
  padding: 9px;
  text-align: left;
  background: #f7f9fa;
  border: 1px solid var(--line);
  border-radius: 7px;
  cursor: pointer;
}

.shelf-slot:hover {
  border-color: #8fa9bd;
}

.shelf-slot.selected {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.shelf-slot.stored {
  background: var(--green-soft);
  border-color: #b8d7cb;
}

.shelf-slot.aging {
  background: var(--orange-soft);
  border-color: #e8c49e;
}

.shelf-slot.issued {
  background: #fff4e8;
  border-color: #e9b97e;
}

.shelf-slot.returned {
  background: #edf2fb;
  border-color: #bdcbe3;
}

.shelf-slot.clear-candidate {
  border-color: #b66b1d;
  box-shadow: inset 0 0 0 2px #d99b57;
}

.shelf-slot.delete-candidate {
  border-color: #b23b3b;
  box-shadow: inset 0 0 0 2px #dc7777;
}

.shelf-slot.move-target {
  background: var(--blue-soft);
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.shelf-slot:disabled {
  color: inherit;
  opacity: 0.48;
  cursor: not-allowed;
}

.shelf-slot .cell-slot {
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.shelf-slot .cell-code {
  color: #20485f;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.shelf-slot.aging .cell-code {
  color: #8e4c13;
}

.shelf-slot.issued .cell-code {
  color: #a25a12;
}

.shelf-slot.returned .cell-code {
  color: #3b5d8f;
}

.shelf-slot .cell-sub {
  color: #5f737e;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-slot.empty .cell-code {
  color: #a3adb5;
  font-size: 14px;
  font-weight: 500;
}

.shelf-detail {
  position: sticky;
  top: 18px;
  min-height: 260px;
  overflow: hidden;
}

.detail-body {
  padding: 16px;
}

.detail-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.detail-title-row h2 {
  margin: 0;
  font-size: 24px;
}

.status-label {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 5px;
  font-size: 12px;
}

.status-label.empty {
  color: #62717d;
  background: #eef1f3;
}

.status-label.aging {
  color: var(--orange);
  background: var(--orange-soft);
}

.detail-list {
  display: grid;
  margin: 0;
  gap: 11px;
}

.detail-list > div {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-list dd {
  min-width: 0;
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.detail-code {
  color: var(--blue);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  gap: 9px;
}

.detail-actions .wide {
  grid-column: 1 / -1;
}

.move-note {
  margin: 12px 0 0;
  color: var(--blue);
  font-size: 12px;
}

.history-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 16px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  background: #e3e8ec;
  border-radius: 7px;
}

.segment {
  min-height: 34px;
  padding: 0 14px;
  color: #53616e;
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.segment.active {
  color: #17324d;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(27, 45, 60, 0.12);
}

.compact-field {
  width: 150px;
}

.compact-field select {
  height: 40px;
}

.history-surface {
  overflow: hidden;
}

.workorder-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 420px) minmax(0, 1fr);
  align-items: end;
  margin-bottom: 14px;
  gap: 14px;
}

.search-field input {
  height: 40px;
}

.workorder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: start;
  gap: 18px;
}

.workorder-list-surface {
  overflow: hidden;
}

.workorder-list {
  display: grid;
}

.workorder-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 110px;
  align-items: center;
  min-height: 82px;
  padding: 13px 16px;
  gap: 14px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e9edf0;
  cursor: pointer;
}

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

.workorder-row:hover {
  background: #f8fafb;
}

.workorder-row.selected {
  background: #edf4fa;
  box-shadow: inset 3px 0 0 var(--blue);
}

.workorder-row-main {
  min-width: 0;
}

.workorder-row-main strong,
.workorder-row-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workorder-row-main strong {
  font-size: 14px;
}

.workorder-row-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.workorder-number {
  color: var(--blue) !important;
  font-size: 12px !important;
  font-weight: 600;
}

.workorder-row-meta {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  justify-content: center;
  padding: 0 8px;
  color: #52616e;
  background: #edf1f3;
  border-radius: 5px;
  font-size: 12px;
  white-space: nowrap;
}

.status-pill.open {
  color: #6b4c16;
  background: #f7efd9;
}

.status-pill.processing {
  color: var(--blue);
  background: var(--blue-soft);
}

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

.status-pill.unpaid {
  color: var(--red);
  background: var(--red-soft);
}

.status-pill.cancelled {
  color: var(--red);
  background: var(--red-soft);
}

.priority-urgent {
  color: var(--red);
  font-weight: 600;
}

.workorder-detail {
  position: sticky;
  top: 18px;
  min-height: 300px;
  overflow: hidden;
}

.workorder-detail-body {
  padding: 16px;
}

.workorder-detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.workorder-detail-title h2 {
  margin: 0;
  font-size: 20px;
}

.workorder-detail-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.workorder-detail-list {
  display: grid;
  margin: 0;
  gap: 11px;
}

.workorder-detail-list > div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.workorder-detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.workorder-detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.workorder-parts {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.workorder-parts h3 {
  margin: 0 0 9px;
  font-size: 13px;
}

.linked-part {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 50px;
  padding: 7px 0;
  gap: 9px;
  border-bottom: 1px solid #edf0f2;
}

.linked-part:last-child {
  border-bottom: 0;
}

.linked-part strong,
.linked-part span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.linked-part strong {
  font-size: 12px;
}

.linked-part span {
  color: var(--muted);
  font-size: 11px;
}

.workorder-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  gap: 9px;
}

.workorder-actions .wide {
  grid-column: 1 / -1;
}

.workorder-material-editor {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workorder-material-lines {
  display: grid;
  padding: 12px;
  gap: 10px;
}

.workorder-material-lines:empty::before {
  display: grid;
  min-height: 54px;
  place-items: center;
  color: #8d99a3;
  content: "暂无辅材";
  border: 1px dashed #cdd6dc;
  border-radius: 6px;
  font-size: 12px;
}

.workorder-material-line {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 90px 110px 38px;
  align-items: end;
  gap: 9px;
}

.workorder-material-line .field > span {
  font-size: 11px;
}

.workorder-material-line .field input,
.workorder-material-line .field select {
  height: 38px;
}

.workorder-material-line .remove-line {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  color: var(--red);
  background: var(--red-soft);
  border: 1px solid #efc5c5;
  border-radius: 6px;
  cursor: pointer;
}

.material-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 420px) minmax(0, 1fr);
  align-items: end;
  margin-bottom: 14px;
  gap: 14px;
}

.material-view-tabs {
  width: max-content;
  margin-bottom: 14px;
}

.staff-material-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px auto;
  align-items: center;
  min-height: 58px;
  padding: 9px 0;
  gap: 10px;
  border-bottom: 1px solid #edf0f2;
}

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

.staff-material-row strong,
.staff-material-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-material-row strong {
  font-size: 13px;
}

.staff-material-row span {
  color: var(--muted);
  font-size: 11px;
}

.staff-material-stock {
  color: var(--blue) !important;
  font-size: 18px !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.staff-material-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}

.staff-material-actions .btn {
  min-height: 32px;
  padding: 0 8px;
  font-size: 12px;
}

.material-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: start;
  gap: 18px;
}

.material-list-surface {
  overflow: hidden;
}

.material-list {
  display: grid;
}

.material-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px 100px;
  align-items: center;
  min-height: 78px;
  padding: 13px 16px;
  gap: 14px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #e9edf0;
  cursor: pointer;
}

.material-row:hover {
  background: #f8fafb;
}

.material-row.selected {
  background: #edf4fa;
  box-shadow: inset 3px 0 0 var(--blue);
}

.material-row-main {
  min-width: 0;
}

.material-row-main strong,
.material-row-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-row-main strong {
  font-size: 14px;
}

.material-row-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.material-quantity {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.material-quantity.low {
  color: var(--red);
}

.material-quantity small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}

.material-status {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 5px;
  font-size: 12px;
}

.material-status.low {
  color: var(--red);
  background: var(--red-soft);
}

.material-status.inactive {
  color: #65727d;
  background: #edf0f2;
}

.material-detail {
  position: sticky;
  top: 18px;
  min-height: 300px;
  overflow: hidden;
}

.material-detail-body {
  padding: 16px;
}

.material-detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.material-detail-title h2 {
  margin: 0;
  font-size: 20px;
}

.material-detail-title span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.material-stock-display {
  display: flex;
  align-items: baseline;
  margin-bottom: 16px;
  gap: 7px;
}

.material-stock-display strong {
  color: var(--blue);
  font-size: 34px;
  font-variant-numeric: tabular-nums;
}

.material-stock-display span {
  color: var(--muted);
}

.material-detail-list {
  display: grid;
  margin: 0;
  gap: 10px;
}

.material-detail-list > div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
}

.material-detail-list dt {
  color: var(--muted);
  font-size: 12px;
}

.material-detail-list dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.material-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  gap: 9px;
}

.material-actions .wide {
  grid-column: 1 / -1;
}

.material-transactions {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.material-transactions h3 {
  margin: 0 0 9px;
  font-size: 13px;
}

.material-transaction {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 48px;
  padding: 7px 0;
  gap: 8px;
  border-bottom: 1px solid #edf0f2;
}

.material-transaction:last-child {
  border-bottom: 0;
}

.material-transaction strong,
.material-transaction span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-transaction strong {
  font-size: 12px;
}

.material-transaction span {
  color: var(--muted);
  font-size: 11px;
}

.material-transaction .change {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.material-transaction .change.in {
  color: var(--green);
}

.material-transaction .change.out {
  color: var(--red);
}

.material-transaction .change.transfer {
  color: var(--blue);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  height: 50px;
  padding: 8px 14px;
  text-align: left;
  border-bottom: 1px solid #e9edf0;
}

.data-table th {
  color: #5f6c77;
  background: #f7f9fa;
  font-size: 12px;
  font-weight: 600;
}

.data-table td {
  font-size: 13px;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: #fafcfd;
}

.table-type {
  display: inline-flex;
  align-items: center;
  min-width: 52px;
  min-height: 24px;
  justify-content: center;
  padding: 0 8px;
  border-radius: 5px;
  font-size: 12px;
}

.table-type.inbound {
  color: var(--green);
  background: var(--green-soft);
}

.table-type.pickup,
.table-type.issue {
  color: var(--blue);
  background: var(--blue-soft);
}

.table-type.return {
  color: #3b5d8f;
  background: #edf2fb;
}

.table-type.clear {
  color: #6b4c16;
  background: #f7efd9;
}

.table-type.delete {
  color: var(--red);
  background: var(--red-soft);
}

.table-type.move {
  color: var(--orange);
  background: var(--orange-soft);
}

.photo-count-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 9px;
  gap: 6px;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid #c7ddef;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}

.photo-count-button svg {
  width: 15px;
  height: 15px;
}

.mono {
  font-variant-numeric: tabular-nums;
}

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

.icon-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.camera-dialog {
  width: min(720px, calc(100vw - 28px));
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.camera-dialog::backdrop {
  background: rgba(9, 18, 27, 0.72);
  backdrop-filter: blur(3px);
}

.camera-panel {
  overflow: hidden;
  background: #0f1821;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.camera-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 10px 14px 10px 18px;
  color: #f5f8fa;
  background: #17232d;
}

.camera-head div {
  display: grid;
}

.camera-head strong {
  font-size: 15px;
}

.camera-head span {
  color: #aebbc5;
  font-size: 12px;
}

.camera-view {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  background: #05090d;
}

.camera-view video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(72%, 480px);
  aspect-ratio: 2.3 / 1;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.2);
  transform: translate(-50%, -50%);
}

.scan-frame::before,
.scan-frame::after {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 5px;
  content: "";
  background: #4aa3e6;
}

.scan-frame::before {
  left: -2px;
  border-radius: 8px 0 0 8px;
}

.scan-frame::after {
  right: -2px;
  border-radius: 0 8px 8px 0;
}

.camera-feedback {
  min-height: 42px;
  margin: 0;
  padding: 11px 18px;
  color: #c9d4dc;
  background: #17232d;
  font-size: 12px;
}

.photo-dialog {
  width: min(920px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.photo-dialog::backdrop {
  background: rgba(9, 18, 27, 0.72);
  backdrop-filter: blur(3px);
}

.photo-dialog-panel {
  max-height: calc(100vh - 28px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.photo-dialog-head {
  position: sticky;
  z-index: 1;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px 14px 10px 18px;
  gap: 14px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.photo-dialog-head div {
  display: grid;
}

.photo-dialog-head strong {
  font-size: 16px;
}

.photo-dialog-head span {
  color: var(--muted);
  font-size: 12px;
}

.photo-dialog-head .icon-button {
  color: var(--ink);
}

.photo-dialog-head .icon-button:hover {
  background: #eef2f4;
}

.photo-dialog-content {
  padding: 18px;
}

.photo-dialog-content .photo-strip {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.photo-dialog-content .photo-thumb {
  aspect-ratio: 4 / 3;
}

.confirm-dialog {
  width: min(520px, calc(100vw - 28px));
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.confirm-dialog::backdrop {
  background: rgba(9, 18, 27, 0.72);
  backdrop-filter: blur(3px);
}

.confirm-dialog-panel {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.confirm-dialog-head {
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.confirm-dialog-head div {
  display: grid;
}

.confirm-dialog-head strong {
  font-size: 18px;
}

.confirm-dialog-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.confirm-dialog-body {
  padding: 18px;
}

.confirm-dialog-body p {
  margin: 0;
  color: #4f5d69;
  line-height: 1.65;
}

.confirm-dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  gap: 10px;
}

.form-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.form-dialog::backdrop {
  background: rgba(9, 18, 27, 0.72);
  backdrop-filter: blur(3px);
}

.form-dialog-panel {
  display: grid;
  max-height: calc(100vh - 28px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.form-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 16px 12px 18px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.form-dialog-head div {
  display: grid;
}

.form-dialog-head strong {
  font-size: 18px;
}

.form-dialog-head span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.form-dialog-body {
  padding: 18px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.form-grid textarea {
  width: 100%;
  min-height: 82px;
  padding: 10px 12px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  resize: vertical;
}

.form-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 14px 18px;
  gap: 10px;
  border-top: 1px solid var(--line);
}

.payment-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
}

.payment-dialog::backdrop {
  background: rgba(9, 18, 27, 0.72);
  backdrop-filter: blur(3px);
}

.payment-dialog-panel {
  display: grid;
  max-height: calc(100vh - 28px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

.payment-dialog-body {
  padding: 18px;
}

.payment-summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.payment-summary span {
  color: var(--muted);
  font-size: 13px;
}

.payment-summary strong {
  color: var(--blue);
  font-size: 28px;
}

.payment-qr-wrap {
  display: grid;
  margin: 0 auto 16px;
  width: min(300px, 82vw);
  place-items: center;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.payment-qr-wrap img {
  display: block;
  width: 100%;
  height: auto;
}

.payment-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.photo-view-single {
  display: grid;
  place-items: center;
}

.photo-view-single img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  object-fit: contain;
  border-radius: 6px;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  display: grid;
  width: min(360px, calc(100vw - 40px));
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  padding: 13px 14px;
  gap: 10px;
  color: #f8fafb;
  background: #1e3445;
  border-radius: 7px;
  box-shadow: 0 12px 36px rgba(12, 25, 36, 0.22);
  pointer-events: auto;
  animation: toast-in 160ms ease-out;
}

.toast.success {
  background: #1f6d50;
}

.toast.error {
  background: #9b3636;
}

.toast svg {
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.toast strong {
  display: block;
  font-size: 13px;
}

.toast span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

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

@media (max-width: 1080px) {
  .inbound-layout,
  .pickup-layout,
  .shelf-layout,
  .workorder-layout,
  .material-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .confirm-surface,
  .shelf-detail {
    position: static;
  }

  .confirm-surface {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(200px, 0.8fr);
    align-items: end;
    gap: 16px;
  }

  .confirm-surface .surface-head {
    grid-column: 1 / -1;
  }

  .confirm-surface .package-summary {
    margin: 0;
  }

  .waiting-list {
    max-height: 340px;
  }

  .workorder-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }

  .material-toolbar {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .app-header {
    min-height: 62px;
    padding: 10px 14px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand strong {
    font-size: 16px;
  }

  .brand span,
  .status-line {
    display: none;
  }

  .header-status {
    gap: 10px;
  }

  .header-install-button {
    min-height: 36px;
    padding: 0 10px;
  }

  .app-nav {
    min-height: 54px;
    padding: 0 8px;
    justify-content: space-between;
  }

  .nav-item {
    min-width: 0;
    min-height: 54px;
    flex: 1 1 14.2857%;
    padding: 0 6px;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
  }

  .nav-item::after {
    right: 12px;
    left: 12px;
  }

  .nav-item svg {
    width: 19px;
    height: 19px;
  }

  .app-main {
    padding: 16px 12px 24px;
  }

  .view-head {
    align-items: center;
    margin-bottom: 12px;
  }

  .view-head h1 {
    font-size: 23px;
  }

  .scan-strip,
  .pickup-scan-strip {
    grid-template-columns: minmax(0, 1fr);
    padding: 12px;
  }

  .scan-submit {
    width: 100%;
  }

  .inbound-layout,
  .pickup-layout,
  .shelf-layout {
    gap: 12px;
  }

  .slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    padding: 12px;
    gap: 8px;
  }

  .slot-button {
    min-height: 68px;
  }

  .confirm-surface {
    display: block;
    padding: 14px;
  }

  .confirm-surface .package-summary {
    margin-bottom: 14px;
  }

  .pickup-result-surface {
    min-height: 240px;
    padding: 14px;
  }

  .pickup-hero {
    grid-template-columns: 106px minmax(0, 1fr);
    gap: 14px;
  }

  .issue-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .slot-display {
    min-height: 104px;
  }

  .slot-display strong {
    font-size: 36px;
  }

  .pickup-option {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .pickup-option .btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .shelf-surface {
    padding: 8px;
  }

  .shelf-head-row,
  .shelf-row {
    grid-template-columns: 22px repeat(6, minmax(42px, 1fr));
    gap: 4px;
  }

  .shelf-slot {
    min-height: 76px;
    padding: 6px;
  }

  .shelf-slot .cell-code {
    font-size: 16px;
  }

  .shelf-slot .cell-sub {
    font-size: 9px;
  }

  .shelf-legend {
    display: none;
  }

  .view-head-actions {
    gap: 8px;
  }

  .view-head-actions .btn {
    min-width: 44px;
  }

  .history-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .workorder-row {
    grid-template-columns: minmax(0, 1fr) 96px;
  }

  .material-row {
    grid-template-columns: minmax(0, 1fr) 90px;
  }

  .material-row .material-status {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }

  .material-row .material-quantity {
    grid-column: 2;
    grid-row: 2;
  }

  .workorder-row-meta {
    grid-column: 2;
    grid-row: 1;
  }

  .workorder-row .status-pill {
    grid-column: 2;
    grid-row: 2;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .workorder-material-line {
    grid-template-columns: minmax(0, 1fr) 82px 38px;
  }

  .workorder-material-line .price-field {
    grid-column: 1 / 3;
  }

  .workorder-material-line .remove-line {
    grid-column: 3;
    grid-row: 1;
  }

  .segmented {
    width: 100%;
  }

  .segment {
    flex: 1 1 25%;
    padding: 0 7px;
  }

  .compact-field {
    width: 100%;
  }
}

@media (max-width: 460px) {
  .brand div {
    max-width: 140px;
  }

  .view-head .btn {
    width: 42px;
    height: 42px;
    padding: 0;
    font-size: 0;
  }

  .view-head .btn svg {
    width: 18px;
    height: 18px;
  }

  .surface-head {
    align-items: flex-start;
  }

  .surface-head > .btn {
    min-width: 42px;
    padding: 0 10px;
    font-size: 0;
  }

  .surface-head > .btn svg {
    width: 18px;
    height: 18px;
  }

  .pickup-hero {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .slot-display strong {
    font-size: 32px;
  }

  .pickup-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .pickup-actions .btn-primary {
    width: 100%;
    min-width: 0;
  }

  .waiting-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .waiting-row time {
    grid-column: 2;
  }

  .toast-region {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }
}
