/* ==========================================================================
   p-portal.css — deal room (/deals), user centre (/me), deal back office.
   Page-level layout only; shared components (.deal-card .scorecard .progress
   .timeline .badge-band) live in platform.css. Tokens only, so both themes
   resolve through app.css.
   ========================================================================== */

/* ---------- shared bits ------------------------------------------------ */
.pp-ref { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass-ink); }
.pp-prose { font-size: 14.6px; line-height: 1.85; color: var(--dim); max-width: 68ch; }
.pp-empty { font-size: 13px; }
.pp-msg { max-width: 34ch; font-size: 12.8px; color: var(--dim); white-space: pre-line; }

.pp-band { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pp-band > span:not(.badge-band) { font-size: 11.6px; color: var(--faint); text-align: right; }
.scorecard__total { margin-top: 8px; }

/* ---------- /deals list ------------------------------------------------ */
.pp-filters { padding: 18px 22px; display: grid; gap: 14px; }
.pp-filter { display: grid; grid-template-columns: 7.5em minmax(0, 1fr); align-items: center; gap: 14px; }
.pp-filter__k { font-family: var(--f-mono); font-size: 9.8px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--faint); }
.pp-filter + .pp-filter { padding-top: 14px; border-top: 1px solid var(--line); }
@media (max-width: 620px) {
  .pp-filters { padding: 16px; }
  .pp-filter { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}

.pp-deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 18px;
}
.pp-deal-grid .deal-card { min-height: 100%; }
.pp-deal-grid .deal-card__t { min-height: 2.52em; }

/* ---------- /deals/:id ------------------------------------------------- */
.pp-deal-head .h-lg { max-width: 30ch; }
.pp-detail { gap: clamp(28px, 4vw, 64px); }

.pp-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: var(--r-panel);
  background: var(--surface); overflow: hidden;
}
.pp-facts > div { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.pp-facts > div:nth-child(odd) { border-right: 1px solid var(--line); }
.pp-facts > div:nth-last-child(-n + 2) { border-bottom: 0; }
.pp-facts dt { font-family: var(--f-mono); font-size: 9.8px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.pp-facts dd { margin: 6px 0 0; font-size: 14.2px; color: var(--ivory); }
@media (max-width: 520px) {
  .pp-facts { grid-template-columns: minmax(0, 1fr); }
  .pp-facts > div:nth-child(odd) { border-right: 0; }
  .pp-facts > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
}

.pp-side { position: sticky; top: 96px; }
@media (max-width: 900px) { .pp-side { position: static; } }

.pp-gate { padding: clamp(22px, 2.6vw, 32px); position: relative; overflow: hidden; }
.pp-gate::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 2px;
  background: linear-gradient(90deg, var(--brass-400), transparent);
}
.pp-gate__list { display: grid; gap: 10px; margin-top: 18px; font-size: 13.4px; color: var(--dim); }
.pp-gate__list li { position: relative; padding-left: 22px; line-height: 1.55; }
.pp-gate__list li::before {
  content: ''; position: absolute; left: 0; top: 0.45em;
  width: 10px; height: 10px; border-radius: 2px;
  border: 1px solid var(--brass-600);
  background: repeating-linear-gradient(135deg, transparent 0 2px, color-mix(in srgb, var(--brass-400) 40%, transparent) 2px 3px);
}

.pp-interest { padding: clamp(20px, 2.4vw, 28px); }
.pp-mine { display: grid; gap: 8px; font-size: 13px; color: var(--dim); padding: 12px 14px; border-radius: var(--r-btn); background: var(--well); }
.pp-kind { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.pp-kind__opt {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-btn);
  cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast);
}
.pp-kind__opt:hover { border-color: var(--brass-600); }
.pp-kind__opt:has(input:checked) { border-color: var(--jade-500); background: color-mix(in srgb, var(--jade-500) 7%, transparent); }
.pp-kind__opt input { margin-top: 3px; accent-color: var(--jade-500); }
.pp-kind__opt > span { display: grid; gap: 3px; min-width: 0; }
.pp-kind__opt b { font-weight: 500; font-size: 13.8px; color: var(--ivory); }
.pp-kind__opt small { font-size: 12px; color: var(--faint); line-height: 1.5; }
.pp-kind__opt em { font-style: normal; font-family: var(--f-mono); font-size: 10px; letter-spacing: 0.12em; color: var(--accent); text-transform: uppercase; }

/* ---------- /me -------------------------------------------------------- */
.pp-board { margin-top: clamp(40px, 5vw, 64px); }
.pp-board__head { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.pp-board__lede { font-size: 13px; }
.pp-kpi-v { font-size: 1.12rem; line-height: 1.35; word-break: break-word; }

.pp-card {
  padding: clamp(20px, 2.4vw, 30px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}
.pp-card__t { font-family: var(--f-display); font-size: 1.32rem; line-height: 1.28; margin-top: 8px; font-weight: 500; }
.pp-card__t a { color: inherit; border-bottom: 1px solid var(--line); transition: border-color var(--t-fast), color var(--t-fast); }
.pp-card__t a:hover { color: var(--accent); border-bottom-color: var(--accent); }

.pp-sec { margin-top: 26px; padding-top: 22px; border-top: 1px dashed var(--line); }

/* status stepper */
.pp-steps {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px; margin-top: 22px; list-style: none; padding: 0;
}
.pp-steps li { position: relative; padding-top: 14px; font-size: 11.6px; color: var(--faint); line-height: 1.35; }
.pp-steps li::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  border-radius: 2px; background: var(--track);
}
.pp-steps li.is-done { color: var(--dim); }
.pp-steps li.is-done::before { background: var(--jade-600); }
.pp-steps li.is-now { color: var(--accent); font-weight: 500; }
.pp-steps li.is-now::before { background: linear-gradient(90deg, var(--jade-600), var(--jade-400)); box-shadow: 0 0 10px -2px var(--jade-glow); }
.pp-steps.is-off { display: block; }
@media (max-width: 520px) { .pp-steps li span { display: none; } .pp-steps li.is-now span { display: inline; white-space: nowrap; } }

.pp-assess { gap: clamp(20px, 3vw, 36px); align-items: start; }
.pp-opinion { padding: 4px 0; }

.pp-matches { display: grid; gap: 8px; list-style: none; padding: 0; }
.pp-matches li {
  display: grid; grid-template-columns: 9em minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 11px 14px; border-radius: var(--r-btn); background: var(--well);
  font-size: 13.4px;
}
.pp-matches__type { font-family: var(--f-mono); font-size: 10.4px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--brass-ink); display: inline-flex; align-items: center; gap: 8px; }
.pp-matches__type::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pin-law); flex: none; }
.pp-matches__type[data-type="asset-tracing"]::before { background: var(--pin-trace); }
.pp-matches__type[data-type="enforcement"]::before { background: var(--pin-enforce); }
.pp-matches__type[data-type="funder"]::before { background: var(--pin-funder); }
.pp-matches__name { color: var(--ivory); min-width: 0; }
.pp-matches__name i { font-style: normal; color: var(--faint); }
@media (max-width: 620px) { .pp-matches li { grid-template-columns: minmax(0, 1fr) auto; } .pp-matches__name { grid-column: 1 / -1; order: 3; } }

/* holdings */
.pp-holding__grid { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); gap: clamp(22px, 3vw, 40px); align-items: start; }
.pp-alloc { display: grid; gap: 14px; }
.pp-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.pp-figs > div { padding: 12px 14px; border-radius: var(--r-btn); background: var(--well); min-width: 0; }
.pp-figs dt { font-family: var(--f-mono); font-size: 9.6px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.pp-figs dd { margin: 6px 0 0; font-family: var(--f-mono); font-size: 13.4px; color: var(--brass-fig); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 520px) { .pp-figs { grid-template-columns: minmax(0, 1fr); } }

.pp-progress { display: grid; gap: 10px; }
.pp-progress__row { display: grid; grid-template-columns: 6.5em minmax(0, 1fr) 3.2em; align-items: center; gap: 12px; }
.pp-progress__k { font-size: 12px; color: var(--dim); }
.pp-progress__v { font-family: var(--f-mono); font-size: 12.4px; text-align: right; color: var(--ivory); font-variant-numeric: tabular-nums; }

.pp-staff { align-items: center; background: linear-gradient(90deg, color-mix(in srgb, var(--brass-400) 8%, transparent), transparent 70%), var(--surface); }

/* ---------- back office ------------------------------------------------ */
.pp-admin-box { padding: 20px 22px; }
.pp-actions { white-space: nowrap; }
.pp-actions .lnk + .lnk { margin-left: 12px; }
.pp-edit-row > td { padding-top: 0 !important; border-top: 0 !important; }
.pp-edit-row summary { cursor: pointer; font-size: 12px; color: var(--faint); padding: 4px 0 8px; }
.pp-edit-row summary:hover { color: var(--accent); }
.pp-edit-row details[open] { padding: 4px 0 16px; }
