/* =========================================================
   Portal 2.0 · the project record, on design system v2 (wave 1 pilot 2)

   Authority: docs/authorities/portal-2-design-system-v2.md (layout rules
   7 to 10: the compact header, facts edited in place, the related rail,
   the two-row head; the records row of the mobile table; the states).
   Target: round two's R2-project-shown and R2w-project-1280 boards, with
   the authority's changes on top (one meta line, no fact boxes).

   SCOPE. Every rule needs :root[data-v2] and the record's .pd2 root,
   which only a portal.v2 holder's record carries, so without the key
   nothing here applies. The v2 regions (.pd2-head, .pd2-body) carry .z
   themselves; the record's other tab bodies are today's, outside any .z,
   and keep the page's own ground in both themes until their wave.

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

/* ── the ground: the v2 ground only while a v2 tab shows (the overview,
   related). The legacy main paints its own light ground over the body,
   so it goes too, or dark text tokens land on a light box. ── */
:root[data-v2] body:has(.pd2[data-v2-ground]) { background: var(--z-bg); color: var(--z-text); }
:root[data-v2] body:has(.pd2[data-v2-ground]) main.p-main { background: var(--z-bg); color: var(--z-text); }
/* the app's box holds a screen from the first paint, so the footer starts
   below the fold and never jumps as the record arrives (pilot 1's fix,
   which covers the record too, since both live in #projects-app) */
:root[data-v2] .pd2 { max-width: none; padding: 0; }
/* the page's own footer line, on the v2 ground (as pilot 1's list) */
:root[data-v2] body:has(.pd2[data-v2-ground]) 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(.pd2[data-v2-ground]) footer.footer span { color: var(--z-accent-text); }
/* today's portal-system.css colours every heading by element
   (h1, h2, h3 { color: var(--p-ink) }), which beats .z's inherited colour,
   so a v2 heading was ink on the dark ground. The foundation's own classes
   already outrank that rule for face and size; only the colour needs saying */
:root[data-v2] .pd2 .z h1,
:root[data-v2] .pd2 .z h2,
:root[data-v2] .pd2 .z h3 { color: var(--z-text); }

/* ── the head: crumbs, the record header, the tabs ── */
:root[data-v2] .pd2 .pd2-head {
  padding: var(--z-s-4) var(--z-s-6) 0; background: var(--z-bg); color: var(--z-text);
  font-family: var(--z-f-std); font-size: var(--z-t-body);
}
:root[data-v2] .pd2 .pd2-crumbs { display: flex; align-items: center; gap: var(--z-s-2); margin: 0 0 var(--z-s-2); font-size: var(--z-t-small); color: var(--z-text-2); }
:root[data-v2] .pd2 .pd2-crumbs a { color: var(--z-text-2); text-decoration: none; }
:root[data-v2] .pd2 .pd2-crumbs a:hover { color: var(--z-text); text-decoration: underline; text-underline-offset: 3px; }
:root[data-v2] .pd2 .z-rhead { gap: var(--z-s-3); }
:root[data-v2] .pd2 .z-rhead__main { gap: var(--z-s-1); }
:root[data-v2] .pd2 .z-rhead__actions { align-self: flex-end; }
:root[data-v2] .pd2 .z-rhead .z-tabs { margin-top: var(--z-s-1); }
/* lane C, the five tabs: a group of several shows its members on a second,
   quieter strip under the record's own */
:root[data-v2] .pd2 .pd2-subtabs { margin: var(--z-s-2) 0 0; }
:root[data-v2] .pd2 .pd2-subtabs .z-tab { font-size: var(--z-t-small); }
/* the reference: the ZP chip, as the eyebrow's words. It still copies on a
   press (its "copied." note stays); its icon glyph goes, words not icons */
:root[data-v2] .pd2 .z-rhead__eyebrow .pjx-zpid {
  display: inline-flex; align-items: center; margin: 0; padding: 0 var(--z-s-1); min-height: 22px;
  border: 1px solid transparent; border-radius: var(--z-r); background: transparent; box-shadow: none;
  font: inherit; letter-spacing: inherit; color: var(--z-text-2); cursor: pointer;
}
:root[data-v2] .pd2 .z-rhead__eyebrow .pjx-zpid:hover { border-color: var(--z-line-2); background: var(--z-bg-hover); color: var(--z-text); }
:root[data-v2] .pd2 .z-rhead__eyebrow .pjx-zpid__cp { display: none; }
:root[data-v2] .pd2 .z-rhead__eyebrow .pjx-zpid.is-copied::after { color: var(--z-text); background: var(--z-bg-raised); border-color: var(--z-line-2); }
/* the eyebrow's facts (status, likelihood) read at the eyebrow's size */
:root[data-v2] .pd2 .z-rhead__eyebrow .z-fact { font-size: var(--z-t-small); }
:root[data-v2] .pd2 .z-rhead__eyebrow .z-fact__value { color: var(--z-text); }
:root[data-v2] .pd2 .z-rhead__eyebrow .z-pill { height: 20px; }

/* the stalled sentence, beside the status it explains: only when stalled */
:root[data-v2] .pd2 .pd2-stall { margin: var(--z-s-2) 0 0; max-width: 64ch; font-size: var(--z-t-small); color: var(--z-text-2); }

/* why a dead project died: the record, in full, under the header */
:root[data-v2] .pd2 .pd2-dead {
  margin: var(--z-s-3) 0 0; padding: var(--z-s-3) var(--z-s-4); max-width: 72ch;
  border: 1px solid var(--z-line); border-radius: var(--z-r); background: var(--z-bg-sunk);
  display: flex; flex-direction: column; gap: var(--z-s-1);
}
:root[data-v2] .pd2 .pd2-dead p { margin: 0; font-size: var(--z-t-small); color: var(--z-text-2); }
:root[data-v2] .pd2 .pd2-dead .pd2-dead__what { color: var(--z-text); }
:root[data-v2] .pd2 .pd2-dead .pd2-dead__note { color: var(--z-text); font-size: var(--z-t-body); }
/* who called it and when: the record's footnote, quieter than what happened */
:root[data-v2] .pd2 .pd2-dead .pd2-dead__when { font-size: var(--z-t-label); color: var(--z-text-3); }

/* the loading, failed and not-found states, before the project resolves */
:root[data-v2] .pd2 .pd2-state { max-width: 720px; padding: var(--z-s-2) 0 var(--z-s-6); }

/* ── the inline fact editors that are not a single field ── */
:root[data-v2] .pd2 .pd2-dates { display: grid; grid-template-columns: 1fr 1fr; gap: var(--z-s-2); }
:root[data-v2] .pd2 .pd2-svc { display: flex; flex-direction: column; gap: var(--z-s-1); }
:root[data-v2] .pd2 .pd2-svc__opt { display: flex; align-items: center; gap: var(--z-s-2); min-height: var(--z-control); font-size: var(--z-t-body); color: var(--z-text); }
:root[data-v2] .pd2 .pd2-svc__opt input { width: 18px; height: 18px; margin: 0; accent-color: var(--z-text); }

/* ── the body: the overview, with the rail beside it at a desk ── */
:root[data-v2] .pd2 .pd2-body { background: var(--z-bg); color: var(--z-text); font-family: var(--z-f-std); font-size: var(--z-t-body); }
/* the overview's three sections, spaced as the board spaces them */
:root[data-v2] .pd2 .pd2-overview .z-record__main { gap: var(--z-s-5); }
:root[data-v2] .pd2 .pd2-related { padding: var(--z-s-5) var(--z-s-6) var(--z-s-7); display: flex; flex-direction: column; gap: var(--z-s-5); }
/* while the plan loads: a screen's height held, so nothing below is in view
   when the loaded sections arrive */
:root[data-v2] .pd2 .pd2-waiting { min-height: calc(100vh - var(--z-ribbon-h)); }

/* content that rides a region directly (a table, a list, the plan) loses
   its own box: the region is the box */
:root[data-v2] .pd2 .z-region > .z-list { border: 0; border-radius: 0; }
:root[data-v2] .pd2 .z-region > .z-stack { border: 0; border-radius: 0; }
:root[data-v2] .pd2 .z-region > .pd2-mini { border: 0; border-radius: 0; }
:root[data-v2] .pd2 .z-region > .pd2-note { padding: var(--z-s-2) 14px var(--z-s-3); }
:root[data-v2] .pd2 .pd2-note { margin: 0; font-size: var(--z-t-small); color: var(--z-text-2); }

/* next up: a date, what happens, one mark */
:root[data-v2] .pd2 .pd2-when { display: flex; flex-direction: column; padding: 0 14px; }
:root[data-v2] .pd2 .pd2-when__row {
  display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: var(--z-s-3);
  min-height: var(--z-row); padding: var(--z-s-2) 0; border-bottom: 1px solid var(--z-line);
}
:root[data-v2] .pd2 .pd2-when__row:last-child { border-bottom: 0; }
:root[data-v2] .pd2 .pd2-when__d { font-size: var(--z-t-small); color: var(--z-text-2); white-space: nowrap; }
:root[data-v2] .pd2 .pd2-when__d.is-today { color: var(--z-accent-text); font-weight: 600; }
:root[data-v2] .pd2 .pd2-when__w { min-width: 0; color: var(--z-text); overflow-wrap: anywhere; }
:root[data-v2] .pd2 .pd2-when__w b { font-weight: 600; }
:root[data-v2] .pd2 .pd2-when__m { justify-self: end; }
:root[data-v2] .pd2 .pd2-mention { color: var(--z-text); font-weight: 600; text-decoration: none; }
:root[data-v2] .pd2 .pd2-mention:hover { text-decoration: underline; text-underline-offset: 3px; }
:root[data-v2] .pd2 .pd2-stage { font-size: var(--z-t-small); color: var(--z-text-2); }

/* lane C, the front page's Portal 2.0 parts (project-overview.js): needs
   doing (which tab, what, one link), the job (each piece of work, its
   likelihood, its tag), and closing the job in the rail */
:root[data-v2] .pd2 .pd2-needs, :root[data-v2] .pd2 .pd2-job { display: flex; flex-direction: column; padding: 0 14px; }
:root[data-v2] .pd2 .pd2-needs__row {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; align-items: baseline; gap: var(--z-s-3);
  padding: var(--z-s-2) 0; border-bottom: 1px solid var(--z-line);
}
:root[data-v2] .pd2 .pd2-needs__row:last-child, :root[data-v2] .pd2 .pd2-job__row:last-child { border-bottom: 0; }
:root[data-v2] .pd2 .pd2-needs__tab { font-size: var(--z-t-small); color: var(--z-text-2); }
:root[data-v2] .pd2 .pd2-needs__what { min-width: 0; color: var(--z-text-2); overflow-wrap: anywhere; }
:root[data-v2] .pd2 .pd2-needs__what b { color: var(--z-text); font-weight: 600; }
:root[data-v2] .pd2 .pd2-job__row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 140px; align-items: center; gap: var(--z-s-3);
  min-height: var(--z-row); padding: var(--z-s-2) 0; border-bottom: 1px solid var(--z-line);
}
:root[data-v2] .pd2 .pd2-job__what { min-width: 0; overflow-wrap: anywhere; }
:root[data-v2] .pd2 .pd2-job__when { font-size: var(--z-t-small); color: var(--z-text-2); }
:root[data-v2] .pd2 .pd2-job__lk { font-size: var(--z-t-small); color: var(--z-text-2); white-space: nowrap; }
:root[data-v2] .pd2 .pd2-job__tag { justify-self: end; font-size: var(--z-t-small); color: var(--z-text); }
:root[data-v2] .pd2 .pd2-close { display: flex; flex-direction: column; gap: var(--z-s-2); align-items: flex-start; }
:root[data-v2] .pd2 .pd2-close__not { font-size: var(--z-t-small); color: var(--z-text); }
:root[data-v2] .pd2 .pd2-close__not ul { margin: var(--z-s-1) 0 0; padding-left: var(--z-s-4); }

/* the opportunities: the shared prefix is quieter; the reference stays whole */
:root[data-v2] .pd2 .pd2-pre { color: var(--z-text-3); }
:root[data-v2] .pd2 .pd2-id { color: var(--z-text-2); font-variant-numeric: tabular-nums; }

/* the plan, the next fortnight, in the coverage language */
:root[data-v2] .pd2 .pd2-mini { position: relative; overflow-x: auto; background: var(--z-bg-raised); }
:root[data-v2] .pd2 .pd2-mini__in { position: relative; min-width: 720px; }
:root[data-v2] .pd2 .pd2-mini__days,
:root[data-v2] .pd2 .pd2-mini__row { display: grid; grid-template-columns: 208px repeat(14, minmax(0, 1fr)); }
:root[data-v2] .pd2 .pd2-mini__days { height: 44px; border-bottom: 1px solid var(--z-line-2); background: var(--z-bg-sunk); }
:root[data-v2] .pd2 .pd2-mini__days > span {
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.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);
}
:root[data-v2] .pd2 .pd2-mini__days > span b { font-family: var(--z-f-std); font-weight: 600; font-size: var(--z-t-small); letter-spacing: 0; color: var(--z-text); }
:root[data-v2] .pd2 .pd2-mini__days > span.is-today,
:root[data-v2] .pd2 .pd2-mini__days > span.is-today b { color: var(--z-accent-text); }
:root[data-v2] .pd2 .pd2-mini__days > .pd2-mini__lbl { align-items: flex-start; padding-left: 14px; }
:root[data-v2] .pd2 .pd2-mini__bg {
  position: absolute; left: 208px; right: 0; top: 44px; bottom: 0; pointer-events: none;
  display: grid; grid-template-columns: repeat(14, minmax(0, 1fr));
}
:root[data-v2] .pd2 .pd2-mini__bg span { border-left: 1px solid var(--z-line); }
:root[data-v2] .pd2 .pd2-mini__bg span.is-we { background: var(--z-bg-sunk); }
:root[data-v2] .pd2 .pd2-mini__bg span.is-today { box-shadow: inset 2px 0 0 var(--z-accent); }
:root[data-v2] .pd2 .pd2-mini__row { position: relative; min-height: 44px; align-items: center; border-bottom: 1px solid var(--z-line); }
:root[data-v2] .pd2 .pd2-mini__row:last-child { border-bottom: 0; }
:root[data-v2] .pd2 .pd2-mini__row > .pd2-mini__lbl { display: flex; flex-direction: column; justify-content: center; min-width: 0; padding: 0 14px; line-height: 1.25; }
:root[data-v2] .pd2 .pd2-mini__lbl b { font-size: var(--z-t-small); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--z-text); }
:root[data-v2] .pd2 .pd2-mini__lbl span { font-size: var(--z-t-label); color: var(--z-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-v2] .pd2 .pd2-mini__row .z-cov { margin: 0 2px; position: relative; grid-row: 1; }
:root[data-v2] .pd2 .pd2-mini__row > .pd2-mini__lbl { grid-row: 1; grid-column: 1; }

/* the related rail's rows that carry a control: the folders */
:root[data-v2] .pd2 .pd2-folder { display: flex; align-items: center; gap: var(--z-s-2); }
:root[data-v2] .pd2 .pd2-folder > .z-ref { flex: 1; min-width: 0; }
:root[data-v2] .pd2 .pd2-docs { display: flex; }
/* the documents chip is today's component: on the v2 ground it takes the
   rail's words and lines */
:root[data-v2] .pd2 .pd2-docs button { font-family: var(--z-f-std); font-size: var(--z-t-small); font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--z-text); background: var(--z-bg-raised); border: 1px solid var(--z-line-2); border-radius: var(--z-r); min-height: var(--z-control); padding: 0 var(--z-s-3); }
:root[data-v2] .pd2 .pd2-docs * { text-transform: none; letter-spacing: 0; }
:root[data-v2] .pd2 .pd2-docs button:hover { background: var(--z-bg-hover); }
:root[data-v2] .pd2 .pd2-details { display: flex; flex-direction: column; gap: var(--z-s-1); }
:root[data-v2] .pd2 .pd2-details__row { display: flex; min-height: var(--z-control); align-items: center; font-size: var(--z-t-body); }

/* today's delete control, on the v2 ground of a v2 tab: destructive is red
   words on an outline, and it still asks first (its own confirm stage).
   On a legacy tab the ground stays light, so it keeps today's look there */
:root[data-v2] .pd2[data-v2-ground] .pd-danger { background: transparent; color: var(--z-text-2); padding: var(--z-s-5) var(--z-s-6); }
:root[data-v2] .pd2[data-v2-ground] .pd-danger .pl-btn {
  min-height: var(--z-control); padding: 0 var(--z-s-3); border-radius: var(--z-r);
  background: var(--z-bg-raised); color: var(--z-text); border: 1px solid var(--z-line-2);
  font-family: var(--z-f-std); font-weight: 500; font-size: var(--z-t-small); text-transform: none; letter-spacing: 0;
}
:root[data-v2] .pd2[data-v2-ground] .pd-danger .pl-btn--danger { color: var(--z-bad); border-color: var(--z-bad); }
:root[data-v2] .pd2[data-v2-ground] .pd-danger .pl-btn:hover { background: var(--z-bg-hover); }

/* ── THE UI PASS (15 Oct 2026): the boards' head, ground and width ──
   A quote-model holder's head (.p2-head, V2RecordHead's board branch):
   the crumb, a 46px title, one meta line led by the derived likelihood,
   the five tabs underlined in orange. On the tabs drawn to a board
   (data-p2: overview, quote, finance) the page takes the boards' ground,
   #fafaf8 (the sunk ground), and their width: to 1280, 40px each side. */
:root[data-v2] body:has(.pd2[data-p2]),
:root[data-v2] body:has(.pd2[data-p2]) main.p-main { background: var(--z-bg-sunk); color: var(--z-text); }
/* snag round 6b (D2): the head spans the full content width on every tab,
   as the plan board does (it was capped at 1,280, so on the plan its right
   edge stopped short of the board's); it never changes size between tabs */
:root[data-v2] .pd2 .p2-head { background: var(--z-bg-sunk); padding: 32px 40px 0; box-sizing: border-box; }
/* ...and a tab drawn full width (the plan) keeps the head's 40px sides, so
   the board's right edge and the head's meet */
@media (min-width: 961px) {
  :root[data-v2] .pd2:not([data-p2]) .pd-panel { padding-left: 40px; padding-right: 40px; }
}
:root[data-v2] .pd2 .p2-head .zb-crumb a { color: inherit; text-decoration: none; }
:root[data-v2] .pd2 .p2-head .zb-crumb a:hover { text-decoration: underline; text-underline-offset: 3px; }
:root[data-v2] .pd2 .p2-head .p2-head__rh { gap: 0; }
/* THE SECOND UI PASS (16 Oct 2026, defect 3): on the finance tab two more
   actions (all orders, bills) sat beside the title and squeezed it onto two
   lines. The title row takes the room and the actions never shrink; when
   there is not room for both, the actions wrap under, not the title. */
:root[data-v2] .pd2 .p2-head .p2-head__top { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--z-s-3) var(--z-s-5); }
:root[data-v2] .pd2 .p2-head .p2-head__titlerow { flex: 1 1 560px; min-width: 0; align-items: baseline; gap: var(--z-s-3); }
:root[data-v2] .pd2 .p2-head .p2-head__top > .z-rhead__actions { flex: 0 0 auto; align-self: flex-start; margin-top: 6px; }
:root[data-v2] .pd2 .p2-head .z-rhead__title { font-size: 46px; line-height: 1; letter-spacing: -0.035em; min-width: 0; overflow-wrap: anywhere; }
:root[data-v2] .pd2 .p2-head .p2-head__meta { margin-top: 14px; column-gap: 22px; row-gap: 6px; font-size: 15px; color: var(--z-text-2); }
:root[data-v2] .pd2 .p2-head .p2-head__meta > *:not(:last-child)::after { content: none; }
:root[data-v2] .pd2 .p2-head .p2-head__meta .z-fact__label { margin-right: 4px; color: var(--z-text-2); }
:root[data-v2] .pd2 .p2-head .p2-head__meta .z-fact__value { color: var(--z-text-2); }
/* line two and the people (the second UI pass): the people on their own
   line, AM then PM then CL; anything unset muted, with "set" */
:root[data-v2] .pd2 .p2-head .p2-head__people { margin-top: 8px; column-gap: 22px; row-gap: 6px; font-size: 15px; color: var(--z-text-2); }
:root[data-v2] .pd2 .p2-head .p2-head__who { font-family: var(--z-f-cd); font-size: 13px; letter-spacing: 0.06em; color: var(--z-text-3); }
:root[data-v2] .pd2 .p2-head .p2-head__name { color: var(--z-text); }
:root[data-v2] .pd2 .p2-head .p2-head__client a { color: var(--z-text); }
:root[data-v2] .pd2 .p2-head .p2-head__unset { color: var(--z-text-3); }
:root[data-v2] .pd2 .p2-head .p2-head__set { color: var(--z-accent-text); font: inherit; background: none; border: 0; padding: 0 6px; margin: -11px -2px; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; text-decoration: underline; cursor: pointer; }
:root[data-v2] .pd2 .p2-head .p2-head__set:focus-visible { outline: 2px solid var(--z-focus); outline-offset: 2px; }
:root[data-v2] .pd2 .p2-head .p2-head__tabs .z-tabs { gap: 28px; margin-top: 26px; border-bottom: 1px solid var(--z-line-2); }
:root[data-v2] .pd2 .p2-head .p2-head__tabs .z-tab {
  height: auto; padding: 10px 2px; font-size: 16px; font-weight: 400; color: var(--z-text-2);
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
:root[data-v2] .pd2 .p2-head .p2-head__tabs .z-tab[aria-selected="true"] { color: var(--z-text); font-weight: 600; border-bottom-color: var(--z-accent); }
:root[data-v2] .pd2 .p2-head .pd2-subtabs .z-tabs { gap: 22px; border-bottom: 1px solid var(--z-line); }
/* snag round 4 (D2): a tab with no sub-tabs keeps the row, empty, at the
   same height, so the header never shrinks between tabs */
:root[data-v2] .pd2 .p2-head .pd2-subtabs.is-empty .z-tab.is-ghost { visibility: hidden; pointer-events: none; }
:root[data-v2] .pd2[data-p2] .pd-panel { max-width: 1280px; box-sizing: border-box; padding: 28px 40px 64px; }
:root[data-v2] .pd2[data-p2] .pd2-body { background: var(--z-bg-sunk); max-width: 1280px; box-sizing: border-box; }
:root[data-v2] .pd2[data-p2] .pd-danger { max-width: 1280px; box-sizing: border-box; padding-left: 40px; padding-right: 40px; background: transparent; }
/* the overview, as Project.dc.html: section titles at 27px above white
   cards; the rail is three cards (details, history, closing the job), then
   the folders and documents */
:root[data-v2] .pd2 .p2-ov { padding: 26px 40px 48px; }
:root[data-v2] .pd2 .p2-ov .p2-ov__cols { gap: 24px; }
:root[data-v2] .pd2 .p2-ov .p2-ov__main { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
:root[data-v2] .pd2 .p2-ov .p2-ov__side { align-self: start; }
:root[data-v2] .pd2 .p2-ov .z-region { border: 0; background: transparent; overflow: visible; }
:root[data-v2] .pd2 .p2-ov .z-region__head { padding: 0 0 12px; border-bottom: 0; }
:root[data-v2] .pd2 .p2-ov .z-region__head .z-h3 { font-family: var(--z-f-ex); font-weight: 700; font-size: 27px; letter-spacing: -0.035em; line-height: 1.05; }
:root[data-v2] .pd2 .p2-ov .z-region__head .z-count { display: none; }
:root[data-v2] .pd2 .p2-ov .z-region > :not(.z-region__head) { background: var(--z-bg-raised); border: 1px solid var(--z-line-2); border-radius: var(--z-r); }
:root[data-v2] .pd2 .p2-ov .z-region > .pd2-note { background: transparent; border: 0; padding: 8px 0 0; }
:root[data-v2] .pd2 .p2-ov .z-rail { border: 0; background: transparent; padding: 0; gap: 24px; }
:root[data-v2] .pd2 .p2-ov .z-rail__group { background: var(--z-bg-raised); border: 1px solid var(--z-line-2); border-radius: var(--z-r); padding: 20px 20px 18px; gap: 10px; }
:root[data-v2] .pd2 .p2-ov .z-rail__group .z-sechead .z-h3 { font-family: var(--z-f-ex); font-weight: 700; font-size: 21px; letter-spacing: -0.03em; }
:root[data-v2] .pd2 .p2-ov .pd2-needs { padding: 0 22px; }
:root[data-v2] .pd2 .p2-ov .pd2-needs__row { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: 18px 0; }
:root[data-v2] .pd2 .p2-ov .pd2-needs__what { color: var(--z-text); font-size: 16px; }
:root[data-v2] .pd2 .p2-ov .pd2-needs__what b { font-weight: 600; }
:root[data-v2] .pd2 .p2-ov .pd2-needs__sub { display: block; margin-top: 2px; font-size: 13px; color: var(--z-text-2); }
:root[data-v2] .pd2 .p2-ov .pd2-needs__tab { margin-right: 4px; vertical-align: 2px; }
/* a quiet note (a stalled project) reads as a note, not an alarm */
:root[data-v2] .pd2 .p2-ov .pd2-needs__row--quiet .pd2-needs__what { color: var(--z-text-2); }
:root[data-v2] .pd2 .p2-ov .pd2-needs__row--quiet .pd2-needs__what b { font-weight: 500; color: var(--z-text-2); }
:root[data-v2] .pd2 .p2-ov .pd2-details__set { color: var(--z-accent-text); font: inherit; background: none; border: 0; padding: 0 6px; margin: -11px -2px; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; text-decoration: underline; cursor: pointer; }
:root[data-v2] .pd2 .p2-ov .pd2-job { padding: 0 22px; }
:root[data-v2] .pd2 .p2-ov .pd2-job__row { grid-template-columns: minmax(0, 1fr) auto auto; min-height: 44px; font-size: 15px; }
:root[data-v2] .pd2 .p2-ov .pd2-job__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
:root[data-v2] .pd2 .p2-ov .pd2-when { padding: 0 22px; }
:root[data-v2] .pd2 .p2-ov .pd2-when__row { font-size: 15px; }
:root[data-v2] .pd2 .p2-ov .pd2-hist { display: flex; flex-direction: column; }
:root[data-v2] .pd2 .p2-ov .pd2-hist__row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--z-line); font-size: 14px; }
:root[data-v2] .pd2 .p2-ov .pd2-hist__d { font-family: var(--z-f-cd); font-size: 13px; color: var(--z-text-3); }
:root[data-v2] .pd2 .p2-ov .pd2-details-dl dd { font-size: 15px; }
@media (max-width: 700px) {
  :root[data-v2] .pd2 .p2-ov { padding: 20px 24px 40px; }
  :root[data-v2] .pd2 .p2-ov .pd2-needs__row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  :root[data-v2] .pd2 .p2-head { padding: 20px 24px 0; }
  :root[data-v2] .pd2 .p2-head .z-rhead__title { font-size: 34px; }
  :root[data-v2] .pd2 .p2-head .p2-head__top { flex-direction: column; gap: var(--z-s-2); }
  /* the third UI pass: in a column the row's 560px basis became a 560px
     height, a blank band under every title on a phone */
  :root[data-v2] .pd2 .p2-head .p2-head__titlerow { flex-basis: auto; }
  :root[data-v2] .pd2[data-p2] .pd-panel { padding: 20px 24px 48px; }
}

/* ── tablet and phone: 44px targets ── */
@media (max-width: 1023px) {
  :root[data-v2] .pd2 .pd2-head { padding: var(--z-s-3) var(--z-s-5) 0; }
  :root[data-v2] .pd2 .pd2-crumbs a { display: inline-flex; align-items: center; min-height: var(--z-target); }
  :root[data-v2] .pd2 .z-rhead__eyebrow .pjx-zpid { min-height: var(--z-target); }
  :root[data-v2] .pd2 .pd2-mention { display: inline-flex; align-items: center; min-height: var(--z-target); }
  :root[data-v2] .pd2 .pd2-docs button { min-height: var(--z-target); }
}

/* ── a phone: the job, not the page. The eyebrow, the title and a meta
   line of at most two lines (three facts; the rest are on the related
   tab), then the tabs as a scrolling strip. Body text is 16px ── */
@media (max-width: 599px) {
  :root[data-v2] .pd2 .pd2-head { padding: var(--z-s-2) var(--z-s-4) 0; }
  :root[data-v2] .pd2 .pd2-head,
  :root[data-v2] .pd2 .pd2-body { font-size: 16px; }
  :root[data-v2] .pd2 .z-rhead__top { flex-direction: column; gap: var(--z-s-2); }
  :root[data-v2] .pd2 .z-rhead__actions { align-self: flex-start; }
  :root[data-v2] .pd2 .z-rhead__meta { font-size: var(--z-t-body); }
  :root[data-v2] .pd2 .pd2-body .z-record__main { padding: var(--z-s-4); }
  :root[data-v2] .pd2 .pd2-related { padding: var(--z-s-4) var(--z-s-4) var(--z-s-7); }
  :root[data-v2] .pd2 .pd2-when__row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "d m" "w w"; row-gap: 2px; }
  :root[data-v2] .pd2 .pd2-when__d { grid-area: d; }
  :root[data-v2] .pd2 .pd2-when__w { grid-area: w; }
  :root[data-v2] .pd2 .pd2-when__m { grid-area: m; }
  /* the plan is a grid that has to scroll: its first column stays put */
  :root[data-v2] .pd2 .pd2-mini__in { min-width: 640px; }
  :root[data-v2] .pd2 .pd2-mini__days,
  :root[data-v2] .pd2 .pd2-mini__row { grid-template-columns: 132px repeat(14, minmax(0, 1fr)); }
  :root[data-v2] .pd2 .pd2-mini__bg { left: 132px; }
  :root[data-v2] .pd2 .pd2-mini__lbl { position: sticky; left: 0; z-index: 1; background: var(--z-bg-raised); }
  :root[data-v2] .pd2 .pd2-mini__days > .pd2-mini__lbl { background: var(--z-bg-sunk); }
}
