/* Тёмная тема в стиле прошлого ТСД: крупно, контрастно, удобно пальцем */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #0e1014; --card: #161a20; --line: #2a3039; --text: #fff; --muted: #8a929e;
  --green: #22a06b; --blue: #3b7fe0; --red: #e5484d; --yellow: #e0a526; --teal: #1f9aa8;
}
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.35 Roboto, "Segoe UI", -apple-system, sans-serif; }
body { padding-bottom: env(safe-area-inset-bottom); user-select: none; }
.wrap { padding: 12px 12px 110px; max-width: 640px; margin: 0 auto; }
.hidden { display: none !important; }
h1 { font-size: 24px; margin: 8px 0 14px; }
h2 { font-size: 18px; margin: 18px 0 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.muted { color: var(--muted); font-size: 14px; }

/* Карточки и плитки */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-height: 130px; cursor: pointer; }
.tile .ic { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; margin-bottom: 12px; }
.tile b { display: block; font-size: 19px; }
.tile span { color: var(--muted); font-size: 14px; }

/* Кнопки и поля */
button, .btn { font: inherit; font-weight: 700; font-size: 17px; border: 0; border-radius: 12px; padding: 14px 16px;
  background: var(--blue); color: #fff; cursor: pointer; }
button.green { background: var(--green); } button.red { background: var(--red); }
button.ghost { background: var(--card); border: 1px solid var(--line); color: #ddd; }
button:disabled { opacity: .4; }
input, select { width: 100%; font: inherit; font-size: 18px; padding: 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #0b0d11; color: #fff; }
label { display: block; color: var(--muted); font-size: 14px; margin: 10px 0 6px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }

/* Верхняя панель экрана */
.top { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.top .title { flex: 1; font-size: 20px; font-weight: 800; }
.pill { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 10px 14px; font-weight: 700; }

/* Камера */
#cam { position: relative; background: #000; border-radius: 16px; overflow: hidden; margin-bottom: 10px; height: 34vh; }
#cam video { width: 100%; height: 100%; object-fit: cover; }
#cam .frame { position: absolute; inset: 18% 6%; border: 3px solid var(--green); border-radius: 12px; }
#cam .frame::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--red); }

/* Главная подсказка «что делать дальше» и строка статуса */
.prompt { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 22px 16px;
  font-size: 28px; font-weight: 800; text-align: center; margin-bottom: 10px; }
.status { border-radius: 14px; padding: 14px 16px; font-size: 18px; font-weight: 600; margin-bottom: 10px; background: var(--card); }
.status.ok { background: #123a26; } .status.err { background: #4a1618; } .status.warn { background: #4a3a10; }

/* Нижняя панель кнопок */
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: #0b0d11; border-top: 1px solid var(--line);
  display: flex; gap: 6px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); }
.bar button { flex: 1; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600;
  padding: 8px 2px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #ccc; }
.bar button i { font-style: normal; font-size: 22px; }
.bar button.warn { color: var(--yellow); }

/* Выбор места: линии и сетка мест */
.lines { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 10px; }
.lines button, .places button { padding: 14px 0; font-size: 20px; background: var(--card); border: 1px solid var(--line); }
.lines button.on { background: var(--blue); border-color: var(--blue); }
.places { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.places button.has { background: #123a26; border-color: var(--green); }   /* здесь этот товар уже лежит */
.places button.on { background: var(--blue); border-color: var(--blue); }
.places button small { display: block; font-size: 11px; color: #9fe0bf; font-weight: 600; }
.chosen { text-align: center; font-size: 30px; font-weight: 800; padding: 10px; }

/* Списки */
.item { display: flex; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .name { font-size: 15px; } .item .sub { color: var(--muted); font-size: 13px; }
.item .qty { font-size: 20px; font-weight: 800; white-space: nowrap; }
.click { cursor: pointer; }
.big-num { font-size: 40px; font-weight: 800; text-align: center; }
.stepper { display: flex; align-items: center; gap: 10px; } .stepper button { width: 64px; font-size: 26px; }
.stepper input { text-align: center; font-size: 28px; font-weight: 800; }
.minus { color: var(--red); } .plus { color: var(--yellow); }
