/*
  Дизайн-система редизайна «Тёплый Лофт» (redesign/DESIGN_SYSTEM.md).
  Значения токенов и геометрии взяты дословно из redesign/design-tokens.css и redesign/reference.css.
  Отличия от reference.css:
    - селекторы не ограничены #loft-redesign — это полноценная страница приложения, не встроенный демо-блок;
    - добавлены состояния, которых нет в эталоне (ошибка, focus-visible, hover/active кнопок) — раздел 5 ТЗ;
    - таблица заданий — семантический <table>, а не div-grid (сохранены те же классы/визуальный результат);
    - добавлена печатная раскладка (@media print) — раздел WD-05: без навигации/кнопок/фона.
*/

:root {
  color-scheme: light;
  --lf-bg: #f6f7f3;
  --lf-paper: #ffffff;
  --lf-text: #24332c;
  --lf-muted: #5e6d64;
  --lf-line: #dce3dc;
  --lf-brand: #286247;
  --lf-on: #ffffff;
  --lf-soft: #eaf1eb;
  --lf-warn: #fff5e2;
  --lf-warntext: #8a5709;
  --lf-sidebar: #ffffff;

  --lf-sidebar-width: 196px;
  --lf-radius-shell: 20px;
  --lf-radius-card: 20px;
  --lf-radius-notice: 16px;
  --lf-radius-control: 12px;
  --lf-radius-badge: 8px;
  --lf-control-height: 40px;
  --lf-touch-control-height: 44px;
  --lf-font-body: 14px;
  --lf-font-caption: 12px;
  --lf-font-heading: 25px;
  --lf-font-subheading: 17px;
  --lf-font-family: Inter, ui-sans-serif, system-ui, sans-serif;

  --lf-brand-hover: #1f5039;
  --lf-brand-active: #1a4431;
  --lf-error: #b13b32;
  --lf-error-bg: #fcefed;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--lf-font-family);
  font-size: var(--lf-font-body);
  line-height: 1.5;
  color: var(--lf-text);
  background: var(--lf-bg);
}

button, input, select { font: inherit; }

a { color: var(--lf-brand); }
/* Эталон: названия в списках — обычный тёмный текст; ссылка видна по hover/focus. */
.lf-order-main > a, .lf-table td > a { color: var(--lf-text); text-decoration: none; }
.lf-order-main > a:hover, .lf-table td > a:hover { color: var(--lf-brand); text-decoration: underline; }

h1, h2, h3, h4, p { margin: 0; }

/* ---------- Оболочка ---------- */
/* «Улитка» 07.10.2026: почти белый фон #F6F7F3, белое меню с границей, токены — docs/ulitka/README_CLAUDE.md. */

#app-shell {
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius-shell);
  overflow: hidden;
  min-height: 100vh;
}

.lf-page {
  display: grid;
  grid-template-columns: var(--lf-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.lf-side {
  background: var(--lf-sidebar);
  border-right: 1px solid var(--lf-line);
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.lf-logo {
  font-weight: 600;
  letter-spacing: .015em;
  padding: 0 12px;
}
.lf-logo span {
  display: block;
  font-weight: 400;
  font-size: var(--lf-font-caption);
  color: var(--lf-muted);
  margin-top: 3px;
}

.lf-side nav { display: grid; gap: 5px; }
.lf-side-menu { display: flex; flex-direction: column; gap: 25px; flex: 1; }
.lf-menu-btn { display: none; }

.lf-side-bottom { margin-top: auto; display: grid; gap: 10px; }

.lf-person { padding: 8px 12px; color: var(--lf-muted); font-size: var(--lf-font-caption); }
/* «Выйти» — не пункт макета, добавлен для реальной сессии: тихая кнопка без рамки. */
.lf-logout { width: 100%; justify-content: flex-start; background: transparent; border-color: transparent; padding: 8px 12px; }

.lf-content { padding: 27px 27px 20px; min-width: 0; position: relative; isolation: isolate; }

/* ---------- Кнопки ---------- */

button, .lf-btn, .lf-nav {
  min-height: var(--lf-control-height);
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius-control);
  padding: 8px 13px;
  color: var(--lf-text);
  background: var(--lf-paper);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}
button:disabled, .lf-btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }
/* data-lf-busy (loft.js): видимый индикатор выполнения на кнопке, пока идёт запрос. */
form[data-lf-submitting="true"] button[aria-disabled="true"] { cursor: progress; pointer-events: none; }
form[data-lf-submitting="true"] button[aria-disabled="true"] > svg { display: none; }
form[data-lf-submitting="true"] button[aria-disabled="true"]::before {
  content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%;
  animation: lf-spin .8s linear infinite;
}
@keyframes lf-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { form[data-lf-submitting="true"] button[aria-disabled="true"]::before { animation-duration: 2.4s; } }

button:hover, .lf-btn:hover { background: var(--lf-soft); }

.lf-primary {
  background: var(--lf-brand);
  color: var(--lf-on);
  border-color: var(--lf-brand);
}
.lf-primary:hover { background: var(--lf-brand-hover); border-color: var(--lf-brand-hover); }
.lf-primary:active { background: var(--lf-brand-active); border-color: var(--lf-brand-active); }

.lf-small { font-size: var(--lf-font-caption); color: var(--lf-muted); }

button:focus-visible, .lf-btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--lf-brand);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  button, .lf-btn { transition: none; }
}

/* Навигация: активный пункт — белый фон + medium (раздел 5, состояние №1 из трёх). */
.lf-nav {
  background: transparent;
  border-color: transparent;
  justify-content: flex-start;
  padding: 10px 12px;
  width: 100%;
  color: var(--lf-text);
}
.lf-nav svg { flex: none; }

.lf-icon { width: 16px; height: 16px; flex: none; }
.lf-nav[aria-current="page"] { background: var(--lf-soft); color: var(--lf-brand); font-weight: 600; }

/* Этапы дня: выбран — зелёная заливка (раздел 5, состояние №2). */
.lf-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid var(--lf-line);
  padding-bottom: 14px;
  margin-bottom: 20px;
}
.lf-tab { border-color: transparent; background: transparent; }
.lf-tab[aria-pressed="true"], .lf-tab[aria-current="page"] { background: var(--lf-brand); color: var(--lf-on); }
.lf-step { opacity: .7; font-size: var(--lf-font-caption); }
.lf-count {
  font-size: var(--lf-font-caption); min-width: 20px; padding: 0 6px; border-radius: var(--lf-radius-badge);
  background: var(--lf-warn); color: var(--lf-warntext); font-variant-numeric: tabular-nums; text-align: center;
}

/* Участки задания: выбран — мягкий зелёный (раздел 5, состояние №3). */
.lf-filter { background: var(--lf-bg); border-color: var(--lf-line); }
.lf-filter[aria-pressed="true"], .lf-filter[aria-current="page"] { background: var(--lf-soft); color: var(--lf-brand); border-color: var(--lf-brand); }

/* ---------- Типографика и раскладка ---------- */

h2.lf-heading { font-size: var(--lf-font-heading); line-height: 1.2; font-weight: 600; margin: 0 0 8px; }
h3 { font-size: var(--lf-font-subheading); font-weight: 600; }

.lf-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lf-between { justify-content: space-between; }
.lf-head { margin-bottom: 24px; align-items: flex-start; }

.lf-notice {
  padding: 14px 16px;
  background: var(--lf-warn);
  color: var(--lf-warntext);
  border-radius: var(--lf-radius-notice);
  margin-bottom: 18px;
}
.lf-notice strong { color: var(--lf-warntext); }

/* Итог успешного действия — мягкий зелёный (семантика «успех», раздел 5 «Статусы»). */
.lf-notice-ok { background: var(--lf-soft); color: var(--lf-brand); }
.lf-notice-ok strong { color: var(--lf-brand); }

.lf-notice-error {
  background: var(--lf-error-bg);
  color: var(--lf-error);
}
.lf-notice-error strong { color: var(--lf-error); }

.lf-box {
  background: var(--lf-paper);
  border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius-card);
  padding: 18px;
  margin-bottom: 16px;
}

.lf-summary { margin: 16px 0; color: var(--lf-muted); }
.lf-summary strong { color: var(--lf-text); font-weight: 600; }

.lf-bottom { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--lf-line); }

.lf-drawer {
  border: 1px solid var(--lf-brand);
  background: var(--lf-paper);
  padding: 20px;
  border-radius: var(--lf-radius-control);
  margin: 0 0 20px;
}

.lf-message { color: var(--lf-brand); font-size: 13px; min-height: 24px; margin-top: 12px; }
.lf-message.lf-message-error { color: var(--lf-error); }

/* ---------- Таблица заданий (семантический <table>, тот же визуальный результат) ---------- */

.lf-table { width: 100%; border-collapse: collapse; }
.lf-table-grid { table-layout: fixed; }
.lf-table th {
  color: var(--lf-muted);
  font-size: var(--lf-font-caption);
  font-weight: 400;
  text-align: left;
  padding: 12px 0 9px;
  border-bottom: 1px solid var(--lf-line);
}
.lf-table th.lf-num, .lf-table td.lf-num { text-align: right; }
.lf-table td {
  padding: 16px 0;
  border-bottom: 1px solid var(--lf-line);
  vertical-align: middle;
}
/* Эталон: статус в ячейке grid растянут на ширину колонки (grid item stretch). */
.lf-table-grid td > .lf-tag { display: flex; }
.lf-table tr:last-child td { border-bottom: 0; }
/* Эталон: gap 12px между колонками grid — в <table> это отступ слева у всех, кроме первой. */
.lf-table th + th, .lf-table td + td { padding-left: 12px; }
.lf-table col.lf-col-main { width: auto; }
/* Ширина колонки включает отступ-«gap» 12px слева: 64+12 и 105+12 (эталон grid 1fr 64px 105px). */
.lf-table col.lf-col-qty { width: 76px; }
.lf-table col.lf-col-stage { width: 117px; }

.lf-num { font-variant-numeric: tabular-nums; }
.lf-code { display: block; font-size: var(--lf-font-caption); color: var(--lf-muted); margin-top: 3px; overflow-wrap: anywhere; }

/* ---------- Статусы (семантический цвет — раздел 5 "Статусы") ---------- */

.lf-tag {
  font-size: var(--lf-font-caption);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--lf-radius-badge);
  background: var(--lf-soft);
  color: var(--lf-brand);
  white-space: nowrap;
}
.lf-tag-success { background: var(--lf-soft); color: var(--lf-brand); }
.lf-tag-warn { background: var(--lf-warn); color: var(--lf-warntext); }
.lf-tag-error { background: var(--lf-error-bg); color: var(--lf-error); }
.lf-tag-neutral { background: var(--lf-bg); color: var(--lf-muted); border: 1px solid var(--lf-line); }

/* ---------- Поля форм ---------- */

input, select {
  max-width: 100%;
  border: 1px solid var(--lf-line);
  background: var(--lf-paper);
  color: var(--lf-text);
  border-radius: var(--lf-radius-control);
  padding: 9px 11px;
}
input[type="checkbox"], input[type="radio"] { max-width: none; }

.lf-search { width: 100%; margin: 16px 0; }

.lf-label { display: block; margin: 14px 0 7px; font-size: var(--lf-font-caption); color: var(--lf-muted); }

.lf-field-error { color: var(--lf-error); font-size: var(--lf-font-caption); margin-top: 6px; }
.lf-hint { margin-top: 6px; }
.lf-fieldset { border: 0; padding: 0; margin: 0; }
.lf-fieldset legend { padding: 0; }
.lf-check { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.lf-check input { width: 16px; height: 16px; accent-color: var(--lf-brand); }
.lf-form-box { max-width: 560px; }
.lf-box-spaced { margin-top: 16px; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; overflow-wrap: anywhere; }
.lf-field-error-border { border-color: var(--lf-error) !important; }

/* ---------- Строки списков (заказы/товары/этикетки/отгрузка) ---------- */

.lf-order {
  display: flex;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--lf-line);
  flex-wrap: wrap;
}
.lf-order:last-child { border: 0; }
.lf-order-main { min-width: 0; overflow-wrap: anywhere; }
.lf-grow { flex: 1 1 240px; }
.lf-pdf-frame { width: 100%; height: 70vh; min-height: 420px; border: 0; border-radius: var(--lf-radius-control); background: var(--lf-bg); }

.lf-date { padding: 7px 0; color: var(--lf-muted); }

.lf-row-tight { gap: 6px; }
.lf-align-end { align-self: flex-end; }
.lf-filter-bar { align-items: flex-end; margin-bottom: 16px; }
.lf-filter-bar .lf-label { margin-top: 0; }
.lf-text-error { color: var(--lf-error); }
.lf-search-tight { margin: 0; }
.lf-input-narrow { flex: 0 1 180px; min-width: 120px; }
.lf-inline-form { margin-top: 4px; }
.lf-select-wide { width: 100%; }

/* Раскрытие строки (WD-05 «Сборка»): компактный основной список, детали — по запросу. */
details.lf-expand > summary { cursor: pointer; list-style: none; }
details.lf-expand > summary::-webkit-details-marker { display: none; }
details.lf-expand > summary::before {
  content: "›"; display: inline-block; width: 14px; color: var(--lf-muted);
  transition: transform 140ms ease;
}
details.lf-expand[open] > summary::before { transform: rotate(90deg); }
details.lf-expand > summary .lf-code { padding-left: 14px; }
.lf-sublist { list-style: none; margin: 10px 0 0; padding: 0 0 0 14px; }
.lf-sublist li {
  display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--lf-line);
  font-size: var(--lf-font-caption); overflow-wrap: anywhere;
}
.lf-sublist li .lf-code { margin-top: 0; }
@media (prefers-reduced-motion: reduce) { details.lf-expand > summary::before { transition: none; } }

details.lf-details { padding: 16px 0; border-bottom: 1px solid var(--lf-line); }
details.lf-details:last-child { border-bottom: 0; }
details.lf-details summary { cursor: pointer; font-weight: 600; }
details.lf-details p { margin-top: 10px; color: var(--lf-muted); }

[hidden] { display: none !important; }

.lf-visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Выбранный результат «Не отгружен» — семантический красный (расширение DESIGN_SYSTEM §2). */
.lf-danger { background: var(--lf-error-bg); color: var(--lf-error); border-color: var(--lf-error); }
.lf-danger:hover { background: var(--lf-error-bg); }
.lf-btn-compact { min-height: 32px; padding: 4px 10px; font-size: var(--lf-font-caption); }

/* ---------- Отгрузка (WD-07) ---------- */
.dispatch-filters { margin-bottom: 16px; }
.dispatch-filters input { min-width: 180px; }
.dispatch-list { padding-top: 2px; padding-bottom: 2px; }
.dispatch-group + .dispatch-group { border-top: 1px solid var(--lf-line); }
.dispatch-group:not(:last-of-type) .dispatch-row:last-child { border-bottom: 0; }
.dispatch-group-head { padding: 12px 0 0; }
.dispatch-group-head + .dispatch-row { padding-top: 10px; }
.dispatch-row[aria-busy="true"] { opacity: .6; }
.lf-row-status { margin-top: 3px; }
.dispatch-reason { flex: 1 1 100%; }
.dispatch-reason .lf-label { margin-top: 0; }
.dispatch-comment { flex: 1 1 220px; }
.lf-confirm { border-color: var(--lf-brand); margin-top: 16px; }
.lf-confirm:focus { outline: none; }

.lf-empty { color: var(--lf-muted); padding: 24px 0; text-align: center; }

/* ---------- Склад: Товары → Составы (ТЗ склада, раздел 7.1) ---------- */
.wh-split { display: grid; grid-template-columns: minmax(260px, 35%) minmax(0, 1fr); gap: 16px; align-items: start; }
.wh-split > .lf-box { margin-bottom: 0; }
.wh-first-label { margin-top: 0; }
.wh-filters { margin: 12px 0 4px; }
.wh-list-rows { max-height: calc(100vh - 260px); overflow-y: auto; margin: 0 -8px; padding: 0 8px; }
.wh-list-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
  padding: 12px 8px; margin: 0 -8px; border-bottom: 1px solid var(--lf-line);
  color: var(--lf-text); text-decoration: none; border-radius: var(--lf-radius-control);
}
.wh-list-row:hover { background: var(--lf-bg); }
.wh-list-row[aria-current="page"] { background: var(--lf-soft); }
.wh-list-text { min-width: 0; overflow-wrap: anywhere; }
.wh-list-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.wh-back { display: none; margin-bottom: 12px; }
.wh-product-name { font-size: var(--lf-font-subheading); margin: 4px 0 12px; overflow-wrap: anywhere; }
.wh-lines { margin-top: 8px; }
.wh-line {
  display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; gap: 4px 12px; align-items: end;
  padding: 12px 0; border-bottom: 1px solid var(--lf-line);
}
.wh-line .lf-label { margin-top: 0; }
.wh-line-more, .wh-line-error { grid-column: 1 / -1; }
.wh-line-more summary { cursor: pointer; width: fit-content; }
.wh-line-more select { margin-bottom: 6px; }
.wh-qty { display: flex; align-items: center; gap: 8px; }
.wh-qty input { width: 90px; text-align: right; font-variant-numeric: tabular-nums; }
.wh-unit { min-width: 28px; color: var(--lf-muted); }
.wh-line-actions { margin-top: 14px; }
.wh-summary { margin-top: 14px; min-height: 21px; }
.wh-create { margin-top: 16px; }
.wh-create h3 { margin-bottom: 4px; }
.wh-suggest { margin-top: 8px; }
.wh-create-fields { align-items: flex-end; }
.wh-similar { margin-top: 14px; }
.wh-similar li { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.wh-versions { margin-top: 12px; padding-bottom: 0; }
.wh-dialog { max-width: 420px; border: 1px solid var(--lf-line); }
.wh-dialog::backdrop { background: rgba(37, 40, 36, .35); }
@media (max-width: 1023px) {
  .wh-split { grid-template-columns: 1fr; }
  .wh-has-selection .wh-list { display: none; }
  .wh-split:not(.wh-has-selection) .wh-editor { display: none; }
  .wh-back { display: inline-flex; }
  .wh-list-rows { max-height: none; }
}
@media (max-width: 520px) {
  .wh-line { grid-template-columns: minmax(0, 1fr) auto; }
  .wh-line-component { grid-column: 1 / -1; }
}

/* ---------- Склад: главная и импорт ---------- */
.wh-checklist { list-style: none; margin: 0; padding: 0; }
.wh-checklist li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid var(--lf-line); }
.wh-checklist li:last-child { border-bottom: 0; }
.wh-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.wh-import-row { padding: 12px 0; border-bottom: 1px solid var(--lf-line); overflow-wrap: anywhere; }
.wh-import-row:last-child { border-bottom: 0; }
.wh-import-row ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- Склад: остатки, операции, проверка дня (ТЗ склада, разделы 8–13) ---------- */
.wh-daybar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px; margin: -6px 0 16px; background: var(--lf-paper); border: 1px solid var(--lf-line);
  border-radius: var(--lf-radius-control);
}
.wh-kind { margin-bottom: 4px; }
.wh-stock-filters select { min-width: 150px; }
.wh-stock-table td { padding: 12px 0; }
.wh-change summary { margin-top: 4px; }
.wh-form { max-width: 720px; }
.wh-select { margin-top: 6px; }
.wh-rline { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 8px 0; border-bottom: 1px solid var(--lf-line); }
.wh-rlines { margin: 8px 0 10px; }
.wh-qty-input { width: 100px; text-align: right; font-variant-numeric: tabular-nums; }
.wh-show-parts { margin-top: 10px; }
.wh-check-strong { margin-top: 16px; font-weight: 500; }
.wh-outcome { margin-top: 12px; padding: 12px 14px; border-radius: var(--lf-radius-control); background: var(--lf-bg); }
.wh-parts { margin-top: 8px; }
.wh-parts td { padding: 10px 0; }
.wh-blockers { margin: 8px 0 0; padding-left: 18px; }
.wh-day-tools { margin-bottom: 10px; }
.wh-day td { padding: 12px 0; vertical-align: top; }
.wh-day-name { min-width: 0; overflow-wrap: anywhere; }
.wh-day-packed { width: 210px; }
.wh-source { display: block; margin-top: 4px; }
.wh-row-error td:first-child { box-shadow: inset 3px 0 0 var(--lf-error); padding-left: 10px; }
.wh-row-warn td:first-child { box-shadow: inset 3px 0 0 #c8962d; padding-left: 10px; }
.wh-warn-text { color: var(--lf-warntext); font-size: var(--lf-font-caption); margin-top: 6px; }
.wh-rest { padding-bottom: 0; }
.wh-rest table { margin-top: 8px; }
.wh-close-bar { align-items: center; }
.wh-save-draft { margin-left: auto; }
.wh-history td { padding: 12px 0; vertical-align: top; }
.wh-item-balances .lf-order { padding: 10px 0; }
@media (max-width: 760px) {
  .wh-day thead { display: none; }
  .wh-day, .wh-day tbody, .wh-day tr, .wh-day td { display: block; width: 100%; }
  .wh-day tr { padding: 12px 0; border-bottom: 1px solid var(--lf-line); }
  .wh-day td { border: 0; padding: 4px 0 !important; text-align: left; }
  .wh-day td[data-label] { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
  .wh-day td[data-label]::before { content: attr(data-label); color: var(--lf-muted); font-size: var(--lf-font-caption); }
  .wh-day-packed { width: 100%; }
  .wh-source { flex-basis: 100%; }
  .wh-row-error td:first-child, .wh-row-warn td:first-child { padding-left: 10px !important; }
  .wh-save-draft { margin-left: 0; }
}

.wh-select-list { max-height: 320px; overflow-y: auto; margin-top: 8px; }
.wh-count td { padding: 10px 0; vertical-align: top; }
.wh-count-note { display: block; margin-top: 6px; width: 100%; max-width: 260px; font-size: var(--lf-font-caption); }
.wh-export { margin: -4px 0 10px; }
.wh-discrepancy { margin-top: 0; }
.wh-discrepancy p { max-width: 70ch; }
.wh-report td { padding: 10px 0; }

/* ---------- Экран входа (не описан в redesign/SPEC.md отдельно — та же система токенов) ---------- */

.lf-guest {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lf-guest-box { width: 100%; max-width: 340px; }
.lf-guest-box h1 { font-size: var(--lf-font-heading); font-weight: 600; margin-bottom: 4px; }
.lf-guest-box .lf-small { display: block; margin-bottom: 4px; }

/* ---------- Загрузка / skip-link ---------- */

.lf-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--lf-paper);
  color: var(--lf-text);
  padding: 10px 16px;
  border-radius: var(--lf-radius-control);
  z-index: 100;
}
.lf-skip-link:focus { left: 12px; top: 12px; }

/* ---------- Адаптивность (redesign/DESIGN_SYSTEM.md раздел 6) ---------- */

@media (max-width: 720px) {
  .lf-page { grid-template-columns: 1fr; min-height: 0; }
  .lf-side { padding: 8px 12px; gap: 8px; }
  .lf-side-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
  .lf-side-top .lf-logo { padding: 0 4px; }
  .lf-side-menu { gap: 8px; }
  .lf-js .lf-menu-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--lf-line); border-radius: var(--lf-radius-control); background: var(--lf-paper); color: var(--lf-text); font: inherit; cursor: pointer; }
  .lf-js .lf-side:not([data-open]) .lf-side-menu { display: none; }
  .lf-logo span, .lf-person { display: none; }
  .lf-side nav { display: flex; flex-wrap: wrap; gap: 3px; }
  .lf-side-bottom { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
  .lf-nav, .lf-logout { width: auto; }
  .lf-side-bottom form { margin-left: auto; }
  .lf-content { padding: 14px 15px 20px; }
  .lf-help-hero { margin-bottom: 12px; }
  .lf-help-title { font-size: 26px; }
  .lf-help-sectionhead { margin: 18px 0 10px; }
  .lf-table col.lf-col-main { width: auto; }
  .lf-table col.lf-col-qty { width: 50px; }
  .lf-table col.lf-col-stage { width: 84px; }
  .lf-table th + th, .lf-table td + td { padding-left: 8px; }
  .lf-table th, .lf-table td { padding-left: 0; padding-right: 0; }
  h2.lf-heading { font-size: 22px; }
  .lf-head { margin-bottom: 18px; }
}

@media (pointer: coarse) {
  button, .lf-btn, .lf-btn-compact { min-height: var(--lf-touch-control-height); }
  input, select { font-size: 16px; }
}

/* Контрольная ширина 320px (redesign/DESIGN_SYSTEM.md раздел 6): не допускать горизонтальный скролл страницы. */
html, body { max-width: 100%; overflow-x: hidden; }
.lf-scroll-x { overflow-x: auto; }

/* ---------- Печатные формы (WD-05) ---------- */
.lf-print-page { padding: 24px; background: var(--lf-paper); }
.lf-print-toolbar { margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--lf-line); }
.lf-print-table { width: 100%; border-collapse: collapse; }
.lf-print-table th { color: var(--lf-muted); font-size: var(--lf-font-caption); font-weight: 400; text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--lf-line); }
.lf-print-table td { padding: 8px 6px; border-bottom: 1px solid var(--lf-line); vertical-align: top; overflow-wrap: anywhere; }
.lf-print-table .lf-num { text-align: right; white-space: nowrap; }
.lf-print-table tfoot td { border-bottom: 0; }
.lf-print-table tr { break-inside: avoid; }
.lf-secret { font-size: 16px; }
/* Канал (WB СГТ/WB Р/…) — синим, как колонка «Площадка» в XLSX сборочного задания. */
.lf-channel { color: #1F4E9A; font-weight: 500; }

/* ---------- Печать (WD-05/WD-06: без навигации/кнопок/фона приложения) ---------- */

@media print {
  body { background: #fff; }
  .lf-page { display: block; }
  .lf-side, .lf-no-print { display: none !important; }
  .lf-content { padding: 0; }
  #app-shell { border: 0; border-radius: 0; min-height: 0; }
  .lf-box { border: 0; padding: 0; margin-bottom: 12px; }
  .lf-print-page { padding: 0; }
  .lf-print-table thead { display: table-header-group; }
}

/* ---------- Помощь (docs/help_pack_20260926/02_UX_UI_SPEC.md) ---------- */
.lf-help-hero { display: grid; gap: 8px; max-width: 760px; margin-bottom: 20px; }
.lf-help-title { font-size: 30px; line-height: 1.2; margin: 0; font-weight: 650; text-wrap: balance; }
.lf-help-lead { font-size: 16px; color: var(--lf-muted); margin: 0; }
.lf-help-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--lf-brand); margin: 0; }
.lf-help-h2 { font-size: 19px; margin: 0; font-weight: 650; }
.lf-help-searchform { display: grid; gap: 6px; margin-top: 12px; }
.lf-help-searchbox { display: flex; align-items: center; gap: 10px; background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: var(--lf-radius-control); padding: 0 12px; min-height: 48px; }
.lf-help-searchbox:focus-within { border-color: var(--lf-brand); box-shadow: 0 0 0 3px var(--lf-soft); }
.lf-help-searchbox input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }  /* один крестик — наш */
.lf-help-searchbox input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 16px; min-height: 44px; min-width: 0; }
.lf-help-clear { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--lf-muted); }
.lf-help-clear[hidden] { display: none; }
.lf-help-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lf-help-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--lf-line); border-radius: 999px; background: var(--lf-paper); color: var(--lf-text); text-decoration: none; }
.lf-help-chip:hover { border-color: var(--lf-brand); color: var(--lf-brand); }
.lf-help-sectionhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 28px 0 12px; flex-wrap: wrap; }
.lf-help-journeys, .lf-help-topics, .lf-help-groups { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.lf-help-journey, .lf-help-topic, .lf-help-card { background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: 20px; padding: 18px; }
.lf-help-journey { display: grid; gap: 6px; align-content: start; }
.lf-help-journey p { margin: 0; color: var(--lf-muted); }
.lf-help-journey-title { font-size: 17px; font-weight: 650; color: var(--lf-text); text-decoration: none; }
a.lf-help-journey-title:hover, .lf-help-topic:hover strong { color: var(--lf-brand); text-decoration: underline; }
.lf-help-iconbox { display: inline-flex; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: 12px; background: var(--lf-soft); color: var(--lf-brand); }
.lf-help-iconbox .lf-icon { width: 20px; height: 20px; }
.lf-help-topic { display: grid; gap: 4px; text-decoration: none; color: var(--lf-text); }
.lf-help-topic span:last-child { color: var(--lf-muted); }
.lf-help-card h3 { margin: 0 0 8px; font-size: 16px; }
.lf-help-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lf-help-links a { display: inline-block; padding: 6px 0; text-decoration: underline; text-underline-offset: 3px; }
.lf-help-principles { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 16px; padding: 14px 18px; background: var(--lf-soft); border-radius: 16px; }
.lf-help-principles span::before { content: "•"; color: var(--lf-brand); margin-right: 6px; }
.lf-help-results { max-width: 760px; }
.lf-help-resultlist { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.lf-help-resultlist a { display: grid; gap: 2px; padding: 14px 16px; background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: 16px; color: var(--lf-text); text-decoration: none; }
.lf-help-resultlist a:hover strong { color: var(--lf-brand); text-decoration: underline; }
.lf-help-resultlist span { color: var(--lf-muted); }
.lf-help-empty { background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: 16px; padding: 16px; display: grid; gap: 10px; justify-items: start; }
.lf-help-empty p { margin: 0; }
.lf-help-fold summary { cursor: pointer; list-style: revert; }
.lf-help-fold summary h2 { display: inline; }
.lf-help-fold + .lf-help-fold { margin-top: 12px; }
.lf-help-dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 12px 0 0; }
.lf-help-dl dt { font-weight: 600; }
.lf-help-dl dd { margin: 0; color: var(--lf-text); }
.lf-help-back { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; text-decoration: none; min-height: 36px; }
.lf-help-articlegrid { display: grid; grid-template-columns: minmax(0, 740px) minmax(220px, 300px); gap: 20px; align-items: start; }
.lf-help-article { background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: 22px; padding: 28px; font-size: 16px; line-height: 1.6; display: grid; gap: 14px; }
.lf-help-article .lf-help-title { font-size: 28px; }
.lf-help-aside { display: grid; gap: 12px; }
.lf-help-aside p { margin: 0 0 12px; color: var(--lf-muted); }
.lf-help-where { background: var(--lf-bg); border-radius: 12px; padding: 10px 14px; font-size: 14px; }
.lf-help-stephead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.lf-help-stephead h2 { font-size: 19px; margin: 0; }
.lf-help-steps { list-style: none; margin: 0; padding: 0; display: grid; }
.lf-help-steps li { border-bottom: 1px solid var(--lf-line); }
.lf-help-steps li:last-child { border-bottom: 0; }
.lf-help-step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; cursor: default; }
.lf-help-guided .lf-help-step { cursor: pointer; }
.lf-help-num { flex: none; display: inline-flex; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 999px; background: var(--lf-soft); color: var(--lf-brand); font-size: 13px; font-weight: 700; }
.lf-help-check { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--lf-brand); flex: none; }
.lf-help-done .lf-help-num { background: var(--lf-brand); color: var(--lf-on); }  /* отмечено: галочка и цвет номера, текст остаётся читаемым */
.lf-help-guide-note { margin: 0; padding: 8px 12px; background: var(--lf-warn); color: var(--lf-warntext); border-radius: 12px; }
.lf-link-btn { background: none; border: 0; padding: 0; color: var(--lf-brand); text-decoration: underline; cursor: pointer; justify-self: start; min-height: 32px; }
.lf-help-options { list-style: none; margin: 0 0 12px 40px; padding: 0; display: grid; gap: 8px; }
.lf-help-options li { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--lf-line); border-radius: 12px; background: var(--lf-bg); }
.lf-help-options li::before { content: "или"; font-size: 12px; color: var(--lf-muted); }
.lf-help-options li:first-child::before { content: "Выберите один способ"; }
.lf-help-callout { border-radius: 16px; padding: 14px 16px; }
.lf-help-callout strong { display: block; margin-bottom: 2px; }
.lf-help-callout p { margin: 0; }
.lf-help-ok { background: var(--lf-soft); }
.lf-help-warn { background: var(--lf-warn); color: var(--lf-warntext); }
.lf-help-err { background: var(--lf-error-bg); color: var(--lf-error); }
.lf-help-details details { border-bottom: 1px solid var(--lf-line); padding: 10px 0; }
.lf-help-details summary { cursor: pointer; font-weight: 600; min-height: 32px; display: list-item; }
.lf-help-details p { margin: 8px 0 0; }
.lf-help-footer { margin: 8px 0 0; font-size: 13px; color: var(--lf-muted); }
.lf-help-lab { display: grid; gap: 14px; max-width: 760px; font-size: 15px; }
.lf-help-lab p { margin: 0; }
.lf-help-badge { justify-self: start; padding: 4px 12px; border-radius: 999px; background: var(--lf-warn); color: var(--lf-warntext); font-weight: 600; font-size: 13px; }
.lf-help-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.lf-help-fields input { width: 100%; min-height: 44px; border: 1px solid var(--lf-line); border-radius: var(--lf-radius-control); padding: 0 12px; font-size: 16px; }
.lf-help-modes { display: flex; flex-wrap: wrap; gap: 8px; }
.lf-help-modes [aria-pressed="true"] { background: var(--lf-brand); color: var(--lf-on); border-color: var(--lf-brand); }
.lf-help-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 10px; }
.lf-help-stat { background: var(--lf-bg); border-radius: 16px; padding: 14px; display: grid; gap: 2px; }
.lf-help-stat strong { font-size: 26px; font-variant-numeric: tabular-nums; }
.lf-help-lab h3 { font-size: 15px; margin: 12px 0 6px; }

/* «Как это работает» рядом с заголовком экрана */
.lf-help-link { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 4px; color: var(--lf-brand); text-decoration: none; font-size: 14px; white-space: nowrap; }
.lf-help-link:hover span { text-decoration: underline; }
.lf-help-link .lf-icon { width: 18px; height: 18px; }

/* Боковая панель помощи (§6.5): справа 440px, на телефоне — во весь экран */
.lf-help-panel { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(440px, 90vw); max-width: 90vw; height: 100dvh; max-height: 100dvh; padding: 0; border: 0; border-left: 1px solid var(--lf-line); border-radius: 22px 0 0 22px; background: var(--lf-paper); color: var(--lf-text); box-shadow: -8px 0 30px rgba(20, 40, 28, .12); overflow: hidden; }
.lf-help-panel[open] { display: flex; flex-direction: column; }
.lf-help-panel::backdrop { background: rgba(20, 40, 28, .25); }
.lf-help-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--lf-line); }
.lf-help-panel-close { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--lf-line); background: var(--lf-paper); cursor: pointer; }
.lf-help-panel-body { overflow-y: auto; padding: 18px 20px 28px; display: grid; gap: 12px; align-content: start; font-size: 15px; line-height: 1.55; outline: none; }
.lf-help-panel-title { font-size: 22px; margin: 0; }
.lf-help-panel-more { margin: 8px 0 0; }

@media (max-width: 900px) {
  .lf-help-articlegrid { grid-template-columns: minmax(0, 1fr); }
  .lf-help-article { padding: 20px 16px; }
  .lf-help-title, .lf-help-article .lf-help-title { font-size: 26px; }
  .lf-help-dl { grid-template-columns: 1fr; }
  .lf-help-dl dd { margin-bottom: 8px; }
}
@media (max-width: 600px) {
  .lf-help-panel { width: 100vw; max-width: 100vw; border-radius: 0; border-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .lf-help-panel { transition: none; } }
@media print {
  .lf-help-link, .lf-help-panel, .lf-help-aside, .lf-help-back, .lf-help-searchform, [data-help-guide], [data-help-reset] { display: none !important; }
  .lf-help-articlegrid { display: block; }
  .lf-help-article { border: 0; padding: 0; }
  .lf-help-details details > p { display: block; }
}

/* Поступление: единый поисковый выбор позиции (доработка помощи 26.09) */
.wh-pick-row { display: flex; gap: 8px; align-items: center; }
.wh-pick-row .wh-pick { flex: 1; min-width: 0; }
.wh-picked { margin: 4px 0 0; font-size: 13px; color: var(--lf-text); overflow-wrap: anywhere; }
.wh-plan-hint { margin-bottom: 12px; }
@media (max-width: 720px) {
  /* Поступление на телефоне: выбор позиции во всю ширину, ниже количество, единица, «Удалить». */
  .wh-lines-table thead { display: none; }
  .wh-lines-table tr[data-wh-rline] { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--lf-line); }
  .wh-lines-table tr[data-wh-rline] td { padding: 0; border: 0; }
  .wh-lines-table tr[data-wh-rline] td:first-child { grid-column: 1 / -1; }
  .wh-lines-table .wh-qty-input { width: 100%; }
}

/* ---------- Файлы (docs/TZ_Files_Claude_2026-09-29.md) ---------- */
/* Раздел «Файлы» — рабочий экран с миниатюрами: текст 16 px, поля и кнопки 44 px.
   Всё ниже ограничено классами fl-* и не меняет другие разделы. */
.fl-page { font-size: 16px; }
.fl-page .lf-small, .fl-page .lf-help-link, .fl-page .lf-label, .fl-page th { font-size: 14px; }
.fl-page [data-folder-new] { min-height: 44px; }
.fl-page .lf-tab { min-height: 44px; padding: 0 18px; }
.fl-page .lf-btn-compact { font-size: 14px; }
.fl-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fl-count { display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--lf-line);
  background: var(--lf-paper); color: var(--lf-muted); font-size: 14px; font-weight: 500; line-height: 1; font-variant-numeric: tabular-nums; }
.fl-head .lf-small { margin-top: 4px; }
.fl-upload-btn { min-height: 44px; padding: 0 22px; }
.fl-usage { margin: 0 0 12px; font-size: 14px; color: var(--lf-muted); }
.fl-usage summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; }
.fl-usage-warn summary { color: var(--lf-warntext); font-weight: 600; }
.fl-settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; align-items: end; margin: 8px 0; }
.fl-setting { display: grid; gap: 4px; }
.fl-setting input { width: 100%; min-height: 40px; }
.fl-settings > button { min-height: 40px; }
.fl-filters { display: grid; gap: 8px; margin: 14px 0 10px; }
/* Строка 1: поиск тянется, тип, папка, «Фильтры», «Найти» — одной строкой. */
.fl-filter-row { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(140px, 180px) minmax(150px, 220px) auto auto; gap: 8px; align-items: start; }
.fl-filter-row > * { min-width: 0; }
.fl-search input, .fl-filter-row select { width: 100%; min-height: 44px; }
.fl-filter-row > .lf-primary { min-height: 44px; padding: 0 20px; }
.fl-more { position: relative; }
.fl-more > summary { list-style: none; min-height: 44px; padding: 0 16px; cursor: pointer; display: inline-flex; align-items: center; white-space: nowrap; }
.fl-more > summary::-webkit-details-marker { display: none; }
.fl-more-body { position: absolute; z-index: 20; top: calc(100% + 6px); right: 0; width: min(560px, 92vw); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px;
  background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: 16px; padding: 14px; box-shadow: 0 10px 30px rgba(20, 40, 28, .12); }
.fl-more-body input, .fl-more-body select { width: 100%; min-height: 40px; }
.fl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fl-chip { display: inline-flex; align-items: center; min-height: 34px; padding: 0 12px; border-radius: 999px; background: var(--lf-soft); color: var(--lf-text); text-decoration: none; font-size: 14px; }
.fl-chip:hover { text-decoration: line-through; }
.fl-chip-reset { background: transparent; border: 1px solid var(--lf-line); }
.fl-chip-reset:hover { text-decoration: underline; }
/* Строка 2: вид слева, сортировка и размер страницы справа. */
.fl-viewbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.fl-seg { display: inline-flex; gap: 4px; }
.fl-seg .lf-btn { min-height: 44px; padding: 0 16px; }
.fl-pager .lf-btn { min-height: 40px; }
.fl-viewbar select { min-height: 44px; }
.fl-on { background: var(--lf-brand) !important; color: var(--lf-on) !important; border-color: var(--lf-brand) !important; }
.fl-bulk { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 15; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; margin: 0 0 10px;
  background: var(--lf-paper); border: 1px solid var(--lf-brand); border-radius: 16px; box-shadow: 0 6px 18px rgba(20, 40, 28, .10); }
.fl-bulk button, .fl-bulk select { min-height: 40px; }
.fl-bulk-all { flex-basis: 100%; margin: 0; }
.fl-danger { color: var(--lf-error) !important; }
.fl-status { min-height: 0; }
.fl-toast { display: inline-block; margin: 0 0 10px; padding: 8px 14px; border-radius: 12px; background: var(--lf-soft); }
.fl-toast.err { background: var(--lf-error-bg); color: var(--lf-error); }
.fl-manual { background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.fl-manual textarea { width: 100%; font-family: ui-monospace, monospace; font-size: 13px; }
.fl-empty { text-align: center; padding: 40px 16px; display: grid; gap: 12px; justify-items: center; }
.fl-empty:has(.fl-empty-drop) { padding: 10px; }
.fl-empty-drop { width: 100%; min-height: 340px; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 32px 20px;
  border: 2px dashed var(--lf-line); border-radius: 16px; transition: background-color 140ms ease, border-color 140ms ease; }
.fl-empty-drop.fl-drop-on { border-color: var(--lf-brand); background: var(--lf-soft); }
.fl-empty-svg { width: 44px; height: 44px; color: var(--lf-brand); }
.fl-empty-title { margin: 0; font-size: 20px; font-weight: 600; }
.fl-empty-text { margin: 0; max-width: 42ch; color: var(--lf-muted); }
.fl-empty-drop .lf-primary { min-height: 44px; padding: 0 22px; margin-top: 4px; }
.fl-empty-hint { margin: 0; font-size: 14px; color: var(--lf-muted); }
.fl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.fl-selpage { grid-column: 1 / -1; min-height: 36px; }
.fl-card { position: relative; background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: 18px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
.fl-card.fl-selected { border-color: var(--lf-brand); box-shadow: 0 0 0 2px var(--lf-soft); }
.fl-pick { position: absolute; top: 6px; left: 6px; z-index: 2; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }
.fl-pick input { width: 22px; height: 22px; accent-color: var(--lf-brand); }
.fl-thumb { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; background: var(--lf-bg); cursor: zoom-in; overflow: hidden; border-radius: 0; }
.fl-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.fl-thumb:focus-visible { outline: 3px solid var(--lf-brand); outline-offset: -3px; }
.fl-noimg { display: flex; width: 100%; height: 100%; align-items: center; justify-content: center; color: var(--lf-muted); font-weight: 600; }
.fl-cardbody { padding: 10px 12px 12px; display: grid; gap: 4px; align-content: start; }
.fl-name { margin: 0; font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.fl-meta { margin: 0; font-size: 14px; color: var(--lf-muted); }
.fl-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; margin-top: 6px; }
.fl-actions .lf-btn-compact, .fl-row-actions .lf-btn-compact { min-height: 40px; }
.fl-actions .lf-btn-compact { white-space: nowrap; padding: 4px 10px; }
.fl-listbox { padding: 4px 12px; }
.fl-list td { vertical-align: middle; }
.fl-list input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--lf-brand); }
.fl-thumb-sm { width: 56px; height: 42px; aspect-ratio: auto; border-radius: 8px; }
.fl-name-cell { overflow-wrap: anywhere; max-width: 320px; }
.fl-row-actions { white-space: nowrap; }
.fl-pager { margin: 14px 0; gap: 10px; flex-wrap: wrap; }
.fl-gap { padding: 0 4px; color: var(--lf-muted); }
.fl-folders { margin-top: 14px; }
.fl-folders summary { cursor: pointer; min-height: 32px; }
.fl-folder-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.fl-folder-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.fl-dialog { border: 0; border-radius: 22px; padding: 0; width: min(960px, 94vw); max-height: 92dvh; background: var(--lf-paper); color: var(--lf-text); box-shadow: 0 20px 60px rgba(20, 40, 28, .25); }
.fl-dialog::backdrop { background: rgba(20, 40, 28, .35); }
.fl-dialog[open] { display: flex; flex-direction: column; }
.fl-dialog > *:not(.fl-dialog-head) { padding-left: 20px; padding-right: 20px; }
.fl-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 12px 12px 20px; border-bottom: 1px solid var(--lf-line); }
.fl-dialog-head h3 { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.fl-close { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--lf-line); background: var(--lf-paper); font-size: 22px; cursor: pointer; flex: none; }
.fl-pv-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; padding-top: 14px; overflow: auto; }
.fl-pv-media img, .fl-pv-media video { max-width: 100%; max-height: 64dvh; display: block; margin: 0 auto; background: var(--lf-bg); border-radius: 12px; }
.fl-pv-meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0; font-size: 14px; align-content: start; }
.fl-pv-meta dt { color: var(--lf-muted); }
.fl-pv-meta dd { margin: 0; overflow-wrap: anywhere; user-select: all; }
.fl-pv-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 14px; padding-bottom: 18px; }
.fl-pv-actions > * { min-height: 44px; }
.fl-upload { width: min(760px, 94vw); }
.fl-upload > p, .fl-up-folder { margin: 12px 0 0; }
.fl-drop { position: relative; display: grid; place-items: center; gap: 4px; align-content: center; min-height: 150px; margin: 12px 20px; border: 2px dashed var(--lf-line); border-radius: 18px; background: var(--lf-bg); cursor: pointer; text-align: center; padding: 16px; }
.fl-drop.fl-drop-on { border-color: var(--lf-brand); background: var(--lf-soft); }
.fl-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fl-drop:focus-within { outline: 3px solid var(--lf-brand); outline-offset: 2px; }
.fl-up-summary { font-weight: 600; margin: 4px 0; min-height: 1.4em; }
.fl-queue-wrap { max-height: 40dvh; overflow: auto; }
.fl-queue td { vertical-align: top; }
.fl-q-name { overflow-wrap: anywhere; max-width: 280px; }
.fl-st { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 14px; font-weight: 600; background: var(--lf-bg); }
.fl-st-done { background: var(--lf-soft); color: var(--lf-brand); }
.fl-st-exists, .fl-st-in_trash { background: var(--lf-warn); color: var(--lf-warntext); }
.fl-st-error { background: var(--lf-error-bg); color: var(--lf-error); }
.fl-st-msg { display: block; font-size: 14px; margin-top: 2px; }
.fl-st-link { display: block; font-size: 13px; overflow-wrap: anywhere; }
.fl-up-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 10px; padding-bottom: 18px; }
.fl-up-actions > * { min-height: 44px; }
.fl-mini { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: flex; gap: 10px; align-items: center; padding: 10px 14px; background: var(--lf-paper); border: 1px solid var(--lf-brand); border-radius: 16px; box-shadow: 0 8px 24px rgba(20, 40, 28, .18); max-width: calc(100vw - 32px); }
.fl-dropveil { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(36, 121, 78, .18); border: 4px dashed var(--lf-brand); font-size: 22px; font-weight: 600; color: var(--lf-brand); pointer-events: none; }
/* Узкое окно или планшет: поиск — отдельной строкой, остальное — второй. */
@media (max-width: 1100px) {
  .fl-filter-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; }
  .fl-search { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .fl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fl-cardbody { padding: 8px; }
  .fl-actions { grid-template-columns: 1fr; }
  .fl-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .fl-more-body { grid-template-columns: 1fr; position: static; width: 100%; box-shadow: none; margin-top: 6px; }
  /* Телефон: поиск — строка, тип | папка, «Фильтры» | «Найти»; открытые фильтры — на всю ширину. */
  .fl-filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fl-search, .fl-more[open] { grid-column: 1 / -1; }
  .fl-more > summary, .fl-filter-row > .lf-primary { width: 100%; justify-content: center; min-height: 44px; }
  .fl-viewbar > .lf-row-tight { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .fl-viewbar select { width: 100%; }
  .fl-drop { min-height: 96px; }
  .fl-pv-body { grid-template-columns: 1fr; }
  .fl-list thead { display: none; }
  /* Телефон: галочка | миниатюра | название и короткие сведения; формат виден по расширению,
     автор — в «Ещё». Ячейка галочки тоже с data-label — её колонку задаём последней. */
  .fl-list tr { display: grid; grid-template-columns: 28px 56px minmax(0, 1fr); gap: 2px 10px; padding: 10px 0; border-bottom: 1px solid var(--lf-line); }
  .fl-list td { padding: 0; border: 0; }
  .fl-list td[data-label] { grid-column: 3; font-size: 13px; color: var(--lf-muted); text-align: left; }
  .fl-list td[data-label]:not([data-label=""])::before { content: attr(data-label) ": "; }
  .fl-list td[data-label="Формат"], .fl-list td[data-label="Кто"] { display: none; }
  .fl-list td:first-child { grid-column: 1; grid-row: 1 / span 2; }
  .fl-list .fl-name-cell, .fl-list .fl-row-actions { grid-column: 3; max-width: none; white-space: normal; }
  .fl-list .fl-row-actions { margin-top: 4px; }
  .fl-list td:nth-child(2) { grid-column: 2; grid-row: 1 / span 4; }
  .fl-pager { justify-content: center; }
  .fl-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
}
@media (prefers-reduced-motion: reduce) { .fl-dialog, .fl-mini { transition: none; } }

/* ---------- Подсказки «Что требует внимания» ---------- */
.ad-home { margin-bottom: 4px; }
.ad-home-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.ad-home-head h3 { margin: 0 0 6px; }
.ad-calm { background: var(--lf-soft); color: var(--lf-brand); border-radius: var(--lf-radius-notice); padding: 10px 14px; margin: 8px 0; }
.ad-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; margin: 10px 0; }
.ad-card { background: var(--lf-paper); border: 1px solid var(--lf-line); border-left: 5px solid var(--lf-brand); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ad-card.ad-warn { border-left-color: #d49a2e; }
.ad-card.ad-risk { border-left-color: #c2412d; }
.ad-card-head { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; }
.ad-badge { font-weight: 600; color: var(--lf-brand); }
.ad-warn .ad-badge { color: var(--lf-warntext); }
.ad-risk .ad-badge { color: #a1301e; }
.ad-meta { color: var(--lf-muted); }
.ad-title { font-size: 16px; margin: 0; overflow-wrap: anywhere; }
.ad-qty { font-size: 20px; font-weight: 700; margin: 0; }
.ad-due { font-size: 14px; font-weight: 400; color: var(--lf-muted); }
.ad-summary { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.ad-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.ad-actions .lf-btn-compact, .ad-actions .lf-btn { min-height: 40px; }
.ad-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
/* Подсказки списком (07.10): действие → количество → срок → причина → кнопка; без стены узких карточек. */
.ad-list { list-style: none; margin: 10px 0; padding: 0; background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: var(--lf-radius-card); }
.ad-info .ad-list, .ad-home .ad-list { border-radius: 14px; }
.ad-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 120px auto; gap: 6px 16px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--lf-line); box-shadow: inset 4px 0 0 var(--lf-brand); }
.ad-row:last-child { border-bottom: 0; }
.ad-row.ad-warn { box-shadow: inset 4px 0 0 #d49a2e; }
.ad-row.ad-risk { box-shadow: inset 4px 0 0 #c2412d; }
.ad-row .ad-title { font-size: 15px; font-weight: 600; }
.ad-row .ad-summary { font-size: 13px; color: var(--lf-muted); margin-top: 2px; }
.ad-mark { color: var(--lf-brand); margin-right: 4px; }
.ad-warn .ad-mark { color: var(--lf-warntext); }
.ad-risk .ad-mark, .ad-risk .ad-title { color: #a1301e; }
.ad-row-qty { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.ad-row-qty strong { font-size: 17px; }
.ad-row-due { font-size: 13px; color: var(--lf-muted); }
.ad-quality { display: block; font-size: 12px; color: var(--lf-warntext); }
.ad-row .ad-actions { margin: 0; padding: 0; justify-content: flex-end; flex-wrap: nowrap; }
.ad-caption { font-size: 13px; color: var(--lf-muted); margin: 4px 0; }
.ad-fresh { font-size: 13px; color: var(--lf-muted); }
.ad-fresh summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; gap: 6px; list-style: none; }
.ad-fresh summary::-webkit-details-marker { display: none; }
.ad-fresh summary::before { content: "▸"; color: var(--lf-brand); }
.ad-fresh[open] summary::before { content: "▾"; }
.ad-fresh-warn { color: var(--lf-warntext); }
.ad-fresh-list { list-style: none; margin: 4px 0 8px; padding: 8px 12px; background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: 12px; display: grid; gap: 4px; }
.ad-fresh-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; }
.ad-info summary, .ad-limits summary { cursor: pointer; font-weight: 600; }
@media (max-width: 760px) {
  .ad-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px 14px; }
  .ad-row-main { grid-column: 1 / -1; }
  .ad-row-qty { text-align: left; }
  .ad-row-due { text-align: right; }
  .ad-row .ad-actions { grid-column: 1 / -1; justify-content: flex-start; flex-wrap: wrap; }
}
.ad-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ad-filters .lf-search { flex: 1 1 220px; }
.ad-more summary { cursor: pointer; }
.ad-dialog { border: 0; border-radius: 18px; padding: 0; width: min(560px, 94vw); max-height: 90dvh; background: var(--lf-paper); color: var(--lf-text); }
.ad-dialog::backdrop { background: rgba(20, 40, 28, .35); }
.ad-dialog[open] { display: flex; flex-direction: column; }
.ad-dialog-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--lf-line); }
.ad-dialog-head h3 { margin: 0; font-size: 17px; overflow-wrap: anywhere; }
.ad-dialog-body { padding: 12px 18px 18px; overflow: auto; }
.ad-dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 4px 12px; margin: 10px 0; }
.ad-dl dt { color: var(--lf-muted); overflow-wrap: anywhere; }
.ad-dl dd { margin: 0; overflow-wrap: anywhere; }
.ad-arith { background: var(--lf-bg); border-radius: 10px; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.ad-notes { padding-left: 18px; margin: 4px 0 10px; }
.ad-links { display: flex; flex-wrap: wrap; gap: 8px; }
.ad-limits summary { cursor: pointer; }
@media (max-width: 640px) {
  .ad-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .ad-dl { grid-template-columns: 1fr; }
  .ad-dl dd { margin-bottom: 6px; }
}
/* Подсказки, этап 2: настройки и расчёт по позиции */
.ad-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 4px 14px; margin: 8px 0; }
.ad-field { min-width: 0; }
.ad-field select, .ad-field input { width: 100%; }
.ad-days { display: flex; flex-wrap: wrap; gap: 6px; }
.ad-day { display: inline-flex; flex-direction: column; align-items: center; min-width: 46px; padding: 6px 4px; border-radius: 10px; background: var(--lf-soft); font-variant-numeric: tabular-nums; }
.ad-day b { font-size: 16px; }
.ad-day small { color: var(--lf-muted); font-size: 12px; }
.ad-day-zero { background: var(--lf-bg); }
.ad-field-wide { grid-column: 1 / -1; max-width: 480px; }
/* Подсказки, этап 3: «После основного задания» на экране задания цеха */
.am-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 10px; }
.am-line { border: 1px solid var(--lf-line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.am-removed { opacity: .65; }
.am-main { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; overflow-wrap: anywhere; }
.am-qty { font-size: 18px; font-weight: 700; }
.am-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.am-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.am-qty-input { width: 90px; }
.am-why summary { cursor: pointer; font-size: 14px; }
@media print { .am-box { display: none; } }
/* Сверка отгрузок с площадками */
.sc-item { border-left: 5px solid var(--lf-line); }
.sc-mandatory { border-left-color: #c2412d; }
.sc-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; }
.sc-form { min-width: 0; flex: 1 1 280px; }
.sc-form summary { list-style: none; display: inline-flex; }
.sc-form[open] { border: 1px solid var(--lf-line); border-radius: 12px; padding: 10px; }
.sc-inline { display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center; }
/* Отменено площадкой — строка остаётся в сборочном листе, красным */
.lf-print-cancelled td { background: #fde2e1; color: #b42318; }
.lf-print-cancelled td:nth-child(4) { text-decoration: line-through; }
.lf-text-error { color: #b42318; }
@media print { .lf-print-cancelled td { -webkit-print-color-adjust: exact; print-color-adjust: exact; } }
/* Выполнение столярки */
.cp-hint { background: var(--lf-soft); border-radius: 10px; padding: 8px 12px; margin: 0 0 8px; }
.cp-table td { vertical-align: top; }
.cp-title { display: block; overflow-wrap: anywhere; }
.cp-stock { color: var(--lf-brand); }
.cp-qty { width: 96px; text-align: right; }
.cp-proposed { color: var(--lf-muted); font-style: italic; }
.cp-removed td { opacity: .6; }
.cp-error td { background: #fdecea; }
.cp-actions { flex-wrap: wrap; gap: 8px; margin-top: 8px; }
@media (max-width: 640px) { .cp-table th:nth-child(2), .cp-table td:nth-child(2) { display: none; } .cp-qty { width: 72px; } }

/* ---------- «Улитка» (пакет оформления 07.10.2026, docs/ulitka/README_CLAUDE.md) ---------- */
/* Фудзи — отдельный декоративный слой рабочей области, ниже содержимого; карточки и таблицы непрозрачные. */
.lf-content::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  top: -120px; right: -40px; width: 1100px; aspect-ratio: 16 / 9;
  background: var(--ul-fuji) no-repeat right top / contain; opacity: .14;
}
@media (min-width: 1600px) { .lf-content::before { width: min(1400px, 72vw); } }
@media (max-width: 1100px) { .lf-content::before { width: 900px; } }
@media (max-width: 700px) { .lf-content::before { width: 660px; right: -180px; top: -25px; opacity: .09; } }

.ul-brand {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 2px 8px;
  border: 0; background: transparent; text-align: left; justify-content: flex-start; color: var(--lf-text);
}
.ul-brand:hover { background: transparent; }
.ul-brand img { width: 44px; height: 44px; flex: none; }
.ul-brand strong, .ul-guest-brand strong { display: block; font-size: 24px; line-height: 1.1; letter-spacing: -.02em; font-weight: 650; }
.ul-brand small, .ul-guest-brand small { display: block; font-size: 12px; color: var(--lf-muted); margin-top: 2px; }
.ul-guest-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ul-guest .lf-small { display: block; margin-bottom: 8px; }
.ul-guest h1:not(.lf-visually-hidden) { font-size: 22px; margin: 6px 0; }

/* Наш путь */
.ul-path { background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: var(--lf-radius-card); padding: 24px; margin-bottom: 18px; }
.ul-path-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ul-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--lf-muted); margin: 0 0 4px; }
.ul-slogan { font-size: 22px; line-height: 1.2; letter-spacing: -.01em; font-weight: 650; margin: 0 0 4px; }
.ul-badge { flex: none; border-radius: var(--lf-radius-badge); padding: 4px 10px; font-size: 12px; font-weight: 600; background: var(--lf-soft); color: var(--lf-brand); }
.ul-steps { list-style: none; margin: 22px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 12px; }
.ul-step { position: relative; min-width: 0; }
.ul-step-link {
  display: block; height: 100%; padding: 12px 14px 14px; border: 1px solid var(--lf-line); border-radius: 14px;
  background: #fafbf9; color: var(--lf-text); text-decoration: none; min-height: 84px;
}
a.ul-step-link:hover { border-color: var(--lf-brand); }
.ul-step-link strong { display: block; font-size: 15px; margin: 4px 0 2px; }
.ul-step-mark { font-size: 12px; font-weight: 700; color: var(--lf-brand); }
.ul-step-note { display: block; font-size: 12px; color: var(--lf-muted); padding-right: 40px; }
.ul-step-done .ul-step-link { background: #f0f5f0; border-color: #d1dfd2; }
.ul-step-current .ul-step-link { background: #fff; border-color: var(--lf-brand); }
.ul-step-attention .ul-step-link { background: var(--lf-warn); border-color: #d9b46a; }
.ul-step-attention .ul-step-mark, .ul-step-attention .ul-step-note { color: var(--lf-warntext); }
.ul-path-snail { position: absolute; right: 10px; top: -18px; width: 38px; height: 38px; background: #fff; border-radius: 12px; pointer-events: none; }
.ul-flag { position: absolute; right: 12px; top: -16px; width: 24px; height: 24px; color: var(--lf-brand); pointer-events: none; }
.ul-flag + .ul-path-snail { right: 36px; }
.ul-breathe { animation: ul-breathe 2.4s ease-in-out infinite; }
@keyframes ul-breathe { 50% { transform: translateX(4px); } }
.ul-next { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 16px; border-top: 1px solid var(--lf-line); }
.ul-next strong { font-size: 16px; }
.ul-next p { margin-top: 3px; max-width: 70ch; }
.ul-next form, .ul-next > .lf-btn { flex: none; }
.ul-tasks { list-style: none; margin: 14px 0 0; padding: 12px 0 0; border-top: 1px solid var(--lf-line); display: grid; gap: 8px; }
.ul-tasks li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }

/* Компактный «путь дня» (журнал 28.10, U05): полоса этапов в одну строку, пояснения — по нажатию. */
.ul-compact { padding: 12px 16px; margin-bottom: 12px; }
.ul-compact .ul-slogan { font-size: 15px; margin: 0; }
.ul-compact .ul-eyebrow { display: inline; margin-right: 6px; }
.ul-compact .ul-steps { margin: 10px 0 10px; gap: 8px; }
.ul-compact .ul-step-link { min-height: 0; padding: 6px 10px; border-radius: 10px; }
.ul-compact .ul-step-link strong { display: inline; font-size: 13px; margin: 0 0 0 4px; }
.ul-compact .ul-step-note { display: none; }
.ul-compact .ul-path-snail { top: -14px; width: 28px; height: 28px; }
.ul-compact .ul-flag { top: -12px; width: 18px; height: 18px; }
.ul-compact .ul-next { padding-top: 10px; }
/* Хокку справа от этапов (владелец 29.10): этапы и «что дальше» — слева, стихотворение — колонкой справа. */
.ul-with-hk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 300px); gap: 14px; align-items: start; }
.ul-with-hk .ul-steps { margin-top: 10px; gap: 6px; }
.ul-with-hk .ul-step-link { padding: 4px 8px; }
.ul-with-hk .ul-step-link strong { font-size: 12.5px; }
.ul-with-hk .hk { margin: 4px 0 0; max-width: none; padding: 8px 12px; }
.ul-with-hk .hk-poem { font-size: 14px; margin-top: 4px; }
.ul-compact .ul-next strong { font-size: 14px; }
.ul-more { margin-top: 8px; }
.ul-more > summary { cursor: pointer; }
.ul-notes { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--lf-muted); }

/* Об Улитке */
.ul-about { border: 1px solid var(--lf-line); border-radius: 24px; padding: 24px; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; color: var(--lf-text); background: var(--lf-paper); }
.ul-about::backdrop { background: rgba(36, 51, 44, .35); }
.ul-about-head { display: flex; justify-content: flex-end; }
.ul-about-mountain { display: block; width: 100%; height: 150px; object-fit: contain; opacity: .6; margin: 6px 0 10px; }
.ul-about h2 { font-size: 24px; margin-bottom: 10px; }
.ul-about p { margin-bottom: 10px; }
.ul-about-walk { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; }
.ul-about-snail { border: 0; background: transparent; padding: 0; min-width: 44px; min-height: 44px; width: 170px; justify-content: flex-start; }
.ul-about-snail:hover { background: transparent; }
.ul-about-snail img { transition: transform .9s ease-in-out; }
.ul-about-snail.ul-walked img { transform: translateX(106px); }
.ul-motion { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--lf-line); font-size: 13px; color: var(--lf-muted); min-height: 44px; }
.ul-motion input { width: 18px; height: 18px; accent-color: var(--lf-brand); }

/* Анимации — только по желанию: системная настройка и локальная «Анимации интерфейса». */
@media (prefers-reduced-motion: reduce) { .ul-breathe { animation: none; } .ul-about-snail img { transition: none; } }
.ul-no-motion .ul-breathe { animation: none; }
.ul-no-motion .ul-about-snail img { transition: none; }

@media (max-width: 720px) {
  .ul-brand { padding: 0 2px; min-height: 44px; width: auto; }
  .ul-brand img { width: 38px; height: 38px; }
  .ul-brand strong { font-size: 22px; }
  .ul-brand small { display: block; }
  .ul-path { padding: 18px; }
  .ul-path-head { flex-direction: column; gap: 8px; }
  .ul-slogan { font-size: 20px; }
  .ul-steps { grid-template-columns: 1fr; gap: 8px; margin-top: 16px; }
  .ul-step-link { min-height: 0; padding: 9px 13px; display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 6px; align-items: baseline; }
  .ul-step-link strong { margin: 0; }
  .ul-step-note { grid-column: 2; }
  .ul-path-snail { top: 8px; width: 34px; height: 34px; }
  .ul-flag { top: 10px; right: 10px; }
  .ul-flag + .ul-path-snail { right: 34px; }
  .ul-next { display: block; }
  .ul-with-hk { grid-template-columns: minmax(0, 1fr); }
  .ul-next form, .ul-next > .lf-btn { margin-top: 12px; }
  .ul-next .lf-btn, .ul-next button { width: 100%; }
}
@media print { .lf-content::before, .ul-path, .ul-about { display: none !important; } }

/* ---------- Цеха: работы и расценки (ТЗ цехов, этап 1) ---------- */
.wk-period { display: grid; gap: 10px; }
.wk-range { align-items: center; }
.wk-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin-bottom: 16px; }
.wk-card { display: grid; gap: 4px; margin: 0; }
.wk-card strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.wk-table td { vertical-align: top; padding-top: 9px; padding-bottom: 9px; }
.wk-detail summary { cursor: pointer; }
.wk-facts { margin: 6px 0 4px; padding-left: 18px; font-size: 13px; }
.wk-base { color: var(--lf-warntext); }
.wk-unconf { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.wk-unconf li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: center; border-bottom: 1px solid var(--lf-line); padding-bottom: 6px; }
.wk-rate-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 8px; }

/* ---------- Табели (ТЗ цехов, этап 2) ---------- */
.ts-nav { margin-bottom: 14px; align-items: center; }
.ts-spacer { flex: 1; }
.ts-rows { list-style: none; margin: 0 0 12px; padding: 0; background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: var(--lf-radius-card); }
.ts-row { display: grid; grid-template-columns: minmax(150px, 1.4fr) 130px 92px 92px 120px minmax(150px, 1fr); gap: 6px 12px; align-items: end;
  padding: 12px 16px; border-bottom: 1px solid var(--lf-line); }
.ts-row:last-child { border-bottom: 0; }
.ts-row.ts-confirmed { background: #fafcf9; }
.ts-row.ts-has-error { box-shadow: inset 4px 0 0 var(--lf-error); }
.ts-who { display: grid; gap: 2px; align-self: center; }
.ts-time { display: grid; gap: 2px; font-size: 12px; color: var(--lf-muted); }
.ts-time input { width: 100%; font-variant-numeric: tabular-nums; }
.ts-nolunch { align-self: center; min-height: 44px; }
.ts-sum { display: grid; gap: 2px; align-self: center; font-variant-numeric: tabular-nums; }
.ts-money { font-weight: 600; }
.ts-more { grid-column: 1 / -1; }
.ts-more summary { cursor: pointer; font-size: 13px; color: var(--lf-brand); min-height: 32px; }
.ts-more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; margin-top: 6px; }
.ts-more-grid label { display: grid; gap: 2px; }
.ts-wide { grid-column: 1 / -1; }
.ts-actions { position: sticky; bottom: 0; background: var(--lf-bg); padding-bottom: 8px; z-index: 2; }
.ts-week-scroll { overflow-x: auto; }
.ts-week { min-width: 960px; }
.ts-week th, .ts-week td { padding: 8px 6px; vertical-align: top; }
.ts-sticky { position: sticky; left: 0; background: var(--lf-paper); z-index: 1; min-width: 150px; }
.ts-cell span { display: block; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ts-draft { color: var(--lf-muted); background: #f7f8f5; }
.ts-cancelled { opacity: .55; }
.ts-bonus { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--lf-line); }
.ts-bonus-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 12px; align-items: end; margin-top: 10px; }
.ts-bonus-form label { display: grid; gap: 2px; }
.ts-print { position: relative; }
.ts-print > summary { list-style: none; }
.ts-print > summary::-webkit-details-marker { display: none; }
.ts-print-menu { position: absolute; right: 0; z-index: 5; display: grid; gap: 8px; min-width: 260px; padding: 12px 14px; background: var(--lf-paper);
  border: 1px solid var(--lf-line); border-radius: 12px; box-shadow: 0 8px 24px rgba(20, 40, 28, .12); }
.ts-terms label, .ts-sched .lf-row { gap: 8px; }
.ts-days { display: flex; flex-wrap: wrap; gap: 4px 14px; border: 0; padding: 0; margin: 10px 0; }
.ts-sched { border: 0; padding: 0; margin: 10px 0; display: grid; gap: 4px; }
.ts-dayname { width: 28px; }
.ts-import-opts fieldset { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 4px; }
.ts-map { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: center; padding: 4px 0; border-bottom: 1px solid var(--lf-line); }
@media (max-width: 900px) {
  .ts-row { grid-template-columns: 1fr 1fr; }
  .ts-who, .ts-kind, .ts-sum { grid-column: 1 / -1; }
}
@media print { .ts-actions, .ts-print, .ts-nav { display: none !important; } }
.ts-op { margin: 8px 0; }
.ts-op > summary { list-style: none; display: inline-flex; }
.ts-op > summary::-webkit-details-marker { display: none; }
.ts-pay td { vertical-align: middle; }
.wk-how { width: min(420px, 90vw); }
.wk-how p { margin: 0 0 8px; font-size: 13px; }
.wk-hints { padding: 8px; }
.wk-hints .ad-list { border: 0; margin: 0; }
.wk-hints .ad-row { grid-template-columns: minmax(0, 1fr) 0 0 auto; }

/* Общий табель недели (пакет 08.10): липкие имена и шапка, горизонтальная прокрутка только у таблицы. */
.ts-common-box { padding: 0; overflow: hidden; }
.ts-common-scroll { overflow: auto; max-height: calc(100vh - 220px); }
.ts-common { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.ts-common th, .ts-common td { border-bottom: 1px solid var(--lf-line); padding: 6px 8px; vertical-align: top; text-align: left; }
.ts-common thead th { position: sticky; top: 0; background: var(--lf-paper); z-index: 2; font-weight: 600; }
.ts-common thead th.ts-sticky { z-index: 3; }
.ts-common .ts-day-h span { font-weight: 400; color: var(--lf-muted); }
.ts-common .ts-today { background: var(--lf-soft); }
.ts-common .ts-name { min-width: 190px; max-width: 240px; font-weight: 400; }
.ts-common .ts-fio { display: block; font-weight: 600; }
.ts-common .ts-group th, .ts-common .ts-group td { background: var(--lf-soft); color: var(--lf-brand); font-weight: 600; }
.ts-common .ts-group-total th, .ts-common .ts-group-total td { background: #f2f5f0; font-weight: 600; }
.ts-common .ts-grand th, .ts-common .ts-grand td { background: var(--lf-soft); font-weight: 700; border-top: 2px solid var(--lf-brand); }
.ts-common .ts-cell { min-width: 96px; }
.ts-common .ts-cell-error { background: var(--lf-error-bg); }
.ts-common .ts-hours { color: var(--lf-muted); }
.ts-common .ts-empty { color: var(--lf-muted); }
.ts-common .ts-in input { width: 64px; padding: 3px 5px; min-height: 30px; font-variant-numeric: tabular-nums; }
.ts-common .ts-in, .ts-common .ts-nl { display: block; margin-bottom: 3px; font-size: 12px; }
.ts-common .ts-k { font-size: 12px; min-height: 28px; padding: 2px 4px; max-width: 110px; }
.ts-common .ts-ask { display: block; color: var(--lf-warntext); font-size: 12px; }
.ts-fin { margin-top: 4px; }
.ts-fin-body { white-space: normal; min-width: 340px; padding: 6px 0; }
.ts-extra { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.ts-extra input, .ts-extra select { min-height: 30px; padding: 2px 6px; font-size: 12px; max-width: 150px; }
.ts-consequences { border: 2px solid var(--lf-warntext); }
.ts-savebar { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 10px 14px; margin-top: 10px; background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: var(--lf-radius-control);
  box-shadow: 0 -4px 14px rgba(0, 0, 0, .08); }
@media (max-width: 700px) { .ts-common .ts-name { min-width: 130px; } .ts-common-scroll { max-height: none; } }

/* ---------- Досье сотрудника (пакет 08.10.2026, раздел 9) ---------- */
.ds-head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.ds-who { flex: 1 1 220px; min-width: 0; }
.ds-who p { margin: 2px 0 0; }
.ds-portrait { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none; border: 1px solid var(--lf-line); }
.ds-initials { display: inline-flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 700;
  background: var(--lf-paper); color: var(--lf-muted, #666); }
.ds-active { color: var(--lf-oktext, #1f6b3a); }
.ds-tabs { margin-top: 4px; }
.ds-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.ds-grid > .ds-photo-del { grid-column: 2; }
.ds-fieldset { border: 0; padding: 0; margin: 8px 0 0; }
.ds-private { border-left: 3px solid var(--lf-warntext); padding-left: 10px; }
.ds-crop-stage { position: relative; display: inline-block; max-width: 100%; margin-top: 8px; touch-action: none; }
.ds-crop-stage img { display: block; max-width: 100%; max-height: 360px; }
.ds-crop-box { position: absolute; box-sizing: border-box; border: 2px solid #fff; outline: 1px solid #000;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); cursor: move; }
.ds-crop-stage { overflow: hidden; }
.ds-docs { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ds-doc { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--lf-line); border-radius: var(--lf-radius-control); padding: 8px; }
.ds-doc img, .ds-pdf { width: 96px; height: 96px; object-fit: cover; flex: none; border-radius: 4px; }
.ds-pdf { display: inline-flex; align-items: center; justify-content: center; background: var(--lf-paper); font-weight: 700; border: 1px solid var(--lf-line); }
@media (max-width: 760px) { .ds-grid { grid-template-columns: 1fr; } .ds-grid > .ds-photo-del { grid-column: 1; } .ds-portrait { width: 72px; height: 72px; } }
.ds-mini { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 6px; }

/* ---------- Расценки обоих цехов (пакет 08.10.2026, 7.2) ---------- */
.rt-scroll { overflow-x: auto; }
.rt-table td { vertical-align: top; }
.rt-price { width: 7.5em; text-align: right; }
.rt-changed { outline: 2px solid var(--lf-warntext); background: #fff8e6; }
.rt-bar { align-items: flex-end; }

/* ---------- Контроль отгрузки: массовая отметка (патч 08.10.2026) ---------- */
.dispatch-row { position: relative; }
.dispatch-pick-wrap { display: inline-flex; align-items: flex-start; padding: 4px 8px 0 0; cursor: pointer; }
.dispatch-pick, #dispatch-pick-all { width: 20px; height: 20px; }
.dispatch-bulk-bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--lf-paper);
  padding: 8px 10px; border: 1px solid var(--lf-line); border-radius: var(--lf-radius-control); gap: 12px; align-items: center; }
#dispatch-bulk-modal { border: 2px solid var(--lf-warntext); }

/* ---------- Склад: отрицательные остатки и поздний ввод (ТЗ 09.10.2026) ---------- */
.wh-negative { color: var(--lf-error, #b3261e); font-weight: 700; }
.wh-negative-row td { background: rgba(179, 38, 30, .06); }
.wh-negatives { border-left: 4px solid var(--lf-warntext); }
.wh-late { border: 2px solid var(--lf-warntext); }

/* ---------- Выплатить зарплату из табеля (09.10.2026) ---------- */
.po-table th[scope="row"] { font-weight: 600; }
.po-now { width: 8em; text-align: right; }
.po-more-body { display: grid; gap: 6px; padding: 8px 0; min-width: 260px; }
.po-warn { color: var(--lf-warntext); }
.po-bar { align-items: flex-end; gap: 12px; flex-wrap: wrap; }

/* ---------- «Сотрудники → Расчёты / Архив» (ТЗ 09.10.2026) ---------- */
.st-filters { flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; align-items: center; }
.st-radio { cursor: pointer; }
.st-radio input { position: absolute; opacity: 0; pointer-events: none; }
.st-summary { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }
.st-summary .wk-card strong { font-size: 20px; }
.st-box { padding: 0; }
.st-scroll { overflow-x: auto; max-width: 100%; }
.st-table { min-width: 860px; }
.st-table .st-name { position: sticky; left: 0; background: var(--lf-paper); z-index: 1; min-width: 180px; }
.st-table td .lf-code, .st-table th .lf-code { display: block; }
.st-nodata { color: var(--lf-muted, #6b7670); font-style: italic; }
.st-actions { white-space: nowrap; }
.st-actions > * { display: inline-block; vertical-align: top; margin: 2px 4px 2px 0; }
.st-act[open] { display: block; white-space: normal; }
.st-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; margin: 8px 0; padding: 10px; min-width: min(560px, 80vw);
  border: 1px solid var(--lf-line, #d8ddd9); border-radius: 8px; background: var(--lf-paper); }
.st-form label { display: grid; gap: 2px; }
.st-form .st-wide, .st-form fieldset { grid-column: 1 / -1; }
.st-kinds { display: flex; flex-wrap: wrap; gap: 6px 14px; border: 0; padding: 0; margin: 0; }
.st-kinds label { display: inline-flex; gap: 4px; align-items: center; }
.st-form [hidden] { display: none; }
.st-prelim { margin-top: -6px; }
.st-tag { display: inline-block; padding: 1px 6px; border: 1px solid var(--lf-line, #d8ddd9); border-radius: 10px; font-size: 12px; }
.st-tag-done { border-color: currentColor; font-weight: 600; }
.st-people { margin-left: auto; }
.po-adv { display: flex; gap: 4px; align-items: center; margin-top: 4px; }
.st-table .lf-num { white-space: nowrap; }
.st-table .lf-num .lf-code { white-space: normal; }
.st-formrow > td { background: var(--lf-bg, #f4f6f3); }
.st-formwrap { position: sticky; left: 0; max-width: min(760px, calc(100vw - 48px)); }
.st-formwrap .st-form { min-width: 0; }
.po-table .lf-num { white-space: nowrap; }
.po-table .lf-num .lf-field-error, .po-table .po-adv { white-space: normal; display: block; max-width: 240px; margin-left: auto; text-align: right; }
.po-table .po-adv { display: flex; justify-content: flex-end; }

/* ---------- «Остатки на площадках» ---------- */
.sk-filters { flex-wrap: wrap; gap: 8px; margin: 8px 0 14px; align-items: center; }
.sk-more { position: relative; }
.sk-more[open] > div { margin-top: 8px; flex-wrap: wrap; gap: 8px; }
.sk-box { padding: 0; }
.sk-scroll { overflow-x: auto; max-width: 100%; }
.sk-table { min-width: 860px; }
.sk-table th[scope=row] { font-weight: 400; min-width: 260px; max-width: 520px; }
.sk-name { font-weight: 700; }
.sk-table .lf-code { display: block; }
.sk-mp { display: inline-block; margin: 0 10px 2px 0; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sk-mp-name { color: var(--lf-muted); font-size: var(--lf-font-caption); }
.sk-sug { display: inline-block; padding: 3px 8px; border-radius: 8px; border: 1px solid var(--lf-line); }
.sk-sug-zero, .sk-sug-short { border-color: #d9a3a3; }
.sk-sug-fine { border-color: var(--lf-accent, #2b5f45); }
.sk-sug-unknown { border-style: dashed; }
.sk-more-body { display: grid; gap: 8px; margin: 8px 0; }
.sk-cards { font-size: var(--lf-font-caption); }
.sk-off td { color: var(--lf-muted); }
.sk-conn-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.sk-pages { flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.sk-group summary { cursor: pointer; }
.sk-group ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.sk-toggle { all: unset; cursor: pointer; display: grid; gap: 2px; }
.sk-toggle:focus-visible { outline: 2px solid var(--lf-accent, #2b5f45); outline-offset: 2px; }
.sk-toggle[aria-expanded="true"] .sk-name { text-decoration: underline; }
.sk-detail-row > td { background: var(--lf-bg, #f4f6f3); }
.sk-detail-row .sk-more-body { position: sticky; left: 0; max-width: min(1100px, calc(100vw - 48px)); }
.sk-actions { flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; align-items: center; }
.sk-pp { display: grid; gap: 8px; }
.sk-pp h3 { margin: 0; }
.sk-changed { border-color: #d9a3a3; }
.sk-mode, .sk-manual { flex-wrap: wrap; gap: 12px; align-items: center; }
.sk-manual { display: grid; }
.sk-apply { gap: 12px; align-items: center; margin: 14px 0; }
.sk-st { display: inline-block; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--lf-line); font-size: var(--lf-font-caption); }
.sk-st-confirmed { border-color: var(--lf-accent, #2b5f45); font-weight: 600; }
.sk-st-failed, .sk-st-stale { border-color: #d9a3a3; }
.sk-st-unknown { border-style: dashed; }
.sk-modeform { display: grid; gap: 12px; }
.sk-modeform fieldset { border: 1px solid var(--lf-line); border-radius: 8px; padding: 8px 12px; display: grid; gap: 6px; margin: 0; }
.sk-modeform fieldset label { display: flex; gap: 6px; align-items: center; }

/* Ожидаемые поступления: поля формы в столбик на узком экране, ничего не вылезает за край. */
.sk-expform label { display: inline-flex; flex-direction: column; gap: 4px; max-width: 100%; }
.sk-expform { grid-template-columns: minmax(0, 1fr); }
.sk-expform select, .sk-expform input { max-width: 100%; box-sizing: border-box; }
.sk-expform select { width: 100%; }
.sk-expform > label, .sk-expform .lf-row > label:first-child { display: flex; flex: 1 1 100%; }
.sk-expform .lf-row { flex-wrap: wrap; align-items: flex-end; }
.sk-expform .sk-apply { align-items: center; }
tr.sk-late td { background: color-mix(in srgb, #d9a3a3 18%, transparent); }
/* Складской день — видимые варианты (21.10.2026) */
.wh-days { border: 0; padding: 0; margin: 0 0 4px; display: flex; flex-wrap: wrap; gap: 8px; }
.wh-days legend { padding: 0; margin-bottom: 4px; }
.wh-day-opt { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--lf-line); border-radius: var(--lf-radius-control); background: var(--lf-paper); cursor: pointer; }
.wh-day-opt:has(input:checked) { border-color: var(--lf-brand); background: var(--lf-soft); }
.wh-day-opt span { display: flex; flex-direction: column; line-height: 1.2; }
.wh-day-opt small { color: var(--lf-muted); font-size: var(--lf-font-caption); }

/* ---------- «Табель и выплаты» (22.10.2026): строка расчёта, панель «Расчёт», подготовка выплат ---------- */
.tp-paybar { gap: 10px; margin: 6px 0 10px; align-items: center; }
.tp-paybar input, .tp-paybar select { min-height: var(--lf-control-height); }
.ts-plan-tag { font-size: var(--lf-font-caption); color: var(--lf-muted); border: 1px dashed var(--lf-line); border-radius: var(--lf-radius-badge); padding: 0 5px; white-space: nowrap; }
.tp-sub { display: block; font-size: var(--lf-font-caption); color: var(--lf-muted); }
.tp-inline { display: inline; } .tp-inline summary { display: inline; cursor: pointer; text-decoration: underline dotted; }
.tp-inline span { display: block; }
.ts-fin-table .tp-earned strong, .ts-fin-table .tp-topay strong { font-size: 15px; }
.ts-fin-table .tp-topay strong { color: var(--lf-brand); }
.ts-fin-table .ts-person > * { border-bottom: 0; }
.tp-sumrow td { padding: 0 8px 8px; }
.tp-sumline { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.tp-chips { display: inline-flex; flex-wrap: wrap; gap: 4px 14px; font-size: var(--lf-font-caption); color: var(--lf-text); }
.tp-warn { color: var(--lf-warntext); }
.tp-open-btn { min-height: 36px; }
.ts-person.tp-open > * { background: var(--lf-soft); }
.tp-panelrow > td { padding: 0 8px 14px; background: var(--lf-bg); }
.tp-panel { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, 1fr); gap: 18px; background: var(--lf-paper);
  border: 1px solid var(--lf-line); border-radius: 14px; padding: 16px; white-space: normal; font-size: var(--lf-font-body); }
.tp-h { margin: 0 0 8px; font-size: var(--lf-font-subheading); }
.tp-calc { margin: 0; }
.tp-line > summary, .tp-total { display: flex; justify-content: space-between; gap: 12px; padding: 7px 2px; border-bottom: 1px solid var(--lf-line); cursor: pointer; list-style: none; }
.tp-line > summary::-webkit-details-marker { display: none; }
.tp-line > summary dt { text-decoration: underline dotted var(--lf-muted); text-underline-offset: 3px; }
.tp-line > summary dd, .tp-total dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tp-line[open] > summary { background: var(--lf-soft); }
.tp-line > :not(summary) { padding: 6px 4px 10px; }
.tp-total { cursor: default; border-bottom: 0; font-weight: 700; font-size: 18px; color: var(--lf-brand); }
.tp-total dt { font-weight: 700; }
.tp-note { margin: 4px 0; }
.tp-days td, .tp-days th { padding: 3px 6px; font-size: 13px; }
.tp-op { border-top: 1px dashed var(--lf-line); padding: 6px 0; }
.tp-op-line { margin: 0 0 4px; }
.tp-sub-form { margin: 2px 0; }
.tp-sub-form > summary { cursor: pointer; display: inline-block; margin-right: 10px; }
.tp-mini { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; padding: 8px 0; }
.tp-mini label, .tp-moreform label { display: flex; flex-direction: column; gap: 2px; }
.tp-mini input, .tp-mini select, .tp-moreform input, .tp-moreform select, .tp-pay input, .tp-pay select { min-height: var(--lf-control-height); }
.tp-wide { flex: 1 1 100%; } .tp-wide input { width: 100%; }
.tp-money { width: 120px; text-align: right; font-variant-numeric: tabular-nums; }
.tp-right { display: flex; flex-direction: column; gap: 10px; }
.tp-pay { display: flex; flex-direction: column; gap: 10px; background: var(--lf-soft); border-radius: 14px; padding: 14px; }
.tp-field { display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.tp-nowrow { gap: 8px; align-items: center; flex-wrap: wrap; }
.tp-big { font-size: 20px; font-weight: 700; width: 150px; min-height: 44px; }
.tp-after { display: grid; gap: 4px; }
.tp-after div { display: flex; justify-content: space-between; gap: 8px; }
.tp-after strong { font-variant-numeric: tabular-nums; }
.tp-when, .tp-actions { gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.tp-actions button { min-height: 44px; }
.tp-excess { display: flex; gap: 6px; align-items: center; color: var(--lf-warntext); }
.tp-more { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; }
.tp-link { background: none; border: 0; padding: 6px 0; min-height: 0; color: var(--lf-brand); text-decoration: underline; cursor: pointer; font: inherit; }
.tp-moreform { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: flex-end; border: 1px solid var(--lf-line); border-radius: 12px; padding: 12px; }
.tp-moreform[hidden] { display: none; }
.tp-hint { flex: 1 1 100%; margin: 0; }
.tp-effects { margin: 6px 0; flex: 1 1 100%; } .tp-effects td, .tp-effects th { padding: 4px 8px; }
.tp-hist td, .tp-hist th { padding: 4px 6px; font-size: 12px; vertical-align: top; }
.tp-mass-top { gap: 8px; margin-bottom: 8px; align-items: center; }
.tp-mass-table th[scope=row] { font-weight: 600; }
.tp-mass-table .tp-chips { display: flex; margin-top: 2px; color: var(--lf-muted); }
.tp-mass-table input[type=checkbox] { width: 20px; height: 20px; }
.tp-mrow.tp-err > * { background: var(--lf-warn); }
.tp-massbar { position: sticky; bottom: 0; background: var(--lf-paper); border-top: 1px solid var(--lf-line); padding: 10px 0; gap: 12px; align-items: flex-end; flex-wrap: wrap; z-index: 4; }
.tp-massbar button { min-height: 44px; }
.ts-days-m { display: none; }
.ts-days-m ul { list-style: none; margin: 4px 0 0; padding: 0; }
.ts-days-m li { display: flex; justify-content: space-between; gap: 10px; font-size: var(--lf-font-caption); }
@media (max-width: 760px) {
  .ts-common .ts-dcol { display: none; }
  .ts-days-m { display: block; }
  .ts-common-scroll { overflow-x: hidden; }
  .ts-common .ts-name { max-width: none; min-width: 0; }
  .ts-sticky { position: static; min-width: 0; }
  .tp-panel { grid-template-columns: 1fr; padding: 12px; }
  .tp-mass-table thead { display: none; }
  .tp-mass-table tr.tp-mrow { display: grid; grid-template-columns: 32px 1fr 1fr; gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--lf-line); }
  .tp-mass-table tr.tp-mrow > * { border: 0; padding: 2px; text-align: left; }
  .tp-mass-table tr.tp-mrow > th { grid-column: 2 / 4; }
  .tp-money { width: 100%; }
}
@media print { .tp-panelrow, .tp-sumrow .tp-open-btn, .tp-paybar { display: none !important; } }
.ts-fin-table .ts-cell span.ts-hours { white-space: normal; }
.ts-fin-table .ts-cell { min-width: 84px; }
.ts-fin-table td.lf-num, .tp-calc dd { white-space: nowrap; }
.tp-panelrow > td, .tp-sumrow > td { position: sticky; left: 0; }
.tp-histbox { grid-column: 1 / -1; display: block; overflow-x: auto; }
.tp-hist { width: 100%; }

/* ---------- «ИИ и расходы» (Маркетинг, этап 2) ---------- */
.ai-actions { gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.ai-form { gap: 8px 12px; flex-wrap: wrap; align-items: flex-end; padding: 8px 0; }
.ai-form label { display: flex; flex-direction: column; gap: 2px; }
.ai-form input, .ai-form select, .ai-actions input, .ai-actions select { min-height: var(--lf-control-height); }
.ai-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.ai-profile { border-top: 1px solid var(--lf-line); padding: 8px 0; }
.ai-profile > summary { cursor: pointer; }
.ai-ok { color: var(--lf-brand); font-weight: 600; }
.ai-warn { color: var(--lf-warntext); }
.ai-bad { color: var(--lf-warntext); font-weight: 600; }
.ai-table td, .ai-table th { vertical-align: top; }
@media (max-width: 760px) { .ai-grid { grid-template-columns: 1fr; } .ai-form input { font-size: 16px; } }

/* ---------- «Маркетинг» (этап 3) ---------- */
.mk-filters { gap: 8px 10px; flex-wrap: wrap; align-items: flex-end; margin: 8px 0; }
.mk-filters select, .mk-filters input[type=search], .mk-filters input[type=date] { min-height: var(--lf-control-height); }
.mk-period { margin: 0 0 10px; }
.mk-kpi .wk-card { gap: 4px; }
.mk-kpi-line { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.mk-table th[scope=row] { font-weight: 600; }
.mk-table td, .mk-table th { vertical-align: top; }
.mk-open > * { background: var(--lf-soft); }
.mk-panelrow > td { background: var(--lf-bg); padding: 0 8px 14px; }
.mk-panel { background: var(--lf-paper); border: 1px solid var(--lf-line); border-radius: 14px; padding: 16px; outline: none; }
.mk-dl { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 6px 14px; margin: 0 0 12px; }
.mk-dl dt { color: var(--lf-muted); } .mk-dl dd { margin: 0; }
.mk-actions { gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.mk-actions label { display: flex; flex-direction: column; gap: 2px; }
.mk-actions input, .mk-actions button { min-height: var(--lf-control-height); }
.mk-warn { color: var(--lf-warntext); }
.mk-list { margin: 4px 0; padding-left: 18px; }
.mk-pager { gap: 6px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.mk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.mk-card { border: 1px solid var(--lf-line); border-radius: 12px; padding: 12px; }
.mk-card h5 { margin: 0 0 4px; font-size: 14px; }
.mk-desc { white-space: pre-wrap; max-height: 260px; overflow: auto; }
.mk-passport input:not([type=checkbox]) { min-height: var(--lf-control-height); width: 100%; }
.mk-passport input[type=checkbox] { width: 20px; height: 20px; }
@media (max-width: 760px) {
  .mk-dl { grid-template-columns: 1fr; }
  .mk-table thead { display: none; }
  .mk-table tr { display: block; padding: 8px 0; border-bottom: 1px solid var(--lf-line); }
  .mk-table td, .mk-table th { display: block; border: 0; padding: 2px 0; text-align: left; }
  .mk-filters input, .mk-filters select, .mk-actions input { font-size: 16px; }
}
.mk-facts-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.mk-facts { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 4px 14px; margin: 6px 0; }
.mk-facts dt { color: var(--lf-muted); }
.mk-facts dd { margin: 0; }
@media print {
  .lf-tabs, .wk-period, .lf-head .lf-row .lf-btn, .lf-head .lf-row button { display: none !important; }
  details.wk-detail > ul { display: block; }
}

/* Хокку дня (пакет аналитики 28.10.2026, 04_HOKKU_HOME.md): спокойный блок после рабочих задач. */
.hk { margin: 18px 0 8px; padding: 12px 16px; border: 1px solid var(--lf-line); border-radius: var(--lf-radius-card); background: var(--lf-paper); max-width: 560px; }
.hk-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.hk-title { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--lf-muted); margin: 0; letter-spacing: .02em; }
.hk-link { background: none; border: 0; padding: 4px 2px; min-height: 32px; color: var(--lf-brand); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }
.hk-poem { margin: 8px 0 2px; font-size: 16px; line-height: 1.5; }
.hk-poem span { display: block; }
.hk-author { margin: 0; font-size: 13px; color: var(--lf-muted); }
.hk-actions { display: flex; gap: 12px; margin-top: 4px; }
.hk-about { margin-top: 4px; font-size: 13px; }
.hk-about summary { cursor: pointer; color: var(--lf-brand); }
.hk-about dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 6px 0; }
.hk-about dt { color: var(--lf-muted); }
.hk-about dd { margin: 0; overflow-wrap: anywhere; }
.hk-collapsed { padding-top: 6px; padding-bottom: 6px; }
@media print { .hk { display: none !important; } }
