/* Изделия и работы: каталог, карточка работы, редактор сценария, действия и цехи
   конструктора процессов (макет «Изделия и работы», этап 2 редизайна). */

/* ---------------------------------------------------------------- общее */
/* Страница — колонка с шагом 16 px; вкладки и их панели — тоже. */
.process-page, .process-page > [data-workspace], .process-page [role="tabpanel"]:not([hidden]) { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.process-page > * { margin-top: 0; margin-bottom: 0; }
header.page.process-head { margin: 0; }
header.page.process-head h1, .process-work-head h1 { font-size: var(--fs-26); letter-spacing: -.01em; }
.process-head .section-sub { max-width: none; margin: var(--sp-1) 0 0; color: var(--muted); font-size: var(--fs-13); }
/* Кнопки экрана — как в макете: 13 px, обычное начертание, чёрный текст. */
.process-page button.ghost, dialog.process-dialog button.ghost { font-size: var(--fs-13); font-weight: var(--fw-400); color: var(--ink); box-shadow: none; padding: 0 var(--sp-3); }
.process-page button.action, dialog.process-dialog button.action { font-size: var(--fs-13); font-weight: var(--fw-500); box-shadow: none; padding: 0 14px; }
/* Вкладки «Изделия / Действия / Цехи» — сегмент макета. */
.process-page .workspace-tabs { margin: 0; padding: 3px; gap: 2px; border-radius: var(--radius-card); background: var(--chip-bg); }
.process-page .workspace-tabs [role="tab"] { min-height: 32px; height: 32px; padding: 0 14px; border-radius: var(--radius); font-size: var(--fs-13); font-weight: var(--fw-400); color: var(--ink); }
.process-page .workspace-tabs [aria-selected="true"] { font-weight: var(--fw-600); }
.process-inline-link {
  padding: 0; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer;
  text-decoration: underline; text-underline-offset: 2px;
}
.process-inline-link:hover { color: var(--ink-2); }
.process-ro-chip {
  display: inline-block; vertical-align: middle; padding: 2px var(--sp-2); border-radius: var(--radius-sm);
  background: var(--chip-bg); color: var(--ink-2); font-size: var(--fs-12); font-weight: var(--fw-500); letter-spacing: 0;
}
.process-note {
  margin: 0; padding: var(--sp-2-5) 14px; border-radius: var(--radius-card);
  background: var(--info-soft); color: var(--info); line-height: 1.45; font-size: var(--fs-13);
}
.process-note.warn { background: var(--warn-soft); color: var(--warn); }
.process-note.plain { background: var(--gray-50); color: var(--ink-2); }
.process-load-error {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-card); background: var(--danger-soft); color: var(--danger);
}
.process-code { font-family: var(--mono); font-size: var(--fs-12); font-weight: var(--fw-500); color: var(--muted); }
.process-held { color: var(--held); }
.process-row-actions { display: flex; flex-wrap: wrap; gap: var(--sp-1-5); align-items: center; }
.process-section-head { display: flex; align-items: center; gap: var(--sp-2-5); margin: 0; }
.process-section-head h2 { margin: 0; font-size: var(--fs-17); font-weight: var(--fw-600); }
.process-section-head > button { margin-left: auto; }
.process-ok { color: var(--ok); margin: .25rem 0; }
.field-error { margin: var(--sp-1) 0 0; color: var(--danger); font-size: var(--fs-12); }
select.invalid, textarea.invalid, input.invalid { border-color: var(--danger); }

/* Статус-пилюля: точка 6 px и подпись. */
.process-pill {
  display: inline-flex; align-items: center; gap: var(--sp-1-5); flex: none; white-space: nowrap;
  padding: 2px var(--sp-2); border-radius: var(--radius-pill); font-size: var(--fs-12); font-weight: var(--fw-500);
  background: var(--chip-bg); color: var(--ink-2);
}
.process-pill[data-tone="chip"] { font-weight: var(--fw-600); color: var(--ink); }
.process-pill[data-tone="ok"] { background: var(--ok-soft); color: var(--ok); }
.process-pill[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); }

/* Неподтверждённое сохранение — жёлтая плашка с повтором. */
.process-pending {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2-5) var(--sp-3); border-radius: var(--radius-card);
  background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 25%, var(--surface));
}
.process-pending > span { flex: 1 1 18rem; }

/* ------------------------------------------------------- каталог: планирование */
.process-plan-card {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3) var(--sp-5);
  margin: 0; padding: 14px var(--sp-4); border: 1px solid var(--rule); border-radius: var(--radius-panel);
}
.process-plan-main { display: flex; align-items: flex-start; gap: var(--sp-3); flex: 1 1 24rem; min-width: 0; }
.process-plan-main b { font-weight: var(--fw-600); }
.process-plan-main p { margin: 2px 0 0; color: var(--ink-2); line-height: 1.45; }
.process-plan-count { display: grid; gap: 2px; padding-left: var(--sp-4); border-left: 1px solid var(--rule); }
.process-plan-count b { font: var(--fw-600) var(--fs-17) var(--mono); }
.process-plan-count span { font-size: var(--fs-12); color: var(--muted); }
.process-switch {
  flex: none; width: 40px; height: 24px; margin-top: 2px; padding: 2px; border: 0; border-radius: var(--radius-pill);
  background: var(--gray-350); cursor: pointer; display: flex; justify-content: flex-start; transition: background-color .12s ease;
}
.process-switch span { width: 20px; height: 20px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgb(16 24 40 / .2); }
.process-switch[aria-checked="true"] { background: var(--ink); justify-content: flex-end; }
.process-switch:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* ------------------------------------------------------------ каталог: изделия */
.process-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin: 0; }
.process-toolbar input[type="search"] { flex: 1 1 240px; min-width: 0; height: 36px; padding: 0 var(--sp-3); }
.process-toolbar select { flex: 0 0 auto; width: auto; height: 36px; }
.process-toolbar > button.ghost { height: 36px; }
.process-check { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: 36px; white-space: nowrap; cursor: pointer; }
.process-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.process-counters { margin: 0; font-size: var(--fs-12-5); color: var(--ink-2); }
.process-counters b { font-family: var(--mono); font-weight: var(--fw-600); }
.process-count-link {
  padding: 0; border: 0; background: none; cursor: pointer; color: var(--warn);
  font: var(--fw-600) var(--fs-12-5) var(--mono); text-decoration: underline; text-underline-offset: 2px;
}
.process-count-link:disabled { color: var(--muted); text-decoration: none; opacity: 1; cursor: default; }
.process-works { border: 1px solid var(--rule); border-radius: var(--radius-panel); overflow: hidden; }
.process-works > .empty { border-radius: 0; }
.process-work-row {
  width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1.4fr) minmax(0, 1fr) 16px; gap: var(--sp-1-5) 14px; align-items: center;
  min-height: 52px; padding: var(--sp-2) 14px; border: 0; border-top: 1px solid var(--divider); background: var(--surface);
  font: inherit; color: inherit; text-align: left; cursor: pointer;
}
.process-work-row:first-child { border-top: 0; }
.process-work-row:hover { background: var(--gray-25); }
.process-work-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.process-work-row.archived { opacity: .6; }
.process-work-name { display: grid; gap: 1px; min-width: 0; }
.process-work-name b { font-weight: var(--fw-600); overflow-wrap: anywhere; }
.process-work-name small { font-size: var(--fs-12); color: var(--muted); }
.process-work-state { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1-5); min-width: 0; }
.process-work-state small { font-size: var(--fs-12); }
.process-chevron { justify-self: end; color: var(--muted); }

/* Вкладки «Действия» и «Цехи» */
.process-tab-intro { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2-5); margin: 0; }
.process-tab-intro p { flex: 1 1 300px; margin: 0; color: var(--ink-2); line-height: 1.45; }
.process-tab-intro button.action { height: 36px; }
[data-panel="workshops"] .process-tab-intro p { max-width: 760px; }
.process-shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-2-5); }
.process-workshop { display: flex; flex-direction: column; gap: var(--sp-2-5); padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius-card); min-width: 0; }
.process-workshop.warn { border-color: var(--warn-border); }
.process-workshop.archived { opacity: .6; }
.process-shop-head { display: flex; align-items: baseline; gap: var(--sp-2); }
.process-shop-head > b { font-size: var(--fs-14); font-weight: var(--fw-600); overflow-wrap: anywhere; }
.process-shop-head small { margin-left: auto; font-size: var(--fs-12); color: var(--muted); white-space: nowrap; }
.process-shop-master { margin: 0; font-size: var(--fs-12-5); color: var(--ink-2); }
.process-shop-master.warn { color: var(--warn); }
.process-members { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-1); }
.process-members li { display: flex; gap: var(--sp-2); align-items: center; }
.process-members li.inactive { opacity: .6; }
.process-avatar { width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--chip-bg); display: grid; place-items: center; font-size: 10px; font-weight: var(--fw-600); }
.process-member-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.process-member-edit { flex: 1; min-width: 0; padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.process-member-edit:hover { text-decoration: underline; text-underline-offset: 2px; }
.process-member-role { font-size: var(--fs-12); color: var(--muted); }

/* ------------------------------------------------------------ карточка работы */
.process-page button.process-back { align-self: flex-start; height: 30px; padding: 0 var(--sp-2-5); margin: 0; }
.process-work-head { display: flex; flex-direction: column; gap: var(--sp-1); margin: 0; }
.process-work-head .process-code { font-size: var(--fs-12-5); }
.process-work-head h1 { margin: 0; font-weight: var(--fw-600); overflow-wrap: anywhere; }
.process-work-group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2-5); }
.process-work-group > span { color: var(--ink-2); }
.process-work-group select { width: 240px; max-width: 100%; height: 32px; }
.process-section-head button.ghost { height: 32px; }
.process-scenario-row button.ghost { height: 32px; }
.process-scenarios { border: 1px solid var(--rule); border-radius: var(--radius-panel); overflow: hidden; }
.process-scenarios > .empty, .process-scenarios > .error { border-radius: 0; }
.process-scenarios[role="status"] { padding: var(--sp-3) 14px; color: var(--muted); }
.process-scenario-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) 14px;
  padding: var(--sp-3) 14px; border-top: 1px solid var(--divider);
}
.process-scenario-row:first-child { border-top: 0; }
.process-scenario-row.archived { opacity: .6; }
.process-scenario-name { flex: 1 1 14rem; display: grid; gap: 2px; min-width: 0; }
.process-scenario-name b { font-weight: var(--fw-600); overflow-wrap: anywhere; }
.process-scenario-name small { font-size: var(--fs-12); color: var(--muted); }
.process-issue-count { font-size: var(--fs-12-5); color: var(--muted); }
.process-issue-count.bad { color: var(--danger); }

/* ---------------------------------------------------------- редактор: шапка */
.process-editor { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.process-editor > * { min-width: 0; }
.process-editor-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2-5); }
.process-editor-title h1 { margin: 0; font-size: var(--fs-22); font-weight: var(--fw-600); letter-spacing: 0; overflow-wrap: anywhere; }
.process-editor-title h1 input { width: 180px; max-width: 100%; height: 32px; padding: 0 var(--sp-2); font-size: var(--fs-17); font-weight: var(--fw-600); vertical-align: middle; }
/* Липкая полоса: ревизия, несохранённое, замечания, норма, вид и выпуск. */
.process-sticky {
  position: sticky; top: var(--sp-2); z-index: 8;
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) 14px;
  padding: var(--sp-2-5) var(--sp-3); border: 1px solid var(--rule); border-radius: var(--radius-panel);
  background: var(--surface); box-shadow: 0 0 0 6px var(--surface);
}
.process-state { font-size: var(--fs-12-5); color: var(--ink-2); }
.process-state b { font-family: var(--mono); font-weight: var(--fw-600); }
.process-state .dirty { color: var(--warn); font-weight: var(--fw-600); }
.process-state .clean { color: var(--ok); }
.process-norm { font-size: var(--fs-12-5); color: var(--muted); }
.process-norm b { font-family: var(--mono); color: var(--ink); font-weight: var(--fw-600); }
.process-spacer { flex: 1 1 0; }
.process-issues-pill {
  height: 28px; padding: 0 var(--sp-2-5); border-radius: var(--radius-pill); cursor: pointer; font: inherit;
  font-size: var(--fs-12-5); font-weight: var(--fw-600);
  border: 1px solid color-mix(in srgb, var(--ok) 25%, var(--surface)); background: var(--ok-soft); color: var(--ok);
}
.process-issues-pill[data-tone="bad"] { border-color: color-mix(in srgb, var(--danger) 25%, var(--surface)); background: var(--danger-soft); color: var(--danger); }
.process-issues-pill:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.process-issues { margin-top: calc(-1 * var(--sp-2)); border: 1px solid var(--danger-border); border-radius: var(--radius-card); overflow: hidden; }
.process-issues ul { list-style: none; margin: 0; padding: 0; }
.process-issues li {
  display: flex; align-items: center; gap: var(--sp-2-5); padding: var(--sp-2) var(--sp-3);
  border-top: 1px solid var(--flow-issue-line); background: var(--danger-faint);
}
.process-issues li:first-child { border-top: 0; }
.process-issues li > span:nth-child(2) { flex: 1; }
.process-issues .process-ok { margin: 0; padding: var(--sp-2-5) var(--sp-3); background: var(--ok-soft); }
.process-issues li button.ghost { height: 28px; font-size: var(--fs-12); border-radius: var(--radius-sm); }
.process-sticky button.ghost { font-weight: var(--fw-500); }
.process-bang {
  width: 18px; height: 18px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--danger); color: var(--ink-inverse); font-size: var(--fs-11); font-weight: var(--fw-700);
}
.process-seg { display: flex; gap: 2px; padding: 2px; border-radius: var(--radius); background: var(--chip-bg); }
.process-seg button {
  height: 28px; padding: 0 var(--sp-2-5); border: 0; border-radius: var(--radius-sm); background: transparent;
  font: inherit; font-size: var(--fs-12-5); color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.process-seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: var(--fw-600); box-shadow: var(--shadow-tab); }
.process-seg button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }

/* ---------------------------------------------------------- редактор: версии */
.process-versions { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; margin: 0; }
.process-version-row button.ghost { height: 30px; padding: 0 var(--sp-2-5); font-size: var(--fs-12-5); }
.process-versions h2 { margin: 0; font-size: var(--fs-17); font-weight: var(--fw-600); }
.process-versions > .hint { margin: 0; max-width: 48rem; }
.process-version-list { border: 1px solid var(--rule); border-radius: var(--radius-panel); overflow: hidden; }
.process-version-list > .empty, .process-version-list > .error { border-radius: 0; }
.process-version-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) 14px; padding: var(--sp-2-5) 14px; border-top: 1px solid var(--divider); }
.process-version-row:first-child { border-top: 0; }
.process-version-row > b { min-width: 5rem; font-weight: var(--fw-600); }
.process-version-meta { flex: 1 1 12rem; font-size: var(--fs-12-5); color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.process-versions .mono, .process-dialog .mono { font-family: var(--mono); font-size: var(--fs-12); color: var(--muted); }

/* Окна-вопросы экрана: выпуск, снятие версии, уход, автоплан. Как в макете:
   500 px, тело 18/20/14, футер на подложке с кнопками справа. */
dialog.process-dialog { width: min(500px, calc(100vw - 32px)); border-radius: var(--radius-dialog); }
dialog.process-dialog form { padding: 0; gap: 0; }
.process-dialog-body { display: flex; flex-direction: column; gap: var(--sp-2-5); padding: 18px 20px 14px; }
.process-dialog-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-3) 20px; background: var(--dialog-footer-bg); border-top: 1px solid var(--rule); }
.process-dialog-foot button { height: 32px; }
.process-dialog-text { margin: 0; color: var(--ink-2); line-height: 1.45; }
.process-dialog-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--sp-2-5); color: var(--danger); }
.process-dialog-list li { display: flex; gap: var(--sp-2); }
.process-dialog-list li::before { content: "•"; }
.process-reason { display: grid; gap: var(--sp-1); }
.process-reason textarea { width: 100%; box-sizing: border-box; resize: vertical; padding: var(--sp-2) var(--sp-2-5); }
.process-reason textarea.invalid, .process-reason textarea.invalid:focus { border-color: var(--danger); }
dialog.process-dialog button.action.danger { background: var(--danger); }
dialog.process-dialog button.action.danger:hover:not(:disabled) { background: var(--danger); filter: brightness(.92); }

/* ---------------------------------------------------------- блочный редактор
   Палитра строкой над холстом, холст с точечной сеткой, панель свойств справа
   (на узкой ширине — под холстом), управление видом поверх холста. */
.flow-editor {
  --flow-shadow: 0 1px 2px rgb(16 24 40 / .04);
  --flow-shadow-lift: 0 6px 18px rgb(16 24 40 / .12);
  --flow-canvas-bg: var(--flow-canvas);
  --flow-dot: var(--gray-350);
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--sp-3); align-items: start; min-width: 0;
}
.flow-editor.table-mode { grid-template-columns: minmax(0, 1fr); }
.flow-main { display: grid; gap: var(--sp-2); min-width: 0; }
.flow-main[hidden], .flow-inspector[hidden], .flow-table-wrap[hidden] { display: none; }
.flow-stage {
  position: relative; height: min(64vh, 560px);
  border: 1px solid var(--rule); border-radius: 16px; overflow: hidden;
  background-color: var(--flow-canvas-bg);
  background-image: radial-gradient(var(--flow-dot) 1px, transparent 1px);
  background-size: 22px 22px;
}
.flow-scroll { position: absolute; inset: 0; overflow: auto; min-width: 0; outline: none; }
.flow-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--focus-ring); }
.flow-sizer { position: relative; }
.flow-canvas { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.flow-editor.connecting .flow-node:not(.dragging):hover { box-shadow: 0 0 0 2px var(--info), var(--flow-shadow-lift); }
.flow-help { margin: 0; font-size: var(--fs-12); color: var(--muted); }

/* Цвет типа блока: значок, порты, полоса выбора. */
[data-tone] { --tone: var(--muted); --tone-soft: var(--surface-2); }
[data-tone="intake"] { --tone: var(--stage-intake); --tone-soft: var(--flow-intake-soft); }
[data-tone="operation"] { --tone: var(--stage-make); --tone-soft: var(--flow-make-soft); }
[data-tone="quality"] { --tone: var(--stage-control); --tone-soft: var(--flow-control-soft); }
[data-tone="handover"] { --tone: var(--stage-issue); --tone-soft: var(--flow-issue-soft); }
[data-tone="notify"] { --tone: var(--info); --tone-soft: var(--info-soft); }
[data-tone="wait"] { --tone: var(--muted); --tone-soft: var(--chip-bg); }
[data-tone="decision"] { --tone: var(--warn); --tone-soft: var(--warn-soft); }
[data-tone="courier"], [data-cap="courier"] { --tone: var(--held); --tone-soft: var(--held-soft); }
[data-tone="checklist"], [data-cap="checklist"] { --tone: var(--ok); --tone-soft: var(--ok-soft); }
[data-tone="attachment"], [data-cap="attachment"] { --tone: var(--violet); --tone-soft: var(--violet-soft); }
[data-tone="task"], [data-cap="task"] { --tone: var(--info); --tone-soft: var(--info-soft); }

/* Плитка-значок типа: знак макета на мягкой заливке цвета типа. */
.flow-badge {
  display: inline-grid; place-items: center; flex: none;
  width: 30px; height: 30px; border-radius: var(--radius);
  background: var(--tone-soft, var(--surface-2)); color: var(--tone, var(--muted));
  font-size: var(--fs-13); font-weight: var(--fw-700); line-height: 1;
}
.flow-badge.lg { width: 36px; height: 36px; border-radius: var(--radius); }

/* Палитра: «Добавить после «…»:» и кнопки блоков. */
.flow-palette { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1-5); min-width: 0; }
.flow-palette-label { font-size: var(--fs-12); color: var(--muted); margin-right: var(--sp-1); }
.flow-add {
  display: inline-flex; align-items: center; gap: var(--sp-1-5); max-width: 16rem; height: 30px;
  padding: 0 var(--sp-2-5); border: 1px solid var(--button-border); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-12-5); cursor: pointer;
}
.flow-add .flow-badge { width: 16px; height: 16px; border-radius: 4px; font-size: 10px; }
.flow-add-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flow-add:hover:not(:disabled) { background: var(--hover-bg); }
.flow-add:active:not(:disabled) { cursor: grabbing; }
.flow-add:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.flow-add:disabled { opacity: .5; cursor: default; }

/* Управление видом: внизу слева поверх холста. */
.flow-hud {
  position: absolute; left: 12px; bottom: 12px; z-index: 3;
  display: flex; align-items: center; gap: 2px; padding: 3px;
  background: var(--surface); border: 1px solid var(--button-border); border-radius: var(--radius-card);
}
.flow-hud-btn {
  display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--ink); font: inherit; cursor: pointer;
}
.flow-hud-btn:hover:not(:disabled) { background: var(--chip-bg); color: var(--ink); }
.flow-hud-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.flow-hud-btn:disabled { opacity: .4; cursor: default; }
.flow-hud-text { padding: 0 var(--sp-2-5); border-left: 1px solid var(--rule); border-radius: 0; }
.flow-zoom-label { min-width: 48px; display: grid; place-items: center; font: var(--fs-12) var(--mono); }

/* Стрелки */
.flow-edges { position: absolute; inset: 0; overflow: visible; }
.flow-edges { pointer-events: none; }
.flow-edge { fill: none; stroke: var(--decor); stroke-width: 1.4; }
.flow-edge.fail { stroke: var(--danger); stroke-width: 1.6; stroke-dasharray: 5 4; }
.flow-arrow { fill: var(--decor); }
.flow-arrow.fail { fill: var(--danger); }
.flow-edge-label { font: var(--fw-600) 10.5px var(--font); fill: var(--ok); }
.flow-edge-label.fail { fill: var(--danger); }

/* Блоки 200×72; приём и выдача — пилюли-якоря с замком. */
.flow-node {
  position: absolute; width: 200px; height: 72px; box-sizing: border-box;
  display: flex; align-items: center; gap: var(--sp-2-5); padding: var(--sp-2-5) var(--sp-3);
  background: var(--surface); border: 1px solid var(--button-border); border-radius: var(--radius-panel);
  box-shadow: var(--flow-shadow); cursor: grab; user-select: none; touch-action: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.flow-node.anchor { border-radius: var(--radius-pill); }
.flow-node:hover { box-shadow: var(--flow-shadow-lift); }
.flow-node.dragging { cursor: grabbing; box-shadow: var(--flow-shadow-lift); z-index: 2; }
.flow-node:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.flow-node.selected { border: 2px solid var(--tone); padding: 9px 11px; box-shadow: var(--flow-shadow-lift); }
.flow-node.has-issue:not(.selected) { border-color: var(--danger-border); }
.flow-node-text { display: grid; min-width: 0; gap: 1px; flex: 1; }
.flow-node-kind { font-size: 10px; font-weight: var(--fw-700); letter-spacing: .06em; text-transform: uppercase; color: var(--tone, var(--muted)); }
.flow-node strong { font-size: var(--fs-13); font-weight: var(--fw-600); line-height: 1.2; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.flow-node small { font-size: var(--fs-11); color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.flow-node-lock { position: absolute; top: 6px; right: 8px; font-size: 10px; color: var(--decor); }
.flow-node-alert {
  position: absolute; right: -8px; top: -8px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; font-size: var(--fs-12); font-weight: var(--fw-700); color: var(--ink-inverse); background: var(--danger);
}
/* Пустой черновик: пунктирная подсказка рядом с приёмом. */
.flow-ghost {
  position: absolute; width: 220px; height: 72px; padding: var(--sp-2); box-sizing: border-box;
  border: 2px dashed var(--decor); border-radius: var(--radius-panel);
  display: grid; place-items: center; color: var(--ink-2); text-align: center;
}

/* Панель свойств 300 px справа. */
.flow-inspector {
  position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; box-sizing: border-box; min-width: 0;
  display: grid; align-content: start; gap: var(--sp-3); padding: 14px;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel);
}
.flow-insp-idle { margin: 0; color: var(--muted); line-height: 1.45; }
.flow-inspector h3 { margin: 0; font-size: var(--fs-14); }
.flow-inspector h4 { margin: 0; font-size: var(--fs-11); font-weight: var(--fw-700); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.flow-inspector .hint { margin: 0; font-size: var(--fs-12); line-height: 1.4; }
.flow-insp-head { display: flex; align-items: center; gap: var(--sp-2); }
.flow-insp-head .flow-badge { width: 26px; height: 26px; border-radius: var(--radius-sm); font-size: var(--fs-12); }
.flow-insp-head .flow-node-kind { font-size: var(--fs-11); }
.flow-insp-issue { white-space: pre-line; margin: 0; padding: var(--sp-2) var(--sp-2-5); border-radius: var(--radius); background: var(--danger-soft); color: var(--danger); font-size: var(--fs-12-5); line-height: 1.4; }
.flow-note { margin: 0; padding: var(--sp-2) var(--sp-2-5); border-radius: var(--radius); background: var(--gray-50); color: var(--ink-2); font-size: var(--fs-12-5); line-height: 1.45; }
.flow-action-src { margin: 0; padding: var(--sp-2) var(--sp-2-5); font-size: var(--fs-12-5); border-radius: var(--radius); background: var(--gray-50); color: var(--ink-2); }
.flow-action-src.warn { background: var(--warn-soft); color: var(--warn); }
.flow-form { display: grid; gap: var(--sp-3); }
.flow-form select, .flow-form input:not([type="checkbox"]):not([type="radio"]), .flow-form textarea { width: 100%; box-sizing: border-box; }
.flow-form label.field { gap: var(--sp-1); font-size: var(--fs-12); font-weight: var(--fw-500); color: var(--ink-2); }
.flow-form label.field > span { font-weight: var(--fw-400); font-size: var(--fs-12) !important; line-height: 1.4; }
.flow-form label.field input:not([type="checkbox"]), .flow-form label.field select { height: 34px; font-size: var(--fs-13); }
.flow-form button.ghost.tiny { height: 28px; border-radius: var(--radius-sm); }
.flow-form input[type="number"] { font-family: var(--mono); }
.flow-checks { border: 0; padding: 0; margin: 0; display: grid; gap: .2rem; }
.flow-checks legend { font-size: var(--fs-12-5); color: var(--ink-2); margin-bottom: .2rem; }
.flow-checks label, .flow-toggle { display: flex; gap: .45rem; align-items: center; }
.flow-checks input, .flow-toggle input { width: auto; }
.flow-chips { display: flex; flex-wrap: wrap; gap: .25rem; }
.flow-chips .chip { font-size: var(--fs-12); }
.flow-sub { display: grid; gap: var(--sp-1-5); }
.flow-sub > button { justify-self: start; }
.flow-sub-title { font-size: var(--fs-12-5); color: var(--ink-2); }
.flow-checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: .35rem; counter-reset: chk; }
.flow-checklist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem; align-items: center; padding: .4rem; border-radius: var(--radius-card); background: var(--gray-50); }
.flow-checklist li > input { grid-column: 1 / -1; }
.flow-icon-btn {
  width: var(--control-h); height: var(--control-h); flex: none; border: 1px solid var(--button-border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--muted); font: inherit; cursor: pointer;
}
.flow-icon-btn:hover:not(:disabled) { color: var(--danger); border-color: var(--danger); }
.flow-icon-btn:disabled { opacity: .4; cursor: default; }
.flow-branches { display: grid; gap: .35rem; }
.flow-branch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: .3rem; align-items: center; }
.flow-branch:has(> :nth-child(2):last-child) { grid-template-columns: minmax(0, 1fr) auto; }
.flow-links { display: flex; flex-direction: column; gap: var(--sp-1-5); padding-top: var(--sp-2-5); border-top: 1px solid var(--divider); }
.flow-link { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-13); }
.flow-link-to { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.flow-link-port { min-width: 44px; font-size: var(--fs-12); font-weight: var(--fw-600); color: var(--ok); }
.flow-link-port.fail { color: var(--danger); }
.flow-link .flow-icon-btn { width: 24px; height: 24px; border-radius: var(--radius-sm); color: var(--ink); }
.flow-links-none { margin: 0; font-size: var(--fs-12-5); color: var(--muted); }
.flow-link-add { display: flex; gap: var(--sp-1-5); }
.flow-link-add select { flex: 1; min-width: 0; height: 32px; }
.flow-delete { justify-self: start; height: 28px; padding: 0; border: 0; background: none; color: var(--danger); font: inherit; font-weight: var(--fw-500); cursor: pointer; }
.flow-delete:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.danger-text { color: var(--danger); }

/* Этапы таблицей */
.flow-table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius-panel); min-width: 0; }
.flow-table { width: 100%; min-width: 780px; border-collapse: collapse; }
.flow-table thead th { padding: var(--sp-2) var(--sp-3); background: var(--table-head-bg); font-size: var(--fs-12); font-weight: var(--fw-500); color: var(--muted); text-align: left; }
.flow-table thead th:nth-child(4) { width: 110px; }
.flow-table td, .flow-table tbody th { padding: var(--sp-1-5) var(--sp-3); border-top: 1px solid var(--divider); text-align: left; vertical-align: middle; }
.flow-table tbody th { display: table-cell; font-weight: var(--fw-600); }
.flow-table tr.has-issue { background: var(--danger-faint); }
.flow-table select { width: 100%; height: 32px; }
.flow-table tbody th[scope="row"] { font-weight: var(--fw-600); color: var(--ink); font-size: var(--fs-13); }
.flow-table thead th:nth-child(1) { width: 15%; }
.flow-table thead th:nth-child(2) { width: 17%; }
.flow-table thead th:nth-child(3) { width: 25%; }
.flow-table input[type="number"] { width: 80px; height: 32px; font-family: var(--mono); }
.flow-table td.muted { color: var(--decor); }
.flow-table-who { display: grid; gap: var(--sp-1); }
.flow-table .flow-table-who { display: table-cell; }
.flow-table-who select + select { margin-top: var(--sp-1); }

/* Тост с отменой */
.toast.flow-toast {
  display: flex; align-items: center; gap: var(--sp-3); pointer-events: auto;
  padding: var(--sp-2-5) var(--sp-2-5) var(--sp-2-5) var(--sp-4); background: var(--ink); color: var(--ink-inverse);
}
.flow-toast-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-lime); flex: none; }
.flow-toast-undo {
  height: 28px; padding: 0 var(--sp-2-5); border: 1px solid var(--ink-2); border-radius: var(--radius-sm);
  background: transparent; color: var(--brand-lime); font: inherit; font-weight: var(--fw-500); cursor: pointer;
}
.flow-toast-undo:focus-visible { outline: 2px solid var(--brand-lime); outline-offset: 2px; }

/* Библиотека действий */
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--sp-2-5); }
.action-card {
  display: flex; align-items: flex-start; gap: var(--sp-3); padding: 14px; min-width: 0;
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-card);
  font: inherit; color: inherit; text-align: left;
}
button.action-card { cursor: pointer; }
button.action-card:hover { background: var(--gray-25); }
button.action-card:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.action-card.archived { opacity: .6; }
.action-card-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.action-card-body b { font-weight: var(--fw-600); }
.action-card-cap { font-size: var(--fs-12); font-weight: var(--fw-500); color: var(--tone); }
.action-card-cfg { font-size: var(--fs-12); color: var(--ink-2); line-height: 1.4; }
.action-empty { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: var(--sp-2-5); }
.action-empty-item { display: grid; gap: .35rem; justify-items: start; padding: 14px; border: 1px dashed var(--rule-strong); border-radius: var(--radius-card); }
.action-empty-item small { color: var(--muted); }
.action-empty .hint { grid-column: 1 / -1; }
dialog.admin-dialog.action-dialog { width: min(46rem, calc(100vw - 2rem)); }
dialog.admin-dialog.action-dialog .form-group { grid-template-columns: minmax(0, 1fr); }
.action-dialog .flow-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem .9rem; }
.action-dialog .flow-form > .flow-sub, .action-dialog .flow-form > label:has(textarea) { grid-column: 1 / -1; }
.action-caps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.action-cap {
  display: flex; align-items: start; gap: .6rem; padding: .7rem; cursor: pointer;
  border: 1px solid var(--rule); border-radius: var(--radius-panel); background: var(--surface);
}
.action-cap input { position: absolute; opacity: 0; pointer-events: none; }
.action-cap > span:last-child { display: grid; gap: .15rem; }
.action-cap small { color: var(--muted); font-size: var(--fs-12); line-height: 1.3; }
.action-cap:has(input:checked) { border-color: var(--tone); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tone) 18%, transparent); }
.action-cap:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.action-cap:has(input:disabled) { cursor: default; }
.action-cap:has(input:disabled:not(:checked)) { opacity: .45; }

/* Узкая ширина: свойства под холстом, холст 60vh. Контент уже ~900 px — это
   экран до 1132 px при открытом меню 232 px. */
@media (max-width: 70.75rem) {
  .flow-editor { grid-template-columns: minmax(0, 1fr); }
  .flow-inspector { position: static; max-height: none; }
  .flow-stage { height: 60vh; }
}
@media (max-width: 40rem) {
  .process-work-row { grid-template-columns: 48px minmax(0, 1fr) 12px; }
  .process-work-state { grid-column: 2; }
  .process-work-row .process-chevron { grid-column: 3; grid-row: 1; }
  .action-caps, .action-dialog .flow-form { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------ карточка наряда → «Сценарий» */
.shadow { display: grid; gap: 1rem; min-width: 0; }
.shadow-banner { display: flex; gap: .7rem; align-items: start; padding: .75rem .9rem; border-radius: 14px; background: var(--info-soft); }
.shadow-banner p { margin: 0; font-size: .88rem; color: var(--ink-2); }
.shadow-summary { display: flex; flex-wrap: wrap; gap: .4rem; }
.shadow-pill {
  display: inline-flex; align-items: center; white-space: nowrap; flex: none;
  padding: .15rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600;
  background: var(--gray-100); color: var(--ink-2);
}
.shadow-pill[data-tone="ok"] { background: var(--ok-soft); color: var(--ok); }
.shadow-pill[data-tone="working"] { background: var(--stage-working-soft); color: var(--stage-working); }
.shadow-pill[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); }
.shadow-pill[data-tone="info"] { background: var(--info-soft); color: var(--info); }
.shadow-body { display: grid; gap: 1rem; }
.shadow-line { display: grid; gap: .8rem; padding: 1rem; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); min-width: 0; }
.shadow-line-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: start; gap: .6rem; }
.shadow-line-head h3 { margin: 0; font-size: 1.02rem; }
.shadow-line-head small { color: var(--muted); }
.shadow-line-head select { max-width: 100%; }
.shadow-empty { margin: 0; padding: .7rem .8rem; border-radius: 10px; background: var(--gray-50); color: var(--ink-2); font-size: .88rem; }
.shadow-now {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .15rem .8rem; align-items: center;
  padding: .7rem .9rem; border-radius: 12px; background: var(--stage-working-soft); border: 1px solid color-mix(in srgb, var(--stage-working) 25%, transparent);
}
.shadow-now.warn { background: var(--warn-soft); }
.shadow-now-label { grid-column: 1; font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--stage-working); }
.shadow-now strong { grid-column: 1; font-size: .98rem; }
.shadow-now small { grid-column: 1; color: var(--warn); font-size: .8rem; }
.shadow-now > .shadow-diff, .shadow-now > .shadow-match { grid-column: 2; grid-row: 1 / span 3; font-size: .8rem; font-weight: 600; }
.shadow-diff { color: var(--warn); }
.shadow-match { color: var(--ok); }
.shadow-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; position: relative; }
.shadow-step {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: .7rem; align-items: center;
  padding: .45rem .5rem; border-radius: 12px;
}
.shadow-step + .shadow-step::before {
  content: ""; position: absolute; left: calc(.5rem + 1.125rem - 1px); top: -.45rem; height: .9rem; width: 2px; background: var(--rule);
}
.shadow-step .flow-badge { width: 2.25rem; height: 2.25rem; }
.shadow-step-text { display: grid; gap: 1px; min-width: 0; }
.shadow-step-text strong { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shadow-step-text small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shadow-step[data-phase="past"] { opacity: .62; }
.shadow-step[data-phase="current"] { background: var(--stage-working-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--stage-working) 30%, transparent); }
.shadow-step[data-state="missing"] { background: var(--warn-soft); }
.shadow-extra { padding: .7rem .9rem; border-radius: 12px; border: 1px dashed color-mix(in srgb, var(--warn) 45%, transparent); }
.shadow-extra h4 { margin: 0 0 .4rem; font-size: .82rem; color: var(--warn); text-transform: uppercase; letter-spacing: .05em; }
.shadow-extra ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .3rem; }
.shadow-extra li { display: flex; justify-content: space-between; gap: .5rem; font-size: .88rem; }
.shadow-save { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; }
.shadow-save .field { flex: 1 1 16rem; }
.shadow-snaps h3 { margin: 0 0 .4rem; font-size: 1rem; }
.shadow-snap-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.shadow-snap-list summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; padding: .5rem .7rem; border-radius: 10px; background: var(--gray-50); font-size: .88rem; }
.shadow-snap-list summary .shadow-pill { margin-left: auto; }
.shadow-snap-body { display: grid; gap: .6rem; padding: .6rem 0 0; }
@media (max-width: 40rem) {
  .shadow-now { grid-template-columns: minmax(0, 1fr); }
  .shadow-now > .shadow-diff, .shadow-now > .shadow-match { grid-column: 1; grid-row: auto; }
  .shadow-step { grid-template-columns: auto minmax(0, 1fr); }
  .shadow-step > .shadow-pill { grid-column: 2; justify-self: start; }
}

/* ---------------------------------------------------- план наряда по сценарию */
.plan { display: grid; gap: .8rem; padding: 1rem; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); }
.plan-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .8rem; }
.plan-head > div { flex: 1 1 16rem; }
.plan-head h3 { margin: 0; font-size: 1.05rem; }
.plan-head small { color: var(--muted); }
.plan-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
.plan-stage {
  display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.2fr) minmax(9rem, auto); gap: .4rem 1rem; align-items: center;
  padding: .6rem .8rem; border-radius: 12px; background: var(--gray-50);
}
.plan-stage.overdue { background: var(--danger-soft); }
.plan-stage-main, .plan-stage-who, .plan-stage-due { display: grid; gap: 2px; min-width: 0; }
.plan-stage-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-stage small { color: var(--muted); font-size: .78rem; }
.plan-stage-who .shadow-pill { justify-self: start; }
.plan-stage-due { text-align: right; font-size: .86rem; font-variant-numeric: tabular-nums; }
.plan-stage.overdue .plan-stage-due small { color: var(--danger); font-weight: 600; }
.plan-apply { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.plan-apply small { color: var(--muted); }
@media (max-width: 40rem) {
  .plan-stage { grid-template-columns: minmax(0, 1fr); }
  .plan-stage-due { text-align: left; }
}
/* Очередь плана — вкладка «По плану сценария» блока «Ждут исполнителя» на доске
   производства (board.css задаёт рамку блока). Строка: этап и № наряда, пациент ·
   цех · срок этапа; пилюля, кто назначает; выбор исполнителя сохраняется сразу. */
.plan-queue { display: grid; gap: .6rem; margin: 0 0 1rem; padding: 1rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--rule); }
.plan-queue.is-embedded { gap: 0; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; }
.plan-queue h2 { margin: 0; font-size: var(--fs-14); }
.plan-queue-list { list-style: none; margin: 0; padding: 0; display: grid; }
.plan-queue-item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(220px, 300px); gap: var(--sp-2) 14px; align-items: center;
  padding: var(--sp-2-5) 14px; border-top: 1px solid var(--row-rule); background: var(--surface);
}
.plan-queue-list > .plan-queue-item:first-child { border-top: 0; }
.plan-stage-main { display: grid; gap: 2px; min-width: 0; }
.plan-stage-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); }
.plan-stage-title > b { font-weight: var(--fw-600); }
.plan-stage-main > small { color: var(--muted); font-size: var(--fs-12); }
.plan-queue-item > .shadow-pill { justify-self: start; font-size: var(--fs-12); font-weight: var(--fw-500); }
.plan-queue-pick { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.plan-queue-pick select { width: 100%; min-width: 0; }
.plan-queue-pick > .danger-text { font-size: var(--fs-12); }
.plan-queue-pick > .danger-text:empty { display: none; }
.plan-queue-empty { margin: 0; padding: var(--sp-4) 14px; color: var(--muted); }
@media (max-width: 48rem) { .plan-queue-item { grid-template-columns: minmax(0, 1fr); } .plan-queue-item .shadow-pill { justify-self: start; } }
.plan-stage.risk { background: var(--warn-soft); }
.plan-stage-due small.risk { color: var(--warn); font-weight: 600; }

/* ------------------------------------------------------------- доска нагрузки */
/* Макет «Нагрузка» (этап 2): заголовок с периодом-сегментом, пять плиток,
   раскрывашка про два разреза, сетка «люди × дни», панель этапов ячейки, «Горят».
   Вторая вкладка — «Люди и смены» (правила .sched-* ниже). */
header.load-head { display: flex; align-items: flex-end; gap: var(--sp-3) var(--sp-4); flex-wrap: wrap; margin: 0; }
header.load-head > div:first-child { flex: 1 1 260px; display: flex; flex-direction: column; gap: var(--sp-1); min-width: 0; }
header.load-head h1 { margin: 0; font-size: var(--fs-26); font-weight: var(--fw-600); letter-spacing: -.01em; }
header.load-head .section-sub { margin: 0; color: var(--muted); }
.load-period { flex: none; display: flex; gap: 2px; padding: 3px; border-radius: var(--radius-card); background: var(--chip-bg); }
.load-period[hidden] { display: none; }
.load-period button {
  min-height: 30px; padding: 0 var(--sp-3); border: 0; border-radius: var(--radius); background: transparent; cursor: pointer;
  font: inherit; font-size: var(--fs-13); color: var(--ink-2); white-space: nowrap;
}
.load-period button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: var(--fw-600); box-shadow: var(--shadow-tab); }
.load-period button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
main[data-view="load"] [data-workspace="load"] > .workspace-tabs { margin: var(--sp-4) 0 var(--sp-4); }
main[data-view="load"] .workspace-panel { min-width: 0; }

.load-body { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.load-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-2); }
.load-kpi {
  display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-3) 14px;
  border: 1px solid var(--rule); border-radius: var(--radius-card); background: var(--surface);
}
.load-kpi strong { font-family: var(--mono); font-size: var(--fs-22); font-weight: var(--fw-600); line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.load-kpi span { font-size: var(--fs-12-5); line-height: 1.3; color: var(--ink-2); }
.load-kpi[data-tone="warn"] { border-color: var(--warn-line); background: var(--warn-soft); }
.load-kpi[data-tone="warn"] strong { color: var(--warn); }
.load-kpi[data-tone="ok"] { border-color: var(--ok-line); background: var(--ok-soft); }
.load-kpi[data-tone="ok"] strong { color: var(--ok); }

.load-why { border: 1px solid var(--rule); border-radius: var(--radius-card); padding: 0 14px; background: var(--gray-25); }
.load-why > summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; font-weight: var(--fw-500); }
.load-why > div { display: flex; flex-direction: column; gap: var(--sp-1-5); padding-bottom: var(--sp-3); max-width: 760px; color: var(--ink-2); line-height: 1.5; }
.load-why p { margin: 0; }
.load-why b { font-weight: var(--fw-600); color: var(--ink); }

.load-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1-5) 14px; font-size: var(--fs-12); color: var(--ink-2); }
.load-legend-item { display: inline-flex; align-items: center; gap: var(--sp-1-5); }
.load-swatch {
  display: inline-grid; place-items: center; width: 22px; height: 16px; box-sizing: border-box; border-radius: 4px;
  font-style: normal; font-family: var(--mono); font-size: 10px; font-weight: var(--fw-700); color: var(--danger);
}
.load-grid-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius-panel); background: var(--surface); }
.load-grid { border-collapse: separate; border-spacing: 0; width: 100%; table-layout: fixed; font-size: var(--fs-13); }
.load-grid col.load-day-col { width: auto; }
.load-grid col.load-person { width: 190px; }
.load-grid col.load-sum { width: 70px; }
.load-grid th, .load-grid td { padding: var(--sp-1) 2px; text-align: center; border-top: 1px solid var(--divider); }
.load-grid thead th {
  position: sticky; top: 0; padding: var(--sp-1-5) 0; border-top: 0; border-bottom: 1px solid var(--rule);
  background: var(--table-head-bg); font-size: var(--fs-11); font-weight: var(--fw-500); color: var(--muted);
}
.load-grid thead th span { display: block; }
.load-grid thead th small { display: block; font-family: var(--mono); font-size: var(--fs-12); font-weight: var(--fw-600); }
.load-grid thead th.off { background: var(--gray-75); color: var(--decor); }
.load-grid thead th.today { background: var(--hue-work-soft); color: var(--hue-work); font-weight: var(--fw-700); }
.load-grid thead th.load-person-col, .load-grid thead th.load-total-head { font-size: var(--fs-12); padding: var(--sp-2) var(--sp-3); }
.load-grid thead th.load-total-head { text-align: right; padding-right: var(--sp-2-5); }
.load-grid tbody tr:first-child > * { border-top: 0; }
.load-grid td.off { background: var(--gray-25); }
.load-grid td.today { background: var(--today-col); }
.load-grid td.away { background: var(--gray-25); }
.load-person-col {
  position: sticky; left: 0; z-index: 1; min-width: 0; text-align: left !important;
  padding: var(--sp-2) var(--sp-3) !important; background: var(--surface);
}
.load-grid thead .load-person-col { z-index: 2; background: var(--table-head-bg); }
.load-person-col strong { display: block; font-weight: var(--fw-600); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.load-person-col small { display: block; font-size: 11.5px; color: var(--muted); font-weight: var(--fw-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.load-person-col small.warn { color: var(--warn); }
.load-total { font-family: var(--mono); font-size: var(--fs-12); font-weight: var(--fw-600); font-variant-numeric: tabular-nums; text-align: right !important; padding: 0 var(--sp-2-5) !important; white-space: nowrap; }
.load-off, .load-away { font-size: 10.5px; color: var(--decor); }
.load-away { color: var(--muted); }
.load-cell {
  position: relative; width: 100%; max-width: 52px; height: 32px; box-sizing: border-box; cursor: pointer;
  border: 1px solid transparent; border-radius: var(--radius-sm); color: var(--ink); white-space: nowrap;
  font-family: var(--mono); font-size: 11.5px; font-weight: var(--fw-600); font-variant-numeric: tabular-nums;
}
.load-cell:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.load-cell[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.load-body [data-level="1"] { background: var(--load-1); border: 1px solid var(--load-1-line); }
.load-body [data-level="2"] { background: var(--load-2); border: 1px solid var(--load-2-line); }
.load-body [data-level="3"] { background: var(--load-3); border: 1px solid var(--load-3-line); }
.load-body [data-level="over"] { background: var(--danger-soft); border: 1.5px solid var(--danger); color: var(--danger); }
.load-body [data-level="u"] {
  background: repeating-linear-gradient(135deg, var(--chip-bg) 0 4px, var(--surface) 4px 8px); border: 1px solid var(--hatch-line); color: var(--ink-2);
}
.load-legend .load-swatch[data-level="u"] { background: repeating-linear-gradient(135deg, var(--chip-bg) 0 3px, var(--surface) 3px 6px); }
.load-over-mark {
  display: inline-grid; place-items: center; width: 14px; height: 14px; border-radius: 50%;
  background: var(--danger); color: var(--ink-inverse); font-family: var(--mono); font-size: 9px; font-weight: var(--fw-700); line-height: 1;
}
.load-cell .load-over-mark { position: absolute; top: -5px; right: -5px; }
tr.unassigned th strong { color: var(--ink-2); }
.load-group-head th {
  text-align: left !important; padding: var(--sp-1-5) var(--sp-3) !important; background: var(--gray-25);
  font-size: var(--fs-10-5); font-weight: var(--fw-600); text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
}
.load-mono { font-family: var(--mono); font-size: var(--fs-12); font-variant-numeric: tabular-nums; }
.load-mono.strong { font-weight: var(--fw-600); white-space: nowrap; }

.load-detail:empty { display: none; }
.load-detail { border: 1px solid var(--ink); border-radius: var(--radius-panel); overflow: hidden; }
.load-detail-head {
  display: flex; align-items: center; gap: var(--sp-2-5); padding: var(--sp-2-5) 14px;
  background: var(--table-head-bg); border-bottom: 1px solid var(--rule);
}
.load-detail-head h3 { margin: 0; font-size: var(--fs-13); font-weight: var(--fw-600); }
.load-detail-hours { font-family: var(--mono); font-size: var(--fs-12); font-weight: var(--fw-600); color: var(--ink-2); }
.load-detail-hours.over { color: var(--danger); }
.load-detail-close {
  margin-left: auto; width: 28px; height: 28px; flex: none; cursor: pointer;
  border: 1px solid var(--button-border); border-radius: var(--radius-sm); background: var(--surface); font: inherit; color: var(--ink);
}
.load-detail ul, .load-risks ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.load-detail li, .load-risks li {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2) 14px; padding: var(--sp-2-5) 14px; border-top: 1px solid var(--divider);
}
.load-detail li:first-child, .load-risks li:first-child { border-top: 0; }
.load-detail li.overdue { background: var(--danger-soft); }
.load-item-main { flex: 1 1 260px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.load-item-main b { font-weight: var(--fw-600); }
.load-item-main small { font-size: var(--fs-12); color: var(--muted); }
.load-detail li.overdue .load-item-main small { color: var(--danger); }
.load-detail li.risk .load-item-main small { color: var(--warn); }
.load-detail li button.ghost, .load-risks li button.ghost { min-height: 30px; font-size: var(--fs-12-5); }

.load-risks { display: flex; flex-direction: column; gap: var(--sp-2); }
.load-risks h2 { margin: 0; font-size: var(--fs-17); font-weight: var(--fw-600); }
.load-risks ul { border: 1px solid var(--rule); border-radius: var(--radius-panel); overflow: hidden; }
.load-risks li.overdue { background: var(--danger-soft); }
.load-risks li.risk { background: var(--warn-soft); }
.load-risks .load-item-main small { color: var(--ink-2); }
.load-pill {
  flex: none; padding: 2px var(--sp-2); border-radius: var(--radius-pill); background: var(--surface);
  border: 1px solid currentColor; font-size: var(--fs-12); font-weight: var(--fw-600);
}
.load-risks li.overdue .load-pill { color: var(--danger); }
.load-risks li.risk .load-pill { color: var(--warn); }
.load-risk-dates { font-size: var(--fs-12-5); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.load-calm { margin: 0; padding: var(--sp-3) 14px; border-radius: var(--radius-card); background: var(--ok-soft); color: var(--ok); font-weight: var(--fw-500); }
.load-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: 48px var(--sp-5); text-align: center;
  border: 1px solid var(--rule); border-radius: var(--radius-panel); background: var(--gray-25);
}
.load-empty strong { font-size: var(--fs-17); font-weight: var(--fw-600); }
.load-empty span { max-width: 460px; color: var(--muted); }
.load-skeleton { height: 320px; border-radius: var(--radius-panel); background: var(--fill-soft); }
.load-error {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-5);
  border: 1px solid var(--danger-line); border-radius: var(--radius-panel); background: var(--danger-soft);
}
.load-error p { flex: 1 1 280px; margin: 0; color: var(--ink-2); }
.load-error b { color: var(--danger); font-weight: var(--fw-600); }
@media (max-width: 37.5rem) {
  .load-grid col.load-person { width: 150px; }
}

/* ---- Нагрузка → люди и смены (у техника — Календарь → мои смены) ------------------------------------------------ */
.sched-bar { flex-wrap: wrap; gap: .5rem .8rem; }
.sched-bar h2 { text-transform: none; }
.sched-bar h2::first-letter { text-transform: uppercase; }
.sched-modes { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 2px; border-radius: 10px; background: var(--gray-100); }
.sched-modes button { border: 0; background: transparent; padding: .3rem .8rem; border-radius: 8px; font: inherit; font-size: .85rem; color: var(--ink-2); cursor: pointer; }
.sched-modes button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-tab); }
.sched-modes button:focus-visible, .sched-chip:focus-visible, .sched-work:focus-visible, .sched-date:focus-visible, .sched-more:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#sched-who { max-width: 14rem; }
.sched-body { display: grid; gap: .8rem; min-width: 0; }

.sched-chip {
  width: 100%; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0 .3rem;
  padding: .3rem .45rem; border: 0; border-radius: 8px; cursor: pointer; font: inherit; text-align: left; color: var(--ink);
}
.sched-chip b { font-size: .8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sched-chip small { grid-column: 1 / -1; font-size: .72rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-chip .load-over-mark { grid-row: 1; }
.sched-chip.compact { display: flex; gap: .3rem; padding: .15rem .4rem; font-size: .74rem; }
.sched-chip-who { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-chip[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--accent); }
.sched-week td { vertical-align: top; }
.sched-week td.past { background: var(--gray-50); }
.sched-week th.today, .sched-week td.today { background: color-mix(in srgb, var(--info) 6%, var(--surface)); }
.sched-week th.today small { color: var(--info); font-weight: 700; }

.sched-pop {
  position: fixed; z-index: 60; width: min(24rem, calc(100vw - 16px)); max-height: min(24rem, 70vh); overflow: auto;
  padding: .6rem; border-radius: 12px; border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--shadow-toast);
}
.sched-pop header { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .6rem; padding: .1rem .3rem .45rem; border-bottom: 1px solid var(--divider); margin-bottom: .4rem; }
.sched-pop header small { color: var(--muted); }
.sched-pop-list, .sched-list { display: grid; gap: .3rem; }
.sched-work {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem; align-items: center; width: 100%;
  padding: .45rem .6rem; border: 1px solid transparent; border-radius: 10px; background: var(--gray-50); cursor: pointer; font: inherit; text-align: left; color: var(--ink);
}
.sched-work:hover { border-color: var(--rule-strong); background: var(--surface); }
.sched-work-main { display: grid; min-width: 0; }
.sched-work-main strong { font-size: .88rem; text-decoration: underline; text-decoration-color: var(--rule-strong); text-underline-offset: 2px; }
.sched-work-main small, .sched-work-side small { color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-work-side { display: grid; justify-items: end; }
.sched-work-side b { font-variant-numeric: tabular-nums; font-size: .85rem; }
.sched-work-side em { font-style: normal; font-size: .72rem; font-weight: 600; color: var(--warn); }
.sched-work.overdue { background: var(--danger-soft); }
.sched-work.overdue em { color: var(--danger); }
.sched-work.risk { background: var(--warn-soft); }

.sched-day { display: grid; gap: 1rem; }
.sched-cols-box { display: grid; gap: .5rem; padding: .9rem 1rem 1rem; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); min-width: 0; }
.sched-cols-box h3 { margin: 0; font-size: .95rem; }
.sched-cols-wrap { overflow-x: auto; padding-bottom: .2rem; }
.sched-cols { position: relative; display: flex; align-items: flex-end; gap: .7rem; padding-left: 2.6rem; min-width: min-content; }
.sched-axis { position: absolute; left: 0; bottom: 2.9rem; height: var(--plot); width: 100%; pointer-events: none; }
.sched-axis span { position: absolute; left: 0; right: 0; transform: translateY(50%); font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sched-axis span::after { content: ""; position: absolute; left: 2.4rem; right: 0; top: 50%; border-top: 1px solid var(--divider); }
.sched-col { position: relative; display: grid; gap: .3rem; width: 6.8rem; flex: 0 0 auto; }
.sched-col-total { display: flex; align-items: baseline; justify-content: center; gap: .2rem; font-size: .8rem; font-variant-numeric: tabular-nums; min-height: 1.3rem; }
.sched-col-total small { color: var(--muted); }
.sched-col-total .sched-over { color: var(--danger); font-weight: 700; }
.sched-col[data-level="over"] .sched-col-total b { color: var(--danger); }
.sched-stack { position: relative; border-radius: 8px 8px 0 0; background: linear-gradient(to top, var(--gray-50), transparent); border-bottom: 2px solid var(--rule-strong); }
.sched-bars { position: absolute; left: 12%; right: 12%; bottom: 0; display: flex; flex-direction: column-reverse; gap: 2px; }
.sched-seg {
  display: flex; align-items: center; justify-content: center; min-height: 4px; padding: 0 .25rem; border: 0; cursor: pointer; overflow: hidden;
  border-radius: 4px; font: inherit; font-size: .7rem; line-height: 1.1; color: var(--ink); text-align: center;
  background: color-mix(in srgb, var(--info) 38%, var(--surface));
}
.sched-bars .sched-seg:last-child { border-radius: 6px 6px 4px 4px; }
.sched-seg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-seg:hover, .sched-seg[aria-expanded="true"] { background: color-mix(in srgb, var(--info) 60%, var(--surface)); }
.sched-seg:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sched-col[data-level="over"] .sched-seg { background: color-mix(in srgb, var(--danger) 30%, var(--surface)); }
.sched-col[data-level="u"] .sched-seg { background: repeating-linear-gradient(45deg, var(--gray-200) 0 4px, var(--surface) 4px 8px); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.sched-seg.overdue { box-shadow: inset 3px 0 0 var(--danger); }
.sched-seg.risk { box-shadow: inset 3px 0 0 var(--warn); }
.sched-cap { position: absolute; left: 0; right: 0; z-index: 1; border-top: 2px dashed var(--ink-2); pointer-events: none; }
.sched-empty-col { position: absolute; bottom: .4rem; left: 0; right: 0; text-align: center; font-size: .72rem; color: var(--muted); }
.sched-col-name { display: grid; text-align: center; min-height: 2.6rem; }
.sched-col-name strong { font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-col-name small { font-size: .7rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sched-key { display: inline-block; width: 1.1rem; height: .8rem; border-radius: 3px; }
.sched-key.seg { background: color-mix(in srgb, var(--info) 38%, var(--surface)); }
.sched-key.late { background: color-mix(in srgb, var(--info) 38%, var(--surface)); box-shadow: inset 3px 0 0 var(--danger); }
.sched-key.cap { height: 0; border-top: 2px dashed var(--ink-2); border-radius: 0; }
.sched-key.over { background: color-mix(in srgb, var(--danger) 30%, var(--surface)); }
.sched-free { margin: 0; color: var(--muted); font-size: .85rem; }
.sched-group-head th { text-align: left !important; padding: .5rem .7rem !important; background: var(--gray-50); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.sched-week tr.shop th strong::before { content: "◼ "; color: var(--ink-2); font-size: .7rem; }
.sched-month-who { margin: 0; }
.sched-month-who small { color: var(--muted); }

.sched-month { display: grid; gap: 1px; border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; background: var(--rule); }
.sched-month-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; }
.sched-month-row.head div { padding: .35rem .5rem; background: var(--gray-50); font-size: .72rem; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.sched-mday { display: grid; align-content: start; gap: 3px; min-height: 6.5rem; padding: .3rem; background: var(--surface); min-width: 0; }
.sched-mday.other { background: var(--gray-50); }
.sched-mday.other .sched-date { color: var(--faint, var(--muted)); }
.sched-mday.off { background: repeating-linear-gradient(135deg, var(--gray-50) 0 6px, var(--surface) 6px 12px); }
.sched-mday.today .sched-date { background: var(--ink); color: var(--surface); }
.sched-date { justify-self: start; min-width: 1.7rem; height: 1.7rem; border: 0; border-radius: 999px; background: transparent; font: inherit; font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; color: var(--ink); }
.sched-date:hover { background: var(--gray-100); }
.sched-more { justify-self: start; border: 0; background: transparent; padding: 0 .3rem; font: inherit; font-size: .74rem; color: var(--info); cursor: pointer; text-decoration: underline; }
@media (max-width: 720px) {
  .sched-mday { min-height: 4.2rem; padding: 2px; }
  .sched-chip.compact .sched-chip-who { display: none; }
  .sched-chip.compact, .sched-mday .sched-chip { padding: .1rem .2rem; }
  .sched-mday .sched-chip small { display: none; }
  #sched-who { max-width: 100%; flex: 1 1 100%; }
}

/* ---- Входящие работы -------------------------------------------------------- */
.inc-bar { flex-wrap: wrap; gap: .5rem .8rem; }
.inc-custom { display: inline-flex; align-items: center; gap: .4rem; }
.inc-custom[hidden] { display: none; }
.inc-body { display: grid; gap: 1rem; min-width: 0; }
.inc-kpi small { color: var(--muted); font-size: .75rem; }
.inc-delta { font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inc-delta.up { color: var(--ok); }
.inc-delta.down { color: var(--danger); }
.inc-delta.flat { color: var(--muted); }
.inc-chart { position: relative; display: grid; gap: .6rem; padding: .9rem 1rem 1rem; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); min-width: 0; }
.inc-chart h2, .inc-table-head h2, .inc-silent h2 { margin: 0; font-size: 1rem; }
.inc-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .8rem; color: var(--ink-2); }
.inc-swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 3px; margin-right: .35rem; vertical-align: -1px; }
.inc-cols-wrap { overflow-x: auto; }
.inc-cols { position: relative; display: flex; align-items: flex-end; gap: .4rem; padding-left: 2.2rem; min-width: min-content; }
.inc-axis { bottom: 1.5rem; height: var(--plot); }
.inc-axis span::after { left: 2rem; }
.inc-col { display: grid; gap: .25rem; justify-items: center; flex: 1 0 2.6rem; max-width: 5.5rem; border-radius: 6px; outline: none; }
.inc-col:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.inc-col b { font-size: .75rem; font-variant-numeric: tabular-nums; min-height: 1rem; }
.inc-col small { font-size: .7rem; color: var(--muted); white-space: nowrap; min-height: 1.2rem; }
.inc-stack { position: relative; width: 100%; border-bottom: 2px solid var(--rule-strong); }
.inc-bars { position: absolute; left: 18%; right: 18%; bottom: 0; display: flex; flex-direction: column-reverse; gap: 2px; }
.inc-bars i { display: block; border-radius: 2px; }
.inc-bars i:last-child { border-radius: 4px 4px 2px 2px; }
.inc-col:hover .inc-bars i, .inc-col:focus-visible .inc-bars i { filter: brightness(.92); }
.inc-tip { position: absolute; z-index: 5; display: grid; gap: .2rem; min-width: 12rem; padding: .5rem .7rem; border-radius: 10px; border: 1px solid var(--rule); background: var(--surface); box-shadow: var(--shadow-toast); font-size: .8rem; pointer-events: none; }
.inc-tip span { display: flex; align-items: center; gap: .1rem; }
.inc-tip span b { margin-left: auto; padding-left: .8rem; font-variant-numeric: tabular-nums; }
.inc-table-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.inc-table-wrap { max-width: 100%; overflow-x: auto; border: 1px solid var(--rule); border-radius: 14px; background: var(--surface); }
.inc-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.inc-table th, .inc-table td { padding: .5rem .7rem; border-bottom: 1px solid var(--divider); text-align: left; vertical-align: middle; }
.inc-table thead th { background: var(--gray-50); font-size: .75rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.inc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.inc-table tbody th { font-weight: 500; background: transparent; }
.inc-kpi strong { white-space: nowrap; font-size: 1.45rem; }
.inc-table tbody th small { display: block; color: var(--muted); font-weight: 400; font-size: .75rem; padding-left: 1.3rem; }
.inc-toggle { display: inline-flex; align-items: center; gap: .35rem; border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; }
.inc-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.inc-caret { width: 1rem; color: var(--muted); }
.inc-badge { display: inline-block; margin-left: .4rem; padding: 0 .4rem; border-radius: 999px; font-style: normal; font-size: .7rem; font-weight: 600; background: var(--ok-soft); color: var(--ok); }
.inc-badge.quiet { background: var(--warn-soft); color: var(--warn); }
.inc-share-cell { display: flex; align-items: center; gap: .5rem; min-width: 9rem; }
.inc-share-cell > span:last-child { font-variant-numeric: tabular-nums; font-size: .8rem; color: var(--ink-2); min-width: 2.6rem; }
.inc-share { display: block; flex: 1; height: 8px; min-width: 4rem; border-radius: 4px; background: var(--gray-100); overflow: hidden; }
.inc-share i { display: block; height: 100%; border-radius: 4px; background: #2a78d6; }
.inc-detail-row > td { background: var(--gray-50); padding: .6rem .8rem .8rem 2rem; }
.inc-detail { display: grid; gap: .5rem; }
.inc-table.inner { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; }
.inc-works { margin: 0; font-size: .82rem; color: var(--ink-2); }
.inc-silent { display: grid; gap: .4rem; padding: .8rem 1rem; border: 1px solid var(--rule); border-radius: 14px; background: var(--warn-soft); }
.inc-silent p { margin: 0; }
.inc-silent ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.inc-silent li { display: flex; flex-wrap: wrap; gap: .2rem .8rem; align-items: baseline; padding: .4rem .6rem; border-radius: 10px; background: var(--surface); }
.inc-silent li small { margin-left: auto; color: var(--muted); }

/* ---- Графики и отсутствия ---------------------------------------------------- */
.sched-away { display: inline-block; margin: 0 0 3px; padding: 0 .4rem; border-radius: 999px; font-size: .7rem; font-weight: 600; background: var(--violet-soft, var(--gray-100)); color: var(--violet, var(--ink-2)); white-space: nowrap; }
.sched-away[data-kind="sick"] { background: var(--danger-soft); color: var(--danger); }
.sched-week td.away, .sched-mday.away { background: repeating-linear-gradient(135deg, var(--gray-50) 0 5px, var(--surface) 5px 10px); }
.sched-col.away .sched-stack { background: repeating-linear-gradient(135deg, var(--gray-100) 0 6px, var(--surface) 6px 12px); }
.sched-stack > .sched-away { position: absolute; top: .3rem; left: 50%; transform: translateX(-50%); }
.load-grid td.away { background: repeating-linear-gradient(135deg, var(--gray-100) 0 5px, var(--surface) 5px 10px); }
.load-away { font-size: .68rem; font-weight: 600; color: var(--ink-2); }
.people-head { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.people-head h2 { margin: 0; font-size: 1.05rem; }
.people-head p { margin: .2rem 0 0; }
.people-list { display: grid; gap: .6rem; }
.people-table tbody th small { padding-left: 0; }
.people-sched { font-weight: 600; }
.people-sched.default { font-weight: 400; color: var(--muted); }
.people-here { color: var(--ok); font-weight: 600; font-size: .82rem; }
.people-away { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--warn-soft); color: var(--warn); }
.people-abs { display: flex; flex-wrap: wrap; gap: .3rem; }
.people-abs-chip { display: inline-flex; align-items: center; gap: .2rem; padding: .1rem .2rem .1rem .55rem; border-radius: 999px; background: var(--gray-100); font-size: .78rem; white-space: nowrap; }
.people-abs-chip[data-kind="sick"] { background: var(--danger-soft); }
.people-abs-chip small { color: var(--muted); max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }
.people-abs-x { border: 0; background: transparent; width: 1.4rem; height: 1.4rem; border-radius: 50%; cursor: pointer; font: inherit; font-size: .95rem; color: var(--ink-2); }
.people-abs-x:hover { background: var(--surface); color: var(--danger); }
.people-abs-x:focus-visible { outline: 2px solid var(--accent); }
.people-actions { white-space: nowrap; text-align: right !important; }
.people-actions button + button { margin-left: .3rem; }
.people-dialog form { display: grid; gap: .8rem; min-width: min(34rem, 86vw); }
.people-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: .5rem; }
.people-kind { display: flex; gap: .5rem; align-items: flex-start; padding: .6rem .7rem; border: 1px solid var(--rule); border-radius: 12px; cursor: pointer; }
.people-kind:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.people-kind input { width: auto; flex: 0 0 auto; margin: .2rem 0 0; }
.people-kind span { display: grid; }
.people-kind small { color: var(--muted); font-size: .75rem; }
.people-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .4rem; }
.people-week label { display: grid; gap: .2rem; text-align: center; font-size: .78rem; color: var(--ink-2); }
.people-week input { width: 100%; text-align: center; }
.people-cycle, .people-dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; }
