/* Детали: список и то, что раскрывается под деталью.
   Часть общего каскада: порядок подключения — ui.Stylesheets. */
/* One grid for the list and for what opens under it.
   The two panels and the table above them share their column widths, so
   the three read as one thing: a date sits under a part number, a price
   under the last price paid, a count under a count. Percentages and a
   fixed layout, because an automatic table sizes its columns from its
   own contents — three tables would each pick their own and none of
   them would line up. It also stops the columns jumping about as you
   page through the list. */
.parts-grid{table-layout:fixed}
.parts-grid th:nth-child(1),.parts-grid td:nth-child(1){width:17%}
.parts-grid th:nth-child(2),.parts-grid td:nth-child(2){width:22%}
.parts-grid th:nth-child(3),.parts-grid td:nth-child(3){width:11%}
.parts-grid th:nth-child(4),.parts-grid td:nth-child(4){width:7%}
.parts-grid th:nth-child(5),.parts-grid td:nth-child(5){width:12%}
.parts-grid th:nth-child(6),.parts-grid td:nth-child(6){width:12%}
.parts-grid th:nth-child(7),.parts-grid td:nth-child(7){width:19%}
/* Fixed columns cannot widen for their contents, so the contents have to
   give way instead — otherwise a long description simply runs over the
   column beside it. */
.parts-grid th,.parts-grid td{white-space:normal;overflow-wrap:anywhere}

/* What a part number has been worth before, opened under its own row.
   Two tables, one above the other: what it costs us, then what it
   fetches. Read down a column rather than across a sentence, which is
   why these are tables and not lists — a price has to line up with the
   price two rows above it. */
.past{padding:2px 0 12px;white-space:normal}
.past-side + .past-side{margin-top:16px}
.past h3{margin:0 0 7px;font-weight:500;font-size:12px;line-height:1.4;font-family:inherit;color:var(--ink-3);
  letter-spacing:.04em;text-transform:uppercase}
/* Its own type scale: this is a table inside a row of another table, and
   at the outer size it reads as a second list rather than as detail. The
   right-hand padding matches the outer table's so that the text in a
   column starts where the text above it starts, not merely the column. */
.past-grid{font-size:13px}
/* The deals a part was on: ten columns of its own, not the list's seven. */
/* The two tables under a part share their columns, so a supplier's price
   sits over the price we asked for it. */
.deals-grid{width:100%;table-layout:fixed;background:var(--panel);
  border:1px solid var(--line);border-radius:8px;border-collapse:separate;border-spacing:0;overflow:hidden}
.past-grid.deals-grid th,.past-grid.deals-grid td{padding:7px 10px;overflow:hidden;text-overflow:ellipsis;
  border-top:1px solid var(--line)}
.past-grid.deals-grid th{background:var(--sunk);border-top:0;font-weight:500}
.past-grid.deals-grid tbody tr:first-child td{border-top:1px solid var(--line)}
.past-grid.deals-grid tbody tr:hover td{background:var(--sunk)}
/* «+» beside «Suppliers», and the row it opens. */
.add-offer{margin-left:8px;width:22px;height:22px;border-radius:6px;border:1px solid var(--line);
  background:var(--panel);color:var(--accent);font-size:15px;font-weight:600;line-height:1;cursor:pointer;vertical-align:middle}
.add-offer:hover{border-color:var(--accent)}
tr.offer-new td{background:var(--panel)!important;overflow:visible}
tr.offer-new input,tr.offer-new select{width:100%;min-width:0;padding:4px 6px;font:inherit;font-size:13px;
  border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--ink)}
tr.offer-new td.r input{text-align:right}
.offer-price{display:flex;gap:4px}
tr.offer-new .offer-price input{flex:1 1 auto;width:auto}
tr.offer-new .offer-price select{flex:0 0 64px;width:64px;padding:4px 2px}
.offer-acts{white-space:nowrap}
.offer-acts .btn{padding:3px 9px;font-size:12.5px}
.deals-grid td:nth-child(1),.deals-grid th:nth-child(1){width:10%}
.deals-grid td:nth-child(2),.deals-grid th:nth-child(2){width:15%}
.deals-grid td:nth-child(3),.deals-grid th:nth-child(3){width:8%}
.deals-grid td:nth-child(4),.deals-grid th:nth-child(4){width:6%}
.deals-grid td:nth-child(5),.deals-grid th:nth-child(5){width:14%}
.deals-grid td:nth-child(6),.deals-grid th:nth-child(6){width:12%}
.deals-grid td:nth-child(7),.deals-grid th:nth-child(7){width:10%}
.deals-grid td:nth-child(8),.deals-grid th:nth-child(8){width:12%}
.deals-grid td:nth-child(9),.deals-grid th:nth-child(9){width:13%}
.past-grid th{padding:0 24px 6px 0;font-size:12px}
.past-grid td{padding:6px 24px 6px 0;border-top:1px solid var(--line)}
.past-grid th:last-child,.past-grid td:last-child{padding-right:0}
.past-grid tbody tr:first-child td{border-top:0}
.past-grid .chip{padding:2px 8px;font-size:11px}
/* The two facts that ride under the cell they belong to. */
.past-under{color:var(--ink-3);font-size:11.5px;font-weight:400;
  font-family:"IBM Plex Sans",system-ui,sans-serif;margin-top:2px}
.past-more{margin:7px 0 0;font-size:13px;color:var(--ink-3)}
/* The row that is open is marked, so that a panel and its line still
   read as one thing once two of them are open at once.

   Sunk rather than washed: `--wash` is the blue a chip uses to mark an
   offer, and on a washed background those chips vanished — the very
   difference they are there to show, between something offered and
   something that actually changed hands, was invisible on half the rows.
   This grey is also distinct from the hover colour, so an open row and a
   pointed-at row do not read as the same thing. */
tr.open td{background:var(--sunk)}
tr.past-row > td{padding-top:0;border-top:0;background:var(--sunk)}

/* The caret is the affordance: without it a row that opens looks exactly
   like a row that navigates, and the first click is a surprise either
   way. It turns rather than swapping glyph, so the movement says which
   way the panel went. */
/* An item flagged since the last look. Marked rather than sorted to the
   top: the list is in the order the deals matter in, and news that has
   jumped the queue is news read out of context. */
.bell-new{position:relative}
.bell-new::before{content:"";position:absolute;left:6px;top:16px;
  width:6px;height:6px;border-radius:50%;background:var(--accent)}
.bell-new{padding-left:20px}

.caret{border:0;background:none;color:var(--ink-3);cursor:pointer;
  font:600 15px/1 var(--mono);padding:0 7px 0 0;transition:transform .12s;
  display:inline-block;transform-origin:35% 50%}
.caret[aria-expanded="true"]{transform:rotate(90deg);color:var(--accent)}
.pn-link{color:inherit;text-decoration:none}
.pn-link:hover{color:var(--accent);text-decoration:underline}

