/* Инвентарь: раскладка поверх токенов и компонентов /css/app.css. Цвета — только токенами :root из app.css. */

/* ═══ Вход ═══ */
/* svh: от dvh экран по центру менял высоту, когда Safari прячет панель (прокрутили с открытой клавиатурой), — форма прыгала. */
.gate { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; padding: 24px 16px; }
.gate-box { width: min(440px, 100%); display: grid; gap: 22px; }
.gate-brand { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
#gate-card { border-radius: var(--r-xl); border: 1px solid var(--line-strong); background: var(--raised); padding: 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
#gate-card h1 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; margin-bottom: 6px; }
#gate-card .lead { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
#gate-card .stack { display: grid; gap: 10px; margin-top: 4px; }
#gate-card .stack + .stack { margin-top: 10px; }
.gate-err { color: var(--bad); font-size: 13.5px; margin-bottom: 12px; }
.gate-who { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.gate-who b { display: block; font-size: 16px; }
.gate-who span:not(.avatar) { color: var(--muted); font-size: 13px; }
.field.pin { letter-spacing: .4em; font-size: 20px; font-variant-numeric: tabular-nums; }
/* Поля даты и времени: в iOS Safari у них своя минимальная ширина и текст по центру — в узкой колонке поле вылезало
   за рамку («Дата начала смены» в корзине). */
input[type=date].field, input[type=time].field { min-width: 0; max-width: 100%; }
input[type=date].field::-webkit-date-and-time-value, input[type=time].field::-webkit-date-and-time-value { text-align: left; }
@supports (-webkit-touch-callout: none) {
  input[type=date].field, input[type=time].field { -webkit-appearance: none; appearance: none; }
}
/* Открыта шторка или окно на телефоне: страница под ней не прокручивается (иначе Safari прячет и показывает свою панель,
   и всё на экране дёргается). Класс ставит ui.mjs. */
html.scroll-lock, html.scroll-lock body { overflow: hidden; overscroll-behavior: none; }
/* Длинная подпись главной кнопки окна («Отметить потерянными: 12 шт.», «Передать 2 шт. — Имя Фамилия») переносится,
   а не выталкивает «Отмена» за край. */
#modal-box .actions .btn { min-width: 0; }
#modal-box .actions .btn.primary, #modal-box .actions .btn.danger { white-space: normal; text-align: center; line-height: 1.25; padding-top: 6px; padding-bottom: 6px; }
/* «Длина PIN»: 6 или 4 цифры — две равные кнопки во всю ширину. */
.seg.pin-len { display: flex; width: 100%; }
.seg.pin-len button { flex: 1; }

/* ═══ Оболочка ═══ */
.nav .cnt, .tabbar .cnt { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 650; color: var(--on-gold); background: var(--warn); }
.nav .cnt { margin-left: auto; }
.nav .sep { height: 1px; background: var(--line); margin: 8px 12px; }
.side-foot { gap: 12px; }
.wh-pick { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-deep); color: var(--ink); text-align: left; }
.wh-pick:hover { border-color: var(--line-strong); }
.wh-pick .ico { color: var(--gold); width: 18px; height: 18px; }
.wh-pick .lbl2 { display: block; color: var(--muted); font-size: 12px; line-height: 1.2; }
.wh-pick b { display: block; font-size: 14px; line-height: 1.25; }
/* Склад кладовщика — его, не переключается: кнопка остаётся (подсказка по нажатию), без вида «выбора». */
/* Кладовщик смотрит чужой склад (только просмотр): плашка над разделом. */
.view-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: calc(1360px - 2 * var(--gutter)); margin: 16px var(--gutter) 0; padding: 10px 14px; border-radius: var(--r-md);
  border: 1px solid color-mix(in srgb, var(--gold) 35%, transparent); background: color-mix(in srgb, var(--gold) 9%, transparent); color: var(--ink); font-size: 14px; }
.view-banner[hidden] { display: none; }
.view-banner .ic, .view-banner .ico { color: var(--gold); flex: none; }
.view-banner span { flex: 1 1 220px; }
.who { display: flex; align-items: center; gap: 10px; padding: 0 6px; min-height: 32px; }
.who .nm { font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.who .rl { font-size: 12px; color: var(--muted); }
.side-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.side-btns .btn { padding: 0 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 12.5px; font-weight: 650; color: var(--on-gold); background: var(--gold-grad); }
.avatar.lg { width: 48px; height: 48px; font-size: 17px; }
.avatar.muted { background: var(--surface-2); color: var(--muted); }
#inv-status { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
#inv-status .status-compact { display: none; }
.view[hidden] { display: none !important; }
.tabbar button { position: relative; }
.tabbar .cnt { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 11px; }

/* ═══ Тост ═══ */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 2000; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--raised); color: var(--ink); font-size: 14.5px; font-weight: 550; box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.toast.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

.sheet-list button .sheet-hint { margin-left: auto; color: var(--subtle); font-size: 12.5px; }
.sheet-list button:disabled { opacity: .45; }

/* ═══ Цвета состояний (только токены) ═══ */
.s-available { color: var(--ok); }
.s-assigned { color: var(--gold); }
.s-repair { color: var(--muted); }
.s-in_transit { color: var(--info); }
.s-lost { color: var(--bad); }
.s-disputed { color: var(--warn); }
.s-other, .s-written_off { color: var(--subtle); }
.st { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: color-mix(in srgb, currentColor 12%, transparent); }
.st .dot { width: 6px; height: 6px; }
.overdue { color: var(--bad); font-weight: 600; }
.due { color: var(--muted); }
.sid { font-family: var(--mono); font-size: 11.5px; color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); padding: 1px 6px; border-radius: 5px; }
.muted-line { color: var(--muted); font-size: 13px; }
.muted-line .ico { width: 14px; height: 14px; vertical-align: -2px; }
.hint-line { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.hint-line .ico { width: 15px; height: 15px; margin-top: 1px; flex: none; }

/* ═══ Каталог ═══ */
.big-actions { display: none; }
.ctrs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.ctr { display: grid; gap: 2px; text-align: left; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); min-height: 76px; transition: border-color .15s, background .15s; }
.ctr:hover { border-color: var(--line-strong); }
.ctr .n { font-size: 24px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.ctr .l { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ctr .bar { height: 3px; border-radius: 2px; margin-top: 6px; background: currentColor; opacity: .7; width: 28px; }
.ctr .bar.total { color: var(--ink); }
.ctr.active { border-color: color-mix(in srgb, var(--gold) 55%, transparent); background: color-mix(in srgb, var(--gold) 8%, transparent); }
.cat-toolbar .search { flex: 1 1 220px; }
.cat-toolbar .chip { min-height: var(--tap); }
.wo-chip[aria-pressed="true"] { color: var(--warn); }
.cat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
/* «Только просмотр»: корзины нет — список во всю ширину (body.inv-viewer ставит session.mjs). */
body.inv-viewer .cat-layout { grid-template-columns: minmax(0, 1fr); }
body.inv-viewer #cart, body.inv-viewer #cart-fab { display: none !important; }
.dispute-who { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.gate-hint { margin-top: 14px; }
.cat-list { min-width: 0; }
.type-list { display: grid; gap: 10px; }
.type-card { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-lg); overflow: clip; }
.type-h { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto 24px; gap: 14px; align-items: center; width: 100%; padding: 14px 16px; border: 0; background: none; color: inherit; text-align: left; }
button.type-h:hover { background: rgba(255, 255, 255, .02); }
.type-h.static { grid-template-columns: 44px minmax(0, 1fr); }
.type-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--gold) 10%, transparent); color: var(--gold); }
.type-ic .ico { width: 22px; height: 22px; }
.type-main { min-width: 0; display: grid; gap: 1px; }
.type-nm { font-weight: 650; font-size: 15px; }
.type-md { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mix { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--bg-deep); margin-top: 8px; max-width: 360px; }
.mix i { display: block; height: 100%; background: currentColor; }
.type-nums { text-align: right; font-variant-numeric: tabular-nums; display: grid; }
.type-nums .big { font-size: 22px; font-weight: 650; line-height: 1.15; }
.type-nums .big .tot { color: var(--subtle); font-weight: 500; font-size: 14px; }
.type-nums .sm { font-size: 12px; color: var(--muted); }
.type-h .chev { color: var(--muted); transition: transform .15s; }
.type-card.open .type-h .chev { transform: rotate(180deg); }
.units { border-top: 1px solid var(--line); }
.unit-row { display: grid; grid-template-columns: 44px 120px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 16px; border-bottom: 1px solid var(--line); font-size: 14px; min-height: 56px; content-visibility: auto; contain-intrinsic-size: auto 56px; }
.unit-row:last-child { border-bottom: 0; }
.unit-row.in-cart { background: color-mix(in srgb, var(--gold) 6%, transparent); }
.unit-row .num, .tbl .num { font-family: var(--mono); font-size: 13px; font-weight: 650; color: var(--ink); background: none; border: 0; text-align: left; padding: 6px 0; min-height: 32px; text-decoration: underline dotted var(--line-strong); text-underline-offset: 3px; }
.unit-row .num:hover, .tbl .num:hover { color: var(--gold); }
.unit-row .where { min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unit-row .where b { color: var(--ink); font-weight: 550; }
.add { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.add .ico { width: 17px; height: 17px; }
.add:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.add.on { background: var(--gold-grad); color: var(--on-gold); border-color: transparent; }
.add:disabled { opacity: .3; cursor: not-allowed; }
.add-spacer { width: 44px; }
.more-row { padding: 10px 16px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.more-btn { margin-top: 12px; }
.grp-h { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 16px; border: 0; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .02); font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; text-align: left; color: var(--ok); min-height: 40px; }
.grp-h .ico { width: 15px; height: 15px; }
.grp-h.muted { color: var(--subtle); }
.grp-h.muted:hover { color: var(--ink); }
.grp-h .chev { margin-left: auto; transition: transform .15s; }
.grp-h.open .chev { transform: rotate(180deg); }
.grp-empty { padding: 12px 16px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.empty-card .empty { display: grid; gap: 6px; place-items: center; }
.empty-card .empty > .ico { width: 30px; height: 30px; color: var(--subtle); }
/* Карточка типа: строка раскрывает список, «Изменить» (название и количество) — отдельная кнопка справа. */
.type-row { display: flex; align-items: center; }
.type-row > .type-h { flex: 1 1 auto; min-width: 0; }
.type-edit { flex: none; margin-right: 14px; }
.type-edit .ico, .type-edit-tb .ico { color: var(--gold); }
#cat-typef { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
#cat-typef:empty { display: none; }
#cat-typef select { min-width: 0; }

/* ═══ Корзина ═══ */
.cart { position: sticky; top: calc(var(--top-h) + 20px); display: grid; border-radius: var(--r-lg); border: 1px solid var(--line-strong); background: var(--raised); box-shadow: 0 20px 50px rgba(0, 0, 0, .3); overflow: clip; max-height: calc(100vh - var(--top-h) - 40px); max-height: calc(100svh - var(--top-h) - 40px); overflow-y: auto; overscroll-behavior: contain; }
.cart-h { display: flex; align-items: center; gap: 8px; padding: 12px 14px 12px 18px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--raised); z-index: 1; }
.cart-h h2 { font-size: 15px; font-weight: 650; display: flex; align-items: center; gap: 10px; margin-right: auto; }
.cart-h h2 .ico { color: var(--gold); }
.pill { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--on-gold); background: var(--gold); }
.cart-sec { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.cart-sec.off { opacity: .55; }
.sec-l { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); margin-bottom: 10px; font-weight: 650; }
.sec-l.on { color: var(--gold); }
.stepn { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--muted); background: var(--surface-2); letter-spacing: 0; }
.sec-l.on .stepn { color: var(--on-gold); background: var(--gold); }
.stepn .ico { width: 13px; height: 13px; }
.cart-items { display: grid; gap: 6px; }
.ci { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 6px 8px 12px; border-radius: 10px; background: var(--bg-deep); border: 1px solid var(--line); }
.ci.bad { border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.ci .n { font-family: var(--mono); font-size: 13px; font-weight: 650; }
.ci .t { font-size: 12.5px; color: var(--muted); grid-column: 1; }
.ci .btn { grid-row: 1 / span 2; grid-column: 2; }
.cart-empty { display: grid; place-items: center; gap: 10px; text-align: center; padding: 20px 12px; color: var(--muted); font-size: 13.5px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); }
.cart-empty > .ico { width: 28px; height: 28px; color: var(--subtle); }
.emp-pick .lbl { margin-bottom: 6px; }
.emp-pick-row { display: flex; gap: 8px; }
.emp-pick-row .btn.icon { flex: none; }
.emp-opts { display: grid; gap: 2px; margin-top: 6px; }
.emp-opts:empty { display: none; }
.opt { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-deep); color: var(--ink); text-align: left; min-height: 52px; }
.opt:hover { border-color: var(--gold); }
.opt.blocked { opacity: .6; cursor: not-allowed; }
.opt.blocked:hover { border-color: var(--line); }
.opt-t { display: grid; min-width: 0; }
.opt-t .nm, .emp-card .nm { font-weight: 600; }
.opt-empty { padding: 10px 4px; font-size: 13px; color: var(--muted); }
.mt { font-size: 12.5px; color: var(--muted); display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.mt .ico { width: 13px; height: 13px; }
.emp-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 8px 10px 12px; border-radius: 12px; background: var(--bg-deep); border: 1px solid var(--line); }
.emp-card-t { display: grid; gap: 1px; min-width: 0; }
.due-box { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; margin-top: 10px; background: color-mix(in srgb, var(--gold) 8%, transparent); border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent); }
.due-box:first-child { margin-top: 0; }
.due-box.dim { opacity: .6; }
.due-box .big { font-size: 16px; font-weight: 650; color: var(--gold); }
.due-box .why { font-size: 12.5px; color: var(--muted); }
.due-warn { display: flex; gap: 6px; align-items: center; color: var(--bad); font-size: 13px; font-weight: 600; }
.due-warn .ico { width: 15px; height: 15px; }
.shift-ctx { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 7%, transparent); }
.shift-ctx .hd { color: var(--warn); font-size: 13px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.shift-ctx .hd .ico { width: 16px; height: 16px; }
.shift-ctx .row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shift-ctx .form-row { margin: 0; }
.shift-ctx .form-row label { font-size: 12.5px; }
label.cb { display: flex; gap: 10px; align-items: center; font-size: 13.5px; min-height: 44px; cursor: pointer; }
.btn.xl { min-height: 52px; font-size: 16px; border-radius: 12px; }
.cart-foot { display: grid; gap: 8px; padding: 14px 18px 18px; }
.cart-foot .btn { white-space: normal; text-align: center; line-height: 1.25; }
.cart-foot .hint { font-size: 12.5px; color: var(--muted); text-align: center; }
.cart-problem { margin: 12px 18px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 8%, transparent); font-size: 13.5px; display: grid; gap: 6px; }
.cart-problem .row-actions { margin-top: 4px; }
.conflicts { list-style: none; display: grid; gap: 2px; }
.conflicts b { font-family: var(--mono); font-size: 12.5px; }
.issue-result { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; margin: 14px 18px 0; padding: 12px 14px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); background: color-mix(in srgb, var(--ok) 8%, transparent); font-size: 13.5px; }
.issue-result > .ico { color: var(--ok); width: 20px; height: 20px; margin-top: 1px; }
.issue-result .nums { font-family: var(--mono); font-size: 12.5px; margin: 2px 0; }
.issue-result a { color: var(--gold); font-weight: 600; display: inline-block; margin-top: 6px; }
.cart-fab { display: none; }

/* ═══ Карточка единицы ═══ */
.uc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 14px; color: var(--muted); font-size: 14px; }
.uc-dl { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 8px 14px; font-size: 14px; }
.uc-dl dt { color: var(--muted); }
.uc-dl dd { min-width: 0; overflow-wrap: anywhere; }
.uc-actions { margin-top: 16px; }
.uc-h { font-size: 13px; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 18px 0 8px; }
.mini-hist { list-style: none; display: grid; gap: 6px; font-size: 13px; }
.mini-hist li { display: grid; grid-template-columns: 110px 170px minmax(0, 1fr); gap: 10px; }
.mini-hist .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-hist .a { color: var(--muted); }

/* ═══ Камера ═══ */
.cam-scrim { z-index: 1500; }
.cam-box { width: min(520px, 100%); }
.cam-frame { position: relative; border-radius: 14px; overflow: hidden; background: var(--bg-deep); aspect-ratio: 4 / 3; margin: 10px 0; }
.cam-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-aim { position: absolute; inset: 18%; border: 2px solid var(--gold); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .25); }

/* ═══ Окна операций ═══ */
#modal-title { display: flex; align-items: center; gap: 10px; }
#modal-box:focus { outline: none; }
#modal-title .ico { color: var(--gold); width: 20px; height: 20px; }
.op-items { display: grid; gap: 6px; margin-bottom: 14px; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.op-items.chooser { max-height: 300px; margin-top: 8px; }
.op-item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 4px 10px 4px 0; border-radius: 10px; background: var(--bg-deep); border: 1px solid var(--line); min-height: 52px; font-size: 13.5px; }
.op-check { display: grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.op-it { display: grid; min-width: 0; }
.op-it .mono, .mono { font-family: var(--mono); font-weight: 650; font-size: 13px; }
.op-it .t { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-due { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.op-group { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); margin: 8px 0 2px; }
.op-sec { margin: 6px 0 14px; }
.op-skip { font-size: 13px; color: var(--warn); margin: -4px 0 12px; }
.op-item.changed .op-it .mono { text-decoration: line-through; text-decoration-color: var(--warn); }
.op-changed { display: block; font-size: 12.5px; color: var(--warn); margin-top: 2px; }
.op-why { font-size: 12.5px; color: var(--muted); margin-top: 8px; text-align: right; }
.op-form.frozen { opacity: .6; pointer-events: none; }
.op-progress { font-size: 13.5px; margin: 8px 0; display: grid; gap: 6px; }
.seg.cond button { min-height: 36px; font-size: 12.5px; padding: 0 10px; }
.seg.cond button.bad.active { color: var(--bad); }
.row-actions.tight { margin: 0 0 10px; }
.field.area { min-height: 110px; padding: 10px 12px; font-family: var(--mono); line-height: 1.5; resize: vertical; }
.num-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-radius: 12px; background: var(--bg-deep); border: 1px solid var(--line); margin-bottom: 10px; }
.num-chip { font-family: var(--mono); font-size: 12.5px; padding: 2px 8px; border-radius: 6px; color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.num-chip.taken { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.dialog .actions .btn.danger { flex: 1; }

/* ═══ «Изменить тип»: название и количество ═══ */
.te-qty { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-deep); margin-bottom: 14px; }
.te-step { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.te-step .btn.icon { width: 48px; min-height: 48px; border-radius: 12px; }
.te-step .btn.icon .ico { width: 20px; height: 20px; }
.field.te-count { width: 104px; min-height: 48px; text-align: center; font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.te-now { margin-left: 6px; color: var(--muted); font-size: 14px; }
.te-break { margin-top: 10px; color: var(--muted); font-size: 13px; }
.te-note { margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.te-note.warn { color: var(--warn); }
.te-sec { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); }
.te-sec.te-add { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: color-mix(in srgb, var(--ok) 5%, transparent); }
.te-sec.te-remove { border-color: color-mix(in srgb, var(--bad) 30%, transparent); background: color-mix(in srgb, var(--bad) 5%, transparent); }
.te-sec-h { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; margin-bottom: 12px; }
.te-sec.te-add .te-sec-h { color: var(--ok); }
.te-sec.te-remove .te-sec-h { color: var(--bad); }
.te-sec .form-row:last-child, .te-sec .form-grid:last-child .form-row { margin-bottom: 0; }
.te-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.te-opt { display: grid; gap: 2px; align-content: center; text-align: left; padding: 10px 12px; min-height: 56px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.te-opt:hover { border-color: var(--gold); }
.te-opt.active { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); box-shadow: inset 0 0 0 1px var(--gold); }
.te-opt b { font-size: 14px; }
.te-opt span { font-size: 12.5px; color: var(--muted); }
.te-units { max-height: 260px; }
.te-link { border: 0; background: none; padding: 0; color: var(--gold); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.te-result { margin: 0; }
.te-problem { margin: 14px 0 0; }

/* ═══ Таблица и массовые действия ═══ */
.tbl-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: -4px 0 10px; }
.tbl-tools .sel-all { min-height: 44px; font-weight: 550; }
.sel-count { font-size: 13.5px; color: var(--gold); font-weight: 600; }
.tbl-hint { display: inline-flex; gap: 6px; align-items: center; }
.tbl-hint .ico { color: var(--gold); }
.inv-tbl th:nth-child(1) { width: 56px; }
.inv-tbl th:nth-child(2) { width: 34%; }
.inv-tbl th:nth-child(3) { width: 128px; }
.inv-tbl th:nth-child(5) { width: 104px; }
.inv-tbl th:nth-child(6) { width: 64px; }
.inv-tbl td { padding: 6px 12px; }
.inv-tbl .c-num .num { display: block; padding: 4px 0 0; min-height: 0; }
.inv-tbl .c-where .w { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inv-tbl .c-where .d { display: block; }
.inv-tbl .c-where .d { font-size: 12.5px; }
.inv-tbl td.c-check, .inv-tbl td.c-add { overflow: visible; }
.inv-tbl .hit { display: grid; place-items: center; width: 44px; height: 44px; margin: -4px 0 -4px -8px; cursor: pointer; }
.inv-tbl .eq-t { font-size: 12.5px; }
.inv-tbl .eq-m { font-size: 12.5px; color: var(--muted); }
.inv-tbl .eq-m:not(:empty)::before { content: " · "; }
.inv-tbl tr.selected td { background: color-mix(in srgb, var(--gold) 7%, transparent); }
.inv-selbar { position: fixed; left: calc(var(--rail) + 24px); right: 24px; bottom: 16px; z-index: 60; flex-wrap: wrap; justify-content: flex-end; }
.inv-selbar[hidden] { display: none !important; }
.inv-selbar:not([hidden]) { display: flex; }
.inv-selbar .sel-n { font-weight: 650; margin-right: auto; white-space: nowrap; }
.inv-selbar .cnt { font-variant-numeric: tabular-nums; opacity: .8; }
/* Панель выбора прибита к низу экрана: конец списка поднимается над ней (16 px + её высота + 12 px; 56 px — отступ main). */
body.selbar-on #view-catalog { padding-bottom: calc(16px + var(--selbar-h, 64px) + 12px - 56px); }
.bulk-list { display: grid; gap: 6px; margin-bottom: 8px; }
.bulk-group { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--subtle); margin: 10px 0 2px; }
.bulk-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-deep); color: var(--ink); text-align: left; min-height: 56px; }
.bulk-row:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-2); }
.bulk-row:disabled { opacity: .45; cursor: not-allowed; }
.bulk-row .bi { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--gold); background: color-mix(in srgb, var(--gold) 10%, transparent); }
.bulk-row.danger .bi { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.bulk-row .t { display: block; font-weight: 600; font-size: 14.5px; }
.bulk-row .m { display: block; font-size: 12.5px; color: var(--muted); }
.bulk-row .m b { color: var(--ink); }
.net-badge { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.net-badge.on { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.net-badge.need { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }

/* ═══ Перемещения ═══ */
.sec-h { font-size: 17px; font-weight: 650; margin: 18px 0 10px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.sec-h span { font-size: 13px; font-weight: 400; color: var(--muted); }
.ship-card { margin-bottom: 12px; overflow: clip; }
.ship-h { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ship-t { display: grid; min-width: 0; }
.ship-t b { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; }
.ship-t b .ico { width: 14px; height: 14px; }
.ship-prog { display: grid; gap: 6px; justify-items: end; font-size: 13px; color: var(--muted); min-width: 150px; }
.ship-prog .mix { width: 150px; margin: 0; }
.ship-items { display: grid; gap: 6px; padding: 12px 16px; }
.ship-foot { padding: 0 16px 14px; }
.ship-card .cart-problem { margin: 0 16px 12px; }
.ship-done { display: grid; }
.ship-row { display: grid; gap: 2px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ship-row:last-child { border-bottom: 0; }
.ship-row b { display: inline-flex; align-items: center; gap: 6px; }
.ship-row b .ico { width: 14px; height: 14px; }
.pad { padding: 8px 0; }

/* ═══ За сотрудниками ═══ */
.holder { margin-bottom: 12px; overflow: clip; }
.holder.late { border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.holder-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.holder-t { display: grid; min-width: 0; }
.holder-t b { font-size: 15px; }
.holder-due { text-align: right; font-size: 14px; }
.holder-due .ico { width: 15px; height: 15px; margin-right: 4px; vertical-align: -2px; }
.holder-n { display: grid; justify-items: center; line-height: 1.1; }
.holder-n b { font-size: 20px; }
.holder-n span { font-size: 11.5px; color: var(--muted); }
.hold-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 6px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; min-height: 44px; }
.hold-row .num { font-family: var(--mono); font-weight: 650; font-size: 13px; background: none; border: 0; color: var(--ink); text-align: left; text-decoration: underline dotted var(--line-strong); text-underline-offset: 3px; min-height: 32px; }
.hold-what { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.holder-f { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 16px; }
.holder-f a, a.link { color: var(--gold); font-size: 13.5px; font-weight: 550; display: inline-flex; gap: 6px; align-items: center; min-height: 34px; }
.holder-f a .ico, a.link .ico { width: 15px; height: 15px; }
.focus-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); color: var(--gold); font-size: 13.5px; margin-bottom: 12px; }
.focus-chip .ico { width: 15px; height: 15px; }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ═══ История ═══ */
.hist-tools { align-items: flex-start; }
.hist-tools .search { flex: 1 1 200px; }
.hist-emp { position: relative; flex: 1 1 220px; min-width: 200px; }
.hist-emp .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.hist-emp .emp-opts { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); padding: 6px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line-strong); box-shadow: 0 16px 40px rgba(0, 0, 0, .45); max-height: 320px; overflow-y: auto; }
.hist-emp .hint-line { display: none; }
.hist-card { overflow: clip; }
.h-row { display: grid; grid-template-columns: 56px 190px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.h-row:last-child { border-bottom: 0; }
.h-time { font-weight: 600; font-variant-numeric: tabular-nums; padding-top: 2px; }
.h-what { overflow-wrap: anywhere; }
.h-why { font-size: 13px; color: var(--muted); margin-top: 2px; }
.h-counts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.h-counts span { font-size: 12.5px; padding: 3px 9px; border-radius: 8px; background: var(--bg-deep); border: 1px solid var(--line); }
.h-counts b { color: var(--gold); }
.h-author { display: grid; justify-items: end; gap: 2px; font-size: 13px; color: var(--muted); text-align: right; }
.h-author b { color: var(--ink); font-weight: 550; }
.tag.t-gold { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.tag.t-ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.tag.t-info { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); }
.tag.t-bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.tag.t-warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.tag.t-muted { color: var(--muted); background: var(--surface-2); }
.badge.offline { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.badge.mine { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }

/* ═══ Сверка ═══ */
.dispute, .review-op, .review-group { margin-bottom: 12px; overflow: clip; }
.dispute { border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.dispute-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.dispute-h > .ico { color: var(--warn); width: 18px; height: 18px; }
.dispute-cols { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.dispute-cols > div { padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.dispute-cols > div + div { border-left: 1px solid var(--line); }
.dispute-op { display: grid; gap: 2px; }
.dispute-form { padding: 14px 16px; display: grid; gap: 10px; }
.dispute-form .form-row { margin: 0; }
.seg.wrap { flex-wrap: wrap; }
.review-op > p, .review-op > .form-row, .review-op > .row-actions { padding: 0 16px; }
.review-op > p:first-of-type { padding-top: 12px; }
.review-op > .row-actions { padding-bottom: 14px; }
/* Шапка группы «Сверки»: поля и кнопка — с отступами, как у карточки операции. */
.review-group { border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.review-group > .form-row, .review-group > .row-actions, .review-group > p { padding: 0 16px; }
.review-group > .form-row { padding-top: 12px; }
/* Шапка группы: значок не уезжает отдельной строкой на телефоне — текст переносится рядом с ним. */
.review-group .group-h { flex-wrap: nowrap; align-items: flex-start; }
.review-group .group-h > .ic, .review-group .group-h > .ico { flex: none; margin-top: 2px; }
.review-group .group-t { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.review-group > .row-actions { padding-top: 4px; padding-bottom: 14px; }
.field.area.plain { font-family: var(--font); }
.help.grow { flex: 1 1 320px; margin: 0; }

/* ═══ Ответственные ═══ */
.acc { margin-bottom: 10px; overflow: clip; }
.acc.off { opacity: .7; }
.acc-h { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 16px; }
.acc-t { display: grid; min-width: 0; }
.acc-pw, .acc-devices { padding: 0 16px 14px; }
.grants { display: grid; gap: 6px; margin-bottom: 8px; }
.grant { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--bg-deep); border: 1px solid var(--line); font-size: 13px; }
.grant.dead { opacity: .55; }
.grant .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-add { margin-bottom: 12px; }

/* ═══ Отчёты и этикетки ═══ */
.rep-csv { align-items: end; margin-top: 16px; }
.rep-local { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
/* «Это устройство»: очередь, хранилище, выгрузка */
.dev-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0 0 16px; font-size: 14px; }
.dev-facts dt { color: var(--muted); }
.dev-facts dd { margin: 0; overflow-wrap: anywhere; }
.rejected-op .dispute-h > .ico { color: var(--bad); }
.rep-csv-btn { display: flex; }
.labels { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; max-height: 56vh; max-height: 56svh; overflow-y: auto; margin-bottom: 4px; }
.label { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: center; padding: 10px; border-radius: 10px; background: #fff; color: #111; }
.label .qr img, .label .qr canvas { display: block; width: 112px; height: 112px; }
.label-t { display: grid; gap: 2px; min-width: 0; }
.label .lt { font-size: 12px; }
.label .lm { font-size: 12px; color: #444; }
.label .ln { font-family: var(--mono); font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
#print-area { display: none; }
@media print {
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing { background: #fff; }
  body.printing #print-area { display: block; }
  body.printing .labels { max-height: none; overflow: visible; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  body.printing .label { border: 1px solid #ccc; break-inside: avoid; }
}

/* ═══ Планшет (768–1199): рельс ═══ */
@media (max-width: 1199px) {
  .nav .cnt { position: absolute; margin: 0; top: 6px; right: 10px; }
  .nav button { position: relative; }
  .nav .sep { margin: 6px 8px; }
  .wh-pick { justify-content: center; padding: 6px; }
  .wh-pick .txt, .who > div, .side-btns .btn span { display: none; }
  .who { justify-content: center; padding: 0; }
  .side-btns { justify-content: center; }
  .ctrs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cat-layout { grid-template-columns: minmax(0, 1fr) 330px; gap: 14px; }
  .unit-row { grid-template-columns: 44px 110px minmax(0, 1fr); }
  .unit-row .st { grid-column: 3; justify-self: start; }
  .unit-row { content-visibility: visible; } /* высота здесь другая, чем у оценки 56 px: без неё список не подпрыгивает */
  .type-h { grid-template-columns: 40px minmax(0, 1fr) auto 20px; gap: 10px; }
  .inv-selbar { left: calc(var(--rail) + 16px); right: 16px; }
}

/* ═══ Телефон (<768) ═══ */
@media (max-width: 767px) {
  #inv-status { flex-wrap: nowrap; gap: 4px; }
  #inv-status .chip { display: none; }
  #inv-status .chip.status-compact { display: inline-flex; padding: 0 10px; gap: 5px; }
  .top-text { flex: 1 1 auto; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  #gate-card { padding: 20px; }
  .field.pin { font-size: 20px; }
  /* minmax(0, …) и перенос подписи: на узком телефоне (320 px) «Принять возврат» не помещалась в строку и раздвигала
     страницу вбок. */
  .big-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
  .big-actions .btn { min-height: 60px; min-width: 0; padding: 0 12px; font-size: 17px; white-space: normal; line-height: 1.2; text-align: center; }
  .ctrs { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)) 14px; padding: 0 var(--gutter); }
  .ctrs::-webkit-scrollbar { display: none; }
  .ctr { flex: 0 0 132px; }
  .cat-toolbar .search { flex-basis: 100%; order: -1; }
  .cat-toolbar .view-seg { flex: 1 1 100%; }
  .cat-toolbar .view-seg button { flex: 1; }
  /* «Таблица»: фильтр типа и «Изменить тип» — своей строкой, фильтр тянется. */
  #cat-typef { flex: 1 1 100%; }
  #cat-typef select { flex: 1 1 auto; }
  .cat-layout { grid-template-columns: minmax(0, 1fr); }
  .unit-row { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 12px; padding: 8px 12px; min-height: 64px; }
  .unit-row .add, .unit-row .add-spacer { grid-row: 1 / span 2; }
  .unit-row .num { grid-column: 2; padding: 2px 0; min-height: 0; justify-self: start; }
  .unit-row .where { grid-column: 2 / span 2; grid-row: 2; }
  .unit-row .st { grid-column: 3; grid-row: 1; justify-self: end; }
  .type-h { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 12px; }
  .type-h .chev { display: none; }
  .te-opts { grid-template-columns: 1fr; }
  .type-ic { width: 40px; height: 40px; }
  .mix { max-width: none; }
  /* Корзина — шторка снизу; открывается кнопкой «Корзина (N)» или большой «Выдать». */
  .cart { display: none; }
  /* Шторка постоянной высоты: подстраиваясь под содержимое, она прыгала верхним краем (выбрали сотрудника, догрузился
     срок); svh — не меняется, когда Safari прячет панель. Кнопка «Выдать» — у нижнего края всегда: и пока шагов мало
     (иначе она съезжала вниз, когда шаги дорисовывались), и когда они не помещаются (sticky). */
  body.cart-open .cart { display: flex; flex-direction: column; position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 1100;
    height: 92vh; height: 92svh; max-height: none;
    border-radius: 22px 22px 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom); animation: sheetUp .22s ease-out; }
  body.cart-open::after { content: ""; position: fixed; inset: 0; z-index: 1050; background: rgba(12, 11, 16, .62); }
  body.cart-open .cart > * { flex: none; }
  body.cart-open .cart-foot { margin-top: auto; position: sticky; bottom: 0; z-index: 1; background: var(--raised); border-top: 1px solid var(--line); }
  /* Окна, которые меняются по нажатию («Изменить тип», «Добавить», операции), — тоже постоянной высоты: подстраиваясь
     под содержимое, окно росло вверх, и всё над изменением уезжало (после «−» кнопка уходила из-под пальца, а второе
     касание попадало в «Списать»). */
  #modal-box[data-kind="typeedit"], #modal-box[data-kind="register"], #modal-box[data-kind="op"] { height: 92vh; height: 92svh; }
  /* Плавающая «Корзина (N)» и панель выбора не закрывают последние строки и кнопку «Изменить» у последней карточки:
     к нижнему отступу main (96 px) — сколько ещё нужно, чтобы конец списка поднимался над ними (кнопка: 80 + 52 px,
     панель: 76 px + её высота, --selbar-h из bulk.mjs), и 12 px зазора. */
  body.cart-fab-on #view-catalog { padding-bottom: 48px; }
  body.selbar-on #view-catalog { padding-bottom: calc(76px + var(--selbar-h, 168px) + 12px - 96px); }
  .cart-fab { position: fixed; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); z-index: 45; display: inline-flex; align-items: center; gap: 10px;
    min-height: 52px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--gold-grad); color: var(--on-gold); font-size: 16px; font-weight: 700;
    box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
  .cart-fab[hidden] { display: none; }
  .shift-ctx .row2 { grid-template-columns: minmax(0, 1fr); }
  /* Цели нажатия ≥ 44 px на телефоне */
  .btn.sm { min-height: 44px; }
  .btn.sm.icon { width: 44px; }
  .unit-row .num, .hold-row .num, .inv-tbl .num, .inv-tbl .c-num .num { min-height: 44px; display: inline-flex; align-items: center; }
  .seg.cond button { min-height: 44px; }
  .unit-row .num { padding: 0; }
  .uc-dl { grid-template-columns: 1fr; gap: 2px; }
  .uc-dl dd { margin-bottom: 8px; }
  .mini-hist li { grid-template-columns: 1fr; gap: 0; }
  .op-item { grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; padding: 6px 10px 6px 0; }
  .op-item > .op-check { grid-row: 1 / span 2; }
  .op-item > :nth-child(n+3) { grid-column: 2; justify-self: start; }
  .op-items { max-height: 46vh; max-height: 46svh; }
  /* Таблица → карточки с галочкой (одна разметка, как .tbl в Tabeli) */
  .tbl-tools { margin-top: 0; }
  /* Без «content-visibility» (из .tbl): высота карточки (118–156 px) не совпадала с оценкой, а Safari не поправляет
     прокрутку, когда строка впервые показывается, — список подпрыгивал. */
  .inv-tbl tr { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 12px; content-visibility: visible; }
  /* Выбранная карточка подсвечивается целиком, а не каждой ячейкой (были серые прямоугольники с просветами). */
  .inv-tbl tr.selected { background: color-mix(in srgb, var(--gold) 7%, var(--surface)); border-color: color-mix(in srgb, var(--gold) 35%, var(--line)); }
  .inv-tbl tr.selected td { background: none; }
  .inv-tbl td.c-check { grid-row: 1 / span 2; }
  .inv-tbl .hit { margin: 0; }
  .inv-tbl td.c-num { grid-column: 2; grid-row: 1; }
  .inv-tbl td.c-st { grid-column: 3; grid-row: 1; justify-self: end; }
  .inv-tbl td.c-where { grid-column: 2; grid-row: 2; font-size: 13px; color: var(--muted); }
  .inv-tbl td.c-add { grid-column: 3; grid-row: 2; justify-self: end; align-self: center; }
  .inv-selbar { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); padding: 10px; gap: 8px; }
  .inv-selbar .bar-more { display: none; }
  .inv-selbar .sel-n { flex-basis: auto; }
  /* «Снять выбор» — в первой строке, справа от «Выбрано: N» (а не один на третьей строке); «Выдать» — во всю ширину,
     остальные кнопки делят строку под ней. */
  .inv-selbar .sel-n { order: -2; }
  .inv-selbar .sel-clear { order: -1; }
  .inv-selbar .btn.primary { flex: 1 1 100%; }
  .inv-selbar .btn:not(.icon) { flex-grow: 1; }
  .ship-h { grid-template-columns: 40px minmax(0, 1fr); }
  .ship-prog { grid-column: 1 / -1; justify-items: start; }
  .sec-h { font-size: 16px; }
  .holder-h { grid-template-columns: auto minmax(0, 1fr) auto; }
  .holder-due { grid-column: 2 / span 2; grid-row: 2; text-align: left; }
  .hold-row { grid-template-columns: minmax(0, 1fr) auto; row-gap: 0; padding: 4px 16px 10px; }
  .hold-what { grid-column: 1 / -1; grid-row: 2; white-space: normal; }
  .h-row { grid-template-columns: 48px minmax(0, 1fr); gap: 4px 12px; }
  .h-kind { grid-column: 2; }
  .h-main { grid-column: 1 / -1; }
  .h-author { grid-column: 1 / -1; justify-items: start; text-align: left; display: flex; flex-wrap: wrap; gap: 4px 12px; }
  .hist-emp { flex-basis: 100%; }
  .dispute-cols { grid-template-columns: 1fr; }
  .dispute-cols > div + div { border-left: 0; border-top: 1px solid var(--line); }
  .acc-h { grid-template-columns: auto minmax(0, 1fr); }
  .acc-h .row-actions { grid-column: 1 / -1; }
  .grant { grid-template-columns: 1fr; }
  .labels { grid-template-columns: 1fr; }
}

/* Заблокировано (экран PIN поверх): окно операции и меню ждут того же ответственного, но не видны и не нажимаются. */
body.locked .scrim { display: none !important; }
/* «Кто работает?» — профили ответственных на устройстве */
.who-list { display: grid; gap: 8px; margin: 4px 0 16px; }
.who-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: var(--tap); padding: 10px 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); color: var(--ink); font: inherit; cursor: pointer; }
.who-row:hover { border-color: var(--line-strong); }
.who-t { display: grid; flex: 1; min-width: 0; }
.who-t span { color: var(--muted); font-size: 13px; }
.who-row > .ico { color: var(--subtle); }
/* Прогноз устройства: сделано без связи, сервер ещё не подтвердил / станет спором */
.badge.local { color: var(--info); background: color-mix(in srgb, var(--info) 12%, transparent); }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
/* «Доступно обновление» видно и на телефоне (остальные плашки там свёрнуты в одну) */
@media (max-width: 767px) { #inv-status .chip.update-chip { display: inline-flex; } }

/* Карточка типа в узком списке (телефон, планшет с корзиной справа, узкое окно) — по ширине самого списка, а не окна:
   «Изменить» — значок-карандаш, подпись под числами переносится, без стрелки — названию типа остаётся место. */
.type-list { container-type: inline-size; }
@container (max-width: 560px) {
  .type-h { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 12px; }
  .type-h .chev { display: none; }
  .type-edit { width: 44px; padding: 0; margin-right: 10px; }
  .type-edit span { display: none; }
  .type-nums .sm { max-width: 96px; line-height: 1.25; }
}
@container (max-width: 330px) {
  .type-nums .sm { display: none; }
}
