/* Projects: the overview and the top of a project's page (projects-page.js). Built on the machines' parts
   (machine-page.css: .mp-st, .mp-g, .mp-cap, .mr-*, .mt, .mp-at, .mp-tabs, .mp-find). Flat: hairlines, no boxed cards,
   no coloured edges; colour only for warn and bad, sky for work under way. Theme tokens only (docs/THEMES.md). Laid out
   by the room it has (container queries); one column on a phone. */

/* ---------------------------------------------------------------- shared parts */
.pj-g { font-size: 13px; font-weight: 650; letter-spacing: .02em; color: var(--text-2); }
.pj-g.big { font-size: 18px; }
.pj-bar { display: flex; gap: 2px; height: 6px; min-width: 40px; border-radius: 3px; overflow: hidden; }
.pj-bar.none { background: var(--ink-3); opacity: .6; }
.pj-bar.wide { height: 5px; margin: 2px 0 1px; }
.pj-bar i { display: block; min-width: 3px; background: var(--line-2); }
.pj-bar i.s-doing { background: var(--sky); }
.pj-bar i.s-review { background: var(--warn); }
.pj-bar i.s-blocked { background: var(--bad); }
.pj-bar i.s-planned { background: var(--text-3); }
.pj-spark { display: block; overflow: visible; }
.pj-spark .sk-base { stroke: var(--line); stroke-width: 1; }
.pj-spark .sk-m { fill: var(--line-2); }
.pj-spark .sk-d { fill: var(--sky); }
.pj-faces { display: inline-flex; align-items: center; }
.pj-av { width: 24px; height: 24px; flex: none; display: inline-grid; place-items: center; border-radius: 50%; font-size: 10.5px; font-weight: 600; color: var(--text-2);
  background: var(--ink-3); box-shadow: 0 0 0 2px var(--content-bg); }
.pj-faces .pj-av + .pj-av { margin-left: -4px; }
.pj-av.lead { color: var(--text); box-shadow: 0 0 0 2px var(--content-bg), 0 0 0 3px var(--text-3); }
.pj-av.more { color: var(--text-3); font-weight: 500; }
.pj-only { height: 20px; font-size: 11.5px; color: var(--text-3); }
.pj-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pj-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 999px; background: none; color: var(--text-2);
  font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.pj-chip span { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.pj-chip:hover { color: var(--text); border-color: var(--text-3); }
.pj-chip.on { color: var(--text); border-color: var(--text); font-weight: 500; }
.pj-chip.on span { color: var(--text-2); }
.pj-chip.need span { color: var(--warn); font-weight: 600; }
.pj-chip:focus-visible { outline: var(--focus-w, 2px) solid var(--focus); outline-offset: 2px; }
.pj-none { padding: 18px 0; margin: 0; font-size: 13.5px; color: var(--text-2); }

/* ---------------------------------------------------------------- the overview */
.pj { container: pjlist / inline-size; }
.pj-tabs:not(:empty) { border-bottom: 1px solid var(--line); margin-bottom: 14px; }
#pjListBox[hidden], #pjAccess[hidden] { display: none; }
.pj-bar1 { padding-bottom: 4px; }
.pj-scope { margin: 2px 0 0; font-size: 12.5px; color: var(--text-3); }
.pj-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 12px 0 12px; }
.pj-find { margin: 0; flex: 0 1 280px; }
.pj-list { border-top: 1px solid var(--line); }
.pj-head, .pj-a { display: grid; grid-template-columns: minmax(220px, 1.6fr) minmax(150px, 1fr) minmax(130px, .9fr) 104px minmax(120px, .9fr) minmax(90px, 110px) 14px; gap: 0 22px; align-items: center; padding: 0 16px; }
.pj-list.no-sp .pj-head, .pj-list.no-sp .pj-a { grid-template-columns: minmax(220px, 1.6fr) minmax(150px, 1fr) minmax(130px, .9fr) 104px minmax(120px, .9fr) 14px; }
.pj-head { height: 32px; font-size: 11.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); border-bottom: 1px solid var(--line); }
.pj-head > span:nth-child(6) { text-align: right; }
.pj-r { border-bottom: 1px solid var(--line); }
.pj-a { min-height: 68px; padding-top: 12px; padding-bottom: 12px; color: inherit; text-decoration: none; }
.pj-a:hover { background: color-mix(in srgb, var(--ink-3) 45%, transparent); }
.pj-a:focus-visible { outline: var(--focus-w, 2px) solid var(--focus); outline-offset: -2px; }
.pj-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pj-tk { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pj-tl { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pj-act { min-width: 0; }
.pj-pp { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; }
.pj-pp > .pj-faces, .pj-pp > .pj-only { order: 0; }
.pj-you, .pj-lead { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pj-sp { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 0; text-align: right; }
.pj-sp b { font-size: 13.5px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pj-sp span { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.pj-r.off .pj-who .mp-g { opacity: .6; }
@container pjlist (max-width: 1040px) {
  .pj-head { display: none; }
  .pj-a, .pj-list.no-sp .pj-a { grid-template-columns: minmax(0, 1fr) auto 14px; grid-template-areas: "who st go" "tk act go" "pp sp go"; gap: 10px 20px; }
  .pj-who { grid-area: who; } .mr-st { grid-area: st; align-items: flex-end; text-align: right; } .mr-go { grid-area: go; }
  .pj-tk { grid-area: tk; padding-left: 48px; } .pj-act { grid-area: act; justify-self: end; }
  .pj-pp { grid-area: pp; padding-left: 48px; flex-direction: row; align-items: center; gap: 10px; } .pj-sp { grid-area: sp; flex-direction: row; align-items: baseline; gap: 8px; }
}
@container pjlist (max-width: 560px) {
  .pj-a { grid-template-columns: minmax(0, 1fr) auto 14px; grid-template-areas: "who who go" "st st go" "tk sp go" "pp pp go"; padding: 12px 12px; gap: 8px 12px; }
  .pj-list.no-sp .pj-a { grid-template-columns: minmax(0, 1fr) 14px; grid-template-areas: "who go" "st go" "tk go" "pp go"; }
  .mr-st { flex-direction: row; align-items: baseline; gap: 8px; padding-left: 48px; text-align: left; min-width: 0; }
  .mr-st .mp-st { flex: none; }
  .pj-act { display: none; } /* the fourteen days are on the project's page */
  .pj-sp { flex-direction: column; align-items: flex-end; gap: 0; align-self: end; }
  .pj-pp { flex-wrap: wrap; gap: 4px 10px; }
  .pj-pp .pj-lead { order: 3; }
  .pj-tools { flex-direction: column; align-items: stretch; }
  .pj-find { flex-basis: auto; }
}

/* Who sees what (Owners): people across, projects down; the first column stays while the table scrolls sideways */
.pj-acc-note { margin: 0 0 12px; max-width: 90ch; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.pj-acc-note b { color: var(--text); font-weight: 600; }
.pj-acc-w { overflow-x: auto; border-top: 1px solid var(--line); max-width: 100%; }
.pj-acc-w:focus-visible { outline: var(--focus-w, 2px) solid var(--focus); outline-offset: 2px; }
.pj-acc { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.pj-acc th, .pj-acc td { padding: 9px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.pj-acc thead th { vertical-align: bottom; font-weight: 500; color: var(--text-2); }
.pj-acc thead th:not(:first-child) { text-align: center; min-width: 92px; }
.pj-acc thead th .pj-av { margin: 0 auto 4px; display: grid; }
.pj-acc-n { display: block; color: var(--text); font-weight: 600; }
.pj-acc-r { display: block; font-size: 11.5px; color: var(--text-3); }
.pj-acc thead th:first-child, .pj-acc tbody th, .pj-acc tfoot th { position: sticky; left: 0; z-index: var(--z-raise); background: var(--content-bg); min-width: 170px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.pj-acc tbody th { font-weight: 600; }
.pj-acc tbody th a { color: var(--text); text-decoration: none; }
.pj-acc tbody th a:hover { text-decoration: underline; }
.pj-acc td { text-align: center; }
.pj-acc td.out { color: var(--text-3); }
.pj-acc td.in a { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--ink-3); color: var(--text); text-decoration: none; font-size: 12.5px; }
.pj-acc td.in a:hover { text-decoration: underline; }
.pj-acc td.lead a i { font-style: normal; color: var(--text-2); }
.pj-acc tbody tr:hover > * { background: color-mix(in srgb, var(--ink-3) 35%, var(--content-bg)); }
.pj-acc tfoot th, .pj-acc tfoot td { color: var(--text-3); font-size: 12px; border-bottom: 0; }
.pj-acc-none { margin: 12px 0 0; font-size: 13px; color: var(--warn); }

/* ---------------------------------------------------------------- a project's page */
.pj-page { container: mpage / inline-size; }
.pj-h .mp-name .pj-title { margin: 0; font-size: 22px; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; color: var(--text); overflow-wrap: anywhere; }
.pj-rules { margin: 8px 0 0; max-width: 90ch; font-size: 13.5px; line-height: 1.5; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pj-h .mp-acts { flex-wrap: wrap; justify-content: flex-end; }
.pj-people { display: inline-flex; align-items: center; gap: 8px; margin-right: 6px; }
.pj-ppl { font-size: 12.5px; color: var(--sky); text-decoration: none; }
.pj-ppl:hover { text-decoration: underline; }
.pj-live .mt { grid-template-rows: auto auto auto auto; }
.pj-live .mt-v { font-size: 24px; }
.pj-live .mt-s { white-space: normal; }
.pj-mt .pj-spark { margin: 2px 0 0; }
/* The tasks: the filter beside the heading; a filter is CSS on the box, so it survives each repaint */
.pj-tasks > .ph { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.pj-tf .pj-chip { height: 26px; font-size: 12.5px; }
#pjTasks[data-f="open"] > .pl-task[data-st="done"],
#pjTasks[data-f="done"] > .pl-task:not([data-st="done"]),
#pjTasks[data-f="doing"] > .pl-task:not([data-st="doing"]),
#pjTasks[data-f="blocked"] > .pl-task:not([data-st="blocked"]),
#pjTasks[data-f="needs"] > .pl-task:not([data-needs]) { display: none; }
.pj-tf-none[hidden] { display: none; }
.pj-due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.pj-due svg { width: 13px; height: 13px; color: var(--text-3); }
.pj-due.soon, .pj-due.soon svg { color: var(--warn); }
.pj-due.late { color: var(--bad-2); font-weight: 500; } .pj-due.late svg { color: var(--bad); }
.pj-tf-none { margin: 0; padding: 14px 0; }
@container mpage (max-width: 620px) {
  .pj-h .mp-name .pj-title { font-size: 20px; }
  .pj-h .mp-acts { justify-content: flex-start; }
  .pj-people { flex-basis: 100%; margin: 0 0 4px; }
}

/* Money (PROJECTS §4b): Owners, and people an Owner allowed */
.pj-sp i { font-style: normal; font-weight: 500; font-size: 11px; color: var(--text-3); margin-right: 5px; text-transform: uppercase; letter-spacing: .04em; }
.pj-cell { display: inline-flex; align-items: center; gap: 4px; }
.pj-mon { width: 24px; height: 24px; display: inline-grid; place-items: center; border: 1px solid transparent; border-radius: 999px; background: none; color: var(--text-3); cursor: pointer; opacity: .45; }
.pj-mon svg { width: 14px; height: 14px; }
.pj-mon:hover { opacity: 1; border-color: var(--line-2); }
.pj-mon.on { opacity: 1; color: var(--ok); border-color: var(--line-2); }
.pj-mon:focus-visible { outline: var(--focus-w, 2px) solid var(--focus); outline-offset: 1px; opacity: 1; }
.pj-mon[disabled] { cursor: progress; }
.pj-mon-ic { width: 13px; height: 13px; vertical-align: -2px; color: var(--ok); }
.pj-money { border-top: 1px solid var(--line); padding: 10px 0 12px; }
.pj-money > summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--text); list-style: none; }
.pj-money > summary::-webkit-details-marker { display: none; }
.pj-money > summary::after { content: " ›"; color: var(--text-3); }
.pj-money[open] > summary::after { content: " ⌄"; }
.pj-mcols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px; margin-top: 12px; }
.pj-ml { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.pj-ml b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }
.pj-ml small { color: var(--text-3); }
.pj-ml:last-child { border-bottom: 0; }
.pj-ml:last-child span { color: var(--text); font-weight: 600; }
.pj-mt-k { margin-top: 16px; }
.pj-mtasks { border-top: 1px solid var(--line); }
.pj-mtask { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--text); text-decoration: none; }
.pj-mtask:hover { background: color-mix(in srgb, var(--ink-3) 45%, transparent); }
.pj-mtask small { color: var(--text-3); }
.pj-in2, .pj-out2 { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pj-in2:not(:empty)::before { content: "in "; color: var(--text-3); }
.pj-out2:not(:empty)::before { content: "out "; color: var(--text-3); }
.pj-mnote { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--text-3); max-width: 90ch; }
@container mpage (max-width: 620px) {
  .pj-mcols { grid-template-columns: 1fr; }
  .pj-mtask { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .pj-in2, .pj-out2 { text-align: left; }
}
/* What agents record alone a day (PROJECTS §4a step 3): one line, an inline form for an Owner. */
.pj-lim { margin-top: 12px; align-items: baseline; }
.pj-lim b { margin-left: auto; }
.pj-lim small { font-weight: 400; color: var(--text-3); margin-left: 6px; }
.pj-lim .linkbtn { color: var(--canopy-2); padding: 0; }
.pj-limf { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.pj-limf[hidden] { display: none; }
.pj-limf input[name=amount] { width: 140px; }
.pj-limf input[name=currency] { width: 64px; text-transform: uppercase; }
.pj-est b { font-weight: 500; color: var(--text-2); } /* own model keys, estimated (PROJECTS §4h): beside the total, never in it */
