/* Сделка по шагам: поиск поставщиков, расчёт, КП, заказы, переписка.
   Часть общего каскада: порядок подключения — ui.Stylesheets. */
/* ── loading state ─────────────────────────────────
   Skeletons rather than a spinner, as the interface spec asks: the shape
   of what is coming is itself information, and a list that arrives into
   a space the right size does not make the page jump.
   `prefers-reduced-motion` is honoured — a shimmer is decoration, and to
   some people it is worse than that. */
.skel{display:block;height:12px;border-radius:6px;background:var(--sunk);
  position:relative;overflow:hidden}
.skel::after{content:"";position:absolute;inset:0;transform:translateX(-100%);
  background:linear-gradient(90deg,transparent,rgb(255 255 255/.14),transparent);
  animation:skel 1.3s infinite}
:root[data-theme="dark"] .skel::after{background:linear-gradient(90deg,transparent,rgb(255 255 255/.06),transparent)}
@keyframes skel{100%{transform:translateX(100%)}}
@media(prefers-reduced-motion:reduce){.skel::after{animation:none}}
tr.skel-row td{padding:14px 12px}
tr.skel-row .skel{width:100%}
tr.skel-row td:nth-child(2) .skel{width:70%}
tr.skel-row td.r .skel{width:50%;margin-left:auto}

/* ── what needs you ────────────────────────────────
   A count, not a dot: "three things" is actionable and a coloured spot
   is not, and colour alone must never be the only carrier of meaning. */
.bell-wrap{position:relative}
#bell{position:relative}
.bell-count{position:absolute;top:2px;right:2px;min-width:16px;height:16px;padding:0 4px;
  border-radius:9px;background:var(--crit);color:#fff;font:600 11px/16px var(--mono);
  text-align:center}
.bell-panel{position:absolute;right:0;top:calc(100% + 8px);z-index:30;width:330px;
  max-height:70vh;overflow:auto;background:var(--panel);border:1px solid var(--line);
  border-radius:var(--r);box-shadow:0 16px 40px rgb(21 29 38/.20)}
.bell-item{display:block;padding:12px 14px;border-bottom:1px solid var(--line);
  color:var(--ink);text-decoration:none}
.bell-item:last-child{border-bottom:0}
.bell-item:hover{background:var(--soft);text-decoration:none}
@media(max-width:640px){.bell-panel{width:calc(100vw - 28px);right:-8px}}

/* ── the sourcing tree ─────────────────────────────
   A deal is parts first and suppliers second; the screen used to say the
   opposite — one part at a time, chosen from a strip in the header that
   hid itself whenever there was only one line to choose from. So a part
   nobody had been asked about looked exactly like a part not currently
   selected, and that is the one part worth seeing. */
.tree{margin:0;padding:0;list-style:none}
.tree>li{border-top:1px solid var(--line)}
.tree>li:first-child{border-top:0}
.tree-part{display:flex;align-items:center;gap:10px;width:100%;padding:11px 12px;
  border:0;background:var(--soft);color:var(--ink);font:inherit;text-align:left;
  cursor:pointer}
.tree-part:hover{background:var(--sunk)}
.tree-part[aria-pressed="true"]{background:var(--wash)}
.tree-part .pn{font:600 14px/1.4 var(--mono)}
.tree-count{margin-left:auto;white-space:nowrap}
.tree-rows{margin:0;padding:0;list-style:none}
/* A row and the action at the end of it, on two fixed tracks.
   It was a flex line: the row took whatever the trailing button left,
   so its width changed with the button's — present on an answered offer,
   absent on a quiet one, wider still for "Remove". The caption above had
   no button at all and so was wider than every row under it, which is
   exactly how the headings came to sit beside their figures instead of
   over them. The slot is now always there, whether or not it is filled. */
.tree-line{display:grid;grid-template-columns:1fr;align-items:center;
  column-gap:8px;padding-right:12px;border-top:1px solid var(--line)}
/* Only where the rows in that list actually carry one. Reserved
   everywhere it left a dead strip down the right of the lists that do
   not, and squeezed their figures to make room for nothing. */
.tree.has-actions .tree-line{grid-template-columns:1fr 104px}
.tree-line>.btn{justify-self:end}
/* Columns, not a run of words.
   These rows were a flex line with a gap, so nothing lined up between one
   supplier and the next: a reader comparing three offers had to find the
   price in a different place on each line. Fixed tracks put the same fact
   in the same column all the way down, which is the whole reason to show
   several of them at once. */
.tree-row{display:grid;align-items:center;column-gap:14px;row-gap:2px;min-width:0;
  padding:9px 4px 9px 30px;border:0;background:none;color:var(--ink);
  font:inherit;text-align:left;cursor:pointer}
.tree-row:hover{background:var(--soft)}
.tree-row[aria-pressed="true"]{background:var(--wash);box-shadow:inset 3px 0 0 var(--accent)}
.tree-row>*{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tree-row .who{font-weight:600}
.tree-row .num{font:400 13px/1.4 var(--mono);text-align:right}
.tree-row .cc,.tree-row .chip{justify-self:start}
/* Short of what was asked for. The one fact on the row that changes what
   happens next — the rest has to be found somewhere else — so it is the
   one that gets a colour. */
.tree-row .short{color:var(--warn);font-weight:600}

/* Every track but the first is a definite width, and that is the whole
   point rather than a stylistic choice.
   The caption and the rows under it are separate grids. A track sized
   from its contents — `auto`, `max-content`, or an `fr` sharing space
   with one — is measured against *that grid's* contents, so "Price each"
   and "4,200.00 USD" size their columns differently and the two can only
   line up by accident. Fixed columns plus one flexible first column give
   both grids the same tracks by construction. */
/* Who was asked, and what came back. */
.tree-row.asked{grid-template-columns:1fr 108px 124px 96px 124px 84px 104px}
/* An offer being priced on. No "answered" column: every row here is one. */
.tree-row.offer{grid-template-columns:1fr 96px 124px 84px 104px 128px}

/* The correspondence rows carry prose, not columns. */
.tree-row.free{display:flex;align-items:center;gap:10px}

@media(max-width:1100px){
  .tree-row.asked{grid-template-columns:1fr 96px 112px 88px 112px}
  .tree-row.offer{grid-template-columns:1fr 88px 112px 76px}
}
/* A part with nobody asked is what the step machine now refuses to move
   past, so it is coloured like the refusal it will cause. */
.tree-none{padding:10px 12px 10px 30px;border-top:1px solid var(--line);
  background:var(--warn-wash);color:var(--warn);font-size:13px}
@media(max-width:640px){
  .tree-part,.tree-row{flex-wrap:wrap}
  .tree-row{padding-left:18px}
}

/* ── who was asked: the table ──────────────────
   Parts as rows, the suppliers asked about each folded under it, as wide
   as the page. The candidates used to hold a column of their own on
   every visit; they now open beside the part they are about (.drawer
   below), and the table has the width back. One set of tracks for the
   caption and every part row, so the headings sit over their figures. */
.ask{margin:0;padding:0;list-style:none;
  /* fold · part · qty · asked · answered · status · action · menu. The
     action track is empty on a part row and holds Remind or Update on a
     supplier row; reserved on both so the menus line up. */
  --ask-cols:34px minmax(0,1fr) 88px 104px 104px 210px 100px 40px}
.ask .r{text-align:right}
.ask-head{display:grid;grid-template-columns:var(--ask-cols);column-gap:12px;align-items:center;
  padding:0 0 8px;font-size:13px;font-weight:500;color:var(--ink-3);border-bottom:1px solid var(--line)}
.ask-part{border-bottom:1px solid var(--line)}
.ask-part:last-child{border-bottom:0}
.ask-row{display:grid;grid-template-columns:var(--ask-cols);column-gap:12px;align-items:center;
  padding:9px 0}
.ask-row[aria-current="true"] .ask-name .pn{color:var(--accent-2)}
.ask-name{display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0;
  justify-self:start;max-width:100%;
  padding:2px 6px;margin-left:-6px;border:0;border-radius:var(--r-s);background:none;
  color:var(--ink);font:inherit;text-align:left;cursor:pointer}
button.ask-name:hover{background:var(--soft)}
div.ask-name{cursor:default}
/* A row that belongs to another part's price: still there to compare
   against, but not the one in hand. */
.ask-sup.dim{opacity:.55}
.ask-sup.dim:hover{opacity:1}
.ask-name .pn{font:600 14.5px/1.4 var(--mono)}
.ask-name>span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ask-row .num{font-size:14px}
/* The two small round controls a row carries: the fold and the menu. */
.fold,.dots{width:30px;height:30px;border:1px solid var(--line-2);border-radius:50%;
  background:var(--panel);color:var(--ink-2);cursor:pointer;display:grid;place-items:center;
  padding:0;font-weight:600;font-size:16px;line-height:1;font-family:inherit}
.dots{border-color:transparent;background:transparent}
.fold:hover,.dots:hover{background:var(--soft);color:var(--ink)}
.fold svg{transition:transform .15s}
.fold[aria-expanded="false"] svg{transform:rotate(-90deg)}
.dots[aria-expanded="true"]{background:var(--wash);color:var(--accent-2)}
.ask-rows{margin:0 0 10px 46px;padding:0;list-style:none}
.ask-rows[hidden]{display:none}
/* A supplier under the part: a block with a rule down its side, so the
   eye reads it as belonging to the row above rather than as a row of
   the table — and on the table's own tracks, so its figures sit under
   the headings that name them. The block starts 46px in and its right
   edge is the table's, so the fixed tracks on the right coincide by
   construction; the flexible first one absorbs the inset. */
.ask-sup{display:grid;grid-template-columns:var(--sup-cols,minmax(0,1fr) 88px 220px 210px 100px 40px);
  column-gap:12px;align-items:center;margin:0 -1px 6px 0;padding:4px 0;
  border:1px solid var(--line);border-left:3px solid var(--accent);border-radius:var(--r-s);
  background:var(--soft)}
/* The selecting button spans the four fact columns as a subgrid: its
   cells are laid on the parent's tracks, not on tracks of its own. */
.ask-pick{grid-column:1/var(--pick-end,5);display:grid;grid-template-columns:subgrid;align-items:center;
  min-width:0;padding:5px 0 5px 12px;border:0;background:none;color:var(--ink);
  font:inherit;text-align:left;cursor:pointer;border-radius:5px 0 0 5px}
.ask-pick:hover{background:var(--sunk)}
.ask-pick[aria-pressed="true"]{background:var(--wash)}
.ask-pick>*{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
/* Prefixed: .who and .nm are the person in the top bar, and a bare class
   here inherited its height and centring. */
.ask-who{display:flex;flex-direction:column;gap:1px}
.ask-nm{font-weight:600;overflow:hidden;text-overflow:ellipsis}
.ask-nm .small{font-weight:400;margin-left:8px}
.ask-said{display:flex;align-items:center;gap:8px}
.ask-pick .num{font:400 13.5px/1.4 var(--mono)}
.ask-pick .short{color:var(--warn);font-weight:600}
.ask-sup>.btn{justify-self:start}
.ask-more{display:flex;align-items:center;justify-content:space-between;padding:2px 0 0}
.ask-more .btn{padding-left:6px;padding-right:6px;margin-left:-6px}
/* A part with nobody asked is what the step machine refuses to move
   past, so it is coloured like the refusal it will cause. */
.ask-note{display:flex;align-items:center;gap:10px;margin:0 0 8px;padding:10px 14px;
  border-radius:var(--r-s);background:var(--warn-wash);color:var(--warn);font-size:13.5px}
.ask-note svg{flex:none}
.ask-none{padding:12px 0}
.fld input[readonly]{background:var(--sunk);color:var(--ink-2);border-color:transparent}
/* A field that needs the room of two — a supplier's name and the part it
   is about do not fit in one column without being cut. */
@media(min-width:640px){.form>.fld-2{grid-column:span 2}}
/* A button drawn in the accent, without being filled by it — the second
   of two actions in a header, next to the first. */
.btn .i{width:15px;height:15px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;
  stroke-linecap:round;stroke-linejoin:round}
@media(max-width:1180px){
  .ask{--ask-cols:34px minmax(0,1fr) 72px 88px 88px 170px 96px 36px;
    --sup-cols:minmax(0,1fr) 72px 188px 170px 96px 36px}
}

/* ── pricing: the offers and the quotation ─────
   The same table twice over, with the price columns the step needs:
   fold · part · qty · price each · condition · status · action · menu on
   the offers, and qty · price each · margin · line total on the quotation.
   An offer row is a subgrid over the first five tracks. */
.ask.offers{--ask-cols:34px minmax(0,1fr) 88px 130px 70px 200px 110px 40px;
  --sup-cols:minmax(0,1fr) 88px 130px 70px 200px 110px 40px;--pick-end:6}
.ask .short{color:var(--warn);font-weight:600}
/* ── sourcing: the parts and the calculator ────
   The parts on the left, laid out as the quotation on the next step
   (table.kp.quote), with the document's card under them; the calculator
   on the right, at a fixed width. */
.src-grid{display:grid;grid-template-columns:minmax(0,1fr) 500px;gap:14px;align-items:start}
table.kp.quote tbody tr[data-row]{cursor:pointer}
table.kp.quote tbody tr[data-row]:hover td{background:var(--soft)}
table.kp.quote tbody tr[aria-selected="true"] td{background:var(--wash)}
/* Taken out of the reckoning: readable, and plainly not counted. */
table.kp.quote tbody tr.out td{background:color-mix(in srgb,var(--crit) 12%,transparent);color:var(--ink-3)}
table.kp.quote tbody tr.out:hover td,table.kp.quote tbody tr.out[aria-selected="true"] td{
  background:color-mix(in srgb,var(--crit) 20%,transparent)}
table.kp.quote tbody tr.out .num.b{text-decoration:line-through}
/* The calculator. Three fields to a row, short controls and no prose
   under them: the whole form, totals and button included, fits a screen
   of ordinary height beside the table. */
.card.calc{padding:16px 18px}
.calc .dsub{margin:0 0 4px;padding-top:0;border-top:0;font-size:13px}
.calc .fld{margin-bottom:6px}
.calc .fld label{font-size:12px;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.calc .fld label .muted{font-weight:400}
.calc .fld input,.calc .fld select{height:32px;padding:0 9px;font-size:13.5px}
.calc-in{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 10px}
.calc-in .fld-2{grid-column:span 2}
.calc-price input{font-weight:600}
/* A link drawn as a button, switched off: nothing to download yet. */
a.btn.disabled{opacity:.45;pointer-events:none}
/* Three figures of the same shape — a label, the number, a line under
   it — aligned at the top so the labels sit on one line whatever is
   written beneath them. */
.calc-out{display:flex;align-items:flex-start;gap:14px;flex-wrap:wrap;margin-top:4px;
  padding-top:10px;border-top:1px solid var(--line)}
/* The figure is never cut; the note under it may be, and carries its
   whole text in the tooltip. */
.calc-sum{display:grid;grid-template-rows:16px 24px auto;gap:0;min-width:0}
.calc-sum small{overflow:hidden;text-overflow:ellipsis;max-width:130px}
.calc-out .btn{margin-left:auto;align-self:center}
.calc-sum>span{font-size:12px;color:var(--ink-3);white-space:nowrap}
.calc-sum b{font:600 17px/24px var(--mono);white-space:nowrap}
.calc-sum small{font-size:11.5px;white-space:nowrap}
#o_profbox b{color:var(--ok)}
#o_profbox.loss b{color:var(--crit)}
#o_linebox.loss small{color:var(--crit)}
/* A warning takes a line of its own under the figures rather than
   pushing the button off theirs. */
.calc-out .note{margin:0;flex-basis:100%}
@media(max-width:1100px){
  .src-grid{grid-template-columns:minmax(0,1fr)}
}

/* ── the panel of candidates ───────────────────
   Over the page rather than beside it. The table keeps its width, the
   veil says the rest of the page is waiting, and one click on it puts
   the panel away. Not a <dialog>: a modal takes the keyboard from the
   page, and the table under it is what the reader is checking against. */
.veil{position:fixed;inset:0;z-index:40;background:rgb(21 29 38/.28)}
.veil[hidden]{display:none}
.drawer{position:fixed;top:0;right:0;bottom:0;z-index:41;width:min(460px,100vw);
  display:flex;flex-direction:column;background:var(--panel);color:var(--ink);
  border-left:1px solid var(--line);box-shadow:0 8px 32px rgb(20 35 55/.12)}
.drawer[hidden]{display:none}
.drawer header{padding:20px 22px 0;border-bottom:1px solid var(--line)}
.drawer header h2{font-size:19px}
.drawer header .ghost{margin:-5px -8px 0 0}
.drawer-body{flex:1;overflow:auto;padding:12px 22px 18px}
.drawer footer{display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:14px 22px;border-top:1px solid var(--line);background:var(--soft)}
.drawer .btn-go:disabled{opacity:.5;cursor:default}
.dr-scope{display:flex;align-items:center;gap:7px;margin-right:auto;font-size:13px;
  color:var(--ink-2);cursor:pointer;white-space:nowrap}
.dr-scope input{width:16px;height:16px;margin:0;accent-color:var(--accent)}
.dr-scope[hidden]{display:none}
.dtabs{display:flex;gap:2px;margin-top:12px}
.dtabs button{height:40px;padding:0 12px;border:0;border-bottom:2px solid transparent;
  background:none;color:var(--ink-2);font-weight:500;font-size:14px;line-height:1;font-family:inherit;cursor:pointer;
  border-radius:var(--r-s) var(--r-s) 0 0}
.dtabs button:hover{color:var(--ink);background:var(--soft)}
.dtabs button[aria-selected="true"]{color:var(--accent);border-bottom-color:var(--accent);
  background:var(--wash)}
.dsub{margin:18px 0 4px;padding-top:14px;border-top:1px solid var(--line);
  font-size:13.5px;font-weight:600;color:var(--ink)}
.pick{margin:0;padding:0;list-style:none}
.pick li{display:flex;align-items:center;gap:12px;padding:9px 0;border-top:1px solid var(--line)}
.pick li:first-child{border-top:0}
.pick label{display:flex;align-items:flex-start;gap:12px;flex:1;min-width:0;cursor:pointer}
.pick label>span{display:flex;flex-direction:column;min-width:0}
.pick input[type="checkbox"]{width:18px;height:18px;margin:2px 0 0;flex:none;accent-color:var(--accent)}
.pick .nm{font-weight:500}
.pick .st{font-size:13px;color:var(--ink-3)}
.pick li.done{opacity:.7}
.pick li.done label{cursor:default}
.pick li.muted{display:block;padding:12px 0}

/* ── the quotation step ────────────────────────
   Totals under the table, and the document on a panel wide enough for a
   page, drawn as paper: white, margins, the letterhead's type. */
.kp-totals{display:flex;align-items:baseline;gap:28px;justify-content:flex-end;
  margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}
.kp-totals>span:first-child{margin-right:auto}
.kp-total{display:flex;align-items:baseline;gap:10px}
.kp-total b{font:600 16px/1.3 var(--mono)}
.kp-grand span{font-weight:600;letter-spacing:.04em;font-size:13px}
.kp-grand b{font-size:20px}
table.kp.quote td .chip{margin-top:4px;font-size:12px;padding:2px 8px}
table.kp.quote td s{opacity:.7}
/* Documents the customer held before the current one. */
/* The quotations sent: one row each, the current one marked. */
.papers-t{width:100%;border-collapse:collapse}
.papers-t td{padding:9px 12px 9px 0;border-top:1px solid var(--line);font-size:13.5px;vertical-align:middle}
.papers-t tr:first-child td{border-top:0}
.papers-t tr.now td{font-weight:500}
.papers-t tr.old td{color:var(--ink-3)}
.papers-t td.r{text-align:right;white-space:nowrap}
.papers-t td .num{font-family:var(--mono)}
/* The inquiry on step 1 and the quotation on step 4 are one table twice
   over, laid out the same way: fixed tracks, tight gutters, and the
   prose cells cut or wrapped rather than deciding the width. */
table.kp.quote,table.kp.inquiry{table-layout:fixed}
table.kp.quote th,table.kp.quote td,
table.kp.inquiry th,table.kp.inquiry td{padding-right:12px;font-size:13.5px;overflow:hidden}
/* One line, cut with an ellipsis; the whole of it is in the tooltip. */
table.kp.quote td.cell-clip,table.kp.inquiry td.cell-clip{white-space:nowrap;text-overflow:ellipsis}
/* Two lines at most, then cut; the whole of it is in the tooltip. On an
   element inside the cell, not the cell: a cell that stops being a cell
   takes the row with it. */
table.kp .clamp{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;white-space:normal;line-height:1.35}
/* Editable cells keep the height of the field that replaces them; the
   description, which is not edited here, sits at the same height. */
table.kp.inquiry td.editable:hover{box-shadow:inset 0 0 0 1px var(--line-2)}
table.kp.inquiry .lookup{white-space:normal}
table.kp.quote td .short{display:block;white-space:nowrap}
table.kp.quote .dots{margin-left:auto}
.drawer.wide{width:min(820px,100vw)}
.drawer-paper{background:var(--sunk);padding:22px}
.doc{background:#fff;color:#151d26;padding:34px 38px;border:1px solid var(--line);
  border-radius:4px;font:400 13px/1.45 "IBM Plex Sans",system-ui,sans-serif;
  box-shadow:0 8px 24px rgb(20 35 55/.08)}
.doc .mono{font-family:var(--mono);font-variant-numeric:tabular-nums}
.doc .r{text-align:right}
.doc-muted{color:#5b6b7a;font-size:12px}
.doc-head{display:flex;justify-content:space-between;gap:24px;padding-bottom:12px;
  border-bottom:2px solid #151d26;margin-bottom:16px}
.doc-logo{display:block;height:60px;width:auto;margin-bottom:8px}
.doc-brand{font-size:19px;font-weight:600;letter-spacing:-.01em;margin-bottom:3px}
.doc-kind{text-align:right}
.doc-title{font-size:12px;font-weight:600;letter-spacing:.08em;color:#5b6b7a}
.doc-num{font:600 16px/1.4 var(--mono)}
.doc-label{font-size:11px;letter-spacing:.06em;color:#5b6b7a}
.doc-name{font-weight:600;font-size:14px}
.doc-to{margin-bottom:18px;font-size:14px}
.doc-table{width:100%;border-collapse:collapse;font-size:12.5px}
.doc-table th{font-size:10.5px;letter-spacing:.06em;color:#5b6b7a;font-weight:500;text-align:left;
  padding:0 10px 6px 0;border-bottom:1px solid #8d9aa6;white-space:nowrap}
.doc-table td{padding:7px 10px 7px 0;border-top:0;border-bottom:1px solid #e3e9ee;
  vertical-align:top;white-space:normal;color:#151d26}
.doc-table th:last-child,.doc-table td:last-child{padding-right:0}
.doc-detail{font-size:11px;color:#5b6b7a;margin-top:2px}
.doc .c{text-align:center}
.doc-close{display:flex;justify-content:space-between;gap:24px;margin-top:10px;
  padding-top:14px;border-top:2px solid #151d26}
.doc-close-terms{display:grid;gap:4px;align-content:start}
.doc-remarks{margin-top:6px}
.doc-close-sum{width:240px}
.doc-total{display:flex;justify-content:space-between;align-items:baseline;gap:16px;font-weight:600}
.doc-total b{font-size:16px}
.doc-sig-label{margin-top:22px}
.doc-sigbox{height:64px;border:1px solid #151d26;margin-top:4px}
.doc-signed{margin-top:22px;white-space:pre-line}
.doc-terms{display:grid;grid-template-columns:auto 1fr;gap:5px 22px;margin:20px 0 0;font-size:12.5px}
.doc-terms dt{color:#5b6b7a} .doc-terms dd{margin:0}
.doc-sign{margin:34px 0 0 auto;width:220px;padding-top:6px;border-top:1px solid #151d26;text-align:right}
.doc-foot{margin-top:28px;padding-top:8px;border-top:1px solid #e3e9ee;font-size:11px;color:#5b6b7a}
/* The company's order form on screen, drawn as the Excel sheet is:
   the heading line, the two parties side by side, the gridded table,
   the terms as label-and-value lines, the signature and the date. */
.doc-form{font-size:13px}
.form-logo{display:block;height:60px;width:auto;margin-bottom:-24px}
.form-title{text-align:center;font-weight:700;font-size:15px;letter-spacing:.02em;margin-bottom:22px}
.form-parties{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-bottom:22px}
.form-party>div{margin-bottom:3px}
.form-party .doc-name{margin-bottom:6px}
.form-addr{white-space:pre-line;max-width:34ch}
.form-table{width:100%;border-collapse:collapse;font-size:12.5px;margin-bottom:14px}
.form-table th,.form-table td{border:1px solid #151d26;padding:6px 8px;text-align:center}
.form-table th{font-weight:600;font-size:11.5px}
.form-table td:nth-child(3){text-align:left}
.form-terms{display:flex;flex-direction:column;gap:5px;margin-bottom:26px}
.form-term{display:flex;gap:10px;align-items:baseline}
.form-term>.doc-muted{min-width:190px}
.form-term>b{font-weight:600;min-width:120px;overflow-wrap:anywhere;max-width:52ch}
.form-total{margin-left:auto}
.form-total b{font-size:14px}
.form-sign{display:flex;justify-content:space-between;margin-bottom:18px}
.form-director{text-align:right;font-weight:600}

/* ── the orders step: the paperwork ───────────── */
.drop{display:flex;flex-direction:column;align-items:center;gap:4px;padding:22px;
  border:1.5px dashed var(--line-2);border-radius:var(--r-s);background:var(--soft);
  color:var(--ink-2);cursor:pointer;text-align:center}
.drop.over{border-color:var(--accent);background:var(--wash);color:var(--accent-2)}
.files{list-style:none;margin:12px 0 0;padding:0}
.files li{display:flex;align-items:center;gap:12px;padding:9px 0;border-top:1px solid var(--line)}
.files li:first-child{border-top:0}
.files .file-ico{color:var(--ink-3);display:grid;place-items:center}
.files .file-name{flex:1;min-width:0}
.files .file-name a{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}
.files li.muted{display:block;padding:10px 0}

/* ── the small menu behind ⋮ ──────────────────── */
.pop{position:fixed;z-index:50;margin:0;padding:5px;list-style:none;min-width:210px;
  background:var(--panel);border:1px solid var(--line-2);border-radius:var(--r-s);
  box-shadow:0 12px 28px rgb(21 29 38/.16)}
.pop button,.pop a{display:block;width:100%;padding:8px 10px;border:0;border-radius:5px;
  background:none;color:var(--ink);font-weight:400;font-size:14px;line-height:1.3;font-family:inherit;text-align:left;cursor:pointer;
  text-decoration:none}
.pop button:hover,.pop a:hover,.pop button:focus-visible,.pop a:focus-visible{
  background:var(--wash);text-decoration:none;outline:none}
.pop .danger{color:var(--crit)}

/* ── the conversation with one supplier ────────────
   Sent and received are told apart by a rule down the side and a wash,
   not by sides of the screen. Chat bubbles would say "messenger"; this
   is a record of correspondence that somebody may have to stand behind,
   and it should look like one. */
.feed{margin:0;padding:0;list-style:none;max-height:46vh;overflow:auto}
.msg{border-left:3px solid var(--line-2);border-radius:0 var(--r-s) var(--r-s) 0;
  background:var(--soft);padding:10px 12px;margin-bottom:10px}
.msg-in{border-left-color:var(--accent);background:var(--wash)}
.msg-head{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline;
  font-size:12px;color:var(--ink-2);margin-bottom:6px}
.msg-head .b{color:var(--ink)}
.msg-body{font-size:13.5px;line-height:1.55;overflow-wrap:anywhere}
.msg-body p{margin:0 0 8px}
.msg-body p:last-child{margin-bottom:0}
.msg-flag{color:var(--warn);background:var(--warn-wash);border-radius:4px;padding:1px 6px}

/* The editor. Four controls, because a letter to a supplier is short
   business prose — and because every tag offered here has to survive a
   dozen mail clients on the way. */
.wtools{display:flex;gap:4px;padding:6px;border:1px solid var(--line);
  border-bottom:0;border-radius:var(--r-s) var(--r-s) 0 0;background:var(--soft)}
.wtools button{min-width:30px;height:28px;border:1px solid transparent;
  border-radius:5px;background:none;color:var(--ink-2);cursor:pointer;font-size:13px}
.wtools button:hover{background:var(--panel);border-color:var(--line);color:var(--ink)}
.wbox{min-height:110px;max-height:30vh;overflow:auto;padding:10px 12px;
  border:1px solid var(--line);border-radius:0 0 var(--r-s) var(--r-s);
  background:var(--panel);font-size:13.5px;line-height:1.55}
.wbox:empty::before{content:attr(data-placeholder);color:var(--ink-3)}
.wbox p{margin:0 0 8px}
/* Where the Cyrillic is. Pointing at it is the whole difference between
   a message a person can act on and a count they cannot. */
.wbox mark{background:var(--crit-wash);color:var(--crit);
  box-shadow:0 0 0 1px var(--crit) inset;border-radius:3px;padding:0 2px}


/* The remaining two steps, on the same grid discipline: what was quoted
   and what came back, and what was ordered from whom. */
.tree-row.answer{grid-template-columns:1fr 168px 124px 168px}
.tree-row.order{grid-template-columns:1fr 124px 124px 148px}
@media(max-width:1100px){
  .tree-row.answer{grid-template-columns:1fr 148px 112px}
  .tree-row.order{grid-template-columns:1fr 112px 132px}
}

/* One caption row for a list of parts, naming what the columns hold.
   It wears the row's own classes, so the tracks are the row's tracks
   rather than a second copy that would drift the first time one changed.
   Only the appearance is overridden here. */
.tree-head{border-bottom:1px solid var(--line)}
.tree-row.is-head{padding-bottom:8px;align-items:end;cursor:default;
  font-size:12px;font-weight:500;color:var(--ink-3)}
.tree-row.is-head:hover{background:none}
/* Captions over numeric columns sit where the numbers do. */
.tree-row.offer.is-head>*:nth-child(2),.tree-row.offer.is-head>*:nth-child(3),
.tree-row.quoted.is-head>*:nth-child(2),.tree-row.quoted.is-head>*:nth-child(3),
.tree-row.quoted.is-head>*:nth-child(4),.tree-row.quoted.is-head>*:nth-child(5){
  text-align:right}

/* A part already in the quotation, with the offer it was priced on. */
.tree-row.quoted{grid-template-columns:1fr 96px 124px 84px 136px}
@media(max-width:1100px){
  .tree-row.quoted{grid-template-columns:1fr 88px 112px 76px 120px}
}
/* An empty list says so in plain words rather than as a warning: nothing
   has gone wrong, there is simply nothing in it yet. */
.tree-none.plain{background:var(--soft);color:var(--ink-2)}

/* A certificate, one per part: the document, then who put it there.
   Fixed tracks, like every other tree — `fr` and `minmax(…,auto)` are
   sized against the content of their own grid, so the caption and the
   rows would each pick their own widths and never line up. */
.tree-row.cert{grid-template-columns:1fr 72px 108px 148px}
@media(max-width:1100px){
  .tree-row.cert{grid-template-columns:1fr 72px 108px}
}
/* The file name is a link, but the row is not: it should read as part of
   the line until it is pointed at. */
.tree-row.cert a.who{color:inherit;text-decoration:none}
.tree-row.cert a.who:hover{color:var(--accent);text-decoration:underline}

/* One hop of a journey: where it went, on what paperwork, and what can
   still be said about it. */
.hop{display:flex;align-items:flex-start;gap:12px;padding:12px 0;
  border-top:1px solid var(--line)}
.hop:first-child{border-top:0}


/* A closed, lost or cancelled deal: what only a running deal can do is
   not offered (load.js sets data-ended, the markup marks data-live). */
body[data-ended] [data-live]{display:none!important}
