:root {
  --bg: #000000; --bar: #0F0F0F; --card: #1D1D1D; --card2: #2A2A2A;
  --text: #FFFFFF; --muted: #A3A3A3;
  --ok: #2EC26A; --warn: #F7C34E; --bad: #FF4D4D;
  --main: linear-gradient(90deg, #EF000E, #8A0076);
  --second: linear-gradient(90deg, #730C97, #581FBF);
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "Montserrat", system-ui, sans-serif; font-weight: 600;
}
header {
  background: var(--bar); padding: 16px 16px; font-weight: 800; font-size: 18px;
  position: sticky; top: 0;
}
main { max-width: 640px; margin: 0 auto; padding: 16px; }
h2 { font-size: 16px; font-weight: 800; margin: 0 0 16px; }
.card { background: var(--card); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.muted { color: var(--muted); font-size: 14px; }
label { display: block; color: var(--muted); font-size: 13px; margin: 8px 0 4px; }
input {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 0;
  background: var(--card2); color: var(--text); font: inherit; font-size: 16px;
}
.row { display: flex; gap: 8px; }
.row > * { flex: 1; }
.btn {
  display: block; width: 100%; min-height: 56px; margin: 0; padding: 0 16px; border: 0; border-radius: 12px;
  color: #fff; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer;
  background: var(--main);
  line-height: 1.2;   /* 2 рядки з емодзі влазять у 56 */
}
.btn.second { background: var(--second); }
.preview { display: block; width: 100%; max-width: 400px; margin: 16px auto 0;
  border-radius: 6px; background: #fff; image-rendering: pixelated; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; border: 2px solid; font-size: 13px; }
.pill.green { color: var(--ok); border-color: var(--ok); }
.pill.yellow { color: var(--warn); border-color: var(--warn); }
.pill.red { color: var(--bad); border-color: var(--bad); }
#result { margin-top: 16px; min-height: 28px; }

/* --- этап 1: каркас, меню, карта --- */
a { color: inherit; }
header { display: flex; align-items: center; justify-content: space-between; z-index: 5; }
header .brand { text-decoration: none; }
nav.top a { text-decoration: none; color: var(--muted); margin-left: 16px; font-size: 15px; }
h1 { font-size: 22px; font-weight: 800; margin: 4px 0 16px; }
.t-orders { color: #A9A5E8; } .t-sklad { color: #F0877B; }
.t-reserves { color: #2DD4BF; } .t-staff { color: #5BA3E8; }

.row-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.h2link { font-size: 18px; font-weight: 800; text-decoration: none; }
.tag { background: var(--card2); color: var(--muted); border-radius: 8px; padding: 4px 8px; font-size: 12px; }
ul.places { list-style: none; padding: 0; margin: 16px 0 0; }
ul.places li {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  background: var(--card2); border-radius: 10px; min-height: 44px; padding: 8px 12px; margin-bottom: 8px;
}
ul.places li a { text-decoration: none; flex: 1; }
details { margin-top: 16px; }
details summary { color: var(--muted); cursor: pointer; min-height: 32px; }
details.card summary { font-weight: 800; color: var(--text); }
form.inline { display: flex; gap: 8px; margin-top: 8px; }
form.inline input { flex: 1; }
.btn.small { min-height: 44px; font-size: 14px; width: auto;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* маленькая — всегда в одну строку */
.btn.danger { background: transparent; border: 2px solid var(--bad); color: var(--bad); }
.btn:disabled { opacity: .4; cursor: default; }
select {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: 10px; border: 0;
  background: var(--card2); color: var(--text); font: inherit; font-size: 16px;
}
.border-red { border: 1px solid var(--bad) !important; }
.border-yellow { border: 1px solid var(--warn) !important; }
.crumbs { margin: 0 0 4px; color: var(--muted); font-size: 14px; }
.crumbs a { text-decoration: none; }
.stickers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stickers .preview { margin: 0; }
.small { font-size: 12px; } .center { text-align: center; } .break { word-break: break-all; }
code { background: var(--card2); padding: 2px 8px; border-radius: 6px; word-break: break-all; }
.result { margin-top: 8px; min-height: 4px; }
.steps { padding-left: 24px; line-height: 1.5; }
.scanres { margin-top: 16px; }

/* --- плашки выбора (как фильтры на макетах) --- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { margin: 0; color: var(--text); font-size: 14px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  border-radius: 10px; background: var(--card2); cursor: pointer; user-select: none;
}
.chip input:checked + span { background: #fff; color: #000; }
.chip input:focus-visible + span { outline: 2px solid #fff; outline-offset: 2px; }
.stepper { display: flex; gap: 8px; }
.stepper input { text-align: center; font-weight: 800; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button, .stepper input::-webkit-outer-spin-button { -webkit-appearance: none; }
.stepper button {
  flex: 0 0 56px; min-height: 44px; border: 0; border-radius: 10px; background: var(--card2);
  color: var(--text); font: inherit; font-size: 22px; font-weight: 800; cursor: pointer;
}

html { background: var(--bg); }
body { overflow-x: hidden; min-height: 100vh; }
header .brand { display: flex; align-items: center; gap: 16px; color: #fff; }
header .brand img { display: block; height: 24px; width: auto; }
header .vline { width: 1px; height: 22px; background: #fff; opacity: .9; }
header .place { font-size: 14px; font-weight: 700; color: #fff; letter-spacing: .25px; }
nav.top { display: flex; gap: 4px; }
nav.top a { display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; margin: 0; color: var(--muted); border-radius: 10px; }
nav.top a:hover { color: #fff; background: var(--card); }
/* поля в строку не вылезают за край */
.row > *, form.inline > * { min-width: 0; }
input, select, button { max-width: 100%; }

/* --- этап 2: склад, приёмка, товар --- */
a.btn { display: flex; align-items: center; justify-content: center; text-decoration: none; text-align: center; }
textarea {
  width: 100%; padding: 8px 12px; border-radius: 10px; border: 0; resize: vertical;
  background: var(--card2); color: var(--text); font: inherit; font-size: 16px;
}
h2.section { margin: 24px 0 8px; color: var(--muted); font-size: 14px; }
.searchbar { display: flex; gap: 8px; margin-bottom: 16px; }
.searchbar input { flex: 1; min-width: 0; min-height: 56px; font-size: 17px; }
.searchbar .btn { width: auto; flex: 0 0 auto; }
.badge { display: inline-block; min-width: 22px; padding: 1px 8px; margin-left: 8px; border-radius: 999px;
  background: var(--bad); color: #fff; font-size: 13px; }
ul.log { list-style: none; margin: 0; padding: 0; }
ul.log li { padding: 8px 0; border-bottom: 1px solid var(--card2); display: flex; flex-direction: column; gap: 2px; }
ul.log li:last-child { border-bottom: 0; }
ul.log a { text-decoration: none; }
a.item-card { display: block; text-decoration: none; }
.item-card b { font-weight: 700; }
.where { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.item-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: -8px 0 16px; }
dl.fields { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 16px;
  background: var(--card); border-radius: 12px; padding: 16px 16px; }
dl.fields dt { color: var(--muted); font-size: 13px; }
dl.fields dd { margin: 0; word-break: break-all; }
form.act { margin-top: 16px; }
.chosen { background: var(--card2); border-radius: 10px; padding: 16px; color: var(--muted);
  font-weight: 700; margin-bottom: 4px; }
.chosen.on { color: var(--ok); border: 2px solid var(--ok); }
.sticky-action { position: sticky; bottom: calc(var(--navh) + env(safe-area-inset-bottom)); padding: 8px 0; background: linear-gradient(transparent, var(--bg) 30%); z-index: 3; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; margin: 8px 0 0; }
.check input { width: 22px; height: 22px; min-height: 0; accent-color: #2EC26A; flex: 0 0 auto; }
.checklist li { padding: 0 12px; }
.checklist .check { margin: 0; min-height: 52px; width: 100%; }
.scanbox { margin-bottom: 8px; }
.picker { margin-top: 8px; }
.picker-group { margin-top: 8px; }
.picker-title { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.picker-filter { margin-bottom: 4px; }
.toast { position: sticky; top: 56px; z-index: 6; margin: 8px 16px 0; padding: 12px 16px; border-radius: 12px;
  font-weight: 700; transition: opacity .4s; }
.toast.ok { background: #0f2a1a; color: var(--ok); border: 2px solid var(--ok); }
.toast.err { background: #2a0f0f; color: var(--bad); border: 2px solid var(--bad); }
.toast.hide { opacity: 0; pointer-events: none; }
.cam { position: fixed; inset: 0; background: #000; z-index: 50; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 16px; gap: 16px; }
.cam video { width: 100%; max-width: 520px; border-radius: 12px; }
.cam .cam-frame { position: absolute; width: 220px; height: 220px; border: 3px solid #fff; border-radius: 16px;
  box-shadow: 0 0 0 4000px rgba(0,0,0,.35); pointer-events: none; }
.cam p { color: #fff; z-index: 1; }
.cam .btn { max-width: 520px; z-index: 1; }

/* --- этапы 3–6: заявки, резервы, працівники, вхід --- */
.filter { margin-bottom: 16px; }
.scroll-x { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.chip-link, .chip-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px;
  background: var(--card); color: var(--text); text-decoration: none; font: inherit; font-size: 14px;
  border: 0; cursor: pointer; white-space: nowrap;
}
.chip-link.on { background: #fff; color: #000; }
.chip-btn { background: var(--card2); }
.chip-btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
form.chip-del { display: inline; margin: 0; }
.cnt { background: var(--card2); color: var(--text); border-radius: 999px; padding: 0 8px; font-size: 12px; }
.chip-link.on .cnt { background: #000; color: #fff; }
.chip.wide { flex: 1 1 100%; }
.chip.wide span { width: 100%; flex-direction: column; align-items: flex-start; justify-content: center; padding: 8px 16px; }
.chip small { font-weight: 600; font-size: 12px; opacity: .75; }
b.big { font-size: 20px; font-weight: 800; }
.nowrap { white-space: nowrap; }
.line { border-top: 1px solid var(--card2); margin-top: 16px; padding-top: 12px; }
.line-head { display: flex; justify-content: space-between; gap: 8px; }
.label-s { color: var(--muted); font-size: 13px; margin: 8px 0 8px; }
details.put summary { color: var(--text); font-weight: 700; margin-top: 8px; }
.row.three { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.row.three .btn { padding: 0 8px; font-size: 13px; }
.row form { flex: 1; margin: 0; }
.qr-big { display: block; width: 100%; max-width: 280px; margin: 16px auto; border-radius: 12px; background: #fff; image-rendering: pixelated; }
.dups { background: var(--card2); border-radius: 10px; padding: 8px 12px; margin-top: 16px; }
.dups p { margin: 4px 0; }
summary.arrived-btn { list-style: none; display: flex; align-items: center; justify-content: center;
  background: var(--main); color: #fff; width: 100%; }
summary.arrived-btn::-webkit-details-marker { display: none; }
hr { border: 0; border-top: 1px solid var(--card2); margin: 16px 0; }
a { -webkit-tap-highlight-color: transparent; }
a[href^="tel:"] { color: var(--text); }
[hidden] { display: none !important; }
/* скрытые radio/checkbox в плашках не должны растягивать страницу (iPhone из-за этого уменьшал всё) */
.chip { position: relative; }
.chip input { width: 1px; height: 1px; min-height: 0; padding: 0; margin: 0; left: 0; top: 0; }
html, body { max-width: 100%; }

/* --- компьютер (> 900 px): общий контейнер 1100 px для шапки, контента и нижнего меню --- */
.grid { display: block; }
@media (min-width: 901px) {
  main { padding-top: 24px; padding-bottom: 48px; }
  /* кнопки не на всю ширину: одна — до 400 px, в ряду — делят ряд */
  .btn { max-width: 400px; }
  /* списки карточек — 2 колонки */
  .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; margin-bottom: 16px; }
  .grid > .card { margin: 0; }
  .grid > .wide { grid-column: 1 / -1; }
}

/* --- v2: карта категорий --- */
a.rule-card { display: block; text-decoration: none; }
a.rule-card b { font-weight: 700; }
a.pill { text-decoration: none; }
.test-res { margin-top: 8px; }
.answer-card .q { color: var(--muted); font-size: 13px; margin-bottom: 4px; word-break: break-word; }

/* --- v3: поштучно с полки --- */
.shelf-sum { margin: -8px 0 16px; }
.shelf-list li a { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.it-name { font-weight: 700; }
.it-spec { color: var(--text); opacity: .85; font-size: 14px; }
.list-filter { margin: 8px 0 4px; }
.take-list li { padding: 4px 8px 4px 4px; }
.take-list form { margin: 0; }
.take-one { flex: 1; min-width: 0; }
.take-btn { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: space-between; gap: 8px;
  background: transparent; border: 0; color: var(--text); font: inherit; text-align: left; cursor: pointer; padding: 4px 8px; }
.take-btn b { color: var(--warn); }
.add-form .hint { margin: 8px 0 0; }
.sugg { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.sugg-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  min-height: 44px; padding: 8px 12px; border: 0; border-radius: 10px; background: #fff; color: #000;
  font: inherit; cursor: pointer; }
.sugg-item .muted { color: #555; }
.known { margin-top: 8px; color: var(--warn); }
textarea#name { min-height: 44px; overflow: hidden; }
.stepper button:disabled { opacity: .35; }
.batch-log { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.batch-log .toast { position: static; margin: 0; }
.unsorted-card { display: flex; justify-content: space-between; align-items: center; gap: 8px; text-decoration: none; }
.unsorted-link { display: block; margin-top: 16px; text-decoration: none; }
.pick-shelf { margin-top: 16px; }
.item-title { margin-bottom: 4px; }
.item-spec { margin: 0 0 16px; font-size: 16px; }
.intro { margin: -8px 0 16px; line-height: 1.45; }
.intro a, .many-words a { color: inherit; }
.many-words { display: block; border-radius: 10px; margin: 8px 0 0; line-height: 1.35; }
.col { min-width: 0; }
.add-form .inline, #nf .inline { display: flex; gap: 8px; }
#nf .inline input { flex: 1; min-width: 0; }

/* --- поле «Цінник» у формі «Додати товар» --- */
.tagbox { background: var(--card2); border-radius: 12px; padding: 4px 12px 12px; margin-bottom: 8px; }
.tagbox label { color: var(--text); font-size: 15px; font-weight: 800; margin-top: 8px; }
.tagbox textarea { background: #000; min-height: 112px; }
.tag-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tag-ok { color: var(--ok); } .tag-bad { color: var(--warn); }
label .opt { color: var(--muted); font-weight: 600; font-size: 12px; }
summary .opt { color: var(--muted); font-weight: 600; font-size: 12px; }
.req { color: var(--bad); }

/* --- навигация (23.11): > 900 px — вкладки в шапке, ≤ 900 px — нижняя панель с иконками --- */
:root { --wrap: 1100px; --navh: 64px; }
header { display: block; height: auto; padding: 0; position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--card); }
.hwrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; height: 56px;
  display: flex; align-items: center; gap: 24px; }
.hwrap .brand { flex: 0 0 auto; }
nav.top { margin-left: auto; }
main { max-width: var(--wrap); margin: 0 auto; padding: 16px 16px calc(var(--navh) + 24px + env(safe-area-inset-bottom)); }
.toast { max-width: calc(var(--wrap) - 32px); margin: 8px 16px 0; }
@media (min-width: 1133px) { .toast { margin: 8px auto 0; } }
.t-orders { --tc: #A9A5E8; } .t-sklad { --tc: #F0877B; }
.t-reserves { --tc: #2DD4BF; } .t-staff { --tc: #5BA3E8; }

nav.tabs { display: none; align-self: stretch; gap: 4px; }
nav.tabs a { display: flex; align-items: center; padding: 0 12px; text-decoration: none;
  font-size: 15px; font-weight: 700; color: var(--tc); opacity: .55;
  border-bottom: 2px solid transparent; border-top: 2px solid transparent; transition: opacity .15s; }
nav.tabs a:hover { opacity: .85; }
nav.tabs a.on { opacity: 1; border-bottom-color: var(--tc); filter: brightness(1.15); }

nav.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex;
  max-width: none; margin: 0; border-radius: 0;
  background: var(--bar); border-top: 1px solid var(--card); padding-bottom: env(safe-area-inset-bottom); }
nav.bottom a { flex: 1; min-width: 0; height: var(--navh); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; text-decoration: none;
  color: var(--tc); opacity: .55; font-size: 12px; font-weight: 700; position: relative; }
nav.bottom a svg { display: block; flex: 0 0 auto; }
nav.bottom a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav.bottom a.on { opacity: 1; }
nav.bottom a.on::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: 0; height: 2px;
  border-radius: 2px; background: var(--tc); }

@media (min-width: 901px) {
  nav.tabs { display: flex; }
  nav.bottom { display: none; }
  :root { --navh: 0px; }
  main { padding-top: 24px; padding-bottom: 48px; }
}

/* --- «Склад»: три равные кнопки в ряд под поиском --- */
.searchbar { max-width: none; }
.actions3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.actions3 .btn { max-width: none; padding: 4px 8px; line-height: 1.25;
  font-size: 13px; }
@media (min-width: 560px) { .actions3 .btn { font-size: 15px; } }
@media (min-width: 901px) { .actions3 { gap: 16px; } .actions3 .btn { font-size: 16px; } }

/* ================= v4 (23.11): оформлення в стилі jabko.ua — сітка 8 px ================= */
:root { --line: #2A2A2A; --line-hi: #4A4A4A; --accent: #fff; }
body.tab-orders { --accent: #A9A5E8; } body.tab-sklad { --accent: #F0877B; }
body.tab-reserves { --accent: #2DD4BF; } body.tab-staff { --accent: #5BA3E8; }

/* мягкое фиолетовое свечение за шапкой; сам фон остаётся чёрным */
body { background:
  radial-gradient(ellipse 70% 420px at 50% -80px, rgba(115, 12, 151, .15), rgba(115, 12, 151, 0) 100%) no-repeat,
  var(--bg); }
header { background: rgba(15, 15, 15, .78); -webkit-backdrop-filter: saturate(140%) blur(16px);
  backdrop-filter: saturate(140%) blur(16px); border-bottom: 1px solid rgba(255, 255, 255, .06); }

/* вкладки в шапке: иконка + текст, активная — «таблетка» 15 % цвета вкладки */
nav.tabs { align-self: center; gap: 4px; }
nav.tabs a { height: 40px; padding: 0 16px 0 12px; gap: 8px; border: 0; border-radius: 999px;
  color: var(--tc); opacity: .6; transition: background-color .15s, opacity .15s; }
nav.tabs a .ico { flex: 0 0 auto; }
nav.tabs a:hover { opacity: 1; background: rgba(255, 255, 255, .06); }
nav.tabs a.on { opacity: 1; filter: none; background: rgba(255, 255, 255, .08);
  background: color-mix(in srgb, var(--tc) 15%, transparent); }

/* типографика и ритм */
h1 { font-size: 28px; font-weight: 800; line-height: 1.15; margin: 0 0 16px; letter-spacing: -.2px; }
h2 { font-size: 16px; line-height: 1.3; margin: 0 0 8px; }
main > * + * { margin-top: 0; }
.sub { margin: -8px 0 16px; }
.card { border: 1px solid var(--line); margin-bottom: 16px; transition: border-color .15s; }
.card:hover { border-color: var(--line-hi); }
.grid { gap: 16px; margin-bottom: 24px; }
.searchbar { margin-bottom: 16px; }
.row { gap: 8px; }
.line { margin-top: 16px; padding-top: 16px; }
.filter { margin-bottom: 24px; }
details.card summary { min-height: 24px; }

/* статус заявки/резерва — полоса 3 px слева */
.card.status { border-left-width: 3px; }
.card.st-red { border-left-color: var(--bad); }
.card.st-yellow { border-left-color: var(--warn); }
.card.st-green { border-left-color: var(--ok); }
.card.st-none { border-left-color: var(--line-hi); }

/* сводные карточки сверху страницы — они же фильтры */
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 24px; }
.stat { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: 8px 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none;
  color: var(--text); text-align: left; transition: border-color .15s, background-color .15s; }
.stat:hover { border-color: var(--line-hi); }
.stat b { font-size: 28px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 13px; line-height: 1.25; min-width: 0; }
.stat.tone-red b { color: var(--bad); } .stat.tone-yellow b { color: var(--warn); }
.stat.tone-green b { color: var(--ok); }
.stat.on { border-color: var(--accent); background: rgba(255, 255, 255, .06);
  background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.stat.on span { color: var(--text); }
@media (min-width: 600px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
  .stat { flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px;
    min-height: 96px; padding: 16px; }
}

/* предупреждения: жёлтая плашка → «Налаштувати» (Сервіс) */
.warn { display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin: 0 0 8px;
  padding: 8px 8px 8px 16px; min-height: 56px; border-radius: 12px; color: var(--warn);
  background: rgba(247, 195, 78, .08); border: 1px solid rgba(247, 195, 78, .45); font-size: 14px; }
.warn .ico { flex: 0 0 auto; }
.warn span { flex: 1 1 180px; color: #FBE3A6; }
.warn-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; margin-left: auto;
  border-radius: 10px; background: var(--warn); color: #000; font-weight: 800; font-size: 14px;
  text-decoration: none; white-space: nowrap; }
.warn-btn:hover { filter: brightness(1.08); }
.warns { margin-bottom: 24px; }
.warns .warn:last-child { margin-bottom: 0; }
@media (max-width: 599px) {
  .warn { flex-wrap: nowrap; padding: 8px 8px 8px 12px; font-size: 13px; line-height: 1.3; }
  .warn span { flex: 1 1 auto; }
  .warn-btn { padding: 0 12px; font-size: 13px; }
}

/* пустые состояния: иконка 48, заголовок, одна строка, главное действие */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 40px 24px; gap: 16px; }
.empty-ico { width: 80px; height: 80px; border-radius: 50%; display: grid; place-items: center;
  color: var(--accent); background: rgba(255, 255, 255, .05);
  background: color-mix(in srgb, var(--accent) 12%, transparent); }
.empty h2 { font-size: 18px; margin: 0; }
.empty p { margin: 0; max-width: 420px; }
.empty .btn { width: auto; min-width: 240px; padding: 0 24px; }
.empty-text { display: flex; flex-direction: column; align-items: center; gap: 8px; }
@media (max-width: 599px) { .empty .btn { width: 100%; } }

/* ================= v5 (23.11): Сервіс, Сканер, превью наклеек ================= */
/* иконки справа в шапке: текущая страница подсвечена (вкладки при этом не подсвечены) */
nav.top a.on { color: #fff; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
body.tab-service, body.tab-scan { --accent: #fff; }

h2.section { margin: 24px 0 8px; color: var(--muted); font-size: 13px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .6px; }
main > h1 + h2.section, .warns + h2.section { margin-top: 0; }

/* сетка карточек: 3 в ряд на компьютере, 1 на телефоне */
.grid3 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 8px; }
.grid3 > .card { margin: 0; }
@media (min-width: 700px) { .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.scard { display: flex; flex-direction: column; gap: 8px; }
.scard-head { display: flex; align-items: center; gap: 16px; min-height: 40px; }
.scard-head b { flex: 1; min-width: 0; font-size: 15px; font-weight: 700; }
.scard-head .pill { flex: 0 0 auto; font-size: 12px; padding: 2px 8px; white-space: nowrap; }
.scard-ico { flex: 0 0 40px; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  background: var(--card2); color: #fff; }
.scard-note { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.label-fields .scard-note { margin: 8px 0 0; }
.scard > .scard-note { flex: 1 0 auto; }   /* действие карточки прижато вниз — без margin у кнопки */
.scard .btn.small { width: 100%; max-width: none; }
.howto summary { list-style: none; display: flex; align-items: center; justify-content: center; }
.howto summary::-webkit-details-marker { display: none; }
.howto[open] summary { background: var(--card2); }
.big-date { font-size: 28px; font-weight: 800; line-height: 1.1; }
.big-date small { font-size: 16px; color: var(--muted); font-weight: 700; }
.pathline { display: flex; align-items: center; gap: 8px; }
.pathline code.path { flex: 1; min-width: 0; background: none; padding: 0; color: var(--muted); font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; word-break: normal; direction: rtl; text-align: left; }
.pathline .chip-btn { flex: 0 0 auto; gap: 8px; }

/* шаги 1-2-3 с номерами в кружках */
ol.nsteps { list-style: none; counter-reset: st; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 16px; }
ol.nsteps li { counter-increment: st; position: relative; padding-left: 40px; min-height: 28px; font-size: 14px;
  line-height: 1.45; color: #DADADA; }
ol.nsteps li::before { content: counter(st); position: absolute; left: 0; top: -2px; width: 28px; height: 28px;
  border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; color: #fff;
  background: var(--second); }

/* сворачиваемая карточка: иконка + заголовок + подзаголовок + шеврон */
details.fold > summary { list-style: none; display: flex; align-items: center; gap: 16px; cursor: pointer;
  min-height: 40px; color: var(--text); }
details.fold > summary::-webkit-details-marker { display: none; }
.fold-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fold-title b { font-weight: 700; font-size: 15px; }
.fold-chev { flex: 0 0 auto; color: var(--muted); display: grid; transition: transform .15s; }
details.fold[open] > summary .fold-chev { transform: rotate(90deg); }
details.fold[open] > summary { margin-bottom: 8px; }
details.fold form[data-print] { margin-top: 16px; }

/* превью этикетки = настоящая наклейка 50×30 */
.sticker { margin: 0; display: inline-flex; flex-direction: column; align-items: center; gap: 8px; max-width: 100%; }
.sticker img { display: block; width: 300px; max-width: 100%; height: auto; aspect-ratio: 50 / 30;
  background: #fff; border-radius: 6px; image-rendering: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .06); }
.sticker figcaption { color: var(--muted); font-size: 12px; }
.stickers { display: flex; flex-wrap: wrap; gap: 24px; justify-content: center; margin: 8px 0 16px; }
details .sticker, form > .sticker { margin: 16px auto 0; display: flex; }

/* тестовая этикетка: слева поля и кнопка, справа превью */
.label-test { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: center; margin-top: 8px; }
.label-test .btn { display: flex; align-items: center; justify-content: center; gap: 8px; }
.label-side { display: flex; justify-content: center; padding: 24px 16px 16px; border-radius: 12px;
  background: radial-gradient(circle at 50% 40%, #2a2a2a, #161616 70%); }
.label-side .sticker { margin: 0; }
@media (min-width: 760px) { .label-test { grid-template-columns: minmax(0, 1fr) 360px; } }

/* Сканер */
.scan-hero { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 24px 16px; }
.scan-ico { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; color: #fff;
  background: var(--second); }
.scan-form label { color: var(--text); font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.scan-row { display: flex; gap: 8px; }
.big-input { min-height: 56px; font-size: 20px; font-weight: 700; letter-spacing: .3px; border: 1px solid var(--line);
  background: #111; }
.big-input:focus { outline: none; border-color: #fff; box-shadow: 0 0 0 4px rgba(255, 255, 255, .08); }
.scan-row .btn { width: auto; padding: 0 24px; }
.scan-form .hint { margin: 8px 0 0; }
.scanres { margin-top: 0; padding: 16px; border-radius: 12px; background: rgba(255, 77, 77, .06);
  border: 1px solid rgba(255, 77, 77, .35); }
.scanres p { margin: 8px 0 0; }
@media (min-width: 700px) {
  .scan-hero { grid-template-columns: 64px 1fr; padding: 24px; align-items: start; }
  .scan-hero .scanres { grid-column: 2; }
}
@media (min-width: 901px) { .phone-only { display: none !important; } }

ul.recent { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 8px; }
ul.recent a { display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 8px 12px 8px 8px;
  text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s; }
ul.recent a:hover { border-color: var(--line-hi); }
.recent-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.recent-t b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-empty { margin: 0 0 24px; }
@media (min-width: 901px) { ul.recent { grid-template-columns: 1fr 1fr; } }

/* пустое состояние с формой на месте */
.empty-form { width: 100%; max-width: 560px; margin-top: 8px; text-align: left; }

/* ================= v6 (23.11): ціннік з Команди, номенклатура, камера, полірування ================= */
/* пилюлі: текст ніколи не обрізаємо — у шапках карток вони не стискаються, довгі переносяться */
.pill { max-width: 100%; white-space: normal; overflow-wrap: anywhere; line-height: 1.35; }
.row-head .pill, .scard-head .pill, .line-head .pill { flex: 0 0 auto; white-space: nowrap; }

/* картка товару */
h1.item-title { margin: 0 0 8px; }
.item-spec { margin: 0 0 8px; }
.item-meta { margin: 8px 0 16px; gap: 8px; }
.item-meta .tag { display: inline-flex; align-items: center; min-height: 24px; }
main > .grid > .col > :first-child, main > .grid > .col > .card:first-child { margin-top: 0; }
.acts2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.acts2 > form { margin: 0; }
.acts2 .btn, .acts2 summary.btn { width: 100%; max-width: none; }
.btn.outline { background: var(--card2); border: 1px solid var(--line-hi); }
.btn.outline:hover { border-color: #6a6a6a; }
details.move { margin: 0; }
details.move.solo, details.move[open] { grid-column: 1 / -1; }
details.move > summary { list-style: none; display: flex; align-items: center; justify-content: center; color: #fff; }
details.move > summary::-webkit-details-marker { display: none; }
details.move[open] > summary { background: var(--card); }
details.move > form { margin-top: 8px; }

/* швидкі кнопки під заголовком полиці / партії */
.quick-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.quick-row .btn { flex: 1 1 160px; width: auto; max-width: none; }
.quick-row .cam-hint { flex: 1 1 100%; margin: 0; }
@media (min-width: 901px) { .quick-row .btn { flex: 0 1 280px; } }
.quick-row:not(:has(> :not([hidden]))) { display: none; }

/* «Розпізнані рядки» */
.lchips { display: flex; flex-wrap: wrap; gap: 8px; }
.lchip { min-height: 40px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-hi);
  background: transparent; color: var(--muted); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
  max-width: 100%; overflow-wrap: anywhere; }
.lchip.on { background: #fff; color: #000; border-color: #fff; }
.lchip.junk:not(.on) { text-decoration: line-through; opacity: .6; }
#lines-wrap { margin-top: 16px; }

/* поле, яке програма заповнила сама */
.filled { box-shadow: 0 0 0 2px var(--ok) !important; background: rgba(46, 194, 106, .1) !important;
  transition: box-shadow .3s, background-color .3s; }

/* номенклатура в пошуку */
.g-title { font-weight: 700; font-size: 16px; }
.g-places { margin: 8px 0 0; line-height: 1.5; }
.g-places a { text-decoration: none; color: var(--ok); }
.g-places a:hover { text-decoration: underline; }
details.units { margin-top: 8px; }
.unit-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.unit-list a { display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border-radius: 10px;
  background: var(--card2); text-decoration: none; }
.unit-list .u-main { font-weight: 700; }

/* заявки: де лежить і вибір серед схожих */
.found-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.found-line a.pill { text-decoration: none; }
.choose { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.choose form { margin: 0; }
.choice { width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 44px;
  padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line-hi); background: var(--card2); color: #fff;
  font: inherit; text-align: left; cursor: pointer; }
.choice:hover { border-color: #fff; }

/* камера (html5-qrcode) */
.cam-reader { width: 100%; max-width: 520px; border-radius: 12px; overflow: hidden; background: #000; }
.cam-reader video { width: 100% !important; border-radius: 12px; }

/* Сервіс → Перевірка бота */
#bot-test { display: flex; flex-direction: column; gap: 8px; }
.qr-mid { display: block; width: 168px; height: 168px; border-radius: 10px; background: #fff; image-rendering: pixelated; flex: 0 0 auto; }
.bt-link { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.bt-link ol.nsteps { flex: 1 1 240px; margin: 0; }
.bt-state { background: var(--card2); border-radius: 10px; padding: 12px 16px; margin-top: 8px; }
.bt-state .label-s { margin: 0 0 4px; }
.bt-state p { margin: 0 0 4px; overflow-wrap: anywhere; }
.bt-state.flash { outline: 2px solid var(--ok); }
.bt-acts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.bt-acts form { margin: 0; }
.bt-acts .btn { width: 100%; max-width: none; white-space: normal; line-height: 1.3; padding: 8px 16px; }
@media (min-width: 900px) { .bt-acts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bt-more { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: start; }
.bt-more form { margin: 0; }
.bt-more .btn.small { width: 100%; max-width: none; white-space: normal; }
@media (min-width: 700px) { .bt-more { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
#bot-test details.howto .qr-mid { margin: 12px 0 0; }
.bt-more summary.btn { width: 100%; max-width: none; }

/* 23.11: бейдж «Треба зробити» на вкладці «Резерви» */
nav.tabs a, nav.bottom a { position: relative; }
.todo-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--bad); color: #fff; font-size: 12px; font-weight: 800; line-height: 1; }
.todo-badge[hidden] { display: none; }
nav.tabs .todo-badge { margin-left: 2px; }
nav.bottom .todo-badge { position: absolute; top: 6px; left: calc(50% + 6px); }
/* «Хто я» в шапці */
nav.top a.who.on { color: #fff; background: var(--card); }
.who-chips .chip-btn { padding: 0 20px; font-size: 16px; }
.chip-btn.on { background: #fff; color: #000; }

/* «Треба зробити» */
.todo { margin-bottom: 24px; }
.todo-head { display: flex; align-items: center; gap: 8px; }
.todo-head h2 { margin: 0; flex: 1; }
.todo-empty { margin: 8px 0 0; }
.todo-clear, .todo-restore { margin: 0; }
.todo-restore { margin-top: 8px; }
.todo-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.todo-row { display: flex; gap: 16px; align-items: center; background: var(--card2); border-radius: 10px;
  padding: 12px 12px 12px 16px; border-left: 3px solid var(--warn); }
.todo-row.tone-red { border-left-color: var(--bad); }
.todo-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.todo-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; color: var(--warn); }
.tone-red .todo-label { color: var(--bad); }
.todo-title { overflow-wrap: anywhere; }
.todo-main .muted { overflow-wrap: anywhere; }
.todo-place { font-size: 16px; font-weight: 800; color: #fff; overflow-wrap: anywhere; margin-top: 2px; }
.todo-act { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.todo-act form { margin: 0; }
.todo-act .btn.small { min-width: 120px; width: 100%; }
.todo-act .chip-btn { width: 100%; justify-content: center; }
/* 02.12: «🗑 Видалити» — маленька кнопка справа; після натискання рядок сіріє з «Відновити» на 5 с */
.todo-del { flex: 0 0 auto; align-self: flex-start; min-height: 32px; padding: 4px 10px; border-radius: 8px;
  border: 1px solid #3A3A3A; background: transparent; color: var(--muted);
  font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.todo-del:hover { color: #fff; border-color: #555; }
.todo-undo { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.todo-undo[hidden] { display: none; }
.todo-row.deleted { border-left-color: #555; }
.todo-row.deleted .todo-main { opacity: .45; filter: grayscale(1); pointer-events: none; }
.todo-row.deleted .todo-act, .todo-row.deleted .todo-del { display: none; }
.btn.danger-fill { background: var(--bad); }
@media (max-width: 600px) {
  .todo-row { flex-direction: column; align-items: stretch; }
  .todo-act { flex-direction: row; }
  .todo-act > * { flex: 1; }
  .todo-del { align-self: flex-end; }
}

/* Червона картка «Не актуально — зняти з полиці» */
.where-big { font-size: 20px; font-weight: 800; line-height: 1.25; margin: 8px 0 4px; overflow-wrap: anywhere; }
.where-big small { display: block; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }
.btn.took-off { background: var(--bad); width: 100%; max-width: 400px; }

/* Журнал дій */
.log-table { list-style: none; margin: 0; padding: 0; }
.log-table li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 4px 16px; padding: 12px 0;
  border-bottom: 1px solid var(--card2); }
.log-table li:last-child { border-bottom: 0; }
.log-when { color: var(--muted); font-size: 13px; }
.log-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.log-what b { overflow-wrap: anywhere; }
.log-what .muted { overflow-wrap: anywhere; }
.log-who { font-weight: 700; }
.log-bot { color: #2DD4BF; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.log-link { display: flex; align-items: center; gap: 16px; text-decoration: none; color: #fff; }
.log-link > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.todo-link { display: flex; justify-content: space-between; align-items: center; gap: 16px; text-decoration: none; color: #fff; }

/* ================= v7 (23.11): кнопки и интервалы =================
   У .btn нет margin нигде. Расстояния — только gap контейнера:
   .stack — 16 px (блоки формы/карточки), .row и .acts — 8 px (кнопки и поля в ряд).
   Высоты кнопок ровно две: .btn — 56 (основная), .btn.small — 44 (маленькая). */
.stack { display: flex; flex-direction: column; gap: 16px; }
/* :is(..., form.inline) поднимает специфичность выше правил вида form.inline / ul.places */
.stack > :is(*, form.inline) { margin-top: 0; margin-bottom: 0; }
.stack > .btn { align-self: flex-start; }
.fields > label:first-child, .fields > .row:first-child label { margin-top: 0; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.acts > * { flex: 1 1 140px; min-width: 0; }
.acts > form { display: flex; }
.acts > form > .btn { flex: 1 1 auto; }
.acts.col > * { flex-basis: 100%; }
.acts > :only-child { flex-grow: 0; flex-basis: 400px; }   /* одна кнопка в ряду — як одиночна, ≤ 400 */   /* столбиком: каждая кнопка на всю ширину */
.acts .btn, .acts summary.btn { width: 100%; max-width: none; }
@media (min-width: 901px) {
  .acts { max-width: 560px; }
  .acts.wide { max-width: none; }
}
/* details: содержимое под заголовком — отступом у содержимого, не у кнопки */
details[open] > summary + * { margin-top: 8px; }
details.fold[open] > summary + * { margin-top: 0; }
.chead > :last-child { margin-bottom: 0; }
.stack > .result:empty { display: none; }
ul.places li:last-child { margin-bottom: 0; }

/* 24.11: «📸 Сфотографувати цінник» — камера з рамкою під цінник */
.cam.ocr { justify-content: flex-start; padding-top: max(16px, env(safe-area-inset-top)); overflow-y: auto; }
.ocr-view { position: relative; width: 100%; max-width: 520px; border-radius: 12px; overflow: hidden; background: #111; }
.ocr-view video { display: block; width: 100%; height: auto; }
.ocr-frame { position: absolute; left: 7.5%; width: 85%; aspect-ratio: 50 / 31; top: 50%; transform: translateY(-50%);
  border: 3px solid #fff; border-radius: 10px; box-shadow: 0 0 0 4000px rgba(0, 0, 0, .45); pointer-events: none; }
.cam.no-cam .ocr-view { display: none; }
.ocr-msg { margin: 0; text-align: center; max-width: 520px; color: #fff; }
.ocr-msg.bad { color: var(--warn); }
.ocr-btns { width: 100%; max-width: 520px; }
.ocr-btns .btn.small { flex-basis: 100%; }
label.btn.ocr-file { display: flex; align-items: center; justify-content: center; cursor: pointer; }
@media (min-width: 700px) { .scan-hero .ocr-btn { grid-column: 2; } }
@media (max-width: 900px) { .quick-row .btn.wide { flex-basis: 100%; } }   /* довга назва — свій рядок на телефоні */

/* Сервіс → Команда для iPhone: посилання для бота + QR */
.sc-share { background: var(--card2); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.sc-share .label-s { margin: 0 0 8px; }
.sc-row { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.sc-form { flex: 1 1 260px; min-width: 0; }

/* 24.11: кілька товарів у замовленні працівника */
.items-block { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.items-list { display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.item-row { align-items: center; }
.item-row > .chip-btn { flex: 0 0 44px; width: 44px; padding: 0; justify-content: center; }

.del-order { color: var(--bad); align-self: flex-start; }


/* 24.11: сторінка замовлення /reserve/<id> */
.order-page { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.order-page > .col.stack > .card { margin: 0; }
.order-page .sec-h { margin: 0; font-size: 18px; }
.order-page .card.is-current { border-color: #fff; }
.order-page .card.status.st-none { border-left-width: 1px; }
.call-btn { display: flex; align-items: center; justify-content: center; text-decoration: none; max-width: 400px; }
.line-foot { display: flex; gap: 8px; flex-wrap: wrap; }
.raw-msg { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; font-size: 14px; color: var(--muted);
  background: var(--card2); border-radius: 10px; padding: 12px; margin: 8px 0 0; }
a.card-link { color: inherit; text-decoration: none; }
a.card-link:hover { text-decoration: underline; }
.row.three .btn { white-space: normal; line-height: 1.15; overflow-wrap: anywhere; }
.order-page details.put > summary.btn { display: flex; align-items: center; justify-content: center; max-width: 400px; list-style: none; }
.order-page details.put > summary.btn::-webkit-details-marker { display: none; }

/* 24.11: кілька товарів в одній картці замовлення */
.oline + .oline { border-top: 1px solid var(--card2); padding-top: 16px; }
.oline-name { font-size: 16px; font-weight: 800; }



/* ================= 25.11: залишки 1С — «Розкласти», картка позиції, імпорт ================= */
.import-age { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.import-age.stale { color: var(--warn); }
.import-age a { color: inherit; }
.rz-filter { margin: 0 0 8px; }
.rz-target { margin-bottom: 16px; }
.rz-target a { color: var(--muted); }
.rz-sug-card { margin-bottom: 16px; }
.rz-tree { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.rz-group { background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.rz-group .rz-group { background: transparent; border: 0; border-top: 1px solid var(--card2); border-radius: 0; }
.rz-group > summary { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 4px 12px 4px 4px;
  cursor: pointer; list-style: none; font-weight: 700; }
.rz-group > summary::-webkit-details-marker { display: none; }
.rz-gname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rz-body { padding: 0 8px 8px 12px; }
.rz-group .rz-group .rz-body { padding-left: 8px; }
.rz-nom { padding: 8px 0 0; }
.rz-nom-name { font-weight: 700; font-size: 15px; padding: 0 4px 4px 44px; overflow-wrap: anywhere; }
ul.rz-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.rz-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: var(--card2);
  border-radius: 10px; padding: 4px 8px 4px 0; }
.rz-check { display: flex; align-items: center; gap: 8px; flex: 1 1 160px; min-width: 0; min-height: 48px;
  margin: 0; color: var(--text); cursor: pointer; }
.rz-check input { width: 28px; height: 28px; min-height: 0; margin: 0 0 0 10px; accent-color: #2EC26A; flex: 0 0 auto; }
.rz-gcheck { flex: 0 0 auto; min-height: 44px; }
.rz-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rz-what b { font-weight: 700; overflow-wrap: anywhere; }
.rz-what .muted { overflow-wrap: anywhere; }
.rz-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; padding-left: 46px; }
.rz-more { display: grid; place-items: center; width: 36px; min-height: 36px; color: var(--muted); text-decoration: none;
  font-size: 22px; font-weight: 800; }
.rz-yes { white-space: normal; text-align: left; }
.stepper.mini { gap: 4px; }
.stepper.mini button { flex: 0 0 40px; min-height: 40px; font-size: 20px; }
.stepper.mini input { width: 56px; min-height: 40px; padding: 0 4px; }
.rz-go { display: flex; }
.rz-go .btn { flex: 0 1 400px; }
.rz-sheet { margin-bottom: 16px; }
.rz-zone { display: flex; flex-direction: column; gap: 8px; }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 140px; padding: 16px; border: 2px dashed var(--line-hi, #555); border-radius: 12px; text-align: center;
  color: var(--muted); cursor: pointer; }
.dropzone.over { border-color: var(--ok); color: var(--text); background: rgba(46, 194, 106, .08); }
.dropzone input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; min-height: 0; }
.dropzone b { color: var(--text); }
.pos-places li form { margin: 0; }
.imp-table { list-style: none; margin: 0; padding: 0; }
.imp-table li { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--card2); }
.imp-table li:last-child { border-bottom: 0; }
.home-1c { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
/* ---- 27.11: карта (map.svg inline) — на телефоні на всю ширину, без горизонтального скролу */
.map-box { width: 100%; max-width: 560px; margin: 8px auto 0; }
.map-box svg.map-svg { display: block; width: 100%; height: auto; max-width: 100%; }
.map-box.big { max-width: 640px; }
.map-box.pick { max-width: 460px; }
.map-box g.place:not(.furniture):hover rect { stroke: #fff; }
.map-box g.place.furniture { pointer-events: none; }
.map-box g.place.active > rect { stroke: #EF000E; stroke-width: 3; fill: #4A0A12; }
.map-box g.place.dim { opacity: .35; }
.map-box .map-badge { pointer-events: none; }
.map-wrap { display: flex; flex-direction: column; gap: 8px; }
.map-legend { text-align: center; }
.map-panel { border-color: #EF000E; scroll-margin-top: 80px; }
.map-chosen { margin: 8px 0; min-height: 22px; }
.map-chosen b { color: #fff; }
.map-mini { margin-top: 4px; }
.map-mini summary { cursor: pointer; }
.map-mini .map-box { max-width: 360px; }
.map-items li a { min-width: 0; overflow-wrap: anywhere; }
/* ---- 27.11 (2): інтерактивна карта — пошук, фільтри, заповненість, рівні, перенос, зум */
.map-q { width: 100%; max-width: 640px; margin: 0 auto; display: block; }
.map-filters { justify-content: center; max-width: 640px; margin: 0 auto; }
.map-filters .chip-btn.on { background: #fff; color: #000; border-color: #fff; }
.map-tools { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; max-width: 640px; width: 100%; margin: 0 auto; }
.seg { display: inline-flex; background: #1D1D1D; border: 1px solid #2A2A2A; border-radius: 10px; padding: 2px; gap: 2px; }
.seg button { min-width: 44px; height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent;
  color: #A3A3A3; font: inherit; font-weight: 700; cursor: pointer; }
.seg button.on { background: #fff; color: #000; }
.map-note { text-align: center; min-height: 18px; margin: 0; }
.map-box.big { overflow: hidden; border-radius: 10px; }
.map-box.big svg.map-svg { touch-action: pan-y; }
.map-box.big.zoomed svg.map-svg { touch-action: none; cursor: grab; }
.map-box .fill-1 > rect { fill: #24142C; }
.map-box .fill-2 > rect { fill: #35174A; }
.map-box .fill-3 > rect { fill: #4B1B6A; }
.map-box .fill-4 > rect { fill: #651E8E; }
.map-box .fill-5 > rect { fill: #8424B8; }
.map-box g.place.hit > rect { stroke: #F7C34E; stroke-width: 3; }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.fill-sw { display: inline-block; width: 18px; height: 12px; border-radius: 3px; }
.fill-sw.fill-1 { background: #24142C; } .fill-sw.fill-2 { background: #35174A; } .fill-sw.fill-3 { background: #4B1B6A; }
.fill-sw.fill-4 { background: #651E8E; } .fill-sw.fill-5 { background: #8424B8; }
.rack { display: flex; flex-direction: column; gap: 6px; }
.rack-level { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; width: 100%;
  min-height: 48px; padding: 8px 12px; background: #2A2A2A; border: 1px solid #333; border-left: 4px solid #8424B8;
  border-radius: 8px; color: #fff; font: inherit; text-align: left; cursor: pointer; }
.rack-level.empty { border-left-color: #444; color: #A3A3A3; }
.rack-level[aria-expanded="true"] { border-color: #fff; }
.rack-name { min-width: 0; overflow-wrap: anywhere; font-weight: 700; }
.rack-items { padding: 4px 0 8px 8px; display: flex; flex-direction: column; gap: 8px; }
.rack-row-side { display: inline-flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.map-panel.moving { border-color: #F7C34E; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.lb-txt { min-width: 0; overflow-wrap: anywhere; }
.pill.small { font-size: 11px; padding: 1px 8px; }
@media (max-width: 900px) {
  /* панель знизу на всю ширину над нижнім меню */
  .map-panel { position: fixed; left: 0; right: 0; bottom: calc(var(--navh) + env(safe-area-inset-bottom)); z-index: 9;
    max-height: 58vh; overflow-y: auto; margin: 0; border-radius: 14px 14px 0 0; border-width: 1px 0 0; }
  .map-panel.moving { max-height: 34vh; }
}


/* «Сканувати полицю» */
.ss-cur { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border-color: #2EC26A; }
.ss-place { font-size: 22px; font-weight: 800; flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; }
.ss-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ss-row { display: flex; align-items: center; gap: 8px; background: #2A2A2A; border-radius: 10px; padding: 8px 12px;
          border-left: 3px solid #2A2A2A; }
.ss-row.st-green { border-left-color: #2EC26A; }
.ss-row.st-yellow { border-left-color: #F7C34E; }
.ss-row.st-red { border-left-color: #FF4D4D; }
.ss-row.ss-dup { outline: 2px solid #F7C34E; }
.ss-t { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cam-last { color: #2EC26A; font-weight: 700; overflow-wrap: anywhere; padding: 0 16px; }

/* Дошка QR — один лист A4 */
.qr-board { background: #fff; color: #000; border-radius: 12px; padding: 16px; margin-top: 16px; }
.qr-map svg { width: 100%; max-height: 120mm; height: auto; display: block; background: #111; border-radius: 8px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; }
.qr-grid figure { margin: 0; text-align: center; break-inside: avoid; }
.qr-grid img { width: 100%; max-width: 120px; image-rendering: pixelated; }
.qr-grid figcaption { font-size: 11px; font-weight: 700; color: #000; }
.qr-foot { color: #333; font-size: 12px; text-align: center; margin: 8px 0 0; }
@media print {
  @page { size: A4 portrait; margin: 8mm; }
  body { background: #fff !important; }
  header, nav, .tabbar, .bottom-nav, .no-print, .toast { display: none !important; }
  .qr-board { margin: 0; padding: 0; border-radius: 0; }
  .qr-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 700px) { .scan-hero .scan-acts { grid-column: 2; } }
.scan-acts .btn { white-space: nowrap; }
@media (max-width: 600px) { .card .map-box.pick, .card .map-box.big { margin-left: -8px; margin-right: -8px; width: calc(100% + 16px); max-width: none; } }
.scan-hero .scan-acts { max-width: 400px; }
.cam-last.bad { color: #F7C34E; }
.cam-hint-ss { color: #fff; text-align: center; padding: 0 16px; margin: 8px 0 0; }

/* 30.11: SKLAD_DEV=1 (run_dev.bat) - plashka v shapci */
.dev-pill { margin-left: 8px; font-size: 11px; padding: 1px 8px; white-space: nowrap; }

/* --- 02.12: ролі — CSS еталона _map/design/roles_mockup.html (ті самі значення; кольори — змінні) --- */
:root {
  --role-senior: #F7C34E; --role-senior-bg: #2a2208; --role-senior-ink: #2a1d00;
  --role-dev: #581FBF; --role-dev-ring: #9b5de5; --role-dev-bg: #1f1033; --role-dev-ink: #c9a7ff;
  --role-seller: #5BA3E8; --role-seller-bg: #0f2233; --role-seller-pill: #1b3a57; --role-seller-ink: #9cc9f2;
}
/* .av — аватар з ініціалами в кільці кольору ролі */
.av { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
      font-weight: 600; font-size: 13px; flex: none; box-sizing: border-box; line-height: 1; }
.av.senior { background: var(--role-senior-bg); border: 2px solid var(--role-senior); color: var(--role-senior); }
.av.dev { background: var(--role-dev-bg); border: 2px solid var(--role-dev-ring); color: var(--role-dev-ink); }
.av.seller { background: var(--role-seller-bg); border: 2px solid var(--role-seller); color: var(--role-seller-ink); }
/* .rpill — плашка ролі: інлайн-SVG іконка зліва від тексту */
.rpill { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; display: inline-flex;
         align-items: center; gap: 4px; white-space: nowrap; line-height: 1.4; flex: none; }
.rpill svg { flex: none; }
.rpill.senior { background: var(--role-senior); color: var(--role-senior-ink); }
.rpill.dev { background: var(--role-dev); color: #fff; }
.rpill.seller { background: var(--role-seller-pill); color: var(--role-seller-ink); }
/* кольорова точка ролі («Хто ти?») */
.rdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; margin-right: 8px; }
.rdot.senior { background: var(--role-senior); }
.rdot.dev { background: var(--role-dev-ring); }
.rdot.seller { background: var(--role-seller); }
.who-btn { display: inline-flex; align-items: center; }
.who-btn.on { box-shadow: 0 0 0 2px var(--role-senior) inset; }
.who-now { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crown { color: var(--role-senior); vertical-align: -1px; margin-left: 4px; flex: none; }
.btn .crown, .chip-btn .crown, .chip-link .crown { margin-left: 6px; }
/* .uhdr = .hdr еталона: картка користувача */
.uhdr { background: #0F0F0F; border-radius: 12px; padding: 10px 12px; display: flex; align-items: center; gap: 10px;
        margin-bottom: 14px; max-width: 390px; }
.uhdr .pbody, .pcard .pbody { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pbody .nm, .uhdr .nm { font-size: 13px; font-weight: 600; color: #fff; line-height: 1.4; margin: 0;
                        overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbody .sub, .spanel .sub { font-size: 11px; color: #A8A8A8; margin: 0; line-height: 1.4; }
/* .spanel = .panel еталона: «Панель старшого» */
.spanel { background: var(--role-senior-bg); border: 1px solid #F7C34E66; border-radius: 12px; padding: 10px 12px;
          margin-bottom: 16px; max-width: 390px; }
.spanel .t { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--role-senior); }
.spanel ul { list-style: none; margin: 8px 0 0; padding: 8px 0 0; display: grid; gap: 6px; border-top: 1px solid #F7C34E33; }
.spanel li a { font-size: 12px; color: #fff; text-decoration: none; }
.spanel li a:hover { text-decoration: underline; }
.spanel .warn-n { color: var(--role-senior); font-weight: 700; }
/* .psec = .sec еталона: «РОЗРОБНИК / СТАРШІ / ПРОДАВЦІ» */
.psec { font-size: 11px; letter-spacing: .04em; color: #8a8a8a; margin: 12px 2px 6px; text-transform: uppercase; font-weight: 600; }
/* .pcard = .card еталона: одна людина — одна картка-рядок */
.pcard { background: #1D1D1D; border-radius: 12px; padding: 9px 10px; display: flex; align-items: center; gap: 10px;
         margin: 0 0 6px; text-decoration: none; color: #fff; border: 1px solid transparent; box-sizing: border-box; }
.pcard.senior { border: 1px solid #F7C34E55; }
a.pcard:hover { border-color: #3a3a3a; }
a.pcard.senior:hover { border-color: #F7C34Eaa; }
.people { max-width: 560px; display: block; }
/* шапка сайту: аватар + «Прізвище І.» + плашка ролі — один рядок, без переносу */
nav.top a.who { display: inline-flex; align-items: center; gap: 8px; width: auto; padding: 0 8px; white-space: nowrap;
                min-width: 0; max-width: 260px; }
nav.top a.who .av { width: 32px; height: 32px; font-size: 11px; }
nav.top a.who .who-name { font-size: 13px; font-weight: 600; color: #fff; min-width: 0; max-width: 130px;
                          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* телефон: той самий рядок — окремою смужкою під шапкою (у першому рядку не вміщається) */
.ustrip { display: none; }
@media (max-width: 600px) {
  nav.top a.who { display: none; }
  .ustrip { display: flex; align-items: center; gap: 8px; max-width: var(--wrap); margin: 0 auto; padding: 0 16px 8px;
            text-decoration: none; color: #fff; white-space: nowrap; min-width: 0; }
  .ustrip .av { width: 28px; height: 28px; font-size: 10px; }
  .ustrip .who-name { font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .ustrip .nopin { font-size: 11px; color: var(--muted); }
}
/* --- 01.12: замовлення 1С --- */
.zm-switch { margin-bottom: 8px; }
.zm-filters { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 16px; }
.zm-filters label { margin: 0; display: flex; flex-direction: column; gap: 4px; flex: 1 1 140px; min-width: 0; }
.zm-filters select { min-height: 44px; width: 100%; }
.zm-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0; font-size: 14px; }
.zm-dl dt { color: var(--muted); }
.zm-dl dd { margin: 0; overflow-wrap: anywhere; }
.zm-items { margin: 0; padding-left: 18px; }
@media (max-width: 420px) { .zm-dl { grid-template-columns: 1fr; } .zm-dl dt { margin-top: 4px; } }
.hist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
/* 02.12: «Зараз:» — один рядок; на телефоні картка користувача = смужка в шапці (без дубля); «Додати» — по ширині списку */
.who-now { flex-wrap: nowrap; min-width: 0; }
.who-now b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-now .muted { white-space: nowrap; }
@media (max-width: 600px) { .uhdr { display: none; } .who-now .muted { display: none; } }
#add-emp { max-width: 560px; box-sizing: border-box; }
/* 02.12: замовлення 1С на сторінці працівника */
.zm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.zm-row { background: var(--card2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px;
          border-left: 3px solid var(--ok); min-width: 0; overflow-wrap: anywhere; }
.zm-row.st-yellow { border-left-color: var(--warn); }
.zm-row.st-red { border-left-color: var(--bad); }
.import-age .age-part.stale b { color: var(--warn); }
.import-age .age-part { white-space: nowrap; }
/* 02.12: резерви працівника — компактний список */
.rz-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rz-row { background: var(--card2); border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px;
          border-left: 3px solid var(--ok); min-width: 0; overflow-wrap: anywhere; }
.rz-row.st-yellow { border-left-color: var(--warn); }
.rz-row.st-red { border-left-color: var(--bad); }
