/* Screens added in the second pass: shell layers, Map, Issues, Analytics, Reports.
 * Tokens and the shared component language live in app.css. */

/* ===================================================================== shell
 * Layers that must sit OUTSIDE the smoother's transform. */
/* 🔴 The canvas paints UNDER the scroll column and shows through a transparent
   hole in the stage panel. At a z-index above the column it covered the pins,
   the rail and the hero — and the pins were positioned correctly the whole time,
   which is exactly what makes this one hard to see. */
#gl {
  position: fixed; left: 0; top: 0; z-index: 1;
  transform-origin: 0 0; pointer-events: auto;
  border-radius: var(--r-lg);
}
#gl[hidden] { display: none; }

.mast .mastxt { min-width: 0; }
.langtog { margin-inline-start: 12px; font-weight: 700; }

.panel.empty { padding: 64px var(--sp-6); text-align: center; }
.panel.empty h2 { margin: 0 0 6px; font-size: var(--t-h2); }
.panel.empty p { margin: 0; color: var(--slate); }

.panel > header .note {
  font-size: var(--t-label); color: var(--stone-text); max-width: 46ch;
  text-align: end; line-height: 1.4;
}
.kpis.kpis-4 { grid-template-columns: repeat(4, 1fr); }

.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; padding: 0 16px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--canvas); font-size: 13px; font-weight: 600;
}
.pill svg { width: 15px; height: 15px; stroke: currentColor; stroke-width: 1.9;
  fill: none; stroke-linecap: round; stroke-linejoin: round; }
.pill.ghost { background: var(--card); color: var(--ink); border: 1px solid var(--hairline); }
.field input[type="date"] {
  min-height: 38px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--hairline); background: var(--card); font-size: 13px;
  font-family: inherit;
}

/* ===================================================================== map */
.mapcols {
  display: grid; grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--sp-4); align-items: start;
}
/* transparent so the canvas underneath is visible; the border still reads as a panel */
.stagewrap { padding: 0; overflow: hidden; background: transparent; }
.stage {
  position: relative; height: min(62vh, 620px); min-height: 380px;
  border-radius: var(--r-lg); overflow: hidden;
  background: transparent;
  /* 🔴 A transparent region layered over the canvas still takes every pointer
     hit, so orbit, zoom and click would be silently dead with no error. Only
     the chrome takes events; everything else falls through to the canvas. */
  pointer-events: none;
}
.stage.noscene-on { background: var(--hairline-soft); }
.stage .pins, .stage .stagechrome { pointer-events: none; }
/* 🔴 Every new control in the chrome must be named HERE. `.stage` is pointer-events:none so the
   canvas underneath can be orbited, and `.stagechrome` inherits it — a button added without
   being added to this list renders perfectly and does nothing at all. */
.stage .pin, .stage .namechip, .stage .noscene, .stage .stageback { pointer-events: auto; }

.stagechrome {
  position: absolute; inset: 0; padding: var(--sp-4);
  display: flex; align-items: flex-start; gap: var(--sp-3); z-index: 3;
}
.namechip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: var(--r-pill);
  background: oklch(1 0 0 / .92); border: 1px solid var(--hairline);
  font-size: 13px; font-weight: 600;
}
.stage .loading {
  margin-inline-start: auto; padding: 7px 13px; border-radius: var(--r-pill);
  background: oklch(1 0 0 / .92); border: 1px solid var(--hairline);
  font-size: var(--t-label); font-weight: 600; color: var(--slate);
}

.pins { position: absolute; inset: 0; z-index: 2; }
.pin {
  position: absolute; left: 0; top: 0; z-index: var(--z, 1);
  display: flex; flex-direction: column; align-items: center;
  transform: translate(-50%, -50%); padding: 0; will-change: transform;
}
.pin > * { pointer-events: none; }
.pin .shot {
  position: relative; width: 62px; height: 46px; border-radius: 9px;
  overflow: hidden; border: 2px solid var(--canvas); background: var(--hairline);
  box-shadow: 0 2px 10px oklch(0.227 0.004 286 / .28);
}
.pin .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pin.locked .shot img { filter: grayscale(1) brightness(.8); }
.pin .hazard {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg,
    oklch(0.487 0.180 25 / .6) 0 5px, oklch(0.227 0.004 286 / .6) 5px 10px);
}
.pin .lk {
  position: absolute; inset-block-start: 3px; inset-inline-end: 3px;
  width: 15px; height: 15px; border-radius: 4px; background: var(--late);
  display: grid; place-items: center;
}
.pin .lk svg { width: 9px; height: 9px; stroke: var(--canvas); stroke-width: 2.4;
  fill: none; stroke-linecap: round; }
.pin .lbl {
  margin-top: 5px; padding: 3px 8px; border-radius: var(--r-pill);
  background: oklch(1 0 0 / .94); border: 1px solid var(--hairline);
  display: flex; flex-direction: column; align-items: center; line-height: 1.25;
  white-space: nowrap;
}
.pin .lbl .nm { font-size: 11px; font-weight: 700; }
.pin .lbl .dt { font-size: 11px; color: var(--slate); }
.pin .leader { width: 1px; height: 14px; background: var(--ink); opacity: .5; }
.pin:not(.locked) { cursor: pointer; }
.pin:not(.locked):hover .shot { border-color: var(--brand-yellow); }

.noscene {
  position: absolute; inset: 0; z-index: 4;
  display: grid; place-content: center; justify-items: center; gap: var(--sp-4);
  padding: var(--sp-6); background: var(--surface); text-align: center;
}
.noscene .ph { width: min(380px, 70%); border-radius: var(--r-md); overflow: hidden; }
.noscene .ph img { width: 100%; display: block; }
.noscene p { margin: 0; color: var(--slate); font-size: 13px; max-width: 36ch; }

.viewlist ul { list-style: none; margin: 0; padding: var(--sp-2); }
.vrow {
  display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center;
  padding: var(--sp-2); border-radius: var(--r-md);
  text-decoration: none; color: inherit; min-height: 48px;
}
a.vrow:hover { background: var(--surface); }
.vrow .th {
  position: relative; width: 54px; height: 40px; border-radius: 7px;
  overflow: hidden; background: var(--hairline);
}
.vrow .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vrow.locked .th img { filter: grayscale(1) brightness(.8); }
.vrow .th .hazard {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg,
    oklch(0.487 0.180 25 / .55) 0 5px, oklch(0.227 0.004 286 / .55) 5px 10px);
}
.vrow .meta { min-width: 0; }
.vrow .nm { display: block; font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrow .dt { display: block; font-size: var(--t-label); color: var(--stone-text); }
.vrow .rs {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 2px;
  font-size: var(--t-label); font-weight: 600; color: var(--late);
}
.vrow .rs svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2.2; fill: none; }

/* ================================================================== issues */
.issues { list-style: none; margin: 0; padding: var(--sp-2) var(--sp-3) var(--sp-4); }
.issue {
  display: grid; grid-template-columns: 92px minmax(0, 1fr) 128px 164px;
  gap: var(--sp-4); align-items: start;
  padding: var(--sp-4) var(--sp-3);
  border-bottom: 1px solid var(--hairline-soft);
}
.issue:last-child { border-bottom: 0; }
.issue .th {
  width: 92px; height: 68px; border-radius: var(--r-sm); overflow: hidden;
  background: var(--hairline); display: block;
}
.issue .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.issue .hd { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.issue .ttl { font-size: 14px; font-weight: 600; }
.issue .anchor {
  display: flex; align-items: center; gap: 5px; margin-top: 4px;
  font-size: var(--t-label); color: var(--slate);
}
.issue .anchor svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 1.7;
  fill: none; stroke-linejoin: round; }
.issue .desc { margin: 7px 0 0; font-size: 13px; color: var(--slate); }
.issue .meta {
  margin-top: 6px; font-size: var(--t-label); color: var(--stone-text);
  display: flex; gap: 6px; flex-wrap: wrap;
}
.issue .sep { opacity: .5; }
.issue .side2 { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.issue .type { font-size: var(--t-label); font-weight: 600; color: var(--slate); }
.issue .act {
  display: flex; flex-direction: column; gap: 4px; align-items: flex-end;
  text-align: end; font-size: var(--t-label); color: var(--stone-text);
}
.issue .act .who { font-weight: 600; color: var(--slate); }
.issue .cmt { display: inline-flex; align-items: center; gap: 4px; }
.issue .cmt svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 1.8;
  fill: none; stroke-linejoin: round; }
.issue .open {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 4px;
  font-size: var(--t-label); font-weight: 600; color: var(--ink);
  text-decoration: none; min-height: 28px;
}
.issue .open svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round; }
:dir(rtl) .issue .open svg { transform: scaleX(-1); }
.issue .open:hover { text-decoration: underline; text-underline-offset: 3px; }

.state {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px;
  border-radius: var(--r-pill); font-size: var(--t-label); font-weight: 700;
  border: 1px solid transparent;
}
.state.open     { background: var(--brand-yellow); color: var(--ink); }
.state.resolved { background: var(--tint-teal); color: var(--ok); }
.state.closed   { background: var(--card); color: var(--slate); border-color: var(--hairline); }

.issues .empty { padding: 56px var(--sp-4); text-align: center; color: var(--slate); }

/* =============================================================== analytics */
.anal {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4); align-items: start;
}
.anal .wide { grid-column: 1 / -1; }
.anal .chartbox { padding: var(--sp-3) var(--sp-5) var(--sp-5); }
.anal .caption {
  padding: 0 var(--sp-5) var(--sp-5); font-size: var(--t-label); color: var(--slate);
}
.legend { display: flex; align-items: center; gap: 7px; font-size: var(--t-label);
  color: var(--slate); }
.legend .lg { width: 14px; height: 3px; border-radius: 2px; background: var(--planned);
  margin-inline-start: var(--sp-2); }
.legend .lg.actual { background: var(--ok-fill); margin-inline-start: 0; }
.legend .lg.actual.warn { background: var(--warn-fill); }
.legend .lg.actual.late { background: var(--late-fill); }

.chart { width: 100%; height: auto; display: block; }
.chart .grid line { stroke: var(--hairline-soft); stroke-width: 1; }
.chart .ax { fill: var(--stone-text); font-size: 11px; font-weight: 600; }
.chart .axv { fill: var(--slate); font-size: 11px; font-weight: 700; }
.chart .ln { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .dot { stroke: var(--canvas); stroke-width: 2; r: 4; }
.chart .ser.plan .ln, .chart .ser.plan .dot { stroke: var(--planned); }
.chart .ser.plan .dot { fill: var(--planned); }
.chart .ser.actual .ln { stroke: var(--ok-fill); }
.chart .ser.actual .dot { fill: var(--ok-fill); }
.chart .ser.actual.warn .ln { stroke: var(--warn-fill); }
.chart .ser.actual.warn .dot { fill: var(--warn-fill); }
.chart .ser.actual.late .ln { stroke: var(--late-fill); }
.chart .ser.actual.late .dot { fill: var(--late-fill); }
.chart .bar { fill: var(--planned); }
.chart .bar.ok { fill: var(--ok-fill); }
.chart .bar.warn { fill: var(--warn-fill); }
.chart .bar.late { fill: var(--late-fill); }

.fresh { list-style: none; margin: 0; padding: var(--sp-2) var(--sp-5) var(--sp-5); }
.fresh li {
  display: grid; grid-template-columns: minmax(0, 260px) 1fr 56px;
  gap: var(--sp-4); align-items: center; padding: 7px 0;
}
.fresh .nm { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fresh .dt { text-align: end; font-size: var(--t-label); font-weight: 700; color: var(--slate); }

/* ================================================================= reports */
.sheet { padding: var(--sp-7); max-width: 1000px; }
.sheethead { border-bottom: 1px solid var(--hairline); padding-bottom: var(--sp-5); }
.sheethead .eyebrow {
  font-size: var(--t-label); font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--stone-text);
}
.sheethead h2 { margin: 6px 0 0; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.sheethead .sub { margin: 4px 0 0; color: var(--slate); font-size: 13px; }
.sheethead .range { margin: 2px 0 0; color: var(--stone-text); font-size: var(--t-label); }

.counters {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3);
  padding: var(--sp-5) 0;
}
.counter {
  border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: var(--sp-4); display: flex; flex-direction: column; gap: 4px;
}
.counter .k { font-size: var(--t-label); font-weight: 700; color: var(--slate); }
.counter .n { font-size: var(--t-metric); font-weight: 700; letter-spacing: -.02em; }
.counter.open .n { color: var(--warn); }
.counter.resolved .n { color: var(--ok); }

.acth { margin: var(--sp-4) 0 var(--sp-3); font-size: 15px; font-weight: 700; }
.replist { list-style: none; margin: 0; padding: 0; }
.replist li {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) 140px;
  gap: var(--sp-4); align-items: start;
  padding: var(--sp-3) 0; border-bottom: 1px solid var(--hairline-soft);
}
.replist .th { width: 76px; height: 56px; border-radius: var(--r-sm); overflow: hidden;
  background: var(--hairline); display: block; }
.replist .th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.replist .hd { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.replist .ttl { font-size: 14px; font-weight: 600; }
.replist .meta { margin-top: 4px; font-size: var(--t-label); color: var(--stone-text);
  display: flex; gap: 6px; flex-wrap: wrap; }
.replist .sep { opacity: .5; }
.replist .desc { margin: 6px 0 0; font-size: 13px; color: var(--slate); }
.replist .act { text-align: end; font-size: var(--t-label); color: var(--stone-text);
  display: flex; flex-direction: column; gap: 3px; }
.replist .act .who { font-weight: 600; color: var(--slate); }
.sheet .empty { color: var(--slate); font-size: 13px; }

/* ===================================================================== print
 * Everything but the report sheet is chrome. */
@media print {
  #rail, #gl, #depth, #pop, .hero, .mast { display: none !important; }
  #smooth-wrapper { position: static !important; overflow: visible !important; }
  #smooth-content { padding: 0 !important; transform: none !important; }
  .sheet { border: 0; padding: 0; max-width: none; }
  .replist li { break-inside: avoid; }
}

/* =============================================================== responsive */
@media (max-width: 1360px) {
  .mapcols { grid-template-columns: minmax(0, 1fr) 280px; }
  .issue { grid-template-columns: 76px minmax(0, 1fr) 120px; }
  .issue .act { grid-column: 2 / -1; flex-direction: row; gap: var(--sp-3);
    align-items: center; justify-content: flex-start; text-align: start; }
  .kpis.kpis-4 { grid-template-columns: repeat(2, 1fr); }
  .kpis.kpis-4 .kpi:nth-child(n+4) { display: flex; }
}
@media (max-width: 1080px) {
  .mapcols, .anal { grid-template-columns: minmax(0, 1fr); }
  .counters { grid-template-columns: repeat(2, 1fr); }
  .issue { grid-template-columns: 64px minmax(0, 1fr); }
  .issue .side2 { grid-column: 2; flex-direction: row; }
}

/* leader lines from each fanned billboard back to its true ground point */
.leaders {
  position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%;
  pointer-events: none; overflow: visible;
}
.leaders line { stroke: var(--ink); stroke-width: 1; opacity: .45; }
.leaders circle { fill: var(--ink); opacity: .75; }

/* ============================================================== demo marker
 * The chip makes the note get seen; the note is what actually says what is
 * illustrative. Both are chrome, so neither prints. */
.titlerow { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.demochip {
  display: inline-flex; align-items: center; min-height: 24px; padding: 0 10px;
  border-radius: var(--r-pill); border: 1px solid var(--hairline);
  background: var(--card); color: var(--slate);
  font-size: 11px; font-weight: 700; letter-spacing: .07em;
  white-space: nowrap; align-self: center;
}
.demonote {
  margin: var(--sp-6) 0 0; padding-top: var(--sp-4);
  border-top: 1px solid var(--hairline);
  font-size: var(--t-label); color: var(--stone-text);
  max-width: 78ch; line-height: 1.5;
}
@media print { .demochip, .demonote { display: none; } }

/* Which capture the 3D scene actually is, when it is not the project's own site scan.
 * The backdrop is opaque-over-white like .namechip so audit() can resolve it. */
.viachip {
  display: inline-flex; align-items: center; min-height: 20px; padding: 0 8px;
  border-radius: var(--r-pill); background: var(--hairline-soft);
  color: var(--slate); font-size: 11px; font-weight: 700;
}

/* ============================================================ project screen
 * `/project/<id>` — a project and its captures. Reuses `.vrow` (the Map view list),
 * `.attn` (the portfolio's needs-attention list) and `.kpis` verbatim; everything new is
 * namespaced `pj*` because screens.css already owns short names like `.legend .lg` and a
 * collision looks almost right. Grepped against app.css, screens.css and spine.css: 0 hits.
 */
 /* 🔴 Only I.ok / I.warn / I.late / I.total carry stroke="currentColor"; I.cube does not, and
    `.kpi .ic svg` sets stroke-width and fill but never stroke — so the Captures icon painted
    nothing at all. Scoped here so no other screen's icons change. */
.kpis-pj .kpi .ic svg { stroke: currentColor; }

.pjhead {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  padding-bottom: var(--sp-4);
}
.pjback {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 32px; padding: 0 12px 0 8px;
  border-radius: var(--r-pill); border: 1px solid var(--hairline);
  background: var(--card); color: var(--slate);
  font-size: var(--t-label); font-weight: 700; text-decoration: none;
}
.pjback:hover { background: var(--surface); color: var(--ink); }
/* The chevron points BACK. :dir() then flips it again for RTL, where back is the other way. */
.pjback svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.2;
  fill: none; stroke-linecap: round; stroke-linejoin: round; transform: scaleX(-1); }
:dir(rtl) .pjback svg { transform: none; }
.pjloc {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--t-label); font-weight: 600; color: var(--stone-text);
}
.pjloc svg { width: 13px; height: 13px; stroke: currentColor; stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* The project screen stacks the live stage over its capture list in the main column. */
.pjmain { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
/* Shorter than the Map's: this screen carries the list and the milestones below it, and a
   620px stage pushed the captures entirely under the fold. */
.pjmain .stage { height: min(48vh, 460px); min-height: 320px; }

/* a capture row that opens in this screen's own stage */
.vrow.opens { cursor: pointer; }
.vrow.opens:hover { background: var(--surface); }
.vrow.opens:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.vrow.sel { background: var(--surface); box-shadow: inset 2px 0 0 var(--brand-yellow); }
:dir(rtl) .vrow.sel { box-shadow: inset -2px 0 0 var(--brand-yellow); }
.pjin {
  display: inline-block; margin-top: 2px;
  font-size: var(--t-label); font-weight: 700; color: var(--ok);
}

/* leaving a capture, back out to the site it belongs to */
.stageback {
  display: inline-flex; align-items: center; gap: 5px;
  min-height: 30px; padding: 0 12px 0 8px; border-radius: var(--r-pill);
  background: oklch(1 0 0 / .92); border: 1px solid var(--hairline);
  color: var(--ink); font-size: var(--t-label); font-weight: 700;
}
.stageback:hover { border-color: var(--ink); }
.stageback svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2.2;
  fill: none; stroke-linecap: round; stroke-linejoin: round; transform: scaleX(-1); }
:dir(rtl) .stageback svg { transform: none; }

/* open issues on the capture itself, on its billboard */
.pin .pinbadge {
  position: absolute; inset-block-start: 3px; inset-inline-start: 3px;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: var(--r-pill);
  background: var(--late); color: var(--canvas);
  font-size: 11px; font-weight: 700; line-height: 17px; text-align: center;
  font-variant-numeric: tabular-nums;
}

.pjbar {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--hairline);
}
.pjbarmeta { min-width: 0; flex: 1; }
.pjms  { display: block; font-size: var(--t-body); font-weight: 600; }
.pjmsl { display: block; font-size: var(--t-label); color: var(--stone-text); }
.pjbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  flex: none; min-height: 36px; padding: 0 var(--sp-4);
  border-radius: var(--r-pill); background: var(--ink); color: var(--canvas);
  font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap;
}
.pjbtn svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 2;
  fill: none; stroke-linecap: round; stroke-linejoin: round; }
:dir(rtl) .pjbtn svg { transform: scaleX(-1); }
/* Not a button: there is nothing to open. A disabled control invites a click; a label does not. */
.pjbtn.off {
  background: var(--card); color: var(--stone-text);
  border: 1px solid var(--hairline); font-weight: 600;
}
.pjbtn.off svg { display: none; }

/* the end cell of a capture row: open-issue count, then the chevron if it opens */
.pjend { display: inline-flex; align-items: center; gap: var(--sp-2); }
.pjbadge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px;
  padding: 0 6px; border-radius: var(--r-pill);
  background: var(--tint-coral); color: var(--late);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.pjno {
  display: inline-block; margin-top: 2px;
  font-size: var(--t-label); font-weight: 600; color: var(--stone-text);
}

/* milestones: the same two numbers the portfolio popover shows, as a standing panel */
.pjbd { list-style: none; margin: 0; padding: 0 var(--sp-4) var(--sp-4); }
.pjbd li { padding: var(--sp-3) 0; border-top: 1px solid var(--hairline-soft); }
.pjbd li:first-child { border-top: 0; }
.pjbd .h {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--sp-3); margin-bottom: 6px;
}
.pjbd .nm { font-size: 13px; font-weight: 600; }
/* 🔴 A signed number needs BOTH isolate and an explicit base direction, or RTL renders -14% as
   14%- . unicode-bidi alone does not set the internal direction. */
.pjbd .var { font-size: var(--t-label); font-weight: 700;
  unicode-bidi: isolate; direction: ltr; }
.pjbd .b {
  display: grid; grid-template-columns: 54px 36px minmax(0, 1fr);
  gap: var(--sp-2); align-items: center; margin-top: 4px;
}
.pjbd .k { font-size: var(--t-label); color: var(--stone-text); }
.pjbd .b .num { font-size: var(--t-label); font-weight: 600; text-align: end; }
.pjnone {
  list-style: none; padding: var(--sp-3) var(--sp-4) var(--sp-4);
  font-size: var(--t-label); color: var(--stone-text);
}

/* The project screen's five figures are all load-bearing — Captures and Open issues most of
   all — so they WRAP below 1360px instead of taking app.css's `.kpi:nth-child(n+4){display:none}`,
   which exists for the portfolio's fifth cell and would hide exactly the two that matter here. */
@media (max-width: 1360px) {
  .kpis.kpis-pj { grid-template-columns: repeat(3, 1fr); }
  .kpis.kpis-pj .kpi:nth-child(n+4) { display: flex; }
}
@media (max-width: 1080px) {
  .kpis.kpis-pj { grid-template-columns: repeat(2, 1fr); }
  .pjbar { flex-wrap: wrap; }
  .pjmain .stage { height: min(42vh, 380px); }
}
@media print {
  .pjback, .pjbtn, .pjend .ch { display: none; }
  /* A WebGL canvas prints as a blank rectangle; the pins print as a pile in the corner. */
  .pjmain .stagewrap { display: none; }
}

/* ====================================================== capture card grid
 * The thin list left the right half of the panel empty and wasted the one thing a capture
 * actually has — its picture. Cards fill the width and the image is the card.
 * Namespaced `c*` inside `.capgrid` so the short names cannot reach anything else. */
.capgrid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: var(--sp-4); list-style: none; margin: 0;
  padding: var(--sp-2) var(--sp-5) var(--sp-5);
}
.capgrid > li { min-width: 0; }
.capcard {
  display: flex; flex-direction: column; height: 100%;
  border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden;
  background: var(--card); text-decoration: none; color: inherit;
}
.capcard.opens { cursor: pointer; }
.capcard:not(.flat):hover { border-color: var(--ink); }
.capcard:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.capcard.sel { border-color: var(--brand-yellow); box-shadow: 0 0 0 2px var(--brand-yellow); }

.capcard .cshot {
  position: relative; display: block; aspect-ratio: 16 / 10;
  background: var(--hairline-soft); overflow: hidden;
}
.capcard .cshot img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .45s cubic-bezier(.33,.9,.28,1);
}
.capcard:not(.flat):hover .cshot img { transform: scale(1.045); }
.capcard .cbadge {
  position: absolute; inset-block-start: 8px; inset-inline-start: 8px;
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--late); color: var(--canvas);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
}

.capcard .cbody {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3);
  padding: 11px 13px 13px; flex: 1;
}
.capcard .cmeta { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.capcard .cnm {
  display: block; font-size: 13px; font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.capcard .cdt { display: block; font-size: var(--t-label); color: var(--stone-text); }
.capcard .ctag {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--t-label); font-weight: 700; color: var(--ok); white-space: nowrap;
}
.capcard .ctag.off { color: var(--stone-text); font-weight: 600; }
.capcard .ctag svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.2;
  fill: none; stroke-linecap: round; stroke-linejoin: round; }
:dir(rtl) .capcard .ctag svg { transform: scaleX(-1); }

@media (prefers-reduced-motion: reduce) {
  .capcard .cshot img, .capcard:not(.flat):hover .cshot img { transition: none; transform: none; }
}
@media (max-width: 1080px) { .capgrid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
@media print { .capcard .ctag { display: none; } }

/* ================================================== actual vs plan, one cell
 * Three columns (62% / 71% / -9%) made the reader subtract what a tick shows at a glance, and
 * spent three column widths saying one thing. Bar = actual, tick = plan, number = the gap. */
.avp {
  display: grid; grid-template-columns: minmax(64px, 1fr) auto auto;
  gap: 10px; align-items: center; min-width: 170px;
}
.avp:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }
.avpbar { position: relative; display: block; }
/* 🔴 `.track` is a <span> and app.css never sets `display` on it — it only ever worked because
   `.pct` is a flex column, which blockifies its children. In a plain block wrapper it stays
   inline, height is ignored, and the bar vanishes leaving just the plan tick. */
.avp .track { display: block; width: 100%; }
.avp .track > i.ok   { background: var(--ok-fill); }
.avp .track > i.warn { background: var(--warn-fill); }
.avp .track > i.late { background: var(--late-fill); }
/* OUTSIDE the track, which is overflow:hidden — a plan at 100% would otherwise be clipped away
   and read as "no plan" instead of "plan is at the end". */
.plantick {
  position: absolute; inset-block-start: -4px; width: 2px; height: 14px;
  border-radius: 1px; background: var(--ink); transform: translateX(-50%);
}
.avp .v { font-size: 13px; font-weight: 700; }
/* 🔴 A signed number needs an explicit base direction as well as isolation, or RTL renders
   -9% as 9%- . "on plan" is a word and is left to the page direction. */
.avp .var { font-size: var(--t-label); font-weight: 700; min-width: 54px; text-align: end;
  unicode-bidi: isolate; direction: ltr; }
:dir(rtl) .avp .var { direction: rtl; }
.card .avp { margin-top: 6px; }

@media (max-width: 1360px) { .avp { min-width: 140px; grid-template-columns: minmax(44px, 1fr) auto auto; gap: 8px; } }

/* A multi-date capture offers BOTH: scrub its dates here, and open the published date on tier 3. */
.capcard .ctag.open3d {
  margin-inline-start: var(--sp-2);
  text-decoration: none;
  white-space: nowrap;
}
