/* ─────────────────────────────────────────────────────────────
   Parcl9 Investor Portal & LP Management
   Matches the Parcl9 site design tokens exactly.
───────────────────────────────────────────────────────────── */

/* Values reference the Parcl9 theme's own tokens (style.css :root) first,
   falling back to a hardcoded copy so this file still renders correctly
   if the plugin is ever activated on a different theme. */
:root {
  --p9ip-bg:         var(--white, #ffffff);
  --p9ip-bg-subtle:  var(--bg, #f5f2eb);
  --p9ip-bg-warm:    #fdf9f3;
  --p9ip-border:     var(--border, rgba(154, 111, 46, 0.18));
  --p9ip-border-md:  rgba(154, 111, 46, 0.28);
  --p9ip-gold:       var(--gold, #9a6f2e);
  --p9ip-gold-hover: var(--gold2, #b8883e);
  --p9ip-gold-light: rgba(154, 111, 46, 0.09);
  --p9ip-text:       var(--fg, #1a1814);
  --p9ip-text-mid:   var(--mu, #6b6458);
  /* Deliberately NOT var(--mu2, ...) — the theme's --mu2 (#a8a090) is tuned
     for input placeholder text, not real content, and its contrast against
     white (~2.6:1) is too low to read comfortably. This variable actually
     drives a lot of real, legible-content text across the portal (table
     headers, dates, tab labels, email addresses, icon buttons), so it gets
     its own darker value (~4.5:1, WCAG AA for normal text) independent of
     whatever the shared theme token is tuned for. */
  --p9ip-muted:      #7d766a;
  --p9ip-danger:     #b53c3c;
  --p9ip-success:    #2e7d32;
  --p9ip-radius:     4px;
  --p9ip-shadow:     var(--shadow-sm, 0 1px 3px rgba(26,24,20,.06), 0 1px 2px rgba(26,24,20,.04));
  --p9ip-shadow-md:  var(--shadow-md, 0 4px 16px rgba(26,24,20,.08), 0 2px 6px rgba(26,24,20,.05));
}

/* ── Wrap ─────────────────────────────────────────────────── */
#p9ip-wrap {
  font-family: 'Inter', sans-serif;
  color: var(--p9ip-text);
  background: var(--p9ip-bg);
  box-sizing: border-box;
  /* Self-contained gutter so content never touches the edges of whatever
     container (page block, card, etc.) the shortcode is placed in. */
  padding: 0.5rem 1.75rem 2rem;
}
#p9ip-wrap *, #p9ip-wrap *::before, #p9ip-wrap *::after { box-sizing: border-box; }

/* Guest / login prompt */
.p9ip-guest-msg {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--p9ip-text-mid);
  font-size: 0.95rem;
}
.p9ip-guest-msg a { color: var(--p9ip-gold); }

/* ── overide title margin-top ──────────────────────────────────────────────── */
.p9ip-lp-header-text h2, .p9ip-gp-header h2  {
  margin-top: 0 !important;
}


/* ── Top bar ──────────────────────────────────────────────── */
#p9ip-topbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 0 1rem;
  border-bottom: 1px solid var(--p9ip-border);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
#p9ip-topbar h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--p9ip-text);
  margin: 0;
  flex: 1;
}
/* Role switch takes the left side; when empty (single-role accounts) it
   collapses via #p9ip-role-switch:empty below, and margin-left:auto on the
   bell (not justify-content:space-between on the parent) is what keeps the
   bell pinned right in both cases. */
#p9ip-role-switch { flex: 1; min-width: 0; }
.p9ip-user-label { font-size: 0.8rem; color: var(--p9ip-text-mid); }
.p9ip-role-badge {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 2px;
  background: rgba(154,111,46,.1);
  color: var(--p9ip-gold);
}
.p9ip-role-badge.gp { background: rgba(26,24,20,.08); color: var(--p9ip-text); }

/* ── Buttons ──────────────────────────────────────────────── */
.p9ip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.55rem 1.1rem;
  border-radius: 3px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  white-space: nowrap;
}
/* !important + #p9ip-wrap scoping below guards against theme/page-builder
   global link-color rules (e.g. "a { color: ... }") clobbering button text,
   which otherwise silently renders as invisible text on matching backgrounds. */
/* #p9ip-modal is a sibling of #p9ip-wrap (see views/portal.php), not a
   descendant, so every rule below is duplicated for both roots — otherwise
   buttons rendered inside modals (Save, Invite, etc.) fall back to
   unstyled/theme-default appearance. #p9ip-assistant-panel and
   #p9ip-notif-drawer are the same situation — both mounted on <body>,
   outside #p9ip-wrap (see mountAssistant()/mountDrawer() in
   investor-portal.js), so they need the same explicit scoping. */
#p9ip-wrap .p9ip-btn--primary,   #p9ip-modal .p9ip-btn--primary,   #p9ip-assistant-panel .p9ip-btn--primary,   #p9ip-notif-drawer .p9ip-btn--primary   { background: var(--p9ip-gold) !important; color: #fff !important; border-color: var(--p9ip-gold) !important; }
#p9ip-wrap .p9ip-btn--primary:hover, #p9ip-modal .p9ip-btn--primary:hover, #p9ip-assistant-panel .p9ip-btn--primary:hover, #p9ip-notif-drawer .p9ip-btn--primary:hover { background: var(--p9ip-gold-hover) !important; border-color: var(--p9ip-gold-hover) !important; }
#p9ip-wrap .p9ip-btn--secondary, #p9ip-modal .p9ip-btn--secondary, #p9ip-notif-drawer .p9ip-btn--secondary { background: transparent !important; color: var(--p9ip-gold) !important; border-color: rgba(154,111,46,.4) !important; }
#p9ip-wrap .p9ip-btn--secondary:hover, #p9ip-modal .p9ip-btn--secondary:hover, #p9ip-notif-drawer .p9ip-btn--secondary:hover { background: var(--p9ip-gold-light) !important; }
#p9ip-wrap .p9ip-btn--danger,    #p9ip-modal .p9ip-btn--danger,    #p9ip-notif-drawer .p9ip-btn--danger    { background: var(--p9ip-danger) !important; color: #fff !important; border-color: var(--p9ip-danger) !important; }
.p9ip-btn--sm { font-size: 0.7rem; padding: 0.3rem 0.7rem; }
.p9ip-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ── Tab navigation ───────────────────────────────────────── */
#p9ip-tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--p9ip-border);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.p9ip-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  padding: 0.6rem 1.1rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--p9ip-muted);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.p9ip-tab-btn:hover  { color: var(--p9ip-text); }
.p9ip-tab-btn.active { color: var(--p9ip-gold); border-bottom-color: var(--p9ip-gold); }

/* ── Tab panes ────────────────────────────────────────────── */
.p9ip-tab-pane { display: none; }
.p9ip-tab-pane.active { display: block; }

/* ── Panel ────────────────────────────────────────────────── */
.p9ip-panel {
  background: var(--p9ip-bg);
  border: 1px solid var(--p9ip-border);
  border-radius: var(--p9ip-radius);
  box-shadow: var(--p9ip-shadow);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.p9ip-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.1rem;
  background: var(--p9ip-bg-warm);
  border-bottom: 1px solid var(--p9ip-border);
}
.p9ip-panel-title {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--p9ip-gold);
  margin: 0;
}
.p9ip-panel-body { padding: 1.1rem; }
.p9ip-empty { color: var(--p9ip-muted); font-size: 0.85rem; text-align: center; padding: 1.5rem 0; }

/* ── Deals grid ───────────────────────────────────────────── */
#p9ip-deals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.p9ip-deal-card {
  background: var(--p9ip-bg);
  border: 1px solid var(--p9ip-border);
  border-radius: var(--p9ip-radius);
  box-shadow: var(--p9ip-shadow);
  overflow: hidden;
  transition: box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}
.p9ip-deal-card:hover { box-shadow: var(--p9ip-shadow-md); border-color: rgba(154,111,46,.35); }
.p9ip-deal-card-header {
  padding: 0.85rem 1rem 0.7rem;
  background: var(--p9ip-bg-warm);
  border-bottom: 1px solid var(--p9ip-border);
}
.p9ip-deal-name  { font-size: 0.95rem; font-weight: 600; color: var(--p9ip-text); margin-bottom: 0.25rem; }
.p9ip-deal-type  { font-size: 0.73rem; color: var(--p9ip-text-mid); }
.p9ip-deal-body  { padding: 0.85rem 1rem; }
.p9ip-deal-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem 1rem; }
.p9ip-deal-stat-label { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--p9ip-muted); }
.p9ip-deal-stat-value { font-size: 0.88rem; color: var(--p9ip-text); font-weight: 500; }

/* Deal status badge */
.p9ip-status-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.18rem 0.55rem;
  border-radius: 2px;
  background: rgba(154,111,46,.1);
  color: var(--p9ip-gold);
}
.p9ip-status-badge.active    { background: rgba(46,125,50,.1);  color: #1a4a2e; }
.p9ip-status-badge.realized  { background: rgba(26,24,20,.08); color: var(--p9ip-text); }
.p9ip-status-badge.inactive  { background: rgba(168,160,144,.15); color: var(--p9ip-muted); }

/* ── Deal detail ──────────────────────────────────────────── */
#p9ip-deal-detail { display: none; }
#p9ip-deal-detail.active { display: block; }
#p9ip-back-btn { background: none; border: none; color: var(--p9ip-gold); cursor: pointer; font-size: 0.82rem; padding: 0 0 1rem; font-family: 'Inter', sans-serif; font-weight: 500; letter-spacing: 0.02em; }
#p9ip-back-btn:hover { text-decoration: underline; }

/* ── Info rows ────────────────────────────────────────────── */
.p9ip-info-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 0.85rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--p9ip-border);
}
.p9ip-info-row:last-child { border-bottom: none; }
.p9ip-info-label { color: var(--p9ip-text-mid); font-size: 0.78rem; }
.p9ip-info-value { color: var(--p9ip-text); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── Tables ───────────────────────────────────────────────── */
.p9ip-table { width: 100%; border-collapse: collapse; font-size: 0.83rem; }
.p9ip-table th {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--p9ip-muted);
  padding: 0.4rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid var(--p9ip-border);
  white-space: nowrap;
}
.p9ip-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--p9ip-border); color: var(--p9ip-text); }
.p9ip-table tr:last-child td { border-bottom: none; }
.p9ip-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.p9ip-table .actions { display: flex; gap: 0.4rem; }

/* ── LP investor list ─────────────────────────────────────── */
.p9ip-investor-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--p9ip-border);
}
.p9ip-investor-row:last-child { border-bottom: none; }
.p9ip-investor-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--p9ip-bg-subtle);
  border: 1px solid var(--p9ip-border-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 600; color: var(--p9ip-gold);
  flex-shrink: 0;
}
.p9ip-investor-name  { font-size: 0.9rem; font-weight: 600; color: var(--p9ip-text); }
.p9ip-investor-email { font-size: 0.75rem; color: var(--p9ip-muted); }
.p9ip-investor-meta  { margin-left: auto; text-align: right; }
.p9ip-investor-amount { font-size: 0.88rem; font-weight: 600; color: var(--p9ip-text); }
.p9ip-investor-pct    { font-size: 0.72rem; color: var(--p9ip-text-mid); }

/* ── Document list ────────────────────────────────────────── */
.p9ip-doc-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--p9ip-border);
}
.p9ip-doc-row:last-child { border-bottom: none; }
.p9ip-doc-icon { color: var(--p9ip-gold); font-size: 1rem; flex-shrink: 0; }
.p9ip-doc-name { font-size: 0.85rem; color: var(--p9ip-text); flex: 1; }
.p9ip-doc-date { font-size: 0.73rem; color: var(--p9ip-muted); }
.p9ip-doc-name a { color: var(--p9ip-gold); text-decoration: none; }
.p9ip-doc-name a:hover { text-decoration: underline; }

/* ── Update feed ──────────────────────────────────────────── */
.p9ip-update-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--p9ip-border);
}
.p9ip-update-item:last-child { border-bottom: none; }
.p9ip-update-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.3rem; }
.p9ip-update-title { font-size: 0.88rem; font-weight: 600; color: var(--p9ip-text); }
.p9ip-update-date  { font-size: 0.72rem; color: var(--p9ip-muted); }
.p9ip-update-body  { font-size: 0.83rem; color: var(--p9ip-text-mid); line-height: 1.5; }

/* ── Modal ────────────────────────────────────────────────── */
.p9ip-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26,24,20,.45);
  z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.p9ip-modal {
  background: var(--p9ip-bg);
  border: 1px solid var(--p9ip-border-md);
  border-radius: var(--p9ip-radius);
  width: 100%; max-width: 520px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: var(--p9ip-shadow-md);
}
.p9ip-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--p9ip-border);
  background: var(--p9ip-bg-warm); position: sticky; top: 0;
}
.p9ip-modal-header h3 { margin: 0; font-family: 'Playfair Display', Georgia, serif; font-size: 1.05rem; font-weight: 400; color: var(--p9ip-text); }
.p9ip-modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--p9ip-muted); }
.p9ip-modal-body   { padding: 1.25rem; }
.p9ip-modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--p9ip-border); display: flex; gap: 0.5rem; justify-content: flex-end; background: var(--p9ip-bg-warm); }

/* ── Form ─────────────────────────────────────────────────── */
.p9ip-form { display: flex; flex-direction: column; gap: 0.85rem; }
.p9ip-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.p9ip-f-group { display: flex; flex-direction: column; gap: 0.3rem; }
.p9ip-f-group label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--p9ip-text-mid); }
.p9ip-f-group input,
.p9ip-f-group select,
.p9ip-f-group textarea {
  background: var(--p9ip-bg-subtle);
  border: 1px solid var(--p9ip-border-md);
  border-radius: var(--p9ip-radius);
  padding: 0.55rem 0.8rem;
  font-family: 'Inter', sans-serif;
  font-size: 0.88rem;
  color: var(--p9ip-text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.p9ip-f-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239a6f2e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  padding-right: 2.1rem;
  cursor: pointer;
}
.p9ip-f-group input:focus,
.p9ip-f-group select:focus,
.p9ip-f-group textarea:focus {
  border-color: var(--p9ip-gold);
  box-shadow: 0 0 0 3px rgba(154,111,46,.1);
}
.p9ip-f-group input::placeholder,
.p9ip-f-group textarea::placeholder { color: var(--p9ip-muted); }
.p9ip-f-group textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.p9ip-form-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--p9ip-gold);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--p9ip-border);
  margin-top: 0.25rem;
}

/* ── Upload area ──────────────────────────────────────────── */
.p9ip-upload-area {
  border: 2px dashed var(--p9ip-border-md);
  border-radius: var(--p9ip-radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--p9ip-muted);
  font-size: 0.83rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.p9ip-upload-area:hover { border-color: var(--p9ip-gold); background: var(--p9ip-bg-subtle); }
.p9ip-upload-area input[type="file"] { display: none; }

/* ── Notice toast ─────────────────────────────────────────── */
#p9ip-notice {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--p9ip-text); color: #fff;
  padding: 0.7rem 1.2rem; border-radius: 3px;
  font-size: 0.85rem; box-shadow: var(--p9ip-shadow-md);
  display: none; z-index: 9999;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 640px) {
  #p9ip-deals-grid { grid-template-columns: 1fr; }
  .p9ip-form-row   { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   PATCH — Full JS-rendered class coverage
════════════════════════════════════════════════════════════ */

/* Modal structure: view uses id-based, JS populates body */
#p9ip-modal { display: none; position: fixed; inset: 0; background: rgba(26,24,20,.45); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 1rem; }
#p9ip-modal[style*="display: none"] { display: none !important; }
#p9ip-modal-inner { background: var(--p9ip-bg); border: 1px solid var(--p9ip-border-md); border-radius: var(--p9ip-radius); width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--p9ip-shadow-md); }
#p9ip-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 0.85rem 1.25rem; border-bottom: 1px solid var(--p9ip-border); background: var(--p9ip-bg-warm); position: sticky; top: 0; }
#p9ip-modal-title { margin: 0; font-family: 'Playfair Display', Georgia, serif; font-size: 1.05rem; font-weight: 400; color: var(--p9ip-text); }
#p9ip-modal-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--p9ip-muted); }
#p9ip-modal-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 0.75rem; }

/* Content area */
#p9ip-content { width: 100%; }

/* Guest box */
.p9ip-guest { display: flex; align-items: center; justify-content: center; padding: 4rem 1rem; }
.p9ip-guest-box { background: var(--p9ip-bg); border: 1px solid var(--p9ip-border); border-radius: var(--p9ip-radius); padding: 2.5rem 2.75rem; text-align: center; max-width: 380px; box-shadow: var(--p9ip-shadow); }
.p9ip-guest-box h2 { font-family: 'Playfair Display', Georgia, serif; font-size: 1.4rem; font-weight: 400; color: var(--p9ip-text); margin: 0 0 0.75rem; }
.p9ip-guest-box p { color: var(--p9ip-text-mid); font-size: 0.9rem; margin: 0 0 1.25rem; }

/* Empty state */
.p9ip-empty-state { text-align: center; padding: 3rem 1rem; color: var(--p9ip-text-mid); font-size: 0.9rem; }
.p9ip-empty { color: var(--p9ip-muted); font-size: 0.85rem; padding: 1.25rem 0; }

/* GP header bar */
.p9ip-gp-header { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 0 1rem; border-bottom: 1px solid var(--p9ip-border); margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.p9ip-gp-header h2 { font-family: 'Playfair Display', Georgia, serif; font-size: 1.3rem; font-weight: 400; color: var(--p9ip-text); margin: 0; }
/* Groups a header's action button(s) + the notification bell together so
   they sit right next to each other — justify-content:space-between on the
   parent then only has to separate this group from the h2, not space the
   button and bell apart from each other too. */
.p9ip-gp-header-actions { display: flex; align-items: center; gap: 0.75rem; }

/* LP header */
.p9ip-lp-header { padding: 0.75rem 0 1rem; border-bottom: 1px solid var(--p9ip-border); margin-bottom: 1.5rem; }
.p9ip-lp-header h2 { font-family: 'Playfair Display', Georgia, serif; font-size: 1.3rem; font-weight: 400; color: var(--p9ip-text); margin: 0 0 0.25rem; }
.p9ip-lp-welcome { font-size: 0.85rem; color: var(--p9ip-text-mid); margin: 0; }
/* Portfolio list only (renderLPPortfolio) — puts the bell on the right of
   the title/welcome text. Deal detail (renderLPDeal) doesn't use this
   modifier since its h2 + address need to stack normally underneath the
   breadcrumb row instead. */
.p9ip-lp-header--list { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }

/* Breadcrumb — back link on the left, notification bell (when present) on the right */
.p9ip-breadcrumb { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.85rem; color: var(--p9ip-text-mid); padding-top: 1.25rem; }
.p9ip-breadcrumb-sep { color: var(--p9ip-muted); }
.p9ip-deal-head-meta { display: flex; align-items: center; gap: 0.75rem; }

/* Clickable link-style button */
.p9ip-link { background: none; border: none; color: var(--p9ip-gold); cursor: pointer; font-size: 0.85rem; padding: 0; font-family: 'Inter', sans-serif; text-decoration: none; }
.p9ip-link:hover { text-decoration: underline; }

/* Tabs */
.p9ip-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--p9ip-border); margin-bottom: 1.25rem; flex-wrap: wrap; }
.p9ip-tab { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 0.6rem 1rem; font-family: 'Inter', sans-serif; font-size: 0.78rem; font-weight: 500; color: var(--p9ip-muted); cursor: pointer; transition: color 0.2s, border-color 0.2s; white-space: nowrap; }
.p9ip-tab:hover { color: var(--p9ip-text); }
.p9ip-tab--active { color: var(--p9ip-gold) !important; border-bottom-color: var(--p9ip-gold) !important; }
.p9ip-tab-body { padding-top: 0.25rem; }

/* Role switcher (My Investments / My Deals) — top-level nav for accounts
   that are both an LP and a GP. Deliberately its own class (not .p9ip-tab)
   so it doesn't get picked up by the sub-tab click handler. */
#p9ip-role-switch:empty { display: none; }
/* No border/margin here — #p9ip-topbar (the shared parent with the
   notification bell) already provides the dividing line and spacing for
   the whole row, tabs included. */
.p9ip-role-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.p9ip-role-tab { background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px; padding: 0.7rem 1.1rem; font-family: 'Inter', sans-serif; font-size: 0.82rem; font-weight: 600; color: var(--p9ip-muted); cursor: pointer; transition: color 0.2s, border-color 0.2s; white-space: nowrap; }
.p9ip-role-tab:hover { color: var(--p9ip-text); }
.p9ip-role-tab--active { color: var(--p9ip-gold) !important; border-bottom-color: var(--p9ip-gold) !important; }

/* ── Notification bell ────────────────────────────────────────
   No fixed home — mounted contextually inside whichever view's own
   header/breadcrumb is showing (see #p9ip-notif-bell usages in
   investor-portal.js: GP deal list header, GP deal breadcrumb, LP
   portfolio header, LP deal breadcrumb). Each of those parents already
   handles left/right positioning (space-between or an actions group),
   so this just needs to anchor the dropdown panel. */
#p9ip-notif-bell { position: relative; flex-shrink: 0; }
#p9ip-notif-bell:empty { display: none; }

#p9ip-notif-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--p9ip-text-mid);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
#p9ip-notif-btn:hover { background: var(--p9ip-gold-light); color: var(--p9ip-gold); }

.p9ip-notif-badge {
  position: absolute;
  top: -0.15rem;
  right: -0.15rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--p9ip-danger);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.1rem;
  text-align: center;
  font-family: 'Inter', sans-serif;
}

#p9ip-notif-panel {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: 340px;
  max-width: calc(100vw - 2rem);
  background: var(--p9ip-bg);
  border: 1px solid var(--p9ip-border);
  border-radius: var(--p9ip-radius);
  box-shadow: var(--p9ip-shadow-md);
  z-index: 40;
  overflow: hidden;
}

.p9ip-notif-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--p9ip-border);
  background: var(--p9ip-bg-warm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--p9ip-text);
}
#p9ip-notif-mark-all {
  background: none;
  border: none;
  color: var(--p9ip-gold);
  font-family: 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
#p9ip-notif-mark-all:hover { color: var(--p9ip-gold-hover); text-decoration: underline; }

#p9ip-notif-list { max-height: 22rem; overflow-y: auto; }
.p9ip-notif-empty { padding: 1.5rem 1rem; text-align: center; color: var(--p9ip-muted); font-size: 0.82rem; }

.p9ip-notif-row {
  position: relative;
  display: flex;
  gap: 0.65rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--p9ip-border);
  cursor: pointer;
  transition: background 0.15s;
}
.p9ip-notif-row:last-child { border-bottom: none; }
.p9ip-notif-row:hover { background: var(--p9ip-bg-warm); }
.p9ip-notif-row--unread { background: var(--p9ip-gold-light); }
.p9ip-notif-row--unread:hover { background: rgba(154, 111, 46, 0.14); }

.p9ip-notif-row-icon { flex-shrink: 0; font-size: 1.1rem; line-height: 1.4rem; }
.p9ip-notif-row-body { flex: 1; min-width: 0; }
.p9ip-notif-row-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--p9ip-text);
  margin-bottom: 0.15rem;
}
.p9ip-notif-row-msg {
  font-size: 0.78rem;
  color: var(--p9ip-text-mid);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.p9ip-notif-row-time { font-size: 0.68rem; color: var(--p9ip-muted); margin-top: 0.25rem; }
.p9ip-notif-dot {
  flex-shrink: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--p9ip-gold);
  margin-top: 0.3rem;
}

/* ── Notification detail drawer ──────────────────────────────
   Slides in from the right with the complete, untruncated message — the
   dropdown list (.p9ip-notif-row-msg above) only ever shows a 2-line
   preview. Appended once to <body> (see mountDrawer()), independent of
   wherever the bell itself currently lives, so it survives navigation. */
#p9ip-notif-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 24, 20, 0.45);
  z-index: 9600;
}
#p9ip-notif-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 420px;
  max-width: 92vw;
  background: var(--p9ip-bg);
  box-shadow: var(--p9ip-shadow-md);
  z-index: 9601;
  display: flex;
  flex-direction: column;
  font-family: 'Inter', sans-serif;
  color: var(--p9ip-text);
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
#p9ip-notif-drawer.p9ip-notif-drawer--open { transform: translateX(0); }
#p9ip-notif-drawer *,
#p9ip-notif-drawer *::before,
#p9ip-notif-drawer *::after { box-sizing: border-box; }

#p9ip-notif-drawer-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1rem;
  border-bottom: 1px solid var(--p9ip-border);
  background: var(--p9ip-bg-warm);
}
#p9ip-notif-drawer-icon { font-size: 1.4rem; line-height: 1.6rem; flex-shrink: 0; }
#p9ip-notif-drawer-titlewrap { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.2rem; }
#p9ip-notif-drawer-title { font-family: 'Playfair Display', Georgia, serif; font-size: 1.15rem; font-weight: 400; color: var(--p9ip-text); }
#p9ip-notif-drawer-time { font-size: 0.75rem; color: var(--p9ip-muted); }
#p9ip-notif-drawer-close { flex-shrink: 0; background: none; border: none; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--p9ip-muted); padding: 0; }
#p9ip-notif-drawer-close:hover { color: var(--p9ip-text); }

#p9ip-notif-drawer-body { flex: 1; overflow-y: auto; padding: 1.25rem; }
#p9ip-notif-drawer-msg { margin: 0; font-size: 0.92rem; line-height: 1.65; color: var(--p9ip-text); white-space: normal; }

#p9ip-notif-drawer-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--p9ip-border); }
#p9ip-notif-drawer-footer:empty { display: none; }
#p9ip-notif-drawer-footer .p9ip-btn { width: 100%; }

/* Section header (within tab) */
.p9ip-section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.p9ip-section-header h3 { margin: 0; font-family: 'Playfair Display', Georgia, serif; font-size: 1rem; font-weight: 400; color: var(--p9ip-text); }
.p9ip-section-title { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--p9ip-gold); }

/* Deal grid */
/* grid rows already stretch every card to the row's tallest card by
   default (align-items: stretch) — .p9ip-deal-card just needs to actually
   use that height via flex-direction: column so .p9ip-deal-info can fill
   the rest below the (optional) cover image, and .p9ip-deal-actions can
   pin itself to the bottom of that via margin-top: auto, regardless of
   how many lines the name/address/target-return above it take up. */
.p9ip-deal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.p9ip-deal-card { background: var(--p9ip-bg); border: 1px solid var(--p9ip-border); border-radius: var(--p9ip-radius); box-shadow: var(--p9ip-shadow); overflow: hidden; transition: box-shadow 0.2s, border-color 0.2s; display: flex; flex-direction: column; }
.p9ip-deal-card:hover { box-shadow: var(--p9ip-shadow-md); border-color: rgba(154,111,46,.35); }
.p9ip-deal-cover { width: 100%; height: 120px; background: var(--p9ip-bg-subtle); background-size: cover; background-position: center; flex-shrink: 0; }
.p9ip-deal-info { padding: 0.85rem 1rem; flex: 1; display: flex; flex-direction: column; }
.p9ip-deal-name { font-size: 0.95rem; font-weight: 600; color: var(--p9ip-text); margin-bottom: 0.25rem; }
/* text-mid, not muted — this is the deal's actual address, identifying
   content directly under the deal name, not a tertiary label/timestamp. */
.p9ip-deal-addr { font-size: 0.73rem; color: var(--p9ip-text-mid); margin-bottom: 0.35rem; }
.p9ip-deal-addr-lp { font-size: 0.73rem; color: var(--p9ip-text-mid); margin-bottom: 0.35rem; }
.p9ip-deal-return { font-size: 0.75rem; color: var(--p9ip-text-mid); margin-bottom: 0.5rem; }
.p9ip-deal-actions { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: auto; padding-top: 0.5rem; flex-wrap: wrap; }
/* Manage sits alone via justify-content: space-between on the parent;
   Edit/Delete are grouped here so they stay tight against each other on
   the right instead of also being spaced apart from Manage. */
.p9ip-deal-actions-secondary { display: flex; gap: 0.35rem; }
/* .p9ip-btn's default 1.1rem side padding is sized for text labels — too
   wide for these icon-only (✎ / ✕) buttons, so tighten it just here. */
.p9ip-deal-actions-secondary .p9ip-btn { padding-left: 0.55rem; padding-right: 0.55rem; }
.p9ip-deal-card--lp { cursor: pointer; }

/* LP deal stats */
.p9ip-lp-deal-stats { display: flex; gap: 1rem; flex-wrap: wrap; margin: 0.5rem 0; }
.p9ip-stat-label { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--p9ip-muted); }
.p9ip-stat-value { font-size: 0.9rem; color: var(--p9ip-text); font-weight: 500; }

/* Summary cards (LP view) */
.p9ip-summary-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.75rem; margin-bottom: 1.25rem; }
.p9ip-summary-card { background: var(--p9ip-bg); border: 1px solid var(--p9ip-border); border-radius: var(--p9ip-radius); padding: 0.9rem 1rem; box-shadow: var(--p9ip-shadow); }
.p9ip-card-label { font-size: 0.67rem; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--p9ip-muted); margin-bottom: 0.3rem; }
.p9ip-card-value { font-size: 1.25rem; font-weight: 300; color: var(--p9ip-text); line-height: 1.1; }
.p9ip-card--good .p9ip-card-value { color: var(--p9ip-success); }
.p9ip-card--bad  .p9ip-card-value { color: var(--p9ip-danger); }
.p9ip-card--blue .p9ip-card-value { color: var(--p9ip-gold); }

/* Investor card */
.p9ip-investor-list { display: flex; flex-direction: column; gap: 0.85rem; }
.p9ip-investor-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--p9ip-bg-warm);
  border: 1px solid var(--p9ip-border);
  border-radius: var(--p9ip-radius);
  padding: 1.1rem 1.25rem;
}
.p9ip-inv-info { flex: 1; min-width: 200px; }
.p9ip-inv-name { font-size: 0.9rem; font-weight: 600; color: var(--p9ip-text); }
.p9ip-inv-email { font-size: 0.75rem; color: var(--p9ip-muted); font-weight: 400; margin-left: 0.5rem; }
.p9ip-inv-stats { display: flex; gap: 1.5rem; flex-wrap: wrap; margin: 0.75rem 0 0; }
.p9ip-inv-actions { width: 100%; display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--p9ip-border); }

/* Sub table (inside investor card) */
.p9ip-sub-table { margin-top: 0.6rem; padding: 0.5rem; background: rgba(154,111,46,.04); border-radius: var(--p9ip-radius); overflow-x: auto; }

/* Table */
.p9ip-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.p9ip-table th { font-size: 0.67rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--p9ip-muted); padding: 0.35rem 0.5rem; text-align: left; border-bottom: 1px solid var(--p9ip-border); white-space: nowrap; }
.p9ip-table td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--p9ip-border); color: var(--p9ip-text); }
.p9ip-table tr:last-child td { border-bottom: none; }
.p9ip-table .p9ip-total-row td { font-weight: 600; background: var(--p9ip-bg-warm); }
.p9ip-table--sm td, .p9ip-table--sm th { padding: 0.28rem 0.45rem; font-size: 0.78rem; }

/* Icon button (small × delete) */
.p9ip-icon-btn { background: none; border: none; color: var(--p9ip-muted); cursor: pointer; font-size: 0.85rem; padding: 0.15rem 0.3rem; line-height: 1; border-radius: 2px; transition: color 0.15s, background 0.15s; }
.p9ip-icon-btn:hover { color: var(--p9ip-danger); background: rgba(181,60,60,.08); }

/* File link */
.p9ip-file-link { color: var(--p9ip-gold); text-decoration: none; }
.p9ip-file-link:hover { text-decoration: underline; }

/* LP read-only waterfall structure (see renderLPWaterfall() in
   investor-portal.js) — a numbered list of promote steps, not the
   full GP waterfall calculator (that stays GP-only, see p9ip-waterfall.js). */
.p9ip-wf-steps-readonly { display: flex; flex-direction: column; gap: 0.6rem; }
.p9ip-wf-step-ro { display: flex; gap: 0.75rem; background: var(--p9ip-bg); border: 1px solid var(--p9ip-border); border-radius: var(--p9ip-radius); padding: 0.75rem 1rem; }
.p9ip-wf-step-ro-num {
  flex-shrink: 0;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--p9ip-gold-light);
  color: var(--p9ip-gold);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.p9ip-wf-step-ro-label  { font-size: 0.88rem; font-weight: 600; color: var(--p9ip-text); }
.p9ip-wf-step-ro-detail { font-size: 0.78rem; color: var(--p9ip-muted); margin-top: 0.15rem; }

/* Update card */
.p9ip-update-card { background: var(--p9ip-bg); border: 1px solid var(--p9ip-border); border-radius: var(--p9ip-radius); padding: 0.85rem 1rem; margin-bottom: 0.75rem; }
.p9ip-update-meta { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.4rem; flex-wrap: wrap; }
.p9ip-update-title { font-size: 0.9rem; font-weight: 600; color: var(--p9ip-text); }
.p9ip-update-date  { font-size: 0.72rem; color: var(--p9ip-muted); }
.p9ip-update-body  { font-size: 0.83rem; color: var(--p9ip-text-mid); line-height: 1.55; }
.p9ip-update-photos { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.p9ip-photo-thumb { width: 80px; height: 80px; object-fit: cover; border-radius: 3px; border: 1px solid var(--p9ip-border); }

/* Badges */
.p9ip-badge { display: inline-block; font-size: 0.65rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.18rem 0.55rem; border-radius: 2px; }
.p9ip-badge--green  { background: rgba(46,125,50,.1);  color: #1a4a2e; }
.p9ip-badge--blue   { background: rgba(154,111,46,.1); color: var(--p9ip-gold); }
.p9ip-badge--yellow { background: rgba(180,83,9,.1);   color: #7a3300; }
.p9ip-badge--gray   { background: rgba(168,160,144,.15); color: var(--p9ip-muted); }
.p9ip-badge--red    { background: rgba(181,60,60,.1);  color: var(--p9ip-danger); }

/* ── Capital Calls (GP tab) — see renderGPCapitalCalls() ─────── */
.p9ip-cc-card { background: var(--p9ip-bg); border: 1px solid var(--p9ip-border); border-radius: var(--p9ip-radius); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.p9ip-cc-card-head { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.p9ip-cc-title { font-size: 0.95rem; font-weight: 600; color: var(--p9ip-text); }
.p9ip-cc-due { font-size: 0.75rem; color: var(--p9ip-muted); margin-left: auto; }
.p9ip-cc-notes { font-size: 0.8rem; color: var(--p9ip-text-mid); margin-bottom: 0.6rem; }
.p9ip-cc-progress-wrap { height: 6px; border-radius: 3px; background: rgba(0,0,0,.06); overflow: hidden; margin-bottom: 0.3rem; }
.p9ip-cc-progress-bar { height: 100%; background: var(--p9ip-gold); border-radius: 3px; transition: width .2s ease; }
.p9ip-cc-progress-label { font-size: 0.75rem; color: var(--p9ip-muted); margin-bottom: 0.75rem; }
.p9ip-cc-alloc-table { margin: 0; }

/* Issue Capital Call modal */
.p9ip-cc-alloc-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 0; border-bottom: 1px solid var(--p9ip-border); }
.p9ip-cc-alloc-row:last-child { border-bottom: none; }
.p9ip-cc-alloc-name { flex: 1; font-size: 0.85rem; color: var(--p9ip-text); }
.p9ip-cc-alloc-amt { width: 140px; flex-shrink: 0; }
.p9ip-cc-total-row { text-align: right; font-size: 0.85rem; color: var(--p9ip-text-mid); margin: 0.6rem 0 1rem; }

/* Pending Capital Calls banner (LP deal detail) — see loadLPCapitalCalls() */
.p9ip-cc-lp-banner { margin-bottom: 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; }
.p9ip-cc-lp-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: rgba(180,83,9,.06);
  border: 1px solid rgba(180,83,9,.25);
  border-radius: var(--p9ip-radius);
  padding: 0.75rem 1rem;
}
.p9ip-cc-lp-row--overdue { background: rgba(181,60,60,.07); border-color: rgba(181,60,60,.3); }
.p9ip-cc-lp-icon { font-size: 1.2rem; line-height: 1.4rem; flex-shrink: 0; }
.p9ip-cc-lp-title { font-size: 0.88rem; font-weight: 600; color: var(--p9ip-text); }
.p9ip-cc-lp-detail { font-size: 0.8rem; color: var(--p9ip-text-mid); margin-top: 0.15rem; }
.p9ip-cc-lp-notes { font-size: 0.76rem; color: var(--p9ip-muted); margin-top: 0.25rem; }

/* Deal-card flag (LP portfolio list) */
.p9ip-deal-cc-flag { font-size: 0.76rem; color: #7a3300; margin-top: 0.2rem; }

/* Form fields in modal (p9ip-fld) */
.p9ip-fld { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.65rem; }
.p9ip-fld label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--p9ip-text-mid); }
.p9ip-fld input, .p9ip-fld select, .p9ip-fld textarea {
  background: var(--p9ip-bg-subtle); border: 1px solid var(--p9ip-border-md); border-radius: var(--p9ip-radius);
  padding: 0.55rem 0.8rem; font-family: 'Inter', sans-serif; font-size: 0.88rem; color: var(--p9ip-text);
  outline: none; transition: border-color 0.2s; width: 100%;
}
.p9ip-fld select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239a6f2e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center; padding-right: 2.1rem; cursor: pointer;
}
.p9ip-fld input:focus, .p9ip-fld select:focus, .p9ip-fld textarea:focus { border-color: var(--p9ip-gold); box-shadow: 0 0 0 3px rgba(154,111,46,.1); }
.p9ip-fld input::placeholder, .p9ip-fld textarea::placeholder { color: var(--p9ip-muted); }
.p9ip-fld textarea { min-height: 80px; resize: vertical; line-height: 1.5; }
.p9ip-fld:last-child { margin-bottom: 0; }
.p9ip-fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 480px) { .p9ip-fld-row { grid-template-columns: 1fr; } }

/* "Pick from Contacts" (Invite Investor modal) */
.p9ip-contact-hint { text-transform: none; font-weight: 400; letter-spacing: 0; color: var(--p9ip-muted); }
.p9ip-contact-picker { position: relative; }
.p9ip-contact-clear { font-size: 0.85rem; padding: 0 0.6rem !important; }
.p9ip-contact-results {
  position: absolute; top: 100%; left: 0; right: 2.4rem; z-index: 20; margin-top: 4px;
  background: var(--p9ip-bg-subtle); border: 1px solid var(--p9ip-border-md); border-radius: var(--p9ip-radius);
  box-shadow: 0 6px 16px rgba(0,0,0,.12); max-height: 220px; overflow-y: auto;
}
.p9ip-contact-result {
  display: block; width: 100%; text-align: left; padding: 0.5rem 0.7rem; font-size: 0.85rem;
  background: none; border: none; border-bottom: 1px solid var(--p9ip-border-md); color: var(--p9ip-text); cursor: pointer;
}
.p9ip-contact-result:last-child { border-bottom: none; }
.p9ip-contact-result:hover { background: var(--p9ip-gold-light); }
.p9ip-contact-result-email { color: var(--p9ip-muted); font-size: 0.75rem; }
.p9ip-contact-empty { padding: 0.5rem 0.7rem; font-size: 0.8rem; color: var(--p9ip-muted); }

/* Button variants used by JS */
#p9ip-wrap .p9ip-btn--outline, #p9ip-modal .p9ip-btn--outline { background: transparent !important; color: var(--p9ip-gold) !important; border: 1px solid rgba(154,111,46,.4) !important; }
#p9ip-wrap .p9ip-btn--outline:hover, #p9ip-modal .p9ip-btn--outline:hover { background: var(--p9ip-gold-light) !important; }
#p9ip-wrap .p9ip-btn--ghost,   #p9ip-modal .p9ip-btn--ghost   { background: transparent !important; color: var(--p9ip-text-mid) !important; border: 1px solid transparent !important; }
#p9ip-wrap .p9ip-btn--ghost:hover, #p9ip-modal .p9ip-btn--ghost:hover { color: var(--p9ip-text) !important; border-color: rgba(154,111,46,.2) !important; }

/* Modal cancel button */
.p9ip-modal-cancel { background: transparent; color: var(--p9ip-text-mid); border: 1px solid transparent; font-family: 'Inter', sans-serif; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.55rem 1rem; border-radius: 3px; cursor: pointer; }
.p9ip-modal-cancel:hover { color: var(--p9ip-text); border-color: rgba(154,111,46,.2); }
.p9ip-modal-note { font-size: 0.73rem; color: var(--p9ip-muted); line-height: 1.4; margin-top: 0.25rem; }

/* Upload area */
.p9ip-doc-group { display: flex; flex-direction: column; gap: 0.65rem; }

/* Notice states */
#p9ip-notice { display: none; }
#p9ip-notice.p9ip-notice--success { background: #1a4a2e; display: block; }
#p9ip-notice.p9ip-notice--error   { background: var(--p9ip-danger); display: block; }

/* ── Avatar ───────────────────────────────────────────────── */
.p9ip-inv-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--p9ip-gold); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.95rem; font-weight: 600; flex-shrink: 0; }

/* ── Required asterisk ────────────────────────────────────── */
.p9ip-req { color: var(--p9ip-danger); margin-left: 2px; }

/* ── LP open deal button ──────────────────────────────────── */
.p9ip-lp-open-deal, .p9ip-open-deal, .p9ip-edit-deal { /* inherits .p9ip-btn variants */ }

/* ── Action buttons (no extra visual CSS, just click targets) */
.p9ip-add-contribution, .p9ip-add-distribution,
.p9ip-del-contribution, .p9ip-del-distribution,
.p9ip-del-document, .p9ip-del-update,
.p9ip-remove-investor { /* action selectors — no extra styling needed */ }

/* ── Modal footer ─────────────────────────────────────────── */
.p9ip-modal-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--p9ip-border); display: flex; gap: 0.5rem; justify-content: flex-end; background: var(--p9ip-bg-warm); }

/* ── Stat label/value pairs ───────────────────────────────── */
.p9ip-stat { display: flex; flex-direction: column; gap: 0.1rem; }
.p9ip-stat-label { font-size: 0.65rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--p9ip-muted); }
.p9ip-stat-value { font-size: 0.88rem; color: var(--p9ip-text); font-weight: 500; }

/* Ensure notice div is visible when active */
#p9ip-notice { display: none; }
#p9ip-notice.p9ip-notice--success,
#p9ip-notice.p9ip-notice--error { display: block; }

/* =========================================================
   EMBEDDED TOOL PANELS (Waterfall + Returns Model tabs)
   ========================================================= */

/* Strip the default top padding on tool panels when embedded,
   since the portal tab already provides vertical spacing */
.p9ip-tool-panel #p9wf-wrap,
.p9ip-tool-panel #p9rm-wrap {
    padding-top: 0;
}

/* Subtle separator between tool topbar and portal tab chrome */
.p9ip-tool-panel #p9wf-topbar,
.p9ip-tool-panel #p9rm-topbar {
    margin-top: 0.5rem;
}

/* Unavailable plugin placeholder */
.p9ip-tool-unavail {
    padding: 3rem 2rem;
    text-align: center;
    background: #fdf9f3;
    border: 1px dashed rgba(154, 111, 46, 0.3);
    border-radius: 4px;
    margin-top: 1rem;
}

.p9ip-tool-unavail p {
    color: #a8a090;
    font-size: 0.9rem;
    margin: 0;
}

.p9ip-tool-unavail strong {
    color: #6b6458;
    font-family: monospace;
    font-size: 0.85rem;
}

/* =========================================================
   AI FEATURES — 3.2 Investor Portal
   Uses existing --p9ip-* design tokens throughout.
   ========================================================= */

/* ── Shared: AI-flavored small button ────────────────────── */
.p9ip-btn--ai-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--p9ip-gold-light);
  color: var(--p9ip-gold);
  border: 1px solid rgba(154,111,46,0.25);
  border-radius: var(--p9ip-radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.p9ip-btn--ai-sm:hover {
  background: var(--p9ip-gold);
  color: #fff;
}

/* ── Shared: AI spinner ───────────────────────────────────── */
@keyframes p9ip-spin { to { transform: rotate(360deg); } }
.p9ip-ai-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--p9ip-border-md);
  border-top-color: var(--p9ip-gold);
  border-radius: 50%;
  animation: p9ip-spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 0.4rem;
}

/* ── Feature 1 — Contextual Insight Bar ──────────────────── */
#p9ip-insight-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  margin-bottom: 0.75rem;
  background: var(--p9ip-bg-warm);
  border: 1px solid var(--p9ip-border);
  border-radius: var(--p9ip-radius);
  font-size: 0.82rem;
  color: var(--p9ip-text-mid);
  min-height: 36px;
  transition: opacity 0.3s;
}
#p9ip-insight-bar.p9ip-insight--hidden {
  display: none;
}
.p9ip-insight-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--p9ip-gold);
  white-space: nowrap;
  flex-shrink: 0;
}
.p9ip-insight-text {
  flex: 1;
  color: var(--p9ip-text);
  font-size: 0.85rem;
}
.p9ip-insight-dismiss {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--p9ip-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.15rem;
  flex-shrink: 0;
  transition: color 0.15s;
}
.p9ip-insight-dismiss:hover { color: var(--p9ip-text); }

/* ── Feature 2 — LP Intelligence Feed ───────────────────── */
#p9ip-lp-feed {
  margin-top: 2rem;
  border: 1px solid var(--p9ip-border);
  border-radius: var(--p9ip-radius);
  overflow: hidden;
}
.p9ip-feed-loading {
  padding: 1rem 1.25rem;
  font-size: 0.82rem;
  color: var(--p9ip-text-mid);
  display: flex;
  align-items: center;
}
.p9ip-feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1.25rem;
  background: var(--p9ip-bg-subtle);
  border-bottom: 1px solid var(--p9ip-border);
}
.p9ip-feed-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--p9ip-gold);
}
.p9ip-feed-cached {
  font-size: 0.7rem;
  color: var(--p9ip-muted);
}
.p9ip-feed-entry {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--p9ip-border);
}
.p9ip-feed-entry:last-child { border-bottom: none; }
.p9ip-feed-deal {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--p9ip-text);
  margin-bottom: 0.3rem;
}
.p9ip-feed-addr {
  font-weight: 400;
  color: var(--p9ip-text-mid);
}
.p9ip-feed-insight {
  font-size: 0.85rem;
  color: var(--p9ip-text-mid);
  line-height: 1.55;
}

/* ── Feature 3 — Parcl9 Assistant (floating chat, every portal view) ──
   Fixed to <body>, independent of #p9ip-wrap/#p9ip-content, so it survives
   render()/unmountTools() and stays visible across every view. z-index sits
   above normal content and the standard modal (9000) but below the full-
   screen Investor Update Drafter modal (99999). */
#p9ip-assistant-fab {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--p9ip-gold);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--p9ip-shadow-md);
  z-index: 9500;
  transition: background-color .15s ease, transform .15s ease;
}
#p9ip-assistant-fab:hover,
#p9ip-assistant-fab.p9ip-assistant-fab--active { background: var(--p9ip-gold-hover); }

#p9ip-assistant-panel {
  position: fixed;
  right: 1.5rem;
  bottom: 5.5rem;
  width: 360px;
  max-width: calc(100vw - 2rem);
  height: 480px;
  max-height: calc(100vh - 8rem);
  background: var(--p9ip-bg);
  color: var(--p9ip-text);
  font-family: 'Inter', sans-serif;
  border: 1px solid var(--p9ip-border-md);
  border-radius: var(--p9ip-radius);
  box-shadow: var(--p9ip-shadow-md);
  z-index: 9500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
}
#p9ip-assistant-panel *,
#p9ip-assistant-panel *::before,
#p9ip-assistant-panel *::after { box-sizing: border-box; }
#p9ip-assistant-panel.p9ip-assistant-panel--open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#p9ip-assistant-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: var(--p9ip-bg-subtle);
  border-bottom: 1px solid var(--p9ip-border);
}
#p9ip-assistant-header-text { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
#p9ip-assistant-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--p9ip-gold);
}
#p9ip-assistant-scope {
  font-size: 0.72rem;
  color: var(--p9ip-muted);
  line-height: 1.35;
}
#p9ip-assistant-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--p9ip-muted);
  cursor: pointer;
  flex-shrink: 0;
}
#p9ip-assistant-close:hover { color: var(--p9ip-text); }
#p9ip-assistant-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.p9ip-assistant-welcome {
  font-size: 0.82rem;
  color: var(--p9ip-text-mid);
  line-height: 1.55;
}
.p9ip-assistant-msg {
  font-size: 0.85rem;
  line-height: 1.55;
  padding: 0.5rem 0.75rem;
  border-radius: var(--p9ip-radius);
  max-width: 88%;
}
.p9ip-assistant-msg--user {
  align-self: flex-end;
  background: var(--p9ip-gold-light);
  color: var(--p9ip-text);
  border: 1px solid rgba(154,111,46,0.2);
}
.p9ip-assistant-msg--ai {
  align-self: flex-start;
  background: var(--p9ip-bg-subtle);
  color: var(--p9ip-text-mid);
  border: 1px solid var(--p9ip-border);
  max-width: 96%;
}

/* ── Markdown rendering inside assistant replies (see mdToHtml() in JS) ── */
.p9ip-md-p { margin: 0 0 0.5rem; }
.p9ip-md-p:last-child { margin-bottom: 0; }
.p9ip-md-h {
  font-weight: 700;
  color: var(--p9ip-text);
  margin: 0.65rem 0 0.35rem;
}
.p9ip-md-h:first-child { margin-top: 0; }
.p9ip-assistant-msg--ai strong { color: var(--p9ip-text); }
.p9ip-assistant-msg--ai code {
  background: rgba(154,111,46,0.1);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  font-size: 0.82em;
}
.p9ip-md-hr { border: none; border-top: 1px solid var(--p9ip-border); margin: 0.6rem 0; }
.p9ip-md-list { margin: 0 0 0.5rem; padding-left: 1.1rem; }
.p9ip-md-list:last-child { margin-bottom: 0; }
.p9ip-md-list li { margin-bottom: 0.2rem; }
.p9ip-md-table-wrap { overflow-x: auto; margin: 0 0 0.5rem; max-width: 100%; }
.p9ip-md-table { border-collapse: collapse; font-size: 0.78rem; width: 100%; }
.p9ip-md-table th, .p9ip-md-table td {
  border: 1px solid var(--p9ip-border);
  padding: 0.3rem 0.5rem;
  text-align: left;
  white-space: nowrap;
}
.p9ip-md-table th { background: var(--p9ip-gold-light); color: var(--p9ip-text); font-weight: 600; }
#p9ip-assistant-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--p9ip-border);
  background: var(--p9ip-bg);
}
#p9ip-assistant-input-row input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  border: 1px solid var(--p9ip-border);
  border-radius: var(--p9ip-radius);
  background: var(--p9ip-bg);
  color: var(--p9ip-text);
}
#p9ip-assistant-input-row input:focus {
  outline: none;
  border-color: var(--p9ip-gold);
  box-shadow: 0 0 0 2px rgba(154,111,46,0.12);
}

/* ── Feature 4 — Re-Investment Signal Popover ────────────── */
.p9ip-reinvest-popover {
  position: relative;
  margin-top: 0.75rem;
  padding: 0.85rem 1rem;
  background: var(--p9ip-bg-warm);
  border: 1px solid var(--p9ip-border-md);
  border-radius: var(--p9ip-radius);
  box-shadow: var(--p9ip-shadow-md);
}
.p9ip-reinvest-tag {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--p9ip-gold);
  margin-bottom: 0.4rem;
}
.p9ip-reinvest-text {
  font-size: 0.85rem;
  color: var(--p9ip-text-mid);
  line-height: 1.55;
  margin: 0 0 0.75rem;
}
.p9ip-reinvest-none {
  font-size: 0.85rem;
  color: var(--p9ip-muted);
  margin: 0;
}
.p9ip-reinvest-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.p9ip-reinvest-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--p9ip-muted);
  line-height: 1;
}
.p9ip-reinvest-close:hover { color: var(--p9ip-text); }

/* ── Feature 5 — Investor Update Drafter Modal ───────────── */
.p9ip-draft-modal {
  position: fixed;
  inset: 0;
  background: rgba(26,24,20,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}
.p9ip-draft-modal-inner {
  background: var(--p9ip-bg);
  border: 1px solid var(--p9ip-border-md);
  border-radius: var(--p9ip-radius);
  box-shadow: var(--p9ip-shadow-md);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 1rem;
}
.p9ip-draft-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--p9ip-border);
  background: var(--p9ip-bg-subtle);
}
.p9ip-draft-modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  color: var(--p9ip-text);
}
.p9ip-draft-modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: var(--p9ip-muted);
}
.p9ip-draft-modal-close:hover { color: var(--p9ip-text); }
.p9ip-draft-modal-body {
  padding: 1.25rem;
}
.p9ip-draft-hint {
  font-size: 0.82rem;
  color: var(--p9ip-text-mid);
  margin: 0 0 0.85rem;
}
.p9ip-draft-modal-body label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--p9ip-text-mid);
  margin-bottom: 0.3rem;
}
.p9ip-draft-modal-body textarea {
  width: 100%;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  font-family: inherit;
  border: 1px solid var(--p9ip-border);
  border-radius: var(--p9ip-radius);
  background: var(--p9ip-bg);
  color: var(--p9ip-text);
  resize: vertical;
}
.p9ip-draft-modal-body textarea:focus {
  outline: none;
  border-color: var(--p9ip-gold);
  box-shadow: 0 0 0 2px rgba(154,111,46,0.12);
}
#p9ip-draft-result {
  padding: 0 1.25rem 1.25rem;
}
.p9ip-draft-field {
  margin-bottom: 0.75rem;
}
.p9ip-draft-field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--p9ip-text-mid);
  margin-bottom: 0.3rem;
}
.p9ip-draft-field input,
.p9ip-draft-field textarea {
  width: 100%;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  font-family: inherit;
  border: 1px solid var(--p9ip-border);
  border-radius: var(--p9ip-radius);
  background: var(--p9ip-bg-subtle);
  color: var(--p9ip-text);
  resize: vertical;
}
.p9ip-draft-copy-row {
  margin-top: 0.65rem;
  display: flex;
  justify-content: flex-end;
}

/* =========================================================
   PIPELINE DEAL PICKER  — shared cross-plugin styling
   ========================================================= */
.p9-deal-picker {
    display: block;
    width: 100%;
    margin-bottom: 0.65rem;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.82rem;
    color: var(--text, #2e2b26);
    background: #fff;
    border: 1px solid var(--border, rgba(154,111,46,0.25));
    border-radius: 3px;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239a6f2e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.1rem;
}
.p9-deal-picker:focus {
    outline: none;
    border-color: var(--accent, #9a6f2e);
    box-shadow: 0 0 0 2px rgba(154,111,46,0.15);
}

/* =========================================================
   CAPITAL STACK REFERENCE PANEL  (Connector 1)
   ========================================================= */

.p9ip-stack-panel {
    margin: 0 0 14px;
    border: 1px solid var(--p9ip-border);
    border-radius: var(--p9ip-radius);
    background: var(--p9ip-bg);
    overflow: hidden;
}

.p9ip-stack-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    background: #f7f8fa;
    transition: background 0.15s;
}
.p9ip-stack-header:hover { background: #eef0f4; }

.p9ip-stack-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--p9ip-muted);
    white-space: nowrap;
}

.p9ip-stack-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--p9ip-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.p9ip-stack-chevron {
    font-size: 10px;
    color: var(--p9ip-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.p9ip-stack-chevron--collapsed { transform: rotate(180deg); }

.p9ip-stack-body {
    padding: 14px 16px 16px;
    border-top: 1px solid var(--p9ip-border);
}

/* Two-column grid of key-value rows */
.p9ip-stack-rows {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
    margin-bottom: 14px;
}

.p9ip-stack-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12.5px;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.p9ip-stack-row-label {
    color: var(--p9ip-muted);
    padding-right: 8px;
}

.p9ip-stack-row-value {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--p9ip-text);
}

/* LP equity fundraising progress bar */
.p9ip-stack-progress-wrap {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.p9ip-stack-progress-bar {
    height: 100%;
    border-radius: 4px;
    min-width: 3px;
    transition: width 0.4s ease;
}

.p9ip-stack-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--p9ip-muted);
    gap: 12px;
}

.p9ip-stack-remain { color: var(--p9ip-gold); font-weight: 600; }
.p9ip-stack-full   { color: var(--p9ip-success, #2a9d5c); font-weight: 600; }

/* Stack picker note in deal form */
.p9ip-fld-note {
    margin: 4px 0 0;
    font-size: 11px;
    color: var(--p9ip-muted);
}

/* Stack picker select (reuse p9-deal-picker sizing) */
#p9ip-stack-select {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.82rem;
    color: var(--p9ip-text);
    background: #fff;
    border: 1px solid var(--p9ip-border);
    border-radius: var(--p9ip-radius);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239a6f2e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8rem center;
    padding-right: 2.1rem;
}

/* =========================================================
   ASSET MANAGER PROPERTY PANEL  (Connector 2)
   ========================================================= */

.p9ip-prop-panel {
    margin: 0 0 14px;
    border: 1px solid var(--p9ip-border);
    border-radius: var(--p9ip-radius);
    background: var(--p9ip-bg);
    overflow: hidden;
}

.p9ip-prop-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    cursor: pointer;
    user-select: none;
    background: #f7f8fa;
    transition: background 0.15s;
}
.p9ip-prop-header:hover { background: #eef0f4; }

.p9ip-prop-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--p9ip-muted);
    white-space: nowrap;
}

.p9ip-prop-name {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--p9ip-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.p9ip-prop-chevron {
    font-size: 10px;
    color: var(--p9ip-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.p9ip-prop-chevron--collapsed { transform: rotate(180deg); }

.p9ip-prop-body {
    padding: 14px 16px 16px;
    border-top: 1px solid var(--p9ip-border);
}

.p9ip-prop-rows {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 28px;
    margin-bottom: 12px;
}

.p9ip-prop-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 12.5px;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f0;
}

.p9ip-prop-row-label { color: var(--p9ip-muted); padding-right: 8px; }
.p9ip-prop-row-value { font-weight: 600; font-variant-numeric: tabular-nums; }

/* Occupancy bar inside property panel */
.p9ip-prop-occ-wrap {
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.p9ip-prop-occ-bar {
    height: 100%;
    border-radius: 3px;
    min-width: 2px;
    transition: width 0.4s ease;
}
