[hidden]{display:none !important}
:root{--gap-sep:22px;
  
  --bg:#FFFFFF; --panel:#F7F7F9; --card:#FFFFFF; --ink:#17171A; --muted:#6B6F78; --line:#EEEFF2;
  --accent:#F56F10; --accent-dark:#DD5F06; --accent-soft:#FCE5D4;
  --accent-btn:#EA6508;
  /* семантика: цвет только там, где он что-то значит; у каждого — текст на мягкой подложке ≥4.5:1 */
  --green:#1A7F3C; --green-soft:#EAF7EF; --red:#C0281C; --red-soft:#FDECEB;
  --warn:#92580A; --warn-soft:#FDF1DC; --info:#2557C7; --info-soft:#EAF0FF;
  --chip:#EEF0F3; --chip-ink:#4B4F57;
  /* поверхности админки: серая страница, белые карточки без рамки */
  --page:#F4F5F7; --r-card:16px;
  --shadow-card:0 1px 2px rgba(16,24,40,.04), 0 4px 14px rgba(16,24,40,.05);
  --dark:#262626; --dark2:#393939; --r:10px;
  --shadow:0 4px 4px rgba(0,0,0,.05), 0 4px 3px rgba(0,0,0,.04);
  --shadow-lg:0 4px 20px rgba(0,0,0,.05);
}
*{box-sizing:border-box;margin:0;padding:0}
html{-webkit-text-size-adjust:100%}
body{font-family:'Manrope',system-ui,sans-serif;background:var(--bg);color:var(--ink);
  font-size:14px;line-height:1.45;min-height:100dvh}
a{color:inherit;text-decoration:none}
.hchip{display:inline-block;background:var(--chip);color:var(--ink);
  border-radius:8px;padding:1px 9px;font-size:.92em;vertical-align:baseline}
.alink{color:var(--accent-dark);font-weight:700}
.alink:hover{color:var(--accent)}
.wrap a:not([class]),.pos-wrap a:not([class]){color:var(--accent-dark);font-weight:700}
.wrap a:not([class]):hover,.pos-wrap a:not([class]):hover{color:var(--accent)}
.wrap td a:not([class]),.pos-wrap td a:not([class]){color:inherit;font-weight:inherit}
button{font:inherit;cursor:pointer;color:inherit;touch-action:manipulation}
html{touch-action:pan-x pan-y}
a,.btn,summary,label,input[type=checkbox],input[type=radio]{touch-action:manipulation}
.btn:active,button.qtybtn:active,.cat-chip:active{transform:scale(.97)}
@media(prefers-reduced-motion:reduce){.btn:active,button.qtybtn:active,.cat-chip:active{transform:none}}
input,select,textarea{font:inherit;color:var(--ink);background:#fff;border:1px solid var(--line);
  border-radius:8px;padding:9px 12px;min-height:44px;width:100%}
/* 16px не даёт iOS Safari зумить страницу при фокусе на поле */
input,select,textarea{font-size:16px}
input[type=datetime-local]{min-width:215px}
input:focus,select:focus,textarea:focus{outline:2px solid var(--accent);outline-offset:0;border-color:var(--accent)}
input[type=checkbox],input[type=radio]{width:18px;height:18px;min-height:0;padding:0;flex:none;
  accent-color:var(--accent);cursor:pointer}
input[type=checkbox]:focus-visible,input[type=radio]:focus-visible{outline:2px solid var(--accent);
  outline-offset:2px}
label{display:block;font-size:13px;font-weight:600;color:var(--muted);margin:0 0 4px}
.field{margin-bottom:12px}
.frowmb{margin-bottom:12px}
.num{font-variant-numeric:tabular-nums}

/* топбар */
.topbar{background:var(--dark);color:#fff;position:sticky;top:0;z-index:100;box-shadow:var(--shadow-lg);
  padding-top:env(safe-area-inset-top)}
.topbar-in{display:flex;align-items:center;gap:6px;padding:0 16px 0 10px;
  min-height:64px;overflow-x:auto;-webkit-overflow-scrolling:touch}
.subnav{display:flex;gap:2px;background:#fff;padding:0 16px;overflow-x:auto;
  scrollbar-width:none;border-bottom:1px solid var(--line)}
.subnav::-webkit-scrollbar{display:none}
.subnav a{flex:none;padding:11px 12px 10px;font-size:14px;font-weight:600;color:var(--muted);
  white-space:nowrap;border-bottom:3px solid transparent;margin-bottom:-1px}
.subnav a:hover{color:var(--ink)}
.subnav a.on{color:var(--ink);font-weight:700;border-bottom-color:var(--accent)}
@media(max-width:700px){.subnav{display:none}}
/* вкладки листа, оставшиеся ради телефона (CRM, справочник): на широком экране их
   заменяет полоса подразделов */
.tabs.mobonly{display:none}
@media(max-width:700px){.tabs.mobonly{display:flex}}
@media(max-width:1120px){
  .topbar-in > .shell-switch{margin-left:auto}
  .shell-switch + .topuser{margin-left:0}
  .topnav a{margin:2px 0;padding:8px 12px;min-height:40px}
  .topuser span span:last-child{display:none}
}

.logo{font-weight:800;font-size:15px;white-space:nowrap;padding:14px 8px 14px 0;letter-spacing:.2px}
.logo b{color:var(--accent)}
.brandcol{display:flex;flex-direction:column;align-items:center;gap:3px;padding:4px 4px 4px 0}
.brandcol .logo{padding:0}
.topshift{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:600;
  letter-spacing:.3px;text-transform:uppercase;color:rgba(255,255,255,.6);text-decoration:none;
  white-space:nowrap;line-height:1}
.topshift:hover{color:#fff}
.topshift i{width:6px;height:6px;border-radius:50%;background:var(--green);display:block}
.topshift.off i{background:var(--red)}
/* смену забыли закрыть (SHIFT_MAX_H): не «открыта» и не «закрыта», а отдельное состояние */
.topshift.stale{color:#F2B26B}
.topshift.stale i{background:#e0a052}
.topnav{display:flex;gap:2px}
.topnav{gap:4px;align-items:center}
.topnav a{padding:10px 16px;margin:10px 0;color:rgba(255,255,255,.66);font-weight:500;font-size:14px;
  white-space:nowrap;border-radius:10px;min-height:44px;display:flex;align-items:center}
.topnav a:hover{color:#fff;background:rgba(255,255,255,.06)}
.topnav a.on{color:#fff;background:var(--dark2)}
.shell-switch{display:inline-flex;align-items:center;gap:8px;margin-left:auto;
  color:#fff;font-weight:700;font-size:14px;border:1px solid rgba(255,255,255,.25);
  border-radius:12px;padding:9px 14px;min-height:44px;white-space:nowrap}
.shell-switch:hover{background:rgba(255,255,255,.08);border-color:rgba(255,255,255,.45)}
.shell-switch svg{width:18px;height:18px}
.shell-switch + .topuser{margin-left:14px}
@media(max-width:640px){.shell-switch span{display:none}.shell-switch{padding:9px 11px}}
@media(max-width:600px){
  .topbar-in{padding:0 8px 0 6px}
  .umenu.logomenu summary{padding-left:0}
  .logo .lbt{display:none}
  .brandcol{padding:6px 8px 6px 0}
  .topshift{font-size:10px}
  .topbar .topuser{gap:6px}
  .topbar .topuser>a,.topbar .topuser .bugbtn{padding:7px 9px}
  .topbar .topuser>a{min-width:37px;justify-content:center;box-sizing:border-box}
  .topbar .shell-switch{padding:8px 10px;position:relative}
  .topbar .shell-switch+.topuser{margin-left:0}  /* зазор даёт gap самой шапки */
  .topuser .lb{display:none}
  .topuser span{display:none}
  .topuser img{width:30px;height:30px}
}
.topuser a,.topuser .bugbtn{border:1px solid rgba(255,255,255,.25);border-radius:10px;
  padding:8px 12px;min-height:40px;display:inline-flex;align-items:center;gap:6px;
  color:rgba(255,255,255,.85);font-size:13px;font-weight:600}
.topuser a:hover,.topuser .bugbtn:hover{background:rgba(255,255,255,.08);color:#fff;
  border-color:rgba(255,255,255,.45)}
.topuser{margin-left:auto;display:flex;align-items:center;gap:8px;white-space:nowrap;
  color:rgba(255,255,255,.65);font-size:13px}

/* layout */
/* имя гостя приходит из кабинета: одно слово в 60 символов раздвигало карточку шире
   экрана и уносило вбок всю страницу зала */
.card,.chk-line,.pos-top{overflow-wrap:anywhere}
/* ...но не в кнопках: там нет чужого текста, зато «Наличные» ломалось на «Нали/чные» */
.card button,.card .btn,.pos-top button,.pos-top a{overflow-wrap:normal}
.card > summary{overflow-wrap:normal;flex-wrap:wrap}
.tscroll table td,.tscroll table th{overflow-wrap:normal}
.tscroll table td.num,.tscroll table th.num,.tscroll table td.r,.tscroll table th.r{white-space:nowrap}
.wrap{max-width:1880px;margin:0 auto;padding:20px 16px 48px}
body{--th-top:64px}
.pagehead{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:16px}
h1{font-size:20px;font-weight:800}
h2{font-size:15px;font-weight:700;margin-bottom:8px}
.sub{color:var(--muted);font-size:13px}
.tabs{display:flex;gap:4px;background:var(--panel);border-radius:12px;padding:4px;flex-wrap:wrap}
.tabs a{padding:8px 16px;border-radius:9px;font-weight:600;font-size:14px;color:var(--muted);
  min-height:38px;display:flex;align-items:center}
.tabs a.on{background:#fff;color:var(--ink);box-shadow:var(--shadow)}
.pagehead:has(> .backslot) > .backslot{order:-3;display:inline-flex;align-items:center}
.pagehead:has(> .backslot) > .tabs{order:-2}
.pagehead:has(> .backslot) > .phbr{order:-1}
.pagehead:not(.bkinline):not(:has(> .tabs)) > .backslot{flex:1 0 100%}
.pagehead:not(.bkinline):not(:has(> .tabs)) > .phbr{display:none}
.pagehead:not(.bkinline):not(:has(> .tabs)) .backbtn{min-height:36px;padding:5px 12px 5px 9px}
@media(min-width:641px){
  .pagehead:has(> .tabs:not(.tabs-mob):not(.mobonly)) > .backslot{min-width:156px}
  .pagehead:has(> .tabs:not(.tabs-mob):not(.mobonly)):not(:has(> .backslot)) > h1{flex:0 0 156px;max-width:156px;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}
.spacer{flex:1}
.pagehead-search{flex:1;max-width:420px}
.perchips{display:flex;gap:6px;flex-wrap:wrap}
.perchip{min-height:38px;padding:0 12px;border-radius:10px;border:1px solid var(--line);
  background:#fff;color:var(--muted);font:inherit;font-size:13px;font-weight:600;white-space:nowrap}
.perchip:hover{color:var(--ink)}
a.perchip{display:inline-flex;align-items:center;text-decoration:none}
.perchip.on{background:var(--accent-soft);border-color:var(--accent);color:var(--accent-dark)}
.perline{display:flex;gap:4px;align-items:center}
.perstep{min-height:44px;padding:0 10px;font-size:16px;line-height:1;color:var(--muted)}
.perstep:hover{color:var(--accent-dark);border-color:var(--accent)}
.persel{position:relative}
.persel>summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;
  justify-content:center;white-space:nowrap;min-height:44px}
.persel>summary::-webkit-details-marker{display:none}
.persel>summary::marker{content:''}
.persel[open]>summary{border-color:var(--accent);color:var(--accent-dark)}
.persel-box{position:absolute;z-index:60;top:calc(100% + 6px);left:0;
  background:#fff;border:1px solid var(--line);border-radius:12px;padding:10px;
  box-shadow:var(--shadow-lg);display:flex;flex-direction:column;gap:10px;
  max-width:min(92vw, 420px)}
.persel-box .perchips{flex-wrap:wrap}
.perown-box{display:flex;gap:10px}
.perown-box label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted);
  font-weight:600;white-space:nowrap}
.perown-box input{min-height:38px}
@media(max-width:520px){.perown-box{flex-direction:column}}
/* четыре чипа стоят одной строкой: в две они читаются как два разных фильтра.
   Ширину берём по содержимому — подписи в разных языках разной длины */
.perchips{flex-wrap:nowrap}
.field.per,.frow .field.per{flex:0 0 auto;min-width:max-content;order:-1}
@media(max-width:700px){
  .field.per,.frow .field.per{flex:1 0 100%;min-width:0}
  .perchips{flex-wrap:wrap}
}
@media(max-width:700px){
  .pagehead{gap:10px}
  .pagehead h1{font-size:20px}
  .pagehead.docph > h1{font-size:16px}
  .pagehead > form:not(.op-pin-form),
  .pagehead > .frow{width:100%;flex:1 0 100%;max-width:none}
  .pagehead > .spacer{display:none}
  .pagehead > form.phpre,
  .pagehead > form.opst-f,
  .pagehead > form.covers-f{width:auto;flex:none}
  .pagehead.cardph > .headbtns{width:auto;flex:none;margin-left:auto}
  .pagehead.cardph > h1.gname{flex:1 1 0;min-width:0}
  .pagehead.payph > .opnum > .opdt{flex:0 1 auto;order:1}
  .pagehead.payph > .badge{font-size:11px;padding:3px 8px;min-width:0;order:2}
  .pagehead.payph > .headbtns{order:3}
  .pagehead.payph > .paylink{order:4;flex:1 0 100%;font-size:13px}
  /* «от» и широкое поле не оставляли места кнопке — подпись убираем, поле ужимаем:
     значок календаря и так говорит, что это дата */
  .pagehead.payph > .opnum > .opdt > span{display:none}
  .pagehead.payph .opnum input[type=datetime-local]{font-size:14px;width:auto;max-width:186px;
    padding-left:24px;padding-right:2px;background-size:13px;background-position:6px center}
  .pagehead.cardph > .headbtns > .btn{flex:none}
  .pagehead > .headbtns{flex-wrap:wrap!important;width:100%}
  .pagehead > .headbtns > .btn{white-space:nowrap;flex:1 1 auto}
  .pagehead > button.btn, .pagehead > .op-pin-form{order:10}
}
.backbtn{display:inline-flex;align-items:center;gap:7px;min-height:46px;padding:8px 14px 8px 11px;
  border-radius:12px;background:var(--panel);color:var(--muted);font-weight:600;font-size:14px;
  white-space:nowrap}
.backbtn:hover{color:var(--ink)}
.backbtn.xclose::before{display:none}
.backbtn::before{content:"";flex:0 0 auto;width:14px;height:14px;background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 5l-7 7 7 7'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 5l-7 7 7 7'/%3E%3C/svg%3E") center/contain no-repeat}
th.col-num{width:50px;min-width:50px;max-width:50px;white-space:nowrap}
th.bulk-c,td.bulk-c{width:32px;min-width:32px;max-width:32px;padding-left:0;padding-right:0;text-align:center;vertical-align:middle}
.bulk-c input[type=checkbox]{width:16px;height:16px;min-height:0;margin:0;display:block;margin-inline:auto}
th.bulk-c label{min-height:0!important;height:100%}
th.bulk-c{vertical-align:middle}
th.col-time{width:64px;min-width:64px;max-width:64px}
/* та же ширина в обычных таблицах (смены, ПКО, X-отчёт): там ширину не тянут мышью,
   но автораскладка всё равно раздувала колонку под заголовок */
th[data-c="time"]{width:64px;min-width:64px;max-width:64px}
th.col-time,th[data-c="time"],td[data-c="time"]{white-space:nowrap}
.pagehead .phbr,.st-head .phbr{flex:1 0 100%;height:0;margin:0}
.pagehead>.phbr.phbr-sm{display:none}
.pagehead.bkinline>.phbr{display:none}
.pagehead.bkinline>.backslot{margin-right:6px}
.backbtn span{font-size:15px;line-height:1}

/* карточки и сетки */
.card{background:var(--card);border-radius:var(--r);border:1px solid var(--line);box-shadow:var(--shadow);padding:16px;margin-bottom:14px}
@media(min-width:1100px){
  body[data-sec="refs"] .card{padding:12px}
  body[data-sec="refs"] .card .field{margin-bottom:8px}
  body[data-sec="refs"] .card h2{margin-bottom:8px}
  body[data-sec="refs"] .card input:not([type=checkbox]):not([type=radio]),
  body[data-sec="refs"] .card select,
  body[data-sec="refs"] .card textarea{min-height:34px;padding:5px 10px;font-size:14px}
  /* у select своя внутренняя высота: min-height его не ужимает (WebKit) */
  body[data-sec="refs"] .card select:not([multiple]){height:34px}
  body[data-sec="refs"] .card td,body[data-sec="refs"] .card th{padding-top:5px;padding-bottom:5px}
  body[data-sec="refs"] .card .frowmb,
  body[data-sec="company"] .card .frowmb{margin-bottom:8px}
  body[data-sec="refs"] .card label{margin-bottom:2px}
  body[data-sec="refs"] .card h2 .btn{min-height:32px;padding:5px 12px}
  body[data-sec="refs"] .card{margin-bottom:10px}
  body[data-sec="refs"] .istats .stat{padding:11px 14px}
  /* нижний воздух страницы держит место под панель разделов — на широком экране
     панели нет, и он только выталкивал карточку за край */
  body[data-sec="refs"] .wrap{padding-bottom:20px}
}
.cards{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));margin-bottom:16px}
.stat{background:var(--card);border-radius:var(--r);border:1px solid var(--line);box-shadow:var(--shadow);padding:18px 20px;position:relative}
.stat .ico{position:absolute;top:14px;right:16px;width:34px;height:34px;border-radius:10px;
  background:var(--accent-soft);color:var(--accent-dark);display:flex;align-items:center;justify-content:center}
.stat .ico svg{width:18px;height:18px}
.stat .foot{margin:14px -20px -18px;margin-top:auto;padding:9px 20px;border-top:1px solid var(--line);
  background:var(--panel);border-radius:0 0 var(--r) var(--r);display:flex;justify-content:space-between;
  align-items:center;font-size:13px;font-weight:600;color:var(--muted)}
.stat .foot .go{width:25px;height:25px;border-radius:99px;border:1px solid var(--line);background:#fff;
  display:flex;align-items:center;justify-content:center;color:var(--ink)}
.stat .foot .go svg{width:11px;height:11px}
a.stat,.stat:has(>a.foot){display:flex;flex-direction:column}
a.stat:hover .foot,.stat a.foot:hover{color:var(--ink)}
.stat .v{padding-bottom:12px}

.totbar{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 16px;margin-bottom:12px;
  padding:12px 16px;background:var(--card);border:1px solid var(--line);border-radius:var(--r);
  box-shadow:var(--shadow);font-size:14px;color:var(--muted)}
.totbar b{color:var(--ink);font-weight:700}
.totbar .net b{font-size:16px}
.totbar .neg{color:var(--red)}
.totbar .th{display:flex;align-items:baseline;gap:10px}
@media(max-width:700px){
  .totbar{display:grid;gap:7px;padding:12px 14px}
  .totbar > *{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
  .totbar .net{border-top:1px solid var(--line);padding-top:9px}
  /* фильтр кончается линией под итогом или над списком, без белого воздуха */
  form.mfilt:has(+ .totbar),form.mfilt:has(+ .doccards),form.mfilt:has(+ .tscroll){margin-bottom:6px!important}
  .totbar{margin-bottom:0}
}
.chip{display:inline-flex;align-items:center;gap:8px;background:var(--panel);border-radius:99px;
  padding:7px 16px;font-size:13px;font-weight:600}
.chip .dot{width:8px;height:8px;border-radius:99px;background:var(--accent)}
/* 2112: подпись и крупное число — одна пара; унаследованный line-height 1.45 давал ~13px воздуха между ними */
.stat .v{font-size:24px;font-weight:700;margin-top:3px;letter-spacing:-.02em;line-height:1.15}
.stat .l{font-size:13px;font-weight:500;color:var(--muted);line-height:1.3}
.stat.hi{background:var(--dark);color:#fff;border-color:var(--dark)}
.stat.hi .l{color:rgba(255,255,255,.62)}
.stat.hi .v{color:var(--accent)}
.stat.hi .sub{color:rgba(255,255,255,.6)}
.stat.hi .sub .pos{color:#4ADE80}
.grid2{display:grid;gap:16px;grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
@media(max-width:900px){.grid2{grid-template-columns:minmax(0,1fr)}}

/* таблицы */
.tscroll{overflow:visible}
.tscroll.has-x{overflow-x:auto}
.tscroll.has-x:has(table[data-resizable]){overflow:auto;max-height:calc(100vh - 190px)}
table{width:auto;max-width:100%;border-collapse:collapse;font-size:13px}
.grid2 table,.refsplit table{width:100%}
#lines,#edlines,#invlines,#plGrid{width:100%}
table[data-resizable]{width:100%;max-width:none}
/* колонки уже тянули руками — таблица снова живёт на всю ширину, как до правки 1246:
   ширины считает sort.js от неё, и «по содержимому» ломало бы сохранённую настройку */
table[data-cw-fixed]{width:100%;max-width:none}
/* шапка таблицы остаётся видной при прокрутке длинных списков (остатки, обороты, товары).
   64px — высота липкого топбара, иначе заголовки уезжают под него. */
th{font-size:12px;text-transform:none;color:var(--muted);font-weight:700;text-align:left;
  padding:6px 10px;border-bottom:1px solid var(--line);white-space:nowrap;
  position:sticky;top:var(--th-top,0);z-index:5;background:#fff;
  box-shadow:inset 0 -1px 0 var(--line)}
/* контейнер сам стал прокруткой — шапка липнет к его верху, отступ под топбар лишний */
.tscroll.has-x th{top:0}
.bulkbar ~ * th,.bulkbar ~ table th{top:calc(var(--th-top,0px) + var(--bulk-h,0px))}
.bulkbar ~ .tscroll.has-x th{top:0}
body .ipk-back th, body dialog th{top:0}
.card th{background:#fff}
table[data-nosticky] th{position:relative;top:auto}
.plwrap{max-height:calc(100vh - 240px);overflow:auto}
.plwrap table[data-nosticky] th{position:sticky;top:0;z-index:6}
@media(max-width:700px){.plwrap{max-height:calc(100vh - 210px)}}  /* relative, не static: ручкам .c-grip нужен позиционированный th, иначе они съезжают к краю страницы и дают 3px горизонтальной прокрутки */
td{padding:5px 10px;border-bottom:1px solid var(--line);vertical-align:middle}
tr:last-child td{border-bottom:0}
tr.rowlink{cursor:pointer}
tr.rowlink:hover{background:var(--chip)}
.wrap table tr:hover>td{background:var(--chip)}
.pagehead form.postchk,.pagehead span.postchk{margin-top:0}
.pagehead form.postchk label.chk,.pagehead span.postchk label.chk{display:inline-flex;align-items:center;gap:7px;
  min-height:0;margin:0;font-size:14px;line-height:1}
.pagehead form.postchk input[type=checkbox],.pagehead span.postchk input[type=checkbox]{margin:0;flex:none}
.cf-matrix tr:hover td{background:rgba(245,111,16,.09)}
.money-hl tr:hover td{background:var(--panel)}
td.r,th.r{text-align:right}
.pos{color:var(--green);font-weight:700}
.neg{color:var(--red);font-weight:700}

.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--accent-btn);
  color:#fff;font-weight:600;border:0;border-radius:10px;padding:10px 18px;min-height:42px;font-size:14px}
.btn:hover{background:#D45C06}
.btn:active{background:#F56F10}
.btn:disabled{background:#E4E1DC;color:var(--muted);cursor:default;box-shadow:none}
.btn.ghost{background:#fff;color:var(--ink);border:1px solid var(--line)}
.btn.ghost:hover{border-color:#C9CCD2;background:var(--panel)}
.btn.danger{background:var(--red)}
/* четвёртый порядок: действие есть, но не зовёт — текстом, без рамки и заливки */
.btn.tert{background:none;border:0;color:var(--muted);text-decoration:underline;text-underline-offset:3px;box-shadow:none}
.xbtn{width:44px;height:44px;min-height:44px;padding:0;border:0;background:none;cursor:pointer;
  border-radius:12px;color:var(--accent);display:inline-flex;align-items:center;
  justify-content:center;flex:none;transition:background .16s cubic-bezier(.23,1,.32,1)}
.xbtn svg{width:18px;height:18px}
.xbtn:hover{background:var(--accent-soft)}
.xbtn:active{transform:scale(.94)}
.xbtn.plus{width:30px;height:30px;min-height:30px;border-radius:8px}
#lines td,#edlines td,#invlines td,#plGrid td{padding:3px 6px;vertical-align:middle}
#lines .xbtn.plus,#edlines .xbtn.plus,#invlines .xbtn.plus,#plGrid .xbtn.plus{vertical-align:middle}
#lines td.rownum,#edlines td.rownum,#invlines td.rownum,#plGrid td.rownum{text-align:center}
#lines tr:first-child th:first-child,#edlines tr:first-child th:first-child,#plGrid tr:first-child th:first-child{text-align:center}
#lines tr:has(.plus) .xbtn.del,#edlines tr:has(.plus) .xbtn.del,#invlines tr:has(.plus) .xbtn.del,#plGrid tr:has(.plus) .xbtn.del{display:none}
/* пустая строка дышит — не липнет к разделительной линии */
#lines tr:has(.plus) td,#edlines tr:has(.plus) td,#invlines tr:has(.plus) td,#plGrid tr:has(.plus) td{
  padding-top:9px;padding-bottom:8px}
#lines input,#edlines input,#invlines input,#plGrid input,
#lines td select,#edlines td select,#invlines td select,#plGrid td select{
  min-height:32px;height:32px;padding:4px 8px;font-size:13px}
#lines .xbtn.del,#edlines .xbtn.del,#invlines .xbtn.del,#plGrid .xbtn.del{width:30px;height:30px;min-height:30px}
.rownum{cursor:pointer;user-select:none;white-space:nowrap}
tr.rowsel td{background:var(--accent-soft, #FCE5D4)}
td.rownum:hover{color:var(--accent)}
.covers-inp::-webkit-inner-spin-button{opacity:1}
.rowmenu-box{position:absolute;z-index:230;background:#fff;border:1px solid var(--line);
  border-radius:10px;box-shadow:0 10px 30px -8px rgba(0,0,0,.25);padding:4px;min-width:160px;
  display:flex;flex-direction:column}
.rowmenu-box button{border:0;background:none;font:inherit;font-size:14px;text-align:left;
  padding:8px 12px;border-radius:7px;cursor:pointer}
.rowmenu-box button:hover{background:var(--bg)}
.rowmenu-box button.danger{color:var(--red)}
.xbtn.del{color:var(--red);width:30px;height:30px;min-height:30px;padding:0}
.xbtn.del svg{width:16px;height:16px}
.xbtn.del:hover{background:var(--red-soft)}
.ihelp{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;margin-right:5px;
  border:1px solid var(--muted);border-radius:50%;font:italic 700 10px/1 Georgia,serif;color:var(--muted);
  cursor:help;vertical-align:-1px}
.ihelp:hover{border-color:var(--accent);color:var(--accent)}
.calcsum-hint{margin-top:4px;font-weight:700;color:var(--accent-dark)}
.calcsum-keys{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}
.calcsum-keys .cat-chip{min-width:44px;min-height:44px;font-size:18px;padding:0 10px}
@media(min-width:701px){.calcsum-keys{display:none}}
.pullbar{position:fixed;left:0;right:0;top:0;z-index:400;height:0;display:flex;
  justify-content:center;pointer-events:none;opacity:0;transition:opacity .15s}
.pullbar.on{opacity:1}
.pullbar__i{width:30px;height:30px;margin-top:8px;border-radius:50%;background:#fff;
  box-shadow:var(--shadow-lg);position:relative}
.pullbar__i::before{content:'';position:absolute;inset:8px;border-radius:50%;
  border:2px solid var(--line);border-top-color:var(--accent)}
.pullbar.ready .pullbar__i::before{border-color:var(--accent)}
.pullbar.go .pullbar__i::before{animation:pullspin .7s linear infinite}
@keyframes pullspin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.pullbar.go .pullbar__i::before{animation-duration:2s}}
@media(prefers-reduced-motion:reduce){.xbtn{transition-duration:.01ms}}
.btn.ghost.mark{border-color:var(--accent);color:var(--accent-dark);font-weight:700}
.btn.ghost.ink{border-color:var(--ink)}
/* второй порядок (2160): оранжевая рамка без заливки — после залитой оранжевой, раньше ghost ink и ghost */
.btn.ghost.acc{border-color:var(--accent);color:var(--accent-dark,#C05207)}
.btn.ghost.acc:hover{background:var(--accent-soft)}
.btn.ghost.mark:hover{background:#F9D3B8;border-color:var(--accent-dark)}
.btn.ghost.sel{background:var(--accent-soft);border-color:transparent;color:var(--accent-dark);font-weight:700}
.btn.ghost.sel:hover{border-color:var(--accent)}
.btn.danger.sm{background:#fff;color:var(--red);border:1px solid #EDBFBC}
.btn.danger.sm:hover{background:var(--red-soft);border-color:var(--red)}
.btn.sm{min-height:44px;padding:8px 14px;font-size:14px;border-radius:9px}
.btn.big{min-height:54px;font-size:16px;width:100%}
.badge{display:inline-block;padding:3px 10px;border-radius:99px;font-size:12px;font-weight:600}
.badge.green{background:var(--green-soft);color:var(--green)}
.badge.red{background:var(--red-soft);color:var(--red)}
.badge.opst{min-width:88px;text-align:center}
h1 .draftmark{position:absolute;left:0;top:calc(50% + 13px);font-size:12px;font-weight:500;
  font-style:italic;color:var(--muted);line-height:1;background:#EEF0F3;border-radius:6px;
  padding:3px 7px;white-space:nowrap}
/* на телефоне следующая строка шапки стоит вплотную — плашке нужно своё место */
@media(max-width:700px){.pagehead.docph>h1:has(.draftmark){margin-bottom:16px}}
.pagehead > h1{position:relative}
.opst-f{display:inline-flex;margin:0}
.stmenu > summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:6px;
  min-height:34px;padding:6px 10px;font-size:14px;font-weight:600}
.badge.opst.none{background:#fff;border:1px solid var(--line);color:var(--muted)}
.stmenu > summary::-webkit-details-marker{display:none}
.stmenu > summary svg{width:13px;height:13px;opacity:.65}
.stopts{min-width:190px;padding:6px}
.stopt{display:flex;align-items:center;gap:9px;width:100%;background:none;border:0;
  padding:8px 10px;border-radius:8px;font-size:14px;color:var(--ink);cursor:pointer;
  text-align:left;text-decoration:none;min-height:0}
.stopt:hover{background:var(--panel)}
.stopt.stcfg{border-top:1px solid var(--line);border-radius:0 0 8px 8px;margin-top:6px;
  padding-top:10px;color:var(--muted)}
.stdot{width:14px;height:14px;border-radius:4px;flex:none}
.stdot.gray{background:#E4E6EA}.stdot.orange{background:#F9A870}
.stdot.green{background:var(--green)}.stdot.lime{background:#A8D66A}
.stdot.red{background:#F08A8A}.stdot.blue{background:#7FA6F2}
.stdot.violet{background:#B79BEC}.stdot.yellow{background:#F2D177}
.stdot.teal{background:#7FCFCF}
@media(max-width:700px){.badge.opst{min-width:0}}

/* формы в строку */
.frow{display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end}
.frow .field{margin-bottom:0;flex:1;min-width:130px}
.frow .field:has(> input[type=datetime-local]){min-width:215px}  /* поле даты не сжимается уже своего input — на iPad 768 в ДДС-корректировках оно вылезало за экран на 34px */
.frow .field.wide{flex:2;min-width:200px}
.opform .field select,.opform .field input{height:44px}
@media(max-width:700px){.opform .field:has(> input.calcsum){flex:1 0 100%;max-width:none}}
.opform .field select{-webkit-appearance:none;appearance:none;padding-right:30px;
  background:#fff no-repeat right 10px center/11px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%236D717F' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M2 4.5l4 4 4-4'/%3E%3C/svg%3E")}
/* кнопка действия и «Отмена» — одной парой: на телефоне «Отмена» иначе срывается
   на свою строку, а просили их рядом */
.opform .field.cmtwide{flex:1 0 100%;max-width:none}
.opform .field.cmtwide textarea{width:100%;box-sizing:border-box;min-height:62px;
  font:inherit;font-size:14px;padding:8px 10px;resize:vertical}
.opbtns{display:flex;gap:10px;flex:none}
@media(min-width:701px){
  .opform .field{max-width:230px}
  .opform .field.wide{max-width:none}
  .opform .field.amt{max-width:140px}
  .opform .field select,.opform .field input{height:38px;min-height:38px}
  .opform .field select,.opform .field input{padding-top:6px;padding-bottom:6px}
  .opform .opbtns .btn{height:38px;min-height:38px}
}
.frow.filters .field{max-width:200px}
.frow.filters .field.cp{max-width:230px}        /* контрагент: имена длиннее селекта */
.frow.filters .field.wide{max-width:none}       /* поиск тянется на весь остаток */
.frow .btn{flex-shrink:0}

/* кипер: зал */
.hall{display:grid;gap:14px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
.tablecard{border-radius:16px;padding:18px 16px;min-height:118px;display:flex;flex-direction:column;
  justify-content:space-between;border:2px solid transparent;transition:transform .12s}
.tablecard:active{transform:scale(.97)}
.tablecard.free{background:var(--green-soft);border-color:#CDE8D8;color:var(--green)}
.tablecard.busy{background:#fff;border-color:var(--accent);box-shadow:var(--shadow)}
.tablecard .tname{font-weight:800;font-size:18px;color:var(--ink)}
.tablecard .tinfo{font-size:13px;font-weight:600}
.tablecard.busy .tinfo{color:var(--accent-dark)}
.tablecard.free .tinfo{color:var(--green)}

/* кипер: зал в две колонки на широких */
.hallgrid{display:grid;gap:16px;grid-template-columns:minmax(0,1fr)}
@media(min-width:1100px){.hallgrid{grid-template-columns:minmax(0,2fr) minmax(0,1fr);align-items:start}}
.leg{display:flex;gap:16px;flex-wrap:wrap;align-items:center;margin-bottom:10px;font-size:13px;font-weight:600;color:var(--muted)}
.leg .d{width:10px;height:10px;border-radius:99px;display:inline-block;margin-right:6px;vertical-align:-1px}

/* кипер: чипы категорий меню (Coca) */
/* одной строкой с прокруткой: десять групп в две строки съедали экран планшета,
   а карточки товара уезжали под сгиб */
.pos-menu > .mb{margin-bottom:12px}
.cat-chips{display:flex;gap:8px;margin-bottom:14px;overflow-x:auto;padding-bottom:2px;
  scrollbar-width:none}
.cat-chips::-webkit-scrollbar{display:none}
.cat-chips>*{flex:none}
.cat-chip{border:1px solid var(--line);background:#fff;border-radius:40px;padding:10px 20px;
  font-weight:600;font-size:14px;min-height:44px;color:var(--muted)}
.cat-chip:active{transform:scale(.97)}
.cat-chip.on{background:var(--accent-btn);border-color:var(--accent-btn);color:#fff;
  box-shadow:0 0 0 4px rgba(245,111,16,.18)}

/* кипер: заказ */
.pos-grid{display:grid;gap:16px;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);align-items:start}
/* именно minmax(0,…): при 1fr колонка растягивается под самый широкий неразрывный
   элемент — строка чипов в одну линию утаскивала всю страницу вбок */
@media(max-width:700px){.pos-grid{grid-template-columns:minmax(0,1fr)}}
.pos-mtabs{display:none}
@media(max-width:700px){
  /* полосу тянем во всю ширину рабочей области и красим фоном страницы: иначе из-под
     липкого переключателя выглядывали строки чека, уезжающие вверх */
  .pos-mtabs{display:flex;gap:6px;position:sticky;top:0;z-index:40;
    margin:0 -12px 12px;padding:12px 12px 12px;background:#F4F5F7}
  .pos-mtabs button{flex:1;min-height:44px;border:0;background:var(--panel);border-radius:11px;
    font:inherit;font-weight:700;font-size:14px;color:var(--muted)}
  .pos-mtabs button.on{background:#fff;color:var(--ink);box-shadow:var(--shadow)}
  .pos-grid.m-menu .pos-check,
  .pos-grid.m-check .pos-menu{display:none}
  .pos-grid #posResizer{display:none}
  /* место под полосу итога и нижнее меню, иначе последняя кнопка меню под ними */
  .pos-grid.m-menu{padding-bottom:64px}
  /* итог и оплата — липкой подошвой над нижним меню: до правки «Наличные» лежали
     под всеми позициями чека, и на длинном чеке до них надо было доскроллить */
  /* подошва не должна съедать экран: на 402×714 она занимала треть, и от списка
     позиций оставалась полоска. Кнопки оплаты — в ряд, итог компактнее */
  .pos-grid.m-check .pos-check__foot .paybtns{grid-template-columns:repeat(2,minmax(0,1fr))}
  .pos-grid.m-check .pos-check__foot .total-row{padding:8px 0 2px;font-size:18px}
  .pos-grid.m-check .pos-check__foot .btn{min-height:46px}
  .pos-grid.m-check .pos-check__foot{position:fixed;left:8px;right:8px;
    bottom:calc(72px + env(safe-area-inset-bottom));z-index:70;margin:0;
    background:var(--card,#fff);border:1px solid var(--line);border-radius:14px;
    padding:10px 16px;box-shadow:0 8px 26px -10px rgba(0,0,0,.35)}
  .pos-grid.m-check .pos-check__body{padding-bottom:8px}
  /* запас = высота полосы (итог + ряд кнопок) плюс само нижнее меню */
  .pos-grid.m-check{padding-bottom:200px}
}
/* полоса итога над нижним меню: одно нажатие — и кассир в чеке */
.docbar{display:none}
@media(max-width:700px){
  .docbar{display:flex;gap:8px;position:fixed;left:8px;right:8px;
    bottom:calc(64px + max(8px, env(safe-area-inset-bottom)));z-index:70;
    padding:8px;border-radius:16px;background:#fff;box-shadow:0 10px 26px -8px rgba(0,0,0,.35)}
  .docbar .btn{flex:1;min-height:46px}
  .docbar{bottom:calc(var(--tabbar-h, calc(66px + env(safe-area-inset-bottom))) + 8px)}
  .docbar .btn.ghost{flex:0 0 40%}
  /* дубли: «Сохранить»/«Закрыть» в шапке и «Сохранить состав» под таблицей */
  .pagehead.docph .headbtns>.btn:not(.ghost),
  .opedt:checked~.pagehead.docph .headbtns>a.btn.ghost{display:none}
  .opedt:checked~* .opsave{display:none}
  body:has(.docbar) .pagehead>.headbtns>.btn:not(.ghost){display:none}
  /* «Отмена» сверху — тот же выход, что «Отменить» в полосе; на телефоне оставляем один */
  body:has(.docbar) .pagehead>.backslot{display:none}
  /* место под полосу, чтобы она не накрывала последнюю строку состава */
  body:has(.docbar:not([hidden])) .wrap{padding-bottom:96px}
  .pagehead.docph>.headbtns>.hbgap{display:none}
}
.tsum>span+span{display:none}
details[open]>.tsum>span:first-child{display:none}
details[open]>.tsum>span+span{display:inline}
.mgcard .mgrow{display:flex;align-items:center;gap:10px;padding:5px 0;border-bottom:1px solid var(--line)}
.mgcard .mgrow:last-of-type{border-bottom:0}
.mgcard .mgh{cursor:grab;color:var(--muted);font-size:15px;letter-spacing:-3px;user-select:none}
.mgcard .mgn{flex:0 0 240px;font-weight:600;font-size:14px}
.mgcard .mgrow input{flex:1;max-width:280px;min-height:34px;padding:5px 9px;font-size:14px}
/* шапка двух подписей: сами колонки задаёт .mgrow, ручка держит отступ слева */
.mgcard .mghead{border-bottom:0;padding-bottom:0}
.mgcard .mghead .sub{flex:1;max-width:280px}
.ordmemo textarea{width:100%;min-height:44px;font-size:13px;padding:7px 9px;resize:vertical}
.ordmemo{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.ordmemo > label,.ordmemo > textarea{flex:1 0 100%}
.ordmemo > .btn{margin:0}
.memohint{font-size:12px}
.gtaste{margin-top:6px}
.gtaste>summary{display:flex;align-items:center;gap:6px;min-height:26px;padding:3px 9px;
  font-size:12px;font-weight:600;color:var(--muted);background:var(--panel);border-radius:8px;
  cursor:pointer;list-style:none}
.gtaste>summary::-webkit-details-marker{display:none}
.gtaste>summary:hover{color:var(--ink)}
.gtaste .gt-arr{margin-left:auto;font-size:10px;transition:transform .16s cubic-bezier(.23,1,.32,1)}
.gtaste[open] .gt-arr{transform:rotate(180deg)}
.gtaste .note,.gtaste .favs{margin-top:6px}
.covers-f{display:inline-flex;align-items:center;gap:3px;margin:0}
.covers-f span{font-size:13px;color:var(--muted)}
.covers-inp{width:36px;min-height:28px;padding:2px 3px;text-align:center;
  border:1px solid var(--accent);font-size:13px}
.qtybtn.cov{width:24px;height:24px;min-height:24px;border-radius:7px;font-size:15px}
/* «Сменить гостя» — два слова двумя элементами (второе прячется на телефоне), и
   межэлементный зазор кнопки должен читаться обычным пробелом, а не двойным */
.gbar .btn{gap:4px}
.covers-inp::-webkit-outer-spin-button,.covers-inp::-webkit-inner-spin-button{
  -webkit-appearance:none;margin:0}
@media(max-width:700px){
  .pos-wrap{padding-top:10px;padding-bottom:10px}
  .pos-wrap>.pagehead{margin-bottom:10px}
  .gbar{padding:8px 12px;margin-bottom:8px}
  .gbar__row{gap:6px 10px}
  /* «чел» — сразу за именем, «Сменить гостя» остаётся крайним справа: у кнопки
     order:-1 из правила ниже, поэтому и полю нужен тот же order (DOM решает) */
  .gbar__row>.covers-f{order:-1}
  .pos-mtabs{margin-bottom:8px;padding:8px 12px}
  .pos-check{padding:12px}
}
.cartbar{display:none}
@media(max-width:700px){
  .cartbar{display:flex;align-items:center;gap:10px;position:fixed;left:8px;right:8px;
    bottom:calc(72px + env(safe-area-inset-bottom));z-index:70;min-height:44px;padding:6px 14px;
    border:0;border-radius:14px;background:var(--accent-btn);color:#fff;font:inherit;
    box-shadow:0 10px 26px -8px rgba(0,0,0,.45);text-align:left}
  .cartbar[hidden]{display:none}
  .cartbar .cb-n{font-size:13px;opacity:.85}
  .cartbar .cb-sum{margin-left:auto;font-weight:800;font-size:16px}
  .cartbar .cb-go{font-weight:700;font-size:13px;opacity:.9}
  .cartbar:active{transform:scale(.99)}
}
.menu-grp{margin-bottom:14px}
.menu-grp h3{font-size:13px;font-weight:700;color:var(--muted);margin-bottom:8px}
.menu-btns{display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(152px,1fr))}
.menu-btns form{display:flex}
.menu-btn{background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);border-radius:16px;padding:8px;text-align:left;
  min-height:64px;display:flex;flex-direction:column;gap:8px;transition:box-shadow .15s ease,border-color .15s ease}
.menu-btn:hover{border-color:var(--accent);box-shadow:var(--shadow-lg)}
/* фото товара — как на кассовом референсе: раньше картинка лежала фоном под белой
   заливкой 82% и её попросту не было видно, а кассир ищет позицию глазами по картинке */
.menu-btn .mimg{display:block;height:92px;border-radius:11px;background:var(--chip) center/cover no-repeat}
.menu-btn .mname{font-weight:700;font-size:14px;line-height:1.25;padding:0 4px}
.menu-btn .mprice{color:var(--accent-dark);font-weight:800;font-size:15px;margin-top:auto;padding:0 4px 4px}
.chk-line{display:flex;align-items:center;gap:8px;padding:5px 0;flex-wrap:wrap;
  border-bottom:1px solid var(--line)}
/* название занимает свою строку: статус кальяна и «+ замена чаши» раньше втискивались
   рядом с именем и рвали строку чека на четыре этажа */
.chk-line .n{flex:1;display:block;font-weight:600;font-size:14px;margin-bottom:1px;
  overflow-wrap:break-word}
.chk-th{flex:none;width:34px;height:34px;border-radius:9px;background:var(--chip) center/cover no-repeat}
.prz-card{border-color:var(--accent);padding:8px 12px;margin-bottom:10px}
.prz-card .prz-hk:first-child{margin-top:0}
.prz-sum{display:flex;align-items:center;gap:8px;cursor:pointer;list-style:none;min-height:28px}
.prz-sum::-webkit-details-marker{display:none}
.prz-short{flex:1;min-width:0;font-size:14px;color:var(--muted);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.prz-card[open] .prz-short{display:none}
.prz-sum .dd-arr{flex:none;font-size:12px;color:var(--muted)}
.prz-card[open] .dd-arr{transform:rotate(180deg)}
.prz-tag{flex:none;align-self:flex-start;padding-top:2px;font-size:11px;font-weight:800;
  letter-spacing:.04em;text-transform:uppercase;color:var(--accent-dark)}
.prz-hk{margin-top:5px;display:flex;align-items:center;gap:5px;flex-wrap:wrap}
.prz-hk>b{font-size:14px}
.prz-hk .badge{font-size:11px;padding:2px 8px}
.prz-mix{flex:1 1 100%;font-size:13px;color:var(--muted);white-space:pre-line;
  overflow-wrap:break-word}
.prz-ex{margin:5px 0 0;padding:0 0 0 14px;list-style:disc;font-size:13px}
.prz-ex li{margin:2px 0}
.prz-ex li::marker{color:var(--accent)}
.prz-ex b{font-weight:600}
.chk-nm{flex:1 1 auto;min-width:140px}
/* колонка названия на телефоне узкая (~120px): таймер не переносится — стоит справа
   в первой строке, а длинное название переносится внутри своей части */
.chk-nm .n-row{display:flex;align-items:flex-start;gap:6px}
.chk-nm .n-row .n{flex:1 1 auto;min-width:0;margin-bottom:0}
.chk-nm .n-row .tmr{flex:none;font-size:12px;padding:1px 6px;white-space:nowrap}
@media(min-width:701px){.chk-nm .n-row .n{flex:0 1 auto}}   /* 1990: на компьютере таймер сразу за названием, а не у края */
.chk-line .sum{margin-left:auto;min-width:76px;text-align:right;font-weight:700}
.chk-line .addedat{flex:none;font-size:12px;font-variant-numeric:tabular-nums;opacity:.7}
.qtybtn{width:38px;height:38px;min-height:38px;border-radius:9px;border:1px solid var(--line);
  background:#fff;font-weight:800;font-size:18px}
/* в узкой панели чека (планшет в портрете) три кнопки в ряд не помещаются —
   раскладка сама переносит третью на вторую строку вместо переноса букв */
.paybtns{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(124px,1fr));margin-top:12px}
@media(max-width:520px){.paybtns{grid-template-columns:minmax(0,1fr)}}
.total-row{display:flex;justify-content:space-between;align-items:center;padding:14px 0 4px;
  margin-top:6px;border-top:2px dashed var(--line);font-size:20px;font-weight:800}

/* полоска гостя над меню: занимает одну строку вместо карточки в сто пикселей */
.gbar{padding:10px 14px;margin-bottom:12px}
.gbar__row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.gbar__row b{font-size:15px}
/* на широком имя и подпись в строку, как раньше; колонкой — только на телефоне */
.gbar__who{display:contents}

/* живой таймер: кальян горит / гость едет (timer.js) */
.tmr{display:inline-flex;align-items:center;gap:5px;font-variant-numeric:tabular-nums;
  font-weight:700;font-size:13px;padding:4px 9px;border-radius:99px;
  background:var(--green-soft);color:var(--green)}
.tmr--warn{background:#FFF3E9;color:#B45309}
.tmr--bad{background:var(--red-soft);color:var(--red)}

/* экран чека во весь экран: прокручивается только меню и список позиций */
.pos-grid.grow{flex:1;min-height:0}
/* низкий экран (планшет 768, ноут в 800): отступы съедали половину списка позиций —
   на 1024×768 в чеке было видно полторы строки. Ужимаем только поверхность продаж. */
@media(max-height:820px){
  .pos-wrap.pos-fit{padding-top:10px;padding-bottom:10px}
  .pos-fit .card{padding:11px 12px}
  .pos-fit .gbar{padding:6px 12px;margin-bottom:8px}
  .pos-fit .prz-card{padding:6px 12px;margin-bottom:8px}
  .pos-fit .pagehead{margin-bottom:8px}
  .pos-fit .chk-line{padding:4px 0}
  .pos-fit .total-row{padding:8px 0 2px;font-size:18px}
  .pos-fit .cat-chips{margin-bottom:10px}
  .pos-fit .pagehead .btn{min-height:32px}
  .pos-fit .chk-cmds .btn{min-height:32px}
  .pos-fit .chk-cmds{margin-bottom:4px}
  .pos-fit .ordmemo > summary{min-height:30px}
  .pos-fit .pos-check__foot .mt{margin-top:8px}
}
@media(min-width:701px){
  .pos-menu .menu-btns{gap:8px;grid-template-columns:repeat(auto-fill,minmax(112px,1fr))}
  /* фото позиции — во всю ширину карточки, от края до края */
  .pos-menu .menu-btn{padding:0 0 8px;gap:6px;border-radius:12px;align-items:center;text-align:center;overflow:hidden}
  .pos-menu .menu-btn .mimg{width:100%;height:96px;border-radius:0}
  .pos-menu .menu-btn .mname{font-size:12px;line-height:1.2;padding:0 6px}
  .pos-menu .menu-btn .mprice{font-size:13px;padding:0 6px}
}
@media(min-width:701px){
  .cat-chips{flex-wrap:wrap;overflow-x:visible}
}
@media(min-width:1001px){
  .pos-grid.grow>*{min-height:0;height:100%}
  .pos-menu{overflow-y:auto;padding-right:4px}
  .pos-check{display:flex;flex-direction:column;overflow:hidden}
  .pos-check__body{flex:1;min-height:0;overflow-y:auto;padding-right:4px}
  .pos-check__foot{flex:none;border-top:1px solid var(--line);padding-top:10px;margin-top:8px}
}

/* прочее */
.alert{background:var(--red-soft);color:var(--red);border-radius:10px;padding:12px 16px;
  font-weight:600;margin-bottom:14px}
.note{color:var(--muted);font-style:italic;font-size:14px;margin-bottom:14px}
/* разбор смены — содержательный текст, а не подсказка: прежняя плашка */
.note.ai-report{background:var(--accent-soft);color:var(--accent-dark);font-style:normal;
  border-radius:10px;padding:12px 16px}
.ai-report{font-size:14px;line-height:1.6}
.ai-report p{margin:0 0 10px}
.ai-report p:last-child{margin-bottom:0}
.ai-report .ai-h{font-weight:700;font-size:13px;letter-spacing:.02em;color:var(--muted);
  text-transform:uppercase;margin:0 0 10px;padding-bottom:8px;border-bottom:1px solid var(--line)}
.ai-report .ai-sub{font-weight:700;margin:14px 0 6px}
.ai-report .ai-ul{margin:0 0 10px;padding:0;list-style:none}
.ai-report .ai-ul li{position:relative;padding:5px 0 5px 18px}
.ai-report .ai-ul li::before{content:'';position:absolute;left:2px;top:13px;width:6px;height:6px;
  border-radius:50%;background:var(--accent)}
/* прежний вид оставляем там, где текст короткий и без структуры (совет по цене) */
.note.ai-report{white-space:pre-wrap}
.empty{color:var(--muted);text-align:center;padding:36px 16px;font-size:14px}
.mt{margin-top:16px}.mb0{margin-bottom:0}
.login-page{min-height:100dvh;display:flex;align-items:center;justify-content:center;padding:20px;
  background:var(--dark)}
.login-card{background:#fff;border-radius:16px;padding:32px 28px;width:100%;max-width:400px}
.login-card h1{margin-bottom:4px}
.login-card .sub{margin-bottom:20px}
.week-bars{display:flex;gap:8px;align-items:flex-end;height:120px;padding-top:8px}
.week-bars .b{flex:1;background:var(--accent-soft);border-radius:8px;min-height:6px;position:relative;transition:background .15s}
.week-bars .b:hover,.week-bars .b.hot{background:var(--accent)}
.week-bars .b span{position:absolute;top:-20px;left:0;right:0;text-align:center;font-size:11px;
  font-weight:700;color:var(--muted);white-space:nowrap}
.week-bars .b em{position:absolute;bottom:-20px;left:0;right:0;text-align:center;font-size:11px;
  font-style:normal;color:var(--muted);white-space:nowrap}
@media(max-width:640px){.week-bars .b em{font-size:10px}}

.meta,.meta span{overflow-wrap:anywhere;word-break:break-word}

/* мобильный нижний таб-бар (Restaurant POS) */
.tabbar{display:none}
@media(max-width:640px){
  .tabbar{position:fixed;bottom:0;left:0;right:0;z-index:120;display:flex;justify-content:space-around;
    background:#fff;border-top:1px solid var(--line);padding:5px 6px calc(6px + env(safe-area-inset-bottom));
    box-shadow:0 -4px 20px rgba(0,0,0,.06)}
  .tabbar a{display:flex;flex-direction:column;align-items:center;gap:3px;min-width:55px;
    font-size:10px;font-weight:600;color:var(--muted);padding:2px 6px;min-height:44px}
  .tabbar a svg{width:26px;height:26px}
  .tabbar a.on{color:var(--accent)}
  .wrap{padding-bottom:86px}
}
@media(max-width:640px){
  .topbar-in .topnav{display:none}
  .topbar-in{flex-wrap:nowrap;padding-bottom:0}
  /* 1948: на телефоне разделы уже внизу (tabbar) — меню у логотипа и стрелка рядом с ним не нужны */
  .topbar .logomenu summary{cursor:default;pointer-events:none}
  .topbar .logomenu .logocaret{display:none}
  /* логотип — такая же кнопка, как остальные в шапке: рамка, скругление, размер */
  .topbar .logomenu summary .logo{width:40px;height:40px;box-sizing:border-box;justify-content:center;gap:0!important;
    border:1px solid rgba(255,255,255,.25);border-radius:10px}
  .topbar .logomenu summary .logo img{width:24px!important;height:24px!important;border-radius:6px!important}
}
@media print{
  .topbar,.noprint{display:none!important}
  body{background:#fff}
  .wrap{padding:0;max-width:none}
}


/* Вкладки цехов и ленты кальянов — один раздел на двух экранах: «Цеха» убраны из
   нижней панели кипера (было шесть пунктов при норме пять), экраны переключаются здесь. */
.st-tabs{display:flex;gap:6px;flex-wrap:wrap}
.st-tabs a{padding:8px 14px;border:1px solid var(--line);border-radius:11px;background:#fff;
  text-decoration:none;color:var(--ink);font-size:14px;font-weight:600;min-height:44px;
  display:inline-flex;align-items:center}
.st-tabs a.on{background:var(--accent-btn);border-color:var(--accent-btn);color:#fff}

.chainflow{display:flex;flex-direction:column;gap:16px}
.chain-row{display:flex;align-items:center;gap:0;flex-wrap:nowrap}
.chain-branches{display:flex;flex-direction:column;gap:10px;flex:1;min-width:0;
  position:relative;margin-left:26px}
.chain-branches > .chain-row{position:relative}
/* отвод к плашке; у первой ветки он длиннее — это же и выход из родителя */
.chain-branches > .chain-row::before{content:"";position:absolute;left:-13px;top:50%;
  width:13px;height:1px;background:#C9CCD2}
.chain-branches > .chain-row:first-child::before{left:-26px;width:26px}
/* ствол: от середины предыдущей ветки до середины этой */
.chain-branches > .chain-row + .chain-row::after{content:"";position:absolute;left:-13px;
  top:calc(-50% - 10px);height:calc(100% + 10px);width:1px;background:#C9CCD2}
/* оплата, вышедшая из приёмки, — тем же отводом вправо */
.chain-branches .chain-row > a.chain-box + a.chain-box{margin-left:26px;position:relative}
.chain-branches .chain-row > a.chain-box + a.chain-box::before{content:"";position:absolute;
  left:-26px;top:50%;width:26px;height:1px;background:#C9CCD2}
.chain-box{background:var(--panel);border:1px solid var(--line);border-radius:var(--r);
  padding:10px 14px;min-width:170px}
.chain-box.on{border-color:var(--accent);box-shadow:0 0 0 2px rgba(245,111,16,.14)}
.chain-box a{color:inherit;text-decoration:none}
.chain-box a:hover{color:var(--accent)}
a.chain-box{display:block;color:inherit;text-decoration:none}
a.chain-box:hover{border-color:var(--accent);background:#fff}
.chain-box .t{font-size:12px;font-weight:600;color:var(--muted)}
.chain-box .n{font-weight:700;margin-top:2px}
.chain-box .t .no{font-size:13px;font-weight:700;color:var(--ink)}
.chain-box .w{font-size:13px;margin-top:2px}
.chain-box .d{font-size:12px;color:var(--muted)}
.chain-box .s{font-weight:700;margin-top:4px;font-size:14px}
.chainhint{margin-top:4px}

/* Переключатель колонок таблицы (colcfg.js): номенклатура, гости */
.colcfg{position:relative}
.colcfg summary{list-style:none;cursor:pointer}
.colcfg summary::-webkit-details-marker{display:none}
.colcfg-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:20;background:#fff;
  border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-lg);padding:8px;min-width:210px}
.colcfg-menu label,.colcfg-menu a,.wrap .colcfg-menu a{display:flex;gap:10px;align-items:center;padding:8px 10px;
  border-radius:8px;font-size:14px;font-weight:500;color:var(--ink);cursor:pointer;margin:0;
  text-decoration:none;white-space:nowrap}
.colcfg-menu label:hover,.colcfg-menu a:hover,.wrap .colcfg-menu a:hover{background:var(--bg);color:var(--ink)}
/* галочка у выбранного пункта — место под неё держим всегда, иначе строки прыгают */
.colcfg-menu a::before{content:'';width:14px;flex:none;color:var(--accent)}
.colcfg-menu a.on::before{content:'✓'}
.colcfg-scrim{position:fixed;inset:0;background:rgba(20,18,16,.38);z-index:199}
@media(max-width:700px){
  .colcfg-menu.sheet{position:fixed!important;left:8px!important;right:8px!important;
    top:auto!important;bottom:calc(76px + env(safe-area-inset-bottom))!important;
    width:auto!important;max-height:56vh;overflow-y:auto;z-index:200;display:block}
  .colcfg-menu.sheet{max-height:min(56dvh, 56vh);
    -webkit-overflow-scrolling:touch;touch-action:pan-y;overscroll-behavior:contain}
  /* пункты пальцем: 8 точек padding давали строку в 34px при норме 44 */
  .colcfg-menu.sheet label,.colcfg-menu.sheet a{min-height:44px;padding:10px 12px}
  .colcfg-menu.sheet.cols::before{content:'Колонки';display:block;font-weight:700;
    font-size:15px;padding:6px 12px 10px;text-align:left;color:var(--ink)}
}

.umenu{position:relative}
.umenu summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px;
  border-radius:10px;padding:3px 6px}
.umenu summary::-webkit-details-marker{display:none}
.umenu summary:hover{background:rgba(255,255,255,.08)}
.umenu summary.btn:hover{background:#D45C06}
.umenu .uic{width:26px;height:26px;color:#fff;opacity:.85;flex:none}
.umenu-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:60;background:#fff;
  border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-lg);padding:8px;min-width:200px}
.umenu .umenu-menu a{display:block;padding:9px 12px;border:0;min-height:0;border-radius:8px;
  font-size:14px;font-weight:500;color:var(--ink);text-decoration:none;white-space:nowrap}
.umenu .umenu-menu a:hover{background:var(--chip);color:var(--ink)}
.umenu .umenu-menu a:last-child{color:var(--muted)}
.umenu .umenu-menu button{display:block;width:100%;text-align:left;padding:9px 12px;border:0;min-height:0;
  border-radius:8px;background:none;font:inherit;font-size:14px;font-weight:500;color:var(--ink);cursor:pointer}
.umenu .umenu-menu button:hover{background:var(--chip)}
.umenu .umenu-menu button:disabled{color:var(--muted);cursor:default}
.orgdd summary{padding:5px 10px;margin-left:-10px;min-height:36px;border-radius:10px}
.orgdd summary:hover{background:var(--chip)}
.orgdd .dd-arr{font-size:13px;color:var(--muted);font-weight:600}
.orgdd .umenu-menu{min-width:220px}
.orgdd .umenu-menu button{display:flex;align-items:center;justify-content:space-between;
  gap:12px;min-height:40px}
.orgdd .umenu-menu button.on{color:var(--accent);font-weight:700}
.orgdd .umenu-menu button.on::after{content:"✓"}

.logomenu summary{cursor:default;pointer-events:none}
.logomenu .logocaret{display:none;color:#fff}
.logomenu .umenu-menu a:last-child{color:var(--ink)}

.topbar.navfold .topbar-in .topnav{display:none}
.topbar.navfold .logomenu summary{cursor:pointer;pointer-events:auto}
.topbar.navfold .logocaret{display:inline}


.orgline{display:block;font-size:11px;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;color:rgba(255,255,255,.6);margin-top:2px;
  max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.crm-tbl td{padding:3px 10px}
.crm-tbl .xbtn{width:30px;height:30px;min-height:30px}

.stat .statrow{border:0;background:none;padding:4px 6px;margin:0 -6px;text-align:left;
  cursor:pointer;font:inherit;display:flex;justify-content:space-between;align-items:baseline;
  gap:10px;width:calc(100% + 12px);border-radius:8px;text-decoration:none;color:inherit}
.stat .statrow:hover{background:var(--bg)}

th.gearth{position:sticky;right:0;width:40px;min-width:40px;max-width:40px;padding:4px 6px;
  text-align:right;z-index:6}
table[data-resizable] th.gearth{width:40px!important}
.clip1{display:inline-block;max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}
table[data-cw-fixed] .clip1{display:inline;max-width:none;overflow:visible}
td[data-c="flav"] .clip1{max-width:min(760px,38vw)}
.edname{font-weight:600}

.doccards{display:none}
@media(max-width:700px){
  .doccards{display:block;margin:0 -16px -16px}   /* в край карточки, как в списке телефона */
  .tscroll.hide-mob{display:none}                 /* прячем только помеченные таблицы */
  .dc-day{padding:9px 16px;background:var(--panel);border-top:1px solid var(--line);
    border-bottom:1px solid var(--line);color:var(--muted);font-size:13px;font-weight:600}
  .dc-day:first-child{border-top:0}
  /* строка даты прилипает под шапкой */
  .dc-day{position:sticky;top:calc(var(--topbar-h, 56px) - 1px);z-index:5}
  .dc-row{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
    padding:11px 16px;min-height:56px;border-bottom:1px solid var(--line);
    color:var(--ink);text-decoration:none}
  .dc-row:last-child{border-bottom:0}
  .dc-row:active{background:var(--panel)}
  .dc-l{min-width:0}
  .dc-l b{display:block;font-size:15px;font-weight:700;line-height:1.25}
  .dc-cmt{margin-top:2px;font-size:12px;line-height:1.3;color:var(--muted);
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .dc-sub{margin-top:3px;font-size:13px;color:var(--muted)}
  /* 1815: статья ДДС в строке номера — одной строкой, длинная обрезается многоточием */
  .dc-sub:has(.dc-cat){white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .dc-cat{color:var(--ink)}
  .dc-a{flex:none;font-size:15px;font-weight:600;white-space:nowrap;padding-top:1px}
  .doccards .dc-a{display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;gap:5px;align-self:stretch}
  .doccards .dc-a .badge{font-size:11px;font-weight:600}
  .dc-l b .badge{vertical-align:2px;margin-left:4px;font-weight:600}
  .doccards .empty{padding:22px 16px}
}

.docgrp{margin:18px 4px 8px;font-size:13px;font-weight:700;letter-spacing:.05em;
  text-transform:uppercase;color:var(--muted)}
.docgrp:first-of-type{margin-top:0}
.doclist{padding:0 16px}
.doclist a,.wrap .doclist a{display:flex;align-items:center;justify-content:space-between;gap:12px;
  min-height:54px;padding:12px 0;border-bottom:1px solid var(--line);
  color:var(--ink);font-weight:600;font-size:15px;text-decoration:none}
.doclist a:last-child{border-bottom:0}
.doclist a:active{color:var(--accent)}
.doclist a svg{width:17px;height:17px;flex:none;color:var(--muted)}

/* 758: полоса разделов на телефоне дублирует «Документы» в нижней панели и просто
   съедает верх экрана — прячем её на листах, куда приходят из «Документов». */
/* 765: вместо неё на платежах и депозитах остаётся переключатель из двух вкладок */
.tabs.tabs-mob{display:none}
/* 764: ДДС и «Прибыль и убытки» — ссылками во вкладках показателей, только на телефоне */
.tabs .tab-mob{display:none}
/* 765: строка фильтров на широком экране — как была: обёртка не создаёт своей коробки,
   поиск через order возвращается в конец строки, кнопка-ползунки не нужна */
.mfilt-fields{display:contents}
.mfilt-btn{display:none;align-items:center;justify-content:center;width:44px;height:44px;
  flex:none;border:0;background:none;color:var(--accent);padding:0;align-self:flex-end}
.mfilt-btn svg{width:22px;height:22px}
@media(min-width:701px){
  .mfilt .msearch{order:9}
  .mfilt .fres{order:10}
  .mfilt .fsave{order:11}
}
.sugbox{position:absolute;z-index:330;   /* заявка 1263: выше карточки правки */background:#fff;border:1px solid var(--line);
  border-radius:10px;box-shadow:var(--shadow);max-height:280px;overflow-y:auto;padding:4px}
.sugbox .sug{padding:7px 10px;border-radius:8px;cursor:pointer;font-size:14px;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
@media(max-width:700px){.sugbox .sug{white-space:normal;padding:10px 12px}}
.sugbox .sug:hover,.sugbox .sug.on{background:var(--panel)}
.sugbox .sub{font-size:12px}
.whobox{display:flex;flex-direction:column;align-items:flex-start;line-height:1.3;width:100%}
.whobox .sub{font-size:12px}
.stlist{width:100%}
.stlist td{padding:4px 6px;vertical-align:middle}
.stlist td:first-child{width:60px}
.stlist td.stname{width:auto}
.stlist .stmove{white-space:nowrap;color:var(--muted)}
.stlist .stmove .xbtn{width:30px;height:30px;min-height:30px;padding:0}
.stlist .stmove svg{width:16px;height:16px}
.stlist input[name=name]{width:100%}
.stcolor{width:190px}
.stpick summary{list-style:none;cursor:pointer;display:inline-flex}
.stpick summary::-webkit-details-marker{display:none}
.stswatch{min-width:104px;text-align:center}
.stpal{display:grid;grid-template-columns:repeat(4,26px);gap:6px;padding:8px}
.stcell{width:26px;height:26px;border-radius:6px;border:1px solid rgba(0,0,0,.12);cursor:pointer;
  min-height:0;padding:0}
.field.chkfield,body[data-sec="refs"] .card .field.chkfield{margin-bottom:0}
label.chkline{display:flex;gap:8px;align-items:center;font-size:14px;color:var(--ink);
  min-height:0;padding:3px 0;margin:0;line-height:1.35}
label.chkline input[type=checkbox]{width:16px;height:16px;min-height:0;flex:none;margin:0}
label.chkline .sub{font-size:12px}
.reftree .gkey{flex:none;width:72px;margin-left:auto;font-style:normal;font-size:11px;
  color:var(--muted);line-height:1.2;text-align:left;overflow:hidden;text-overflow:ellipsis;
  white-space:nowrap}
.reftree a.on .gkey{color:var(--accent)}
.btn.wabtn{min-height:0;height:auto;padding:2px 8px;font-size:11px;line-height:1.6;
  margin-left:6px;vertical-align:middle;border-radius:7px}
h1.gname{margin:0;min-width:0}
h1.gname input{font:inherit;color:inherit;border-color:transparent;background:none;
  padding:2px 6px;margin-left:-6px;min-height:0;width:100%;min-width:110px;max-width:min(560px,60vw)}
h1.gname input:hover{border-color:var(--line)}
h1.gname input:focus{border-color:var(--accent);background:#fff}
tr.isdraft td .badge{font-style:normal}
.stocktbl{width:auto;min-width:0}
.stocktbl th.namecol{width:340px;max-width:340px}
.stocktbl td:first-child{max-width:340px;overflow:hidden;text-overflow:ellipsis}
@media(max-width:1100px){.stocktbl th.namecol{width:260px;max-width:260px}
  .stocktbl td:first-child{max-width:260px}}
.doctabs{display:flex;gap:18px;align-items:center;margin:0 0 12px;padding:0 2px;
  border-bottom:1px solid var(--line);background:none}
.doctabs button{background:none;border:0;padding:10px 2px 10px;font-size:15px;font-weight:600;
  color:var(--muted);cursor:pointer;border-bottom:2px solid transparent;border-radius:0;
  min-height:0;display:inline-flex;align-items:center;gap:7px}
.doctabs button.on{color:var(--ink);border-bottom-color:var(--accent)}
.doctabs .n{font-size:12px;font-weight:700;color:var(--muted);background:var(--panel);
  border-radius:6px;padding:1px 6px}
.stcell.gray{background:#E4E6EA}.stcell.orange{background:#F9A870}
.stcell.green{background:var(--green)}.stcell.lime{background:#A8D66A}
.stcell.red{background:#F08A8A}.stcell.blue{background:#7FA6F2}
.stcell.violet{background:#B79BEC}.stcell.yellow{background:#F2D177}
.stcell.teal{background:#7FCFCF}
/* новые цвета плашек — те же, что в палитре, только мягкой заливкой */
@media(max-width:700px){
  .stlist td:first-child:not(.stname){display:none}
  .stcolor{width:120px}
  .stswatch{min-width:0}
}
.field.fpick{min-width:132px}
.field.fpick > .btn{width:100%}
/* вкладки вида листа стоят в шапке рядом с названием раздела */
.pagehead .tabs.viewtabs{margin:0}
.frow.mfilt .fres,.frow.mfilt .fsave{align-self:flex-end}
.pagehead-search.mfilt .fres,.pagehead-search.mfilt .fsave{align-self:center}
.pagehead-search.mfilt select{min-height:44px;height:44px;padding-top:0;padding-bottom:0}
@media(max-width:700px){
  .tabs.hide-mob{display:none}
  .tabs.tabs-mob{display:flex}
  .tabs .tab-mob{display:flex;align-items:center;padding:8px 16px;border-radius:9px;
    font-weight:600;font-size:14px;color:var(--muted);min-height:38px}
  /* поиск первой строкой, фильтры — под кнопкой рядом с ним */
  .mfilt-btn{display:flex}
  .mfilt .mfilt-fields{display:none}
  .mfilt.fon .mfilt-fields{display:contents}
  .mfilt .msearch{flex:1 1 auto;min-width:0!important}
  .mfilt .msearch label{display:none}
  .mfilt .msearch input{border-color:transparent;background:#ECEDF1
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E")
    10px center/19px no-repeat;padding-left:36px;border-radius:12px}
}

.crmcards .dc-sub{display:block;font-size:14px}
.crmcards .dc-sub.neg{font-weight:600}
.cc-tags{flex:none;display:flex;flex-direction:column;gap:4px;align-items:flex-end}
.crmcards .badge.vio{border:0;text-transform:uppercase;font-size:11px;letter-spacing:.03em}
@media(max-width:700px){
  .mfilt .msearch{order:-3}
  .mfilt .mfilt-btn{order:-2}
}
@media(min-width:641px){
  .pagehead:has(> .tabs:not(.tabs-mob):not(.mobonly)):not(:has(> .backslot)) > h1{flex:0 0 auto;min-width:156px;
    max-width:none;overflow:visible}
}
.topbar .topshift{flex:none;margin:0 4px}
@media(max-width:600px){
  .topbar .shell-switch{display:none}
  .topbar .mobshift{font-size:10px}
}

@media(max-width:600px){
  /* 768: правый блок прижат к краю — правило «после .shell-switch без отступа»
     срабатывало и на спрятанной кнопке, и блок вставал на 70px левее, чем в кипере */
  .topbar .topuser,.topbar .shell-switch+.topuser{margin-left:auto}
  /* та же высота, что у шапки кипера (64px): колонка лого со строкой компании
     с полями по 6px давала 68, и при переходе шапка прыгала на 4px */
  .brandcol{padding:4px 8px 4px 0}
}
@media(max-width:640px){
  /* 769: нижняя панель — те же поля, тень, размеры значка и подписи, что у .pos-tabs
     кипера; пункты делят ширину поровну, подпись не вылезает за экран */
  .tabbar{justify-content:stretch;padding:5px 4px calc(6px + env(safe-area-inset-bottom));
    border-top:0;box-shadow:0 -2px 10px rgba(0,0,0,.09)}
  .tabbar a{flex:1;min-width:0;gap:3px;padding:5px 2px;font-size:11px;letter-spacing:-.2px;
    white-space:nowrap;overflow:hidden;border-radius:12px;color:var(--muted);min-height:0}
  .tabbar a svg{width:26px;height:26px}
  .tabbar a.on{color:#C05207;background:#FFF3EA}
  /* 771: поле даты в строке «Сумма · Дата» не влезало — datetime-local держит
     min-width 215px; на телефоне дата идёт своей строкой во всю ширину */
  .frow .field:has(> input[type=datetime-local]){flex:1 0 100%}
  input[type=datetime-local]{min-width:0;width:100%;-webkit-appearance:none;appearance:none}
}
/* 770: список разделов «Показателей» на телефоне — строка со стрелкой под названием компании */
.tabsdd{display:none}
@media(max-width:700px){
  .tabsdd{display:block;width:100%}
  .tabsdd summary{padding:2px 0;font-size:18px;font-weight:700;color:var(--ink);width:max-content}
  .tabsdd summary:hover{background:none}
  .tabsdd .dd-arr{font-size:12px;color:var(--muted)}
  .tabsdd .umenu-menu{left:0;right:auto}
  .tabsdd .umenu-menu a,.tabsdd .umenu-menu a:last-child{color:var(--ink);font-size:15px;padding:11px 14px}
  .tabsdd .umenu-menu a.on{color:var(--accent);font-weight:700}
}
.mobonly{display:none}
@media(max-width:700px){
  .nomob{display:none}
  .mobonly{display:inline}
}

.optot .v{white-space:nowrap}
.qtysum{display:flex;flex-wrap:wrap;gap:4px 16px;align-items:baseline;
  font-size:13px;font-weight:600;color:var(--muted)}
.qtysum b{font-size:15px;font-weight:800;color:var(--ink)}
.qtysum:empty{display:none}
.totrow{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;
  flex-wrap:wrap;margin-bottom:6px}
.totrow .vatside{margin-left:auto;text-align:right}
.totrow .qtysum{text-align:left;padding-top:2px}
.qtyc{display:flex;align-items:center;gap:4px}
.qtyc input{flex:1;min-width:0}
.qtyc .u{font-style:normal;font-size:11px;color:var(--muted);white-space:nowrap}
.qtyc .u{flex:none;width:34px;text-align:left;overflow:hidden;text-overflow:ellipsis}
@media(max-width:700px){
  .op-cnt{display:block;margin:-4px 0 8px;color:var(--muted);font-size:13px}
  .op-cnt .vatro{display:inline;color:var(--accent);font-weight:600;cursor:pointer;
    text-decoration:underline dotted;text-underline-offset:3px}

  /* шапка документа: подпись слева, поле справа. Ширины из inline-стилей рассчитаны
     на широкий экран — здесь их снимаем, иначе строка обрезается по 190px */
  .ophead .frow{display:block}
  .ophead .field{display:flex;align-items:center;justify-content:space-between;gap:10px;
    max-width:none!important;min-width:0!important;min-height:48px;margin:0;
    padding:2px 0;border-bottom:1px solid var(--line)}
  .ophead .field:last-child{border-bottom:0}
  .ophead .field>label{margin:0;flex:none;font-size:14px;font-weight:600;color:var(--muted)}
  .ophead .field>input,.ophead .field>select,.ophead .field>div{width:auto;min-width:0;
    max-width:64%;flex:0 1 auto;text-align:right;border-color:transparent;background:none;
    padding:6px 0;min-height:0}
  .ophead .field>select{padding-right:18px}
  /* контрагент — не select, а поиск с подсказками (pick.js): та же строка, крестик у края */
  .ophead .field>.pick{flex:0 1 64%;max-width:64%}
  .ophead .pick input.pick-in{text-align:right;border-color:transparent;background:none;
    padding:6px 22px 6px 0;min-height:0}
  .ophead .pick .pick-clear{right:0}

  /* состав — карточки-ряды. Колонки: номер · кол-во · цена · сумма · крестик;
     название лежит первой строкой во всю ширину */
  .linecards,.linecards tbody{display:block}
  .linecards tr{display:grid;grid-template-columns:32px 68px 74px minmax(0,1fr) 36px;
    gap:2px 5px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line)}
  .linecards tr:last-child{border-bottom:0}
  .linecards td{border:0;padding:0}
  .linecards td.rownum{grid-area:1/1;display:flex;align-items:center;justify-content:center;
    min-height:38px;color:var(--muted)}
  .linecards td:has(.edname),.linecards td:has(input[list=items_dl]){grid-area:1/2/auto/5;
    font-size:15px;line-height:1.25}
  .linecards td:has(.xbtn.del){grid-area:1/5}
  .linecards td:has([name=qty]){grid-area:2/2;display:flex;align-items:center;gap:3px}
  .linecards td:has([name=qty])::after{content:'×';color:var(--muted);font-size:13px}
  .linecards td:has([name=price]){grid-area:2/3}
  .linecards td:has(.rowsum){grid-area:2/4}
  .linecards td.vatcol{grid-area:3/2/auto/4}
  /* подпись «НДС» в шапке таблицы не нужна — тумблер с тем же словом стоит выше */
  #edlines.linecards th.vatcol{display:none}
  /* поля состава заточены под мышь (32px, 13.5px): пальцу нужен рост и шрифт от 16px,
     иначе Safari зумит страницу при фокусе. Селектор с id — правило #edlines сильнее класса */
  #edlines.linecards td input{width:100%;min-height:40px;padding:6px 8px;font-size:16px}
  #edlines.linecards td select{min-height:40px;padding:6px 8px;font-size:15px}
  #edlines.linecards .xbtn.del,#edlines.linecards .xbtn.plus{width:36px;height:36px;min-height:36px}
  #edlines.linecards td.unit{grid-area:3/2/auto/4}
  #edlines.linecards td.rowstock{grid-area:3/4/auto/7;text-align:left;font-size:11px;color:var(--muted)}
  #edlines.linecards td.rowstock::before{content:'остаток '}
  #edlines.linecards td:has([name=pack_g]),#edlines.linecards td[data-c]{display:none!important}
  #edlines.linecards tr:has(.plus) td.unit,#edlines.linecards tr:has(.plus) td.rowstock{display:none}
  /* «Принято» и «Остаток» есть только у заказа поставщику — они 4-я и 5-я ячейки строки;
     без подписи «6» и «24» под ценой ничего не значат */
  .linecards[data-po] td:nth-child(4){grid-area:4/2/auto/4}
  .linecards[data-po] td:nth-child(5){grid-area:4/4/auto/6;text-align:left}
  .linecards[data-po] td:nth-child(4)::before{content:'принято '}
  .linecards[data-po] td:nth-child(5)::before{content:'остаток '}
  /* шапка таблицы не нужна — кроме двух меню в ней: порядок строк и «Расценить» */
  .linecards tr:first-child{display:flex;gap:16px;padding:0 0 8px}
  .linecards th{display:none;position:static;padding:0;border:0;box-shadow:none;background:none}
  .linecards th:has(details){display:block}
  /* стрелка сортировки и ручка ширины колонки — приёмы мыши, пальцу они не нужны */
  .linecards th .s-a,.linecards th .c-grip{display:none}
  /* у пустой строки набора (её узнаёт плюс) «принято» и «остаток» пустые — не место им */
  .linecards[data-po] tr:has(.plus) td:nth-child(4),
  .linecards[data-po] tr:has(.plus) td:nth-child(5){display:none}

  /* итоги — строкой: подпись слева, сумма справа. Скрытые строки НДС остаются скрытыми */
  .optot{text-align:left!important}
  .optot>div{justify-content:space-between;align-items:baseline;gap:12px;
    padding:9px 0;border-top:1px solid var(--line)}
  .optot .qtysum{margin-left:auto;margin-right:12px;gap:4px 12px}
  .optot .qtysum,.optot .qtysum b{font-size:inherit}   /* 1949: «Кол-во» и «Вес» того же размера, что и итоговая сумма */
  .optot>div:not(.vatcol),.vat-on .optot>div.vatcol{display:flex}
  .opsave{display:block}
  .opsave .btn{width:100%}
}
@media(max-width:700px){
  .acccards{grid-template-columns:repeat(auto-fit,minmax(104px,1fr));gap:8px;margin-bottom:12px}
  .acccards .stat{padding:10px 12px}
  .acccards .stat .l{font-size:12px}
  .acccards .stat .v{font-size:15px;margin-top:2px;padding-bottom:0;white-space:nowrap}
}
@media(max-width:600px){
  .topbar .mobshift{font-size:0;gap:0}
  .topbar .mobshift i{width:11px;height:11px}
}

.mfsheet-head,.mfsheet-reset{display:none}
@media(max-width:700px){
  /* лист прокручивается сам — страница под ним стоит на месте */
  body.mfilt-open{overflow:hidden}
  /* 2109: лист стоит под шапкой и над нижним меню: в приложении обе панели ложатся поверх листа и закрывали «Готово» */
  .mfilt.fon{position:fixed;inset:var(--topbar-h,0px) 0 0 0;z-index:150;display:block;overflow-y:auto;
    margin:0!important;padding:0 0 calc(110px + env(safe-area-inset-bottom));gap:0;background:var(--bg);
    animation:mfsheet .22s cubic-bezier(.23,1,.32,1)}
  /* поиск и сама кнопка-ползунки в лист не идут: они остались строкой на странице */
  .mfilt.fon>.msearch,.mfilt.fon>.mfilt-btn{display:none}
  .mfilt.fon .mfsheet-head{display:flex;align-items:center;justify-content:space-between;
    gap:12px;position:sticky;top:0;z-index:2;background:var(--card);padding:11px 16px;
    border-bottom:1px solid var(--line)}
  .mfsheet-head button{border:0;background:none;font:inherit;font-size:16px;
    color:var(--accent);padding:4px 0;cursor:pointer}
  .mfsheet-head .mfs-done{font-weight:700}
  .mfsheet-head .mfs-title{font-size:13px;font-weight:800;letter-spacing:.06em}
  .mfilt.fon .mfsheet-reset{display:block;width:100%;border:0;
    border-bottom:1px solid var(--line);background:var(--card);color:var(--red);
    font:inherit;font-size:16px;padding:14px 16px;margin:10px 0;cursor:pointer}
  /* поля — строками во всю ширину: max-width и min-width из строки фильтров здесь
     только режут списки (у части полей они заданы стилем в шаблоне — отсюда important) */
  .mfilt.fon .mfilt-fields{display:block}
  .mfilt.fon .mfilt-fields .field{display:block;margin:0;background:var(--card);
    padding:11px 16px;border-bottom:1px solid var(--line);
    max-width:none!important;min-width:0!important;flex:none}
  .mfilt.fon .mfilt-fields .field>label{display:block;font-size:12px;color:var(--muted);
    margin-bottom:5px}
  .mfilt.fon .mfilt-fields .field>input,.mfilt.fon .mfilt-fields select,
  .mfilt.fon .mfilt-fields .pick{width:100%}
  /* период — тот же чип со стрелками, только растянут на строку */
  .mfilt.fon .mfilt-fields .field.per .persel{flex:1 1 auto;min-width:0}
  .mfilt.fon .mfilt-fields .field.per .persel>summary{width:100%;justify-content:center}
  .mfilt.fon .mfilt-fields .btn{display:block;margin:12px 16px}
  .mfilt.fon .mfilt-fields .fpick>.btn{margin:0}
}
@keyframes mfsheet{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){
  .mfilt.fon{animation-duration:.01ms}
}
@media(max-width:700px){
  .tabsdd summary{padding:7px 12px;border-radius:10px;background:var(--chip);font-size:16px}
  .tabsdd .dd-arr{margin-left:2px}
}

.pagehead-search.mfilt:not(.fon){display:flex;gap:8px;align-items:center;margin:0}
@media(min-width:701px){
  .pagehead-search.mfilt .msearch{order:0}
  .gseg{display:none}                 /* сегменты гостей на широком экране — вкладками */
}
@media(max-width:700px){
  .pagehead > button.btn.phadd,.pagehead > a.btn.phadd{order:1;margin:0 0 0 auto;flex:none}
  .pagehead > .pagehead-search.mfilt{order:2}
  .pagehead > .phtail{order:3}
}
/* 786: карточки гостей — имя, под ним контакты и визиты, справа траты; баланс мелкой
   строкой под суммой и только когда он не ноль, иначе весь лист в нулях */
.gcards .dc-l{flex:1;min-width:0}
.gcards .dc-sub{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gcards .dc-a{text-align:right}
.gcards .dc-a .sub{display:block;font-size:12px}

.gc-nm{font-weight:700;font-size:15px}
.gc-n{display:flex;gap:14px;flex-wrap:wrap;align-items:baseline}
.gedit-ic{display:none}
@media(max-width:700px){
  .pos-fit .cards{gap:8px}
  .gcard{display:flex;flex-wrap:wrap;align-items:flex-start;gap:0 8px;padding:9px 12px}
  .gcard .gc-top{display:contents}
  .gcard .gc-l{flex:1;min-width:0}
  .gcard .gc-nm{font-size:15px;line-height:1.25}
  .gcard .gc-ph{font-size:12px;line-height:1.35;white-space:nowrap;overflow:hidden;
    text-overflow:ellipsis}
  /* цифры прижаты вправо и переносятся в две строки — ровно на ту же высоту, что имя
     с телефоном слева, зато имени остаётся ширина, чтобы влезть в одну строку */
  .gcard .gc-n{margin:0;flex:none;max-width:46%;justify-content:flex-end;white-space:nowrap;
    gap:0 7px;font-size:11px;line-height:1.45}
  /* заметка и «открытый чек» — своими строками под первой */
  .gcard > .sub.mt,.gcard > .btn.mt{flex:0 0 100%;margin-top:6px;min-height:0}
  .gcard > .btn.mt{min-height:34px}
  .gcard .gedit{flex:none;margin:0}
  .gcard .gedit[open]{flex:1 0 100%;margin-top:6px}
  .gcard .gedit > summary{width:auto!important;min-height:32px;padding:0 8px;
    display:inline-flex;align-items:center;justify-content:center}
  .gedit-ic{display:flex;width:18px;height:18px}
  .gedit-ic svg{width:18px;height:18px}
}
/* 791: подписи столбиков на телефоне — вертикально, внутри столбика от его низа */
@media(max-width:700px){.week-bars .b .num{top:auto;bottom:4px;left:50%;right:auto;margin-left:-7px;writing-mode:vertical-rl;transform:rotate(180deg);line-height:14px;font-size:10px}
.week-bars .b.hot .num{color:#fff}}
@media(min-width:901px){.dashcol{display:flex;flex-direction:column;gap:12px}
  .dashcol > .card{margin-bottom:0}.dashcol > .card:last-child{flex:1}}   /* 1933: низ правой колонки = низ «Топ-10» */
@media(max-width:900px){.dashcol{display:contents}}

@media(max-width:600px){
  .topbar .brandcol{flex-direction:row;align-items:center;gap:10px;padding:6px 8px 6px 0}
  .topbar .brandcol .orgline{margin-top:0;max-width:110px}
}

@media(max-width:700px){
  .pagehead.gph>h1{order:-2}
  .pagehead.gph>.tabs{order:-1;flex:1 0 100%}
  .pagehead.gph>.pagehead-search{order:0;flex:1 1 auto;max-width:none}
  .pagehead.gph>.phtail{order:0}
  .tabs.gsegs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .tabs.gsegs::-webkit-scrollbar{display:none}
  .tabs.gsegs a{white-space:nowrap;flex:none}
}
/* 796/800: «+» в шапке раздела на телефоне — просто оранжевый крестик, без рамки и заливки;
   .ricon — квадратная кнопка-значок у поиска (сканер). Общие для Справочника и складских листов */
.pagehead > .refadd{display:none}
.ricon{width:42px;height:42px;flex:none;align-items:center;justify-content:center;padding:0;
  border:1px solid var(--line);border-radius:12px;background:#fff;color:var(--accent);cursor:pointer}
.ricon svg{width:20px;height:20px}
@media(max-width:700px){
  .pagehead > .refadd.mobonly{display:block;width:auto;flex:none;margin:0 0 0 auto;order:0}
  .pagehead > .refadd .btn,.pagehead > a.refadd{padding:0;width:38px;height:38px;font-size:30px;font-weight:400;line-height:1;
    display:inline-flex;align-items:center;justify-content:center;background:none;border:0;box-shadow:none;color:var(--accent)}
  .mfilt .ricon{display:inline-flex}
}
@media(max-width:700px){.mfilt .ricon{order:-4}}  /* 800: сканер слева от поиска, как в Номенклатуре */
/* 797: суммы в плашках счетов на телефоне не влезали («12 000.00 AED») */
@media(max-width:700px){.acccards .stat .v{font-size:13px}}
/* 798: две плашки подряд (депозиты у нас / должники) — в одну строку, суммы одной строкой */
@media(max-width:700px){
  .cards:has(> .stat:nth-child(2):last-child){grid-template-columns:1fr 1fr;gap:8px}
  .cards:has(> .stat:nth-child(2):last-child) .stat{padding:12px 14px}
  .cards:has(> .stat:nth-child(2):last-child) .stat .l{font-size:12px}
  .cards:has(> .stat:nth-child(2):last-child) .stat .v{font-size:18px;margin-top:2px;padding-bottom:6px;white-space:nowrap}
  .cards:has(> .stat:nth-child(2):last-child) .stat .sub{font-size:12px}
}

@media(max-width:700px){.mfilt.fon .mfilt-fields .mfilt-reset{display:none}}
@media(max-width:700px){.mfilt.fon>.ricon{display:none}}  /* 800: в открытом листе фильтра сканеру не место */

.rc-img{width:44px;height:44px;flex:none;border-radius:10px;background:var(--bg);
  border:1px solid var(--line);display:flex;align-items:center;justify-content:center;
  overflow:hidden;font-weight:700;font-size:16px;color:var(--muted)}
.rc-img img{width:100%;height:100%;object-fit:cover}
.refcards .dc-l{flex:1;min-width:0}
.refcards .dc-sub{display:block}
.refcards .dc-a .sub{font-weight:400;font-size:12px}
@media(max-width:700px){.refcards .dc-row{align-items:center}}
/* остаток — значком корзинки и числом под названием, как на референсе Арса */
.rc-cart{width:15px;height:15px;vertical-align:-3px;margin-right:6px}

@media(max-width:700px){.mfilt.fon.card{border:0;border-radius:0;box-shadow:none}}
/* на широком экране порядок строки прежний: поля, поиск, кнопки. Общее правило
   .mfilt .msearch{order:9} уносит поиск в самый конец — там, где кнопок нет */
@media(min-width:701px){
  .filters.mfilt.card .msearch{order:1}
  .filters.mfilt.card > .btn{order:2}
}
/* кнопка создания в шапке: на телефоне — оранжевый крестик в правом верхнем углу
   (как .refadd в Справочнике), на широком экране подпись остаётся целиком */
@media(max-width:700px){
  .pagehead > .btn.phplus{padding:0;width:38px;height:38px;min-height:0;font-size:30px;
    font-weight:400;line-height:1;background:none;border:0;box-shadow:none;color:var(--accent)}
}

@media(max-width:700px){
  .pagehead > button.refadd{padding:0;width:38px;height:38px;font-size:30px;font-weight:400;
    line-height:1;display:inline-flex;align-items:center;justify-content:center;
    background:none;border:0;box-shadow:none;color:var(--accent)}
  .pagehead.gph > .refadd.mobonly{order:-2}
}
.refcards .dc-sub.neg{color:var(--red);font-weight:600}
@media(max-width:700px){.pagehead > a.refadd.mobonly,.pagehead > button.refadd.mobonly{width:38px}}  /* 805: у плюсика-ссылки ширина под палец, а не по крестику */
@media(max-width:700px){.pagehead > a.refadd.mobonly,.pagehead > button.refadd.mobonly{display:inline-flex;
  align-items:center;justify-content:center}}
/* 806: вкусовой профиль последней строкой карточки гостя в кипере */
.gc-taste{margin-top:6px;line-height:1.35}
@media(max-width:700px){.gcard > .gc-taste{flex:0 0 100%;font-size:12px;order:9}}
/* 807: показатели в карточке гостя на телефоне — по три в строку, мельче */
@media(max-width:700px){.cards.gstats{grid-template-columns:repeat(3,1fr);gap:6px}
.gstats .stat{padding:8px 8px}.gstats .stat .l{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gstats .stat .v{font-size:13px;margin-top:2px;padding-bottom:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}}
/* 808/809: вкусовой профиль — цветные плашки в одну-две строки, заметка под ним; карандаш строго за цифрами */
.gc-taste{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
.gc-taste .badge{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gc-note{margin-top:6px}
@media(max-width:700px){.gcard > .gc-taste{flex:0 0 100%;margin-top:6px;order:9}.gcard > .gc-note{flex:0 0 100%;order:10;font-size:12px;line-height:1.35}
.gc-taste .badge{font-size:11px;padding:2px 7px;line-height:16px}
.gcard .gc-n{margin-right:0}.gcard .gedit{margin-left:auto}}

@media(max-width:640px){
  .wrap{padding-bottom:calc(86px + env(safe-area-inset-bottom))}
}

@media(max-width:600px){
  .topbar-in,.pos-top{position:relative}
  .topbar-in>.brandcol{display:contents}
  .topbar-in>.brandcol>.logomenu{order:-3}
  .topbar .mobshift{position:static;order:-2;transform:none;margin:0 0 0 8px}
  .topbar-in>.brandcol>.orgline{order:-1;margin:0 0 0 8px}
  /* 11px, а не 8: в кипере точка лежит внутри строки со своим отступом — так её центр
     встаёт на ту же координату, что в Офисе. Подпись отбита от точки на 8px */
  .pos-top .topshift{position:static;transform:none;margin:0 0 0 20px;gap:8px}
  .topbar .mobshift i{width:6px;height:6px}
}
/* 815: техкарты на телефоне мельче — больше строк в экран; маржа перед ценой с зазором */
@media(max-width:700px){.tccards .dc-row{padding:6px 12px;gap:8px;min-height:0}.tccards .dc-l b{font-size:14px}.tccards .dc-sub{font-size:12px;margin-top:1px}
.tccards .dc-a{font-size:14px}.tccards .dc-a .tc-m{margin-right:12px}}
/* 814: таблицы в карточке гостя на телефоне — строки ниже, шрифт мельче */
@media(max-width:700px){.gview td{padding:3px 8px;font-size:13px}.gview th{padding:4px 8px;font-size:11px}.gview .badge{padding:1px 7px;font-size:11px}}

@media(max-width:700px){
  .dc-cmt{margin-top:2px;font-size:13px;line-height:1.3;color:var(--muted);
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
}
@media(max-width:700px){.cards.paystats{grid-template-columns:1fr 1fr}}

.chainflow>.chain-row{align-items:flex-start}          /* было inline в op_view.html */
.chainflow>.chain-row>.chain-arrow{margin-top:22px}
@media(max-width:700px){
  .chainflow{overflow-x:auto;padding:2px}
  .chainflow .chain-row,.chainflow>.chain-row{flex-direction:column;align-items:stretch;gap:6px}
  .chain-branches{gap:14px;padding-left:12px;border-left:2px solid var(--line)}
  .chain-branches > .chain-row::before,.chain-branches > .chain-row::after,
  .chain-branches .chain-row > a.chain-box + a.chain-box::before{display:none}
  .chain-branches .chain-row > a.chain-box + a.chain-box{margin-left:0}
  .chain-box{min-width:0;padding:8px 10px}
  .chain-box .t,.chain-box .d{font-size:12px}
  .chain-box .n,.chain-box .s{font-size:13px}
  /* «→» между документами становится «↓» — связь идёт сверху вниз */
  .chain-arrow,.chainflow>.chain-row>.chain-arrow{font-size:15px;line-height:1;
    align-self:flex-start;margin:0 0 0 8px;transform:rotate(90deg)}
}

@media(max-width:700px){
  .linecards tr{padding:6px 0}
  .linecards td.rownum{min-height:34px}
  .linecards td:has(.edname),.linecards td:has(input[list=items_dl]){font-size:14px}
  .linecards td:has([name=qty]),.linecards td:has([name=price]),
  .linecards td:has(.rowsum){display:block}
  /* колонка НДС по-прежнему появляется только при включённом НДС (.vat-on) */
  .vat-on .linecards td.vatcol{display:block}
  .linecards td:has([name=qty])::after{content:none}
  .linecards td:has([name=qty])::before{content:'кол-во'}
  .linecards td:has([name=price])::before{content:'цена'}
  .linecards td:has(.rowsum)::before{content:'сумма'}
  .linecards td.vatcol::before{content:'НДС'}
  .linecards td:has([name=qty])::before,.linecards td:has([name=price])::before,
  .linecards td:has(.rowsum)::before,.linecards td.vatcol::before{display:block;
    font-size:11px;line-height:1.35;font-weight:600;color:var(--muted)}
  /* поля ужаты с 40px, но не ниже 38: ниже палец начинает мазать по соседней колонке */
  #edlines.linecards td input{min-height:38px;padding:4px 7px}
  #edlines.linecards td select{min-height:38px;padding:4px 7px}
  .linecards td.vatcol select{min-width:0!important;width:100%}
  /* «принято/остаток» у заказа поставщику подписаны строчно — их держим мельче в тон */
  .linecards[data-po] td:nth-child(4),.linecards[data-po] td:nth-child(5){font-size:13px}
}

@media(max-width:700px){
  .frow .field:has(> select[name=reason]){flex:1 0 100%}
}

textarea.cmt{resize:none;overflow:hidden;line-height:1.35}
@media(max-width:700px){
  /* в шапке документа строки «подпись — значение»; комментарий длинный, ему нужна
     вся ширина, поэтому подпись встаёт над полем */
  .ophead .field:has(> textarea.cmt){display:block;padding:8px 0}
  .ophead .field:has(> textarea.cmt) > label{margin-bottom:4px}
  .ophead .field > textarea.cmt{width:100%;max-width:none;text-align:left;
    border-color:var(--line);background:#fff;padding:8px 10px}
}

@media(max-width:700px){
  .gbar__row>b{order:-2}
  .gbar__row>span:last-child{order:-1;margin-left:auto}
  .gbar__row>.sub{flex-basis:100%}
  .gbar__row>span:last-child .btn.sm{min-height:32px;padding:5px 10px;font-size:13px}
  .gbar__who{display:flex;flex-direction:column;flex:1;min-width:0;order:-2}
  .gbar__who .sub{line-height:1.3}
  .gbar, .pos-fit .gbar{margin-bottom:6px}
  .pos-mtabs{margin-bottom:6px;padding-top:6px;padding-bottom:6px}
  .pos-grid{row-gap:6px}
  .pos-grid > .lgrow{margin-bottom:0}
}

@media(max-width:700px){
  .pos-mtabs{top:-16px}
  .pos-grid.m-check .pos-check__foot,.cartbar,.tblact{left:0;right:0;border-radius:0;
    border:0;border-top:1px solid var(--line);box-shadow:0 -8px 20px -14px rgba(0,0,0,.35)}
}
@media(min-width:601px) and (max-width:700px){
  .pos-mtabs{margin-left:-16px;margin-right:-16px;padding-left:16px;padding-right:16px}
}

@media(max-width:700px){
  .shift-hero .cards{grid-template-columns:repeat(3,1fr);gap:6px;margin-bottom:12px}
  .shift-hero .stat{padding:8px 8px}
  .shift-hero .stat .l{font-size:11px;line-height:1.25}
  .shift-hero .stat .v{font-size:13px;margin-top:2px;padding-bottom:0;white-space:nowrap}
  .shift-hero .stat .sub{font-size:11px;line-height:1.3;margin-top:2px}
}

@media(max-width:700px){
  .shclose .field{flex-wrap:wrap}
  .shclose .field>.sub{flex:1 0 100%;max-width:none;text-align:right;margin-top:-10px;padding:0 0 4px}
  .shclose{display:flex;flex-wrap:wrap;align-items:center}
  .shclose>.field{flex:1 0 100%}
  .shclose>.field.wide{flex:1 1 0;min-width:0;flex-wrap:nowrap;border-bottom:0}
  .shclose>.field.wide>input{flex:1 1 auto;max-width:none;text-align:left}
  .shclose>.btn{flex:none;margin:0 0 0 10px}
}

.shcards .dc-no{flex:none;min-width:26px;padding-top:2px;font-weight:700;font-size:13px;
  color:var(--muted);font-variant-numeric:tabular-nums}
.shcards .dc-l{flex:1;min-width:0}
.shcards .dc-sub{display:block}
.shcards .dc-sub .badge{margin-left:2px}
.shcards .dc-a{text-align:right}
.shcards .dc-a .sub{display:block;font-weight:400;font-size:12px}

@media(max-width:700px){.s-bar:has(+ .tscroll.hide-mob){display:none}}

@media(max-width:700px){
  .pagehead:has(form label.chk) > details.colcfg{order:10;margin-right:0}
}

@media(max-width:700px){
  /* колонки задаёт таблица, строка их наследует (subgrid) — иначе у каждой строки
     ширины свои, и поля соседних позиций стоят вразнобой */
  .linecards tbody{display:grid;column-gap:4px;
    grid-template-columns:28px minmax(0,1fr) 54px 60px 72px 30px}
  .linecards tr{grid-column:1/-1;grid-template-columns:subgrid;gap:2px 4px}
  /* крестик и плюс были 36px — в колонке 30px они вылезали за карточку и таблица
     начинала ездить вбок; ужимаем по ширине, высоту тач-цели оставляем */
  #edlines.linecards .xbtn.del{width:30px;height:30px;min-height:30px}
  #edlines.linecards .xbtn.plus{width:28px;height:40px;min-height:40px}
  .linecards td.rownum{grid-area:1/1}
  .linecards td:has(.edname),.linecards td:has(input[list=items_dl]){grid-area:1/2;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}
  .linecards td:has([name=qty]){grid-area:1/3}
  .linecards td:has([name=price]){grid-area:1/4}
  .linecards td:has(.rowsum){grid-area:1/5}
  .linecards td:has(.xbtn.del){grid-area:1/6}
  /* ставка НДС (когда налог включён) — отдельной строчкой под числами, не на всю
     ширину: иначе селект перевешивает саму позицию */
  .vat-on .linecards td.vatcol{grid-area:3/3/auto/7}
  .linecards[data-po] td:nth-child(4){grid-area:2/2/auto/4}
  .linecards[data-po] td:nth-child(5){grid-area:2/4/auto/7}
  .linecards[data-po] td:nth-child(4),.linecards[data-po] td:nth-child(5){
    font-size:11px;color:var(--muted);text-align:left}
  .linecards[data-wo] td:nth-child(4){grid-area:2/2/auto/4}
  .linecards[data-wo] td:nth-child(5){grid-area:2/4/auto/7}
  .linecards[data-wo] td:nth-child(4)::before{content:'отгружено '}
  .linecards[data-wo] td:nth-child(5)::before{content:'доступно '}
  .linecards[data-wo] td:nth-child(4),.linecards[data-wo] td:nth-child(5){
    font-size:11px;color:var(--muted);text-align:left}
  .linecards[data-wo] td:has([name=disc]){grid-area:3/3/auto/5;display:flex;align-items:center;gap:4px}
  .linecards[data-wo] td:has([name=disc])::before{content:'скидка %';color:var(--muted);font-size:11px;white-space:nowrap}
  .vat-on .linecards[data-wo] td.vatcol{grid-area:3/5/auto/7}
  /* пустая строка набора: в 90px название не ввести — ей первая строка целиком,
     поля встают под своими колонками второй строкой */
  .linecards tr:has(.plus) td:has(input[list=items_dl]){grid-area:1/2/auto/6}
  .linecards tr:has(.plus) td:has([name=qty]),
  .linecards tr:has(.plus) td:has([name=price]),
  .linecards tr:has(.plus) td:has(.rowsum){grid-row:2}
  /* поля ужимаются по бокам, а не по шрифту: 16px обязательны */
  #edlines.linecards td input{padding:4px 4px}
  #edlines.linecards td{padding-left:0;padding-right:0}
}
@media(max-width:700px){
  @supports (field-sizing:content){
    /* minmax(0,auto): длинное число забирает своё, но не выпихивает таблицу за
       экран — при нехватке колонки ужимаются, а не рвут карточку вбок */
    .linecards tbody{grid-template-columns:28px minmax(44px,1fr)
      minmax(0,auto) minmax(0,auto) minmax(0,auto) 30px}
    #edlines.linecards td input.num{field-sizing:content;width:auto;
      min-width:44px;max-width:92px}
  }
}

.ihelpd > summary{list-style:none;cursor:pointer;display:flex;align-items:flex-start;
  gap:6px;min-height:32px}
.ihelpd > summary::-webkit-details-marker{display:none}
.ihelpd .ihelp{flex:none;width:18px;height:18px;margin:2px 0 0;font-size:11px}
.ihelpd[open] .ihelp{border-color:var(--accent);color:var(--accent)}

@media(max-width:700px){
  .gcard{position:relative}
  .gcard .gedit,.gcard .gedit[open]{flex:0 0 100%;margin:0}
  .gcard .gedit > summary{position:absolute;top:8px;right:10px;margin:0}
  .gcard .gc-n{margin-right:36px}
}

.gedit-ic{display:flex;width:18px;height:18px}
.gedit-ic svg{width:18px;height:18px}
.gcard{position:relative}
.gcard .gedit,.gcard .gedit[open]{margin:0}
.gcard .gedit > summary{position:absolute;top:8px;right:10px;margin:0;width:auto;
  min-height:32px;padding:0 8px;display:inline-flex;align-items:center;justify-content:center}
@media(min-width:701px){.gcard .gc-nm{padding-right:34px}}

@media(min-width:701px){
  .chk-line{gap:6px}
  .chk-nm{flex-basis:96px;min-width:96px}
  .chk-line .pricepop{margin-left:auto}
}

@media(max-width:700px){
  .chk-line{flex-wrap:nowrap;gap:6px;padding:4px 0}
  .chk-line .chk-nm{flex:1 1 auto;min-width:0}
  .chk-line .n{font-size:13px}
  .chk-line .qtybtn{width:28px;height:28px;min-height:28px;font-size:15px;flex:none}
  .chk-line form[action$="/qty"]{gap:4px!important;flex:none}
  .chk-line form[action$="/qty"] b{min-width:16px!important;font-size:13px}
  .chk-line .pricepop{margin-left:0;flex:none}
  .chk-line .sum{min-width:58px;font-size:14px}
  .chk-line .notepop .qtybtn svg{width:13px;height:13px}
}
@media(max-width:430px){ .chk-line .addedat{display:none} }
@media(max-width:700px){
  .chk-line .sum{display:flex;flex-direction:column;align-items:flex-end;line-height:1.15}
  .chk-line .sum[data-at]:not([data-at=""])::after{content:attr(data-at);font-size:11px;
    font-weight:500;opacity:.62;font-variant-numeric:tabular-nums}
}

.paytgl{position:absolute;width:1px;height:1px;opacity:0;margin:0;pointer-events:none}
/* «Итого» стало <label>, и на него село общее правило label{color:muted;margin-bottom:4px}
   из шапки файла — на планшете строка итога посерела. Возвращаем ей прежний вид */
label.total-row{color:var(--ink);margin-bottom:0}
@media(min-width:701px){.paytgl{display:none}}  /* лишний таб-стоп на десктопе не нужен */
@media(max-width:700px){
  /* закрыто: в подошве видна только кнопка «Итого» */
  .pos-grid.m-check .pos-check__foot .paytgl:not(:checked)~*:not(.total-row){display:none}
  /* и списку позиций достаётся высота, которую раньше съедали кнопки */
  .pos-grid.m-check:has(.pos-check__foot .paytgl:not(:checked)){padding-bottom:140px}
  .pos-grid.m-check .pos-check__foot{padding:0 16px}
  .pos-grid.m-check .pos-check{margin-left:-12px;margin-right:-12px;border:0;border-radius:0;
    box-shadow:none;padding:12px 16px}
  .pos-grid.m-check .pos-check__foot:has(.paytgl:checked){padding-top:10px;padding-bottom:12px}
  /* кнопка во всю ширину полосы: боковые отступы подошвы отыгрываются отрицательным
     полем, иначе в закрытом виде кнопка висела бы с полями по 16px */
  .pos-grid.m-check .pos-check__foot .total-row{margin:0 -16px;padding:0 16px;border:0;
    border-radius:0;min-height:44px;justify-content:flex-start;gap:10px;font-size:16px;
    background:var(--accent-btn);color:#fff;cursor:pointer;-webkit-tap-highlight-color:transparent}
  .favs{font-size:12px}
  .pos-grid.m-check .pos-check__foot .total-row .num{margin-left:auto;color:#fff}
  .pos-grid.m-check .pos-check__foot .total-row:active{opacity:.92}
  .pos-grid.m-check .pos-check__foot .paytgl:focus-visible~.total-row{outline:2px solid #fff;outline-offset:-4px}
  /* галочка-стрелка: вверх, когда лист открыт */
  .pos-grid.m-check .pos-check__foot .total-row::after{content:'';width:9px;height:9px;
    border:solid currentColor;border-width:0 2px 2px 0;transform:translateY(-2px) rotate(-135deg);
    transition:transform .18s cubic-bezier(.23,1,.32,1)}
  .pos-grid.m-check .pos-check__foot .paytgl:checked~.total-row::after{transform:translateY(2px) rotate(45deg)}
  /* одинокая кнопка «Депозит + нал» лежала в половину ширины — в листе оплаты
     она занимает всю строку */
  .pos-grid.m-check .pos-check__foot .paybtns>.btn:only-child{grid-column:1/-1}
  /* выезд листа: только opacity/transform, 200ms, ease-out */
  .pos-grid.m-check .pos-check__foot .paytgl:checked~*:not(.total-row){
    animation:paysheet .2s cubic-bezier(.23,1,.32,1)}
}
@keyframes paysheet{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){
  .pos-check__foot .total-row::after{transition-duration:.01ms}
  .pos-check__foot .paytgl:checked~*:not(.total-row){animation-duration:.01ms}
}

@media(max-width:700px){
  .deprows tr.rowlink a{pointer-events:none}
}

@media(max-width:700px){
  .tscroll table.gchecks td.num{white-space:normal}
}

.opedt{position:absolute;width:1px;height:1px;opacity:0;margin:0;pointer-events:none}
.opro,.opro-t,.opro-h,.opedt-b,.opedt-c{display:none}
@media(min-width:701px){.opedt{display:none}}   /* лишний таб-стоп на десктопе не нужен */
@media(max-width:700px){
  .opro{display:block}
  .opro-t,.opro-h{display:block}
  .opedt-b{display:inline-flex}
  .opedt-c{display:inline-flex;margin:0 0 0 auto;order:0}
  /* два режима одной карточки: .roonly — просмотр, .edonly — правка. Правило ловит и
     сами карточки-соседи флажка, и всё, что лежит у них внутри */
  .opedt:not(:checked)~.edonly,.opedt:not(:checked)~* .edonly{display:none!important}
  .opedt:checked~.roonly,.opedt:checked~* .roonly{display:none!important}

  .pagehead>label.refadd.opedt-b,.pagehead>a.refadd.opedt-b{width:38px;height:38px;flex:none;margin:0 0 0 auto;order:0;
    align-items:center;justify-content:center;background:none;border:0;color:var(--accent);
    cursor:pointer;-webkit-tap-highlight-color:transparent}
  .pagehead>label.refadd.opedt-b svg,.pagehead>a.refadd.opedt-b svg{width:21px;height:21px}
  .pagehead>label.opedt-c{min-height:38px}

  /* шапка для чтения: те же строки «подпись — значение», но плотнее формы —
     читать проще, чем попадать пальцем */
  .opro-h .field{min-height:0;padding:7px 0}
  .opro-h .field>div.whobox{align-items:flex-end;text-align:right}

  .opro-r{display:flex;align-items:center;gap:10px;padding:9px 0;color:inherit;
    text-decoration:none;border-bottom:1px solid var(--line)}
  .opro-r:last-child{border-bottom:0}
  .opro-n{flex:none;min-width:24px;white-space:nowrap;text-align:right;color:var(--muted);font-size:13px;
    line-height:1.3;font-variant-numeric:tabular-nums}
  .opro-r{gap:8px}
  .opro{margin-left:-10px;margin-right:-10px}
  .opro-n{min-width:18px}
  .opro-r{padding-right:14px}   /* 1782: правую колонку не перекрывает полоса прокрутки */
  .opro .rc-img{width:34px;height:34px;border-radius:50%;font-size:13px;flex:none}
  .opro-l{flex:1;min-width:0;line-height:1.3}
  .opro-l b{display:block;font-weight:600;font-size:15px}
  .opro-q,.opro-x{display:block;color:var(--muted);font-size:13px;margin-top:2px}
  .opro-s{flex:none;font-weight:600;font-size:15px}
  .opro-t{margin-top:0}
  /* 1988: количество × цена по центру строки: слева название (и остаток под ним), справа сумма */
  .opro-r:has(> .opro-l > .opro-q){display:grid;grid-template-columns:auto auto minmax(0,1fr) auto minmax(56px,auto);row-gap:0}
  .opro-r:has(> .opro-l > .opro-q):not(:has(> .rc-img)){grid-template-columns:auto minmax(0,1fr) auto minmax(56px,auto)}
  .opro-r:has(> .opro-l > .opro-q) .opro-l{display:contents}
  .opro-r:has(> .opro-l > .opro-q) > :is(.opro-n,.rc-img){grid-row:1 / span 2}
  .opro-r:has(> .opro-l > .opro-q) .opro-l b{grid-column:-4 / -3;grid-row:1;align-self:end;min-width:0}
  .opro-r:has(> .opro-l > .opro-q) .opro-x{grid-column:-4 / -3;grid-row:2;align-self:start}
  .opro-r:has(> .opro-l > .opro-q):not(:has(.opro-x)) .opro-l b{grid-row:1 / span 2;align-self:center}
  .opro-r:has(> .opro-l > .opro-q) .opro-q{grid-column:-3 / -2;grid-row:1 / span 2;margin:0;white-space:nowrap;text-align:center;font-size:14px;font-variant-numeric:tabular-nums}
  .opro-r:has(> .opro-l > .opro-q) .opro-s{grid-column:-2 / -1;grid-row:1 / span 2;text-align:right}
  /* 2187: на телефоне просмотр всегда карточками: название на всю ширину,
     под ним мелко количество × цена и сумма справа, ниже «принято · остаток» */
  .opro.roonly .opro-r:has(> .opro-l > .opro-q){grid-template-columns:auto auto minmax(0,1fr) auto}
  .opro.roonly .opro-r:has(> .opro-l > .opro-q):not(:has(> .rc-img)){grid-template-columns:auto minmax(0,1fr) auto}
  .opro.roonly .opro-r:has(> .opro-l > .opro-q) > :is(.opro-n,.rc-img){grid-row:1 / span 3}
  .opro.roonly .opro-r:has(> .opro-l > .opro-q) .opro-l b{grid-column:-3 / -1;grid-row:1;align-self:end}
  .opro.roonly .opro-r:has(> .opro-l > .opro-q) .opro-q{grid-column:-3 / -2;grid-row:2;margin-top:2px;text-align:left;
    white-space:normal;font-size:13px}
  .opro.roonly .opro-r:has(> .opro-l > .opro-q) .opro-s{grid-column:-2 / -1;grid-row:2;align-self:end}
  .opro.roonly .opro-r:has(> .opro-l > .opro-q) .opro-x{grid-column:-3 / -1;grid-row:3}
  /* 2114: инвентаризация — «учёт» и факт у каждой строки в колонках одной ширины и по правому краю, цифры не плавают */
  .opro-r.inv-card:has(> .opro-l > .opro-q){grid-template-columns:auto auto minmax(0,1fr) minmax(84px,auto) minmax(58px,auto)}
  .opro-r.inv-card:has(> .opro-l > .opro-q):not(:has(> .rc-img)){grid-template-columns:auto minmax(0,1fr) minmax(84px,auto) minmax(58px,auto)}
  .opro-r.inv-card .opro-q{text-align:right}
  .opro-r.inv-card .opro-s{font-variant-numeric:tabular-nums}
}

@media(max-width:700px){
  .tscroll table.deprows td[data-c=last]{white-space:normal}
}
@media(max-width:700px){.pagehead>label.refadd.opedt-b,.pagehead>a.refadd.opedt-b{display:inline-flex}}

@media(max-width:700px){
  .tscroll table.deprows th[data-c=last]{white-space:normal}
}

.otabs{margin-top:10px;display:flex;flex-wrap:wrap;gap:8px}
@media(max-width:700px){
  .otabs{display:grid;grid-template-columns:1fr 1fr}
  .otabs > .btn{min-height:36px;padding:6px 8px;font-size:12px;line-height:1.3;
    white-space:normal;overflow-wrap:anywhere;justify-content:flex-start;text-align:left}
}
.otabs .osum{white-space:nowrap}

@media(max-width:700px){
  .gc-taste{min-width:0}
  .gc-taste .badge{white-space:normal;overflow:visible;text-overflow:clip;
    overflow-wrap:anywhere;max-width:100%;line-height:1.35}
}

@media(max-width:600px){
  .pos-grid.m-check .pos-check__foot,.cartbar{
    bottom:calc(64px + max(8px, env(safe-area-inset-bottom)))}
}
@media(max-width:700px){
  body:has(.pos-tabs) .pos-grid.m-check .pos-check__foot,body:has(.pos-tabs) .cartbar{
    bottom:var(--pos-tabs-h, calc(66px + env(safe-area-inset-bottom)))}
}

@media(max-width:600px){
  .pos-menu .cat-chips{gap:6px;margin-bottom:10px}
  .pos-menu .cat-chip{min-height:36px;padding:7px 14px;font-size:13px}
  .pos-menu .menu-btns{grid-template-columns:repeat(auto-fill,minmax(78px,1fr));gap:8px}
  .pos-menu .menu-btn{padding:0 0 6px;min-height:0;gap:5px;border-radius:12px;overflow:hidden}
  .pos-menu .menu-btn .mimg{width:100%;height:80px;border-radius:0}
  /* имя обрезаем двумя строками: у «Champagne "Moet & Chandon"» в 78px иначе
     шесть строк, и плитки в ряду разной высоты */
  .pos-menu .menu-btn .mname{font-size:12px;line-height:1.2;padding:0 6px;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
  .pos-menu .menu-btn .mprice{font-size:13px;padding:0 6px 2px}
  .pos-menu .menu-grp h3{font-size:12px;margin-bottom:6px}
}

.deplink{color:inherit;text-decoration:underline dotted currentColor;
  text-underline-offset:3px;text-decoration-thickness:1px}
.deplink:hover{text-decoration-style:solid}

.docfavbar{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 2px}
.docfavbar:empty{display:none}
.docfavbar a,.wrap .docfavbar a{padding:9px 13px;border-radius:11px;background:var(--panel);
  border:1px solid var(--line);color:var(--ink);font-weight:600;font-size:14px;
  line-height:1.15;text-decoration:none}
.docfavbar a:active{color:var(--accent)}
/* строка едет по transform, звезда лежит под ней; overflow режет вылет за карточку */
.docrow{position:relative;overflow:hidden;touch-action:pan-y}
.docrow>a,.wrap .docrow>a{position:relative;z-index:1;background:var(--card);
  transition:transform .24s cubic-bezier(.23,1,.32,1)}
.docrow.sw>a{transform:translateX(72px)}   /* свайп вправо открывает звезду слева; влево — удаление */
/* разделители: раньше их держал «.doclist a:last-child», теперь строка обёрнута в .docrow */
.doclist .docrow a{border-bottom:1px solid var(--line)}
.doclist .docrow:last-child a{border-bottom:0}
.docstar{position:absolute;z-index:0;top:0;left:0;bottom:0;width:72px;display:flex;
  align-items:center;justify-content:center;padding:0;border:0;border-radius:0;
  background:#F5C542;color:#fff;cursor:pointer}
.docstar svg{width:23px;height:23px}
.docstar.on svg{fill:currentColor}
@media (min-width:701px){
  .docrow>a{transition:none}
  .docstar{z-index:2;left:auto;right:26px;width:30px;background:none;color:var(--muted);
    opacity:0;transition:opacity .15s cubic-bezier(.23,1,.32,1)}
  .docrow:hover .docstar,.docstar:focus-visible,.docstar.on{opacity:1}
  .docstar.on{color:#E0A800}
}
@media (prefers-reduced-motion:reduce){.docrow>a{transition-duration:.12s}}

@media(max-width:700px){
  .tccards .dc-a{display:flex;flex-direction:column;align-items:flex-end}
  .tccards .dc-a .tc-cost{font-size:12px;font-weight:400;color:var(--muted);margin-top:1px}
}

@media(max-width:700px){
  .cards.istats{grid-template-columns:1fr 1fr;gap:6px}
  .istats .stat{padding:8px 8px}
  .istats .stat .l{font-size:11px;line-height:1.25}
  .istats .stat .v{font-size:13px;margin-top:2px;padding-bottom:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .istats .stat .sub{font-size:11px;line-height:1.3;margin-top:2px}
}
@media(max-width:700px){
  .pagehead.nobk>.backslot{display:none}
  .pagehead.nobk>.phbr{display:none}
  .comps table{table-layout:fixed;width:100%}
  .comps th,.comps td{padding:6px 4px;font-size:13px;overflow-wrap:anywhere;white-space:normal !important}
  .comps td:first-child,.comps th:first-child{width:36%}
  .comps td:nth-child(2),.comps th:nth-child(2){width:19%}
  .comps th .c-grip{display:none}
  .comps td:last-child,.comps th:last-child{width:34px;padding-left:0;padding-right:0}
  .comps .sub{font-size:11px;white-space:normal}
  .comps .xbtn{width:30px;height:30px;min-height:30px}
  .comps td form{margin:0}
}
.comps .xbtn.del{margin-left:auto}
[data-s="purchase"]{--sc:var(--info)}
[data-s="opt"]{--sc:var(--accent)}
[data-s="money"]{--sc:var(--green)}
[data-s="wh"]{--sc:#9B51E0}
.doclist .docrow a{gap:10px}
.doclist .dname{flex:1;min-width:0}
.dico{flex:none;width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;
  background:var(--sc);color:#fff}
.doclist a .dico svg{width:16px;height:16px;color:#fff;fill:none;stroke:currentColor;stroke-width:1.8;
  stroke-linecap:round;stroke-linejoin:round}
.docfavbar a[data-s],.wrap .docfavbar a[data-s]{background:var(--card);border-color:var(--line);color:var(--ink)}   /* 1944: цвет — только у значка */
@media(max-width:700px){
  .tabsdd .umenu-menu a.on{display:flex;justify-content:space-between;gap:12px}
  .tabsdd .umenu-menu a.on::after{content:"✓"}
}
.dico{background:color-mix(in srgb,var(--sc) 72%,#fff)}
.gc-nm{display:flex;align-items:flex-start;gap:5px}
.gc-nm>a:first-child,.gc-nm>span:first-child{min-width:0}
.gdep{flex:none;position:relative;width:18px;height:18px;border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.35),0 0 0 .5px rgba(0,0,0,.12);
  display:inline-flex;align-items:center;justify-content:center;color:var(--green);background:#fff;box-sizing:border-box}
.gdep svg{width:11px;height:11px}
.gdep::after{content:"";position:absolute;inset:-8px}
.gdep:active{background:#EAF7EF}
.persel-box{min-width:240px}
.perown-box label{min-width:0;overflow:hidden}
.perown-box input{width:100%;min-width:0}
.perown-box input[type=date]{-webkit-appearance:none;appearance:none;max-width:100%;
  padding:8px 10px 8px 30px;text-align:left;
  background:#fff no-repeat 9px center/15px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236D717F' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E")}
.perown-box input[type=date]::-webkit-date-and-time-value{text-align:left}
@media(max-width:700px){
  .cards:not(.dashcards):not(.herocards):not(.gstats):not(.istats):not(.paystats):not(.acccards){grid-template-columns:1fr 1fr;gap:6px}
  .cards:not(.dashcards):not(.herocards):not(.gstats):not(.istats):not(.paystats):not(.acccards) .stat{padding:8px 8px}
  .cards:not(.dashcards):not(.herocards):not(.gstats):not(.istats):not(.paystats):not(.acccards) .stat .l{font-size:11px;line-height:1.25}
  .cards:not(.dashcards):not(.herocards):not(.gstats):not(.istats):not(.paystats):not(.acccards) .stat .v{font-size:13px;margin-top:2px;padding-bottom:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .cards:not(.dashcards):not(.herocards):not(.gstats):not(.istats):not(.paystats):not(.acccards) .stat .sub{font-size:11px;line-height:1.3;margin-top:2px}
}
@media(max-width:700px){.gcard .gc-n{margin-right:40px}}
.cf-period{margin:-6px 0 12px}
.cfrec{margin:-6px 0 14px}
.cfrec>summary{display:flex;align-items:center;gap:6px;cursor:pointer;list-style:none;
  min-height:26px;font-size:13px;color:var(--muted);width:max-content}
.cfrec>summary::-webkit-details-marker{display:none}
.cfrec>summary:hover{color:var(--ink)}
.cfrec .gt-arr{font-size:10px;transition:transform .16s cubic-bezier(.23,1,.32,1)}
.cfrec[open] .gt-arr{transform:rotate(180deg)}
.cfrec-b{margin-top:8px;padding:10px 12px;border-radius:10px;background:var(--panel);font-size:13px}
.cfrec-b>div{display:flex;align-items:baseline;gap:12px;padding:3px 0}
.cfrec-b>div>span{flex:1;min-width:0;color:var(--muted)}
.cfrec-b .cfrec-t{margin-top:4px;padding-top:7px;border-top:1px solid var(--line);font-weight:700}
.cfrec-b .cfrec-t>span{color:var(--ink)}
@media(max-width:700px){.cfstats .stat:nth-child(3){grid-column:1/-1}}
@media(max-width:700px){.s-cnt{display:none}}
@media(max-width:700px){
  #audittbl,#audittbl tbody{display:block;width:100%}
  #audittbl tr:first-child{display:none}
  #audittbl tr{display:grid;grid-template-columns:auto minmax(0,1fr) fit-content(140px);gap:3px 8px;align-items:center;
    padding:9px 0;border-bottom:1px solid var(--line)}
  #audittbl td{display:block;padding:0;border:0;white-space:normal;background:none}
  #audittbl td:first-child{font-size:12px}
  #audittbl td[data-c=who]{font-size:13px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  #audittbl td[data-c=action] .badge{white-space:normal;text-align:center;line-height:1.25}
  #audittbl td[data-c=details]{grid-column:1/-1;font-size:13px;line-height:1.35;color:var(--muted);overflow-wrap:anywhere}
  #audittbl td[colspan]{grid-column:1/-1}
}
.badge.vio{text-transform:none;letter-spacing:0;font-size:12px}
@media(max-width:640px){.tabbar{padding-bottom:max(6px, calc(2px + env(safe-area-inset-bottom)))}}
@media(max-width:700px){
  #abctbl,#abctbl tbody{display:block;width:100%}
  #abctbl tr{display:grid;grid-template-columns:minmax(0,1fr) auto auto auto min-content;gap:1px 10px;
    align-items:center;padding:8px 0;border-bottom:1px solid var(--line)}
  #abctbl th,#abctbl td{display:block;position:static;padding:0;border:0;min-width:0;white-space:normal;background:none}
  #abctbl th:first-child,#abctbl td:first-child{grid-column:1;grid-row:1}
  #abctbl [data-c=grp]{grid-column:1;grid-row:2;font-size:12px}
  #abctbl th[data-c=grp],#abctbl [data-c=cum]{display:none!important}
  #abctbl [data-c=n]{grid-column:2;grid-row:1}
  #abctbl [data-c=s]{grid-column:3;grid-row:1}
  #abctbl [data-c=cls]{grid-column:4;grid-row:1}
  #abctbl th.gearth{grid-column:5;grid-row:1;width:auto;min-width:0;max-width:none}
  #abctbl th .c-grip{display:none}
}
@media(max-width:700px){#abctbl th{font-size:11px}#abctbl th .s-a{display:none}}  /* 887: шапка в одну строку — без стрелок, порядок по-прежнему нажатием */
.plgrp{display:none}
@media(max-width:700px){
  #plGrid,#plGrid tbody{display:block;width:100%}
  #plGrid tr{display:grid;grid-template-columns:auto minmax(0,1fr) repeat(var(--n,1),88px) 30px;gap:0 8px;
    align-items:center;padding:7px 0;border-bottom:1px solid var(--line)}
  #plGrid th,#plGrid td{display:block;position:static;padding:0;border:0;min-width:0;white-space:normal;background:none}
  #plGrid tr>:nth-child(2),#plGrid tr>:nth-child(3),#plGrid tr>:nth-child(5){display:none}
  #plGrid td[colspan]:first-child{grid-column:1/-1}
  #plGrid th{font-size:11px;width:auto!important}
  #plGrid th .c-grip,#plGrid th .s-a{display:none}
  #plGrid .plgrp{display:block;font-size:12px}
  #plGrid td input{width:100%;min-width:0}
}
/* планшет 701–840: разделы второй строкой убраны в 902 — шапка одной строкой, разделы в списке под лого */

.mob-only{display:none}
@media(max-width:700px){.hide-mob{display:none}.mob-only{display:inline}}
@media(min-width:701px){#plGrid{width:auto}}
@media(max-width:700px){#plGrid th.gearth{display:none}}
.field.doccmt textarea{width:100%;max-width:none;min-height:58px;font-size:15px;padding:9px 12px;text-align:left}
.frow .field.doccmt{flex:1 0 100%;min-width:0}
#plForm .doccmt{margin:10px 0 0}
#plGrid th.plsup{text-align:center;font-size:13px;color:var(--ink)}
#plGrid th.plsup .umenu{display:inline-block}
#plGrid th.plsup .umenu summary{justify-content:center;padding:4px 8px}
#plGrid th.plsup .umenu summary:hover{background:var(--chip)}
#plGrid th.plsup .umenu-menu{min-width:170px;text-align:left}
.cmtchip{display:inline-block;max-width:100%;padding:3px 9px;border-radius:7px;background:var(--panel);
  box-shadow:inset 0 1px 0 #fff,0 1px 2px rgba(0,0,0,.10),0 0 0 1px var(--line);color:var(--ink);font-size:13px;line-height:1.35}

.docname{font-size:20px;font-weight:800;width:auto;max-width:min(100%,320px);
  min-height:36px;padding:4px 8px}
.docname.wide{font-size:16px;max-width:min(100%,560px)}
select[name="org_id"]{font-size:12px;padding-left:8px;padding-right:22px}
#refModal .field.ptf{flex:1 0 100%;max-width:none;margin-right:0}
#refModal .field.ptf select[name="org_id"],#ptCard select[name="org_id"]{font-size:16px;padding-left:12px;padding-right:30px}
#refModal .field.ptf .sub{white-space:normal}
@media(max-width:700px){
  .ophead .field>input,.ophead .field>select,.ophead .field>div,
  .ophead select[name="org_id"],.ophead .pick input.pick-in{font-size:14px}
  .ophead .pick input.pick-in{padding-right:20px}
  .opro-h .field>div,.opro-h .field>span{font-size:14px}
  /* в шапке чтения юрлицо осталось живым списком — но выглядеть должно как соседние
     значения: без рамки и заливки, по правому краю */
  .opro-h .field>select{font-size:14px;width:auto;max-width:64%;flex:0 1 auto;text-align:right;
    border-color:transparent;background:none;padding:6px 0;min-height:0;
    -webkit-appearance:none;appearance:none}
}
.opnum{display:flex;align-items:center;gap:8px;margin-left:-8px;
  font-size:16px;font-weight:800;line-height:1}
.opnum span:not(.opdt){font-size:14px;font-weight:500;color:var(--muted)}
.opdt{display:contents}
.opnum input[name=no]{width:60px;font:inherit;min-height:32px;padding:4px 6px;text-align:center}
.opnum input[type=datetime-local]{width:170px;min-width:0;font-size:14px;font-weight:500;
  min-height:32px;padding:4px 6px 4px 30px;
  background:#fff no-repeat 9px center/15px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236D717F' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E")}
@media(max-width:700px){
  .pagehead>.opnum{display:contents}
  .pagehead>.opnum>.opdt{display:flex;align-items:center;gap:8px;flex:1 0 100%;
    font-size:16px;font-weight:800;line-height:1}
  .opnum input[type=datetime-local]{flex:0 1 auto;width:auto;min-width:0;font-size:16px;
    padding-right:4px}
  .opnum input[name=no]{font-size:16px;width:60px}
  .pagehead.docph>.backslot{display:none}
  .pagehead.docph>h1{order:-5}
  .pagehead.docph>.opnum>input[name=no],.pagehead.docph>.opnum>b{order:-4}
  .pagehead.docph>label.refadd.opedt-b,.pagehead.docph>a.refadd.opedt-b{order:-3}
  .pagehead.docph>.opnum>.opdt{order:-2;flex:0 1 auto}
  .pagehead.docph>.badge{order:-2}
  .pagehead.docph>.opst-f{order:-2}
  .pagehead.docph>.opnum>.opdt>span{display:none}
  .pagehead.docph>.phbr.phbr-sm{display:block;order:-1}
  .pagehead.dashph>h1{order:-3}
  .pagehead.dashph>.phdate{order:-2;margin-left:auto;flex:none;align-self:center}
  .pagehead.dashph>.phbr{order:-1;display:block}
  .pagehead.dashph>.tabsdd{order:0}
  .docname{font-size:20px;flex:1 1 auto;min-width:0}
  .docname.wide{font-size:14px}
}
.pagehead>.headbtns{display:flex;align-items:center;gap:8px}
.headbtns .hbgap{width:18px;flex:none}
.pagehead.docph>.hbbr,.pagehead.cardph>.hbbr{flex:1 0 100%;height:0;margin:0}
@media(min-width:701px){
  .pagehead{row-gap:8px}
  .pagehead .headbtns .btn.sm{min-height:34px;padding:6px 13px;font-size:13px}
  /* «Статус» встаёт вровень с полем даты, рядом с которым стоит */
  .pagehead .stmenu>summary{min-height:32px;padding:4px 10px}
  .pagehead:not(.ph-list) .opnum input,
  .pagehead:not(.ph-list) .stmenu>summary,
  .pagehead:not(.ph-list) .badge.opst,
  .pagehead:not(.ph-list) .headbtns .btn.sm,
  .pagehead:not(.ph-list) .headbtns > .btn,
  .pagehead:not(.ph-list) .stopt{min-height:34px;height:34px;box-sizing:border-box}
  .pagehead:not(.ph-list) .stopt{display:inline-flex;align-items:center}
  .optot .opsum .vat-lbl{display:inline-block;text-align:right}
}
/* галочка «Проведено» — в строке со статусом, а не отдельной полосой под названием */
.pagehead>form.postchk{margin:0}
.pagehead>form.postchk .chk{white-space:nowrap}
@media(max-width:700px){
  .pagehead>form.postchk{width:auto;flex:none;max-width:none}
  .pagehead.docph>form.postchk{order:-3;margin-left:0}
  .pagehead.docph>.headbtns{order:11}
  .pagehead.cardph>.hbbr{display:none}
  .pagehead.cardph>.postchk{order:1}
  /* `.opnum` стоит display:contents, поэтому «от дата» — прямой элемент строки по
     раскладке, но не по разметке: селектор через `>` его не достаёт */
  .pagehead.cardph .opdt{order:2;flex:1 1 auto;display:flex;align-items:center;gap:6px}
  .pagehead.cardph>.headbtns{order:3}
}
.cpbal{font-size:12px;color:var(--muted);padding-top:2px}
.cpbal .num{font-weight:700}
@media(min-width:701px){
  .ophead.compact .frow{display:grid;grid-template-columns:repeat(2,minmax(0,440px));
    gap:2px 40px;align-items:start}
  .ophead.compact .field{display:grid;grid-template-columns:128px minmax(0,1fr);
    align-items:center;gap:0 10px;margin:0;min-width:0;max-width:none}
  .ophead.compact .field.wide{grid-column:1/-1}
  .ophead.compact .field>label{margin:0;font-size:13px;font-weight:500;color:var(--muted)}
  .ophead.compact .field>input,.ophead.compact .field>select,
  .ophead.compact .field>textarea{font-size:13px;min-height:28px;padding:4px 8px;margin:0}
  .ophead.compact .field>div{font-size:13px;min-height:28px;display:flex;align-items:center;
    padding-left:9px}
  .ophead.compact .field>div.pick,
  .ophead.compact .field>div:has(input),
  .ophead.compact .field>div:has(select){padding-left:0}
  .ophead.compact .field>div.whobox{display:flex;flex-direction:column;align-items:flex-start}
  .ophead.compact .cpbal{grid-column:2;padding:1px 0 9px 9px}
  .ophead.compact .field>select{width:100%;-webkit-appearance:none;appearance:none;padding-right:26px;
    background:#fff no-repeat right 9px center/11px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%236D717F' stroke-width='1.8' stroke-linecap='round'%3E%3Cpath d='M2 4.5l4 4 4-4'/%3E%3C/svg%3E")}
}
@media(max-width:700px){
  /* строка баланса не третий столбец, а подстрочник: своей строкой под контрагентом */
  .ophead .field:has(.cpbal){flex-wrap:wrap}
  .ophead .field>.cpbal,.ophead .field>div.cpbal{flex:1 0 100%;max-width:none;
    text-align:right;padding:0 0 5px}
  .ophead .field:has(.cpbal){row-gap:0}
  .ophead .field>.cpbal,.ophead .field>div.cpbal{margin-top:-6px;line-height:1.3}
}
@media(min-width:701px){
  .ophead.compact .field>input,.ophead.compact .field>select,
  .ophead.compact .field>.pick{max-width:none}
  .ophead.compact .field>.pick input.pick-in{font-size:13px;min-height:28px;padding:4px 30px 4px 8px}
  .ophead.compact .cpbal{display:block;min-height:0}
  .ophead.compact .field>div>.pick{max-width:none}
  .ophead.compact .field>div>.pick input.pick-in{font-size:13px;min-height:28px;padding:4px 30px 4px 8px}
  .ophead.compact .field>div>.btn.sm{min-height:28px;padding:2px 8px}
}
@media(min-width:701px){.ophead.compact .field>div.cpbal{display:block;min-height:0;font-size:12px}}
@media(max-width:700px){
  .linecards td[data-c]{grid-column:2/7;font-size:11px;color:var(--muted);text-align:left}
  .linecards td[data-c=code]{grid-row:4}
  .linecards td[data-c=art]{grid-row:5}
  .linecards td[data-c=grp]{grid-row:6}
  .linecards td[data-c=code]::before{content:'код '}
  .linecards td[data-c=art]::before{content:'артикул '}
  .linecards td[data-c=grp]::before{content:'группа '}
}
@media(max-width:700px){
  /* у пустой строки набора кода и группы ещё нет — подписи без значений не нужны */
  .linecards td[data-c]:empty::before{content:none}
}

tr.isdraft td,.dc-row.isdraft{font-style:italic;color:var(--muted)}
tr.isarch td,.dc-row.isarch{font-style:italic;color:var(--muted)}
tr.isarch td .badge{font-style:normal}
/* 2222: позиции нет в точке из шапки — строка тише, метка «нет в точке» */
tr.nopt td,.dc-row.nopt{color:var(--muted)}
tr.nopt td img,.dc-row.nopt img{opacity:.5}

table[data-rtable=price_lists] td{padding-top:13px;padding-bottom:13px}
@media(min-width:701px){#plGrid td input.num{width:96px}}

@media(max-width:700px){
  .linecards tbody{grid-template-columns:26px minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 30px}
  .linecards td.rownum{grid-area:1/1;align-self:center}
  .linecards td:has(.edname),.linecards td:has(input[list=items_dl]){grid-area:1/2/auto/5;
    white-space:normal;overflow:visible;text-overflow:clip;font-size:14px;line-height:1.3}
  .linecards td:has(.xbtn.del){grid-area:1/5}
  .linecards td:has([name=qty]){grid-area:2/2}
  .linecards td:has([name=price]){grid-area:2/3}
  .linecards td:has(.rowsum){grid-area:2/4}
  .vat-on .linecards td.vatcol{grid-area:3/2/auto/5}
  #edlines.linecards td:has([name=pack_g]){display:block!important;grid-area:3/2/auto/4}
  #edlines.linecards td:has([name=pack_g])::before{content:'фасовка, г';display:block;
    font-size:11px;line-height:1.35;font-weight:600;color:var(--muted)}
  #edlines.linecards td.unit{grid-area:3/4/auto/6;align-self:center;font-size:12px}
  #edlines.linecards td.rowstock{grid-area:4/2/auto/6;text-align:left;font-size:13px}
  .linecards[data-po] td:nth-child(4){grid-area:4/2/auto/4}
  .linecards[data-po] td:nth-child(5){grid-area:4/4/auto/6}
  .linecards[data-wo] td:nth-child(4){grid-area:4/2/auto/4}
  .linecards[data-wo] td:nth-child(5){grid-area:4/4/auto/6}
  .linecards[data-wo] td:has([name=disc]){grid-area:3/2/auto/4}
  .vat-on .linecards[data-wo] td.vatcol{grid-area:3/4/auto/6}
  /* пустая строка набора: название во всю ширину, поля — вторым этажом под своими */
  .linecards tr:has(.plus) td:has(input[list=items_dl]){grid-area:1/2/auto/5}
  .linecards tr:has(.plus) td:has([name=qty]){grid-area:2/2}
  .linecards tr:has(.plus) td:has([name=price]){grid-area:2/3}
  .linecards tr:has(.plus) td:has(.rowsum){grid-area:2/4}
  /* этаж числами разведён на три равные колонки — поле занимает свою целиком
     (в одну строку его меряли по содержимому, field-sizing, чтобы влезло название) */
  #edlines.linecards td input.num{width:100%;max-width:none;min-width:0}
}

@media(max-width:700px){
  .sgrp .shbar{display:none}
  .swd td[data-c=d],.swd th[data-c=d],
  .swd td[data-c=level],.swd th[data-c=level]{display:none}
  .swd td[data-c=avg] .sub{display:block;font-size:11px;line-height:1.2}
}

@media(max-width:700px){
  .pagehead.docph>.headbtns>a.btn.ghost{order:2}
  .vathead .op-cnt{margin:0;flex:0 1 auto;align-self:center}
  .vathead{justify-content:flex-start;gap:10px;flex-wrap:wrap;align-items:center}
}

@media(max-width:700px){
  .dashcards{grid-template-columns:1fr 1fr;gap:8px}
  .dashcards .stat{padding:10px 12px}
  .dashcards .stat .l{font-size:12px;line-height:1.25}
  .dashcards .stat .v{font-size:18px;line-height:1.2}
  .dashcards .stat .sub{font-size:11px;line-height:1.3}
  .dashcards .stat .ico{top:8px;right:8px;width:26px;height:26px;border-radius:8px}
  .dashcards .stat .ico svg{width:15px;height:15px}
  .dashcards .stat .foot{font-size:11px;padding:6px 12px;margin:10px -12px -10px;margin-top:auto}
  .dashcards>.ds-shift{order:1}
  .dashcards>.ds-rev{order:2}
  .dashcards>.ds-dep{order:3}
  .dashcards>.ds-opt{order:4}
  .dashcards>.ds-money{order:5;grid-column:1/-1}
}

@media(max-width:700px){
  .linecards[data-po][data-rec="0"] td:nth-child(4){display:none}
  .linecards[data-po][data-rec="0"] td:nth-child(5){grid-area:4/2/auto/6}
}

@media(max-width:700px){
  .vat-on .linecards td.vatcol,.linecards td.vatcol{display:none!important}
  .vathead .vatall{display:none;align-items:center;gap:6px;margin:0;font-size:13px}
  .vat-on .vathead .vatall{display:inline-flex;white-space:nowrap}
  .vathead .vatall select{width:auto;min-height:28px;height:28px;padding:2px 20px 2px 8px;
    font-size:13px}
}

.prcmenu{min-width:250px;padding:8px;text-align:left;font-weight:500;text-transform:none;
  letter-spacing:0;white-space:normal}
.prcmenu .prch{font-weight:700;font-size:12px;margin:0 0 4px;color:var(--muted)}
.prcmenu select{width:100%;margin-bottom:5px;min-height:32px;padding:4px 22px 4px 8px;font-size:13px}
.colcfg-menu.prcmenu{width:260px;min-width:0;max-width:calc(100vw - 32px)}
.prcmenu select{max-width:100%;text-overflow:ellipsis}
.prcmenu select:disabled{color:var(--muted);background:var(--bg)}
.prcmenu .btn{width:100%;min-height:34px;padding:5px 10px;font-size:13px}

.wksum{margin-left:8px;font-weight:800;font-size:14px;white-space:nowrap}
@media(max-width:700px){.wksum{display:block;margin:2px 0 0;font-size:14px}}
.wknav{display:flex;align-items:center;gap:10px}
.wknav>span:not(.wkarr){flex:1;min-width:0}
.wkarr{flex:none;width:30px;height:30px;border-radius:9px;border:1px solid var(--line);
  background:#fff;color:var(--ink);display:flex;align-items:center;justify-content:center;
  font-size:18px;line-height:1;text-decoration:none}
.wkarr:hover{border-color:var(--accent);color:var(--accent)}
.wkarr.off{color:var(--line);border-color:var(--line);cursor:default}

.optot .opsum{font-weight:800;font-size:18px;display:flex;justify-content:flex-end;
  align-items:baseline;gap:12px;padding-top:4px}
.optot .opsum .v{font-size:20px}
.optot .ovh{display:flex;justify-content:flex-end;align-items:center;gap:10px;
  margin-top:6px;font-size:13px;color:var(--muted)}
.optot .ovh input{width:110px;min-height:32px;padding:4px 8px;text-align:right;font-size:14px}
.optot .ovh #discPct,.optot .ovh #discAmt{width:76px}
@media(max-width:700px){
  .optot .opsum{font-size:16px;justify-content:space-between}
  .optot .opsum .v{font-size:18px}
  .optot .ovh{justify-content:space-between}
}

#edlines td.rownum,#lines td.rownum,#plGrid td.rownum{cursor:grab;touch-action:none}
tr.lndrag{opacity:.65;background:var(--accent-soft)}
tr.lndrag td.rownum{cursor:grabbing}

.optot .ovh .ovhacc{width:auto;min-height:32px;height:32px;padding:4px 24px 4px 8px;font-size:13px}

.docbody{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:24px;
  align-items:end;margin-top:2px}
.docbody>.optot{min-width:280px}
.optot .opsum,.optot .opsum>span{white-space:nowrap}
.docbody>.tscroll{min-width:0}
.docbody>.s-bar{grid-column:1;grid-row:1;margin:0 0 8px}
@media(min-width:701px){
  .docbody>.bulkbar{grid-column:1;grid-row:1;justify-self:start;align-self:center;margin:-6px 0 -6px}   /* 1781: без воздуха до заголовков */
  .docbody>.s-bar{grid-column:1/-1;justify-self:end}
}
.docbody>.tscroll{grid-column:1;grid-row:2}
.docbody>.docqty{grid-column:2;grid-row:2}
.docbody>.opcmt{grid-column:1;grid-row:3}
.docbody>.optot{grid-column:2;grid-row:3}
/* «Кол-во» прижато к низу своей клетки — встаёт ровно в строку набора новой позиции,
   «Итого» так же прижато к низу своей и стоит вровень с комментарием */
.docqty{display:flex;justify-content:flex-end;padding-bottom:10px}
.docbody>.optot{margin-top:0;padding-bottom:4px}
.opcmt{margin-top:10px}
.opcmt label{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}
.opcmt textarea{width:100%;min-height:64px;font-size:14px;padding:7px 9px;resize:vertical}
.opcmt .cmtro{font-size:14px;line-height:1.35;white-space:pre-wrap}
.cmtread{white-space:pre-wrap}
.opcmt:empty{display:none}
@media(max-width:700px){
  /* на телефоне колонок нет: состав, комментарий и итоги идут друг за другом */
  .docbody{display:block}
  .docqty{padding:9px 0;border-top:1px solid var(--line)}
  .docqty:has(.qtysum:empty){display:none}
}

@media(min-width:701px){
  #edlines td input,#edlines td select{border-color:transparent;background:none;
    transition:border-color .12s,background-color .12s}
  #edlines td input::-webkit-outer-spin-button,
  #edlines td input::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;
    display:none;margin:0}
  #edlines tr:hover td input,#edlines tr:hover td select,
  #edlines td input:focus,#edlines td select:focus{border-color:var(--line);background:#fff}
  #edlines tr:has(.plus) td input{border-color:var(--line);background:#fff}
}

#edlines td input[type=number]{-moz-appearance:textfield}
#edlines td input[type=number]::-webkit-outer-spin-button,
#edlines td input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;
  display:none;margin:0}

.discwrap{display:flex;align-items:center;gap:2px;justify-content:flex-end}
.discwrap input[name=disc]{width:100%;min-width:0}
.discu{flex:none;min-width:30px;height:26px;padding:0 4px;border:1px solid transparent;
  border-radius:7px;background:none;color:var(--muted);font:inherit;font-size:12px;
  font-weight:700;cursor:pointer;line-height:1}
.discu:hover{border-color:var(--line);background:#fff;color:var(--accent)}
@media(max-width:700px){
  .linecards td.disctd{grid-area:3/2/auto/4}
  .linecards td.disctd::before{content:'скидка';display:block;font-size:11px;
    line-height:1.35;font-weight:600;color:var(--muted)}
  .discu{min-width:34px;height:30px;border-color:var(--line);background:#fff}
}

.discpop select,.discpop input[type=number]{min-height:44px}
.discpop .cat-chips{margin:10px 0 8px}
.invrec > summary{font-weight:inherit;font-size:inherit}
.invrec-go{font-weight:500}
.discpop .cbrow{margin-top:8px}
.discpop .cbrow .btn{width:100%;justify-content:center;min-height:34px;padding:6px 10px;
  color:var(--accent-dark);border-color:var(--accent)}
@media(max-width:700px){
  .discpop > form{margin-top:8px}
  .discpop .field{margin-bottom:0}
  .discpop .field > label{font-size:12px;margin-bottom:1px}
  .discpop select,.discpop input[type=number]{min-height:38px;padding:5px 8px}
  .discpop .cat-chips{margin:8px 0 6px}
  .discpop .cat-chip{min-height:40px;padding:6px 10px;font-size:13px}
  .discpop .frow{gap:6px}
  .discpop .frow > .field{flex:1 1 28%;min-width:88px}
  .discpop .frow > .btn{flex:1 0 100%;min-height:42px;margin-top:2px}
}

.upc td,.upc th{padding:9px 10px;border-bottom:1px solid var(--line);vertical-align:middle}
.upc th{vertical-align:bottom}
.upc th{font-weight:600;color:var(--muted);font-size:13px;text-align:left}
.upc th.r,.upc td.r{text-align:right}
.upc .upc-d{white-space:nowrap;font-weight:600}
.upc tr.late{background:#FDF3F2}
.upc tr.soon{background:#FFF8F0}
.upc .sub{font-size:13px;margin-top:2px}
.refback{position:fixed;inset:0;z-index:300;background:rgba(12,14,18,.5);
  backdrop-filter:blur(2px);opacity:0;pointer-events:none;transition:opacity .2s ease}
.refback.on{opacity:1;pointer-events:auto}
.refmodal{position:fixed;z-index:301;left:50%;top:50%;transform:translate(-50%,-46%) scale(.97);
  width:min(720px, calc(100vw - 32px));max-height:calc(100vh - 80px);overflow-y:auto;
  background:#fff;border-radius:18px;box-shadow:0 24px 60px rgba(0,0,0,.28);
  padding:20px 22px 22px;opacity:0;pointer-events:none;
  transition:opacity .2s ease, transform .26s cubic-bezier(.22,1,.36,1)}
.refmodal.on{opacity:1;pointer-events:auto;transform:translate(-50%,-50%) scale(1)}
.refmodal:has(.pick-list.on){overflow:visible}
.refmodal-head{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.refmodal-head h2{margin:0;flex:1;font-size:20px}
.refmodal-foot{display:flex;gap:10px;width:100%;margin-top:6px}
@media(max-width:640px){
  .refmodal{width:100vw;max-width:none;max-height:88vh;left:0;right:0;top:auto;bottom:0;
    transform:translateY(12px);border-radius:18px 18px 0 0}
  .refmodal.on{transform:none}
}
.lgrow{display:flex;margin-bottom:10px}
.lgrow > .btn{flex:none}
@media(min-width:701px){
  .pos-grid > .lgrow{grid-column:3;grid-row:1;justify-self:start;align-self:start;
    height:auto;margin:-54px 0 0;z-index:2}
  .gbar ~ .pos-grid:has(> .lgrow){margin-top:56px}
  /* кнопка заняла клетку чека, поэтому саму панель тоже ставим в неё явно —
     иначе автораскладка уносила её на вторую строку сетки */
  .pos-grid > .pos-menu{grid-column:1;grid-row:1}
  .pos-grid > #posResizer{grid-column:2;grid-row:1}
  .pos-grid > .pos-check{grid-column:3;grid-row:1}
}
@media(max-width:700px){
  /* в режиме меню панели чека нет — кнопке там делать нечего */
  .pos-grid.m-menu > .lgrow{display:none}
}
.lgbox{min-width:220px;max-width:300px;display:flex}
.lgbox .pick{flex:1}
@media(max-width:700px){.lgbox{flex:1 0 100%;max-width:none}}
tr.refrow{cursor:pointer}
tr.refrow:hover{background:#FFF8F2}
/* CRM не растягиваем на весь экран — ширина по содержимому, прижата влево */
.crm-tbl{width:auto;max-width:100%}
.cellinp{border-color:transparent;background:none;min-height:30px;padding:3px 6px;
  font-size:14px;color:var(--muted);transition:border-color .12s,background-color .12s}
tr:hover > td > form > .cellinp{border-color:var(--line);background:#fff}
.cellinp:focus{border-color:var(--accent);background:#fff;color:var(--ink)}
/* 2202: текст в поле ячейки встаёт на линию текста соседних строк — рамку и отступ выносим влево */
td > form > .cellinp{margin-left:-7px}
td > form > select.cellinp{margin-left:-11px;color:var(--ink)}
td > form > select.cellinp,td > form > input.cellinp{font-size:inherit}
.upc .upc-amt{width:96px;min-height:32px;padding:4px 8px;text-align:right;font-size:14px}
.upc .upc-act{white-space:nowrap}
@media(min-width:701px){
  .upc .upc-act .btn{min-height:30px;padding:3px 10px;font-size:13px;border-radius:8px}
  .upc .upc-amt{min-height:30px;font-size:13px}   /* поле суммы — вровень с кнопками */
}
.upc .upc-act form{display:inline}
.upc .upc-act > *{margin-left:6px}
.upccards .dc-l{flex:1;min-width:0}
.upccards .dc-row.late{background:#FDF3F2}
.upccards .dc-row.soon{background:#FFF8F0}
.upccards .dc-a{display:flex;flex-direction:column;align-items:flex-end;gap:6px}
.upccards .upc-cbtn{display:flex;align-items:center;justify-content:flex-end;gap:8px}
.upccards .upc-cbtn form{margin:0}
.upccards .upc-amt{width:104px}
@media(max-width:700px){
  .upccards .upc-cbtn .btn{padding:0;width:38px;min-height:38px;border-radius:10px}
  .upccards .upc-cbtn .btn .lb{display:none}
  .upccards .upc-cbtn .btn svg{width:19px;height:19px}
  .upccards .upc-cbtn{margin-top:6px;gap:10px}
  .upccards .dc-row{padding-top:10px;padding-bottom:10px}
  .upc-cards{grid-template-columns:1fr 1fr}
  .upc-cards .s-month{order:0;grid-column:1/-1}   /* «Текущий месяц» — длинной плашкой поверх двух столбцов */
  .upc-cards .s-late{order:1}
  .upc-cards .s-d7{order:2}
  .upc-cards .s-all{order:3}
  .upc-cards .s-d30{order:4}
}

.notifbtn{position:relative;border:1px solid rgba(255,255,255,.25);border-radius:10px;
  padding:8px 10px;min-height:40px;display:inline-flex;align-items:center;justify-content:center;
  background:none;cursor:pointer;color:rgba(255,255,255,.85);
  transition:transform .16s cubic-bezier(.23,1,.32,1),background-color .16s ease,border-color .16s ease}
.notifbtn svg{width:19px;height:19px}
.notifbtn:hover{background:rgba(255,255,255,.08);color:#fff;border-color:rgba(255,255,255,.45)}
.notifbtn:active{transform:scale(.97)}
.notifdot{display:none;position:absolute;top:6px;right:7px;width:8px;height:8px;border-radius:50%;
  background:var(--red);box-shadow:0 0 0 2px var(--dark)}
.notifdot.on{display:block}
@media(max-width:700px){.notifbtn{padding:7px 9px}}
.pos-top button.posnotif{position:relative;padding:8px 10px}
.pos-top button.posnotif svg{width:19px;height:19px}
.pos-top button.posnotif .notifdot{top:5px;right:6px;box-shadow:0 0 0 2px var(--pos-bar,#262626)}

.notifwrap{position:fixed;inset:0;z-index:140;visibility:hidden;transition:visibility 0s linear .19s}
.notifwrap.on{visibility:visible;transition-delay:0s}
.notifback{position:absolute;inset:0;background:rgba(16,22,32,.28);opacity:0;
  transition:opacity .14s cubic-bezier(.23,1,.32,1)}
.notifwrap.on .notifback{opacity:1;transition-duration:.2s}
.notifpanel{position:absolute;top:0;right:0;height:100%;width:min(392px,calc(100vw - 24px));
  box-sizing:border-box;background:#fff;box-shadow:-18px 0 44px -22px rgba(16,22,32,.45);
  display:flex;flex-direction:column;transform:translateX(100%);
  transition:transform .18s cubic-bezier(.32,.72,0,1)}
.notifwrap.on .notifpanel{transform:translateX(0);transition-duration:.26s}
.notifhead{flex:none;display:flex;align-items:center;gap:10px;padding:14px 12px 12px 16px;
  border-bottom:1px solid var(--line)}
.notifhead b{font-size:15px;margin-right:auto}
.notiflist{flex:1;min-height:0;overflow-y:auto;padding:6px 0}
.notifempty{padding:28px 16px;text-align:center;color:var(--muted);font-size:14px}
.nfi{display:flex;gap:10px;align-items:flex-start;padding:11px 16px;border-bottom:1px solid var(--line);
  color:inherit;text-decoration:none;transition:background-color .14s ease;
  position:relative;background:var(--card);touch-action:pan-y}
.nfi:last-child{border-bottom:0}
.nfrow{position:relative;overflow:hidden}
.nfhint{position:absolute;top:0;bottom:0;display:flex;align-items:center;padding:0 16px;
  font-size:13px;font-weight:700;letter-spacing:.2px;opacity:0;pointer-events:none;
  text-transform:uppercase}
.nfhint.read{left:0;color:#fff;background:var(--accent)}
.nfhint.new{right:0;color:#fff;background:var(--info);justify-content:flex-end}
.nfi:hover{background:var(--panel)}
.nfi .nfdot{flex:none;width:8px;height:8px;border-radius:50%;margin-top:6px;position:relative;
  cursor:pointer;transition:transform .16s cubic-bezier(.23,1,.32,1)}
.nfi .nfdot::before{content:"";position:absolute;inset:-11px -9px}
@media (hover:hover) and (pointer:fine){.nfi .nfdot:hover{transform:scale(1.5)}}
.nfi.read .nft{font-weight:600;color:var(--muted)}
.nfi .nfbody{min-width:0;flex:1}
.nft{display:block;font-size:14px;font-weight:700;line-height:1.3}
.nfs{display:block;font-size:13px;color:var(--muted);margin-top:2px;line-height:1.35}
.nfd{display:block;font-size:12px;color:var(--muted);opacity:.8;margin-top:3px}
/* красным светится только точка: если краснеют и все заголовки, тревожное перестаёт
   читаться как тревожное — глазу не за что зацепиться */
.nfi .nfdot{background:var(--accent)}
.nfi.warn .nfdot{background:var(--red)}
.nfi.read .nfdot{background:transparent;box-shadow:inset 0 0 0 1.5px var(--line)}
/* тосты управления — снизу справа, а не по центру (в кабинете гостя телефонный центр) */
body[data-sec] .pk-toasts{left:auto;right:16px;bottom:16px;align-items:flex-end;padding:0}
@media(min-width:701px){
  body:has(.pos-wrap) .pk-toasts{left:auto;right:16px;bottom:16px;align-items:flex-end;padding:0}
  body[data-sec] .pk-toast, body:has(.pos-wrap) .pk-toast{min-width:380px;max-width:460px;gap:14px;padding:16px 12px 16px 16px;border-radius:18px}
  body[data-sec] .pk-toast__ic, body:has(.pos-wrap) .pk-toast__ic{width:48px;height:48px;border-radius:14px}
  body[data-sec] .pk-toast__ic svg, body:has(.pos-wrap) .pk-toast__ic svg{width:26px;height:26px}
  body[data-sec] .pk-toast__t, body:has(.pos-wrap) .pk-toast__t{font-size:16px}
  body[data-sec] .pk-toast__s, body:has(.pos-wrap) .pk-toast__s{font-size:14px}
}
@media(prefers-reduced-motion:reduce){
  .notifpanel{transform:translateX(0);opacity:0;transition:opacity .15s cubic-bezier(.23,1,.32,1)}
  .notifwrap.on .notifpanel{opacity:1}
  .notifbtn:active{transform:none}
}

.depcols{display:grid;gap:14px;margin-bottom:14px}   /* 2064: плашки не налезают на «Движения депозитов» */
.depcols>.card{margin-bottom:0}
@media(min-width:1100px){.depcols{grid-template-columns:1fr 1fr;align-items:start}}

@media(min-width:701px){
  .pagehead.ph-list > .spacer{display:none}
  .pagehead.ph-list{gap:10px}
  .pagehead.ph-list > *{align-self:center;margin-bottom:0}
  .pagehead.ph-list > .btn,.pagehead.ph-list > a.btn,.pagehead.ph-list > .btn.sm,
  .pagehead.ph-list > details > summary.btn,
  .pagehead.ph-list > form > .btn{min-height:38px;height:38px;padding:7px 14px}
  .pagehead.ph-list .plus{font-weight:900;font-size:16px;line-height:1;margin-right:2px}
  .pagehead.ph-list .btn.ghost .plus,.pagehead.ph-list details .plus{color:var(--accent)}
  .pagehead.ph-list > .mfilt-btn{order:0}
  .pagehead.ph-list > .tabs{order:1}
  .pagehead.ph-list > .ph-per{order:0;margin:0;flex:0 0 auto;display:flex;gap:8px;align-items:center}
  .pagehead.ph-list > .ph-per > .field{margin:0}
  .pagehead.ph-list > .ph-per > .field > label{display:none}
  .pagehead.ph-list > form.mfilt,.pagehead.ph-list > form.pagehead-search.mfilt{
    flex:0 0 auto;min-width:0;max-width:none;margin:0}
  .pagehead.ph-list > form.mfilt.fopen,.pagehead.ph-list > form.pagehead-search.mfilt.fopen{
    flex:1 0 100%;order:4}
  .pagehead.ph-list > .ph-tail{order:2;margin-left:var(--gap-sep)}
  .pagehead.ph-list > .ph-tail2{order:2}   /* второй хвост — сразу за первым, без отбивки */
  .pagehead.ph-list > .favs{order:2;margin-left:var(--gap-sep)}
  .pagehead.ph-list > .ph-search{order:3;margin-left:auto;flex:0 1 430px;min-width:240px}
  .pagehead.ph-list > .ph-tsearch{gap:8px;margin:0 0 0 auto}
  .pagehead.ph-list > .ph-tsearch input{flex:1;max-width:none;min-height:38px;height:38px;
    padding-left:34px;background-repeat:no-repeat;background-position:11px 50%;background-size:15px 15px;
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8F98' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.6-3.6'/></svg>")}
  .pagehead.ph-list > .ph-search input[name=q]{min-height:38px;height:38px;padding-left:34px;
    background-repeat:no-repeat;background-position:11px 50%;background-size:15px 15px;
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8F98' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.6-3.6'/></svg>")}
  .pagehead.ph-list > .msearch{order:3;margin-left:auto;flex:0 1 430px;min-width:240px}
  .pagehead.ph-list > .msearch label{display:none}
  .pagehead.ph-list > .msearch input{min-height:38px;height:38px;padding-left:34px;
    background-repeat:no-repeat;background-position:11px 50%;background-size:15px 15px;
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8F98' stroke-width='2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='M20 20l-3.6-3.6'/></svg>")}
  .mfilt-btn.fbtn{display:inline-flex;width:auto;height:38px;gap:8px;padding:0 14px;
    border:1px solid var(--line);border-radius:10px;background:var(--card);
    font-family:inherit;font-size:14px;font-weight:600;color:var(--ink);cursor:pointer;
    transition:border-color .16s cubic-bezier(.23,1,.32,1), color .16s cubic-bezier(.23,1,.32,1)}
  .mfilt-btn.fbtn svg{width:17px;height:17px}
  .mfilt-btn.fbtn:hover{border-color:var(--accent);color:var(--accent)}
  .mfilt-btn.fbtn:active{transform:scale(.97)}
  /* кнопка держит открытое состояние цветом — видно, что поля не спрятаны */
  form.mfilt.fopen ~ * .mfilt-btn.fbtn,
  .pagehead.ph-list:has(~ * form.mfilt.fopen) .mfilt-btn.fbtn,
  .pagehead.ph-list:has(+ form.mfilt.fopen) .mfilt-btn.fbtn{border-color:var(--accent);color:var(--accent)}
  form.mfilt.fopen > .mfilt-fields{display:flex;flex-wrap:wrap;gap:10px 12px;align-items:flex-start;
    
    background:var(--card);border:1px solid var(--line);border-radius:14px;
    box-shadow:var(--shadow);padding:14px 16px;margin-bottom:2px}
  form.mfilt.fopen > .mfilt-fields > :not(.field){align-self:flex-end}
  .fsh-inline .fsh-row{display:flex;flex-direction:column;align-items:flex-start;gap:4px;margin:0;
    border:0;padding:0;background:none;min-height:0;width:auto}
  .fsh-inline .fsh-row > span{font-size:12px;color:var(--muted)}
  .fsh-inline .fsh-row{width:184px}
  .fsh-inline .fsh-row select{min-height:38px;width:100%;max-width:none;font-size:14px;font-weight:400}
  .fsh-inline .fsh-h{display:none}
  form.mfilt.fsh-inline > .mfilt-fields{padding:12px 16px;gap:10px 12px}
  .fsh-inline .fsh-seg{display:flex;gap:6px}
  .fsh-inline .fsh-reset{align-self:flex-end;order:99;font-size:13px;color:var(--red);
    text-decoration:none;border:0;padding:0 0 9px;background:none;width:auto;display:inline-block}
  form.mfilt:not(.fopen) > .mfilt-fields{display:none}
  form.mfilt > .mfilt-fields:not(:has(.field, .fsh-row)){display:none!important}
  /* «Сброс» относится к полям отбора и прячется вместе с ними: над списком он висел
     сам по себе и выглядел кнопкой неизвестно от чего */
  form.mfilt:not(.fopen) > .fres,form.mfilt:not(.fopen) > .fsave{display:none}
  form.mfilt:not(.fopen){margin-bottom:0!important}
  form.mfilt.card{background:none;border:0;box-shadow:none;padding:0}
  .shclose{padding-bottom:18px}
  .shclose .field{position:relative}
  .shclose .shexp{position:absolute;top:100%;left:0;margin-top:2px;white-space:nowrap}
  .shift-hero h2 .btn{font-size:14px;font-weight:600;min-height:38px;height:38px}
  .bulkbar.rowbar{background:var(--card,#fff);padding:2px 0 6px;margin-top:-6px}
  .pos-wrap > .bulkbar{background:#F4F5F7;padding:6px 0 12px}
}

.favs{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.favchip{display:inline-flex;align-items:center;gap:6px;min-height:32px;padding:4px 10px;
  border:1px solid var(--line);border-radius:10px;background:var(--card);
  font-size:13px;font-weight:600;color:var(--ink);text-decoration:none;
  transition:border-color .16s cubic-bezier(.23,1,.32,1),color .16s cubic-bezier(.23,1,.32,1)}
.favchip:hover{border-color:var(--accent);color:var(--accent)}
.favchip:active{transform:scale(.97)}
.favchip.on{border-color:var(--accent);color:var(--accent)}
.favchip{background:color-mix(in srgb,var(--accent) 6%,var(--card));
  border-color:color-mix(in srgb,var(--accent) 24%,var(--line))}
.favchip::before{content:"";width:11px;height:13px;flex:none;background:var(--accent);opacity:.75;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3h12v18l-6-4.5L6 21z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 3h12v18l-6-4.5L6 21z'/%3E%3C/svg%3E") center/contain no-repeat}
.favnm{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:170px}
.favx{color:var(--muted);font-size:15px;line-height:1;cursor:pointer;padding:0 1px}
.favx:hover{color:var(--red)}
.mfilt .fsave{padding:4px 9px;min-height:38px;display:inline-flex;align-items:center}
@media(max-width:700px){.mfilt .fres,.mfilt .fsave{display:none!important}}
@media(prefers-reduced-motion:reduce){.favchip{transition:none}}

.mfilt-fields > .fltcfg{align-self:flex-end;margin-bottom:2px}
.mfilt-fields > .fltcfg > summary{min-height:38px;padding:4px 9px;display:flex;align-items:center}
@media(max-width:700px){
  .mfilt.fon .mfilt-fields > .fltcfg{display:none}   /* в листе фильтров на телефоне не нужна */
}

/* minmax(0,…): без него колонка сетки растягивалась по самой широкой таблице внутри,
   и на телефоне весь лист уезжал вбок («Корректировки», «Кальяны») */
.halfrow{display:grid;grid-template-columns:minmax(0,1fr);gap:14px;margin-bottom:14px;
  align-items:stretch}
.halfrow > .card{display:flex;flex-direction:column;min-width:0}
.halfrow > .card.sumrows .srow{flex:1;align-items:center}
@media(min-width:1000px){.halfrow{grid-template-columns:repeat(2,minmax(0,1fr))}}
.halfrow > .card{margin-bottom:0}
.grid2{align-items:stretch}
.grid2 > .card{display:flex;flex-direction:column}
.sumrows .srow{display:flex;align-items:baseline;gap:12px;padding:10px 0;
  border-bottom:1px solid var(--line)}
.sumrows .srow:last-child{border-bottom:0}
.sumrows .srow:first-child{padding-top:0}
.sumrows .srow .l{flex:1;min-width:0;color:var(--muted);font-size:14px}
.sumrows .srow .v{font-size:18px;font-weight:700;white-space:nowrap}
.sumrows .srow .sub{color:var(--muted);font-size:13px;white-space:nowrap}

.crmcard .field{min-width:200px}
.crmcard .field > input,.crmcard .field > select{width:100%;text-overflow:ellipsis}
.crmcard .field.cpwho{flex:1 0 100%;margin-bottom:4px}
.crmcard .cpwho > label{margin-bottom:2px}
.crmcard .field.cpnote{flex:1 0 100%}
.crmcard .cpnote textarea{width:100%;min-height:76px}
.cplinks{margin-top:6px;overflow-wrap:anywhere}
.cplinks a,td[data-c="note"] a{color:var(--accent);text-decoration:underline}

.refmodal-foot .dropbtn{margin-left:auto}

.gshare{padding:2px 0}

.cph-row{display:flex;align-items:center;gap:10px;flex:1;justify-content:flex-end}
.cph-row .tabsdd{margin:0}
.btn.cph-add{display:none}
@media(min-width:701px){.pagehead.ph-list > .cph-row{display:contents}}
@media(max-width:700px){
  .cph-row{flex:1 0 100%;justify-content:space-between}
  .btn.cph-add{display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;min-height:38px;
    padding:0;font-size:30px;font-weight:400;line-height:1;margin-left:auto;
    background:none;border:0;box-shadow:none;color:var(--accent)}
  .cph-hideadd{display:none!important}
}
.cardsort{display:none}
@media(max-width:700px){
  .cardsort{display:flex;align-items:center;gap:8px;margin:0 0 10px;font-size:13px;color:var(--muted)}
  .cardsort select{width:auto;min-height:34px;padding:4px 28px 4px 10px;font-size:13px}
  .tblgrid.doccards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0}
  .tblgrid .dc-row{position:relative;display:block;padding:10px 10px 8px;border:1px solid var(--line);
    border-radius:12px;min-height:0;background:var(--card)}
  .tblgrid .dc-row b{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-right:18px}
  .tblgrid .dc-sub{font-size:12px}
  .tblgrid form{position:absolute;top:4px;right:4px;margin:0}
  .tblgrid .xbtn{width:30px;height:30px;min-height:30px;padding:0}
  .tblgrid .xbtn svg{width:16px;height:16px}
}

.pagehead>h1{min-height:44px;display:flex;align-items:center;flex-wrap:wrap;column-gap:.3em;align-self:flex-start}
.pagehead>.ph-title{min-height:44px;display:flex;flex-direction:column;justify-content:center;align-self:flex-start}
/* 2054: меньше воздуха — от шапки до заголовка 12 (было 20) на всех страницах; подпись под заголовком идёт следующей строкой */
@media(min-width:701px){ .wrap{padding-top:12px} }
.pagehead+.note,.pagehead+.sub,.pagehead+style+.note,.pagehead+style+.sub,.pagehead+script+.note,.pagehead+script+.sub,.pagehead+.tabsdd+.sub,.pagehead+.tabsdd+.note{margin-top:-12px}
.pagehead+.tabsdd+.sub,.pagehead+.tabsdd+.note{margin-bottom:16px}
@media(max-width:700px){
  .wrap{padding-top:8px}
  .pos-wrap,.pos-wrap.pos-fit{padding-top:8px}
}

@media(max-width:700px){
  .wrap>.card,.wrap>form>.card,.wrap>details.card,
  .wrap>.grid2>.card,.wrap>form>.grid2>.card,
  .wrap>.grid2>div>.card{margin-left:-16px;margin-right:-16px;   /* 1848: и карточки правой колонки */
    border-radius:0;border-left:0;border-right:0;box-shadow:none}
  .pos-wrap>.card,.pos-wrap>form>.card,.pos-wrap>details.card{margin-left:-12px;margin-right:-12px;
    border-radius:0;border-left:0;border-right:0;box-shadow:none}
}

@media(max-width:700px){
  .pagehead>.tabs.tabs-mob{order:10;flex:1 0 100%;margin-left:0;margin-right:0}
  .pagehead>.tabs.tabs-mob>a{flex:1;justify-content:center;text-align:center}
  .pagehead:has(>.tabs.tabs-mob)>.refadd{margin-left:auto}
}

@media(max-width:700px){
  .refmodal-foot{justify-content:flex-end}
  .refmodal-foot>.btn.ghost{order:2}
  .refmodal-foot>.btn:not(.ghost):not(.danger){order:3}
  .refmodal-foot>.btn.danger,.refmodal-foot .dropbtn{margin-left:0;margin-right:auto;order:1}
}

@media(max-width:700px){
  .pagehead{row-gap:6px;margin-bottom:8px}
  .pos-wrap>.pagehead{margin-bottom:8px}
}
@media(max-width:700px){
  .docbar{left:0;right:0;bottom:var(--tabbar-h, calc(66px + env(safe-area-inset-bottom)));border-radius:0;
    padding:8px 16px;border-top:1px solid var(--line);box-shadow:0 -8px 20px -14px rgba(0,0,0,.35)}
}
@media(max-width:700px){
  .tabbar,body .pos-tabs{padding-top:3px;padding-bottom:max(4px, calc(env(safe-area-inset-bottom) - 14px))}
  .tabbar a,body .pos-tabs a{padding-top:4px;padding-bottom:4px;gap:2px}
  body .pos-tabs a svg{width:26px;height:26px}
}
@media(max-width:700px){
  .opro-h .field{padding:2px 0;min-height:36px}
  .opro-h .field>*{min-height:0}
  body .pagehead.docph>.phbr.phbr-sm,.pagehead.docph>.phbr,.pagehead.docph>.hbbr{display:none}
  .pagehead.docph>.headbtns{flex-basis:100%;gap:6px}
  /* кнопки документа плотнее: место под позиции (заявка 2036) */
  .pagehead.docph>.headbtns .btn{min-height:40px;padding-top:6px;padding-bottom:6px}
  .card.ophead.opro-h{padding-top:8px;padding-bottom:8px}
}
@media(hover:none){
  tr.rowlink:hover,.wrap table tr:hover>td,.cf-matrix tr:hover td,.money-hl tr:hover td{background:none}
  .wrap table tr.rowsel>td,.wrap table tr.rowsel:hover>td{background:var(--accent-soft,#FCE5D4)}
}
@media(max-width:700px){
  .ophead .field>.pick,.ophead .field:has(.pick)>div:not(.cpbal),
  .opro-h .field>div:not(.cpbal){flex:1 1 0;max-width:none;min-width:0;text-align:right}
  .ophead .field>label{flex:none}
}

.h2gear{display:flex;align-items:center;gap:8px}
.h2gear>details.colcfg{margin-left:auto;font-size:14px;font-weight:400}
.dc-a .dc-acc{display:block;font-size:12px;font-weight:500;color:var(--muted);white-space:nowrap}
.dc-a:has(.dc-acc){align-self:stretch;display:flex;flex-direction:column;justify-content:space-between;
  align-items:flex-end;text-align:right;font-variant-numeric:tabular-nums}

@media(min-width:701px){
  .wrap > .card:has(> .bulkbar){padding-top:8px}
  .wrap > .pagehead.ph-list{margin-bottom:10px}
}

.inv-ecards{display:none}
.invsheet{display:none}
@media(max-width:700px){
  form.inv-m .inv-ecards{display:block;margin-bottom:8px}
  form.inv-m #edlines tr:has(a.edname),form.inv-m #edlines tr:has(> th){display:none}
  /* 2028: у инвентаризации первая колонка — «посчитано», поле названия третье: «+» слева, рядом поле */
  form.inv-m #edlines tr:not(:has(a.edname)):not(:has(> th)) > td:is(.cntcol, :nth-child(n+4)){display:none}
  form.ln-m .ln-ecards{display:block;margin-bottom:8px}
  form.ln-m #edlines tr:has(a.edname),form.ln-m #edlines tr:has(> th){display:none}
  .ln-ecards .opro-q b{color:var(--ink);font-weight:600}
  .lns-grid{grid-template-columns:1fr 1fr}
  .lns-grid .invs-cell{border-bottom:1px solid var(--line)}
  .lns-grid .invs-cell:nth-child(odd){border-left:0}
  .lns-grid .invs-cell:nth-child(even){border-left:1px solid var(--line)}
  .lns-in{display:flex;gap:6px;align-items:center}
  .lns-in input,.lns-in select{flex:1 1 auto;min-width:0;font-size:20px;min-height:40px;padding:4px 8px}
  .inv-card{cursor:pointer}
  .inv-card .inv-nm{color:inherit;text-decoration:none}
  .inv-card .opro-q.pos{color:var(--green);font-weight:600}
  .inv-card .opro-q.neg{color:var(--red);font-weight:600}
  .invsheet[open]{display:block;position:fixed;inset:auto 0 0 0;margin:0;width:100%;max-width:none;
    max-height:92dvh;overflow:auto;border:0;border-radius:16px 16px 0 0;padding:0 0 calc(12px + env(safe-area-inset-bottom));
    background:#fff;box-shadow:0 -8px 32px rgba(0,0,0,.18);
    animation:invsIn .22s cubic-bezier(.23,1,.32,1)}
  .invsheet::backdrop{background:rgba(20,22,28,.4)}
  @keyframes invsIn{from{transform:translateY(24px);opacity:0}to{transform:none;opacity:1}}
  @media(prefers-reduced-motion:reduce){.invsheet[open]{animation:none}}
  .invs-head{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;
    border-bottom:1px solid var(--line)}
  .invs-head b{font-size:16px}
  .invs-btn{background:none;border:0;min-height:44px;padding:0 6px;font:inherit;font-size:15px;
    color:var(--accent-dark);font-weight:600;cursor:pointer}
  .invs-name{display:block;padding:14px 16px;font-weight:700;font-size:17px;color:var(--ink);
    text-decoration:none;border-bottom:1px solid var(--line)}
  .invs-sec{padding:14px 16px 6px;background:var(--bg);font-size:13px;font-weight:700;
    color:var(--muted);text-transform:uppercase;letter-spacing:.02em}
  .invs-grid{display:grid;grid-template-columns:1fr 1fr;border-bottom:1px solid var(--line)}
  .invs-cell{display:flex;flex-direction:column;gap:4px;padding:10px 16px;margin:0}
  .invs-cell+.invs-cell{border-left:1px solid var(--line)}
  .invs-cell>span{font-size:13px;color:var(--muted)}
  .invs-cell>b{font-size:20px;font-weight:600;font-variant-numeric:tabular-nums}
  .invs-cell input{font-size:20px;min-height:40px;padding:4px 8px}
  .invs-row{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;
    border-bottom:1px solid var(--line)}
  .invs-row>span{color:var(--muted)}
  .invs-del{display:block;width:100%;margin-top:14px;padding:14px 16px;text-align:left;background:none;
    border:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);
    color:var(--red);font:inherit;font-size:16px;cursor:pointer}
}

@media(min-width:701px){
  form.filters:has(select[name=qf]) > .field:not(.mobonly),
  form.filters:has(select[name=qf]) .mfilt-fields > .field:not(.mobonly){flex:0 0 210px;max-width:210px;min-width:0}
}

@media(max-width:700px){
  .pagehead.docph{position:relative}
  .pagehead.docph>label.refadd.opedt-b,.pagehead.docph>a.refadd.opedt-b{position:absolute;top:3px;right:0;margin:0}
  .pagehead.docph>.opnum>input[name=no]{margin-right:46px}
  .pagehead.docph>form.postchk{order:0}
}

@media(max-width:700px){
  .card>h2:has(button[form=itemsave]){gap:6px;white-space:nowrap}
  .card>h2:has(button[form=itemsave]) .btn.sm{min-height:32px;padding:5px 10px;font-size:13px;white-space:nowrap}
}

@media(max-width:700px){
  #plGrid, #plGrid > tbody{display:block;width:100%}
  #plGrid tr:first-child:has(> th){display:none}
  #plGrid tr.plrow{display:flex;flex-wrap:wrap;align-items:flex-start;gap:6px 8px;
    padding:10px 0;border-bottom:1px solid var(--line)}
  #plGrid tr.plrow > td{display:block;border:0;padding:0}
  #plGrid tr.plrow > td[data-c]{display:none}
  #plGrid tr.plrow > td.rownum{order:0;flex:0 0 24px;text-align:right;color:var(--muted);font-size:13px;
    white-space:nowrap;padding-top:2px}
  #plGrid tr.plrow > td.plname{order:1;flex:1 1 calc(100% - 78px);min-width:0;font-size:15px;line-height:1.3}
  #plGrid tr.plrow > td.plname .plgrp{display:block;font-size:12px;margin-top:2px}
  #plGrid tr.plrow > td.pldel{order:2;flex:0 0 30px}
  #plGrid tr.plrow > td.plp{order:3;flex:1 1 calc(33.33% - 8px);min-width:90px}
  #plGrid tr.plrow > td.plp::before{content:attr(data-l);display:block;font-size:12px;
    color:var(--muted);margin-bottom:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #plGrid tr.plrow > td.plp input{width:100%;min-height:40px}
  #plGrid tr[data-total]{display:flex;align-items:center;gap:8px;padding-top:10px}
  #plGrid tr[data-total] > td{display:block;border:0;padding:0}
  #plGrid tr[data-total] > td[data-c], #plGrid tr[data-total] > td[colspan]{display:none}
  #plGrid tr[data-total] > td:nth-child(4){flex:1}
}
.headbtns.xorder{justify-content:flex-start}
.headbtns.xorder>.btn{flex:none}
.headbtns.xorder>form{display:flex;margin:0}
.headbtns.xorder>.closebtn{margin-left:auto}
@media(max-width:700px){.pagehead.cardph>.headbtns.xorder{width:100%;flex:1 0 100%}}
/* плюс «Добавить поставщика» — в правом верхнем углу карточки прайса */
#plForm{position:relative}
.xbtn.pladd{position:absolute;top:10px;right:10px;width:36px;height:36px;min-height:36px;
  border:1.5px solid var(--accent);border-radius:50%;z-index:2}
.xbtn.pladd svg{width:18px;height:18px}
@media(max-width:700px){.xbtn.pladd{top:2px;right:16px}}
@media(max-width:700px){
  .pagehead>.headbtns:has(>.closebtn){flex:1 0 100%;width:100%;margin-left:0}
  .pagehead>.headbtns>.btn.closebtn{flex:1 1 auto;margin-left:0}
}
.noapp{flex:0 999 auto;min-width:2.4em;overflow:hidden;text-overflow:ellipsis;display:inline-block;font-size:11px;font-weight:600;line-height:1.5;
  color:var(--muted);background:var(--panel);border:1px solid var(--line);border-radius:99px;
  padding:0 7px;white-space:nowrap;vertical-align:1px}
.inapp{margin-top:6px}
.qr-go{min-height:44px;padding:0;margin:0;background:none;border:0;cursor:pointer;display:inline-flex;
  align-items:center;touch-action:manipulation;font:inherit;color:inherit;-webkit-tap-highlight-color:transparent}
.qr-go>span{font-size:12px;font-weight:700;line-height:1.5;white-space:nowrap;color:var(--ink);
  background:#fff;border:1px solid var(--accent);border-radius:99px;padding:1px 10px}
.qr-go:active>span{background:var(--accent-soft)}
.qr-go:focus-visible{outline:none}
.qr-go:focus-visible>span{outline:2px solid var(--accent);outline-offset:2px}

@media(max-width:700px){
  /* смахивание карточки позиции: под ней красное «Удалить» (механика — как в уведомлениях) */
  .sw-row{position:relative;overflow:hidden}
  .sw-hint{position:absolute;inset:0;display:flex;align-items:center;justify-content:flex-end;padding:0 18px;
    background:var(--red);color:#fff;font-size:14px;font-weight:600;opacity:0;pointer-events:none}
  .sw-row .inv-card{position:relative;background:var(--card);touch-action:pan-y}
  /* строка добавления — только название; кол-во, цена и остальное — в окне позиции */
  form.ln-m #edlines tr:not(:has(a.edname)):not(:has(> th)) > td:nth-child(n+3){display:none}
  /* «Позиций · сумма · НДС» — от левого края, как в просмотре (правило из шаблона тянуло вправо) */
  .frow.vathead{justify-content:flex-start}
}

.field.saveR{margin-left:auto;text-align:right}
.btn.saveR{display:flex;width:max-content;margin-left:auto}
.saveRow{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.gqr-f{display:contents}
button.gdep.gqr{border:0;padding:0;margin:0;cursor:pointer;color:var(--ink)}
button.gdep.gqr:active{background:var(--accent-soft)}
h1.gname:has(.gqr-in){display:flex;align-items:center;gap:2px}
h1.gname:has(.gqr-in) input{flex:1 1 auto;width:auto}
.xbtn.gqr-in{flex:none;width:40px;height:40px;min-height:40px;color:var(--ink)}
.xbtn.gqr-in svg{width:20px;height:20px}
@media(min-width:701px){
  .ophead.compact .frow.po3{grid-template-columns:minmax(0,360px) max-content minmax(0,360px);column-gap:48px}
  .frow.po3>.f-org{grid-area:1/1}
  .frow.po3>.f-cp{grid-area:2/1}
  .frow.po3>.f-recv{grid-area:1/2}
  .frow.po3>.f-paid{grid-area:2/2}
  .frow.po3>.f-wh{grid-area:1/3}
  .frow.po3>.f-who{grid-area:2/3}
  /* 1631: цифры рядом со словами и на одной линии с ними (по базовой линии текста) */
  .ophead.compact .frow.po3 .f-recv,.ophead.compact .frow.po3 .f-paid{grid-template-columns:68px auto;align-items:baseline}
}
@media(min-width:701px){
  .ophead.compact .frow.tr3{grid-template-columns:repeat(3,minmax(0,360px));column-gap:48px}
  .frow.tr3>.f-org{grid-area:1/1}
  .frow.tr3>.f-wh_from{grid-area:1/2}
  .frow.tr3>.f-wh_to{grid-area:2/2}
  .frow.tr3>.f-who{grid-area:1/3}
}
/* 2055: «Откуда/Куда» короткие — подпись ближе к полю, не через общую колонку 128 */
/* 2062: шапка перемещения — три колонки с равным зазором 40, подписи по ширине текста; «Откуда/Куда» с общей колонкой подписи, строки ровно друг под другом */
@media(min-width:701px){
  .ophead.compact .frow.tr3{grid-template-columns:repeat(3,max-content)!important;column-gap:40px!important;row-gap:8px;align-items:center}
  .ophead.compact .frow.tr3>.field{grid-template-columns:max-content minmax(220px,300px)!important;column-gap:12px;align-items:center;margin:0}
  .ophead.compact .frow.tr3>.f-wh_from,.ophead.compact .frow.tr3>.f-wh_to{grid-template-columns:48px minmax(220px,300px)!important}
  .ophead.compact .frow.tr3>.f-who{grid-template-columns:max-content max-content!important}
}
/* 2053/2055: «поменять местами» вне сетки — висит в зазоре слева, на стыке «Откуда» и «Куда», строки не двигает */
.f-wh_to:has(>.whswap){position:relative}
.f-wh_to>.whswap{position:absolute;left:-36px;top:0;transform:translateY(-50%);color:var(--accent);z-index:1;width:30px;height:30px;min-height:30px;padding:0}
@media(max-width:700px){.f-wh_to>.whswap{left:auto;right:0;top:-2px}}
.opro[data-sel] .opro-r{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;
  transition:background-color .15s ease}
/* подложка отмеченной шире текста на 8px с каждой стороны — текст не сдвигается */
.opro[data-sel] .opro-r{margin:0;padding-left:8px;padding-right:14px;border-radius:10px}   /* 1827: без выноса за край — экран не ездил вбок */
.opro-r.sel{background:var(--accent-soft)}
.opro-r.sel .opro-n{color:var(--accent-dark);font-weight:800}
.opro-selbar{position:sticky;top:0;z-index:5;display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:8px 12px;margin:0 0 8px;border-radius:10px;background:var(--accent-soft);font-size:14px}
.opro-selbar[hidden]{display:none}
@media(max-width:700px){
  form.ln-m #edlines.linecards tr:not(:has(a.edname)):not(:has(> th)) > td:has([name=pack_g]){display:none!important}
  .docbody{display:grid;grid-template-columns:minmax(0,1fr)}
  .docbody>.s-bar,.docbody>.tscroll,.docbody>.docqty,.docbody>.opcmt,.docbody>.optot{grid-column:1;grid-row:auto}
  .docbody>.s-bar{order:-2}
  .docbody>.opcmt{order:5}
  .sw-hint-l{justify-content:flex-start;background:var(--accent)}
  .inv-card.sel{background:var(--accent-soft)}
  .inv-card.sel .opro-n{color:var(--accent-dark);font-weight:800}
  .opro[data-sel] .opro-r{touch-action:pan-y}
}
.btn.bkbtn,.btn.bkbtn:hover{border:2px dashed #96BCFF}
@media(max-width:700px){.lgrow .btn.bkbtn.mobonly{display:inline-flex}}
.ordmemo{gap:4px}
.ordmemo.mt{margin-top:8px}
.ordmemo > label{margin-bottom:0!important}
.ordmemo textarea{min-height:52px;padding:6px 9px}  /* 1648: две строки — видно, что можно писать абзацами */
.chk-closed-h{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px}
.chk-closed-h .chk-paid{margin-left:auto;font-size:13px;font-weight:400}
.xbtn.chk-print{width:36px;height:36px;min-height:36px;color:var(--ink);align-self:center;
  margin:-8px 0}
.xbtn.chk-print svg{width:18px;height:18px}
.nfoot{display:flex;align-items:flex-end;gap:24px;margin-top:12px}
.nfoot>.field.doccmt{flex:1 1 auto;min-width:0;margin:0}
.nfoot-tot{flex:none;white-space:nowrap;font-weight:800;font-size:16px;padding-bottom:8px}
@media(max-width:700px){.nfoot{flex-direction:column-reverse;align-items:stretch;gap:8px}.nfoot-tot{text-align:right;padding:0}}
.ihelpd.poshelp > summary{align-items:center;min-height:28px}
.ihelpd.poshelp{margin-bottom:6px}
#newtransfer .opform > .field{flex:1 1 0;min-width:0;max-width:none}
#newtransfer .opform > .field.amt{flex:0 1 180px}
#newtransfer .opform > .field.wide{flex:1 0 100%}
#newtransfer .opform select{width:100%}
@media(min-width:701px){
  .ophead.compact .frow.po3{grid-template-columns:minmax(0,360px) max-content minmax(0,360px) minmax(0,320px)}
  .frow.po3>.f-plan{grid-area:1/4}
  .ophead.compact .frow.po3>.f-plan{grid-template-columns:max-content minmax(0,1fr)}
  .ophead.compact .frow.po3>.f-plan>label{white-space:nowrap}
  .ophead.compact .frow.po3>.f-plan>input{padding-top:3px;padding-bottom:3px}
  .frow.po3>.f-pcat{grid-area:2/4}   /* 1992: статья ДДС под плановой датой */
  .ophead.compact .frow.po3>.f-plan>select{padding-top:3px;padding-bottom:3px}
}
@media(min-width:701px){
  .docbody>.tscroll{grid-column:1/-1}
  .docbody #edlines tr:last-child > td{border-bottom:1px solid var(--line)}
  .docbody #edlines tr:not(:has(a.edname)):not(:has(> th)) > td:nth-child(n+3),
  .docbody #edlines tr:not(:has(a.edname)):not(:has(> th)) > td:nth-child(n+3) *{visibility:hidden}
  /* 2115: у инвентаризации первая колонка — «посчитано», поле названия третье; его не прячем */
  .docbody #edlines[data-inv] tr:not(:has(a.edname)):not(:has(> th)) > td:nth-child(3),
  .docbody #edlines[data-inv] tr:not(:has(a.edname)):not(:has(> th)) > td:nth-child(3) *{visibility:visible}
  .docbody>.docqty{grid-column:1/-1;grid-row:2;align-self:end;justify-self:end;
    padding:0 4px 14px 0;position:relative;z-index:1;pointer-events:none}
  .docbody.qty-flow>.tscroll{padding-bottom:36px}   /* 1985: последняя строка заполнена — «Кол-во» ниже таблицы */
}
.optot div.vatcol{display:block}
@media(max-width:700px){.optot>div.vatcol{display:flex}}
.morerows{display:flex;justify-content:flex-start;margin:2px 0 0}
@media(max-width:700px){.morerows .btn{flex:1;min-height:44px}}
.cbedit summary{cursor:pointer;margin-top:4px;list-style:none}
.cbedit summary::-webkit-details-marker{display:none}
.cbedit-f{display:flex;gap:6px;margin-top:6px}
.cbedit-f input{width:96px;min-height:36px}
.invadd{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.invadd-plus{flex:none;color:var(--accent)}
.invadd-in{flex:1 1 260px;min-width:0;max-width:340px}
.invadd-stock{margin-left:auto}
@media(max-width:700px){.invadd-in{flex:1 1 calc(100% - 60px);max-width:none}}
@media(min-width:701px){
  .card.ophead.compact{background:none;border:0;box-shadow:none;border-radius:0;padding-left:0;padding-right:0;
    padding-top:4px;padding-bottom:0;margin-bottom:10px}
  .ophead.compact .frow{min-width:max-content;grid-template-columns:repeat(2,minmax(330px,440px))}
  .ophead.compact .field{grid-template-columns:128px minmax(200px,1fr)}
  .ophead.compact .frow.po3{grid-template-columns:minmax(330px,360px) max-content minmax(330px,360px) minmax(300px,320px)}
}
.bksep{border:0;border-top:1px solid var(--line);margin:6px 4px}
.colcfg-menu.stopts{min-width:0;width:max-content;max-width:280px}
/* в шапке документа пункты — inline-flex (.pagehead .stopt): ширина меню по содержимому
   сложила бы их в одну строку. Внутри меню пункт — блочный flex, столбиком */
.colcfg-menu.stopts .stopt{display:flex;white-space:nowrap;overflow:hidden}
.stopts .stopt.stcfg{width:0;min-width:100%;display:block;text-overflow:ellipsis}
.umenu.umenu-l{position:relative;display:inline-block}
.umenu.umenu-l .umenu-menu{left:0;right:auto;min-width:200px}
.umenu.docnew .umenu-menu form{margin:0}
.umenu.docnew summary.btn:hover{background:var(--panel)}
.umenu.docnew .umenu-menu a:last-child{color:var(--ink)}
.umenu.docnew .umenu-sec{margin:6px 4px 0;padding:10px 8px 4px;border-top:1px solid var(--line);
  font-size:12px;font-weight:600;color:var(--muted)}
.umenu.docnew .umenu-sec:first-child{margin-top:0;border-top:0;padding-top:4px}
@media(min-width:701px){
  .vathead{min-height:36px;margin-bottom:2px}
  .vathead > .bulkbar.rowbar-in{position:static;transform:none;opacity:1;flex:0 1 auto;margin:0 auto 0 0;
    padding:0;background:none;border:0;box-shadow:none;gap:8px;flex-wrap:nowrap}
  .vathead > .bulkbar.rowbar-in .bn{margin-right:4px}
}
.rowdd .colcfg-menu{left:0;right:auto}
.mnm{position:relative;min-width:0}
.mnm .mstop{position:absolute;left:0;top:100%;display:flex;gap:4px;white-space:nowrap;pointer-events:none}
.mnm .mstop .badge{font-size:10px;line-height:12px;padding:1px 6px;min-height:0}
#newtransfer .opform{display:grid;grid-template-columns:minmax(0,1fr) minmax(110px,180px);
  gap:10px 12px;align-items:start}
#newtransfer .opform > .field{margin:0;max-width:none;min-width:0}
#newtransfer .opform > .field:nth-of-type(1){grid-area:1/1}
/* на телефоне под суммой встаёт калькулятор — сумма занимает обе строки справа */
#newtransfer .opform > .field.amt{grid-area:1/2/3/3}
#newtransfer .opform > .field:nth-of-type(2){grid-area:2/1}
#newtransfer .opform > .field.wide,#newtransfer .opform > .refmodal-foot{grid-column:1/-1}
@media(max-width:700px){
  #newtransfer .opform{grid-template-columns:minmax(0,1fr)}
  #newtransfer .opform > .field:nth-of-type(1),#newtransfer .opform > .field:nth-of-type(2),
  #newtransfer .opform > .field.amt{grid-area:auto}
}
@media(max-width:700px){
  .doccards > .sw-row > .dc-row:last-child{border-bottom:1px solid var(--line)}
  .doccards > .sw-row:last-child > .dc-row{border-bottom:0}
}
@media(max-width:700px){.pagehead > a.xclose{margin-left:auto}}
@media(min-width:701px){
  .pagehead.cardph:has(> h1.gname) > .spacer{display:none}
  .pagehead.cardph:has(> h1.gname) > .headbtns{margin-left:8px}
}

input[name=amount],input[name=cash_actual]{border-color:var(--accent)!important}
input[name=amount]:focus,input[name=cash_actual]:focus{border-color:var(--accent-dark)!important}
/* 1826: в мобильной форме закрытия смены поля без отступов — под рамку их нужно вернуть */
.shclose input[name=cash_actual]{padding-left:10px!important;padding-right:10px!important;border-radius:10px}

@media(min-width:701px){
  .pagehead.plph>.headbtns{margin-left:0}
  .pagehead.plph>.opnum{display:flex;align-items:center;gap:6px}
  .pagehead.plph .opdt{display:flex;align-items:center;gap:6px;color:var(--muted)}
  .pagehead.plph .opdt input{width:auto;min-width:0}
  .plbody #plGrid{width:100%}
}
/* 1753: тело не плашка — без рамки и фона, на всю страницу; «+ поставщик» не обрезан */
.card.plbody{position:relative;background:none;border:0;box-shadow:none;overflow:visible}
@media(min-width:701px){
  .card.plbody{padding-left:0;padding-right:0}
  .pagehead.plph~form .ophead .f-org select{min-width:340px}
}

/* метка алкогольной позиции меню */
.badge.a18{background:none;border:1px solid var(--line);color:var(--muted);font-size:10px;font-weight:600;padding:0 5px;vertical-align:1px;margin-left:8px}
.card h2 .btn{white-space:nowrap}

/* 1827: на телефоне экран не ездит вбок, даже если что-то вылезло на пару пикселей */
@media(max-width:700px){html,body{overflow-x:clip}}
/* 1830: на телефоне «Принято» и «Оплачено» заказа поставщику — в одну строку, по половине */
@media(max-width:700px){
  .ophead .frow:has(> .f-recv){display:flex;flex-wrap:wrap;row-gap:0}
  .ophead .frow:has(> .f-recv) > *{flex:0 0 100%;min-width:0}
  .ophead .frow > .f-recv,.ophead .frow > .f-paid{flex:1 1 0;gap:6px}
  .ophead .frow > .f-paid{padding-left:14px}
}
/* 1841/1844: шапка документа на телефоне компактнее — позиции начинаются на первом экране */
@media(max-width:700px){
  .ophead .field{min-height:40px;padding:0}
  .opro-h .field{min-height:30px}
  .ophead .field>input,.ophead .field>select,.ophead .field>div{padding-top:4px;padding-bottom:4px}
  .ophead .f-who .whobox{flex-direction:row;align-items:baseline;gap:6px;flex-wrap:wrap;justify-content:flex-end}
  .ophead .f-cp .cpbal{font-size:12px}
}
/* 1842: поле даты в шапке правки видно как поле: рамка и подсказка, пока оно пустое */
.ophead .field>input[type=date]{border:1px solid var(--line)!important;border-radius:8px;
  padding:4px 8px!important;min-width:140px;background:#fff}
.ophead .field>input[type=date][value=""]::-webkit-datetime-edit{color:var(--muted)}

/* 1882: метка 18+ — на картинке позиции в углу, а не в подписи */
.menu-btn .mimg{position:relative}
.badge.a18.a18-img{position:absolute;top:6px;right:6px;margin:0;background:rgba(23,23,26,.78);border:0;color:#fff;font-weight:700;font-size:11px;padding:1px 6px}

/* 1883: пустой список позиций в правке — одна низкая строка, а не большой пустой блок */
.inv-ecards > .empty,.ln-ecards > .empty,.opro > .empty{padding:10px 16px;font-size:13px}

/* 1885-1887: карточка заказа поставщику — справа сумма, под ней «Оплачено» и «Принято»:
   подписи с общего левого края, цифры по правому — ровно при любой длине чисел */
@media(max-width:700px){
  .pocards .dc-top{margin:0 0 2px}
  .pocards .dc-top .badge{margin-left:6px;vertical-align:1px}
  .pocards .dc-pr{display:grid;grid-template-columns:auto auto;column-gap:8px;row-gap:1px;
    font-size:12px;font-weight:400;color:var(--muted);align-self:flex-end}
  .pocards .dc-pr i{font-style:normal;text-align:left}
  .pocards .dc-pr b{font-weight:600;color:var(--ink);text-align:right;font-variant-numeric:tabular-nums}
  .pocards .dc-pr b.full{color:var(--green)}
}

/* 1891: юрлицо под лого — выпадающий список, переключается из любого раздела */
.orgsw{position:relative}
.orgsw > summary{list-style:none;cursor:pointer;display:inline-flex;align-items:center;gap:4px}
.orgsw > summary::-webkit-details-marker{display:none}
.orgsw .orgcar{font-size:9px;opacity:.7}
.orgsw-menu{position:absolute;top:100%;left:0;z-index:300;min-width:200px;background:#fff;color:var(--ink);
  border:1px solid var(--line);border-radius:12px;box-shadow:0 10px 28px rgba(0,0,0,.18);padding:6px;margin-top:6px}
.orgsw-menu form{margin:0}
.orgsw-menu button{display:block;width:100%;text-align:left;border:0;background:none;padding:10px 12px;border-radius:8px;
  font:600 14px/1.2 inherit;color:var(--ink);letter-spacing:0;text-transform:none;min-height:40px}
.orgsw-menu button:hover{background:var(--bg)}
.orgsw-menu button.on{color:var(--accent-dark);background:var(--accent-soft)}

/* 1899: серая строка «Название №N · время» в карточках списков идёт первой */
@media(max-width:700px){.doccards .dc-top{margin:0 0 2px}}
/* 1912: «Корректировка баланса» и «Объединить» — рядом в одной плашке; раскрытая форма на всю ширину */
.gadm{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start}
.gadm details[open]{flex-basis:100%;order:1}
.gadm details[open] summary{margin-bottom:10px}
/* 1915: «Итого» внизу таблицы заказов поставщикам */
tr.po-tot td{border-top:2px solid var(--line,#E4E6EA);background:var(--bg2,var(--panel))}
/* 1917: пояснение к галочке — отдельной строкой под текстом, а не второй колонкой */
label.chkline{flex-wrap:wrap;row-gap:0}   /* 1925: пояснение вплотную к строке, интервалы между галочками равные */
label.chkline>.sub{flex:0 0 100%;padding-left:24px;margin-top:0;line-height:1.3}
/* 1920: длинное слово («Пакетированный») помещается в плашку позиции, а в крайнем случае переносится */
.menu-btn .mname{max-width:100%;min-width:0;overflow-wrap:anywhere}
@media(max-width:700px){.pos-menu .menu-btn .mname{padding:0 2px}.pos-menu .menu-btn .mname.mlong{font-size:10px;letter-spacing:-.04em;padding:0}}

/* ===== Единый вид админки (2026-10): поверхности, плашки, теги, KPI =====
   Только .wrap (админка). Кипер (.pos-wrap) берёт отсюда лишь цвета токенов. */
body:has(> main.wrap){background:var(--page)}
.wrap .card,.wrap .stat,.wrap .totbar{border:0;border-radius:var(--r-card);box-shadow:var(--shadow-card)}
.wrap .stat .foot{border-radius:0 0 var(--r-card) var(--r-card)}
.wrap .card th{background:#fff}
.wrap table td{font-variant-numeric:tabular-nums}
/* заголовок карточки: название слева, действия-иконки справа */
.card-h{display:flex;align-items:center;gap:8px;min-height:32px;margin-bottom:12px}
.card-h > h2{margin:0;flex:1;min-width:0}
.card-h .xbtn,.card-h .iconbtn{flex:none}

/* плашки статусов: мягкая подложка + текст; оранжевый держим за действием, «давно не был» — предупреждение */
.badge.orange{background:var(--warn-soft);color:var(--warn)}
.badge.gray{background:var(--chip);color:var(--chip-ink)}
.badge.lime{background:var(--green-soft);color:var(--green)}
.badge.teal,.badge.blue{background:var(--info-soft);color:var(--info)}
.badge.violet{background:#F1EDFB;color:#5B3FB0}
.badge.yellow{background:var(--warn-soft);color:var(--warn)}
.crmcards .badge.vio{text-transform:none;letter-spacing:0;font-size:12px}
.badge.st-l,.badge.st-lm,.badge.st-m,.badge.st-ms,.badge.st-s{background:var(--chip);color:var(--chip-ink)}
.prz-tag,.ai-report .ai-h,.docgrp,.nfhint,.invs-sec{text-transform:none!important;letter-spacing:0!important}

/* теги вкусов — один нейтральный вид везде; «Табу» — единственное предупреждение, со словом */
.tags{display:flex;flex-wrap:wrap;gap:4px;min-width:0}
.tag{display:inline-flex;align-items:center;gap:5px;max-width:100%;padding:2px 9px;border-radius:99px;
  background:var(--chip);color:var(--chip-ink);font-size:12px;font-weight:600;line-height:18px;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tag.warn{background:var(--red-soft);color:var(--red)}
.tag.more{background:none;color:var(--muted);padding:2px 4px}
.warnmark{flex:none;width:7px;height:7px;border-radius:50%;background:var(--red);display:inline-block}
.tasteDl{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:6px 16px;margin:0;font-size:14px}
.tasteDl dt{color:var(--muted);font-weight:500;display:flex;align-items:center;gap:6px}
.tasteDl dd{margin:0;color:var(--ink)}
.tasteDl dt.warn{color:var(--red);font-weight:600}
.tag.warn{white-space:normal}
.tag.fav{background:var(--green-soft,#EAF7EF);color:var(--green,#1A7F3C)}
.tasteDl dt.fav{color:var(--green,#1A7F3C);font-weight:600}
.tasteDl.v2{display:flex;flex-direction:column;gap:10px}
.tasteDl.v2 .tdl-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:8px 16px}
.tasteDl.v2 .tdl-row.one{grid-template-columns:minmax(0,1fr)}
.tasteDl.v2 .tdl-i{min-width:0}
.tasteDl.v2 dt{font-size:12px;margin:0 0 2px}
.tasteDl.v2 dd{font-size:14px;overflow-wrap:anywhere}
.gc-taste .tags{gap:4px}
.badge.vio{background:#F1EDFB;color:#5B3FB0}
/* 1941: цвета разделов документов возвращены (были убраны нейтральным кружком) */
/* KPI: дельта стрелкой и словом — не цветом одним */
.kpi .v{margin-bottom:0;padding-bottom:6px}
.kpi .kpi-u{font-size:.6em;font-weight:600;color:var(--muted);letter-spacing:0}
.kpi-d{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 6px;font-size:13px;color:var(--muted)}
.kpi-chg{font-weight:700;font-variant-numeric:tabular-nums}
.kpi-chg.up{color:var(--green)}
.kpi-chg.down{color:var(--red)}
.stat.hi .kpi-d{color:rgba(255,255,255,.66)}
.stat.hi .kpi-chg.up{color:#4ADE80}
.stat.hi .kpi-chg.down{color:#FF8A80}
.stat.hi .kpi-u{color:rgba(255,255,255,.6)}
/* аватар: фото или инициалы на мягком тоне */
.ava{flex:none;display:inline-flex;align-items:center;justify-content:center;border-radius:50%;object-fit:cover;
  vertical-align:middle;background:var(--chip)}
.ava-i{background:hsl(var(--h) 40% 92%);color:hsl(var(--h) 35% 30%);font-weight:700;letter-spacing:.02em}
/* CRM: KPI месяца, сегменты слева (планшет/десктоп) или пилюлями (телефон) */
.cards.kpis{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
/* 1929+: сегменты гостей — вкладками над таблицей, а не колонкой слева: матрица гостей занимает всю ширину */
.crm-split{display:block}
.crm-main{min-width:0}
.segnav{display:flex;flex-direction:row;flex-wrap:wrap;gap:6px;margin:0 0 12px;padding:0;background:none;box-shadow:none}
.segnav a{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:6px 14px;border-radius:99px;
  background:var(--card);box-shadow:var(--shadow-card);font-size:14px;font-weight:600;color:var(--muted);white-space:nowrap}
.segnav a:hover{color:var(--ink)}
.segnav a.on{background:var(--accent-soft);color:var(--ink);box-shadow:none}
.segnav a.on .segn{color:var(--accent-dark)}
.segn{font-size:13px;font-weight:700;color:var(--muted)}
.segnote{margin:0 0 12px}
.gname-c{white-space:nowrap}
/* 2117: строки гостей одной высоты — ячейки в одну строку, лишнее под многоточие (ширины колонок фиксирует wh_resize) */
.gtbl td{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:260px}
.gtbl .gnm{max-width:100%;vertical-align:middle}   /* по базовой линии фото-аватар раздувал строку на 5px */
.gtbl .gnm b{min-width:0;overflow:hidden;text-overflow:ellipsis}
/* 2118: карточка гостя — «Платежи и корректировки» слева от «Чеков», на узком друг под другом */
@media(max-width:1099px){.grid2.gpay{grid-template-columns:minmax(0,1fr)}}
.gnm{display:inline-flex;align-items:center;gap:10px}
.gflav{max-width:250px}
.gflav .tag{display:inline-block}
.gflav .tag .warnmark{margin-right:5px;vertical-align:1px}
.gflav .tags{flex-wrap:nowrap;overflow:hidden}
.gflav .tag,.gflav .tag.warn{max-width:150px;flex:0 1 auto;white-space:nowrap}
.gflav .tag.more{flex:none}
.gcards .dc-row > .ava{margin-top:2px}
.gcards .dc-row{justify-content:flex-start}
.gcards .dc-row .dc-a{margin-left:auto}
@media(max-width:700px){
  .crm-split{display:block}
  .segnav{position:static;flex-direction:row;overflow-x:auto;scrollbar-width:none;background:none;box-shadow:none;
    padding:0;gap:6px;margin:0 -16px 12px;padding:0 16px}
  .segnav::-webkit-scrollbar{display:none}
  .segnav a{flex:none;min-height:40px;padding:6px 14px;border-radius:99px;background:var(--card);
    box-shadow:var(--shadow-card);white-space:nowrap;gap:6px}
  .segnav a.on{background:var(--accent-soft);color:var(--ink);box-shadow:none}
  .cards.kpis{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .cards.kpis .stat{padding:12px 14px}
  .cards.kpis .stat .l{font-size:12px}
  .wrap .cards.kpis .stat .v{font-size:20px;white-space:nowrap}
  .cards.kpis .kpi-d{font-size:12px}
}
.cardph > .ava{order:-4}
@media(max-width:700px){.cardph > .ava{width:40px!important;height:40px!important}}
/* тёмная карточка — уже акцент; число в ней белое, оранжевый остаётся за действием */
.wrap .stat.hi .v{color:#fff}
.wrap .stat.hi .v.neg{color:#FF8A80}
.ds-rev .kpi-d{margin:2px 0 10px}
/* иконка в углу плашки — нейтральная: оранжевый за действием */
.wrap .stat .ico{background:var(--chip);color:var(--chip-ink)}
@media(max-width:700px){.dashcards .kpi-d{font-size:11px;gap:2px 4px}.ds-rev .kpi-d{margin:0 0 6px}}
/* кипер, «Гости»: имя обычным цветом, полужирным — как в карточках броней */
.pos-wrap .gc-nm a,.pos-wrap .gc-nm span{color:var(--ink);font-weight:600}
/* 1928: «включить пуши» — внутри панели уведомлений, а не вторым колокольчиком в шапке */
.notifpush{margin:0 16px 10px;width:calc(100% - 32px);justify-content:center}

/* 1929: дашборд плотнее. Один шаг между плашками (12) по обеим осям, первый ряд ниже,
   в Выручке процент справа от цифр, подпись «Вот что происходит…» вплотную к юрлицу */
@media(min-width:701px){
  .dashcards{gap:12px;margin-bottom:12px}
  .dashcards .stat{padding:12px 18px}
  .dashcards .stat .foot{margin:8px -18px -12px;padding:7px 18px;margin-top:auto}
  .dashgrid{gap:12px}
  .dashgrid > .card{margin-bottom:0}
  .revrow{display:flex;align-items:baseline;gap:4px 10px;flex-wrap:wrap}
  .revrow .kpi-d{margin:0 0 0 auto!important;text-align:right;justify-content:flex-end}
  .dashph{margin-bottom:2px}
  .dashph + div{margin:0 0 12px!important}
}

/* форма «Новый гость» (кипер и CRM): подписи разной длины («Почта (вход в личный кабинет)» на два
   ряда) сдвигали поля одного ряда — теперь поля стоят по низу ряда, на одной линии */
#newg .frow{align-items:flex-end}

/* 1942: в быстрой панели у каждой кнопки значок раздела в цвете раздела */
.docfavbar a[data-s]{display:inline-flex;align-items:center;gap:7px}
.docfavbar .dfi{flex:none;width:16px;height:16px;fill:none;stroke:var(--sc);stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}

/* 1944/1946: быстрая панель — плитки с крупным значком раздела (цвет только у значка) и короткой подписью; лента прокручивается вбок */
.docfavbar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0 0 8px;padding:2px 0}   /* 4 в ряд, остальные — ниже: без прокрутки вбок */
.docfavbar::-webkit-scrollbar{display:none}
.docfavbar a,.wrap .docfavbar a{flex-direction:column;justify-content:flex-start;align-items:center;gap:6px;padding:10px 4px 8px;height:80px;
  border-radius:16px;text-align:center;font-size:12px;line-height:1.15;white-space:normal;overflow:hidden}
.docfavbar a[data-s]{display:flex;flex-direction:column;gap:6px}
.docfavbar .dfi{width:26px;height:26px}
.docfavbar a span{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis}

/* 1945: на телефоне плашки вокруг поиска нет — строка поиска и фильтры почти сразу под заголовком, воздух сокращён.
   Белый фон карточки начинается ниже строки поиска (она 44px + 8px отступа). */
@media(max-width:700px){
  .wrap > .card:has(> form.mfilt:first-child){background:linear-gradient(var(--card),var(--card)) no-repeat 0 52px / 100% 100%;
    box-shadow:none;border-radius:0;padding-top:0;margin-top:-6px}
  .wrap > .card:has(> form.mfilt:first-child) > form.mfilt{margin-bottom:8px}
}

/* 1947: список заказов/приёмок поставщикам на телефоне — на всю ширину: лента статуса слева, три ячейки справа */
@media(max-width:700px){
  .pocards{margin:0 -16px -16px}
  .pocards .dc-day{background:var(--bg);padding:12px 16px 4px;font-size:13px}   /* 1983: фон не прозрачный, иначе липкие даты наезжают друг на друга */
  .pocards .dc-row{display:grid;grid-template-columns:26px minmax(0,1fr) 100px;gap:0;padding:0;margin:0 0 6px;min-height:100px;
    background:var(--card);border:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);align-items:stretch;overflow:hidden}
  .pocards .dc-row:last-child{border-bottom:1px solid var(--line)}
  /* цвета статусов — ровно те же, что у прежних плашек (`.badge.<цвет>`): фон и текст */
  .pocards .sc-green,.pocards .sc-lime{--sbg:var(--green-soft);--sfg:var(--green)}
  .pocards .sc-orange,.pocards .sc-yellow{--sbg:var(--warn-soft);--sfg:var(--warn)}
  .pocards .sc-red{--sbg:var(--red-soft);--sfg:var(--red)}
  .pocards .sc-violet{--sbg:#F1EDFB;--sfg:#5B3FB0}
  .pocards .sc-blue,.pocards .sc-teal{--sbg:var(--info-soft);--sfg:var(--info)}
  .pocards .sc-gray,.pocards .sc-pink{--sbg:var(--chip);--sfg:var(--chip-ink)}
  .pocards .vstrip{display:flex;align-items:center;justify-content:center;background:var(--sbg,var(--chip));
    color:var(--sfg,var(--chip-ink));border-right:1px solid color-mix(in srgb,var(--sfg,#6B717B) 22%,var(--line))}
  .pocards .vstrip span{writing-mode:vertical-rl;transform:rotate(180deg);font-size:10px;font-weight:700;letter-spacing:.05em;
    text-transform:uppercase;white-space:nowrap;max-height:100%;overflow:hidden;text-overflow:ellipsis}
  .pocards .dc-l{padding:11px 8px 11px 12px;display:flex;flex-direction:column;justify-content:center;gap:3px}
  .pocards .dc-l b{font-size:15px;overflow-wrap:anywhere}
  .pocards .dc-r{display:grid;grid-template-rows:repeat(3,1fr);border-left:1px solid var(--line)}
  .pocards .dc-r>div{display:flex;align-items:center;gap:5px;padding:0 8px;border-top:1px solid var(--line);font-size:14px;font-weight:700;white-space:nowrap;min-height:32px;min-width:0}
  .pocards .dc-r>div span{min-width:0;overflow:hidden;text-overflow:ellipsis}
  .pocards .dc-r>div:first-child{border-top:0}
  .pocards .dc-r svg{width:16px;height:16px;opacity:.6;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
  .pocards .dc-r>div:first-child svg{opacity:1}
  .pocards .dc-r .full{color:var(--green)}
  .pocards .dc-r .none{color:var(--muted);font-weight:500}
  .pocards .dc-r>div:last-child{background:#FAFAFB}
}

/* 1947: «Итого по фильтру» на телефоне — не плашкой, а строкой на всю ширину экрана, во всех списках склада и денег */
@media(max-width:700px){
  .wrap .totbar{border-radius:0;box-shadow:none;margin-left:-16px;margin-right:-16px;padding:12px 16px;
    border-top:1px solid var(--line);border-bottom:1px solid var(--line);background:var(--card)}
}

/* QR на стол — значок слева от «+» */
@media(max-width:700px){
  .pagehead.gph > .qrico.mobonly{display:inline-flex;order:-2;width:38px;height:38px;margin:0 0 0 auto;border-radius:11px}
  .pagehead.gph > .qrico + .refadd{margin-left:6px}
}
@media(max-width:700px){
  .crm-split > .segnav{display:none}   /* на телефоне сегменты — выпадашкой */
  .segdd{margin:0 0 10px}
  .segdd .segn{color:var(--muted);font-weight:600;font-size:14px;margin-left:2px}
  /* названия слева, цифры одним ровным столбцом справа; отметка активного — цветом, не галочкой */
  .segdd .umenu-menu a{display:flex;justify-content:space-between;align-items:baseline;gap:16px}
  .segdd .umenu-menu a .segn{min-width:3ch;text-align:right;font-variant-numeric:tabular-nums;margin:0}
  .segdd .umenu-menu a.on::after{content:none}
}

/* карточка платежа: статус того же размера, что системная плашка «расход»; «Закрыть» — сразу справа от статуса */
.pagehead.payph:not(.ph-list) .stmenu>summary,
.pagehead.payph:not(.ph-list) .badge{display:inline-flex;align-items:center;gap:5px;box-sizing:border-box;
  height:24px;min-height:0;min-width:0;padding:0 10px;font-size:12px;line-height:1}
.pagehead.payph:not(.ph-list) .stmenu>summary svg{width:11px;height:11px}

/* номера страниц длинных списков вместо «Показать ещё» */
.pagernums{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:6px;margin:16px 0 8px}
.pagernums a,.pagernums .gap{min-width:38px;height:38px;padding:0 10px;display:inline-flex;align-items:center;justify-content:center;
  border-radius:10px;font-weight:600;font-size:14px;font-variant-numeric:tabular-nums}
.pagernums a{background:var(--card,#fff);color:var(--ink);border:1px solid var(--line)}
.pagernums a.on{background:var(--accent-btn,#C05207);border-color:var(--accent-btn,#C05207);color:#fff}
.pagernums .gap{color:var(--muted)}
table[data-fitted] td{overflow-wrap:anywhere}
/* 1993: «Перевод между счетами» переносится в две строки и по ширине не больше «Расходного ордера» */
.money-hl td[data-c=doctype] .badge{display:inline-block;max-width:124px;white-space:normal;line-height:1.25;vertical-align:middle}

/* ===== Liquid Glass как в Pushka POS (телефон) =====
   Меню — плавающая стеклянная капсула 62 px с полем 12 px, центральный раздел («Кипер», у кассира «Офис») —
   светлая плитка, активный — тёплая подложка. Шапка — графитовое стекло. «Итого» в чеке — оранжевая
   стеклянная капсула над меню. Только телефон: на компьютере и планшете всё как было. */
@media(max-width:700px){
  :root{--glass-low:max(6px, calc(env(safe-area-inset-bottom) - 22px))}
  /* поля 6 и 3 (было 12 и 6): ячейка шире, длинные подписи влезают в подсветку — как в приложении */
  html body .tabbar,html body .pos-tabs{position:fixed;left:6px;right:6px;bottom:var(--glass-low);
    height:62px;min-height:0;padding:0 3px!important;display:flex;align-items:stretch;justify-content:stretch;
    border:.8px solid rgba(255,255,255,.35);border-radius:31px;
    background:rgba(255,255,255,.62);-webkit-backdrop-filter:blur(22px) saturate(1.8);backdrop-filter:blur(22px) saturate(1.8);
    box-shadow:0 4px 14px rgba(0,0,0,.16),inset 0 1px 0 rgba(255,255,255,.6)}
  html body .tabbar a,html body .pos-tabs a{flex:1;min-width:0;margin:5px 0;padding:0 2px!important;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    border-radius:22px;background:transparent;color:#454A57;font-size:clamp(9.5px,2.75vw,11px);font-weight:600;letter-spacing:-.3px;
    white-space:nowrap;overflow:hidden;text-overflow:ellipsis;transition:background-color .16s ease,color .16s ease}
  html body .tabbar a svg,html body .pos-tabs a svg{width:25px;height:25px}
  html body .tabbar a.on,html body .pos-tabs a.on{color:#C05207;background:rgba(192,82,7,.10)}
  html body .tabbar a.raise,html body .pos-tabs a.raise{background:rgba(255,255,255,.92);box-shadow:0 3px 6px rgba(0,0,0,.18)}
  html body .tabbar a:active,html body .pos-tabs a:active{transform:scale(.97)}
  @supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
    html body .tabbar,html body .pos-tabs{background:rgba(255,255,255,.94)}
  }
  /* шапка: графитовое стекло, страница видна сквозь неё при прокрутке */
  html body .topbar,html body .pos-top{background:rgba(23,23,26,.80);
    -webkit-backdrop-filter:blur(20px) saturate(1.6);backdrop-filter:blur(20px) saturate(1.6)}
  /* «Итого» в чеке: оранжевая стеклянная капсула 52 px над меню, как полоса оплаты приложения */
  .pos-grid.m-check .pos-check__foot{left:12px;right:12px;padding:0;border:0;background:transparent;box-shadow:none;border-radius:20px}
  .pos-grid.m-check .pos-check__foot .total-row{margin:0;min-height:52px;padding:0 18px;border-radius:20px;
    background:rgba(245,111,16,.82);-webkit-backdrop-filter:blur(18px) saturate(1.6);backdrop-filter:blur(18px) saturate(1.6);
    box-shadow:0 6px 18px -6px rgba(192,82,7,.55),inset 0 1px 0 rgba(255,255,255,.28);font-size:17px;font-weight:700}
  /* открыт лист оплаты: светлое стекло под кнопками, итог — его шапкой */
  .pos-grid.m-check .pos-check__foot:has(.paytgl:checked){padding:0 14px 14px;border-radius:22px;
    background:rgba(255,255,255,.86);-webkit-backdrop-filter:blur(22px) saturate(1.8);backdrop-filter:blur(22px) saturate(1.8);
    box-shadow:0 10px 30px -10px rgba(0,0,0,.35)}
  .pos-grid.m-check .pos-check__foot:has(.paytgl:checked) .total-row{margin:0 -14px 10px}
  .cartbar{left:12px;right:12px;min-height:52px;border-radius:20px;background:rgba(245,111,16,.82);
    -webkit-backdrop-filter:blur(18px) saturate(1.6);backdrop-filter:blur(18px) saturate(1.6)}
  /* шторки снизу и окна (смена, оплачено, баг, уведомления): светлое стекло, как листы приложения */
  html body dialog.sheet,html body .pdsheet,html body .pbug-sheet,html body .notifpanel{background:rgba(255,255,255,.86);
    -webkit-backdrop-filter:blur(24px) saturate(1.8);backdrop-filter:blur(24px) saturate(1.8)}
  html body dialog.sheet,html body .pbug-sheet{border-radius:22px 22px 0 0}
}
@media(max-width:700px){
  /* 2013: кнопки документа сеткой 2×2 — «Изменить» и «Экспорт» одной ширины слева,
     «Создать документ» и «Закрыть» тянутся до края. Только когда есть обе выпадашки (создать + экспорт) */
  .pagehead.docph>.headbtns:has(>details.docnew~details.docnew){display:grid!important;grid-template-columns:max-content 1fr;gap:8px}
  .pagehead.docph>.headbtns:has(>details.docnew~details.docnew)>details{width:100%;min-width:0}
  .pagehead.docph>.headbtns:has(>details.docnew~details.docnew)>details>summary.btn{width:100%;justify-content:center;box-sizing:border-box}
  .pagehead.docph>.headbtns:has(>details.docnew~details.docnew)>details.colcfg{order:1}
  .pagehead.docph>.headbtns:has(>details.docnew~details.docnew)>details.docnew{order:2}
  .pagehead.docph>.headbtns:has(>details.docnew~details.docnew)>details.docnew~details.docnew{order:3}
  .pagehead.docph>.headbtns:has(>details.docnew~details.docnew)>a.btn.ghost{order:4;width:auto}
}

/* 2090: карточки номенклатуры и меню — одна плашка: показатели в ряд, под ними остатки по складам */
.istat1{align-self:start}
.grid2 > .istat1{margin:0}
.istat1 .l{font-size:13px;font-weight:500;color:var(--muted)}
.istat1 .v{font-size:24px;font-weight:700;margin:4px 0 2px;letter-spacing:-.02em;white-space:nowrap}
.ist-kpi{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,260px);column-gap:16px}
/* подписи переносятся по-разному — subgrid держит цифры на одной линии */
.ist-kpi > div{display:grid;grid-row:span 3;grid-template-rows:subgrid;align-content:start}
.ist-kpi .l{align-self:end}
.ist-wh{margin-top:16px;padding-top:12px;border-top:1px solid var(--line)}
.ist-wh .iwh{display:flex;justify-content:space-between;gap:8px;font-size:14px;padding:6px 0}
.ist-wh .iwh + .iwh{border-top:1px solid var(--line)}
.ist-wh .iwh span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:700px){.ist-kpi{column-gap:10px;grid-auto-columns:minmax(0,1fr)}.istat1 .v{font-size:20px}}

/* 2094: плановый платёж — шесть полей в два ряда по три, комментарий отдельной нижней строкой */
@media(min-width:701px){.opform.cols3 .field:not(.cmtwide){flex:1 1 calc(33.333% - 10px);max-width:none;min-width:0}}

/* 2098: ABC на телефоне — слева класс и подпись в одну строку, справа количество, под ним сумма и доля */
@media(max-width:700px){
  .abc-sum .srow{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:12px;row-gap:2px;align-items:center}
  .abc-sum .srow .l{grid-row:1/3;white-space:nowrap}
  .abc-sum .srow .v{grid-column:2;text-align:right}
  .abc-sum .srow .sub{grid-column:2;text-align:right}
}

/* ИИ-разбор, вариант А (pos_aireport.html): плотный отчёт из ai_reports.data */
.air{container-type:inline-size;display:flex;flex-direction:column;gap:16px}
.air .num{font-variant-numeric:tabular-nums}
.air-head{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.air-st{display:inline-flex;align-items:center;gap:6px;border-radius:99px;padding:3px 10px;flex:none;
  font-size:12.5px;font-weight:700;white-space:nowrap;background:var(--chip);color:var(--chip-ink)}
.air-st i{width:7px;height:7px;border-radius:50%;background:currentColor}
.air-st.down{background:var(--red-soft);color:var(--red)}
.air-st.up{background:var(--green-soft);color:var(--green)}
.air-verdict{font-size:15px;font-weight:600;line-height:1.4;margin:0}
.air-sec{font-size:12px;font-weight:700;letter-spacing:.4px;text-transform:uppercase;color:var(--muted);margin:0 0 8px}
.air-kpis{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
@container (min-width:520px){.air-kpis{grid-template-columns:repeat(4,1fr)}}
.air-kpi{background:var(--panel);border-radius:12px;padding:10px 12px;min-width:0}
.air-kpi .l{font-size:12px;color:var(--muted);font-weight:600}
.air-kpi .v{font-size:20px;font-weight:800;line-height:1.2;margin-top:2px}
.air-kpi .d{font-size:12px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.air-kpi .d b{font-weight:700}
.air .neg{color:var(--red)}
.air-spark{display:flex;align-items:flex-end;gap:3px;height:22px;margin-top:6px}
.air-spark span{flex:1;background:#DADDE3;border-radius:2px 2px 0 0}
.air-spark span.now{background:var(--ink)}
.air-why{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.air-why li{display:flex;gap:8px;align-items:baseline}
.air-tag{flex:none;font-size:11.5px;font-weight:700;color:var(--chip-ink);background:var(--chip);
  border-radius:6px;padding:1px 7px;white-space:nowrap}
.air-risk{border:1px solid var(--line);border-left:3px solid var(--warn);border-radius:10px;padding:10px 12px;
  display:flex;flex-wrap:wrap;row-gap:0;justify-content:space-between;gap:10px;align-items:center}
.air-risk + .air-risk{margin-top:8px}
.air-risk .t{font-weight:700}
.air-risk .s{color:var(--muted);font-size:13px}
.air-risk .s b{color:var(--ink);font-weight:700}
.air-risk a{white-space:nowrap;font-size:13px;min-height:44px;display:flex;align-items:center}
.air-todo{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.air-todo li{display:flex;gap:10px;align-items:flex-start;padding:9px 0;border-top:1px solid var(--line)}
.air-todo li:first-child{border-top:0;padding-top:2px}
.air-todo input{width:18px;height:18px;margin-top:2px;flex:none}
.air-todo input:checked + .tx div{color:var(--muted);text-decoration:line-through}
.air-todo .tx{flex:1;min-width:0}
.air-todo .tx div{font-weight:600}
.air-todo .lnk{font-size:13px;display:inline-block;margin-top:2px}
.air-role{flex:none;font-size:11.5px;font-weight:700;border-radius:99px;padding:2px 8px;
  background:var(--accent-soft);color:#8A3A05;white-space:nowrap}
.air details{border-top:1px solid var(--line)}
.air details summary{list-style:none;cursor:pointer;display:flex;justify-content:space-between;align-items:center;
  min-height:44px;font-weight:700}
.air details summary::-webkit-details-marker{display:none}
.air details summary::after{content:"";width:8px;height:8px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);
  transform:rotate(45deg);margin-right:4px;transition:transform .2s cubic-bezier(.23,1,.32,1)}
.air details[open] summary::after{transform:rotate(-135deg)}
@media(prefers-reduced-motion:reduce){.air details summary::after{transition:none}}
.air-facts{list-style:none;margin:0;padding:0 0 10px;font-size:13px}
.air-facts li{display:flex;justify-content:space-between;gap:12px;padding:5px 0;border-top:1px dashed var(--line)}
.air-facts li span:first-child{color:var(--muted)}
.air-facts li span:last-child{text-align:right;font-weight:600}
.air-menu{list-style:none;margin:0;padding:0 0 10px;font-size:13.5px;display:flex;flex-direction:column;gap:8px}

/* 2192: стрелки порядка счетов */
.accmove{display:inline-flex;gap:4px;margin:0}
.accmove .btn{min-width:36px;justify-content:center}
.accmove .btn:disabled{opacity:.3;cursor:default}
