:root {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
  color: #19263b;
  background: #f4f6fa;
  font-synthesis: none;
}
.uin-panel { overflow-wrap:anywhere; }
.uin-panel input { max-width:100%; min-width:0; }
.uin-panel button[type=submit] { margin-top:12px; }
.uin-panel details { margin:16px 0; }
.uin-success { color:#17663f; }
.uin-error { color:#a12c24; }
.import-entry { display:grid; gap:8px; color:inherit; text-decoration:none; }
.import-entry:hover, .import-entry:focus-visible { border-color:#3d58e8; }
.import-entry span:last-child { color:#304cd5; }
.uin-code { font-variant-numeric:tabular-nums; }
#uin-history-search button { margin-top:10px; }
.packing-link { display:block; margin:12px 0; padding:14px; border:1px solid #cbd5e1; border-radius:12px; text-align:center; color:#304cd5; text-decoration:none; }
#packing-scan button { margin-top:12px; }
.card > button.full + button.full { margin-top:12px; }
.order-product { display:flex; gap:14px; align-items:flex-start; }
.order-product > div { min-width:0; }
.order-card { overflow-wrap:anywhere; }
.order-photo { width:80px; height:107px; object-fit:contain; border-radius:8px; background:white; }
.order-no-photo { flex:0 0 80px; font-size:12px; color:#596a80; }
.order-search { margin:18px 0; }
.order-search button { margin-top:8px; }
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header,
main,
footer {
  max-width: 660px;
  margin: auto;
  padding: 20px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
}
.brand {
  text-decoration: none;
  color: inherit;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -1px;
}
.brand span {
  display: block;
  font-size: 12px;
  letter-spacing: 1px;
  font-weight: 500;
  color: #64748b;
}
h1 {
  font-size: 29px;
  letter-spacing: -0.7px;
  margin: 14px 0;
}
h2 {
  font-size: 21px;
  margin: 8px 0;
}
h3 {
  font-size: 18px;
  margin: 0 0 8px;
}
p {
  line-height: 1.55;
}
small,
.muted {
  color: #596a80;
}
button,
input,
a {
  touch-action: manipulation;
}
button {
  font: inherit;
  font-weight: 600;
  border: 1px solid #ccd5e1;
  border-radius: 13px;
  min-height: 48px;
  padding: 12px 16px;
  background: white;
  color: #26354a;
  cursor: pointer;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: #315feb;
  color: white;
  border-color: #315feb;
}
button.success {
  color: #116443;
  background: #e6f4ec;
  border-color: #acd5bd;
}
button.warning {
  color: #8b5200;
  background: #fff3dc;
  border-color: #e4c791;
}
button.danger {
  color: #a32929;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #7598ff;
  outline-offset: 3px;
}
.card {
  padding: 20px;
  background: white;
  border: 1px solid #dce3ed;
  border-radius: 20px;
  margin: 16px 0;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.actions > * {
  flex: 1;
}
.full {
  width: 100%;
}
.notice {
  padding: 14px 16px;
  background: #fff2d9;
  color: #795018;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.5;
}
.slot {
  font-size: 36px;
  letter-spacing: 1px;
  font-weight: 750;
  margin: 10px 0;
}
.quantity {
  font-size: 23px;
  font-weight: 750;
  white-space: nowrap;
}
label {
  display: block;
  margin: 16px 0 7px;
  font-weight: 600;
}
input {
  width: 100%;
  min-height: 50px;
  border: 1px solid #bdc9d8;
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  font-size: 16px;
}
nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0;
}
nav button {
  flex: 1;
}
progress {
  width: 100%;
  height: 8px;
  accent-color: #315feb;
}
footer {
  font-size: 12px;
  color: #65758a;
  line-height: 1.7;
}
footer a {
  color: inherit;
}
#message:empty {
  display: none;
}
#message {
  position: fixed;
  bottom: 14px;
  left: 16px;
  right: 16px;
  max-width: 628px;
  margin: auto;
  background: #17263d;
  color: white;
  padding: 16px;
  border-radius: 14px;
  z-index: 10;
  box-shadow: 0 6px 30px #0003;
}
details {
  margin-top: 12px;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 10px 0;
}
.audit {
  font-size: 14px;
  border-bottom: 1px solid #e5eaf1;
  padding: 14px 0;
}
.audit pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px monospace;
}
.linkbox {
  overflow-wrap: anywhere;
  font-size: 14px;
}
a {
  color: #254fc6;
}
.status {
  font-size: 14px;
  color: #52677f;
}
.bottom {
  position: sticky;
  bottom: 0;
  background: #f4f6faf5;
  padding: 12px 0 max(12px, env(safe-area-inset-bottom));
}
[hidden] {
  display: none !important;
}
@media (max-width: 380px) {
  header,
  main,
  footer {
    padding: 16px;
  }
  .card {
    padding: 16px;
  }
  .actions {
    gap: 7px;
  }
  button {
    padding: 12px;
  }
}
:root .cabinet-link {
  display: block;
  background: #315feb;
  color: white;
  border-radius: 13px;
  padding: 14px 16px;
  min-height: 48px;
  text-align: center;
  font-weight: 600;
  text-decoration: none;
}
.completed-runs > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  min-height: 56px;
  padding: 16px;
  background: white;
  border: 1px solid #ccd5e1;
  border-radius: 13px;
  font-weight: 600;
}
.completed-runs > summary::-webkit-details-marker { display: none; }
.completed-runs > summary::after { content: "Показать ＋"; font-size: 14px; white-space: nowrap; color: #254fc6; }
.completed-runs[open] > summary::after { content: "Скрыть −"; }

/* A completed pick uses green text and checkmark, without a filled badge. */
.status.picked-status { color: #197044; font-weight: 600; }

/* Secondary picking actions are collapsed by default to keep the route clear. */
.run-more { border: 1px solid #ccd5e3; border-radius: 14px; background: #fff; }
.run-more > summary { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 12px 18px; list-style: none; font-weight: 600; cursor: pointer; }
.run-more > summary::-webkit-details-marker { display: none; }
.run-more > summary:focus-visible { outline: 3px solid #3e59ed; outline-offset: 3px; border-radius: 14px; }
.run-more[open] .run-more-chevron { transform: rotate(180deg); }
.run-more-items { display: grid; gap: 8px; padding: 0 12px 12px; }
.run-more-items button { margin: 0; min-height: 48px; text-align: left; }
.run-more-items .run-more-restart { margin-top: 8px; color: #8b4d17; }

/* Status filters wrap on phones without shrinking touch targets. */
.supply-tabs { display:flex; flex-wrap:wrap; gap:8px; margin:18px 0; }
.supply-tabs button { flex:1 1 100px; font-size:14px; padding:12px 8px; }
.supply-tabs button small { color:inherit; }

.photo-open { flex-shrink:0; padding:0; border:0; background:transparent; line-height:0; }
.photo-dialog { width:min(94vw,620px); max-height:90dvh; padding:16px; border:0; border-radius:16px; overflow:auto; }
.photo-dialog::backdrop { background:rgb(0 0 0 / 65%); }
.photo-close { display:block; margin:0 0 12px auto; position:sticky; top:0; background:white; }
.photo-dialog img { display:block; max-width:100%; max-height:70dvh; width:auto; height:auto; margin:auto; object-fit:contain; }
.photo-dialog img[hidden] { display:none; }
/* Large touch controls for receipt; checkbox must not inherit full-width text-input sizing. */
#return-slot { display:block; width:100%; min-height:48px; border:1px solid #cbd5e1; border-radius:12px; padding:10px; background:white; color:inherit; font:inherit; margin:8px 0 18px; }
#return-confirm input[type="checkbox"] { width:24px; height:24px; min-height:24px; display:inline-block; margin:0 8px 0 0; vertical-align:middle; }

/* Separate the scanner field from its action on every screen size. */
#return-scan button { margin-top:16px; }
#collector { width:100%; min-height:48px; padding:12px; border:1px solid #cbd5e1; border-radius:12px; font:inherit; background:white; margin:12px 0; }

/* Full identifiers stay visible; bold suffixes are only visual reference points. */
.packing-product { display:flex; gap:16px; align-items:center; }
.packing-product img { width:100px; height:100px; object-fit:contain; border-radius:10px; }
.packing-product > div { min-width:0; }
.packing-item { overflow-wrap:anywhere; }
.packing-size { font-size:22px; }
.packing-number { font-size:20px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.packing-number strong { font-size:1.2em; }
.packing-controls { display:flex; gap:8px; flex-wrap:wrap; margin:16px 0; }
.packing-controls button { flex:1 1 170px; min-height:48px; }
.packing-status { font-weight:600; }
.packing-status.accepted { color:#197044; }
.packing-status.waiting { color:#865300; }
.packing-status.error { color:#a32020; }
.packing-status.local { color:#526074; }
.packing-dialog { width:min(92vw,520px); max-height:90dvh; overflow:auto; border:0; border-radius:16px; padding:20px; }
.packing-dialog::backdrop { background:rgb(0 0 0 / 55%); }
.packing-dialog button { margin-top:12px; min-height:48px; }
#matching-filter select { display:block; width:100%; min-width:0; min-height:48px; margin-top:6px; padding:10px; border:1px solid #cbd5e1; border-radius:12px; background:#fff; color:inherit; font:inherit; }
#packing-scan button { margin-top:14px; }
#packing-print-surface { display:none; }
@media print {
  @page { size:58mm 40mm; margin:0; }
  body.packing-printing { margin:0; padding:0; }
  body.packing-printing > * { display:none !important; }
  body.packing-printing > #packing-print-surface { display:block !important; width:58mm; height:40mm; margin:0; padding:0; }
  #packing-print-surface img { display:block; width:58mm; height:40mm; margin:0; transform:scale(.9); transform-origin:center; }
}

/* Keep the personal-device choice readable and tappable on phones. */
.personal-device { display:flex; align-items:center; gap:12px; }
.personal-device input[type="checkbox"] { flex:0 0 24px; width:24px; height:24px; min-height:24px; margin:0; }
