/* SyntaxFlow — job reports and checklists (job-ui.js, checklist-ui.js).
   ===========================================================================
   On top of base.css and sf.css: the desk uses the site's tokens, so light
   and dark come free; the paper is black ink on white, always, like every
   document in sf.css. Phone first: at 360 px every row folds to one column.
   =========================================================================== */

/* ---------- desk: rows of people, materials, operations ---------- */
.j-line{ display:grid; grid-template-columns:minmax(0,2fr) minmax(0,1.3fr) minmax(0,.9fr) auto; gap:0 10px; align-items:end; padding-top:8px; border-top:1px dashed var(--rule-2); min-width:0; }
.j-line:first-of-type{ border-top:0; padding-top:0; }
.j-line .field{ margin-bottom:10px; }
.j-line .field label{ font-size:.84rem; margin-bottom:4px; }
.j-line input,.j-line select,.j-line textarea{ width:100%; min-width:0; }
.j-op{ grid-template-columns:minmax(0,1fr) auto; }
.j-op textarea,.c-edit textarea,.c-notef textarea{ min-height:0; height:auto; }
.j-acts{ display:flex; gap:4px; margin-bottom:12px; }
.j-acts .btn{ min-height:34px; padding:2px 10px; }
.j-flags{ grid-column:1 / -1; display:flex; flex-wrap:wrap; gap:4px 8px; margin:-4px 0 6px; }
.j-flags:empty{ display:none; }
.j-foot{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 16px; }
.j-total{ margin:0; font-weight:640; font-variant-numeric:tabular-nums; color:var(--ink); }
@media (max-width:640px){
  .j-line{ grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
  .j-line .j-name{ grid-column:1 / -1; }
  .j-line .j-acts{ grid-column:1 / -1; justify-content:flex-end; margin-top:-4px; }
  .j-op{ grid-template-columns:minmax(0,1fr); }
}

/* ---------- desk: checklist ---------- */
.c-head{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 16px; }
.c-sum{ flex:1 1 260px; display:grid; gap:6px; min-width:0; }
.c-sum-txt{ margin:0; font-size:.92rem; color:var(--ink); font-variant-numeric:tabular-nums; }
.c-sum-bar{ display:flex; height:6px; border-radius:3px; overflow:hidden; background:var(--paper-2); }
.c-sum-bar i{ display:block; height:100%; width:0; transition:width .25s; }
.c-sum-bar i.ok{ background:var(--pass); }
.c-sum-bar i.na{ background:var(--ink-3); }
.c-sum-bar i.issue{ background:var(--fail); }
.c-sec{ gap:6px; }
.c-sec-h{ display:flex; flex-wrap:wrap; align-items:end; gap:4px 10px; }
.c-sec-h .grow{ flex:1 1 220px; }
.c-item{ display:grid; gap:6px; padding:10px 0 10px 12px; border-top:1px solid var(--rule); border-left:3px solid transparent; min-width:0; }
.c-sec > h2 + .c-item,.c-sec-h + .c-item{ border-top:0; }
.c-item.ok{ border-left-color:var(--pass); }
.c-item.na{ border-left-color:var(--rule-2); }
.c-item.issue{ border-left-color:var(--fail); }
.c-text{ margin:0; color:var(--ink); line-height:1.45; }
.c-item.na .c-text{ color:var(--ink-2); }
.c-state{ display:flex; flex-wrap:wrap; gap:6px; }
.c-st-btn{ min-height:40px; min-width:64px; padding:0 14px; border:1.5px solid var(--rule-2); border-radius:999px; background:var(--surface); color:var(--ink-2); font:inherit; font-size:.92rem; font-weight:620; cursor:pointer; }
.c-st-btn:hover{ border-color:var(--ink-3); color:var(--ink); }
.c-st-btn:focus-visible{ outline:3px solid var(--glass); outline-offset:2px; }
.c-st-btn[disabled]{ cursor:not-allowed; opacity:.75; }
.c-st-btn.ok[aria-pressed="true"]{ background:var(--pass); border-color:var(--pass); color:#fff; }
.c-st-btn.na[aria-pressed="true"]{ background:var(--ink-2); border-color:var(--ink-2); color:var(--surface); }
.c-st-btn.issue[aria-pressed="true"]{ background:var(--fail); border-color:var(--fail); color:#fff; }
@media (prefers-color-scheme: dark){ .c-st-btn.ok[aria-pressed="true"],.c-st-btn.issue[aria-pressed="true"]{ color:#0b1115; } }
.c-item-acts{ display:flex; flex-wrap:wrap; gap:6px; }
.c-item .field{ margin-bottom:4px; }
.c-item .s-photos{ grid-template-columns:repeat(auto-fill,minmax(130px,1fr)); }
.c-edit{ display:flex; flex-wrap:wrap; align-items:end; gap:4px 10px; }
.c-edit .grow{ flex:1 1 240px; }
.fw-issue-notes{ margin:0 0 4px; padding-left:20px; color:var(--ink-2); display:grid; gap:4px; }

/* ---------- paper: shared ---------- */
.sf-doc .d-sec{ font-size:9.5pt; text-transform:uppercase; letter-spacing:.08em; margin:6mm 0 2mm; color:#1f2547; break-after:avoid; }
.sf-doc .d-sec:first-of-type{ margin-top:2mm; }
.j-ops{ margin:0 0 2mm; padding-left:6mm; display:grid; gap:1.4mm; }
.j-ops li{ break-inside:avoid; }
.sf-sheet.sf-doc .j-crew,.sf-sheet.sf-doc .j-mats{ margin-top:4mm; }
.j-accept{ margin-top:8mm; padding:3.5mm 4mm; border:.35mm solid #1f2547; border-radius:1.5mm; break-inside:avoid; }
.j-accept h3{ font-size:8pt; text-transform:uppercase; letter-spacing:.1em; margin:0 0 2.5mm; }
.j-acc-grid{ display:grid; grid-template-columns:1fr 1fr; gap:4mm 8mm; }
.j-acc-grid > div{ display:grid; gap:1mm; }
.j-lab{ font-size:7.6pt; color:#4a525c; text-transform:uppercase; letter-spacing:.06em; }
.j-val{ display:block; min-height:6mm; padding-bottom:1mm; border-bottom:.25mm solid #9aa3ad; font-size:10pt; font-weight:600; }
.j-val.j-sign{ min-height:16mm; }
.j-remarks{ margin-top:3mm !important; font-size:8.8pt; }
.j-legal{ margin-top:3mm !important; font-size:7.4pt; color:#4a525c; font-style:italic; }

/* ---------- paper: checklist ---------- */
.sf-sheet.sf-doc .c-list{ width:100%; font-size:8.9pt; }
.c-list td{ padding:1.6mm 2mm; border-bottom:.2mm solid #d9dde3; vertical-align:top; }
.c-list td.c-n{ padding-left:0; color:#69727d; font-variant-numeric:tabular-nums; }
.c-list td.c-st{ padding-right:0; text-align:right; white-space:nowrap; font-weight:650; }
.c-row.ok td.c-st{ color:#1d6b45; }
.c-row.na td.c-st{ color:#69727d; font-weight:500; }
.c-row.issue td.c-st{ color:#b5381f; }
.c-row.open td.c-st{ color:#1b1f24; font-size:11pt; font-weight:400; }
.c-row.issue td{ background:#fdf3f0; }
.c-note{ display:block; margin-top:.8mm; color:#4a525c; font-style:italic; }
.c-issues{ margin-top:6mm; padding:3mm 4mm; border:.4mm solid #b5381f; border-radius:1.5mm; font-size:8.8pt; break-inside:avoid; }
.c-issues h3{ color:#b5381f; font-size:8pt; text-transform:uppercase; letter-spacing:.08em; margin:0 0 1.5mm; }
.c-issues ul{ margin:0; padding-left:5mm; display:grid; gap:1mm; }

@media print{
  .c-row.issue td{ -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}

/* a checklist item: the state and its own buttons on one line when they fit */
.c-ctrl{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px; }

/* ---------- Pro: several documents on the paper, copies, series, packs ---------- */
.fw-viewbar{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:10px 16px; padding:12px 16px; border-radius:12px; border:1px solid color-mix(in srgb,var(--pencil) 45%,var(--rule)); background:color-mix(in srgb,var(--pencil) 8%,var(--surface)); }
.fw-viewbar p{ margin:0; flex:1 1 280px; color:var(--ink); }
.fw-dlg{ display:grid; gap:10px; }
.fw-dlg .field{ margin-bottom:0; }
.fw-copy{ display:grid; gap:6px; margin:0; padding:10px 14px 4px; border:1px solid var(--rule); border-radius:10px; min-width:0; }
.fw-copy legend{ padding:0 6px; font-weight:640; }
.fw-copy .fw-sub{ padding-left:30px; }
.fw-copy .hint{ margin:2px 0 6px; }
.fw-pick{ display:grid; gap:4px; max-height:min(46vh,380px); overflow:auto; padding:4px 2px; border-top:1px solid var(--rule); border-bottom:1px solid var(--rule); }
.fw-pick .q-check span{ overflow-wrap:anywhere; }
.fw-pick h4{ margin:8px 0 2px; font-size:.86rem; color:var(--ink-2); }
.fw-count{ margin:0; font-weight:620; color:var(--ink); }
.fw-hidden{ display:none !important; }
/* one report after another on the paper; in print each starts a page */
.sf-doc .fw-break{ height:0; margin:9mm 0; border-top:.4mm dashed #9aa3ad; }
@media print{ .sf-doc .fw-break{ margin:0; border:0; break-before:page; } }

/* the pack on the desk */
.c-pack-list{ list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.c-pack-list li{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:6px 12px; padding:8px 10px; border:1px solid var(--rule); border-radius:10px; background:var(--surface-2); }
.c-pack-list li.cur{ border-color:var(--ink-3); }
.c-pack-list li span{ flex:1 1 220px; font-size:.92rem; color:var(--ink); }
.c-pack-list li small{ display:block; color:var(--ink-2); font-size:.84rem; }

/* the pack summary on paper */
.sf-sheet.sf-doc .c-pack{ width:100%; font-size:8.9pt; }
.c-pack td.n,.c-pack th.n{ text-align:right; white-space:nowrap; font-variant-numeric:tabular-nums; }
.c-pack tr.c-pack-tot td{ font-weight:700; border-top:.35mm solid #1b1f24; border-bottom:0; }
.c-pack .c-iss{ color:#b5381f; font-weight:650; }
.c-pack-iss h4{ margin:3mm 0 1mm; font-size:9pt; color:#1f2547; }
.c-pack-iss ul{ margin:0; padding-left:5mm; display:grid; gap:1mm; font-size:8.8pt; }
