/* UniCirc Workspace 2 — Decision Sheets (ws2-products.js, prefix pd-). Small additions only; everything else reuses ws2.css.
   Colours are the ws2.css variables only: the original dark UniCirc colours. No new colours, no other theme.
   19 Nov: numbered sections 0–8, photos, price lines, signature pad and signature table, the making-process checklist.
   19 Nov (later): product renderings (.pd-ph-r) are shown whole in a 4:5 box. */

/* list: search (shown when there are many sheets) */
.pd-find { position: relative; display: flex; align-items: center; }
.pd-find .ic { position: absolute; left: 14px; color: var(--ink-3); pointer-events: none; }
.pd-search { width: 100%; min-height: 48px; padding: 10px 14px 10px 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-size: 16px; -webkit-appearance: none; appearance: none; }
.pd-search:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }

/* list: rows can carry a second chip ("Version 4 waits for signature") */
.pd-list .row-side .chip + .chip { margin-top: 2px; }

/* list: deleted drafts, each with Restore */
.pd-del { list-style: none; margin: 0; padding: 0; display: grid; }
.pd-del li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.pd-del li:last-child { border-bottom: 0; }
.pd-del-t { display: grid; gap: 2px; min-width: 0; }
.pd-del-t small { font-size: 13.5px; }

/* one sheet: card titles, empty values, old price → new price */
.pd-h { font-size: 16px; font-weight: 650; }
.pd-none { color: var(--ink-3); }
.pd-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 16px; }
.pd-price s { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.pd-price b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pd-price .muted { font-size: 14.5px; }
#pd-msgs { scroll-margin-top: calc(var(--top) + 16px); }

/* one sheet: version history, newest first */
.pd-hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pd-hist li { display: grid; gap: 2px; padding-left: 14px; border-left: 2px solid var(--line); }
.pd-hist li:first-child { border-left-color: var(--glow); }
.pd-hist small { font-size: 13.5px; }

/* form: number steppers (minimum batch, days) stay a comfortable width */
.stepper.pd-num { max-width: 240px; }

/* dialogs: quick reasons and the live price change */
.pd-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pd-quick > .hint { flex-basis: 100%; }
.pd-quick .b { white-space: normal; text-align: left; font-weight: 500; }
.pd-diff { font-size: 14.5px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pd-diff:empty { display: none; }

/* the sheet: numbered sections (same look in the form: .pd-fsec) */
.pd-secs { display: grid; gap: 12px; }
.pd-sec { gap: 10px; scroll-margin-top: calc(var(--top) + 16px); }
.pd-sec-h, .pd-fsec .grp-h h2 { display: flex; align-items: center; gap: 10px; }
.pd-sec-h { font-size: 16.5px; font-weight: 650; }
.pd-sec-h:focus { outline: none; }
.pd-n { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--glow); color: var(--ink); font: 700 13px/1 var(--mono); letter-spacing: 0; }
.pd-sub { font-weight: 600; font-size: 14.5px; color: var(--ink-2); margin-top: 2px; }
.pd-src { font-size: 13.5px; color: var(--ink-3); }
.pd-lbl { display: inline-block; min-width: 76px; font-weight: 600; color: var(--ink-2); }
.pd-warn { color: var(--wait); font-weight: 600; font-size: 14.5px; }
.pd-r { text-align: right !important; font-variant-numeric: tabular-nums; }
table.pd-lines-t tfoot th, table.pd-lines-t tfoot td { border-top: 2px solid var(--line); border-bottom: 0; font-weight: 700; }
table.pd-lines-t th:first-child, table.pd-sigs th, table.pd-sigs td { text-align: left; }
.pd-diffs { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* the section index: jump to a section */
.pd-idx { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-idx button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 14px; cursor: pointer; }
.pd-idx button:hover { border-color: var(--ink-3); color: var(--ink); }
.pd-idx b { font: 700 12.5px/1 var(--mono); color: var(--ink); }

/* photos: thumbnails that open larger; in the form each has "what it shows" and Remove */
.pd-phs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 12px; }
.pd-phs > li { display: grid; gap: 6px; align-content: start; min-width: 0; }
.pd-ph { display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border-radius: 12px; border: 1px solid var(--line-2); background: var(--sunk); overflow: hidden; cursor: zoom-in; }
span.pd-ph { cursor: default; }
.pd-ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pd-ph:hover { border-color: var(--ink-3); }
.pd-ph-miss { display: grid; place-items: center; height: 100%; padding: 8px; text-align: center; font-size: 13px; color: var(--ink-3); }
.pd-ph-t { display: grid; gap: 1px; min-width: 0; }
.pd-ph-t b { font-size: 14px; font-weight: 600; }
.pd-ph-t small, .pd-phe small { font-size: 12.5px; color: var(--ink-3); }
.pd-phe select { width: 100%; min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font-size: 14.5px; }
.pd-phe .bw, .pd-phe .b { width: 100%; }
.pd-big { margin: 0; display: grid; gap: 8px; }
.pd-big img { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: var(--sunk); }
/* renderings (19 Nov): product images on their own white background; the box takes their 4:5 shape so the whole garment shows.
   No new colours: the white is the picture itself. */
.pd-ph-r { aspect-ratio: 4 / 5; }
.pd-big-r img { width: auto; max-width: 100%; justify-self: center; }

/* signatures: the table and the pad */
table.pd-sigs th[scope="row"] { font-weight: 600; }
table.pd-sigs td { vertical-align: middle; }
.pd-sig { display: block; width: 180px; max-width: 100%; height: 60px; color: var(--ink); }
.pd-sim { display: block; font-size: 12px; color: var(--ink-3); }
.pd-pad { position: relative; width: 100%; max-width: 480px; aspect-ratio: 3 / 1; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.fld.bad .pd-pad { border-color: var(--bad); }
.pd-pad-c { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; color: var(--ink); z-index: 1; }
.pd-pad-line { position: absolute; left: 8%; right: 8%; bottom: 24%; border-bottom: 1px dashed var(--line); }
.pd-pad-x { position: absolute; left: 4%; bottom: 25%; color: var(--ink-3); font-size: 18px; line-height: 1; }

/* the making process: numbered sections, price lines, first-order note, checklist */
.pd-fsecs { display: grid; gap: 18px; }
.pd-fsec { scroll-margin-top: calc(var(--top) + 16px); }
.pd-parties { font-size: 15px; }
.pd-lines { display: grid; gap: 8px; }
.pd-lh, .pd-line { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, .8fr) minmax(0, .9fr) minmax(0, 1fr) minmax(0, .9fr) 44px; gap: 8px; align-items: center; }
.pd-lh { font-size: 13px; color: var(--ink-3); font-weight: 600; }
.pd-l-tot { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.pd-line .b.pd-l-del { min-width: 44px; padding: 0; font-size: 20px; }
.pd-ltot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pd-ltot:empty, .pd-fo:empty { display: none; }
.pd-ltot .ic, .pd-fo .ic { color: var(--ok); vertical-align: -4px; }
.pd-fo { font-weight: 600; color: var(--ink-2); font-size: 14.5px; }
.pd-ready { gap: 10px; }
.pd-ready-l { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pd-ready-l li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pd-ck { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line); font: 700 12px/1 var(--mono); color: var(--ink-2); }
.pd-ready-l li.ok .pd-ck { background: var(--ok); border-color: var(--ok); color: var(--accent-ink); }
.pd-ready-l li.ok { color: var(--ink-2); }

/* versions: the next one first */
.pd-hist .pd-by { display: block; }
.pd-hist li.pd-next { border-left-color: var(--wait); }

/* phones (390 px): chips wrap instead of pushing the page sideways; steppers use the full width */
@media (max-width: 860px) {
  .pd-list .row-side { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
  .pd-list .row-side .chip + .chip { margin-top: 0; }
  .pd-list .chip { white-space: normal; }
  .stepper.pd-num { max-width: none; }
  .pd-phs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-lh { display: none; }
  .pd-line { grid-template-columns: repeat(3, minmax(0, 1fr)) 44px; padding: 10px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--sunk); }
  .pd-line .pd-l-name { grid-column: 1 / 4; grid-row: 1; }
  .pd-line .pd-l-del { grid-column: 4; grid-row: 1; }
  .pd-line .pd-l-qty { grid-column: 1; grid-row: 2; }
  .pd-line .pd-l-unit { grid-column: 2; grid-row: 2; }
  .pd-line .pd-l-price { grid-column: 3 / 5; grid-row: 2; }
  .pd-line .pd-l-tot { grid-column: 1 / -1; grid-row: 3; text-align: left; }
  .pd-sig { width: 150px; height: 50px; }
  table.pd-lines-t th, table.pd-lines-t td { padding: 8px 6px; font-size: 14.5px; }
  table.pd-sigs th, table.pd-sigs td { padding: 8px 6px; }
}

/* section 4: recycled fabric at the fabric mill (stock in use has the ok line; batches on their way have a plain line) */
.pd-mill { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pd-mill li { display: grid; gap: 2px; padding-left: 14px; border-left: 2px solid var(--line); overflow-wrap: anywhere; }
.pd-mill li.pd-ok { border-left-color: var(--ok); }
.pd-mill li > span:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pd-mill small { font-size: 13.5px; }

/* section 3: fibre content (20 Nov). The chips show what each fibre means for mechanical recycling (the .chips small line,
   hidden elsewhere, shows here); a blend shows the amber warning line under them. Existing tokens only. */
.pd-fibre { display: grid; gap: 8px; }
.pd-fibre .chips label > span { flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; padding: 6px 16px; border-radius: 16px; text-align: left; }
.pd-fibre .chips label > span small { display: block; font-size: 12.5px; color: var(--ink-3); }
.pd-fibre .chips input:checked + span small { color: var(--accent-ink); }
.pd-fibre-live:empty { display: none; }
.pd-fibre-live .chip, .pd-fib .chip { white-space: normal; }
.pd-fib { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pd-fib-w { display: block; margin-top: 4px; }
