/* Report: this week's draft (/report, /reports/{id}) as CK's document in one column, its cell
   editor, the list of earlier drafts (/reports), and the operator's /pilot and per-draft
   comparison pages. Tokens and components from style.css. The document itself stays light in
   both themes (color-scheme: light, so the tokens resolve to their light values), as CK's
   Outlook shows it; the unconfirmed facts inside it use review.css (.ufact). */

.rpt { max-width: 1120px; }
.rpt-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s5); margin-bottom: var(--s4); }
.rpt-head h1 { margin: 0; flex: 1 1 auto; }
.rpt-head .meta { flex-basis: 100%; }
.rpt-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.rpt-acts form { margin: 0; }
.rpt-earlier { color: var(--muted); }
.rpt-offer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s5); margin-bottom: var(--s5); }
.rpt-offer p { margin: 0; font-size: var(--t-lead); }
.rpt-offer form { margin: 0; }
.rpt-note { margin: 0 0 var(--s4); color: var(--muted); }

/* --- the document ----------------------------------------------------------------- */
.doc { color-scheme: light; background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow); }
.doc p { margin: 0 0 var(--s2); }
.doc-h { font-weight: 700; text-decoration: underline; margin-top: var(--s4) !important; }
.doc-grp { font-weight: 700; margin-top: var(--s3) !important; }
.doc-prio { margin: 0 0 var(--s2); padding-left: var(--s5); }
.doc-prio > li { padding: var(--s1) 0 var(--s1) var(--s2); }
.doc-prio > li.written, .doc-unplaced .ufacts { box-shadow: inset 3px 0 0 var(--acc); }
.doc-letters { list-style: none; margin: var(--s1) 0 0; padding-left: var(--s5); }

.tracker { width: 100%; margin-top: var(--s3); border-collapse: collapse; table-layout: fixed; }
.tracker th, .tracker td { padding: var(--s2) var(--s3); border: 1px solid var(--rule); background: var(--paper); color: var(--ink); text-align: left; vertical-align: top; font-weight: 400; white-space: normal; }
.tracker thead th { background: var(--acc-soft); font-weight: 700; text-align: center; }
.tracker thead tr:last-child th { border-bottom: 3px double var(--ink); }
.tracker .tracker-title { background: var(--paper); }
.tracker td p { margin: 0 0 var(--s1); }
.tracker td p:last-child { margin-bottom: 0; }
.tracker .w-no { width: 64px; }
.tracker .w-project { width: 15%; }
.tracker .w-process { width: 12%; }
.tracker .w-status { width: 16%; }
.tracker .w-factory { width: 8%; }
.tracker .w-etd { width: 10%; }
.c-no, .c-factory, .c-etd { text-align: center !important; }
.trow.written > td:first-child { box-shadow: inset 4px 0 0 var(--acc); }
.trow.unchanged { display: none; }
.doc.show-unchanged .trow.unchanged { display: table-row; }
.tsub > td { padding: var(--s2) var(--s4) var(--s3); background: var(--bg); }
.tsub.written > td { box-shadow: inset 4px 0 0 var(--acc); }
.tsub-from { margin: 0 0 var(--s1) !important; color: var(--muted); }
.ufacts { list-style: none; margin: 0; padding: 0 0 0 var(--s3); }
.doc-unplaced { margin-top: var(--s5); }

/* --- the cell editor ----------------------------------------------------------- */
.cell { margin: calc(-1 * var(--s1)); padding: var(--s1); border-radius: var(--r-sm); cursor: text; }
.cell:hover, .cell:focus-visible { background: var(--acc-soft); }
.cell-empty { color: var(--faint); }
.cell-form textarea { display: block; width: 100%; min-height: 96px; }
.cell-acts { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }

/* --- earlier drafts --------------------------------------------------------------- */
.rpt-list { max-width: 640px; padding-top: var(--s2); padding-bottom: var(--s2); }
.rpt-list > li { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); }

/* --- /pilot and the comparison page --------------------------------------------------- */
.pilot .table { margin-bottom: var(--s5); }
.pilot .table td p { margin: 0 0 var(--s1); }
.pilot-narrow { max-width: 420px; }
.pilot-text { white-space: pre-wrap; }

/* --- phone width: the table becomes one block per row --------------------------------- */
@media (max-width: 700px) {
  .doc { padding: var(--s4); }
  .pilot .table { display: block; overflow-x: auto; }  /* Jason's wide metric tables scroll */
  .tracker, .tracker tbody, .tracker tr, .tracker td { display: block; width: auto; }
  .tracker thead tr:last-child { display: none; }
  .tracker thead, .tracker thead tr:first-child, .tracker .tracker-title { display: block; }
  .tracker td { border-width: 0 1px; }
  .trow { margin-top: var(--s3); border-top: 1px solid var(--rule); }
  .trow > td:last-child, .tsub > td { border-bottom: 1px solid var(--rule); }
  .doc.show-unchanged .trow.unchanged { display: block; }
  .tracker td[data-label]::before { content: attr(data-label); display: block; font: 700 var(--t-meta)/1.3 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .c-no { text-align: left !important; font-weight: 700; }
  .c-factory, .c-etd { text-align: left !important; }
  .tracker td:empty { display: none; }
}
