:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1b1f24;
  --muted: #5b6470;
  --line: #d9dee5;
  --accent: #1f5eff;
  --green: #1a8f45;
  --green-bg: #e6f6ec;
  --amber: #b7791f;
  --amber-bg: #fff4dc;
  --red: #c62828;
  --red-bg: #fdecea;
  --radius: 14px;
  font-family: -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 16px; line-height: 1.4; }
h1, h2, h3 { margin: 0; font-weight: 650; }
h1 { font-size: 1.35rem; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
small { color: var(--muted); font-weight: 400; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.topbar {
  display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: center;
  padding: 14px 24px; background: var(--panel); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { flex: 1 1 260px; }
.status-line { margin: 2px 0 0; color: var(--muted); font-size: 0.9rem; }
.metrics { display: flex; gap: 22px; margin: 0; }
.metrics div { text-align: center; }
.metrics dt { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.metrics dd { margin: 0; font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric-green { color: var(--green); }
.metric-amber { color: var(--amber); }
.metric-red { color: var(--red); }
.top-actions { display: flex; gap: 10px; }

main { display: grid; gap: 18px; padding: 20px 24px 40px; max-width: 1180px; margin: 0 auto; }
@media (min-width: 1000px) {
  main { grid-template-columns: minmax(360px, 460px) 1fr; }
  .history-section { grid-column: 1 / -1; }
}
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }

.field-row { display: grid; gap: 6px; margin-bottom: 14px; }
.field-label { font-weight: 600; font-size: 0.95rem; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.segmented { display: flex; flex-wrap: wrap; gap: 6px; }
.segmented button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px;
  font: inherit; font-size: 0.92rem; cursor: pointer; color: var(--ink);
}
.segmented button.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.segmented button.is-suggested:not(.is-active) { border-color: var(--accent); color: var(--accent); }

.scan-field { display: grid; grid-template-columns: 32px 1fr; grid-template-rows: auto auto auto; gap: 4px 10px; margin-bottom: 12px; }
.scan-field .step {
  grid-row: 1 / span 2; width: 32px; height: 32px; border-radius: 50%; background: var(--bg);
  display: grid; place-items: center; font-weight: 700; color: var(--muted); align-self: center;
}
.scan-field input {
  grid-column: 2; width: 100%; font: inherit; font-size: 1.15rem; padding: 12px 14px;
  border: 2px solid var(--line); border-radius: 10px; background: #fff; font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.scan-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.15); }
.scan-field input.is-done { border-color: var(--green); background: var(--green-bg); }
.scan-field input.is-bad { border-color: var(--red); background: var(--red-bg); }
.field-note { grid-column: 2; min-height: 1.2em; font-size: 0.85rem; color: var(--muted); }

.toggles { display: grid; gap: 8px; margin-top: 8px; }
.toggle {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; cursor: pointer; user-select: none;
}
.toggle input { width: 22px; height: 22px; accent-color: var(--red); }
.toggle span { flex: 1; font-weight: 600; }
.toggle small { border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; font-size: 0.75rem; }
.toggle:has(input:checked) { background: var(--red-bg); border-color: var(--red); }
.toggle--info input { accent-color: var(--amber); }
.toggle--info:has(input:checked) { background: var(--amber-bg); border-color: var(--amber); }

.result { min-height: 320px; display: flex; flex-direction: column; gap: 14px; border-width: 2px; }
.result--idle { border-color: var(--line); }
.result--green { border-color: var(--green); background: var(--green-bg); }
.result--yellow { border-color: var(--amber); background: var(--amber-bg); }
.result--red { border-color: var(--red); background: var(--red-bg); }
.result--busy { opacity: 0.7; }
.result-head { display: flex; gap: 16px; align-items: center; }
.status-icon {
  width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 1.8rem; font-weight: 700;
  background: #fff; border: 2px solid var(--line); flex: none;
}
.result--green .status-icon { color: var(--green); border-color: var(--green); }
.result--yellow .status-icon { color: var(--amber); border-color: var(--amber); }
.result--red .status-icon { color: var(--red); border-color: var(--red); }
.result h2 { font-size: 1.5rem; }
.product-name { margin: 2px 0 0; font-size: 1.05rem; }
.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.reasons li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; background: rgba(255,255,255,0.75); border-radius: 8px; }
.reasons li::before { content: "●"; font-size: 0.8rem; margin-top: 3px; }
.reasons li.green::before { color: var(--green); }
.reasons li.yellow::before { color: var(--amber); }
.reasons li.red::before { color: var(--red); }

.candidates { background: rgba(255,255,255,0.85); border-radius: 10px; padding: 12px 14px; }
.candidate { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; cursor: pointer; background: #fff; }
.candidate:hover { border-color: var(--accent); }
.candidate.is-chosen { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 94, 255, 0.15); }
.candidate .num { font-weight: 700; color: var(--muted); width: 24px; }
.candidate .meta { flex: 1; font-size: 0.92rem; }
.candidate .meta strong { display: block; }

.result-details { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px 16px; margin: 0; }
.result-details div { background: rgba(255,255,255,0.75); border-radius: 8px; padding: 8px 10px; }
.result-details dt { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.result-details dd { margin: 2px 0 0; font-weight: 600; word-break: break-word; }
.result-details dd.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 500; font-size: 0.9rem; }
.result-details a { color: var(--accent); }

.decision { display: grid; gap: 10px; margin-top: auto; }
.decision input { font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.decision-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.primary-button {
  font: inherit; font-size: 1.05rem; font-weight: 700; padding: 12px 22px; border-radius: 10px; border: none;
  background: var(--accent); color: #fff; cursor: pointer;
}
.primary-button:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.quiet-button {
  font: inherit; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer;
  color: var(--ink); text-decoration: none; display: inline-flex; align-items: center;
}
.quiet-button:hover { border-color: var(--ink); }

.section-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.section-heading span { color: var(--muted); font-size: 0.9rem; }
.history-list { display: grid; gap: 6px; }
.history-row {
  display: grid; grid-template-columns: 12px 64px 1fr auto auto auto; gap: 12px; align-items: center;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 0.92rem;
}
.history-row .dot { width: 12px; height: 12px; border-radius: 50%; }
.history-row .dot.green { background: var(--green); }
.history-row .dot.yellow { background: var(--amber); }
.history-row .dot.red { background: var(--red); }
.history-row .time { color: var(--muted); font-variant-numeric: tabular-nums; }
.history-row .what strong { display: block; }
.history-row .what small { display: block; }
.history-row .route { font-size: 0.85rem; padding: 3px 8px; border-radius: 999px; background: var(--bg); }
.history-row button { font: inherit; font-size: 0.85rem; border: none; background: none; color: var(--muted); cursor: pointer; }
.history-row button:hover { color: var(--red); }
.history-row.is-cancelled { opacity: 0.55; text-decoration: line-through; }
.cancelled-mark { font-size: 0.85rem; color: var(--muted); }
.empty-history { color: var(--muted); margin: 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff;
  padding: 12px 18px; border-radius: 10px; font-weight: 600; z-index: 10; max-width: 80vw;
}

/* ---- фото товара, несовпадение вложения, диалоги */
.product-photo {
  width: 92px; height: 92px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; flex: none;
}
.mismatch-box {
  background: rgba(255,255,255,0.9); border: 2px dashed var(--red); border-radius: 10px; padding: 12px 14px;
  display: grid; gap: 10px; justify-items: start;
}
.mismatch-box p { margin: 0; font-weight: 600; }
.extra-field { display: grid; gap: 4px; }
.extra-field span { font-weight: 600; font-size: 0.9rem; }
.extra-field input {
  font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.scan-field input.is-layout { border-color: var(--amber); background: var(--amber-bg); }

.dialog {
  border: none; border-radius: var(--radius); padding: 20px 22px; max-width: 560px; width: calc(100vw - 40px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25); color: var(--ink);
}
.dialog::backdrop { background: rgba(0,0,0,0.35); }
.dialog form { display: grid; gap: 12px; }
.dialog h2 { margin-bottom: 4px; }
.dialog-what { margin: 0 0 8px; color: var(--muted); }
.spare-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 10px; }
.chips { display: inline-flex; gap: 6px; }
.chip {
  font: inherit; font-size: 0.9rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); cursor: pointer;
}
.chip.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.spare-row.is-used { opacity: 0.75; }
.spare-toolbar .quiet-button { margin-left: auto; }
.spare-count { color: var(--muted); font-size: 0.9rem; }
.spare-list-scroll { max-height: 52vh; overflow: auto; }
.spare-row .pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.pill.is-ok { background: var(--green-bg); color: var(--green); }
.pill.is-warn { background: var(--amber-bg); color: var(--amber); }
.pill.is-bad { background: var(--red-bg); color: var(--red); }
.spare-row {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; font-size: 0.92rem;
}
.spare-row strong { display: block; }
.spare-row small { color: var(--muted); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.history-row .edit-button { color: var(--accent); }
.history-row .edit-button:hover { color: var(--ink); }
.history-row.is-edited .what strong::after { content: " · правлено"; font-weight: 400; color: var(--muted); font-size: 0.85rem; }

/* ---- предпросмотр размещения */
main.single { grid-template-columns: 1fr; max-width: 900px; }
.attrs-note { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.attrs-note--ok { background: var(--green-bg); color: var(--green); }
.attrs-note--warn { background: var(--amber-bg); color: var(--amber); }
.plan { border: 1px solid var(--line); border-left-width: 4px; border-radius: 12px; padding: 14px 16px; margin-bottom: 12px; }
.plan--ready { border-left-color: var(--green); }
.plan--warn { border-left-color: var(--amber); }
.plan header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.plan header h3 { flex: 1; font-size: 1.02rem; }
.plan-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: none; }
.plan--warn .plan-dot { background: var(--amber); }
.plan-badge { font-size: 0.8rem; padding: 3px 10px; border-radius: 999px; background: var(--bg); color: var(--muted); }
.plan .result-details div { background: var(--bg); }
.plan-desc { margin: 10px 0 0; font-size: 0.88rem; color: var(--muted); }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.85rem; }
.segmented--small button { padding: 4px 12px; font-size: 0.85rem; }
.section-heading { gap: 12px; }
.history-row .time { min-width: 74px; }

.plan--confirmed { border-left-color: var(--accent); background: rgba(31,94,255,0.04); }
.plan--done { border-left-color: var(--muted); opacity: 0.75; }
.plan--done .plan-dot { background: var(--muted); }
.plan-controls { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.plan-controls label { display: grid; gap: 4px; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.plan-controls select, .plan-controls input {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.plan-controls input { width: 140px; }
.plan-controls small { font-weight: 400; }
.plan-buttons { margin-left: auto; display: flex; gap: 8px; }


/* ---- экран размещения: поиск сканером */
.finder {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 8px 14px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.finder-field { display: grid; gap: 6px; margin: 0; }
.finder-label { font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.finder-field input {
  width: 100%;
  font-size: 1.05rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.finder-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.15); }
.finder-note { grid-column: 1 / -1; margin: 0; min-height: 1.15em; font-size: 0.88rem; color: var(--muted); }
.finder-note--ok { color: var(--green); font-weight: 600; }
.finder-note--miss { color: var(--red); font-weight: 600; }

/* ---- экран размещения: карточка вещи */
.plan header { align-items: flex-start; }
.plan .plan-dot { margin-top: 6px; }
.plan-title { flex: 1; min-width: 0; }
.plan-title h3 { font-size: 1.02rem; margin: 0; }
.plan-sub { margin: 3px 0 0; font-size: 0.85rem; color: var(--muted); word-break: break-word; }
.plan-fact { margin: 6px 0 0; font-weight: 600; }
.plan-price { font-size: 1.05rem; font-weight: 600; flex: 1 1 auto; padding-bottom: 8px; }
.plan-control { display: grid; gap: 4px; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.plan-more { margin-top: 10px; }
.plan-more summary {
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--muted);
  list-style: none;
}
.plan-more summary::-webkit-details-marker { display: none; }
.plan-more summary::before { content: "▸ "; }
.plan-more[open] summary::before { content: "▾ "; }
.plan-more .result-details { margin-top: 10px; }
.plan-more .plan-desc { margin-top: 8px; }

.done-block { margin-top: 18px; }
.done-block > .quiet-button { margin-bottom: 10px; }

/* ---- чужой код Честного знака: замена из обменного банка */
.swap-box { background: var(--amber-bg); border: 1px solid var(--amber); }
.swap-list { display: grid; gap: 8px; margin-top: 10px; }
.swap-list .candidate { background: var(--panel); }

/* ================================================================
   Экран приёмки: чек-лист (09.09.2026). Правила ниже перекрывают старые.
   ================================================================ */
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
kbd { font-family: inherit; font-size: 0.74rem; border: 1px solid rgba(0,0,0,0.18); border-radius: 5px; padding: 0 6px; }

/* шапка тише: статусы серым, действия — текстом */
.topbar { padding: 10px 24px; gap: 12px 26px; }
.topbar h1 { font-size: 1.1rem; }
.status-line { font-size: 0.78rem; color: #9aa3ad; }
.metrics { gap: 18px; }
.metrics dt { font-size: 0.66rem; }
.metrics dd { font-size: 1.25rem; }
.top-actions { margin-left: auto; gap: 16px; }
.top-link { font: inherit; font-size: 0.85rem; color: var(--muted); background: none; border: none; padding: 0; cursor: pointer; text-decoration: none; border-bottom: 1px solid transparent; }
.top-link:hover { border-bottom-color: var(--muted); }

/* слева только сканирование; после скана приглушается */
@media (min-width: 1000px) { main { grid-template-columns: minmax(300px, 360px) 1fr; } }
.scan-panel { transition: opacity 0.2s; }
.scan-panel.is-dim { opacity: 0.72; }
.scan-panel.is-dim:hover, .scan-panel.is-dim:focus-within { opacity: 1; }
.scan-field { grid-template-columns: 28px 1fr; align-items: center; }
.scan-field .step { grid-row: 1 / span 3; align-self: center; justify-self: center; width: 28px; height: 28px; background: var(--ink); color: #fff; font-size: 0.85rem; display: flex; align-items: center; justify-content: center; line-height: 1; }
.scan-field input { font-size: 1.05rem; padding: 10px 12px; }

/* результат: белая карточка, цвет только в маркерах */
.result { min-height: 0; padding: 0; gap: 0; border-width: 1px; background: var(--panel); }
.result--green, .result--yellow, .result--red { background: var(--panel); border-color: var(--line); }
.result-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line); gap: 14px; }
.result--idle .result-head { border-bottom: none; }
.product-photo { width: 72px; height: 72px; }
.result-title { flex: 1; min-width: 0; }
.result h2 { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.01em; }
.product-code { margin: 2px 0 0; color: var(--muted); font-size: 0.82rem; word-break: break-word; }
.verdict { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; font-weight: 650; font-size: 0.95rem; white-space: nowrap; background: var(--bg); color: var(--muted); }
.verdict-icon { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #9aa3ad; }
.verdict-icon svg.i { width: 13px; height: 13px; stroke-width: 2.6; }
.result--green .verdict { background: var(--green-bg); color: var(--green); } .result--green .verdict-icon { background: var(--green); }
.result--yellow .verdict { background: var(--amber-bg); color: var(--amber); } .result--yellow .verdict-icon { background: var(--amber); }
.result--red .verdict { background: var(--red-bg); color: var(--red); } .result--red .verdict-icon { background: var(--red); }
.status-icon { width: auto; height: auto; border: none; background: none; font-size: inherit; }

.checklist { list-style: none; margin: 0; padding: 8px 10px 4px; }
.checklist:empty { display: none; }
.check + .check { margin-top: 2px; }
.check-row { display: grid; grid-template-columns: 22px 138px 1fr; gap: 10px; align-items: start; padding: 6px 10px; border-radius: 10px; }
.check .mark { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; color: #fff; margin-top: 2px; }
.check .mark svg.i { width: 11px; height: 11px; stroke-width: 2.8; }
.check.green .mark { background: var(--green); } .check.yellow .mark { background: var(--amber); } .check.red .mark { background: var(--red); }
.check .cat { display: flex; align-items: center; gap: 7px; font-size: 0.85rem; font-weight: 600; color: var(--muted); padding-top: 2px; }
.check .cat svg.i { width: 16px; height: 16px; color: #98a1ab; }
.check .body { min-width: 0; display: grid; }
.check.green .status { color: var(--muted); font-size: 0.88rem; padding-top: 2px; }
.check.yellow .check-row, .check.red .check-row { padding: 10px; }
.check.yellow .check-row { background: var(--amber-bg); } .check.red .check-row { background: var(--red-bg); }
.check.yellow .status, .check.red .status { font-weight: 650; font-size: 0.97rem; }
.check.yellow .status { color: var(--amber); } .check.red .status { color: var(--red); }
.check .fact { color: var(--muted); font-size: 0.85rem; margin-top: 2px; line-height: 1.35; }
.check .more { margin: 4px 10px 8px 42px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 0.9rem; display: grid; gap: 8px; }
.notes { margin: 0; padding: 0 0 0 18px; color: var(--muted); font-size: 0.86rem; }
.notes li + li { margin-top: 2px; }

/* блоки действий внутри пунктов */
.candidates { background: none; padding: 0; }
.candidate { margin-top: 0; padding: 9px 12px; }
.candidate + .candidate, .candidate + .candidate-none { margin-top: 8px; }
.candidate .pick { color: var(--accent); font-weight: 600; font-size: 0.85rem; }
.candidate-none { width: 100%; justify-content: center; font-weight: 600; }
.candidate-none.is-chosen { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31, 94, 255, 0.15); }
#candidate-list { display: grid; gap: 8px; }
.mismatch-box { background: none; border: none; padding: 0; gap: 10px; }
.mismatch-box p { line-height: 1.5; }
.btn-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.after { color: var(--muted); font-size: 0.82rem; }
.swap-box { background: none; border: none; padding: 0; }
.swap-box p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.swap-list { margin-top: 0; }

/* состояние и решение — один блок */
.decision { border-top: 1px solid var(--line); padding: 12px 18px 16px; background: #fcfcfd; gap: 10px; margin-top: 0; }
.flags { display: flex; flex-wrap: wrap; gap: 6px; }
.flag { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer; user-select: none; }
.flag input { width: 15px; height: 15px; margin: 0; accent-color: var(--red); }
.flag kbd { color: #9aa3ad; border: none; padding: 0; }
.flag small { color: var(--muted); font-weight: 400; }
.flag:has(input:checked) { background: var(--red-bg); border-color: var(--red); }
.flag--info input { accent-color: var(--amber); }
.flag--info:has(input:checked) { background: var(--amber-bg); border-color: var(--amber); }
.lock-line { margin: 0; display: flex; gap: 8px; align-items: center; color: var(--red); font-weight: 650; font-size: 0.9rem; }
#route button { padding: 8px 14px; border-radius: 10px; font-weight: 600; font-size: 0.9rem; }
#route button.is-suggested:not(.is-active) { border-color: var(--green); color: var(--green); }
#route button.is-off { opacity: 0.45; text-decoration: line-through; cursor: not-allowed; }
.route-why { margin: 0; color: var(--muted); font-size: 0.84rem; }
.decision-actions { gap: 18px; align-items: center; }
.primary-button kbd { border-color: rgba(255,255,255,0.55); }
.primary-button--big { padding: 13px 22px; font-size: 1rem; display: inline-flex; gap: 10px; align-items: center; }
.link-button { font: inherit; font-size: 0.9rem; font-weight: 600; color: var(--muted); background: none; border: none; padding: 0; cursor: pointer; }
.link-button:hover { color: var(--ink); }
.link-button kbd { margin-left: 4px; }
.extra { color: var(--muted); font-size: 0.9rem; }
.extra summary { cursor: pointer; list-style: none; font-weight: 600; }
.extra summary::-webkit-details-marker { display: none; }
.extra-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; min-width: 420px; }
.extra-grid input { width: 100%; }

/* журнал: свёрнут, пока не нужен */
.history-section { padding: 10px 18px; }
.history-section .section-heading { margin-bottom: 0; gap: 14px; align-items: center; }
.history-section h2 { font-size: 0.95rem; }
.history-section .link-button { margin-left: auto; }
.history-section.is-collapsed .history-list { display: none; }
.history-section:not(.is-collapsed) .section-heading { margin-bottom: 10px; }
/* до скана: пять пунктов видны серыми */
.result--idle .checklist { padding-bottom: 12px; }
.check.idle .mark { background: var(--line); }
.check.idle .cat { color: #9aa3ad; }
.check.idle .cat svg.i { color: #c3c9d0; }
.check.idle .status { color: #b3bac2; font-size: 0.88rem; padding-top: 2px; }
.photo-placeholder { width: 72px; height: 72px; border-radius: 10px; background: #e6e9ee; display: grid; place-items: center; color: #b3bac2; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; flex: none; }
.result--idle .result-head { border-bottom: 1px solid var(--line); }
.result--idle #product-name { color: var(--muted); font-weight: 600; }
.decision.is-idle { opacity: 0.45; pointer-events: none; user-select: none; }

/* этикетки: отдельная панель под результатом; печатает сервис печати */
.labels-panel { display: grid; gap: 10px; grid-column: 1 / -1; padding: 14px 18px 16px; }
.labels-panel.is-idle { opacity: 0.45; pointer-events: none; user-select: none; }
.labels-panel h2 { font-size: 0.95rem; margin-right: 6px; }
.labels-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.labels-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.84rem; color: var(--muted); }
.labels-caption { font-weight: 600; }
.labels-hint { margin-left: auto; color: var(--muted); font-size: 0.84rem; }
.label-button { padding: 7px 12px; font-size: 0.9rem; font-weight: 600; gap: 6px; }
.label-button kbd { color: #9aa3ad; border: none; padding: 0; }
.label-button.is-suggested { border-color: var(--green); color: var(--green); box-shadow: 0 0 0 3px rgba(26, 143, 69, 0.12); }
.label-button:disabled { opacity: 0.45; cursor: not-allowed; }
.copies { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); font-size: 0.85rem; }
.copies input { width: 52px; font: inherit; font-size: 0.9rem; padding: 5px 4px; border: 1px solid var(--line); border-radius: 8px; text-align: center; }
#label-profile button { padding: 5px 10px; font-size: 0.8rem; }
.labels-printer { color: var(--muted); font-size: 0.84rem; }
.labels-printer.is-bad { color: var(--red); font-weight: 600; }
.label-card { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.label-card.is-ready { border-color: var(--green); }
.label-card.is-incomplete { border-color: var(--amber); }
.label-card.is-bad { border-color: var(--red); }
.label-card.is-busy { opacity: 0.7; }
.label-card.is-printed { background: var(--green-bg); }
.label-preview { width: 174px; height: 180px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.label-body { display: grid; gap: 8px; align-content: start; min-width: 0; }
.label-line { margin: 0; font-weight: 650; }
.label-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 0.86rem; }
.label-checks:empty { display: none; }
.label-checks li { padding-left: 16px; position: relative; }
.label-checks li::before { content: "●"; position: absolute; left: 0; top: 1px; font-size: 0.7rem; }
.label-checks li.green::before { color: var(--green); }
.label-checks li.yellow::before { color: var(--amber); }
.label-checks li.red::before { color: var(--red); }
.label-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }
.label-field { display: grid; gap: 3px; font-size: 0.82rem; }
.label-field > span { font-weight: 600; color: var(--muted); }
.label-field input { width: 100%; font: inherit; font-size: 0.9rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.label-field--wide, .label-field--actions { grid-column: 1 / -1; }
.label-field.is-missing input { border-color: var(--red); background: var(--red-bg); }
.label-field.is-missing > span { color: var(--red); }
.label-field .segmented button { padding: 5px 10px; font-size: 0.82rem; }
.label-note { margin: 0; font-size: 0.88rem; }
.label-note:empty { display: none; }
.label-note.is-ok { color: var(--green); font-weight: 600; }
.label-note.is-bad { color: var(--red); font-weight: 600; }

/* размещение: вещь с браком уходит в карантин */
.plan-defect { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--red-bg);
  color: var(--red); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; vertical-align: middle; }

/* Фильтры размещения: подписи остаются видны и на узком экране. */
.placement-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 0 0 18px; }
.placement-filters .plan-control { flex: 1 1 220px; }
.placement-filters select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; }
.placement-filters .finder-note { flex-basis: 100%; }

.placement-page .top-actions { flex-wrap: wrap; min-width: 0; max-width: 100%; }
.placement-filters .plan-control { min-width: 0; }

/* Ход размещения и ожидание фоновой проверки. */
.placement-job { padding: 16px; margin-bottom: 18px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; background: #f4f7ff; overflow-wrap: anywhere; }
.placement-job h2 { font-size: 1.05rem; }
.placement-job p { margin: 7px 0 0; }
.placement-job .job-counts { font-weight: 600; font-variant-numeric: tabular-nums; }
.placement-job .job-elapsed, .plan-freshness { color: var(--muted); font-size: .82rem; }
.job-details { margin: 10px 0 0; padding-left: 20px; max-height: 240px; overflow: auto; }
.job-details li + li { margin-top: 5px; }
.plan--pending { border-left-color: var(--muted); }
.plan--pending .plan-dot { background: var(--muted); }
.plan-draft { color: var(--amber); font-size: .85rem; margin: 8px 0 0; }
.plan-freshness { margin: 8px 0 0; }
.placement-page .plan-badge { max-width: 45%; overflow-wrap: anywhere; }
.placement-page .plan-more dd { overflow-wrap: anywhere; }
@media (max-width: 540px) {
  .placement-page .topbar { position: static; padding: 12px 14px; }
  .placement-page main.single { padding: 14px 10px 30px; }
  .placement-page .panel { padding: 12px; min-width: 0; }
  .placement-page .top-actions { gap: 8px; }
  .placement-page .top-actions button { white-space: normal; }
  .placement-page .plan { padding: 12px; }
  .placement-page .plan header { flex-wrap: wrap; }
  .placement-page .plan-title { min-width: 180px; }
  .placement-page .plan-badge { max-width: 100%; margin-left: 20px; }
  .placement-page .finder { display: flex; flex-wrap: wrap; padding: 12px; }
  .placement-page .finder-field { min-width: 0; width: 100%; }
  .placement-page .plan-buttons { margin-left: 0; }
}

.placement-page button:disabled { cursor: default; opacity: .55; }

/* Состав отправления: что уезжало по этому номеру, когда штрих-код на вещи не читается */
.shipment { display: grid; gap: 12px; }
.shipment-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.shipment-head h2 { margin: 0; font-size: 17px; }
.shipment-sub { margin: 2px 0 0; color: var(--muted, #6b7280); font-size: 13px; }
.shipment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ship-item { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; }
.ship-photo { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; background: #f3f4f6; }
.ship-photo--empty { display: flex; align-items: center; justify-content: center; color: #9ca3af; font-size: 11px; }
.ship-text { flex: 1 1 auto; min-width: 0; }
.ship-name { margin: 0; font-weight: 600; }
.ship-meta { margin: 2px 0 0; color: var(--muted, #6b7280); font-size: 13px; }
.ship-nobarcode { color: var(--muted, #6b7280); font-size: 13px; }
.shipment-notes { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--muted, #6b7280); font-size: 13px; }
.scan-extra { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }

/* Авторизация и страница входа */
.auth-user { display: inline-flex; align-items: center; padding: 0 10px; font-size: 0.9rem; color: var(--muted); font-weight: 600; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-shell { width: 100%; max-width: 400px; display: block; padding: 0; }
.login-card { padding: 26px 24px; display: grid; gap: 14px; }
.login-sub { margin: 0; color: var(--muted); font-size: 0.92rem; }
.login-form { display: grid; gap: 14px; }
.login-field { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; }
.login-field input {
  width: 100%; font: inherit; font-size: 1rem; padding: 11px 13px;
  border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.login-field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(31, 94, 255, 0.15); }
.login-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--red-bg); color: var(--red); font-size: 0.9rem; font-weight: 600; }
.login-submit { width: 100%; }
.login-submit:disabled { opacity: 0.6; cursor: default; }
