:root {
  --bg: #0f1115;
  --panel: #171a21;
  --line: #262b36;
  --text: #e7eaf0;
  --muted: #8b94a7;
  --ok: #3ddc97;
  --warn: #f0b429;
  --error: #ff6b6b;
  --accent: #5b8def;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.4 "Segoe UI", system-ui, sans-serif;
}

/* Рабочее место не скроллится: у сборщика в руках сканер, а не мышь.
   Прокрутка допустима только внутри списков. */
.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
}

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}

.top__left { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.top__brand { font-weight: 600; font-size: 15px; }
.top__account { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.top__right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.dot { width: 10px; height: 10px; border-radius: 50%; background: #3a3f4b; }
.dot--ok { background: var(--ok); }
.dot--warn { background: var(--warn); }

.icon-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 15px;
}
.icon-btn:hover { color: var(--text); border-color: var(--accent); }

/* Порядок шагов виден всегда: где я сейчас и что дальше. */
.steps {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0 auto;
  padding: 0;
  flex-wrap: nowrap;
}

.step {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
}
.step__num {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--line); color: var(--text);
  font-size: 12px; font-weight: 600;
}
.step--done { color: var(--ok); border-color: rgba(61, 220, 151, .35); }
.step--done .step__num { background: var(--ok); color: #06281b; }
.step--current { color: var(--text); border-color: var(--accent); background: rgba(91, 141, 239, .1); }
.step--current .step__num { background: var(--accent); color: #05122e; }

@media (max-width: 760px) {
  .step__name { display: none; }
  .step { padding: 6px 9px; }
}

.settings {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 10px 18px; border-bottom: 1px solid var(--line);
  background: var(--panel); font-size: 13px; color: var(--muted);
}
.settings select {
  background: #0c0e13; color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 8px; margin-left: 6px;
}
.settings__note { color: var(--text); }
.settings__warn { color: var(--warn); }

.stage { min-height: 0; }

.screen { display: none; height: 100%; min-height: 0; }
.screen--active { display: grid; }

.screen[data-screen="1"].screen--active,
.screen[data-screen="4"].screen--active { place-items: center; }

.screen__center { text-align: center; padding: 20px; max-width: 640px; }

.lead { color: var(--muted); margin: 0 0 8px; font-size: 14px; }
.supply-id { font-size: clamp(24px, 4vw, 40px); font-weight: 600; margin: 0 0 20px; }

.row { display: flex; gap: 12px; justify-content: center; align-items: center; }
.row--wrap { flex-wrap: wrap; }

.btn {
  padding: 12px 20px; border-radius: 10px; font-size: 15px; cursor: pointer;
  border: 1px solid var(--line); background: #0c0e13; color: var(--text);
}
.btn:hover { border-color: var(--accent); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #05122e; font-weight: 600; }
.btn--primary:hover { filter: brightness(1.1); }
.btn--ghost { color: var(--muted); }
.btn--ghost:hover { color: var(--text); }

.screen[data-screen="2"].screen--active { grid-template-rows: auto 1fr auto; min-height: 0; }

.progress { display: flex; align-items: center; gap: 12px; padding: 12px 18px 0; }
.progress__bar { flex: 1; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress__bar i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s; }
.progress__text { color: var(--muted); font-size: 13px; white-space: nowrap; }

.pick {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 16px;
  min-height: 0;
}

.pick__prompt {
  font-size: clamp(22px, 3.4vw, 38px);
  font-weight: 600;
  text-align: center;
  color: var(--accent);
}
.pick--marking .pick__prompt { color: var(--warn); }
.pick--ok .pick__prompt { color: var(--ok); }

.pick__input {
  width: min(560px, 88vw);
  padding: 14px 18px;
  font-size: 24px;
  font-family: ui-monospace, "Cascadia Mono", monospace;
  color: var(--text);
  background: #0c0e13;
  border: 2px solid var(--accent);
  border-radius: 12px;
  outline: none;
  text-align: center;
}
.pick--marking .pick__input { border-color: var(--warn); }

.pick__item {
  text-align: center;
  font-size: clamp(16px, 2vw, 22px);
  min-height: 1.4em;
}
.pick__item b { display: block; font-size: 1.25em; }
.pick__item span { color: var(--muted); font-size: .8em; font-family: ui-monospace, monospace; }

.pick__hint { color: var(--muted); font-size: 13px; text-align: center; }

.strip {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel);
}
.strip__next { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.strip__label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.strip__items { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }

.screen[data-screen="3"].screen--active { grid-template-rows: 1fr auto; min-height: 0; }

.pack { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 18px; min-height: 0; }
@media (max-width: 760px) { .pack { grid-template-columns: 1fr; } }

.pack__side { display: grid; grid-template-rows: auto 1fr auto; gap: 10px; min-height: 0; }
.h2 { margin: 0; font-size: 14px; color: var(--muted); font-weight: 600; }
.h2 b { color: var(--text); }

.picklist { list-style: none; margin: 0; padding: 0; overflow-y: auto; min-height: 0; font-size: 14px; }
.picklist li { padding: 8px 4px; border-bottom: 1px solid var(--line); }
.picklist label { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.picklist input { width: 18px; height: 18px; }

.boxlist {
  background: #0c0e13; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 6px; font-family: ui-monospace, monospace; font-size: 14px;
  min-height: 0;
}

.mini { color: var(--muted); font-size: 13px; }
.mini input {
  width: 62px; background: #0c0e13; color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; margin-left: 6px;
}

.journal {
  list-style: none; margin: 20px 0 0; padding: 0;
  font-size: 12px; font-family: ui-monospace, monospace;
  text-align: left; max-height: 22vh; overflow-y: auto;
}
.journal li { padding: 5px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; }
.journal b { min-width: 78px; }
.journal .sent { color: var(--ok); }
.journal .previewed { color: var(--warn); }
.journal .failed { color: var(--error); }

.say {
  padding: 10px 18px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted); min-height: 40px;
}
.say--ok { color: var(--ok); }
.say--warn { color: var(--warn); }
.say--error { color: var(--error); }

.mono { font-family: ui-monospace, monospace; }

/* ── Экран входа ── */
.app--single { grid-template-rows: 1fr; }
.gate { display: grid; place-items: center; padding: 24px; }
.gate__form {
  width: min(380px, 92vw);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  display: grid;
  gap: 14px;
}
.gate__title { margin: 0; font-size: 20px; }
.gate__lead { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.gate__field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.gate__field input {
  background: #0c0e13; color: var(--text); border: 1px solid var(--line);
  border-radius: 9px; padding: 11px 13px; font-size: 16px; outline: none;
}
.gate__field input:focus { border-color: var(--accent); }
.gate__submit { margin-top: 6px; }
.gate__error { margin: 0; min-height: 1.2em; color: var(--error); font-size: 13px; }
.gate__accounts { display: grid; gap: 10px; }
.gate__account { width: 100%; }
