/* ============================================================
   Agent Ibex — data room surface (dataroom.html)
   Extends design-system.css. Owns: NDA gate, header strip,
   folder tree, doc table, activity/Q&A rail. Chunky + dense.
   ============================================================ */

/* ---------- page frame ---------- */
body.gated { overflow: hidden; }

.room { transition: filter 0.5s steps(10); }
.room.locked {
  filter: blur(16px) saturate(0.7) brightness(0.94);
  transform: scale(1.012);
  pointer-events: none;
  user-select: none;
  max-height: 100vh;
  overflow: hidden;
}

.dr-wrap { max-width: 1560px; margin: 0 auto; padding: 0 24px; }

/* ---------- NDA gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background:
    linear-gradient(rgba(47, 39, 29, 0.32), rgba(47, 39, 29, 0.55));
  padding: 24px;
  transition: opacity 0.4s steps(8);
}
.gate.lifting { opacity: 0; pointer-events: none; }
.gate.lifting .gate-card { animation: gateup 0.45s steps(7) forwards; }
@keyframes gateup {
  to { transform: translateY(-46px) scale(0.97); }
}
.gate-card {
  width: 560px; max-width: 94vw;
  background: var(--paper);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: 10px 10px 0 rgba(47, 39, 29, 0.92);
  overflow: hidden;
  animation: gatein 0.5s steps(8) backwards;
}
@keyframes gatein {
  from { transform: translateY(26px) scale(0.98); opacity: 0; }
}
.gate-scene {
  height: 132px; overflow: hidden; position: relative;
  border-bottom: var(--border);
}
.gate-scene .art-ph { position: absolute; inset: 0; }
.gate-scene .gate-scan {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(47,39,29,0.05) 0 2px, transparent 2px 6px);
}
.gate-body { padding: 20px 26px 22px; }
.gate-title-row { display: flex; align-items: center; gap: 14px; margin: 8px 0 6px; }
.gate-title-row h2 { font-size: clamp(1.15rem, 2vw, 1.5rem); margin: 0; }

.optins { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 12px; }
.optins .chip { font-size: 0.66rem; }
.optins .chip-pending { background: var(--cream-2); border-style: dashed; }

.nda-terms { font-family: var(--font-mono); font-size: 0.74rem; line-height: 1.5; }
.nda-terms b { color: var(--terracotta); }
.nda-terms ul { margin: 6px 0 0; padding-left: 18px; }
.nda-terms li { margin-bottom: 3px; }

.gate-form { display: flex; gap: 10px; margin-top: 14px; }
.input {
  font-family: var(--font-mono); font-size: 0.82rem; font-weight: 700;
  color: var(--ink); background: var(--paper);
  border: var(--border); border-radius: var(--radius-sm);
  padding: 12px 14px; outline: none;
  box-shadow: inset 3px 3px 0 rgba(47, 39, 29, 0.12);
  flex: 1; min-width: 0;
}
.input::placeholder { color: var(--ink-faint); font-weight: 400; }
.input:focus { background: #fff; box-shadow: inset 3px 3px 0 rgba(47,39,29,0.12), 0 0 0 3px var(--water-light); }
.input.err { animation: shake 0.3s steps(4); border-color: var(--terracotta); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.gate-foot {
  margin-top: 14px; padding-top: 12px;
  border-top: 2px dashed var(--stone);
  font-family: var(--font-mono); font-size: 0.64rem; font-weight: 700;
  letter-spacing: 0.1em; color: var(--ink-faint);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}

/* ---------- header strip ---------- */
.dr-head {
  background: var(--paper);
  border-bottom: var(--border);
  padding: 20px 0 18px;
}
.dr-head-row { display: flex; gap: 28px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.dr-name { font-size: clamp(1.6rem, 3vw, 2.4rem); margin: 6px 0 4px; }
.dr-meta { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.09em; color: var(--ink-soft); }
.dr-chips { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.presence { display: inline-flex; align-items: center; }
.presence .av { margin-left: -7px; }
.presence .av:first-child { margin-left: 0; }

.dr-side { display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap; }
.meter-wrap { min-width: 210px; }
.meter {
  height: 18px; border: var(--border-thin); border-radius: var(--radius-sm);
  background: var(--cream-2); overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.meter i {
  display: block; height: 100%; width: 0;
  background: repeating-linear-gradient(45deg,
    var(--grass) 0 8px, var(--grass-light) 8px 16px);
  transition: width 1.1s steps(26);
}
.meter-lbl {
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.1em; color: var(--ink-soft); margin-top: 6px;
}
.meter-lbl b { color: var(--ink); }

/* ---------- room grid ---------- */
.dr-grid {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) 330px;
  gap: 20px;
  padding-top: 22px;
  padding-bottom: 30px;
  align-items: start;
}
.dr-col-label {
  font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700;
  letter-spacing: 0.14em; color: var(--ink-soft);
  text-transform: uppercase;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2px 10px;
}
.dr-col-label .tag { letter-spacing: 0.04em; }

/* ---------- folder tree ---------- */
.folders { padding: 8px; position: sticky; top: 84px; }
.fold-all, .fold-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  cursor: pointer; border: 2px solid transparent;
  user-select: none;
}
.fold-all:hover, .fold-head:hover { background: var(--cream-2); }
.fold-all.sel, .fold-head.sel { background: var(--sun); border-color: var(--ink); }
.fold-head .fname { font-weight: 700; font-size: 0.86rem; flex: 1; }
.fold-all .fname { font-weight: 700; font-size: 0.86rem; flex: 1; }
.fold-meta { font-family: var(--font-mono); font-size: 0.62rem; color: var(--ink-soft); display: block; }
.fold-head .chev {
  font-family: var(--font-mono); font-weight: 700; font-size: 0.8rem;
  transition: transform 0.12s steps(2);
}
.fold.open .fold-head .chev { transform: rotate(90deg); }
.fold-files { display: none; padding: 2px 4px 8px 46px; }
.fold.open .fold-files { display: block; }
.ffile {
  font-family: var(--font-mono); font-size: 0.68rem;
  padding: 3px 6px; border-radius: 4px; cursor: pointer;
  display: flex; align-items: center; gap: 7px;
  color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ffile:hover { background: var(--cream-2); color: var(--ink); }
.ffile .fdot { width: 8px; height: 8px; flex: 0 0 8px; border: 1px solid var(--ink); }
.fdot.v { background: var(--grass); } .fdot.p { background: var(--sun); }
.fdot.r { background: var(--paper); border-style: dashed; }
.folders .vicon.folder-ph {
  width: 38px; height: 30px; flex: 0 0 auto;
  border: var(--border-thin); border-radius: 4px; box-shadow: var(--shadow-xs);
}

/* ---------- doc table ---------- */
.docs { padding: 0; overflow: hidden; }
.docs-toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: var(--border-thin);
  background: var(--cream-2);
}
.docs-toolbar .input { flex: 1 1 220px; padding: 9px 12px; font-size: 0.76rem; }
.fchip {
  font-family: var(--font-mono); font-size: 0.64rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
  border: var(--border-thin); border-radius: 999px; background: var(--paper);
  padding: 5px 11px; cursor: pointer; color: var(--ink-soft);
}
.fchip:hover { color: var(--ink); }
.fchip.sel { background: var(--ink); color: var(--cream); }
.doc-count { font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-soft); font-weight: 700; margin-left: auto; }

.drow, .dhead {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 82px 104px 112px;
  gap: 12px; align-items: center;
  padding: 10px 16px;
}
.dhead {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint);
  border-bottom: var(--border-thin); padding-top: 8px; padding-bottom: 8px;
}
.drow { border-bottom: 1px solid var(--cream-2); cursor: pointer; }
.drow:last-child { border-bottom: none; }
.drow:hover { background: var(--cream-2); }
.drow.flash { animation: rowflash 1.4s steps(6); }
@keyframes rowflash { 0%, 40% { background: var(--sun); } 100% { background: transparent; } }
.dname { font-weight: 700; font-size: 0.84rem; overflow-wrap: anywhere; }
.dfolder { font-family: var(--font-mono); font-size: 0.62rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.dsize, .ddate { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-soft); }
.ficon { width: 36px; height: 36px; image-rendering: pixelated; }

.dnote {
  margin-top: 5px; padding: 6px 9px 6px 10px;
  border-left: 3px solid var(--terracotta);
  background: var(--cream-2); border-radius: 0 6px 6px 0;
  font-size: 0.74rem; color: var(--ink-soft); line-height: 1.4;
}
.dnote .tag { margin-right: 6px; background: var(--terracotta); }
.dnote b { color: var(--ink); }

.st { justify-self: start; }
.st-req { background: var(--paper); border-style: dashed; color: var(--ink-soft); }
.st-pen { background: var(--sun); }
.st-ver { background: var(--grass-light); }

.dempty { padding: 34px 20px; text-align: center; font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint); }
.drow.sel { background: var(--sun); box-shadow: inset 0 0 0 2px var(--ink); }

/* ---------- doc preview side sheet ---------- */
body.pv-open { overflow: hidden; }
/* while the sheet is open the room index stays lit + clickable above the
   scrim — buyers can click straight down the list to swap docs (VDR-style).
   Only the two index columns raise; header/rail/ticker stay under the scrim
   so clicking them still closes the sheet. */
body.pv-open .dr-grid > div { position: relative; z-index: 245; }
body.pv-open #docRows { max-height: 62vh; overflow-y: auto; }
.pv-scrim {
  position: fixed; inset: 0; z-index: 240;
  background:
    repeating-linear-gradient(45deg, rgba(47,39,29,0.07) 0 3px, transparent 3px 9px),
    rgba(47, 39, 29, 0.32);
  animation: pvfade 0.3s steps(4);
  cursor: pointer;
}
@keyframes pvfade { from { opacity: 0; } }
.pv-sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 250;
  width: min(720px, 95vw);
  display: flex; flex-direction: column;
  background: var(--cream);
  background-image:
    linear-gradient(rgba(47, 39, 29, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 39, 29, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  border-left: var(--border);
  box-shadow: -10px 0 0 rgba(47, 39, 29, 0.9);
  animation: pvin 0.4s steps(7);
}
@keyframes pvin { from { transform: translateX(80px); opacity: 0; } }
.pv-head {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; border-bottom: var(--border); background: var(--paper);
}
.pv-head .ficon { width: 34px; height: 34px; flex: 0 0 auto; }
.pv-id { flex: 1; min-width: 0; }
.pv-name { font-weight: 700; font-size: 0.95rem; line-height: 1.25; overflow-wrap: anywhere; }
.pv-sub {
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 3px;
}
.pv-x {
  flex: 0 0 auto; width: 34px; height: 34px;
  border: var(--border-thin); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink);
  font-family: var(--font-mono); font-weight: 700; font-size: 0.82rem;
  cursor: pointer; box-shadow: var(--shadow-xs);
}
.pv-x:hover { background: var(--terracotta); color: var(--cream); }
.pv-x:active { transform: translate(2px, 2px); box-shadow: none; }

.pv-body {
  flex: 1; overflow-y: auto; padding: 24px 22px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
/* single stack child: auto top/bottom margins vertically center short docs
   (no empty lower third) while overflow still scrolls normally on long ones */
.pv-stack {
  width: 100%; margin: auto 0;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
/* quick swap transition when a click retargets the open sheet */
.pv-sheet.pv-swapping .pv-page,
.pv-sheet.pv-swapping .pv-note,
.pv-sheet.pv-swapping .pv-meta,
.pv-sheet.pv-swapping .pv-disclaimer { animation: pvswap 0.26s steps(4); }
@keyframes pvswap { from { transform: translateX(30px); opacity: 0; } }
/* page-turn transitions — direction-flavored like flipping the folio */
.pv-sheet.pv-turn-next .pv-page { animation: pvturnN 0.22s steps(3); }
.pv-sheet.pv-turn-prev .pv-page { animation: pvturnP 0.22s steps(3); }
@keyframes pvturnN { from { transform: translateX(26px) rotate(0.6deg); opacity: 0; } }
@keyframes pvturnP { from { transform: translateX(-26px) rotate(-0.6deg); opacity: 0; } }
.pv-page {
  position: relative; width: 100%; max-width: 620px;
  background-color: #fffdf5;
  background-image: repeating-linear-gradient(0deg, rgba(47,39,29,0.028) 0 2px, transparent 2px 7px);
  border: var(--border); border-radius: 6px;
  box-shadow: 8px 8px 0 rgba(47, 39, 29, 0.88);
  overflow: hidden;
}
.pv-doc { position: relative; z-index: 1; padding: 20px 26px 14px; }
.pv-wm {
  position: absolute; inset: -60% -25%; z-index: 2;
  transform: rotate(-22deg);
  display: flex; flex-direction: column; justify-content: space-around;
  pointer-events: none; overflow: hidden;
}
.pv-wm span {
  display: block; white-space: nowrap; text-align: center;
  font-family: var(--font-mono); font-weight: 700; font-size: 0.82rem;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(196, 86, 58, 0.16);
}
.pv-pagefoot {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 0 18px; padding: 8px 6px 12px;
  border-top: 2px dashed var(--stone);
  font-family: var(--font-mono); font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.1em; color: var(--ink-faint); text-transform: uppercase;
}
.pv-note {
  align-self: stretch; max-width: 620px;
  padding: 8px 12px; border-left: 3px solid var(--terracotta);
  background: var(--cream-2); border-radius: 0 6px 6px 0;
  font-size: 0.74rem; color: var(--ink-soft); line-height: 1.4;
}
.pv-note .tag { margin-right: 6px; background: var(--terracotta); }
.pv-note b { color: var(--ink); }
.pv-disclaimer {
  font-family: var(--font-mono); font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.12em; color: var(--ink-faint); text-transform: uppercase;
}

/* doc details + sibling quick-nav panel under the page card */
.pv-meta {
  width: 100%; max-width: 620px;
  border: var(--border-thin); border-radius: var(--radius-sm);
  background: var(--paper); box-shadow: var(--shadow-xs);
  padding: 10px 14px 12px;
}
.pv-meta-h {
  font-family: var(--font-mono); font-size: 0.56rem; font-weight: 700;
  letter-spacing: 0.14em; color: var(--ink-faint); text-transform: uppercase;
  margin-bottom: 7px;
}
.pv-meta-g {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px 14px;
  padding-bottom: 10px; margin-bottom: 10px;
  border-bottom: 1px dashed var(--stone);
}
.pv-meta-g:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.pv-meta-k {
  display: block; font-family: var(--font-mono); font-size: 0.52rem;
  letter-spacing: 0.1em; color: var(--ink-faint);
}
.pv-meta-v {
  display: block; font-family: var(--font-mono); font-size: 0.68rem; font-weight: 700;
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-sibs { display: flex; flex-direction: column; gap: 4px; }
.pv-sib {
  display: flex; align-items: center; gap: 8px;
  border: var(--border-thin); border-radius: 4px; background: var(--cream-2);
  padding: 4px 8px; cursor: pointer; text-align: left;
  font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-soft);
}
.pv-sib:hover { background: var(--sun); color: var(--ink); border-color: var(--ink); }
.pv-sib .ficon { width: 18px; height: 18px; flex: 0 0 auto; }
.pv-sib span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 18px; border-top: var(--border); background: var(--paper);
}
.pv-hint {
  flex: 1; font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.08em; color: var(--ink-faint);
}
.pv-foot .btn { white-space: nowrap; }

/* folio pager — chunky prev/next around the PAGE n OF N label */
.pv-pager {
  display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
  padding-right: 10px; border-right: 2px dashed var(--stone);
}
.pv-pg-btn {
  width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center;
  border: var(--border-thin); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--ink);
  font-family: var(--font-mono); font-weight: 700; font-size: 0.95rem;
  cursor: pointer; box-shadow: var(--shadow-xs);
}
.pv-pg-btn:hover:not(:disabled) { background: var(--sun); }
.pv-pg-btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: none; }
.pv-pg-btn:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.pv-pg-lbl {
  font-family: var(--font-mono); font-size: 0.62rem; font-weight: 700;
  letter-spacing: 0.1em; color: var(--ink); white-space: nowrap;
}

/* ---------- rendered "page" typography ---------- */
.pg-lh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.pg-biz { font-family: var(--font-display); font-size: 0.8rem; letter-spacing: 0.02em; }
.pg-addr { font-family: var(--font-mono); font-size: 0.54rem; color: var(--ink-faint); margin-top: 2px; }
.pg-lh-r {
  font-family: var(--font-mono); font-size: 0.54rem; font-weight: 700;
  color: var(--ink-faint); text-align: right; line-height: 1.6; white-space: nowrap;
}
.pg-title { font-family: var(--font-display); font-size: 0.9rem; margin: 8px 0 0; word-break: break-word; }
.pg-rule { border-top: 3px solid var(--ink); border-bottom: 1px solid var(--stone); height: 2px; margin: 8px 0 10px; }
.pg-sub {
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.15em; color: var(--terracotta); margin-bottom: 8px; text-transform: uppercase;
}
.pg-t { font-family: var(--font-mono); font-size: 0.66rem; margin-top: 2px; }
.pg-r {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 2.5px 0; border-bottom: 1px solid rgba(47, 39, 29, 0.07);
}
.pg-r .lbl { color: var(--ink-soft); }
.pg-r.sub .lbl { padding-left: 14px; }
.pg-r .num { font-weight: 700; white-space: nowrap; text-align: right; }
.pg-r .num.neg { color: var(--terracotta); }
.pg-r.cols {
  font-size: 0.55rem; font-weight: 700; letter-spacing: 0.14em; color: var(--ink-faint);
  border-bottom: 2px solid var(--ink); margin-top: 10px; padding-bottom: 4px;
  text-transform: uppercase;
}
.pg-r.tot {
  font-weight: 700; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink);
  margin-top: 2px; padding: 4px 0;
}
.pg-r.tot .lbl { color: var(--ink); }
.pg-r.grand {
  font-weight: 700; background: var(--sun);
  border: 2px solid var(--ink); border-radius: 4px;
  padding: 5px 8px; margin-top: 6px;
}
.pg-r.grand .lbl { color: var(--ink); padding-left: 0; }
.pg-r.hot { background: var(--terracotta-light); }
.pg-r.hot .lbl, .pg-r.hot .num { color: var(--ink); }
.pg-r.dim .lbl, .pg-r.dim .num { color: var(--ink-faint); }
/* fixed multi-column grids for ledger-style rows */
.pg-r.g2, .pg-r.g3, .pg-r.g4, .pg-r.g4a, .pg-r.g4c, .pg-r.g4d, .pg-r.g4e, .pg-r.g5, .pg-r.g5e, .pg-r.g5m, .pg-r.g6q, .pg-r.g3z, .pg-r.gsop, .pg-r.gsop2, .pg-r.gbk {
  display: grid; align-items: baseline;
}
.pg-r.g2 { grid-template-columns: 1fr auto; }
.pg-r.g3 { grid-template-columns: 1fr auto 64px; }
.pg-r.g3z { grid-template-columns: 1fr auto 76px; }
.pg-r.gbk { grid-template-columns: 1fr auto auto; }
.pg-r.g4 { grid-template-columns: 1.1fr 1.3fr 66px 56px; }
.pg-r.g4a { grid-template-columns: 22px 1fr auto 64px; }
.pg-r.g4c { grid-template-columns: 64px 1fr auto auto; }
.pg-r.g4d { grid-template-columns: 1.6fr 46px 96px auto; }
.pg-r.g4e { grid-template-columns: 1.7fr auto auto auto; }
.pg-r.g5 { grid-template-columns: 64px 84px 1fr 1fr 1fr; }
.pg-r.g5e { grid-template-columns: 1fr 40px auto auto auto; }
.pg-r.g5m { grid-template-columns: 64px 1fr 1fr 1fr 60px; }
.pg-r.g6q { grid-template-columns: 1.5fr repeat(5, auto); font-size: 0.6rem; }
.pg-r.gsop { grid-template-columns: 52px 1fr; }
.pg-r.gsop2 { grid-template-columns: 28px 1fr 1fr; }
.pg-r.g4 .num:nth-child(2), .pg-r.g4a .num:nth-child(2) {
  white-space: normal; text-align: left; font-weight: 400; color: var(--ink-soft);
}
.pg-r.gsop .num { white-space: normal; font-weight: 400; color: var(--ink-soft); text-align: left; }
.pg-r.gsop .lbl { font-weight: 700; color: var(--ink); }
.pg-r.gsop2 .num { white-space: normal; font-weight: 400; color: var(--ink-soft); text-align: left; }
.pg-r.gsop2 .lbl { font-weight: 700; color: var(--ink); }
.pg-r .num.pos { color: var(--leaf); }
.pg-r .num.ok { color: var(--leaf); }
.pg-r .num.warn { color: var(--terracotta); }
.pg-p {
  font-family: var(--font-mono); font-size: 0.62rem; line-height: 1.62;
  color: var(--ink-soft); margin: 0 0 9px; text-align: justify;
}
.pg-p b { color: var(--ink); }
.pg-sum {
  display: flex; flex-wrap: wrap; gap: 5px 18px;
  font-family: var(--font-mono); font-size: 0.58rem; font-weight: 700;
  padding: 7px 10px; background: var(--cream-2);
  border: 2px solid var(--ink); border-radius: 4px; margin-bottom: 10px;
}
.pg-sum b { color: var(--ink); }
.pg-sum span { color: var(--ink-faint); letter-spacing: 0.06em; }
.pg-fn {
  font-family: var(--font-mono); font-size: 0.56rem; color: var(--ink-faint);
  margin-top: 10px; line-height: 1.55;
}
.pg-stamp {
  display: inline-block; border: 3px solid var(--terracotta); border-radius: 4px;
  color: var(--terracotta); font-family: var(--font-mono); font-weight: 700;
  letter-spacing: 0.18em; font-size: 0.72rem; padding: 5px 14px;
  transform: rotate(-3deg); margin: 4px 0 12px;
}
.pg-sig {
  margin-top: 14px; border-top: 1px dashed var(--stone); padding-top: 9px;
  font-family: var(--font-mono); font-size: 0.58rem; color: var(--ink-soft);
  display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.sig-line { font-style: italic; font-size: 0.8rem; color: var(--ink); }

/* cleared-check image pages (bank bundle) + SOP photo plates */
.pg-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 2px; }
.pg-check {
  border: 2px solid var(--ink); border-radius: 5px; background: #fff;
  padding: 6px 9px 7px; font-family: var(--font-mono); font-size: 0.56rem;
  box-shadow: 3px 3px 0 rgba(47, 39, 29, 0.18);
}
.pg-check-h {
  display: flex; justify-content: space-between; gap: 8px;
  font-weight: 700; font-size: 0.6rem;
  border-bottom: 1px dashed var(--stone); padding-bottom: 3px; margin-bottom: 4px;
}
.pg-check-h span { color: var(--ink-faint); font-weight: 400; }
.pg-check-p { color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pg-check-a { font-weight: 700; font-size: 0.74rem; margin: 3px 0; }
.pg-check-m { color: var(--ink-faint); font-size: 0.5rem; letter-spacing: 0.04em; }
.pg-plate { border: 2px solid var(--ink); border-radius: 5px; background: var(--cream-2); padding: 6px; box-shadow: 3px 3px 0 rgba(47, 39, 29, 0.18); }
.pg-plate-box {
  height: 64px; display: grid; place-items: center;
  border: 1px dashed var(--stone); border-radius: 3px; background: #fff;
  font-family: var(--font-mono); font-size: 0.6rem; font-weight: 700;
  letter-spacing: 0.12em; color: var(--ink-faint); margin-bottom: 5px;
}

/* org chart (rendered "png" doc) */
.org-t { display: flex; flex-direction: column; align-items: center; padding: 8px 0 6px; }
.org-node {
  border: var(--border-thin); background: var(--paper); border-radius: 6px;
  box-shadow: var(--shadow-xs); padding: 6px 12px; text-align: center;
  font-family: var(--font-mono); min-width: 96px;
}
.org-node b { font-size: 0.62rem; display: block; }
.org-node span { font-size: 0.5rem; color: var(--ink-faint); letter-spacing: 0.06em; }
.org-top { background: var(--sun); }
.org-mid { background: var(--water-light); }
.org-link { width: 3px; height: 14px; background: var(--ink); }
.org-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.org-leaf { min-width: 84px; }

/* requested/pending doc state */
.pv-empty {
  border: 2px dashed var(--ink); border-radius: var(--radius-sm);
  padding: 26px 20px; text-align: center; background: var(--cream-2);
  font-family: var(--font-mono);
}
.pv-empty-t { font-weight: 700; font-size: 0.78rem; margin: 4px 0 8px; overflow-wrap: anywhere; }
.pv-empty-s { font-size: 0.62rem; color: var(--ink-soft); line-height: 1.55; max-width: 400px; margin: 0 auto; }

/* ---------- right rail ---------- */
.rail { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 84px; }
.rail .card { padding: 16px; }
.rail h3 { font-size: 0.85rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.rail h3 .tag { font-size: 0.6rem; white-space: nowrap; }

.act { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--stone-light); }
.act:last-child { border-bottom: none; }
.av {
  width: 24px; height: 24px; flex: 0 0 24px;
  border: 2px solid var(--ink); border-radius: 4px;
  display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 0.56rem; font-weight: 700;
  color: var(--ink);
}
.av-sun { background: var(--sun); } .av-water { background: var(--water-light); }
.av-leaf { background: var(--grass-light); } .av-terra { background: var(--terracotta-light); }
.av-stone { background: var(--stone-light); } .av-ibex { background: var(--ink); color: var(--cream); }
.act-txt { font-size: 0.76rem; line-height: 1.4; }
.act-txt b { font-weight: 700; }
.act-time { font-family: var(--font-mono); font-size: 0.6rem; color: var(--ink-faint); display: block; margin-top: 2px; }

.qa-q, .qa-a { padding: 9px 11px; border-radius: var(--radius-sm); font-size: 0.76rem; line-height: 1.45; }
.qa-q {
  background: var(--cream-2); border: var(--border-thin);
  margin-bottom: 6px;
}
.qa-q .who, .qa-a .who {
  font-family: var(--font-mono); font-size: 0.58rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; display: block; margin-bottom: 4px;
}
.qa-q .who { color: var(--ink-faint); }
.qa-a {
  background: var(--ink); color: var(--cream);
  margin: 0 0 14px 18px; position: relative;
}
.qa-a .who { color: var(--sun); }
.qa-a::before {
  content: ""; position: absolute; left: -12px; top: 10px;
  width: 8px; height: 8px; background: var(--sun); border: 2px solid var(--ink);
}
.qa-note { font-family: var(--font-mono); font-size: 0.62rem; color: var(--ink-faint); margin-top: -6px; margin-bottom: 12px; }

.rail-actions { display: flex; flex-direction: column; gap: 10px; }
.rail-actions .row { gap: 10px; }
.rail-actions .btn { flex: 1; justify-content: center; }
.req-form { display: none; gap: 8px; }
.req-form.open { display: flex; }
.req-form .input { padding: 9px 11px; font-size: 0.72rem; }
.rail-actions .qa-note { margin: 0; }

/* ---------- ticker + toast ---------- */
.dr-ticker { margin-top: 0; }
.toast {
  position: fixed; left: 22px; bottom: 22px; z-index: 400;
  background: var(--ink); color: var(--cream);
  border: var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 700;
  padding: 12px 16px; max-width: 380px;
  animation: toastin 0.35s steps(5) backwards;
}
.toast .tag { background: var(--sun); color: var(--ink); margin-right: 8px; }
@keyframes toastin { from { transform: translateY(16px); opacity: 0; } }
.toast.out { transition: opacity 0.4s steps(6), transform 0.4s steps(6); opacity: 0; transform: translateY(10px); }

/* ---------- responsive ---------- */
@media (max-width: 1240px) {
  .dr-grid { grid-template-columns: 220px minmax(0, 1fr); }
  .rail { grid-column: 1 / -1; position: static; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .rail-actions { grid-column: 1 / -1; flex-direction: row; }
}
@media (max-width: 860px) {
  .dr-grid { grid-template-columns: 1fr; }
  .folders { position: static; }
  .rail { display: flex; }
  .drow, .dhead { grid-template-columns: 40px minmax(0,1fr) 70px 96px; }
  .ddate { display: none; }
}
