/* Layouts unique to the coordinator workspace. */
.split-2 { display: grid; grid-template-columns: var(--cols, minmax(0, 1fr) 400px); gap: var(--s-5); align-items: start; }
.split-2 > * { min-width: 0; }
.stack-5 > * + * { margin-top: var(--s-5); }
.greet { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-5); }
.greet h1 { font-size: var(--t-40); }
.greet .date { color: var(--muted); margin-top: var(--s-1); }
.dl { display: grid; grid-template-columns: 92px minmax(0, 1fr) 200px auto; gap: var(--s-4); align-items: center; padding: var(--s-3) var(--pad-card); border-bottom: var(--rule); text-decoration: none; color: inherit; }
.dl:last-child { border-bottom: 0; }
.dl:hover { background: var(--npb-soft); }
.dl .due { font: 700 var(--t-22)/1 var(--font-display); }
.dl .due small { display: block; font: 450 var(--t-11)/1.4 var(--font-mono); color: var(--muted); letter-spacing: var(--tracking-label); text-transform: uppercase; }
.dl .due.soon { color: var(--danger-ink); }
.needs .lrow { grid-template-columns: auto minmax(0, 1fr) auto; }

/* Run overview: the flagship sheet */
.runsheet { --vh: clamp(440px, calc(100vh - 250px), 680px); display: grid; grid-template-columns: minmax(0, 1fr) 420px; border: var(--rule-strong); background: var(--surface); }
.runsheet > * { min-width: 0; }
.runsheet .drawing { position: relative; border-right: var(--rule-strong); }
.runsheet .drawing .viewer { border: 0; height: var(--vh); }
.runsheet .title { position: absolute; left: calc(18px + var(--s-4)); top: calc(18px + var(--s-4)); z-index: 3; pointer-events: none; max-width: 70%; }
.runsheet .title h1 { font-size: var(--t-32); }
.runsheet .title p { color: var(--muted); margin-top: 4px; }
.runsheet .drawing .vtools { top: auto; bottom: var(--s-3); left: auto; right: var(--s-3); }
.sched { display: flex; flex-direction: column; min-height: 0; height: calc(var(--vh) + 18px); }
.sched .sheet-h { flex: none; }
.sched-list { flex: 1; overflow-y: auto; min-height: 0; }
.sched .cartiglio > div { padding: 5px var(--s-3); }
.sched .cartiglio .v { font-size: var(--t-13); }
.sched .cartiglio .verdict { font-size: var(--t-22); }
.srow { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: var(--s-3); align-items: start; padding: 10px var(--s-4); border-bottom: var(--rule); cursor: pointer; }
.srow:hover { background: var(--npb-soft); }
.srow.is-sel { background: var(--npb-soft); box-shadow: inset 0 0 0 1px var(--npb-ink); }
.srow .t { font-weight: 600; line-height: 1.3; }
.srow .m { font-size: var(--t-12); color: var(--muted); margin-top: 2px; }
.sched .cartiglio { flex: none; }
.legend-row { display: flex; gap: var(--s-3); flex-wrap: wrap; padding: var(--s-2) var(--s-4); border-bottom: var(--rule); }

/* Ledger of summary figures (no hero metrics) */
.ledger { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: var(--rule); border-left: var(--rule); }
.ledger > div { padding: var(--s-3) var(--s-4); border-right: var(--rule); border-bottom: var(--rule); }
.ledger b { display: block; font: 700 var(--t-28)/1.1 var(--font-display); margin-top: 2px; }
.ledger .label { display: block; }
.ledger .muted { font-size: var(--t-12); }

/* Census bars */
.census { display: grid; gap: 6px; }
.census div { display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr) 70px; gap: var(--s-3); align-items: center; font-size: var(--t-13); }
.census i { display: block; height: 8px; background: var(--npb); }
.census .code { color: var(--ink); }

/* Upload */
.ingest { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-5); align-items: start; }
.ingest > * { min-width: 0; }
.progress { height: 6px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--ink); transition: width var(--dur-2) linear; }

/* Inspector */
.plate { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-4); align-items: center; padding: var(--s-4) var(--pad-card); }
.plate .glyph { width: 52px; height: 52px; border: var(--rule-strong); display: grid; place-items: center; }
.plate h1 { font-size: var(--t-28); }
@media (max-width: 640px) { .plate { grid-template-columns: auto minmax(0, 1fr); } .plate > .cluster { grid-column: 1 / -1; flex-wrap: nowrap; } .plate h1 { font-size: var(--t-22); } .plate .gid { overflow-wrap: anywhere; } }
.insp { display: grid; grid-template-columns: 420px minmax(0, 1fr); gap: var(--s-5); align-items: start; }
.insp > * { min-width: 0; }
.insp .viewer { height: 380px; }
.thread .msg { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s-3); padding: var(--s-3) 0; border-bottom: var(--rule); }
.thread .msg p { margin-top: 2px; }
.hist li { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: var(--s-3); padding: 6px 0; border-bottom: var(--rule); font-size: var(--t-13); }

@media (max-width: 1100px) {
  .split-2, .runsheet, .ingest, .insp { grid-template-columns: 1fr; }
  .runsheet .drawing { border-right: 0; border-bottom: var(--rule-strong); }
  .sched { height: auto; }
  .sched-list { max-height: 420px; }
}
@media (max-width: 640px) {
  .banner { flex-wrap: wrap; }
  .banner .btn { margin-left: auto; }
  .greet h1 { font-size: var(--t-28); }
  .dl { grid-template-columns: 72px minmax(0, 1fr); }
  .dl > :nth-child(3), .dl > :nth-child(4) { grid-column: 2; }
  .runsheet .title { position: static; padding: var(--s-4); max-width: none; pointer-events: auto; }
  .runsheet { --vh: clamp(360px, 56vh, 460px); }
  .runsheet .drawing .vtools { top: calc(18px + var(--s-2)); bottom: auto; left: calc(18px + var(--s-2)); right: auto; }
  .census div { grid-template-columns: 1fr 60px; }
  .census div i { display: none; }
  .hist li { grid-template-columns: 1fr; gap: 0; }
}
aside .spec { grid-template-columns: auto minmax(0, 1fr); gap: var(--s-2) var(--s-3); }
aside .spec .ratio, aside .spec > .pill { grid-column: 2; justify-self: start; }
.attr-missing { color: var(--danger-ink); font-weight: 600; }
.req-flag { display: inline-flex; gap: 4px; align-items: center; font-size: var(--t-12); color: var(--danger-ink); }

/* Full 3D viewer */
.m3d { display: grid; grid-template-columns: 272px minmax(0, 1fr) 300px; gap: var(--s-4); height: calc(100vh - var(--topbar-h) - 44px - var(--pocbar-h) - var(--s-4) * 2); min-height: 560px; }
.m3d > * { min-width: 0; min-height: 0; }
.m3d-side, .m3d-info { display: flex; flex-direction: column; }
.m3d-scroll { flex: 1; overflow-y: auto; min-height: 0; }
.m3d-g { display: grid; gap: var(--s-2); padding: var(--s-3) var(--s-4); border-bottom: var(--rule); }
.m3d-g .flabel { font-size: var(--t-12); font-weight: 600; color: var(--ink-2); display: flex; justify-content: space-between; }
.m3d-row { display: grid !important; grid-template-columns: 16px minmax(0, 1fr) auto; min-height: 26px; font-size: var(--t-13); }
.m3d-leg { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--t-12); }
.m3d-leg i { display: inline-block; width: 12px; height: 12px; margin-right: 5px; vertical-align: -2px; border: 1px solid var(--ink); }
.m3d-canvas { position: relative; }
.m3d-canvas .viewer { position: absolute; left: 18px; top: 18px; right: 0; bottom: 0; min-height: 0; }
@media (max-width: 1100px) { .m3d { grid-template-columns: 1fr; height: auto; } .m3d-canvas { height: 70vh; } .m3d-side .m3d-scroll, .m3d-info .m3d-scroll { max-height: 360px; } .m3d-side { order: 2; } .m3d-info { order: 3; } }

/* Section drawing */
#section .cut { fill: url(#poche); stroke: var(--ink); stroke-width: 1; cursor: pointer; }
#section .cut.bad { stroke: var(--danger); fill: var(--danger-soft); }
#section .band { cursor: pointer; }
#section .band:hover { fill: var(--npb-soft); }
#section .sp { font: 500 12px var(--font-body); fill: var(--muted); cursor: pointer; }
#section .lab { font: 600 11px var(--font-body); fill: var(--ink-2); }
#section .col { fill: var(--c-1); stroke: var(--npb-ink); stroke-width: 1.5; }
#section .px { fill: var(--warning-soft); stroke: var(--warning); stroke-width: 1.5; stroke-dasharray: 5 3; }
#section .hit { fill: transparent; stroke: none; }
#section .xr { cursor: pointer; }
#section .xr.on .hit { fill: var(--npb-soft); fill-opacity: 0.6; stroke: var(--npb-ink); stroke-dasharray: 3 3; }
#section .xr:hover .hit { fill: var(--npb-soft); fill-opacity: 0.4; }
.tree details > summary { list-style: none; }
.tree details > summary::-webkit-details-marker { display: none; }
.tree details > summary::before { content: ''; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 1.4px 1.4px 0; transform: rotate(-45deg); margin-right: 4px; transition: transform var(--dur-2) var(--ease); flex: none; }
.tree details[open] > summary::before { transform: rotate(45deg); }

/* Robustness replay */
.lanes { display: grid; grid-template-columns: 1fr 1fr; }
.lane { padding: var(--s-4) var(--pad-card); min-width: 0; }
.lane + .lane { border-left: var(--rule-strong); }
.lane-h { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-3); }
.cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(16px, 1fr)); gap: 3px; }
.cells i { aspect-ratio: 1; border: 1px solid var(--line); background: var(--surface); transition: background var(--dur-1) var(--ease); }
.cells i.ok { background: var(--ink); border-color: var(--ink); }
.cells i.bad { background: var(--danger); border-color: var(--danger); }
.cells i.iso { background: var(--warning-soft); border: 1px dashed var(--warning); }
.cells i.never { background: var(--surface-2); border-style: dashed; border-color: var(--muted-2); }
.lane-f { margin-top: var(--s-3); font-size: var(--t-13); min-height: 2.8em; }
.lane-f.bad { color: var(--danger-ink); }
@media (max-width: 760px) { .lanes { grid-template-columns: 1fr; } .lane + .lane { border-left: 0; border-top: var(--rule-strong); } }
