/* Layout and components. Colors and fonts come only from tokens in brand/brand.css (docs/brand.md). */

:root {
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  /* Страница — 1440 px по центру; шапка и плашки держат те же края, что содержимое. */
  --page: 1440px;
  --gutter: max(var(--s6), calc((100% - var(--page)) / 2 + var(--s6)));

  /* Four type styles (docs/style.md): large, heading, text, small. */
  --t-large: 32px;
  --t-head: 20px;
  --t-text: 16px;
  --t-small: 13px;
  --radius: 6px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-text);
  font-weight: 400;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

a { color: inherit; text-decoration-color: var(--text-faint); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

h1, h2 { font-weight: 600; line-height: 1.2; margin: 0; }
h1 { font-size: var(--t-large); }
h2 { font-size: var(--t-head); margin-bottom: var(--s3); }

small { display: block; font-size: var(--t-small); color: var(--text-muted); }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--s4); top: var(--s4); background: var(--surface); padding: var(--s2) var(--s3); z-index: 10; }

/* --- Header ------------------------------------------------------------------------------------------------- */

.top {
  display: flex;
  align-items: center;
  gap: var(--s5);
  padding: 0 var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}

.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; }
.brand img { display: block; height: 64px; width: auto; }
.wordmark {
  display: block;
  font-family: var(--font-wordmark);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 2px;
  line-height: 1;
  color: var(--wordmark);
}
.brand small { margin-top: 2px; }

.tabs { display: flex; gap: var(--s5); align-self: stretch; }
.tabs a {
  display: flex;
  align-items: center;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  padding-top: 3px;
}
.tabs a[aria-current="page"] { border-bottom-color: var(--brand); font-weight: 600; }

.tools { margin-left: auto; display: flex; align-items: center; gap: var(--s4); }

.theme-switch { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.theme-switch button {
  font: inherit;
  font-size: var(--t-small);
  padding: var(--s1) var(--s3);
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.theme-switch button[aria-pressed="true"] { background: var(--bg); color: var(--text); font-weight: 600; }

button.link { font: inherit; background: none; border: 0; padding: 0; color: var(--text-muted); cursor: pointer; text-decoration: underline; }

.demo-note {
  margin: 0;
  padding: var(--s3) var(--gutter);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  font-size: var(--t-small);
  color: var(--text-muted);
}
.demo-note b { color: var(--text); font-weight: 600; }

/* --- Page --------------------------------------------------------------------------------------------------- */

main { padding: var(--s6); max-width: var(--page); margin: 0 auto; }

.page-head { display: flex; align-items: center; gap: var(--s3); }
.lead { margin: var(--s2) 0 0; color: var(--text-muted); max-width: 72ch; }
.card .lead { margin: 0 0 var(--s4); }
.source { margin: var(--s1) 0 var(--s5); font-size: var(--t-small); color: var(--text-muted); }
.card .source:last-child { margin-bottom: 0; }
.back { margin: 0 0 var(--s3); font-size: var(--t-small); }
.muted { color: var(--text-muted); }
.danger { color: var(--danger); }
.empty { color: var(--text-muted); }

.info { position: relative; }
.info summary {
  list-style: none;
  cursor: pointer;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: var(--t-small);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
}
.info summary::-webkit-details-marker { display: none; }
.info-body {
  position: absolute;
  z-index: 5;
  top: 32px;
  left: 0;
  width: min(560px, calc(100vw - 32px));
  padding: var(--s4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
  font-size: var(--t-small);
}
.info-body p { margin: 0 0 var(--s2); }
.info-body p:last-child { margin: 0; }

/* Main figures in a row */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s3);
  margin-bottom: var(--s5);
}
.stat {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding: var(--s4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-label, .stat-sub { font-size: var(--t-small); color: var(--text-muted); }
.stat-value { font-size: var(--t-head); font-weight: 600; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s5);
  margin-bottom: var(--s5);
}

.cols { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 0 var(--s5); align-items: start; }

/* Notes: what is wrong, by how much, what to do. Always with ⚠ and words, never color alone. */
.notes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.note { display: flex; gap: var(--s2); align-items: baseline; margin: 0; color: var(--text); }
.note.danger > span { color: var(--danger); }
.note.warn > span { color: var(--warn); }
.fix { display: block; font-size: var(--t-small); color: var(--text-muted); }

.tag { display: block; white-space: nowrap; font-size: var(--t-small); }
.tag.danger { color: var(--danger); }
.tag.warn { color: var(--warn); }

/* --- Forms -------------------------------------------------------------------------------------------------- */

.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s3) var(--s4); margin-bottom: var(--s4); }
.filters label { display: flex; flex-direction: column; gap: var(--s1); font-size: var(--t-small); color: var(--text-muted); }
.filters > a { display: inline-flex; align-items: center; height: 48px; }  /* «Сбросить» — по середине полей */

/* Поля, выпадающие списки и кнопки — одной высоты и одним шрифтом, где бы ни стояли: подпись фильтра мелкая, но поле
   её размер не наследует. Список рисуем сами (стрелка — два треугольника градиентом), иначе браузер даёт ему свою
   высоту и свой шрифт. */
select, input[type="password"], input[type="text"], input[type="date"], input[type="number"], input[type="search"] {
  box-sizing: border-box;
  height: 48px;
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-text);
  font-weight: 400;
  line-height: 1.2;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 var(--s3);
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%),
                    linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}
input::placeholder { color: var(--text-faint); opacity: 1; }

.btn, .btn-quiet {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  margin: 0;
  font-family: var(--font);
  font-size: var(--t-text);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  padding: 0 var(--s5);
  border-radius: var(--radius);
  cursor: pointer;
}
.btn { background: var(--brand); color: var(--on-brand); border: 0; }
.btn:hover { background: var(--brand-light); }
.btn-quiet { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

.login { max-width: 400px; margin: var(--s6) auto; display: grid; gap: var(--s3); }
.login .lead { margin: 0; }
.login label { font-size: var(--t-small); color: var(--text-muted); }
.login .source { margin: 0; }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s3) var(--s4); margin-bottom: var(--s3); }
.fields label { display: flex; flex-direction: column; gap: var(--s1); font-size: var(--t-small); color: var(--text-muted); }
form.inline { display: flex; gap: var(--s2); align-items: center; }
form.inline input { width: 180px; }

.flash { padding: var(--s3) var(--s4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); margin: 0 0 var(--s5); }
.flash.err > span { color: var(--danger); }
.me { font-size: var(--t-small); }
code { font-size: var(--t-small); background: var(--bg); padding: 2px var(--s1); border-radius: 4px; }

/* --- Ввод рейса (entry.html) ------------------------------------------------------------------------------ */

.entry { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s5); align-items: start; }
.entry-side { position: sticky; top: var(--s4); }
.step h2 { display: flex; align-items: center; gap: var(--s3); }
.step-n {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); font-size: var(--t-small); font-weight: 600; color: var(--text-muted);
}
.step h3 { font-size: var(--t-text); font-weight: 600; margin: var(--s4) 0 var(--s2); }
.row { display: grid; gap: var(--s3) var(--s4); margin-bottom: var(--s3); }
.row.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row.r4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.f { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.f-label { font-size: var(--t-small); color: var(--text-muted); }
.unit { color: var(--text-faint); }
.f input { width: 100%; }
.f input[inputmode="decimal"] { text-align: right; font-variant-numeric: tabular-nums; }
.f-hint { font-size: var(--t-small); color: var(--text-faint); }
.f-err { font-size: var(--t-small); color: var(--danger); margin: 0; }
.f.invalid input { border-color: var(--danger); }
.entry input:focus-visible, .entry select:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.tick { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; cursor: pointer; }
.tick input { width: 20px; height: 20px; accent-color: var(--text); margin: 0; }
.seg-f { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.seg { display: flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; min-height: 48px; }
.seg label { flex: 1; display: flex; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  flex: 1; display: grid; place-items: center; padding: 0 var(--s3); cursor: pointer; text-align: center;
  color: var(--text-muted); background: var(--surface);
}
.seg label + label span { border-left: 1px solid var(--border); }
.seg input:checked + span { background: var(--bg); color: var(--text); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--text); outline-offset: -2px; }
.truck { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s3) var(--s4) var(--s1); margin: 0 0 var(--s4); }
.truck legend { display: flex; gap: var(--s4); align-items: baseline; padding: 0 var(--s2); font-weight: 600; }
.truck legend .link { font-weight: 400; font-size: var(--t-small); }
.truck .hired-only { display: none; }
.truck.is-hired .hired-only { display: grid; }
.truck.is-hired .own-only { display: none; }
.line { display: grid; grid-template-columns: 200px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; margin-bottom: var(--s3); }
.line .link { font-size: var(--t-small); padding-top: var(--s5); }
.summary { display: flex; flex-direction: column; gap: var(--s1); margin: 0; }
.sum-profit { font-size: var(--t-large); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.15; }
.estimate { font-style: normal; border-left: 2px solid var(--border); padding-left: var(--s2); margin-top: var(--s1); }
.sum-table { margin: var(--s3) 0 var(--s2); }
.sum-table th, .sum-table td { padding: var(--s2) 0; }
.sum-pairs { font-size: var(--t-small); margin-bottom: var(--s2); }
.checks { margin: var(--s2) 0; display: grid; gap: var(--s2); font-size: var(--t-small); }
.checks .notes { gap: var(--s2); }
.checks .source { margin: 0; }
.ok-line { margin: 0; }
.confirm { font-size: var(--t-small); }
.save { width: 100%; margin-top: var(--s2); }
.page-head .btn, .page-head .edit { margin-left: auto; display: inline-flex; align-items: center; text-decoration: none; }
.head-actions { margin-left: auto; display: flex; gap: var(--s3); }
.head-actions .btn, .head-actions .btn-quiet { margin-left: 0; display: inline-flex; align-items: center; text-decoration: none; }

/* --- Tables ------------------------------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: var(--s2) var(--s3); text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
thead th { font-size: var(--t-small); font-weight: 400; color: var(--text-muted); vertical-align: bottom; }
tfoot td, tfoot th { font-weight: 600; border-bottom: 0; }
.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.trips { min-width: 1280px; }
table.trips th, table.trips td { padding-left: var(--s2); padding-right: var(--s2); }
table.trips td { white-space: nowrap; }
table.trips td.wrap { white-space: normal; min-width: 150px; }
table.trips thead th { white-space: normal; min-width: 64px; }  /* длинные подписи показателей — в две строки */
table.trips thead th.group { text-align: center; color: var(--text); border-bottom-color: var(--text-muted); }  /* «Количество голов» над план / факт / % */
table.trips tbody tr:hover { background: var(--bg); }

table.journal { min-width: 960px; }
table.users { min-width: 960px; }
td.nowrap { white-space: nowrap; }

table.calc th { font-weight: 400; }
table.calc tfoot th { font-weight: 600; }

.big { font-size: var(--t-large); font-weight: 600; margin: 0 0 var(--s2); }

.pairs { display: grid; grid-template-columns: auto 1fr; gap: var(--s2) var(--s5); margin: 0; }
.pairs dt { color: var(--text-muted); }
.pairs dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* --- Tablet and phone --------------------------------------------------------------------------------------- */

@media (max-width: 1100px) {
  .entry { grid-template-columns: 1fr; }
  .entry-side { position: static; }
}

@media (max-width: 900px) {
  .cols { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .top { flex-wrap: wrap; gap: 0 var(--s4); padding: 0 var(--s4) 0 0; }
  .brand img { height: 56px; }
  .tabs { order: 3; width: 100%; padding-left: var(--s4); min-height: 44px; }
  .tools { gap: var(--s3); }
  .brand small { display: none; }
  .demo-note { padding: var(--s3) var(--s4); }
  main { padding: var(--s4); }
  .card { padding: var(--s4); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row.r3, .row.r4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .line { grid-template-columns: minmax(0, 1fr) auto; }
  .line .grow { grid-column: 1 / -1; grid-row: 2; }
}

/* Прикидка: пустое поле — значение из прошлых сделок, оно в подсказке поля бледнее введённого */
.actions { display: flex; align-items: center; gap: var(--s4); }
#estimate input::placeholder { color: var(--text-faint); opacity: 1; }
#estimate + .card { margin-top: var(--s5); }
.basis { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s3) var(--s5); }
.sum-h { font-size: var(--t-small); font-weight: 600; margin: var(--s3) 0 0; }
.sum-table tr.chosen td { font-weight: 600; }
tfoot tr.muted td { color: var(--text-muted); }

/* --- Сделки в работе ------------------------------------------------------------------------------------------ */

/* Вкладки и фильтры списка ведут на #list: страница открывается на списке, а не сверху. */
#list { scroll-margin-top: var(--s6); }

.stage-tabs { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.stage-tabs a {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: var(--s1) var(--s3);
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; font-size: var(--t-small);
}
.stage-tabs a[aria-current="page"] { border-color: var(--text); font-weight: 600; }
.stage-tabs .count { color: var(--text-muted); }

/* Стадия — текстом; рамка различает стадии без цвета. */
.stage {
  display: inline-block; white-space: nowrap;
  font-size: var(--t-small);
  padding: 0 var(--s2);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.stage.s-plan { border-style: dashed; color: var(--text-muted); }
.stage.s-closed { border-color: var(--text); }
.page-head .stage { align-self: center; }

ol.steps { margin: 0; padding-left: var(--s5); display: grid; gap: var(--s3); }
ol.steps li.todo { color: var(--text-muted); }
ol.steps li.todo b { font-weight: 600; }

table.chain tr.k-sum th, table.chain tr.k-sum td,
table.chain tr.k-price th, table.chain tr.k-price td { border-top: 1px solid var(--text-faint); }
table.chain tr.k-result th, table.chain tr.k-result td { font-weight: 600; }

ul.plain { margin: 0; padding-left: var(--s5); display: grid; gap: var(--s1); }

/* --- Бот экспедиторов ---------------------------------------------------------------------------------------- */

.bot { display: grid; grid-template-columns: 240px 1fr; gap: var(--s4); align-items: start; }
.who a[aria-current="page"] { font-weight: 600; }
.messages { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: var(--s2); }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 80%; gap: 2px; }
.msg span {
  white-space: pre-line;
  padding: var(--s2) var(--s3);
  border-radius: var(--radius);
  background: var(--bg);
}
.msg.person { justify-self: end; align-items: flex-end; }
.msg.person span { background: var(--text); color: var(--surface); }
.say { display: flex; gap: var(--s2); margin-bottom: var(--s2); }
.say input[type="text"] { flex: 1; }
@media (max-width: 760px) {
  .bot { grid-template-columns: 1fr; }
  .msg { max-width: 95%; }
}

/* --- Канбан сделок в работе: столбец на стадию, карточка на сделку -------------------------------------------- */

.list-head { display: flex; align-items: center; gap: var(--s4); margin-bottom: var(--s3); }
.list-head h2 { margin: 0; }
.view-switch { margin-left: auto; display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.view-switch a { padding: var(--s1) var(--s3); text-decoration: none; font-size: var(--t-small); color: var(--text-muted); }
.view-switch a + a { border-left: 1px solid var(--border); }
.view-switch a[aria-current="page"] { background: var(--bg); color: var(--text); font-weight: 600; }

.board { display: grid; grid-template-columns: repeat(4, minmax(250px, 1fr)); gap: var(--s3); overflow-x: auto; align-items: start; }
.col { background: var(--bg); border-radius: var(--radius); padding: var(--s3); min-width: 0; }
.col h3 { display: flex; gap: var(--s2); align-items: baseline; margin: 0; font-size: var(--t-text); font-weight: 600; }
.col h3 .count { color: var(--text-muted); font-weight: 400; }
.col-sum { margin: var(--s1) 0 var(--s3); font-size: var(--t-small); color: var(--text-muted); }
.cards { list-style: none; margin: 0; padding: 0 2px 2px 0; display: grid; gap: var(--s2); max-height: 75vh; overflow-y: auto; }
.cards .empty { font-size: var(--t-small); }
/* Цвет края — только в помощь: что не так, написано тегом внизу карточки. */
.kcard {
  position: relative;
  display: grid; gap: 2px;
  padding: var(--s2) var(--s3);
  background: var(--surface);
  border: 1px solid var(--border); border-left: 3px solid var(--border); border-radius: var(--radius);
  font-size: var(--t-small);
}
.kcard.k-danger { border-left-color: var(--danger); }
.kcard.k-warn { border-left-color: var(--warn); }
.kcard:hover { border-color: var(--text-faint); }
.k-farm { font-size: var(--t-text); font-weight: 600; text-decoration: none; }
.k-farm::after { content: ""; position: absolute; inset: 0; }   /* вся карточка — ссылка на сделку */
.k-money { display: flex; justify-content: space-between; gap: var(--s2); font-variant-numeric: tabular-nums; }
.k-tags { display: flex; flex-wrap: wrap; gap: 0 var(--s2); margin-top: var(--s1); }
.k-tags .tag { display: inline-block; }
@media (max-width: 760px) {
  .board { grid-template-columns: repeat(4, 85%); }
  .cards { max-height: none; }
}

/* --- Процесс закупки (CJM): столбец — этап, строка — что о нём известно --------------------------------------- */

.cjm-path { list-style: none; margin: 0 0 var(--s4); padding: 0; display: flex; flex-wrap: wrap; gap: var(--s1); }
.cjm-path a {
  display: inline-flex; align-items: center; gap: var(--s1);
  padding: var(--s1) var(--s4) var(--s1) var(--s3);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: var(--t-small); text-decoration: none;
}
.cjm-path .n, .cjm .n { font-variant-numeric: tabular-nums; color: var(--text-muted); }

.cjm-wrap { overflow-x: auto; margin-bottom: var(--s5); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.cjm { border-collapse: separate; border-spacing: 0; min-width: 2700px; }
.cjm th, .cjm td { vertical-align: top; text-align: left; padding: var(--s2) var(--s3); width: 255px; font-size: var(--t-small); line-height: 1.4; }
.cjm td { border-top: 1px solid var(--border); }
.cjm td + td { border-left: 1px dashed var(--border); }
.cjm .lane {
  position: sticky; left: 0; z-index: 1;
  width: 130px; min-width: 130px;
  background: var(--surface); color: var(--text-muted); font-weight: 600;
  border-right: 1px solid var(--border);
}
.cjm thead .lane { z-index: 2; }
.cjm tr.phases th:not(.lane) {
  font-size: var(--t-small); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-muted); border-bottom: 2px solid var(--text-faint);
}
.cjm tr.phases th + th:not(.lane) { border-left: 1px solid var(--border); }
.cjm tr.stages th:not(.lane) { padding: var(--s2) 0 var(--s2) var(--s1); scroll-margin-left: 150px; }
/* Этапы — стрелки-шевроны одна за другой: главный путь слева направо. */
.chev {
  display: flex; align-items: center; gap: var(--s1); min-height: 52px;
  padding: var(--s1) var(--s5) var(--s1) var(--s4);
  background: var(--text); color: var(--surface);
  font-size: var(--t-text); font-weight: 600; line-height: 1.2;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%);
}
.chev .n { color: var(--surface); opacity: 0.7; }
.cjm tr.stages th:target .chev { background: var(--brand); color: var(--on-brand); }
.cjm .lane-what td { font-size: var(--t-text); }
.cjm .lane-site a { font-weight: 600; }
.status {
  display: inline-block; margin-top: var(--s1); padding: 0 var(--s2);
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text-muted); white-space: nowrap;
}
.status.st-done { border-color: var(--text); color: var(--text); }
.status.st-wait, .status.st-later { border-style: dashed; }
.now { display: block; margin-top: var(--s1); }
.fork { display: grid; gap: 2px; padding: var(--s2); border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); }
.fork + .fork { margin-top: var(--s2); }
.fork .mark {
  display: inline-block; min-width: 30px; margin-right: var(--s1); text-align: center;
  border-radius: var(--radius); font-weight: 600; font-size: 12px;
}
.fork .yes .mark { border: 1px solid var(--text-faint); }
.fork .no .mark { background: var(--text); color: var(--surface); }
.cjm .lane-pain td { color: var(--text); }

/* Схема пути: SVG, цвета — токены бренда, поэтому одинаково читается в светлой и тёмной теме. */
.flow-wrap { overflow-x: auto; }
.flow { display: block; width: 100%; min-width: 900px; height: auto; font-family: var(--font); }
.flow .node rect { fill: var(--surface); stroke: var(--text); stroke-width: 1.5; }
.flow .node:hover rect { fill: var(--bg); }
.flow .node .t { fill: var(--text); font-size: 14px; font-weight: 600; }
.flow .node .num { fill: var(--text-muted); }
.flow .node .s { fill: var(--text-muted); font-size: 12px; }
.flow .edge { stroke: var(--text-muted); stroke-width: 1.5; fill: none; }
.flow .loop { stroke: var(--text); stroke-width: 1.5; stroke-dasharray: 6 4; fill: none; }
.flow .arrowhead { fill: var(--text-muted); }
.flow .dia { fill: var(--bg); stroke: var(--text); stroke-width: 1.5; }
.flow .dia-t { fill: var(--text); font-size: 12px; font-weight: 600; }
.flow .lbl { fill: var(--text-muted); font-size: 12px; }
.flow .lbl.strong { fill: var(--text); font-weight: 600; }
.flow .note { fill: var(--text-muted); font-size: 11px; }

/* Строка категории под менеджером: «Выполнение плана» */
td.indent { padding-left: 1.5rem; }
