/* flow: pipeline sheet, completeness, quick edit (agent flow) */

/* ── file completeness ─────────────────────────────────────────────────────
   A thin native <progress> — no inline width — and the same number in words
   beside it, so the bar is never the only way to read it. */
.comp .card-body{display:grid; gap:8px}
.comp-bar{
  appearance:none; -webkit-appearance:none; display:block; width:100%; height:6px;
  border:0; border-radius:999px; overflow:hidden; background:var(--sys-gray5, var(--hair)); color:var(--navy);
}
.comp-bar::-webkit-progress-bar{background:var(--sys-gray5, var(--hair)); border-radius:999px}
.comp-bar::-webkit-progress-value{background:var(--accent, var(--navy)); border-radius:999px}
.comp-bar::-moz-progress-bar{background:var(--accent, var(--navy)); border-radius:999px}
.comp-say{margin:0; font-size:13px; color:var(--ink-2)}
.comp-note{margin:0; font-size:13px; color:var(--ink)}
.comp-missing{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:6px 16px}
.comp-missing li{display:grid; gap:1px; min-width:0}
.comp-missing .sub{font-size:12px; color:var(--ink-3)}
.comp-item{
  justify-self:start; display:inline-flex; align-items:center; min-height:28px; padding:2px 0; border:0; background:none;
  font:600 13px/1.3 var(--ui); color:var(--accent-ink, var(--navy)); text-align:left; text-decoration:none; cursor:pointer;
}
.comp-item:hover{text-decoration:underline}
.comp-item:focus-visible{outline:2px solid var(--navy); outline-offset:2px; border-radius:4px}
.comp-item.off{color:var(--ink); cursor:default}
.comp-item.off:hover{text-decoration:none}

/* ── click-to-edit on the Merchant card ──────────────────────────────────── */
.fact-group{margin:0; padding:12px 16px 4px; font:600 12px/1.3 var(--ui); color:var(--ink-3); border-top:1px solid var(--hair)}
.qe-card .card-head + .fact-group{border-top:0}
.qe-cell{display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; min-width:0}
.qe{
  display:inline-flex; align-items:baseline; gap:8px; max-width:100%; min-height:28px; margin:-3px -6px; padding:3px 6px;
  border:1px solid transparent; border-radius:6px; background:none; font:inherit; color:inherit; text-align:left; cursor:pointer;
}
.qe .qe-v{min-width:0; overflow-wrap:anywhere}
/* team T-30: link text is --accent-ink (5.4:1 light, 4.9:1 dark on the hover
   ground); --navy is the decoration blue, 4.02:1 on white. "Edit" never breaks
   inside the word: it keeps its width and the value beside it wraps instead. */
.qe .qe-add{flex:none; white-space:nowrap; font:500 11.5px/1.3 var(--ui); color:var(--accent-ink, var(--navy)); opacity:0; transition:opacity .12s}
.qe:hover,.qe:focus-visible{border-color:var(--hair); background:var(--surface-2, rgba(0,0,0,.03))}
.qe:hover .qe-add,.qe:focus-visible .qe-add{opacity:1}
.qe:focus-visible{outline:2px solid var(--navy); outline-offset:1px}
/* An empty cell says so: the dash at rest, "Add" the moment it is pointed at or focused. */
.qe.empty .qe-v{color:var(--ink-3); font-weight:400}
.qe.empty:hover .qe-v,.qe.empty:focus-visible .qe-v{display:none}
.qe-go{font:500 12px/1.3 var(--ui); color:var(--accent-ink, var(--navy))}
.qe-form{display:grid; gap:4px; width:100%; min-width:0}
.qe-in{width:100%; min-width:0; box-sizing:border-box; min-height:32px; padding:4px 8px; border:1px solid var(--line, var(--hair)); border-radius:6px; background:var(--surface); font:inherit; color:var(--ink)}
.qe-in:focus-visible{outline:2px solid var(--navy); outline-offset:1px}
.qe-in[aria-invalid="true"]{border-color:var(--bad)}
.qe-form .hint{font-size:11.5px; color:var(--ink-3); font-weight:400}
.qe-err{font-size:12px; font-weight:500; color:var(--bad)}
.qe-err:empty{display:none}
.qe-acts{display:none; gap:8px}
@media (prefers-reduced-motion: reduce){ .qe .qe-add{transition:none} }

/* A phone has no hover: every editable value is a 44px row that says "Edit" or
   "Add" outright, and its editor is a full-width 16px box with real buttons. */
@media (max-width: 640px), (hover: none){
  .qe{display:flex; justify-content:space-between; align-items:center; width:100%; min-height:44px; margin:0; padding:6px 0}
  .qe .qe-add{opacity:1}
  .qe.empty .qe-v{display:none}
  .qe.empty .qe-add::before{content:"— "; color:var(--ink-3)}
  .qe-go{display:inline-flex; align-items:center; min-height:44px}
  .qe-in{min-height:44px; font-size:16px}
  .qe-acts{display:flex}
  .qe-acts .btn{min-height:44px; flex:1}
  .comp-item{min-height:44px}
  .comp-missing{grid-template-columns:1fr}
}

/* ── the eight stages ──────────────────────────────────────────────────── */
.steps-8{flex-wrap:wrap; row-gap:8px}
.steps-8 .rail-x{min-width:10px}
.stage-ctl{display:grid; gap:10px}
.stage-move{display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px 14px}
.stage-move .field{min-width:200px; margin:0}
.stage-move .check-row{margin:0; max-width:46ch}
.stage-move .err{flex-basis:100%; font-size:12.5px; font-weight:500; color:var(--bad)}
.stage-move .err:empty{display:none}
.stage-how{margin:0}
.stage-wants .l{margin:0 0 4px; font:600 12px/1.3 var(--ui); color:var(--ink-3)}
.stage-wants ul{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:4px 16px; font-size:13px}
.stage-wants li{display:flex; align-items:center; gap:6px; color:var(--ink-2)}
.stage-wants li svg{width:14px; height:14px; flex:none}
.stage-wants li.yes svg{color:var(--ok)}
.stage-wants li.no{color:var(--ink)}
.stage-wants li.no svg{color:var(--sys-orange-text, #7A4B00)}
@media (max-width: 640px){
  .stage-move .field{min-width:0; flex:1 1 100%}
  .stage-move .btn{min-height:44px}
  .stage-move select{min-height:44px; font-size:16px}
}

/* ── the duplicate choice on an intake sheet ───────────────────────────── */
.dup-choice{margin:0 0 14px; padding:12px 14px; border:1px solid var(--sys-orange, #C77700); border-radius:10px; background:var(--sys-orange-tint, #FBF1DC); color:var(--ink)}
.dup-choice:focus-visible{outline:2px solid var(--navy); outline-offset:2px}
.dup-h{margin:0 0 2px; font:600 14px/1.3 var(--ui)}
.dup-choice .hint{margin:0 0 8px; color:var(--ink-2)}
.dup-list{list-style:none; margin:0; padding:0; display:grid; gap:10px}
.dup-row{padding:10px 12px; border-radius:8px; background:var(--surface); border:1px solid var(--hair)}
.dup-row p{margin:0}
.dup-name{font-size:14px}
.dup-name .sub{color:var(--ink-3)}
.dup-why{font-size:12.5px; font-weight:500; color:var(--ink)}
.dup-facts{font-size:12.5px; color:var(--ink-2); overflow-wrap:anywhere}
.dup-acts{display:flex; flex-wrap:wrap; gap:8px; margin-top:8px}
.dup-other{display:grid; gap:6px; margin-top:12px; padding-top:10px; border-top:1px solid var(--hair)}
.dup-other label{font-size:12.5px; color:var(--ink-2)}
.dup-reason{box-sizing:border-box; width:100%; min-height:32px; padding:4px 8px; border:1px solid var(--line, var(--hair)); border-radius:6px; background:var(--surface); font:inherit; color:var(--ink)}
.dup-other .btn{justify-self:start}
@media (max-width: 640px){
  .dup-acts .btn,.dup-other .btn{min-height:44px; flex:1 1 100%; justify-self:stretch}
  .dup-reason{min-height:44px; font-size:16px}
}

/* ── small things ──────────────────────────────────────────────────────── */
.intake-missing{margin:0 0 10px; color:var(--ink-2)}
.stale-set{border:0; margin:0; padding:0; min-width:0}
.stale-set legend{padding:0 0 2px; font-size:12px; font-weight:500; color:var(--ink)}
.stale-set .form-grid{margin-top:8px; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr))}
@media print{ .qe .qe-add,.qe-go,.comp-missing .comp-item{color:inherit} .stage-move,.dup-choice{display:none} }

/* ── next action (file page) ─────────────────────────────────────────────── */
.next-act{display:grid; gap:6px; padding-top:10px; border-top:1px solid var(--line, var(--hair))}
.next-act .l{margin:0; font:600 12px/1.3 var(--ui); color:var(--ink-3)}
.next-now{margin:0; display:flex; flex-wrap:wrap; align-items:center; gap:6px}
.next-now .inline-form{display:inline}
.next-set{display:flex; flex-wrap:wrap; align-items:flex-end; gap:10px 14px}
.next-set .field{min-width:180px; margin:0}
@media (max-width: 640px){
  .next-set .field{min-width:0; flex:1 1 100%}
  .next-set input{min-height:44px; font-size:16px}
  .next-set .btn, .next-now .btn{min-height:44px}
}

/* ══ sheet ══════════════════════════════════════════════════════════════════
   The pipeline sheet (flow, F part 2) — src/web/parts/sheet.ts, public/js/sheet.js.
   Everything below is the sheet's; the quick-edit styles above stay as they are.
   Tokens only, so light and dark both come from the theme. */

.sheet-mode{flex:none}
.sheet-page{display:grid; gap:10px; min-width:0}
.sheet-page[aria-busy="true"]{opacity:.7; transition:opacity .15s}

/* views bar */
.sheet-views{display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px}
.sv-list{display:flex; flex-wrap:wrap; gap:6px; min-width:0}
.sv{display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:4px 12px; border:1px solid var(--hair); border-radius:var(--r-pill, 999px);
  background:var(--surface); color:var(--ink-2); font:500 12.5px/1.2 var(--ui); text-decoration:none; white-space:nowrap}
.sv:hover{border-color:var(--line)}
.sv.on{background:var(--navy-tint); border-color:var(--navy); color:var(--ink); font-weight:600}
.sv:focus-visible{outline:2px solid var(--navy); outline-offset:2px}
.sv-sub,.sv-def{font-size:11px; font-weight:400; color:var(--ink-3)}
.sv-def::before{content:"· "}
.sv-acts{display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-left:auto}
.sv-changed{display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0; font-size:12.5px; color:var(--ink-2)}
.sv-changed .inline-form{display:inline}

/* small disclosure panels: the column chooser and the view options */
.sheet-pop{position:relative}
.sheet-pop>summary{list-style:none; cursor:pointer}
.sheet-pop>summary::-webkit-details-marker{display:none}
.sheet-pop-panel{position:absolute; right:0; top:calc(100% + 6px); z-index:30; min-width:230px; max-width:min(320px, 90vw); padding:12px;
  display:grid; gap:8px; background:var(--surface); border:1px solid var(--hair); border-radius:var(--r, 12px); box-shadow:var(--shadow-2)}
.pop-i{display:block; width:100%; min-height:32px; padding:4px 8px; border:0; border-radius:6px; background:none; text-align:left; font:400 13px/1.3 var(--ui); color:var(--ink); cursor:pointer}
.pop-i:hover,.pop-i:focus-visible{background:var(--surface-2)}
.pop-i.danger{color:var(--bad); border-top:1px solid var(--hair); border-radius:0}
.pop-note{margin:0; font-size:12px; color:var(--ink-3)}
.sc-list{border:0; margin:0; padding:0; display:grid; gap:2px}
.sc-list legend{padding:0 0 4px; font:600 12px/1.3 var(--ui); color:var(--ink-3)}

/* filters */
.sheet-filters{display:flex; flex-wrap:wrap; align-items:flex-end; gap:8px 10px}
.sf-search{display:flex; align-items:center; gap:6px; flex:1 1 220px; min-width:0; max-width:360px; min-height:32px; padding:0 10px;
  border:1px solid var(--input, var(--hair)); border-radius:var(--r-c, 8px); background:var(--surface); color:var(--ink-3)}
.sf-search svg{width:14px; height:14px; flex:none}
.sf-search input{flex:1; min-width:0; border:0; background:transparent; font:400 13px/1 var(--ui); color:var(--ink); padding:6px 0; outline:none}
.sf-search:focus-within{border-color:var(--ring, var(--navy)); box-shadow:0 0 0 3px var(--ring-tint, var(--navy-tint))}
.sf-field{display:grid; gap:2px}
.sf-l{font:500 11px/1.2 var(--ui); color:var(--ink-3)}
.sf-checks{display:flex; flex-wrap:wrap; gap:4px 12px; border:0; margin:0; padding:0 0 6px}
.sf-check{display:inline-flex; align-items:center; gap:6px; min-height:28px; font-size:12.5px; color:var(--ink-2); cursor:pointer}
.sf-acts{display:flex; align-items:center; gap:8px; margin-left:auto}

/* today strip */
.sheet-today{display:flex; flex-wrap:wrap; gap:8px}
.td-i{display:inline-flex; align-items:baseline; gap:5px; min-height:32px; padding:6px 12px; border-radius:var(--r-c, 8px);
  background:var(--surface); border:1px solid var(--hair); color:var(--ink-2); font-size:12.5px; text-decoration:none}
.td-i b{font-variant-numeric:tabular-nums; color:var(--ink)}
.td-i.bad{border-color:var(--bad); color:var(--bad)}
.td-i.bad b{color:var(--bad)}
.td-i.warn{border-color:var(--hold); color:var(--hold)}
.td-i.warn b{color:var(--hold)}

/* bulk bar */
.sheet-bulk{flex-wrap:wrap; border:1px solid var(--hair); border-radius:var(--r, 12px)}
.bk-f{display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:var(--ink-2)}
.bk-f select,.bk-f input{min-height:30px; padding:2px 8px; border:1px solid var(--input, var(--hair)); border-radius:6px; background:var(--surface); color:var(--ink); font:inherit}
.bk-c{display:inline-flex; align-items:center; gap:6px; font-size:12.5px; color:var(--ink-2)}
.sheet-bulk [data-sheet-go]{margin-left:auto}

/* the table */
.sheet-wrap.tall{max-height:min(76vh, 900px)}
table.sheet-t{font-variant-numeric:tabular-nums}
table.sheet-t td,table.sheet-t th{vertical-align:middle}
table.sheet-t .sub{display:block; font-size:11.5px; color:var(--ink-3); font-weight:400}
table.sheet-t .c-business{min-width:180px; max-width:280px}
table.sheet-t .c-business a{font-weight:600}
table.sheet-t .c-next{min-width:160px; max-width:260px}
table.sheet-t .c-tags{max-width:200px}
table.sheet-t .r .fig{white-space:nowrap}
table.sheet-t tr[data-row]:focus{outline:2px solid var(--navy); outline-offset:-2px}
table.sheet-t tr[data-row]:focus-visible{outline:2px solid var(--navy); outline-offset:-2px}
table.sheet-t tr.sel{background:var(--navy-tint)}
.sg-total .sg-tot>*{font-weight:600; background:var(--surface-2); border-bottom:1px solid var(--separator-2, var(--hair))}
.sg-h>th{padding:0 !important; background:var(--surface-2); border-top:1px solid var(--hair); border-bottom:1px solid var(--hair-2); text-align:left}
.sg-row{display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; padding:6px 16px}
.sg-t{display:inline-flex; align-items:center; gap:6px; min-height:32px; padding:0; border:0; background:none; font:600 13px/1.2 var(--ui); color:var(--ink); cursor:pointer}
.sg-t svg{width:12px; height:12px; transition:transform .12s; color:var(--ink-3)}
.sg-t[aria-expanded="false"] svg{transform:rotate(-90deg)}
.sg-t:disabled{cursor:default}
.sg-t:focus-visible{outline:2px solid var(--navy); outline-offset:2px; border-radius:4px}
.sg-n{font-size:12px; color:var(--ink-3); font-weight:400}
.sg-sum{font-size:12.5px; font-weight:600; color:var(--ink); font-variant-numeric:tabular-nums}
.sg-pick{display:inline-flex; align-items:center; gap:6px; margin-left:auto; font-size:12px; font-weight:400; color:var(--ink-3); cursor:pointer}
tbody.sg.collapsed>tr:not(.sg-h){display:none}
.sg-empty td{padding:8px 16px !important; font-size:12.5px; color:var(--ink-3)}
.sg-more td{padding:8px 16px !important}

/* cells that edit */
.sc-e{display:inline-flex; flex-wrap:wrap; align-items:baseline; gap:4px; max-width:100%; min-height:28px; margin:-3px -6px; padding:3px 6px;
  border:1px solid transparent; border-radius:6px; background:none; font:inherit; color:inherit; text-align:inherit; cursor:pointer}
td.r .sc-e{flex-direction:column; align-items:flex-end}
.sc-e:hover,.sc-e:focus-visible{border-color:var(--hair); background:var(--surface-2)}
.sc-e:focus-visible{outline:2px solid var(--navy); outline-offset:1px}
.sc-e.empty{color:var(--ink-3)}
.sc-how{max-width:22ch}
.sc-pop{display:grid; gap:6px; min-width:200px; max-width:320px}
.sc-in{width:100%; box-sizing:border-box; min-height:32px; padding:4px 8px; border:1px solid var(--input, var(--hair)); border-radius:6px; background:var(--surface); color:var(--ink); font:inherit}
.sc-in:focus-visible{outline:2px solid var(--navy); outline-offset:1px}
.sc-in[aria-invalid="true"]{border-color:var(--bad)}
.sc-err{margin:0; font-size:12px; font-weight:500; color:var(--bad); white-space:normal}
.sc-err:empty{display:none}
.sc-missing{margin:4px 0; padding-left:18px; color:var(--ink)}
.sc-note{font-size:11.5px; font-weight:400; color:var(--ink-3)}
.sc-acts{display:flex; flex-wrap:wrap; align-items:center; gap:6px}
.sc-more{display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:6px; color:var(--ink-3)}
.sc-more:hover,.sc-more:focus-visible{background:var(--surface-2); color:var(--ink)}
.sc-more svg{width:16px; height:16px}
.sc-comp{display:inline-flex; align-items:center; gap:8px; justify-content:flex-end}
.sc-comp .comp-bar{width:56px}

/* marks: always a word, never colour alone */
.stale-m,.due-m{display:inline-block; font:500 11px/1.3 var(--ui); white-space:nowrap; border-radius:var(--r-pill, 999px); padding:1px 7px; border:1px solid currentColor}
.stale-m.warn,.due-m.warn{color:var(--hold); background:var(--hold-tint)}
.stale-m.bad,.due-m.bad{color:var(--bad); background:var(--bad-tint)}
.tag-chip{display:inline-block; margin:1px 4px 1px 0; padding:0 7px; border-radius:var(--r-pill, 999px); background:var(--wait-tint); color:var(--ink-2); font-size:11.5px; line-height:1.6}

/* the board's cards say the same things */
.deal .m .stale.very{color:var(--bad); border-color:var(--bad)}
.deal .nx{margin:6px 0 0; font-size:12px; color:var(--ink-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.deal .nx.bad{color:var(--bad)}
.deal .nx.warn{color:var(--hold)}

/* the row sheet, the bulk result, the shortcut list */
.sr-name{margin:0 0 6px; font:600 15px/1.3 var(--ui)}
.sr-f{display:grid; gap:6px; padding:10px 0; border-top:1px solid var(--hair-2)}
.sr-h{margin:0; font:600 12px/1.3 var(--ui); color:var(--ink-3)}
.sr-how{margin:0; font-size:12.5px}
.br-list{margin:0 0 12px; padding-left:18px; display:grid; gap:4px; font-size:13px}
.keys{display:grid; grid-template-columns:auto 1fr; gap:8px 16px; margin:0; font-size:13px}
.keys dt{white-space:nowrap}
.keys dd{margin:0; color:var(--ink-2)}
.keys kbd,.sheet-hint kbd{font:500 11px/1 var(--ui); border:1px solid var(--separator, var(--hair)); border-radius:5px; padding:3px 6px; background:var(--surface-2); color:var(--ink)}
.sheet-hint{margin:0; font-size:12px}

/* A phone gets a grouped card list: the same rows, laid out as cards. 44px
   targets, 16px inputs, nothing wider than the screen. */
@media (max-width: 600px){
  .sheet-views{gap:8px}
  .sv-list{flex-wrap:nowrap; overflow-x:auto; padding-bottom:2px; max-width:100%}
  .sv{min-height:44px}
  .sv-acts{margin-left:0}
  .sheet-filters{display:grid; grid-template-columns:1fr 1fr; align-items:end}
  .sf-search{grid-column:1 / -1; max-width:none; min-height:44px}
  .sf-search input{font-size:16px}
  .sf-field select{min-height:44px; font-size:16px; width:100%}
  .sf-checks{grid-column:1 / -1}
  .sf-check{min-height:44px}
  .sf-acts{grid-column:1 / -1; margin-left:0}
  .sf-acts .btn,.sheet-pop>summary{min-height:44px}
  .sheet-pop-panel{position:fixed; left:12px; right:12px; top:auto; bottom:calc(70px + env(safe-area-inset-bottom)); max-width:none}
  .td-i{min-height:44px; flex:1 1 0; justify-content:center; align-items:center}
  .bk-f{flex:1 1 100%}
  .bk-f select,.bk-f input{min-height:44px; font-size:16px; flex:1}
  .bk-c{min-height:44px}
  .sheet-wrap.tall{max-height:none; overflow:visible}
  table.sheet-t{min-width:0 !important; width:100%}
  table.sheet-t thead{display:none}
  table.sheet-t tbody,table.sheet-t tr.sg-h,table.sheet-t tr.sg-h>th{display:block}
  table.sheet-t tr[data-row]{display:grid; grid-template-columns:auto minmax(0,1fr) auto; gap:2px 10px; padding:10px 12px; border-bottom:1px solid var(--hair-2)}
  table.sheet-t tr[data-row]>*{display:block; padding:0 !important; border:0; height:auto; grid-column:2; text-align:left; min-width:0; max-width:none}
  table.sheet-t tr[data-row]>td.pick{grid-column:1; grid-row:1 / span 3}
  table.sheet-t tr[data-row]>td.act{grid-column:3; grid-row:1}
  table.sheet-t tr[data-row]>.ph-hide{display:none}
  table.sheet-t tr[data-row]>td[data-label]:not(.c-amount):not(.c-days)::before{content:attr(data-label) " "; color:var(--ink-3); font-size:11px}
  table.sheet-t tr[data-row]>.c-business{font-size:15px}
  table.sheet-t tr[data-row]>td.c-amount .sub{display:inline; margin-left:6px}
  table.sheet-t .sc-comp{justify-content:flex-start}
  table.sheet-t .sc-e{min-height:44px; align-items:center}
  table.sheet-t td.r .sc-e{flex-direction:row; align-items:center}
  .sc-more{width:44px; height:44px}
  .sc-in{min-height:44px; font-size:16px}
  .sg-row{padding:8px 12px}
  .sg-t{min-height:44px}
  .sg-pick{min-height:44px; margin-left:0}
  .sg-total{display:block}
  .sg-total .sg-tot{display:flex; flex-wrap:wrap; gap:4px 12px; padding:8px 12px}
  .sg-total .sg-tot>*{padding:0 !important; border:0; background:none}
  .sg-total .sg-tot>td:empty{display:none}
  .sr-f .btn,.sr-f select,.sr-f input{min-height:44px}
  .sr-f select,.sr-f input{font-size:16px}
}
@media (prefers-reduced-motion: reduce){ .sg-t svg{transition:none} .sheet-page[aria-busy="true"]{transition:none} }
@media print{
  .sheet-bulk,.sheet-filters,.sheet-views .sv-acts,.sheet-today,.sheet-hint,.sheet-mode,
  table.sheet-t .pick,table.sheet-t .act,.sg-pick{display:none !important}
  .sheet-wrap.tall{max-height:none; overflow:visible}
  tbody.sg.collapsed>tr:not(.sg-h){display:table-row}
  .sc-e{border:0; padding:0; margin:0}
}

/* ── agent V (round 4, measured in a browser) ───────────────────────────────
   The filters fold under one "Filters" line on a phone and are always out at
   desk width; the bulk bar shows its controls only once a file is ticked; the
   person, stage and owner cells stay on one line. */
.sheet-page{grid-template-columns:minmax(0, 1fr)}
.sf-fold-t{position:absolute; width:1px; height:1px; opacity:0; pointer-events:none}
.sf-fold-l{display:none}
.sf-body{display:contents}
.sv.on .sv-sub,.sv.on .sv-def{color:var(--ink-2)}
.sheet-bulk:not(.has-sel) .bk-f,.sheet-bulk:not(.has-sel) .bk-c,.sheet-bulk:not(.has-sel) [data-sheet-go]{display:none}
.sheet-bulk:not(.has-sel) .bulk-n{font-weight:400; color:var(--ink-2)}
table.sheet-t td.c-owner,table.sheet-t td.c-underwriter,table.sheet-t td.c-stage,table.sheet-t td.c-amount{white-space:nowrap}
table.sheet-t td.c-stage .sc-how{white-space:normal}
/* a ticked row is tinted, and the third grey under it fell to 4.3:1 */
table.sheet-t tr.sel .stale-m,table.sheet-t tr.sel .due-m{background:var(--surface)}
table.sheet-t tr.sel .mut,table.sheet-t tr.sel .sc-e.empty,table.sheet-t tr.sel .sub,table.sheet-t tr.sel td.c-updated{color:var(--ink-2)}
@media (max-width: 600px){
  .sheet-views>*{min-width:0}
  .sv-list{flex:1 1 100%}
  .sf-fold-l{display:flex; grid-column:1 / -1; align-items:center; gap:6px; min-height:44px; padding:0 2px; cursor:pointer;
    font:600 14px/1.2 var(--ui); color:var(--accent-ink, var(--navy))}
  .sf-fold-l::before{content:"+"; display:inline-block; width:12px; text-align:center}
  .sf-fold-t:checked ~ .sf-fold-l::before{content:"−"}
  .sf-fold-n{font-weight:400; color:var(--ink-2)}
  .sf-fold-t:focus-visible ~ .sf-fold-l{box-shadow:var(--focus-ring); border-radius:var(--r-s, 4px)}
  .sf-body{display:none}
  .sf-fold-t:checked ~ .sf-body{display:contents}
  .sf-check input[type="checkbox"],.bk-c input[type="checkbox"],.sg-pick input[type="checkbox"]{
    appearance:none; -webkit-appearance:none; width:44px; height:44px; margin:0 -8px 0 -11px; padding:0; flex:none; border:0;
    background:transparent; cursor:pointer; display:grid; place-items:center}
  .sf-check input[type="checkbox"]::before,.bk-c input[type="checkbox"]::before,.sg-pick input[type="checkbox"]::before{
    content:""; width:22px; height:22px; box-sizing:border-box; border-radius:6px; border:1.5px solid var(--line); background:var(--surface)}
  .sf-check input[type="checkbox"]:checked::before,.bk-c input[type="checkbox"]:checked::before,.sg-pick input[type="checkbox"]:checked::before{
    background:var(--sys-blue) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.5 8.5 6.5 11.5 12.5 5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/16px no-repeat;
    border-color:var(--sys-blue)}
  .sf-check input[type="checkbox"]:focus-visible::before,.bk-c input[type="checkbox"]:focus-visible::before,.sg-pick input[type="checkbox"]:focus-visible::before{box-shadow:var(--focus-ring)}
  .sheet-bulk:not(.has-sel){padding-top:4px; padding-bottom:4px}
  .sf-search input{min-height:44px; padding:0}
  .bk-f>span{flex:none}
  .bk-f select,.bk-f input{min-width:0; width:100%}
  table.sheet-t td.c-owner,table.sheet-t td.c-underwriter,table.sheet-t td.c-stage,table.sheet-t td.c-amount{white-space:normal}
  .sv-list{scrollbar-width:none}
  .sv-list::-webkit-scrollbar{display:none}
  /* a band's heading grows with its second line ("Select all in this group");
     the kit's 40px cell height drew that line over the first card */
  table.sheet-t tr.sg-h>th{height:auto}
  .sg-pick{flex:1 1 100%}
  /* The card: the tick and the ⋯ sit in the corners, the values two to a line
     (name and next action take the whole line) — half the height of one per line. */
  table.sheet-t tr[data-row]{grid-template-columns:44px minmax(0,1fr) minmax(0,1fr) 44px; gap:0 10px; padding:6px 4px 10px}
  table.sheet-t tr[data-row]>*{grid-column:auto}
  table.sheet-t tr[data-row]>td.pick{grid-column:1; grid-row:1 / span 12}
  table.sheet-t tr[data-row]>td.act{grid-column:4; grid-row:1 / span 12}
  table.sheet-t tr[data-row]>.c-business{grid-column:2 / 4; min-height:44px; display:flex; flex-wrap:wrap; align-items:center; gap:0 6px}
  table.sheet-t tr[data-row]>.c-next,table.sheet-t tr[data-row]>.c-owner{grid-column:2 / 4}
  table.sheet-t tr[data-row]>td.c-days{align-self:center}
  table.sheet-t tr[data-row]>td.c-days::before{content:"In stage "; color:var(--ink-3); font-size:11px}
  table.sheet-t tr[data-row]>td[data-label]:not(.ph-hide){display:flex; align-items:center; flex-wrap:wrap; gap:0 4px}
  /* with a file ticked the bar is fixed above the tab bar: two controls to a line */
  .sheet-bulk.has-sel{display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:6px 8px; padding:8px 12px; max-height:60vh; overflow:auto}
  .sheet-bulk.has-sel>.help{display:none}
  .sheet-bulk.has-sel .bulk-n{align-self:center}
  .sheet-bulk.has-sel .bk-f{flex:none; min-width:0}
  .sheet-bulk.has-sel .bk-c,.sheet-bulk.has-sel [data-sheet-go]{grid-column:1 / -1; margin-left:0}
  .sheet-bulk.has-sel [data-sheet-go]{justify-content:center}
  .page:has(.sheet-bulk.has-sel){padding-bottom:calc(300px + env(safe-area-inset-bottom))}
}

/* ══ P: file page polish ══
   The completeness strip in a few lines (agent P, flow round 4): heading, bar and
   "3 of 13 · 20%" on one line; the top three missing as small buttons; the rest
   folded under "and N more", one line each. Agent V does not edit this block. */
.comp-tight .card-body{display:grid; gap:8px; padding-top:10px; padding-bottom:10px}
.comp-line{display:flex; align-items:center; gap:8px 10px; flex-wrap:wrap; min-width:0}
.comp-line h2{margin:0; font:600 13px/1.3 var(--ui); letter-spacing:-.01em; color:var(--ink)}
.comp-tight .comp-line .comp-bar{flex:1 1 120px; width:auto; min-width:80px; max-width:320px}
.comp-n{font-size:13px; color:var(--ink-2); font-variant-numeric:tabular-nums; white-space:nowrap}
.comp-top{list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:6px}
.comp-top li{min-width:0}
.comp-chip{max-width:100%; white-space:normal; text-align:left}
.comp-chip.off{display:inline-flex; align-items:center; min-height:28px; padding:2px 10px; border:1px solid var(--hair); border-radius:8px; font-size:13px; color:var(--ink)}
.comp-settle{font-weight:400; color:var(--ink-3)}
.comp-more{font-size:13px}
.comp-more>summary{cursor:pointer; color:var(--accent-ink, var(--navy)); font-weight:600; width:max-content; min-height:28px; display:flex; align-items:center}
.comp-more>summary:focus-visible{outline:2px solid var(--navy); outline-offset:2px; border-radius:4px}
.comp-rest{list-style:none; margin:4px 0 0; padding:0; display:grid; gap:2px}
.comp-rest li{min-width:0; overflow-wrap:anywhere}
.comp-rest .comp-item{display:inline; min-height:0; padding:0}
.comp-rest .sub{font-size:12px; color:var(--ink-3)}
.comp-done{margin-left:auto}
@media (max-width: 640px){
  .comp-top{display:grid; grid-template-columns:1fr}
  .comp-chip{min-height:44px; width:100%}
  .comp-more>summary{min-height:44px}
  .comp-rest li{min-height:44px; display:flex; align-items:center; flex-wrap:wrap}
  .comp-rest .comp-item{display:inline-flex; align-items:center; min-height:44px}
}
@media print{ .comp-chip{border:0; padding:0} }
