/* WaydorApp — один файл стилей. На компьютере: боковое меню + рабочая область на всю ширину.
   На телефоне (до 900px): верхняя панель с меню, таблицы-списки превращаются в карточки. */
:root {
  --bg: #f3f5f8; --card: #fff; --line: #dde2e9; --line2: #eef1f5;
  --text: #1c2430; --muted: #687385; --accent: #1f5fd1; --accent-d: #184da9; --accent-bg: #eaf1fd;
  --nav: #1f3a68; --nav-text: #d5def0; --nav-active: #fff;
  --ok: #12805c; --ok-bg: #e6f6ef; --warn: #b26a00; --warn-bg: #fff4e0; --err: #c43333; --err-bg: #fdecec;
  --radius: 10px; --gap: 16px;
  color-scheme: light; /* выпадающие списки и календари — светлые, даже если в системе тёмная тема */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
[hidden] { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 17px; margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.neg { color: var(--err); }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.nav { background: var(--nav); color: var(--nav-text); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 700; font-size: 18px; color: #fff; padding: 18px 20px 10px; }
.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #8fa3c7; padding: 16px 20px 6px; }
.nav a { display: flex; justify-content: space-between; align-items: center; color: var(--nav-text); padding: 9px 20px; font-size: 15px; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.14); color: var(--nav-active); box-shadow: inset 3px 0 0 #7fb0ff; }
.badge { background: #e8eefb; color: var(--nav); border-radius: 10px; font-size: 12px; padding: 0 7px; font-weight: 600; }
.nav-foot { margin-top: auto; padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; }
.nav-foot .link { color: #9fc0ff; }
.who { margin-bottom: 6px; overflow-wrap: anywhere; }
.brand { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand .help-btn, .brand .fb-btn { color: var(--nav-text); display: flex; padding: 4px; border-radius: 8px; }
.brand .fb-btn { margin-left: auto; } .brand .fb-btn + .help-btn { margin-left: 2px; }
.brand .fb-btn:hover, .brand .help-btn:hover { color: #fff; background: rgba(255,255,255,.1); }
.topbar .help-btn { margin-left: auto; color: #fff; display: flex; }
.topbar .fb-btn { margin-left: auto; color: #fff; display: flex; } .topbar .fb-btn + .help-btn { margin-left: 4px; }
/* справка */
.help-item { display: block; padding: 7px 0; font-size: 16px; }
.bulk-row { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; }
.bulk-row label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.c-sel { width: 34px; }
.rule-dot { display: inline-block; width: 18px; color: var(--accent); font-weight: 700; font-style: italic; }
.ru-how { max-width: 520px; }
.ru-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 16px; }
.sub-list .b { font-weight: 700; }
.o-adj { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: end; padding: 4px 20px 16px; }
.o-adj label { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.o-adj input { width: 130px; }
.o-adj .hint { flex: 1 1 260px; }
.help-snip { margin: -4px 0 8px; }
.help-snip mark { background: #fff1a8; color: inherit; padding: 0 1px; }
.help-art { max-width: 820px; }
.help-art p, .help-art li { line-height: 1.55; }
.help-art h3 { font-size: 15px; margin: 18px 0 6px; }
.topbar { display: none; }
.view { padding: 24px 32px 48px; min-width: 0; }
.scrim { display: none; }

/* ---------- блоки ---------- */
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head .title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: var(--gap); }
.card.flush { padding: 0; overflow: hidden; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--gap); align-items: start; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .grow { flex: 1 1 260px; }
.inline-f { display: flex; align-items: center; gap: 6px; font-weight: 500; }
.inline-f select { width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
/* выбор нескольких значений из списка с поиском (журнал прихода: позиции) */
.msel { position: relative; }
.msel > summary { list-style: none; cursor: pointer; } .msel > summary::-webkit-details-marker { display: none; }
.msel-pop { position: absolute; right: 0; z-index: 30; margin-top: 6px; width: min(360px, calc(100vw - 32px)); background: var(--card, #fff);
  border: 1px solid var(--line, #d5dbe4); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 10px; }
.msel-list { max-height: 300px; overflow: auto; margin: 8px 0; display: grid; gap: 4px; }
@media (max-width: 700px) { .msel-pop { position: fixed; left: 16px; right: 16px; top: 72px; width: auto; margin: 0; } .msel-list { max-height: 50vh; } }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 5px 12px; font: inherit; font-size: 14px; cursor: pointer; color: var(--text); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.status { display: inline-block; border-radius: 12px; padding: 2px 10px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.st-new { background: #eef1f5; color: #4a5568; }
.st-inwork { background: var(--warn-bg); color: var(--warn); }
.st-ready { background: var(--ok-bg); color: var(--ok); }
.st-partial { background: #f1e9fd; color: #6b3fb5; }
.st-shipped { background: #e8edf3; color: #687385; }
.kv { display: grid; grid-template-columns: minmax(0, max-content) auto; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: break-word; } /* число не дробится по цифре: переносится подпись */
.stats { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.stat .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 12px; color: var(--muted); }

/* ---------- формы ---------- */
label { display: block; font-size: 13px; color: var(--muted); font-weight: 600; }
label > input, label > select, label > textarea { margin-top: 4px; }
input, select, textarea { width: 100%; font: inherit; font-size: 15px; color: var(--text); background: #fff; border: 1px solid #cfd6e0; border-radius: 8px; padding: 9px 11px; min-height: 40px; }
textarea { min-height: 64px; resize: vertical; }
select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 34px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23687385' stroke-width='1.8'/%3E%3C/svg%3E") no-repeat right 12px center; }
select.auto { width: auto; }
input[type=color] { width: 44px; min-height: 36px; padding: 3px; cursor: pointer; flex: none; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(31,95,209,.15); }
input:disabled { background: #f4f6f9; color: var(--muted); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px 16px; }
.fields .span2 { grid-column: span 2; }
.fields .span-all { grid-column: 1 / -1; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; font-weight: 400; }
.inline { display: flex; gap: 8px; align-items: flex-end; }
.inline > * { flex: 1; }
.inline > .btn { flex: none; }
.tbl td.main { white-space: nowrap; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--text); font-size: 15px; cursor: pointer; }
.check input { width: 18px; height: 18px; min-height: 0; flex: none; margin: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: 15px; font-weight: 600; border-radius: 8px; padding: 9px 16px; min-height: 40px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; white-space: nowrap; }
.btn:hover:not(:disabled) { border-color: #b9c3d1; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--accent-d); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { color: var(--err); border-color: #f0c4c4; }
.btn.small { font-size: 13px; padding: 4px 10px; min-height: 30px; }
.btn.wide { width: 100%; }
.link { background: none; border: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; }
.icon-btn { background: none; border: none; font-size: 22px; line-height: 1; padding: 8px; cursor: pointer; color: inherit; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.12); min-width: 240px; padding: 4px; }
.menu-list a, .menu-list button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 6px; color: var(--text); background: none; border: none; font: inherit; cursor: pointer; }
.menu-list a:hover, .menu-list button:hover { background: var(--accent-bg); text-decoration: none; }

/* ---------- меню «⋯» ---------- */
.pop-menu { position: fixed; z-index: 120; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.16);
  min-width: 250px; max-width: calc(100vw - 16px); max-height: calc(100vh - 16px); overflow-y: auto; padding: 4px; }
.pop-menu button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 6px; color: var(--text); background: none; border: none; font: inherit; cursor: pointer; }
.pop-menu button:hover { background: var(--accent-bg); }
.pop-menu button.danger { color: var(--err); }
.pop-menu hr { border: none; border-top: 1px solid var(--line2); margin: 4px 0; }
.btn.dots { font-size: 18px; line-height: 1; padding-left: 10px; padding-right: 10px; letter-spacing: 1px; }
.row-acts { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
.tbl td.acts { width: 1%; }

/* ---------- выпадающий список с поиском ---------- */
.combo-list { position: fixed; z-index: 150; background: #fff; color: var(--text); border: 1px solid #cfd6e0; border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,.16); overflow-y: auto; padding: 4px; }
.combo-opt { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14.5px; }
.combo-opt small { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.combo-opt:hover { background: #f2f5fa; }
.combo-opt.on { background: var(--accent-bg); }
.combo-more { color: var(--muted); font-size: 13px; padding: 8px 10px; }

/* ---------- окно поверх страницы ---------- */
.modal-back { position: fixed; inset: 0; z-index: 110; background: rgba(20,30,45,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 12px 6px 20px; }
.modal-head h2 { margin: 0; }
.modal-body { padding: 4px 20px 20px; }
.modal-foot { margin-top: 18px; }
.modal-back.dlg { z-index: 140; align-items: center; padding-top: 16px; }
.modal.small { max-width: 480px; }
.dlg-text { line-height: 1.5; }
.btn.danger-fill { background: var(--err); border-color: var(--err); color: #fff; }
body.modal-open { overflow: hidden; }
.rm-order { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 10px 12px; background: #f7f9fb; border-radius: 8px; }
.rm-lines { margin-top: 10px; }
.sh-row { padding: 7px 0; border-bottom: 1px solid var(--line2); }

/* ---------- настройки ---------- */
.ref-row { display: flex; align-items: center; gap: 6px; padding: 4px 0; }
.ref-row .ref-name { flex: 1; min-height: 36px; padding: 6px 10px; }
.ref-gap { width: 38px; flex: none; font-size: 11px; color: var(--muted); text-align: center; }
.cols.settings { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }

/* перетаскивание строк («Заказы в работе») */
.drag { display: inline-block; cursor: grab; touch-action: none; user-select: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 4px 8px 4px 2px; margin: -4px 4px -4px -2px; vertical-align: -2px; }
.drag:hover { color: var(--accent); }
tr.dragging { opacity: .6; outline: 2px dashed var(--accent); }
tr.dragging, tr.dragging .drag { cursor: grabbing; }

/* ---------- комплекты КЗС ---------- */
.sec-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sec-head h2 { margin: 0; }
.kzs-flag { margin-left: auto; font-weight: 600; }
.kzs-badge { display: inline-block; font-size: 11.5px; font-weight: 700; color: #0b6b5f; background: #dff3ef; border-radius: 6px; padding: 1px 7px; margin-left: 8px; vertical-align: 2px; }
.exp { border: none; background: none; color: var(--muted); font-size: 13px; width: 22px; padding: 0; margin-right: 4px; cursor: pointer; }
.exp:hover { color: var(--accent); }
.sub-list.comp { padding-left: 40px; }
.kit { border-top: 1px solid var(--line2); padding: 14px 0 6px; }
.kit:first-of-type { border-top: none; }
.k-parts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 8px; }
.k-parts .check { font-size: 14.5px; }
.kit-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; }
.kit-sum .btn { margin-left: auto; }
.k-lines { margin-top: 8px; }
.k-lines .tbl td { padding: 6px 8px; font-size: 14px; }
.k-edit input:not([type]), .k-edit input[inputmode] { width: 90px; text-align: right; }
.tbl tr.low td { background: var(--err-bg); }
.k-edit input.edited { background: var(--warn-bg); border-color: var(--warn); }

/* ---------- сообщения ---------- */
.msg { border-radius: 8px; padding: 10px 14px; margin-top: 12px; font-size: 14px; }
.msg ul { margin: 4px 0 0; padding-left: 18px; }
.msg.ok { background: var(--ok-bg); border-left: 4px solid var(--ok); }
.msg.err { background: var(--err-bg); border-left: 4px solid var(--err); }
.msg.warn { background: var(--warn-bg); border-left: 4px solid var(--warn); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #1c2430; color: #fff; padding: 10px 18px; border-radius: 8px; z-index: 100; max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.loading { color: var(--muted); padding: 24px; }

/* ---------- таблицы ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12.5px; color: var(--muted); font-weight: 600; background: #f7f9fb; padding: 9px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
.tbl td { padding: 9px 10px; border-bottom: 1px solid var(--line2); vertical-align: middle; }
.tbl th.num, .tbl td.num { text-align: right; }
.tbl tr.click { cursor: pointer; }
.tbl tr.click:hover td { background: #f6f9ff; }
.tbl tr.done td { color: var(--muted); }
.tbl tr.ready td { background: #f0faf5; }
.tbl tr.sub td { background: #fafbfd; padding: 0; }
.tbl input, .tbl select { min-height: 36px; padding: 6px 8px; }
.res-btn { font: inherit; font-weight: 600; color: var(--accent); background: var(--accent-bg); border: 1px solid #c7d8f7; border-radius: 6px; padding: 1px 8px; cursor: pointer; font-variant-numeric: tabular-nums; }
.flag { font-size: 16px; font-weight: 700; }
.f-ready { color: var(--ok); } .f-work { color: #e08a00; } .f-wait { color: #9aa5b5; } .f-none { color: #c4cad3; }
.sub-list { padding: 8px 14px 12px; }
.sub-list div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--line2); }
.totals { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px 28px; padding: 14px 20px; border-top: 1px solid var(--line); background: #fafbfd; }
.order-lines td.name { min-width: 280px; }
.order-lines input.qty, .order-lines input.price { text-align: right; width: 110px; }
.order-lines .free { font-size: 13px; }

/* ---------- печать заказ-нарядов открывается отдельной страницей ---------- */

/* ---------- вход ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 28px; width: 100%; max-width: 380px; display: grid; gap: 12px; }
.brand-big { font-size: 22px; font-weight: 700; }
.login-card p { margin: 0; }
.g-btn { min-height: 44px; }

/* ---------- показать/скрыть по ширине ---------- */
.show-mobile, .show-mobile-inline { display: none !important; }

/* ---------- телефон ---------- */
@media (max-width: 900px) {
  body { font-size: 16px; }
  input, select, textarea { font-size: 16px; } /* iOS не увеличивает страницу при вводе */
  .shell { display: block; }
  .topbar { display: flex; align-items: center; gap: 6px; position: sticky; top: 0; z-index: 30; background: var(--nav); color: #fff; padding: 4px 8px; padding-top: max(4px, env(safe-area-inset-top)); }
  .top-title { font-weight: 600; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; width: 280px; height: 100%; transform: translateX(-100%); transition: transform .2s; }
  .nav.open { transform: none; box-shadow: 4px 0 24px rgba(0,0,0,.3); }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; }
  .view { padding: 14px 12px 96px; }
  h1 { font-size: 19px; }
  .card { padding: 14px; }
  .fields { grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .fields .span2 { grid-column: 1 / -1; }
  .cols, .cols.settings { grid-template-columns: 1fr; }
  /* таблица-список -> карточки */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 1px solid var(--line); padding: 10px 12px; }
  table.stack td { border: none; padding: 3px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  table.stack td::before { content: attr(data-l); color: var(--muted); font-size: 13px; text-align: left; flex: none; }
  table.stack td.main { display: block; font-weight: 600; font-size: 16px; text-align: left; white-space: normal; }
  table.stack td.main::before { content: none; }
  table.stack td:empty { display: none; }
  table.stack tr.sub td::before { content: none; }
  /* строка заказа на телефоне: наименование во всю ширину, ниже кол-во и цена рядом, под ними мелко ЕИ/сумма/свободно */
  table.order-lines.stack tr[data-i] { display: grid; grid-template-columns: 1fr 1fr 1fr 44px; gap: 6px 10px; align-items: end;
    grid-template-areas: "name name name del" "qty qty price price" "unit sum free free" "ship ship ship ship"; }
  table.order-lines.stack tr[data-i] td { display: block; padding: 0; text-align: left; font-size: 14px; }
  table.order-lines.stack tr[data-i] td::before { display: block; font-size: 12px; margin-bottom: 2px; }
  table.order-lines.stack tr[data-i] td.c-no { display: none; }
  table.order-lines.stack tr[data-i] td.name { grid-area: name; min-width: 0; font-size: inherit; }
  table.order-lines.stack tr[data-i] td.c-del { grid-area: del; }
  table.order-lines.stack tr[data-i] td.c-qty { grid-area: qty; }
  table.order-lines.stack tr[data-i] td.c-price { grid-area: price; }
  table.order-lines.stack tr[data-i] td.c-unit { grid-area: unit; }
  table.order-lines.stack tr[data-i] td.c-sum { grid-area: sum; }
  table.order-lines.stack tr[data-i] td.c-free { grid-area: free; }
  table.order-lines.stack tr[data-i] td.c-ship { grid-area: ship; }
  table.order-lines.stack tr[data-i] td.c-ship:empty { display: none; }
  .order-lines input.qty, .order-lines input.price { width: 100%; text-align: right; }
  table.stack td.name { display: block; text-align: left; }
  table.stack td.name::before { display: block; margin-bottom: 4px; }
  .sticky-actions .menu-list { top: auto; bottom: calc(100% + 4px); }
  .sticky-actions .btn { padding: 9px 10px; }
  .sticky-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: #fff; border-top: 1px solid var(--line); padding: 8px 12px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .sticky-actions .btn { flex: 1 1 auto; }
  .sticky-actions .btn.dots { flex: 0 0 auto; }
  /* кнопки действий в карточке-строке списка */
  table.stack td.acts { display: block; width: 100%; padding-top: 8px; }
  table.stack td.acts::before { content: none; }
  .row-acts { justify-content: flex-start; }
  .sub-list.comp { padding-left: 12px; }
  .tbl.stack td.opt:empty { display: none; }
  .drag { font-size: 22px; padding: 8px 12px 8px 4px; margin: -8px 2px -8px -4px; } /* под палец */
  .row-acts .btn.small { min-height: 36px; padding: 6px 14px; font-size: 14px; }
  /* окно на телефоне — снизу во всю ширину */
  .modal-back { padding: 0; align-items: flex-end; }
  .modal { max-width: none; border-radius: 14px 14px 0 0; max-height: 92vh; overflow-y: auto; }
  .modal-body { padding: 4px 14px calc(16px + env(safe-area-inset-bottom)); }
  .combo-opt { padding: 11px 10px; font-size: 15px; }
  .pop-menu button { padding: 12px 14px; }
  .totals { justify-content: flex-start; }
  .hide-mobile { display: none !important; }
  .show-mobile { display: flex !important; }
  .show-mobile-inline { display: inline !important; }
}
@media (max-width: 340px) {
  .fields { grid-template-columns: 1fr; }
}
/* обращения: картинки и статусы */
.fb-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.fb-img { position: relative; display: inline-block; }
.fb-img img { height: 84px; max-width: 160px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.fb-img .btn { position: absolute; top: 2px; right: 2px; padding: 0 6px; }
.fb-text { white-space: pre-wrap; margin-top: 8px; }
.card-pad { padding: 14px 20px 10px; }
.pack-text { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.5; margin: 0 0 10px; padding: 12px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); }
.fb-st { font-size: 13px; padding: 2px 10px; border-radius: 12px; background: var(--warn-bg); }
.fb-st.fb-done { background: var(--ok-bg); } .fb-st.fb-rejected { background: var(--err-bg); }
.pack-set { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 24px; align-items: start; }
.pack-tbl { margin: 6px 0 8px; } .pack-tbl input { width: 100%; min-width: 0; }
.pack-n { margin-bottom: 10px; } .pack-n input { display: block; width: 120px; max-width: 100%; }
