/* зона Г2 «конвейер»; подключается после brand.css.
   Здесь одевается всё, что рисуют шаблоны santan/: лента этапов, «сейчас»,
   блокеры, доска, серия и семь экранов этапов. Палитра — только переменные. */

/* ── страница не должна ехать вбок ─────────────────────────────────────── */
.s-raw, .s-letter, pre.s-raw{white-space:pre-wrap;word-break:break-word;overflow-x:auto;
  max-width:100%;background:var(--sunken);border:1px solid var(--line);border-radius:var(--r-m);
  padding:12px 14px;font-family:var(--mono);font-size:12.5px;line-height:1.6;margin:0 0 10px}
.s-letter{background:var(--surface)}
/* широкая таблица едет ВНУТРИ себя на любой ширине; страница стоит на месте */
table.grid,table.s-tbl{display:block;max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;
  /* тени у краёв появляются САМИ, только когда таблица правда шире контейнера */
  background:
    linear-gradient(90deg,var(--surface) 40%,rgba(255,255,255,0)) left/26px 100% no-repeat local,
    linear-gradient(90deg,rgba(255,255,255,0),var(--surface) 60%) right/26px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%,rgba(0,0,0,.22),transparent) left/14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%,rgba(0,0,0,.22),transparent) right/14px 100% no-repeat scroll,
    var(--surface)}
table.grid>thead,table.grid>tbody,table.grid>tfoot,
table.s-tbl>thead,table.s-tbl>tbody,table.s-tbl>tfoot{display:table;width:100%;
  min-width:100%;table-layout:auto}
table.grid td,table.grid th{overflow-wrap:break-word}
table.grid td.n,table.grid th.n,table.grid td.mono{overflow-wrap:normal}

/* контраст текста: цветной текст берём из текстовых двойников, а не из заливочных
   --ok/--warn/--red (D-46, D-47). Заливки и рамки остаются фирменными. */
.chip-warn{color:var(--warn-text,#8a5200)}
.chip-ok{color:var(--ok-text,#146239)}

/* D-33: сетка плиток красилась фоном-разделителем, и ПУСТАЯ клетка получала заливку.
   Разделитель переносим на сами плитки, контейнер делаем прозрачным. */
.tiles,.s-kpis{background:transparent!important}
.tiles>.tile,.s-kpis>.s-kpi{box-shadow:0 0 0 1px var(--line)}
@media (max-width:900px){.tiles{grid-template-columns:1fr!important}}

/* чип — единое слово, не переносится (D-42) */
.chip{white-space:nowrap;word-break:keep-all;hyphens:none}

/* ── лента конвейера ───────────────────────────────────────────────────── */
.s-pipewrap{margin:14px 0 6px;position:relative}
.s-pipehead{display:flex;align-items:baseline;gap:6px 10px;flex-wrap:wrap;margin:0 0 6px;
  font-size:12px;color:var(--grey-text);max-width:100%}
.s-pipehead>*{min-width:0}
.s-pipehead-t{font-weight:500;color:var(--ink-2)}
.s-pipehead-p{background:var(--sunken);border:1px solid var(--line);border-radius:99px;
  padding:1px 9px;color:var(--ink)}
.s-pipehead-h{white-space:nowrap;color:var(--grey-text)}
.s-pipe{list-style:none;margin:0;padding:2px 2px 12px;scroll-behavior:smooth}
.s-pipe:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
/* правый край ленты гасится — видно, что дальше есть ещё этапы */
.s-pipewrap:after{content:"";position:absolute;right:0;top:22px;bottom:12px;width:36px;
  pointer-events:none;background:linear-gradient(90deg,transparent,var(--bg-app,#fff))}
.s-step{border:1px solid var(--line);border-radius:var(--r-m);background:var(--surface);
  flex:0 0 176px;min-width:176px;overflow:hidden}
.s-step>a,.s-step>span{display:flex;flex-direction:column;gap:3px;height:100%;
  padding:10px 12px;text-decoration:none;color:inherit;box-sizing:border-box}
.s-pipe-flat .s-step{cursor:default}
.s-pipe-flat .s-step .s-step-t{margin-top:1px}
.s-step-t{font-size:13px;line-height:1.3;font-weight:500;color:var(--ink);
  overflow-wrap:break-word}
.s-step-m{font-size:11px;line-height:1.35;overflow-wrap:break-word}
.s-step-s{margin-top:auto;padding-top:6px;font-size:11px;line-height:1.3;
  min-height:2.9em;display:flex;align-items:flex-end;color:var(--grey-text)}
.s-step.is-done{background:var(--ok-soft);border-color:var(--line)}
.s-step.is-done .s-step-s{color:var(--ok-text,#146239)}
.s-step.is-done .s-step-n:after{content:" ✓"}
.s-step.is-now{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.s-step.is-now .s-step-s{color:var(--ink);font-weight:600}
.s-step.is-locked{border-style:dashed;border-color:var(--border-strong,#b9bcc2);
  background:repeating-linear-gradient(135deg,var(--sunken),var(--sunken) 6px,transparent 6px,transparent 12px)}
.s-step.is-locked .s-step-t,.s-step.is-locked .s-step-m{color:var(--ink-2)}
.s-step.is-locked>a,.s-step.is-locked>span{background:rgba(255,255,255,.66)}
.s-step.is-locked .s-step-s{color:var(--red-text)}
.s-step.is-locked .s-step-s:before{content:"";display:inline-block;width:7px;height:6px;
  margin-right:5px;border:1.5px solid currentColor;border-radius:1px;vertical-align:1px;
  box-shadow:0 -3px 0 -1.5px currentColor}
.s-step.is-here{outline:2px solid var(--ink);outline-offset:1px}
.s-step.is-here .s-step-s{color:var(--ink);font-weight:600}
.s-step a:hover{background:var(--sunken)}
.s-step a:focus-visible{outline:2px solid var(--ink);outline-offset:-2px;border-radius:var(--r-m)}

/* ворота — разрыв, а не шаг: уже, с полями по бокам и пунктиром */
.s-gatemark{flex:0 0 132px;min-width:132px;margin:0 14px;border-radius:var(--r-m);
  border:1px dashed var(--red);background:var(--red-soft);position:relative;
  display:flex;align-items:center;justify-content:center;text-align:center}
.s-gatemark:before,.s-gatemark:after{content:"";position:absolute;top:12px;bottom:12px;
  width:1px;background:repeating-linear-gradient(180deg,var(--line),var(--line) 3px,transparent 3px,transparent 7px)}
.s-gatemark:before{left:-8px}.s-gatemark:after{right:-8px}
.s-gatemark>a{padding:10px 8px;gap:2px;text-decoration:none}
.s-gatemark .s-gate-i{font-size:13px;line-height:1;width:20px;height:20px;border-radius:99px;
  display:flex;align-items:center;justify-content:center;background:var(--red);color:#fff}
.s-gatemark .s-gate-t{font-size:12.5px;font-weight:600;color:var(--red-text)}
.s-gatemark .s-gate-n{font-size:10.5px;line-height:1.3;color:var(--red-text)}
.s-gatemark.is-open{border-color:var(--ok);background:var(--ok-soft)}
.s-gatemark.is-open .s-gate-i{background:var(--ok)}
.s-gatemark.is-open .s-gate-t,.s-gatemark.is-open .s-gate-n{color:var(--ok-text,#146239)}

.s-note{font-size:12.5px;line-height:1.6;color:var(--ink-2);margin:0 0 16px;max-width:96ch}
.s-hr{border:0;border-top:1px solid var(--line);margin:22px 0}

/* ── «сейчас» ──────────────────────────────────────────────────────────── */
.s-now{display:flex;gap:14px;align-items:flex-start;background:var(--surface);
  border:1px solid var(--line);border-left:3px solid var(--ink);border-radius:var(--r-m);
  padding:14px 16px;margin:6px 0 18px}
.s-now-l{flex:0 0 auto;font-size:10.5px;letter-spacing:.12em;text-transform:uppercase;
  color:var(--grey-text);padding-top:3px}
.s-now>div{flex:1 1 auto;min-width:0}
.s-now b{font-size:16px;line-height:1.3;display:block}
.s-now-a{margin:4px 0 0;font-size:13px;line-height:1.55;color:var(--ink-2);max-width:80ch}
.s-now-go{flex:0 0 auto;align-self:center;border:1px solid var(--line);border-radius:var(--r-m);
  padding:8px 14px;font-size:13px;text-decoration:none;background:var(--sunken);color:var(--ink);
  min-height:40px;display:flex;align-items:center}
.s-now-go:hover{background:var(--surface);border-color:var(--ink)}

/* ── что ждёт человека ─────────────────────────────────────────────────── */
.s-block{margin:0 0 20px}
.s-block h2{display:flex;align-items:center;gap:9px;font-size:17px;margin:0 0 10px}
.s-cnt{font-size:12px;font-weight:600;min-width:22px;height:22px;padding:0 7px;border-radius:99px;
  background:var(--warn-soft);color:var(--warn-text,#8a5200);display:inline-flex;align-items:center;
  justify-content:center}
.s-blist{list-style:none;margin:0;padding:0;border:1px solid var(--line);border-radius:var(--r-m);
  background:var(--surface);overflow:hidden}
.s-blist li+li{border-top:1px solid var(--line-soft)}
.s-blist a{display:flex;gap:10px;align-items:baseline;padding:11px 14px;text-decoration:none;
  color:var(--ink);font-size:13.5px;line-height:1.5;min-height:44px;box-sizing:border-box}
.s-blist a:hover{background:var(--sunken)}
.s-blist .chip{flex:0 0 auto;min-width:92px;text-align:center;white-space:nowrap;
  word-break:keep-all;hyphens:none;letter-spacing:0}
.s-bl{color:var(--ink);text-decoration:none;border-bottom:1px solid var(--line)}
.s-bl:hover{border-bottom-color:var(--ink)}
.s-ok{font-size:13.5px;color:var(--ok-text,#146239);background:var(--ok-soft);border-radius:var(--r-m);
  padding:10px 14px;margin:0 0 16px;display:inline-block}

/* ── плитки чисел (контейнер .s-kpi, плитка .s-k) ──────────────────────── */
.s-kpi{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(176px,1fr));
  gap:10px;margin:0 0 16px;padding:0!important;background:transparent!important;
  border:0!important;flex-direction:row!important}
.s-kpi .s-k{display:flex;flex-direction:column;gap:4px;padding:14px 16px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-l);min-width:0}
.s-kpi .s-k b{font-size:24px;font-weight:600;letter-spacing:-.02em;line-height:1.1;
  font-variant-numeric:tabular-nums}
.s-kpi .s-k span{font-size:12px;line-height:1.4;color:var(--grey-text)}
.s-kpi .s-k.is-warn{border-color:var(--warn);background:var(--warn-soft)}
.s-kpi .s-k.is-warn b{color:var(--warn-text,#8a5200)}

/* заголовок числовой колонки выравнивается так же, как её числа */
table.grid th.n{text-align:right}

/* ── доска этапов ──────────────────────────────────────────────────────── */
.s-boardhint,.s-tblhint{font-size:12px;color:var(--grey-text);margin:0 0 8px}
.s-tblhint{margin:0 0 6px}
.s-board{display:flex;gap:10px;overflow-x:auto;padding:2px 2px 14px;margin:0 0 8px;
  align-items:flex-start;scroll-behavior:smooth}
.s-board:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.s-col{flex:0 0 232px;min-width:232px;background:var(--sunken);border:1px solid var(--line);
  border-radius:var(--r-m);padding:10px;display:flex;flex-direction:column;gap:8px}
.s-col.is-after{border-style:dashed}
.s-col.has-work{background:var(--surface);border-color:var(--border-strong,#b9bcc2)}
.s-col-h{display:flex;flex-direction:column;gap:2px;padding-bottom:8px;
  border-bottom:1px solid var(--line-soft)}
.s-col-t{font-size:13px;font-weight:600;line-height:1.3}
.s-col-m{font-size:11px;color:var(--grey-text)}
.s-col-g{font-size:10px;letter-spacing:.06em;text-transform:uppercase;color:var(--red-text)}
.s-card{display:flex;flex-direction:column;gap:4px;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--r-m);padding:10px 12px;
  text-decoration:none;color:var(--ink)}
.s-card:hover{border-color:var(--ink)}
.s-card.is-warn{border-left:3px solid var(--warn)}
.s-card b{font-family:var(--mono);font-size:12.5px}
.s-card-t{font-size:13px;line-height:1.35}
.s-card-m,.s-card-h,.s-card-c{font-size:11.5px;color:var(--grey-text)}
.s-card-h{display:flex;align-items:center;gap:7px;font-variant-numeric:tabular-nums}
.s-bar{flex:1 1 auto;height:4px;border-radius:99px;background:var(--line);overflow:hidden;
  display:block;min-width:40px}
.s-bar>i{display:block;height:100%;background:var(--ink)}
.s-col .s-empty{display:block;text-align:center;color:var(--grey-text);font-size:11.5px;
  padding:6px 0;border:0;background:transparent;opacity:.7}
.s-card .chip{align-self:flex-start}

/* ── шапка экрана этапа ────────────────────────────────────────────────── */
.s-scr-h{display:flex;flex-direction:column;gap:3px;margin:22px 0 10px;font-size:20px}
.s-scr-m{font-size:12.5px;font-weight:400;color:var(--grey-text);letter-spacing:0}
.s-io{display:flex;flex-direction:column;gap:6px;margin:0 0 16px;padding:12px 14px;
  background:var(--sunken);border:1px solid var(--line-soft);border-radius:var(--r-m)}
.s-io-r{display:flex;gap:10px;align-items:baseline;font-size:13px;line-height:1.5}
.s-io-l{flex:0 0 84px;font-size:11px;letter-spacing:.06em;text-transform:uppercase;
  color:var(--grey-text)}
.s-io-v{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
.s-checks{margin:0 0 16px;padding-left:20px;font-size:13.5px;line-height:1.7;color:var(--ink-2)}
.s-checks li{margin:0 0 2px}
.s-callout-go{display:inline-block;margin-top:8px;font-weight:500;color:var(--red-text);
  text-decoration:underline;text-underline-offset:3px}

/* ── переход между этапами ─────────────────────────────────────────────── */
.s-stagenav{display:flex;justify-content:space-between;gap:12px;margin:22px 0 0;
  padding-top:14px;border-top:1px solid var(--line)}
.s-stagenav a{display:flex;flex-direction:column;gap:2px;padding:10px 14px;min-height:44px;
  border:1px solid var(--line);border-radius:var(--r-m);background:var(--surface);
  text-decoration:none;color:var(--ink);max-width:46%}
.s-stagenav a:hover{border-color:var(--ink);background:var(--sunken)}
.s-stagenav span{font-size:11.5px;color:var(--grey-text)}
.s-stagenav b{font-size:13.5px;font-weight:500;line-height:1.3}
.s-nav-n{margin-left:auto;text-align:right;align-items:flex-end}

/* ── формы этапа ───────────────────────────────────────────────────────── */
.s-act{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px;margin:18px 0 8px;
  padding:14px 16px;background:var(--sunken);border:1px solid var(--line);border-radius:var(--r-m)}
.s-act label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--grey-text)}
.s-act input{min-height:40px;padding:8px 11px;font:inherit;font-size:13.5px;
  border:1px solid var(--line);border-radius:var(--r-m);background:var(--surface);min-width:220px}
.s-act input:focus-visible{outline:2px solid var(--ink);outline-offset:1px}
.s-act button{min-height:44px;padding:11px 18px;font:inherit;font-size:13.5px;font-weight:500;
  border:0;border-radius:var(--r-m);background:var(--graphite,#333);color:#fff;cursor:pointer}
.s-act button:hover{background:#1b212d}
.s-act .muted{flex:1 1 100%;font-size:12px;line-height:1.5}

/* решения по материалам */
.s-dec{display:flex;gap:8px;white-space:nowrap}
.s-dec form{margin:0}
.s-dec button{min-height:36px;padding:7px 14px;font:inherit;font-size:12.5px;cursor:pointer;
  border-radius:var(--r-m);border:1px solid var(--line);background:var(--surface)}
.s-dec .s-yes{background:var(--graphite,#333);color:#fff;border-color:var(--graphite,#333)}
.s-dec .s-yes:hover{background:#1b212d}
.s-dec .s-no:hover{border-color:var(--red);color:var(--red-text)}
.s-alias{font-size:11.5px;line-height:1.4}

/* ── экран цены ────────────────────────────────────────────────────────── */
.s-gate-panel{border:1px solid var(--line);border-left:3px solid var(--red);
  border-radius:var(--r-m);padding:16px 18px;margin:0 0 18px;background:var(--surface)}
.s-gate-panel.is-open{border-left-color:var(--ok)}
.s-gate-head{display:flex;gap:12px;align-items:flex-start}
.s-gate-panel .s-gate-i{flex:0 0 auto;width:26px;height:26px;border-radius:99px;font-size:14px;
  display:flex;align-items:center;justify-content:center;background:var(--red);color:#fff}
.s-gate-panel.is-open .s-gate-i{background:var(--ok)}
.s-gate-panel .s-gate-head b{font-size:15px}
.s-gate-panel .s-gate-head p{margin:5px 0 0;font-size:13.5px;line-height:1.6;color:var(--ink-2);
  max-width:82ch}
table.s-price{margin:14px 0 6px;max-width:560px}

/* ── разбор заявки ─────────────────────────────────────────────────────── */
.s-grid2{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:22px;
  align-items:start;margin:0 0 6px}
.s-grid2>div{min-width:0}
.s-conf{font-size:11.5px;color:var(--grey-text);white-space:nowrap}
.s-conf--found,.s-conf--ok{color:var(--ok)}
.s-conf--missing,.s-conf--none{color:var(--red-text)}
.s-conf--guess,.s-conf--conflict{color:var(--warn)}
tr.is-missing td{background:var(--red-soft)}
tr.is-missing td,tr.is-missing .muted,.callout .muted,.s-gatemark .muted{color:var(--ink-2)}

/* ── сужения ───────────────────────────────────────────────────────────── */
@media (max-width:1100px){
  .s-grid2{grid-template-columns:1fr;gap:16px}
  .s-now{flex-wrap:wrap}
}
@media (max-width:760px){
  .s-step{flex-basis:158px;min-width:158px}
  .s-gatemark{flex-basis:118px;min-width:118px}
  .s-kpi{grid-template-columns:repeat(auto-fit,minmax(142px,1fr))}
  .s-col{flex-basis:200px;min-width:200px}
  .s-now-l{flex-basis:100%}
  .s-now-go{width:100%;justify-content:center}
  .s-act input{min-width:0;width:100%}
  .s-act label{flex:1 1 100%}
  .s-io-r{flex-direction:column;gap:2px}
  .s-io-l{flex-basis:auto}
}
/* узкий экран: широкая таблица едет ВНУТРИ себя, страница стоит на месте */
@media (max-width:900px){
  table.grid>thead,table.grid>tbody,table.grid>tfoot,
  table.s-tbl>thead,table.s-tbl>tbody,table.s-tbl>tfoot{width:max-content}
  table.grid td,table.grid th,table.s-tbl td,table.s-tbl th{white-space:nowrap;
    overflow-wrap:normal}
  table.grid td:first-child,table.grid th:first-child,
  table.s-tbl td:first-child,table.s-tbl th:first-child{white-space:normal}
  /* плитки шапки блока — по одной в строке, чтобы не оставалось пустой залитой клетки */
  .s-kpis{grid-template-columns:1fr!important}
  .s-grid2 pre.s-raw{font-size:12px}
}
@media (prefers-reduced-motion:reduce){.s-pipe,.s-board{scroll-behavior:auto}}
