/* Design code of 4bms, part four: what lies in the office lists. The bench of the menu,
   the tree of groups, prices and measures, the board of taps, the places an addition is
   offered. All of it is built from the parts in parts.css and coloured by base.css. */

/* The bench: a tree on the left, the positions of the chosen branch on the right. */
.workbench { display: grid; grid-template-columns: minmax(12rem, 14rem) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.sheet { max-width: 52rem; }

/* The tree ---------------------------------------------------------------- */

/* Ветка меню — такая же строка, как раздел в колонке слева: то же скругление, та же
   высота, тот же синий у выбранной. Дерево не заводит своего вида. */
.tree { position: sticky; top: calc(var(--hat) + var(--s3)); }
.branch-row { display: flex; align-items: center; border-radius: var(--radius-control); }
.branch-row form { margin: 0; }
/* Hidden by opacity, a control takes its focus outline with it: from the keyboard the
   tree was a place where the mark disappeared. Quiet is a colour, not a veil. */
.branch-row .btn { color: var(--muted); box-shadow: none; }
.branch-row:hover { background: var(--sunken); }
.branch-row:hover .btn, .branch-row .btn:focus-visible { color: var(--text); }

.branch {
    flex: 1; display: flex; align-items: center; gap: var(--s2); min-width: 0;
    min-height: 2.125rem; padding: 0 var(--s2); border-radius: var(--radius-control);
    color: var(--text); font-size: var(--t-body); text-decoration: none;
}
.branch .count { margin-left: auto; color: var(--muted); font-size: var(--t-small); font-variant-numeric: tabular-nums; }
.branch--on { background: var(--accent-soft); color: var(--accent-text); font-weight: 500; }
.branch--on .count { color: var(--accent-text); }
.branch--fixed { font-weight: 500; }
/* Завести группу — такая же строка дерева, только тихая: она стоит там, где её ищут. */
.branch--new { color: var(--muted); }
.branch--new:hover { color: var(--text); }

/* Цены ---------------------------------------------------------------------- */

/* A portion's price must leave room for the other columns on a 1024px screen.
   Wrap the long headings and action inside this table instead of pushing the
   button beyond the sheet; the shelf keeps its own widths. */
.tag-list .badge { white-space: normal; }
@media (max-width: 75rem) {
    .tag-list th { white-space: normal; }
    .tag-list .qty { max-width: 5.5rem; }
    .tag-list .btn { white-space: normal; }
}

/* Момент листа цен — четыре ответа в строку, и строка у них длиннее, чем у списка
   групп: пополам с ним «С понедельника» и «Другой момент» уезжали на вторую строку. */
.tag-when { margin-top: var(--s5); }
.tag-when > .field:first-child { flex: 4 1 26rem; }

/* The price list ----------------------------------------------------------- */

/* Read column by column, so the columns are given their widths instead of being left
   to fight over them: a name that wraps onto a second line makes every row a different
   height and the eye loses the list. */
.menu-list { table-layout: fixed; }
.menu-list th:nth-child(2) { width: 7rem; }
.menu-list th:nth-child(3) { width: 6rem; }
.menu-list th:nth-child(4) { width: 6rem; }
/* Столбец действий — по своей кнопке: в пять rem «Убрать с продажи» не входило и
   вылезало за край списка, а лист с фиксированными столбцами клетку не растягивает. */
.menu-list th:nth-child(5) { width: 9.5rem; }
.menu-list .price { font-weight: 500; }
/* Склад и движения — по той же причине и ещё по одной: у этих списков есть отбор, и
   без заданных ширин он двигает столбцы под руками. Замерено на «Остатках»: «Розлив»
   ужимал «Позицию» на 21 точку, а «На сумму» растягивал на 9 — числа, которые читали,
   уезжали вбок при каждом щелчке по отбору. */
.shelf-list, .moves-list { table-layout: fixed; }
/* Keep 18rem for the position after the three numeric columns (30rem). The panel
   scrolls when the list no longer fits; a fixed table must not spend the name's space
   on numbers. With the type column, another 10rem belongs to the table. */
.shelf-list { min-width: calc(48rem + 2px); }
.shelf-list:has(th.c-kind) { min-width: calc(58rem + 2px); }
/* Остатки заданы по имени столбца, а не по его номеру: «Тип» уходит из списка, когда
   отобран один тип, и номера съезжали бы на соседей — «Средняя цена» вставала бы в
   мерку «Остатка» и переносилась. «Позиция» без мерки: ей достаётся остальное. */
.shelf-list th.c-kind { width: 10rem; }
.shelf-list th.c-balance { width: 9rem; }
.shelf-list th.c-average { width: 11rem; }
.shelf-list th.c-worth { width: 10rem; }
/* «Смены» — семь столбцов, и на 1024 точках «Расхождение» уезжало за край листа: подписи
   и отметка о размене не переносились. Теперь переносятся по словам, когда места мало, а
   на широком экране стоят в строку, как раньше. Имя смены — «Касса 1, № 2» — не рвётся. */
.shifts-list th, .shifts-list .badge { white-space: normal; }
.shifts-list td:first-child { white-space: nowrap; }
.moves-list th:nth-child(1) { width: 7rem; }
.moves-list th:nth-child(2) { width: 9rem; }
.moves-list th:nth-child(3) { width: 9rem; }
.moves-list th:nth-child(4) { width: 9rem; }
/* Порядок плиток переставляют в своём режиме, и стрелки живут там же, где имя строки:
   столбец стрелок в каждой строке списка отнимал место у того, что читают каждый день. */
.order { display: inline-flex; margin-right: var(--s2); vertical-align: middle; }
.order form { margin: 0; display: inline-flex; }
.order .btn { color: var(--muted); box-shadow: none; }
tr:hover .order .btn, .order .btn:hover, .order .btn:focus-visible { color: var(--text); }
td.doing { width: 1%; text-align: right; white-space: nowrap; }
/* «Кассы» в настройках: имя кассы берёт место, какое осталось, номер — по ширине
   шестнадцати цифр. Смена и компьютер рвутся только между половинами своих фраз — «№ 1 идёт»
   и «с 00:14», «привязан» и «26.09 в 00:09», — и узкий экран ломает их в две строки, а не в
   четыре. Причина под выключенной «Убрать» — строкой под кнопками: в строку с ними она
   растягивала столбец действий. */
.tills-list td:first-child input { width: 100%; min-width: 7rem; }
.tills-list input[name="serial"] { width: calc(16ch + 1.625rem); }
body.office .tills-list td.doing .note { display: block; margin: var(--s1) 0 0; white-space: normal; }
/* «Принтеры»: имя — как принтер зовут в баре, его может и не быть; два принтера одного бара
   всегда отличает адрес — поле не короче адреса с портом, как подключён — строкой под ним. На
   узком листе строка становится карточкой: имя и адрес, лента и что печатает, кнопки под
   ними, — без прокрутки вбок. */
body.office .printers-list td.named input { width: 100%; min-width: 12ch; }
body.office .printers-list td.where input { min-width: 22ch; }
body.office .printers-list td.where .note { display: block; margin: var(--s1) 0 0; }
body.office .printers-list td .note.narrow { display: none; }
@media (max-width: 75rem) {
    body.office .printers-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    body.office .printers-list, body.office .printers-list tbody { display: block; }
    body.office .printers-list tr { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); height: auto; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line-soft); }
    body.office .printers-list tr:last-child { border-bottom: 0; }
    body.office .printers-list td { display: block; padding: 0; border: 0; }
    body.office .printers-list td.where, body.office .printers-list td.doing { flex: 1 0 100%; width: auto; text-align: left; white-space: normal; }
    body.office .printers-list td.named { flex: 1 0 100%; }
    body.office .printers-list td.named input { width: auto; }
    body.office .printers-list td .note.narrow { display: inline; margin: 0; }
}
/* «Счета» в «Компании»: БИК — по ширине девяти цифр, номер — двадцати, целиком, чтобы его
   копировали без пробелов. Причина под выключенной «Убрать» — строкой под кнопкой, как у касс.
   На узком листе строка становится карточкой: банк, под ним БИК и номер, отметка и кнопки, — без
   прокрутки вбок, и вопрос «Убрать» открывается вправо от слова: оно стоит у левого края, и
   вопрос уезжал за него. Фон наведения и строки добавления у карточки — целиком, а не полосами
   за каждой клеткой. Значок отказа в поле номера встаёт за двадцатой цифрой, а не на неё. */
body.office .accounts-list td:first-child input { width: 100%; min-width: 8rem; }
body.office .accounts-list input[name="bik"] { width: calc(11ch + 1.625rem); }
body.office .accounts-list input[name="number"] { width: calc(20ch + 1.625rem); }
body.office .accounts-list input[name="bik"][aria-invalid="true"] { width: calc(11ch + 3.0625rem); }
body.office .accounts-list input[name="number"][aria-invalid="true"] { width: calc(20ch + 3.0625rem); }
body.office .accounts-list td { font-variant-numeric: tabular-nums; }
body.office .accounts-list td.doing .note { display: block; margin: var(--s1) 0 0; }
body.office .accounts-list td .note.narrow { display: none; }
@media (max-width: 60rem) {
    body.office .accounts-list thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    body.office .accounts-list, body.office .accounts-list tbody { display: block; }
    body.office .accounts-list tr { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); height: auto; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line-soft); }
    body.office .accounts-list tr:last-child { border-bottom: 0; }
    body.office .accounts-list td { display: block; padding: 0; border: 0; }
    body.office .accounts-list td:first-child, body.office .accounts-list td.doing { flex: 1 0 100%; width: auto; text-align: left; white-space: normal; }
    body.office .accounts-list td .note.narrow { display: inline; margin: 0; }
    body.office .accounts-list td.doing .note { white-space: normal; }
    body.office .accounts-list tr.next input { width: 100%; }
    body.office .accounts-list tr.next td { flex: 1 0 100%; }
    body.office .accounts-list tr.next td .note.narrow { display: block; margin: 0 0 var(--s1); }
    body.office .accounts-list details.confirm > .ask { inset-inline-end: auto; inset-inline-start: 0; }
    body.office .accounts-list td, body.office .accounts-list tr:hover td { background: none; }
    body.office .accounts-list tr:hover { background: #fafafa; }
    body.office .accounts-list tr.next { background: var(--sunken); }
}
/* Кто счета только видит, не видит ни строки добавления, ни подсказки к кнопке, которой у него
   нет, ни пустой колонки действий. Стоит после узкого листа: там строка таблицы — карточка, и
   её «display» перебивал бы правило рамы. */
body.office .accounts-list tr.next:has([data-shut]),
body.office .accounts-list td.doing form:has(.btn[data-shut]) > .note,
body.office .accounts-list:has(tr.next [data-shut]) :is(thead th:last-child, td.doing) { display: none; }

/* A position taken out of the menu stays on the screen, because putting it back starts
   by finding it, but it must not read as something that sells. */
.row--off td, .row--off th[scope="row"] { color: var(--muted); background: var(--sunken); }
.row--off .title { text-decoration: line-through; text-decoration-color: currentColor; }

/* A sort of the menu is one line, and its measures are read inside that line: «50 мл
   390 ₽ · 100 мл 700 ₽». The whole cell is the way to the window that changes them. */
.price-cell { display: flex; flex-wrap: wrap; gap: var(--s1); justify-content: flex-end; color: inherit; text-decoration: none; }
.price-cell:hover .price { text-decoration: underline; text-decoration-color: var(--line); }
.measure {
    display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 0.1em 0.35em;
    padding: 2px var(--s2); border: 1px solid var(--line); border-radius: var(--radius-sm);
    color: var(--muted); font-size: var(--t-small);
}
.measure > * { white-space: nowrap; }
.measure b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 500; }
.measure-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3); }
.measure-form .field { flex: 1 1 5.5rem; }
.measure-form .cell { max-width: 5.5rem; text-align: right; }
.measure-form .field > .note { font-size: var(--t-micro); }
/* What is left of a position on the shelf. A dash is not a zero: a cocktail has no
   shelf line of its own, and a sort nobody poured yet has nothing to count. */
td.left { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: var(--t-small); }
td.left.none { color: var(--muted); }
td.left a { color: inherit; text-decoration: none; }
td.left a:hover { text-decoration: underline; text-decoration-color: var(--line); }
/* A number with its unit beside it, not wrapped under it. */
.with-unit { display: inline-flex; align-items: center; gap: var(--s2); }
.with-unit .qty { max-width: 6rem; }
.with-unit b { color: var(--muted); font-weight: 500; font-size: var(--t-small); }

/* Наводя доплату, человек делает одно из двух: вписывает своё число или берёт
   посчитанное по ставке. Обе двери стоят друг под другом у правого края. */
.pay { display: inline-flex; flex-direction: column; align-items: flex-end; gap: var(--s1); }
.pay .note { text-align: right; }

/* Where an addition is offered: one line a place — the name, where it came from, and
   the one thing to do about it on the right. */
.where { display: flex; align-items: baseline; gap: var(--s3); padding: var(--s1) 0; border-bottom: 1px solid var(--line-soft); font-size: var(--t-small); }
.where:last-child { border-bottom: none; }
.where span { color: var(--muted); }
.where form { margin-left: auto; }
.where--off, .where--off b { color: var(--muted); }
.where--off b { text-decoration: line-through; text-decoration-color: currentColor; }

/* Блок окна: черта, заголовок и то, что под ним. Окно читают сверху вниз одним
   списком блоков — «что это», «где уже предлагают», «предложить ещё». */
.was-list, .where-list { margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line-soft); }
.where-list .section:first-child { margin-top: 0; }
.where-list form.row { align-items: flex-end; }
.where-list form.row .field { flex: 1 1 14rem; }
.was { display: flex; align-items: baseline; gap: var(--s3); padding: var(--s1) 0; font-size: var(--t-small); }
.was span:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.was b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* The board of taps -------------------------------------------------------- */

/* Кран — карточка, а не строка таблицы: у него есть номер, сорт, цены и остаток, и всё
   это читают одним взглядом, стоя у стойки. Свободный кран — такая же карточка, иначе
   дырку на его месте не видно. */
.taps { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: var(--s3); }
.tap {
    position: relative; display: flex; flex-direction: column; gap: 2px; padding: var(--s3);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.tap--free { background: var(--sunken); border-style: dashed; }
.tap--wrong, .tap--dry { border-color: var(--danger); }
.tap--low { border-color: var(--warn); }
.tap-no { font-size: 1.25rem; font-weight: 600; line-height: 1.1; }
.tap-no .note { font-size: var(--t-small); font-weight: 400; }
.tap-name { font-weight: 500; }
/* Кран открывает карточку сорта целиком, как строка списка открывает свою бумагу: имя
   сорта растянуто невидимым слоем на всю карточку, а кнопки «Цены» и «Снять» лежат над
   ним — «снять с крана» не должно оказаться «открыть карточку». У свободного крана слоя
   нет, и его форму над соседями не поднимают: подсказки и окно выбора кеги уходили под
   карточку следующего крана. */
.tap .tap-name[href]::after { content: ""; position: absolute; inset: 0; }
.tap .btn, .tap form, .tap details { position: relative; z-index: 1; }
.tap.tap--free form { z-index: auto; }
.tap-prices { display: flex; flex-wrap: wrap; gap: var(--s1); margin: var(--s2) 0; }
.tap .warn { color: var(--danger-text); font-size: var(--t-small); font-weight: 500; }
.tap-foot { display: flex; align-items: center; gap: var(--s2); margin-top: auto; padding-top: var(--s2); border-top: 1px solid var(--line-soft); }
.tap-foot .left { font-variant-numeric: tabular-nums; font-size: var(--t-small); color: var(--muted); }
.tap--dry .tap-foot .left { color: var(--danger-text); font-weight: 500; }
.tap--low .tap-foot .left { color: var(--warn-text); font-weight: 500; }
.tap form { margin: 0; }
/* Вопрос у крана считает края от карточки, а не от слова «Снять»: у первого крана
   слово стоит у левого края экрана, и вопрос уезжал за него. */
.tap details.confirm { position: static; }
.tap details.confirm > .ask { left: 0; right: 0; top: 100%; width: auto; }

/* Заголовок, которым список сортируют. Щёлкают по самому слову столбца, а не по значку
   рядом с ним: так в цель попадают и мышью, и с клавиатуры, и на узком экране. Стрелка
   стоит только у того столбца, по которому список упорядочен сейчас, — у остальных её
   место пустует, иначе шапка превращается в частокол стрелок, и видно только их. */
body.office th > .sorter {
    display: flex; align-items: center; gap: 4px;
    margin: calc(-1 * var(--s2)) calc(-1 * var(--s3)); padding: var(--s2) var(--s3);
    border-radius: var(--radius-sm); color: inherit; text-decoration: none;
}
body.office th > .sorter:hover { background: var(--sunken); color: var(--text); }
/* Бледная стрелка говорит «этим столбцом можно упорядочить», полная — «упорядочено
   сейчас». Без бледной четыре живых заголовка ничем не отличались от мёртвого «Типа»,
   и щёлкать по ним человек учился случайно. Шапка при этом не чернеет: почерневшая,
   она перебивала собственные данные под собой. */
body.office th > .sorter > .icon { width: 0.875rem; height: 0.875rem; opacity: 0.3; }
body.office th[aria-sort] > .sorter { font-weight: 600; }
body.office th[aria-sort] > .sorter > .icon { opacity: 1; color: var(--text); }
/* В столбце чисел стрелка уходит влево от слова: правый край шапки остаётся там же,
   где правый край чисел под ней. */
body.office th.num > .sorter { flex-direction: row-reverse; justify-content: flex-start; }

/* Количество с единицей: единица серая и одной ширины (деталь unit), иначе «24 шт» и «1 л» кончаются на
   разной высоте и столбец чисел перестаёт быть столбцом. Минус в остатке — это
   непроведённая накладная, и он единственное, ради чего список открывают срочно. */
body.office td.amount small { color: var(--muted); font-size: var(--t-small); }
body.office td.short { color: var(--danger-text); font-weight: 500; }
body.office td.short small { color: inherit; }

/* Бумага — накладная ------------------------------------------------------ */

/* Шапка накладной стоит на листе, а не за кнопкой: поставщика, номер и дату видно, не
   нажимая ничего, и правят их там же, где читают. Сохраняются они вместе со строками —
   одной бумагой, как их и принесли. */
.paper-head { display: flex; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s3); }
.paper-head > .field { flex: 1 1 9rem; }
.paper-head > .field:first-child { flex: 2 1 16rem; }

/* Строки набирают в самой таблице: число встаёт под числом, а последняя, пустая строка
   — это следующая строка той же бумаги, а не форма рядом с ней. Столбцам заданы
   ширины, иначе поля дерутся за место и строка в пятнадцать знаков ломает список. */
.lines { table-layout: fixed; }
.lines col.c-no { width: 2.75rem; }
.lines col.c-qty, .lines col.c-sum { width: 9rem; }
/* «Закупка за единицу, ₽» — самая длинная шапка накладной: в 9rem «₽» уходил под соседний столбец. */
.lines col.c-cost { width: 10.5rem; }
.lines col.c-sale { width: 10rem; }
/* Вес строки техкарты — «1 250,5 г» и «было» под ним: три таких столбца по 9rem
   отнимали у названия место, которого числам не нужно. */
.lines col.c-weight { width: 6.5rem; }
/* Где стоит позиция: «с самого начала по 29.09.2026» и метка под ним; в окне замены —
   «184,74 → 180,53 ₽ за 1 кг» одной строкой. */
.lines col.c-span { width: 15rem; }
.lines col.c-change { width: 13rem; }
.lines col.c-off { width: 3rem; }
/* A receipt has 44.25rem of numbered columns and needs 18rem for the item as well.
   Keep the existing panel's horizontal scroll, including hints and the sticky total. */
.lines:has(col.c-sale) { min-width: calc(62.25rem + 2px); }
.lines:has(col.c-sale) input[name="item_name"] { text-overflow: ellipsis; }
/* Строка документа поставщика: сверху — его слова, под ними — позиция склада. Сколько и почём
   в единицах склада считает база и показывает строчкой, а не полем: их не вписывают. */
.lines tr.doc .said { display: block; padding: var(--s2) var(--s3) 0; color: var(--muted); font-size: var(--t-small); }
.lines tr.doc .odd { padding-top: 0; color: var(--warn-text); text-align: end; }
/* «Похоже»: под словами поставщика — позиция его сорта с галочкой, серым, как они. */
.lines tr.doc .guess { align-items: center; padding: var(--s1) var(--s3) 0; color: var(--muted); font-size: var(--t-small); }
.lines tr.doc .guess .check { width: 1rem; }
.paper-accept { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s3); }
/* Что разошлось с документом: пунктами в одной клетке, у каждого — свои кнопки. */
.gap + .gap { margin-top: var(--s2); }
/* Срок в «Расхождениях» — одной строкой: «до 06.10» и метка рядом. */
.gaps td:first-child { white-space: nowrap; }
.gap form.inline { margin-inline-start: var(--s2); }
.lines tr.doc.off td, .lines tr.doc.off .figure { color: var(--muted); }
/* Отметки документов поставки в «Накладных»: узкий столбец, галочка посередине. */
th.traced, td.traced { width: 1%; text-align: center; white-space: nowrap; }
.lines tr.doc .figure { display: block; padding: var(--s2) var(--s3); text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines tr.doc .figure small { color: var(--muted); }
.lines tr.doc td:first-child + td .figure { text-align: start; color: var(--muted); }
/* A tech card has 34.25rem of numbered columns: three weights, the cost and the cross.
   With 10rem for the item it still fits the panel of a 1024 screen whole. */
.lines:has(col.c-weight) { min-width: calc(44.25rem + 2px); }
.lines:has(col.c-weight) input[name="item_name"] { text-overflow: ellipsis; }
.lines td { padding: var(--s2) var(--s3); }
/* Номер строки считает сам список: в коде это было бы второе место, где живёт порядок
   строк, и однажды они разошлись бы. */
.lines tbody { counter-reset: line; }
.lines tbody td:first-child { color: var(--muted); font-variant-numeric: tabular-nums; }
.lines tbody td:first-child::before { counter-increment: line; content: counter(line); }
.lines input { width: 100%; }
/* Сумму строки считает база: её показывают числом, а не полем, — её не вписывают. */
.lines td.sum { font-variant-numeric: tabular-nums; font-weight: 500; white-space: nowrap; } .lines td.sum small { color: var(--muted); font-weight: 400; }
.lines td.fact { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* Пустая строка внизу подложкой говорит, что она ещё не строка бумаги. Помечена она
   сама, а не последняя по счёту: у проведённой накладной последняя строка — строка.
   Так же помечена строка, в которой заводят новое в справочнике: там она такая же —
   последняя, пустая и той же формы, что и соседние. */
tbody tr.next td, tbody tr.next:hover td { background: var(--sunken); }
.lines tbody tr.next td.sum { color: var(--muted); font-weight: 400; }
/* Строка, из-за которой бумага не сохранилась, — одна из пятнадцати, бывает и последней. Розовое
   к белому — 1,07, поэтому у неё ещё красная черта слева и значок у номера. */
.lines tbody tr.wrong td, .lines tbody tr.wrong:hover td { background: var(--danger-soft); } .lines tbody tr.wrong td:first-child { box-shadow: inset 3px 0 0 var(--danger); padding-inline-end: 0; color: var(--danger-text); font-weight: 600; white-space: nowrap; }
.lines tbody tr.wrong td:first-child::after { content: ""; display: inline-block; width: 0.875rem; height: 0.875rem; margin-inline-start: 3px; vertical-align: -0.125rem; background: var(--wrong-mark) center / contain no-repeat; }
/* Итог стоит под столбцом сумм тем же кеглем, рубли под рублями: крупный уезжал на 21 точку. */
.lines tfoot td { border-top: 1px solid var(--line); border-bottom: none; background: var(--surface); font-weight: 600; }
.lines.lines--quiet tbody td.sum { padding-inline-end: var(--s3); }
.lines tfoot tr:hover td { background: var(--surface); }

/* Лист из клеток: поле занимает клетку целиком, а рамку берёт под курсором и при
   наборе. Сетку держит сама таблица — тонкая черта между клетками, — и лист читается
   столбцами, как его и читают. Правила стоят на двух классах сразу: подложка комнаты
   задаёт клетке отступ, и одного класса ей мало, чтобы его снять. */
.lines.lines--quiet td { padding: 0; }
.lines.lines--quiet tbody td + td { border-inline-start: 1px solid var(--line-soft); }
.lines.lines--quiet tbody td:first-child { padding-inline: var(--s3); }
.lines.lines--quiet tfoot td { padding: var(--s2) var(--s3); border-inline-start: none; }
/* Клетка, в которую пишут, подчёркнута краем поля: рамок в покое нет, но «сюда пишут»
   должно быть видно и не наведя курсор, а подложка сетки даёт к листу 1,13 — то есть
   ничего. Клетка-итог черты не берёт: её не набирают, и она этим отличается. */
.lines.lines--quiet .slot { border-bottom-color: var(--edge); }
/* Проведённая накладная — тот же лист с запертыми полями: черты под клетками нет,
   набирать в них нечего. Столбцы и высота строк остаются теми же, и возврат в правку
   ничего на экране не двигает. */
.lines.lines--shut .slot { border-bottom-color: transparent; }
.lines.lines--shut .slot:hover { background: none; border-color: transparent; }
/* Лист, который только читают, — прежний состав техкарты: полей в нём нет, и воздух строкам
   и итогу дают сами клетки. Клетка офиса своего воздуха сверху и снизу не даёт. */
.lines.lines--read td { padding-block: var(--s2); }
/* Отчего цена заперта — строчкой под самим числом, а не общей фразой над листом: строк
   пятнадцать, и «какая-то из цен продана» не говорит, какая. */
.lines .note { display: block; margin-top: 2px; padding: 0 var(--s3); color: var(--muted); font-size: var(--t-small); text-align: end; }
/* Марки банок в строке списания: кнопки партий — кнопками, с промежутком, а ушедшие марки — списком под строкой. */
.lines .line-lots { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s1); margin-top: var(--s1); padding: 0 var(--s3); }
.lines .line-marks { margin-top: 2px; font-size: var(--t-small); }
.lines .line-marks > summary { color: var(--muted); cursor: pointer; }
.lines .line-marks > ul { margin: var(--s1) 0 0; padding-left: var(--s4); overflow-wrap: anywhere; }
.paper-sheet > .withdrawn { margin: var(--s3) 0 0; }

/* Строка, которая ждёт позицию с полки: подложка «выбранной строки» даёт к листу 1,09,
   и одной ею человек строку не находит. Черта слева — та же, какой список показывает
   строку под курсором. */
.lines.lines--quiet tr.on td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
/* Крестик виден на той строке, где курсор: пятнадцать крестиков на листе — пятнадцать
   предложений что-нибудь удалить, а убирают строку раз в сто строк. Где курсора не
   бывает вовсе — на планшете, — крестик просто тихий: невидимую цель не нажать. Прячут
   только кнопку: строка документа «не на склад» тоже помечена off, и пропадала целиком. */
.lines.lines--quiet .btn.off { opacity: 0; }
.lines.lines--quiet tr:hover .btn.off, .lines.lines--quiet tr:focus-within .btn.off { opacity: 1; }
@media (hover: none) { .lines.lines--quiet .btn.off { opacity: 1; color: var(--muted); } }

/* На ноутбуке лист уже, а колонки те же: место уступают те, которые читают реже. */
@media (max-width: 78rem) {
    .workbench { grid-template-columns: minmax(10rem, 12rem) minmax(0, 1fr); }
    .menu-list th:nth-child(2) { width: 6.5rem; }
    .menu-list th:nth-child(3) { width: 5rem; }
    .menu-list th:nth-child(4) { width: 5rem; }
}
@media (max-width: 62rem) {
    .workbench { grid-template-columns: 1fr; }
    .tree { position: static; }
}
