/* =========================================================
   Portal 2.0 · the projects list, on design system v2 (wave 1 pilot)

   Authority: docs/authorities/portal-2-design-system-v2.md (layout rules
   3, 4, 6 and 10; status as a dot and a word, at most one pill per row;
   mobile: lists become stacked rows). Target: round two's R2-list-shown
   board. Brief: the pages handover, wave 1, pilot 1.

   RESTYLE, DON'T REBUILD. Every read, write, filter and editor on the
   list is today's, unchanged: this file only changes how they look, for
   a portal.v2 holder. Every rule needs :root[data-v2] and the list view's
   own root, so without the key nothing here applies, and the project
   record and opportunity views of the same page are untouched until
   their own pilot.

   TOKENS ONLY: no colour value lives here (scripts/check-v2-static.py
   holds this file to that, through scripts/v2/migrated-pages.json).

   The shape, top to bottom:
     the crown       the title, its count, the actions
     the filters     today's four cards become one row of tabs with
                     counts (layout rule 6: no boxes that restate the page)
     the bar         search, the person and phase filters, sort
     the table       the project name takes the width (rule 3); people
                     are initials chips (rule 4); status a dot and a word;
                     likelihood plain words, with one pencilled chip at
                     most; icon glyphs hidden (words, not icons)
     under 1024      44px targets, and the table scrolls inside its box
     under 600       stacked rows: the name, three facts, one status
   ========================================================= */

/* ── the ground: this page takes the v2 ground only while the list shows.
   The legacy main paints its own light ground over the body, so it goes
   too, or dark text tokens land on a light box. ── */
/* the UI pass (15 Oct 2026): the boards' page ground, #fafaf8 (the sunk ground) */
:root[data-v2] body:has(.projects-list-view) { background: var(--z-bg-sunk); color: var(--z-text); }
:root[data-v2] body:has(.projects-list-view) main.p-main { background: var(--z-bg-sunk); color: var(--z-text); }
/* the app's box holds a screen's height from the first paint (before React
   renders, so it cannot wait for .projects-list-view), so the footer starts
   below the fold and never jumps on screen as the list arrives: on staging
   that jump was a layout shift of 0.6, the budget's six times over */
:root[data-v2] #projects-app { min-height: calc(100vh - var(--z-ribbon-h)); }
:root[data-v2] .projects-list-view {
  color: var(--z-text); font-family: var(--z-f-std); font-size: var(--z-t-body);
  max-width: none; padding: var(--z-s-6) var(--z-s-6) var(--z-s-7); background: transparent;
}
:root[data-v2] .projects-list-view :where(h1, h2, h3, p) { color: var(--z-text); }

/* ── the crown: title, count, actions ── */
:root[data-v2] .projects-list-view .cmd { background: transparent; border: 0; padding: 0; margin: 0 0 var(--z-s-4); color: var(--z-text); }
:root[data-v2] .projects-list-view .cmd__top { display: flex; align-items: flex-end; gap: var(--z-s-4); flex-wrap: wrap; margin: 0 0 var(--z-s-4); }
:root[data-v2] .projects-list-view .cmd__title { display: flex; flex-direction: column; gap: var(--z-s-1); flex: 1 1 auto; min-width: 0; }
:root[data-v2] .projects-list-view .cmd__title h1 {
  margin: 0; font-family: var(--z-f-ex); font-weight: 700; font-size: var(--z-t-hero); line-height: 1; letter-spacing: -0.035em;
  color: var(--z-text); text-transform: none;
}
:root[data-v2] .projects-list-view .cmd__title .n {
  font-family: var(--z-f-std); font-weight: 400; font-size: var(--z-t-small); color: var(--z-text-2);
  text-transform: none; letter-spacing: 0;
}
:root[data-v2] .projects-list-view .cmd__actions { display: flex; align-items: center; gap: var(--z-s-3); flex-wrap: wrap; }
:root[data-v2] .projects-list-view .pjx-svcshow { display: inline-flex; align-items: center; gap: var(--z-s-1); }
:root[data-v2] .projects-list-view .pjx-svcshow__label {
  font-family: var(--z-f-std); font-size: var(--z-t-small); color: var(--z-text-2); text-transform: none; letter-spacing: 0; margin-right: var(--z-s-1);
}

/* every chip-shaped control on the list: outlined, words, 34px at a desk */
:root[data-v2] .projects-list-view :is(.pjx-viewchip, .pjx-filterchip) {
  min-height: var(--z-control); padding: 0 var(--z-s-3); display: inline-flex; align-items: center; gap: var(--z-s-1);
  border: 1px solid var(--z-line-2); border-radius: var(--z-r); background: var(--z-bg-raised); color: var(--z-text-2);
  font-family: var(--z-f-std); font-weight: 500; font-size: var(--z-t-small); text-transform: none; letter-spacing: 0; line-height: 1.2;
}
:root[data-v2] .projects-list-view :is(.pjx-viewchip, .pjx-filterchip):hover { background: var(--z-bg-hover); color: var(--z-text); border-color: var(--z-text-3); }
/* pressed: ink on the raised ground, with an ink underline, never a
   black block (a filled chip reads as the page's primary action) */
:root[data-v2] .projects-list-view :is(.pjx-viewchip, .pjx-filterchip).is-on {
  background: var(--z-bg-hover); color: var(--z-text); border-color: var(--z-text-3); box-shadow: inset 0 -2px 0 var(--z-text);
}

/* the one primary action: orange fill, ink text */
:root[data-v2] .projects-list-view .btn.btn--primary {
  min-height: var(--z-control); padding: 0 var(--z-s-4); border: 1px solid var(--z-accent); border-radius: var(--z-r);
  background: var(--z-accent); color: var(--z-on-accent); font-family: var(--z-f-std); font-weight: 600; font-size: var(--z-t-small);
  text-transform: none; letter-spacing: 0;
}
:root[data-v2] .projects-list-view .btn.btn--primary:hover { background: var(--z-orange-press); border-color: var(--z-orange-press); color: var(--z-on-accent); }
:root[data-v2] .projects-list-view .btn:not(.btn--primary) {
  min-height: var(--z-control); padding: 0 var(--z-s-3); border: 1px solid var(--z-line-2); border-radius: var(--z-r);
  background: var(--z-bg-raised); color: var(--z-text); font-family: var(--z-f-std); font-weight: 500; font-size: var(--z-t-small); text-transform: none;
}

/* ── the filters: today's four cards, as one row of tabs with counts ── */
:root[data-v2] .projects-list-view .stat-tiles {
  display: flex; flex-wrap: nowrap; gap: var(--z-s-5); overflow-x: auto; margin: 0; padding: 0;
  border: 0; border-bottom: 1px solid var(--z-line); background: transparent; grid-template-columns: none;
}
:root[data-v2] .projects-list-view .stat-tile {
  flex: none; display: inline-flex; flex-direction: row-reverse; align-items: baseline; justify-content: flex-end; gap: 6px;
  min-height: 40px; padding: 0 2px; margin: 0 0 -1px; border: 0; border-bottom: 2px solid transparent; border-radius: 0;
  background: transparent; color: var(--z-text-2); box-shadow: none; text-align: left;
}
:root[data-v2] .projects-list-view .stat-tile__label {
  font-family: var(--z-f-std); font-weight: 500; font-size: var(--z-t-body); color: inherit; text-transform: none; letter-spacing: 0; line-height: 1.2;
}
:root[data-v2] .projects-list-view .stat-tile__num {
  font-family: var(--z-f-cd); font-weight: 600; font-size: var(--z-t-label); color: var(--z-text-3); letter-spacing: 0.03em;
  font-variant-numeric: tabular-nums; line-height: 1.2;
}
:root[data-v2] .projects-list-view .stat-tile--btn { cursor: pointer; }
:root[data-v2] .projects-list-view .stat-tile--btn:hover { color: var(--z-text); background: transparent; border-color: transparent; border-bottom-color: var(--z-line-2); }
:root[data-v2] .projects-list-view .stat-tile--btn.is-on { color: var(--z-text); background: transparent; border-color: transparent; border-bottom-color: var(--z-text); }
:root[data-v2] .projects-list-view .stat-tile--btn.is-on .stat-tile__num,
:root[data-v2] .projects-list-view .stat-tile--btn.is-on .stat-tile__label { color: inherit; }
:root[data-v2] .projects-list-view .stat-tile--btn.is-on .stat-tile__num { color: var(--z-text-2); }
/* needs attention: red means a person is needed now, so its count wears
   it, and the word still says so */
:root[data-v2] .projects-list-view .stat-tile--accent .stat-tile__num,
:root[data-v2] .projects-list-view .stat-tile--accent.is-on .stat-tile__num { color: var(--z-bad); }
:root[data-v2] .projects-list-view .stat-tile--accent.is-on { border-bottom-color: var(--z-text); background: transparent; }

/* ── the bar: search, filters, sort (page head, row two: layout rule 10) ── */
:root[data-v2] .projects-list-view .bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--z-s-2) var(--z-s-3);
  margin: 0 0 var(--z-s-5); padding: var(--z-s-3) 0 0; border: 0; background: transparent;
}
:root[data-v2] .projects-list-view .bar__search { flex: 1 1 260px; min-width: 0; max-width: 460px; margin: 0; }
:root[data-v2] .projects-list-view .bar__search input {
  width: 100%; height: var(--z-control); padding: 0 var(--z-s-3); border: 1px solid var(--z-text-3); border-radius: var(--z-r);
  background: var(--z-bg-sunk); color: var(--z-text); font-family: var(--z-f-std); font-size: var(--z-t-body); box-shadow: none;
}
:root[data-v2] .projects-list-view .bar__search input::placeholder { color: var(--z-text-3); opacity: 1; }
/* today's field draws a magnifier glyph in its left gutter; the v2 field has
   its own padding, so the glyph sat on the text (and vanished in dark). The
   board has none: the placeholder says what the field is for */
:root[data-v2] .projects-list-view .bar__search::before { content: none; }
:root[data-v2] .projects-list-view .bar__search input:focus { outline: 2px solid var(--z-focus); outline-offset: 2px; }
:root[data-v2] .projects-list-view .bar__group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--z-s-2); }
:root[data-v2] .projects-list-view .pjx-filterrow { display: inline-flex; flex-wrap: wrap; gap: var(--z-s-2); }
:root[data-v2] .projects-list-view .bar__sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--z-line-2); }
:root[data-v2] .projects-list-view .pjx-sort { display: inline-flex; align-items: center; gap: var(--z-s-1); }
:root[data-v2] .projects-list-view .pjx-sort__k {
  font-family: var(--z-f-std); font-size: var(--z-t-small); color: var(--z-text-2); text-transform: none; letter-spacing: 0; margin-right: 2px;
}

/* ── sections: a section head, then its table ── */
:root[data-v2] .projects-list-view .wrap { max-width: none; padding: 0; margin: 0; background: transparent; }
:root[data-v2] .projects-list-view .wrap > section { margin: 0 0 var(--z-s-7); }
:root[data-v2] .projects-list-view .p-section-label {
  display: flex; align-items: baseline; gap: var(--z-s-2); margin: 0 0 var(--z-s-3); padding: 0; border: 0;
  font-family: var(--z-f-std); font-weight: 600; font-size: var(--z-t-h2); line-height: 1.25; letter-spacing: -0.01em;
  color: var(--z-text); text-transform: none;
}
:root[data-v2] .projects-list-view .p-section-label .count {
  font-family: var(--z-f-std); font-weight: 400; font-size: var(--z-t-small); color: var(--z-text-2); text-transform: none; letter-spacing: 0;
}
/* the list's first section repeats the page's own title (nothing twice
   on one screen): keep its count, lose the word */
:root[data-v2] .projects-list-view .wrap > section:first-child > .p-section-label { font-size: 0; margin-bottom: var(--z-s-2); }
:root[data-v2] .projects-list-view .wrap > section:first-child > .p-section-label .count { font-size: var(--z-t-small); }

/* ── the table ──
   Its legacy wrapper scrolls (an INLINE style, overflowX: auto, at
   dashboard.html's table), and a sticky header binds to its nearest
   scrolling box, so it sat 52px down inside the wrapper, over the first
   row. At a desk the wrapper stops scrolling and the header sticks under
   the ribbon; under 1024 the wrapper scrolls again and the header rides at
   its top. !important is the only way a stylesheet beats an inline style,
   and these two declarations are the only ones here that need it. */
:root[data-v2] .projects-list-view .wrap > section > div:has(> table.pjx-table) { overflow: visible !important; }
:root[data-v2] .projects-list-view .pjx-table {
  width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0;
  font-family: var(--z-f-std); font-size: var(--z-t-body); color: var(--z-text); background: transparent;
}
:root[data-v2] .projects-list-view .pjx-table th {
  position: sticky; top: var(--z-ribbon-h); z-index: 2; height: 36px; padding: 0 10px; text-align: left; vertical-align: middle;
  background: var(--z-bg-sunk); border: 0; border-bottom: 1px solid var(--z-line-2);
  font-family: var(--z-f-cd); font-weight: 600; font-size: var(--z-t-label); letter-spacing: 0.03em; color: var(--z-text-3);
  text-transform: none; white-space: nowrap;
}
/* the columns: the project takes the width; the others are only as wide
   as what they hold (layout rule 3) */
:root[data-v2] .projects-list-view .pjx-table th.c-chev { width: 36px; padding: 0; }
:root[data-v2] .projects-list-view .pjx-table th.c-zpid { width: 96px; }
:root[data-v2] .projects-list-view .pjx-table th.c-client { width: 17%; }
:root[data-v2] .projects-list-view .pjx-table th.c-team { width: 112px; }
:root[data-v2] .projects-list-view .pjx-table th.c-dates { width: 176px; }
:root[data-v2] .projects-list-view .pjx-table th.c-phase { width: 124px; }
:root[data-v2] .projects-list-view .pjx-table th.c-status { width: 116px; }
:root[data-v2] .projects-list-view .pjx-table td {
  height: 56px; padding: 0 10px; vertical-align: middle; border: 0; border-bottom: 1px solid var(--z-line);
  background: var(--z-bg); color: var(--z-text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
:root[data-v2] .projects-list-view .pjx-table tbody tr:hover td { background: var(--z-bg-hover); }
:root[data-v2] .projects-list-view .pjx-table td.pjx-chev { padding: 0; text-align: center; overflow: visible; }

/* a stalled project is a warning, not an alarm: amber dot and word in its
   status cell, no red row (red means a person is needed now) */
:root[data-v2] .projects-list-view .pjx-table tr.pjx-row--stalled td { background: var(--z-bg); box-shadow: none; }
:root[data-v2] .projects-list-view .pjx-table tr.pjx-row--stalled:hover td { background: var(--z-bg-hover); }
:root[data-v2] .projects-list-view .pjx-table tr.pjx-row--stalled .pjx-projname__a { color: var(--z-text); }
:root[data-v2] .projects-list-view .pjx-table tr.pjx-row--stalled .pstatus__dot { background: var(--z-warn); }

/* the expander: the words stay out; a drawn chevron shows open or closed */
:root[data-v2] .projects-list-view .pjx-chevbtn {
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--z-r); background: transparent;
  color: transparent; font-size: 0; display: inline-grid; place-items: center; cursor: pointer;
}
:root[data-v2] .projects-list-view .pjx-chevbtn::before {
  content: ""; width: 6px; height: 6px; border-right: 1.5px solid var(--z-text-3); border-bottom: 1.5px solid var(--z-text-3);
  transform: rotate(-45deg);
}
:root[data-v2] .projects-list-view .pjx-chevbtn.is-open::before { transform: translateY(-2px) rotate(45deg); }
:root[data-v2] .projects-list-view .pjx-chevbtn:hover { background: var(--z-bg-hover); }

/* the reference: a quiet id, still the button that copies it */
:root[data-v2] .projects-list-view .pjx-zpid {
  min-height: 28px; padding: 0 4px; border: 0; border-radius: var(--z-r); background: transparent;
  font-family: var(--z-f-cd); font-weight: 600; font-size: var(--z-t-label); letter-spacing: 0.05em; color: var(--z-text-2);
  font-variant-numeric: tabular-nums; text-transform: none;
}
:root[data-v2] .projects-list-view .pjx-zpid:hover { background: var(--z-bg-hover); color: var(--z-text); }
:root[data-v2] .projects-list-view .pjx-zpid__cp { display: none; }
:root[data-v2] .projects-list-view .pjx-zpid.is-copied::after { color: var(--z-text); background: var(--z-bg-raised); border-color: var(--z-line-2); }

/* the project: the name leads, its services beneath in a quiet line */
:root[data-v2] .projects-list-view .pjx-table td.pjx-projname { font-weight: 500; color: var(--z-text); white-space: normal; }
:root[data-v2] .projects-list-view .pjx-projname__in { display: flex; align-items: center; gap: var(--z-s-2); min-width: 0; }
:root[data-v2] .projects-list-view .pjx-projname__a {
  color: var(--z-text); font-weight: 500; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
:root[data-v2] .projects-list-view .pjx-projname__a:hover { color: var(--z-text); text-decoration: underline; text-underline-offset: 3px; }
:root[data-v2] .projects-list-view .pjx-svcline {
  display: block; margin-top: 1px; font-family: var(--z-f-std); font-weight: 400; font-size: var(--z-t-label);
  color: var(--z-text-3); text-transform: none; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
:root[data-v2] .projects-list-view .pjx-deadchip {
  flex: none; padding: 0 6px; border: 1px solid var(--z-line-2); border-radius: var(--z-r); background: transparent;
  font-family: var(--z-f-std); font-weight: 500; font-size: var(--z-t-label); color: var(--z-text-2); text-transform: none; letter-spacing: 0;
}
:root[data-v2] .projects-list-view .pjx-newdot { background: var(--z-accent); }

/* the cells a person can edit: the value is the control; no pencil */
:root[data-v2] .projects-list-view .pjx-celledit {
  max-width: 100%; min-height: 28px; padding: 0 6px; margin-left: -6px; border: 1px solid transparent; border-radius: var(--z-r);
  background: transparent; color: var(--z-text-2); font-family: var(--z-f-std); font-size: var(--z-t-body); text-transform: none;
  display: inline-flex; align-items: center; gap: var(--z-s-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
:root[data-v2] .projects-list-view .pjx-celledit:hover,
:root[data-v2] .projects-list-view .pjx-celledit.is-open { border-color: var(--z-line-2); background: var(--z-bg-raised); color: var(--z-text); }
:root[data-v2] .projects-list-view .pjx-celledit__pen { display: none; }
:root[data-v2] .projects-list-view .pjx-muted,
:root[data-v2] .projects-list-view .pdim { color: var(--z-text-3); }

/* the team: three initials chips; the name is the title and the
   accessible name. Design system v2's own initials chip (.z-initials in
   components.css) is a neutral ground with ink letters: the identity
   colours today's trio paints INLINE put 12px letters at 2.9 to 3.6:1,
   under AA, so a holder gets the foundation's chip. !important only
   because the colour is an inline style. */
:root[data-v2] .projects-list-view .pjx-celledit--bare { min-height: 0; padding: 0; margin: 0; border: 0; background: transparent; border-radius: 50%; }
:root[data-v2] .projects-list-view .pjx-trio { display: inline-flex; gap: 4px; align-items: center; }
:root[data-v2] .projects-list-view .pjx-trio__slot {
  width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--z-bg-hover) !important; color: var(--z-text);
  font-family: var(--z-f-std); font-weight: 600; font-size: var(--z-t-label); letter-spacing: 0; text-transform: none;
}
:root[data-v2] .projects-list-view .pjx-trio__slot--none { background: transparent !important; border: 1px dashed var(--z-text-3); }
:root[data-v2] .projects-list-view .pjx-celledit--bare:hover .pjx-trio__slot,
:root[data-v2] .projects-list-view .pjx-celledit--bare.is-open .pjx-trio__slot { outline: 2px solid var(--z-text); outline-offset: 1px; }

/* the dates: tabular, with where they come from beneath */
:root[data-v2] .projects-list-view .pjx-table td.pjx-dates { white-space: normal; color: var(--z-text-2); font-variant-numeric: tabular-nums; line-height: 1.25; }
:root[data-v2] .projects-list-view .pjx-table td.pjx-dates > span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-v2] .projects-list-view .pjx-table td.pjx-dates small { display: block; font-size: var(--z-t-label); color: var(--z-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* likelihood: a plain word, except a pencil, which is the row's one pill
   (the coverage language: hatched is pencilled) */
:root[data-v2] .projects-list-view .chip.chip--status {
  display: inline-flex; align-items: center; min-height: 0; height: auto; padding: 0; border: 0; border-radius: var(--z-r); background: transparent;
  font-family: var(--z-f-std); font-weight: 400; font-size: var(--z-t-small); letter-spacing: 0; color: var(--z-text-2); text-transform: none;
}
:root[data-v2] .projects-list-view .chip.chip--status[data-status="watching"] {
  height: 22px; padding: 0 8px; border: 1px dashed var(--z-line-2); background: var(--z-cov-pencil); color: var(--z-text); font-weight: 500;
}

/* status: a dot and a word */
:root[data-v2] .projects-list-view .pstatus {
  display: inline-flex; align-items: center; gap: 6px; font-family: var(--z-f-std); font-weight: 500; font-size: var(--z-t-small);
  color: var(--z-text); text-transform: none; letter-spacing: 0; white-space: nowrap;
}
:root[data-v2] .projects-list-view .pstatus__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--z-text-3); }
:root[data-v2] .projects-list-view .pstatus[data-state="positive"] .pstatus__dot { background: var(--z-ok); }
:root[data-v2] .projects-list-view .pstatus[data-state="watch"] .pstatus__dot { background: var(--z-warn); }
:root[data-v2] .projects-list-view .pstatus[data-state="risk"] .pstatus__dot { background: var(--z-bad); }

/* the opportunities under a project, when it is open */
:root[data-v2] .projects-list-view .pjx-table tr.pjx-oppsrow td { height: auto; padding: 6px 10px 10px 46px; background: var(--z-bg-sunk); white-space: normal; }
:root[data-v2] .projects-list-view .pjx-opps { display: flex; flex-direction: column; gap: 2px; }
:root[data-v2] .projects-list-view .pjx-opp { display: flex; align-items: center; gap: var(--z-s-3); min-height: 30px; font-size: var(--z-t-small); color: var(--z-text-2); }
:root[data-v2] .projects-list-view .pjx-opp__name { color: var(--z-text); text-decoration: none; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root[data-v2] .projects-list-view .pjx-opp__name:hover { text-decoration: underline; text-underline-offset: 3px; }
:root[data-v2] .projects-list-view .pjx-opp__zeq { font-family: var(--z-f-cd); font-weight: 600; font-size: var(--z-t-label); letter-spacing: 0.05em; color: var(--z-text-2); }
:root[data-v2] .projects-list-view .pjx-opp__dates { color: var(--z-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
:root[data-v2] .projects-list-view .pjx-opps__empty { font-size: var(--z-t-small); color: var(--z-text-2); padding: 6px 0; }
:root[data-v2] .projects-list-view .pjx-kind {
  display: inline-flex; align-items: center; padding: 0; border: 0; background: transparent;
  font-family: var(--z-f-std); font-size: var(--z-t-label); color: var(--z-text-3); text-transform: none; letter-spacing: 0;
}
:root[data-v2] .projects-list-view .pjx-kind--quote { color: var(--z-text-2); font-weight: 500; }

/* the secondary tables (unassigned opportunities, dry hires) */
:root[data-v2] .projects-list-view .pjx-table--sec td { color: var(--z-text-2); }
:root[data-v2] .projects-list-view .pjx-table--sec tr.pjx-attnrow td { background: transparent; }
:root[data-v2] .projects-list-view .pnudge {
  font-family: var(--z-f-std); font-weight: 500; font-size: var(--z-t-small); color: var(--z-bad); text-transform: none; letter-spacing: 0;
}

/* the states: loading, empty, failed (today's markup, the v2 look) */
:root[data-v2] .projects-list-view .state { padding: var(--z-s-6) 0; color: var(--z-text-2); background: transparent; border: 0; }
:root[data-v2] .projects-list-view .state__title { font-family: var(--z-f-std); font-weight: 600; font-size: var(--z-t-h3); color: var(--z-text); text-transform: none; }
:root[data-v2] .projects-list-view .state__body { font-size: var(--z-t-small); color: var(--z-text-2); }

/* the cell and filter menus: portalled to the body, so they sit outside
   the list's root; on this page they take the same tokens */
:root[data-v2] body:has(.projects-list-view) :is(.pjx-cellmenu, .pjx-filterchip__menu) {
  background: var(--z-bg-raised); color: var(--z-text); border: 1px solid var(--z-line-2); border-radius: 8px; box-shadow: var(--z-shadow);
  font-family: var(--z-f-std); font-size: var(--z-t-body);
}
:root[data-v2] body:has(.projects-list-view) :is(.pjx-cellmenu__opt, .pjx-ta__opt) {
  min-height: 34px; color: var(--z-text); background: transparent; font-family: var(--z-f-std); font-size: var(--z-t-body); text-transform: none;
}
:root[data-v2] body:has(.projects-list-view) :is(.pjx-cellmenu__opt, .pjx-ta__opt):hover,
:root[data-v2] body:has(.projects-list-view) .pjx-cellmenu__opt.is-sel { background: var(--z-bg-hover); color: var(--z-text); }
:root[data-v2] body:has(.projects-list-view) .pjx-cellmenu__q {
  min-height: 34px; border: 1px solid var(--z-text-3); border-radius: var(--z-r); background: var(--z-bg-sunk); color: var(--z-text); font-family: var(--z-f-std);
}
:root[data-v2] body:has(.projects-list-view) :is(.pjx-cellmenu__meta, .pjx-cellmenu__none) { color: var(--z-text-2); font-size: var(--z-t-label); }
:root[data-v2] body:has(.projects-list-view) .pjx-cellmenu .chip.chip--status {
  padding: 0; border: 0; background: transparent; color: var(--z-text); font-family: var(--z-f-std); font-size: var(--z-t-body); text-transform: none; letter-spacing: 0;
}

/* the page's own footer line, while the list shows: text-2 on the v2
   ground, and the orange word as small orange text (accent-text) */
:root[data-v2] body:has(.projects-list-view) footer.footer { background: transparent; color: var(--z-text-2); border-color: var(--z-line); font-family: var(--z-f-std); }
:root[data-v2] body:has(.projects-list-view) footer.footer span { color: var(--z-accent-text); }

/* ── under 1024: every control a 44px target; the table scrolls in its box ── */
@media (max-width: 1023px) {
  :root[data-v2] .projects-list-view { padding: var(--z-s-5) var(--z-s-4) var(--z-s-7); }
  :root[data-v2] .projects-list-view :is(.pjx-viewchip, .pjx-filterchip, .btn) { min-height: var(--z-target); }
  :root[data-v2] .projects-list-view .stat-tile { min-height: var(--z-target); }
  :root[data-v2] .projects-list-view .bar__search input { height: var(--z-target); }
  :root[data-v2] .projects-list-view .wrap > section > div:has(> table.pjx-table) { overflow-x: auto !important; overflow-y: hidden; }
  /* wide enough that the project still takes the width (rule 3): at 860px
     the fixed columns left it 34px */
  :root[data-v2] .projects-list-view .pjx-table { min-width: 1040px; }
  :root[data-v2] .projects-list-view .pjx-table th { top: 0; }
  :root[data-v2] .projects-list-view .pjx-table td { height: var(--z-row); }
  :root[data-v2] .projects-list-view .pjx-chevbtn { width: var(--z-target); height: var(--z-target); }
  :root[data-v2] .projects-list-view .pjx-zpid { min-height: var(--z-target); min-width: var(--z-target); }
  :root[data-v2] .projects-list-view .pjx-celledit { min-height: var(--z-target); min-width: var(--z-target); }
  :root[data-v2] .projects-list-view .pjx-celledit--bare { min-width: var(--z-target); min-height: var(--z-target); display: inline-grid; place-items: center; }
  :root[data-v2] .projects-list-view .pjx-projname__a,
  :root[data-v2] .projects-list-view .pjx-opp__name,
  :root[data-v2] .projects-list-view .pjx-table--sec a { display: inline-flex; align-items: center; min-height: var(--z-target); min-width: var(--z-target); }
  :root[data-v2] body:has(.projects-list-view) :is(.pjx-cellmenu__opt, .pjx-ta__opt, .pjx-cellmenu__q) { min-height: var(--z-target); }
}

/* ── under 600: stacked rows (a phone gets the job, not the page) ──
   The name is the heading with its reference above it; beneath it, at most
   three facts (client, dates, likelihood); one status at the right. The
   team, the expander and the column heads stay off the phone. */
@media (max-width: 599px) {
  :root[data-v2] .projects-list-view { font-size: 16px; padding-top: var(--z-s-4); }
  /* the list is the job, so what sits above it takes as little room as it
     can: the actions on one line, the tabs and the filters each one strip
     that scrolls sideways inside itself (the page never does) */
  :root[data-v2] .projects-list-view .cmd__top { align-items: flex-start; margin-bottom: var(--z-s-3); }
  :root[data-v2] .projects-list-view .cmd__actions { flex-wrap: nowrap; width: 100%; overflow-x: auto; gap: var(--z-s-2); }
  :root[data-v2] .projects-list-view .cmd__actions > * { flex: none; }
  :root[data-v2] .projects-list-view .stat-tiles { gap: var(--z-s-4); }
  :root[data-v2] .projects-list-view .bar { margin-bottom: var(--z-s-3); }
  :root[data-v2] .projects-list-view .bar__search { flex-basis: 100%; max-width: none; }
  :root[data-v2] .projects-list-view .bar__search input { font-size: 16px; }
  :root[data-v2] .projects-list-view .bar__group { flex-wrap: nowrap; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  :root[data-v2] .projects-list-view .pjx-filterrow { flex-wrap: nowrap; }
  :root[data-v2] .projects-list-view .bar__group > *, :root[data-v2] .projects-list-view .pjx-filterrow > * { flex: none; }
  :root[data-v2] .projects-list-view .bar__sep { display: none; }
  :root[data-v2] .projects-list-view .wrap > section > div:has(> table.pjx-table) { overflow-x: visible !important; }
  :root[data-v2] .projects-list-view .pjx-table { min-width: 0; table-layout: auto; }
  :root[data-v2] .projects-list-view .pjx-table thead { display: none; }
  :root[data-v2] .projects-list-view .pjx-table,
  :root[data-v2] .projects-list-view .pjx-table tbody { display: block; width: 100%; }
  :root[data-v2] .projects-list-view .pjx-table tbody tr:not(.pjx-oppsrow) {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--z-s-3); align-items: center;
    padding: var(--z-s-3) 0; border-bottom: 1px solid var(--z-line);
  }
  :root[data-v2] .projects-list-view .pjx-table tbody tr:not(.pjx-oppsrow) td { display: block; height: auto; padding: 0; border: 0; background: transparent; }
  :root[data-v2] .projects-list-view .pjx-table tbody tr.pjx-oppsrow { display: none; }
  :root[data-v2] .projects-list-view .pjx-table tbody tr:hover td { background: transparent; }
  /* the list's own rows: 1 expander, 2 reference, 3 name, 4 client,
     5 team, 6 dates, 7 likelihood, 8 status */
  :root[data-v2] .projects-list-view .pjx-table:not(.pjx-table--sec) td:nth-child(1),
  :root[data-v2] .projects-list-view .pjx-table:not(.pjx-table--sec) td:nth-child(5) { display: none; }
  :root[data-v2] .projects-list-view .pjx-table:not(.pjx-table--sec) td:nth-child(2) { grid-area: ref; }
  :root[data-v2] .projects-list-view .pjx-table:not(.pjx-table--sec) td:nth-child(3) { grid-area: name; }
  :root[data-v2] .projects-list-view .pjx-table:not(.pjx-table--sec) td:nth-child(8) { grid-area: status; align-self: start; }
  :root[data-v2] .projects-list-view .pjx-table:not(.pjx-table--sec) td:nth-child(4),
  :root[data-v2] .projects-list-view .pjx-table:not(.pjx-table--sec) td:nth-child(6),
  :root[data-v2] .projects-list-view .pjx-table:not(.pjx-table--sec) td:nth-child(7) { display: inline-flex; align-items: center; min-width: 0; }
  :root[data-v2] .projects-list-view .pjx-table:not(.pjx-table--sec) tbody tr:not(.pjx-oppsrow) { grid-template-areas: "ref status" "name status" "c4 c4" "c6 c7"; }
  :root[data-v2] .projects-list-view .pjx-table:not(.pjx-table--sec) td:nth-child(4) { grid-area: c4; }
  :root[data-v2] .projects-list-view .pjx-table:not(.pjx-table--sec) td:nth-child(6) { grid-area: c6; flex-direction: column; align-items: flex-start; justify-content: center; }
  :root[data-v2] .projects-list-view .pjx-table:not(.pjx-table--sec) td:nth-child(7) { grid-area: c7; justify-self: end; }
  :root[data-v2] .projects-list-view .pjx-table td.pjx-projname { font-size: 16px; }
  :root[data-v2] .projects-list-view .pjx-projname__a { white-space: normal; }
  :root[data-v2] .projects-list-view .pjx-table td.pjx-dates > span,
  :root[data-v2] .projects-list-view .pjx-table td.pjx-dates small { white-space: normal; }
  :root[data-v2] .projects-list-view .pjx-zpid { min-height: var(--z-target); padding: 0; }
  /* the secondary tables: a stacked line each */
  :root[data-v2] .projects-list-view .pjx-table--sec tbody tr { display: flex; flex-wrap: wrap; gap: 2px var(--z-s-3); padding: var(--z-s-3) 0; border-bottom: 1px solid var(--z-line); }
  :root[data-v2] .projects-list-view .pjx-table--sec tbody tr td { display: inline-flex; align-items: center; height: auto; padding: 0; border: 0; }
  :root[data-v2] .projects-list-view .pjx-table--sec tbody tr td.pjx-projname { flex-basis: 100%; order: -1; font-size: 16px; }
}

/* The house phone tier. check-mobile-contract.py (§6) reads a fixed table's
   release only inside a 430px block; v2's phone tier (under 600, above)
   already stacks the rows with table-layout: auto, so this repeats that one
   declaration where the guard reads it, and a phone renders nothing new. */
@media (max-width: 430px) {
  :root[data-v2] .projects-list-view .pjx-table { table-layout: auto; }
}
