/* T-018 Provider pipeline (ext/pipeline.js). Reuses the add-provider pieces of watch.css (.addprov-*) for the add sheet. */

/* Signing goal stat: "Signed 28 of 50 · by 31 Dec" with a thin progress bar */
.pipe-goal { min-width: 168px; }
.pipe-goal .k { gap: 6px; }
.pipe-setgoal { font-size: var(--t-xs); padding: 2px 6px; margin-left: 2px; }
.pipe-bar { display: block; width: 100%; height: 6px; margin-top: 6px; border-radius: 3px; overflow: hidden; background: color-mix(in srgb, var(--ink) 8%, transparent); }
.pipe-bar span { display: block; height: 100%; background: var(--brand); border-radius: 3px; transition: width var(--t-med) var(--ease-std); }
.pipe-num { font: inherit; color: inherit; letter-spacing: inherit; border-radius: 6px; padding: 0 2px; margin: 0 -2px; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 22%, transparent); text-underline-offset: 3px; }
.pipe-num:hover { text-decoration-color: currentColor; }
.pipe-num:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.pipe-num.sm { font-weight: 600; }

/* Lead sentence above the table */
.pipe-lead { margin: 12px 0 8px; font-size: var(--t-sm); color: var(--ink-2); text-wrap: pretty; }
.pipe-lead-n { font: inherit; color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 22%, transparent); text-underline-offset: 3px; border-radius: 4px; }
.pipe-lead-n:hover { text-decoration-color: currentColor; }

/* Table cells */
.pipe-table .pipe-note { white-space: normal; min-width: 200px; color: var(--ink-2); font-size: var(--t-sm); }
.pipe-stage { height: 30px; padding: 0 26px 0 10px; background: var(--surface); }
.pipe-stage .ui-select-btn { font-weight: 500; }
.pipe-stage .caret { right: 8px; }
.pipe-stuck { display: inline-flex; align-items: center; gap: 4px; color: var(--warn-text, var(--warn)); font-weight: 600; }
.pipe-unc { display: block; font-size: var(--t-xs); color: var(--ink-3); font-weight: 400; white-space: nowrap; }
.pipe-collect { color: var(--ink-3); text-align: left !important; }
.pipe-collect .ico { vertical-align: -2px; margin-right: 6px; }
.pipe-src { display: flex; align-items: center; gap: 4px; margin-top: 5px; padding-left: 11px; font-size: var(--t-xs); color: var(--ink-3); white-space: nowrap; }
.pipe-src.sug { color: var(--ink-2); }
.pipe-stagecell { min-width: 150px; }
.pipe-word { margin-left: 2px; }

/* Not signing */
.pipe-reasons { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 14px; }
.pipe-reasons .micro { margin-right: 4px; }
.pipe-reasons .chip b { margin-left: 4px; font-weight: 600; }
.pipe-reason { white-space: normal !important; min-width: 180px; }
.pipe-reason small { display: block; margin-top: 4px; font-size: var(--t-xs); color: var(--ink-3); text-wrap: pretty; }
.pipe-back { margin: 2px 4px 2px 0; }
.pipe-back-t { display: inline-flex; align-items: center; gap: 4px; color: var(--pos-text); font-weight: 600; white-space: nowrap; }
.pipe-nw { white-space: nowrap; }
.pcard .row.pipe-row { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.pcard .row.pipe-row > span { flex-direction: row; align-items: center; }
.risk-stripe.pipe-stripe { --rc: var(--pos); }
.pipe-ns .honest-word { display: block; max-width: 120px; margin-left: auto; font-size: var(--t-xs); color: var(--ink-3); font-weight: 400; white-space: normal; text-align: right; }
.pipe-reason { max-width: 240px; }
.pipe-backbtn { padding-inline: 10px; }
.pipe-kv .kv-row > span:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; white-space: normal; }
.pipe-kv .kv-row small { font-size: var(--t-xs); color: var(--ink-3); white-space: normal; text-wrap: pretty; }
.pipe-kv .kv-row > span:last-child:not(:first-child) { flex: none; max-width: 45%; text-align: right; }
button.honest-word, a.honest-word { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--ink) 22%, transparent); text-underline-offset: 2px; }

/* Drawer */
.pipe-stage-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pipe-stage-d { height: 36px; background: var(--surface); }
.pipe-instage { font-size: var(--t-sm); color: var(--ink-2); }
.pipe-srcline { margin: 8px 0 0; font-size: var(--t-xs); color: var(--ink-3); }
.pipe-link { word-break: break-all; }
.pipe-actions { margin-top: 12px; }
.pipe-hist { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.pipe-hist li { position: relative; display: flex; flex-direction: column; gap: 2px; font-size: var(--t-sm); }
.pipe-hist li::before { content: ""; position: absolute; left: -19px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-2); }
.pipe-hist li:first-child::before { border-color: var(--brand); background: var(--brand); }
.pipe-hist b { font-weight: 600; }
.pipe-hist b .muted { font-weight: 400; }
.pipe-hist span { font-size: var(--t-xs); color: var(--ink-3); }
.pipe-variants { display: flex; flex-direction: column; gap: 8px; }
.pipe-form .fl .field { height: 40px; }
.pipe-dist .ui-select-btn { max-width: none; width: 100%; text-align: left; }
.pipe-dist { width: 100%; box-sizing: border-box; }
.pipe-file { cursor: pointer; }
.pipe-file:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.pipe-imp .kv-row { align-items: center; }
.pipe-imp-act { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.pipe-csv .d-section + .d-section { margin-top: 18px; }

/* Hand-off by role and own actions (inside the drawer's reply-actions row) */
.pipe-acts { display: contents; }
.pipe-inactive + .pipe-inactive { padding-top: 16px; border-top: 1px solid var(--line); }
.pipe-inactive .pipe-stage-row { margin-top: 10px; }

@media (max-width: 767px) {
  .pipe-goal { min-width: 0; flex: 1 1 100%; }
  .pipe-lead { margin-top: 4px; }
  .toolbar .addprov-tools:has(> [data-action="pipe-csv"]) { grid-template-columns: minmax(0, 1fr) auto auto; }
  .toolbar .addprov-tools > [data-action="pipe-csv"] { grid-column: auto; grid-row: 1; justify-self: start; }
  .toolbar .addprov-tools:has(> [data-action="pipe-csv"]) > .psort-group { grid-column: 1; grid-row: 1; }
  .toolbar .addprov-tools:has(> [data-action="pipe-csv"]) > .addprov-add { grid-column: 3; grid-row: 1; }
  .toolbar .addprov-tools:has(> [data-action="pipe-csv"]) > [data-action="pipe-csv"] { grid-column: 2; }
  .toolbar .addprov-tools:has(> .psort-group) .pipe-word { display: none; }
}

/* Filters (To sign stages, Not signing reasons + Back in view): one choice at a time, remembered per person */
.pipe-filter-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pipe-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.pipe-filter-row .pipe-filter { margin-top: 0; }
.pipe-filter-row { margin-top: 14px; }
.pipe-fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: var(--t-sm); font-weight: 500; transition: background-color var(--t-fast) var(--ease-std), border-color var(--t-fast) var(--ease-std), color var(--t-fast) var(--ease-std); }
.pipe-fchip b { font-weight: 600; color: var(--ink-3); }
.pipe-fchip:hover { border-color: var(--ink-3); color: var(--ink); }
.pipe-fchip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.pipe-fchip[aria-pressed="true"] b { color: inherit; opacity: 0.75; }
.pipe-fchip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
/* Mood now: wide enough for "Not a clear change yet" on one line */
.pipe-ns .pipe-moodcell { min-width: 140px; }
.pipe-ns td.pipe-backcell { white-space: normal; min-width: 130px; max-width: 200px; }
.pipe-ns .pipe-moodcell .honest-word { max-width: 170px; white-space: normal; }
/* The drawer title already names the provider: the header block keeps the logo and the sub line (UX review P1) */
#drawerBody .detail-inner > .p-name:first-child > div > b { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 767px) {
  .pipe-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -2px; padding: 2px; }
  .pipe-filter::-webkit-scrollbar { display: none; }
  .pipe-fchip { flex: none; }
  .pipe-filter-row { flex-wrap: nowrap; }
  .pipe-filter-row .pipe-filter { flex: 1; min-width: 0; }
}

/* D-70: while a tab swaps, its ghosts keep the old layout's width; clip them so a resize mid-swap (slow WebKit) never widens the page */
#view.swap-in { overflow-x: clip; }
