/* --- Analytics dashboard -------------------------------------------- */
/* KPI strip — single compact row for the fund detail one-pager.
   7 cards (Documents, Total committed, Avg. completion, Draft, In
   review, Ready for signature, Signed) — column count must match the
   card count or the last one wraps to a second line. */
.ds-analytics-page .ds-analytics-kpi-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.ds-analytics-page .ds-analytics-kpi-row .ds-kpi-card {
  padding: 5px 6px;
  gap: 1px;
  border-radius: 8px;
  min-width: 0;
}
.ds-analytics-page .ds-analytics-kpi-row .ds-kpi-header {
  gap: 4px;
  min-width: 0;
}
.ds-analytics-page .ds-analytics-kpi-row .ds-kpi-icon {
  font-size: var(--ds-text-small);
}
.ds-analytics-page .ds-analytics-kpi-row .ds-kpi-label {
  font-size: 0.7rem;
  letter-spacing: var(--ds-tracking-caps);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-analytics-page .ds-analytics-kpi-row .ds-kpi-value {
  font-size: var(--ds-text-small);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-analytics-page .ds-analytics-export-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  overflow-y: auto;
  padding: 2px 0;
}
.ds-analytics-page .ds-analytics-export-columns {
  max-height: 140px;
  column-count: 2;
  column-gap: 24px;
}
/* Compact filter toolbar — chip filters + export. */
.ds-analytics-filter-label {
  font-size: var(--ds-text-small);
  font-weight: var(--ds-weight-bold);
  letter-spacing: var(--ds-tracking-caps);
  text-transform: uppercase;
  color: var(--ds-ink-muted);
  white-space: nowrap;
}
.ds-analytics-filter-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.ds-analytics-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--ds-parchment-shadow);
  border-radius: 8px;
  /* Child menu z-index only competes inside this stacking context. */
  position: relative;
  z-index: 40;
  overflow: visible;
}
/* While a chip menu is open, lift the whole toolbar above page chrome
   (sidebar 1030, assistant 1042, doc overlays 2000, Bootstrap modals). */
.ds-analytics-toolbar:focus-within,
.ds-analytics-toolbar:has(.Select-menu-outer),
.ds-analytics-toolbar:has(.Select.is-open),
.ds-analytics-toolbar:has(div[class$="-menu"]:not(.Select-menu)) {
  z-index: 10050;
}
.ds-analytics-toolbar--subdoc {
  padding: 8px 12px;
}

/* Filter chip — placeholder is the filter name; fills navy when set. */
.ds-analytics-filter-chip {
  --ds-filter-chip-fg: var(--color-navy);
  --ds-filter-chip-bg: var(--color-white);
  --ds-filter-chip-border: var(--color-navy);
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  width: max-content;
  max-width: 100%;
  min-height: 32px;
  border: 1px solid var(--ds-filter-chip-border);
  border-radius: 999px;
  background: var(--ds-filter-chip-bg);
  overflow: visible;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  cursor: pointer;
}
.ds-analytics-filter-chip:focus-within,
.ds-analytics-filter-chip:has(.Select-menu-outer),
.ds-analytics-filter-chip:has(.Select.is-open),
.ds-analytics-filter-chip:has(div[class$="-menu"]:not(.Select-menu)) {
  z-index: 1;
}
.ds-analytics-filter-chip.is-active,
.ds-analytics-filter-chip:has(.Select-value-label),
.ds-analytics-filter-chip:has(.Select-value),
.ds-analytics-filter-chip:has(div[class*="-singleValue"]),
.ds-analytics-investor-dropdown.is-active {
  --ds-filter-chip-fg: var(--color-white);
  --ds-filter-chip-bg: var(--color-navy);
  --ds-filter-chip-border: var(--color-navy);
}
/* Filled chip — explicit white on the control label (never the list). */
.ds-analytics-filter-chip.is-active .Select-value,
.ds-analytics-filter-chip.is-active .Select-value-label,
.ds-analytics-filter-chip.is-active div[class*="-singleValue"],
.ds-analytics-filter-chip:has(.Select-value) .Select-value,
.ds-analytics-filter-chip:has(.Select-value) .Select-value-label,
.ds-analytics-filter-chip:has(div[class*="-singleValue"]) div[class*="-singleValue"],
.ds-analytics-filter-chip.is-active .Select-input > input,
.ds-analytics-filter-chip:has(.Select-value) .Select-input > input,
.ds-analytics-filter-chip:has(div[class*="-singleValue"]) div[class*="-Input"] input,
.ds-analytics-investor-dropdown.is-active .ds-analytics-filter-chip-summary {
  color: var(--color-white) !important;
}
.ds-analytics-filter-chip.is-disabled {
  --ds-filter-chip-fg: var(--ds-ink-muted);
  --ds-filter-chip-border: var(--ds-parchment-shadow);
  opacity: 0.65;
  cursor: not-allowed;
}
.ds-analytics-filter-chip.ds-analytics-status-dropdown,
.ds-analytics-filter-chip.ds-analytics-status-dropdown .ds-analytics-filter-chip-select {
  min-width: 11rem; /* fits "Filled — in review" + chevron */
  flex: 0 0 auto;
}
.ds-analytics-filter-chip.ds-analytics-fund-chip,
.ds-analytics-filter-chip.ds-analytics-fund-chip .ds-analytics-filter-chip-select {
  min-width: 7.5rem; /* fits "Fund" + chevron */
  flex: 0 0 auto;
}
.ds-analytics-filter-chip.ds-analytics-subdoc-dropdown,
.ds-analytics-filter-chip.ds-analytics-subdoc-dropdown .ds-analytics-filter-chip-select {
  min-width: 13.5rem; /* fits "Document type" + chevron */
  flex: 0 0 auto;
}
.ds-analytics-filter-chip.ds-analytics-investor-dropdown,
.ds-analytics-filter-chip.ds-analytics-investor-dropdown .ds-analytics-filter-chip-select {
  min-width: 9rem; /* fits "Investors" + chevron */
  flex: 0 0 auto;
}
/* Multi-select — hide react-select's per-item tags and show a single
   "N investors" summary label instead, keeping the compact pill height. */
.ds-analytics-investor-dropdown .Select-value,
.ds-analytics-investor-dropdown div[class*="-multiValue"] {
  display: none !important;
}
/* In-flow sizer reserves width for long investor summary labels. */
.ds-analytics-filter-chip-summary-sizer {
  display: block;
  height: 0;
  overflow: hidden;
  visibility: hidden;
  white-space: nowrap;
  padding-left: 10px;
  padding-right: 28px;
  font-size: var(--ds-text-small);
  font-weight: var(--ds-weight-bold);
  letter-spacing: var(--ds-tracking-tight);
}
.ds-analytics-investor-dropdown:has(.ds-analytics-filter-chip-summary-sizer) {
  position: relative;
}
.ds-analytics-investor-dropdown:has(.ds-analytics-filter-chip-summary-sizer)
  .ds-analytics-filter-chip-select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ds-analytics-filter-chip-summary {
  position: absolute;
  left: 10px;
  right: 26px;
  top: 0;
  line-height: 30px;
  font-size: var(--ds-text-small);
  font-weight: var(--ds-weight-bold);
  letter-spacing: var(--ds-tracking-tight);
  color: var(--ds-filter-chip-fg);
  white-space: nowrap;
  overflow: visible;
  pointer-events: none;
}
.ds-analytics-investor-dropdown:has(.ds-analytics-filter-chip-summary) .Select-placeholder,
.ds-analytics-investor-dropdown:has(.ds-analytics-filter-chip-summary) div[class*="-placeholder"] {
  opacity: 0 !important;
}
.ds-analytics-filter-chip-select {
  position: relative;
  width: max-content;
  min-width: 100%;
  height: auto;
  flex: 0 0 auto;
  overflow: visible;
}
.ds-analytics-filter-chip-select > div,
.ds-analytics-filter-chip-select .Select {
  width: auto !important;
  min-width: 100% !important;
  height: auto !important;
  min-height: 100% !important;
  overflow: visible !important;
}
.ds-analytics-filter-chip .Select-control,
.ds-analytics-filter-chip div[class*="-control"] {
  width: auto !important;
  min-width: 100%;
  min-height: 100% !important;
  height: auto !important;
  border: none !important;
  border-radius: 999px !important;
  background: transparent !important;
  box-shadow: none !important;
  cursor: pointer;
}
.ds-analytics-filter-chip .Select-control:hover,
.ds-analytics-filter-chip div[class*="-control"]:hover {
  border: none !important;
  box-shadow: none !important;
}
.ds-analytics-filter-chip .is-focused > .Select-control,
.ds-analytics-filter-chip .Select-control.is-focused,
.ds-analytics-filter-chip div[class*="-control"][class*="-focused"],
.ds-analytics-filter-chip div[class*="-control"]:focus-within {
  border: none !important;
  box-shadow: none !important;
}
.ds-analytics-filter-chip .Select-value,
.ds-analytics-filter-chip .Select-placeholder,
.ds-analytics-filter-chip div[class*="-singleValue"],
.ds-analytics-filter-chip div[class*="-placeholder"] {
  color: var(--ds-filter-chip-fg) !important;
  font-size: var(--ds-text-small) !important;
  font-weight: var(--ds-weight-bold) !important;
  letter-spacing: var(--ds-tracking-tight);
  margin: 0 !important;
  line-height: 28px !important;
  white-space: nowrap;
}
.ds-analytics-filter-chip .Select-placeholder,
.ds-analytics-filter-chip div[class*="-placeholder"] {
  text-transform: none;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.ds-analytics-filter-chip .Select-value,
.ds-analytics-filter-chip div[class*="-singleValue"] {
  position: relative !important;
  top: auto !important;
  transform: none !important;
  max-width: none !important;
  overflow: visible;
  text-overflow: clip;
}
.ds-analytics-filter-chip .Select-value-label {
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
.ds-analytics-filter-chip .Select-value-wrapper,
.ds-analytics-filter-chip div[class*="-ValueContainer"] {
  width: auto !important;
  max-width: none !important;
  overflow: visible;
  flex-wrap: nowrap;
  padding-left: 10px !important;
  padding-right: 2px !important;
}
/* Keep the search field usable for partial-string filtering. */
.ds-analytics-filter-chip .Select-input,
.ds-analytics-filter-chip div[class*="-Input"] {
  margin: 0 !important;
  padding: 0 !important;
  opacity: 1 !important;
}
.ds-analytics-filter-chip .Select-input > input,
.ds-analytics-filter-chip div[class*="-Input"] input {
  color: var(--ds-filter-chip-fg) !important;
  opacity: 1 !important;
  cursor: text;
}
.ds-analytics-filter-chip .Select-arrow-zone,
.ds-analytics-filter-chip .Select-clear-zone,
.ds-analytics-filter-chip div[class*="-indicatorContainer"] {
  padding: 0 6px !important;
  color: var(--ds-filter-chip-fg) !important;
}
.ds-analytics-filter-chip .Select-arrow {
  border-color: var(--ds-filter-chip-fg) transparent transparent !important;
}
.ds-analytics-filter-chip div[class*="-indicatorSeparator"] {
  display: none !important;
}
.ds-analytics-filter-chip svg {
  fill: var(--ds-filter-chip-fg) !important;
  stroke: var(--ds-filter-chip-fg) !important;
}
/* Clear (X) — white on the filled navy chip. */
.ds-analytics-filter-chip.is-active .Select-clear,
.ds-analytics-filter-chip:has(.Select-value) .Select-clear,
.ds-analytics-filter-chip:has(div[class*="-singleValue"]) .Select-clear,
.ds-analytics-filter-chip.is-active div[class*="-clearIndicator"] svg,
.ds-analytics-filter-chip:has(.Select-value) div[class*="-clearIndicator"] svg,
.ds-analytics-filter-chip:has(div[class*="-singleValue"]) div[class*="-clearIndicator"] svg {
  fill: var(--color-white) !important;
  stroke: var(--color-white) !important;
  color: var(--color-white) !important;
}
.ds-analytics-filter-chip .Select-clear,
.ds-analytics-filter-chip div[class*="-clearIndicator"] {
  cursor: pointer;
}
.ds-analytics-filter-chip .Select-clear:hover,
.ds-analytics-filter-chip div[class*="-clearIndicator"]:hover {
  opacity: 0.85;
}
/* Outer dropdown shell — one box only (not MenuList / inner Select-menu). */
.ds-analytics-filter-chip .Select-menu-outer,
.ds-analytics-filter-chip div[class$="-menu"]:not(.Select-menu) {
  position: absolute !important;
  /* Anchor to the chip's own left edge, directly beneath it — the menu
     may be wider than the pill, but it never drifts away from the chip
     that opened it. */
  top: 100% !important;
  left: 0 !important;
  right: auto !important;
  margin-top: 4px;
  min-width: max(100%, 16rem);
  width: max-content;
  max-width: min(520px, 92vw);
  background: var(--color-white) !important;
  border: 1px solid var(--ds-parchment-shadow) !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12) !important;
  overflow: hidden;
  z-index: 10050 !important;
  color: var(--ds-ink) !important;
}
/* Inner scroll list — white fill, no second chrome box. */
.ds-analytics-filter-chip .Select-menu-outer > .Select-menu,
.ds-analytics-filter-chip .Select-menu,
.ds-analytics-filter-chip div[class$="-menuList"],
.ds-analytics-filter-chip div[class*="MenuList"] {
  background: var(--color-white) !important;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  color: var(--ds-ink) !important;
}
.ds-analytics-filter-chip .Select-option,
.ds-analytics-filter-chip div[class*="-option"],
.ds-analytics-filter-chip .Select-menu-outer [role="option"],
.ds-analytics-filter-chip .Select-menu [role="option"],
.ds-analytics-filter-chip div[class$="-menuList"] [role="option"] {
  font-size: var(--ds-text-small) !important;
  color: var(--ds-ink) !important;
  font-weight: var(--ds-weight-regular) !important;
  background: var(--color-white) !important;
  white-space: normal;
  word-break: break-word;
}
.ds-analytics-filter-chip .Select-option.is-focused,
.ds-analytics-filter-chip .Select-option:hover,
.ds-analytics-filter-chip div[class*="-option"]:hover,
.ds-analytics-filter-chip div[class*="-option"][class*="-focused"],
.ds-analytics-filter-chip .Select-menu-outer [role="option"]:hover,
.ds-analytics-filter-chip .Select-menu [role="option"]:hover,
.ds-analytics-filter-chip div[class$="-menuList"] [role="option"]:hover {
  background: color-mix(in srgb, var(--color-navy) 8%, var(--color-white)) !important;
  color: var(--ds-ink) !important;
  font-weight: var(--ds-weight-regular) !important;
}
/* Selected option — same ink color/weight as siblings; only the tint
   marks it so the list never "jumps" when a chip already has a value. */
.ds-analytics-filter-chip .Select-option.is-selected,
.ds-analytics-filter-chip div[class*="-option"][class*="-selected"],
.ds-analytics-filter-chip div[class*="-option"][aria-selected="true"],
.ds-analytics-filter-chip .Select-menu-outer [role="option"][aria-selected="true"] {
  background: color-mix(in srgb, var(--color-navy) 8%, var(--color-white)) !important;
  color: var(--ds-ink) !important;
  font-weight: var(--ds-weight-regular) !important;
}

.ds-analytics-status-dropdown {
  min-width: 11rem;
  flex: 0 0 auto;
}
.ds-analytics-subdoc-dropdown {
  min-width: 13.5rem;
  flex: 0 0 auto;
}
.ds-analytics-doc-card .card-body {
  padding: 12px 14px;
}
.ds-analytics-page .ds-analytics-data-table-wrap {
  max-height: min(52vh, 520px);
  overflow: auto;
  border: 1px solid var(--ds-parchment-shadow);
  border-radius: 8px;
}
.ds-analytics-page .ds-analytics-data-table {
  font-size: var(--ds-text-small);
}
.ds-analytics-page .ds-analytics-data-table thead th {
  position: sticky;
  top: 0;
  background: var(--ds-parchment-mid);
  z-index: 1;
  white-space: nowrap;
}
.ds-analytics-page .ds-analytics-export-card .card-body {
  padding: 12px 14px;
}

/* Document / inline links — navy ink, not Bootstrap's default blue. */
.ds-analytics-page a:not(.btn):not(.ds-sidebar-nav-item),
.ds-analytics-fund-section a:not(.btn),
.ds-analytics-page .ds-analytics-doc-link,
.ds-analytics-fund-section .ds-analytics-doc-link {
  color: var(--ds-mahogany-deep) !important;
}
.ds-analytics-page a:not(.btn):not(.ds-sidebar-nav-item):hover,
.ds-analytics-page a:not(.btn):not(.ds-sidebar-nav-item):focus,
.ds-analytics-fund-section a:not(.btn):hover,
.ds-analytics-fund-section a:not(.btn):focus,
.ds-analytics-page .ds-analytics-doc-link:hover,
.ds-analytics-page .ds-analytics-doc-link:focus,
.ds-analytics-fund-section .ds-analytics-doc-link:hover,
.ds-analytics-fund-section .ds-analytics-doc-link:focus {
  color: var(--color-navy) !important;
}

/* Checkboxes / radios — brand accent instead of Bootstrap blue. */
.ds-analytics-page .form-check-input:checked,
.ds-analytics-fund-section .form-check-input:checked {
  background-color: var(--color-navy);
  border-color: var(--color-navy);
}
.ds-analytics-page .form-check-input:focus,
.ds-analytics-fund-section .form-check-input:focus {
  border-color: var(--color-navy);
  box-shadow: 0 0 0 0.2rem var(--ds-focus-ring);
}

.ds-analytics-page .ds-fund-graph-wrap {
  margin-bottom: 0.25rem;
  overflow: hidden;
}
@media (max-width: 1100px) {
  .ds-analytics-page .ds-analytics-kpi-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ds-kpi-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.ds-kpi-card {
  background: #fff;
  border: 1px solid var(--ds-parchment-shadow);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ds-kpi-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ds-kpi-icon {
  font-size: var(--ds-text-body);
}
.ds-kpi-label {
  font-size: var(--ds-text-small);
  font-weight: var(--ds-weight-bold);
  letter-spacing: var(--ds-tracking-caps);
  text-transform: uppercase;
  color: var(--ds-ink-muted);
}
.ds-kpi-value {
  font-size: var(--ds-text-large);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-ink);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
@media (max-width: 900px) {
  .ds-kpi-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Aggregate cards: two-column grid of per-field cards with bars. */
.ds-aggregate-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (max-width: 900px) {
  .ds-aggregate-grid {
    grid-template-columns: 1fr;
  }
}
.ds-agg-card {
  background: #fff;
  border: 1px solid var(--ds-parchment-shadow);
  border-radius: 10px;
  padding: 14px 16px;
}
.ds-agg-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ds-parchment-shadow);
}
.ds-agg-label {
  font-weight: var(--ds-weight-bold);
  font-size: var(--ds-text-body);
  color: var(--ds-ink);
  word-break: break-word;
}
.ds-agg-meta {
  white-space: nowrap;
}
.ds-agg-bar {
  margin-bottom: 8px;
}
.ds-agg-bar:last-child {
  margin-bottom: 0;
}
.ds-agg-bar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
  font-size: var(--ds-text-small);
}
.ds-agg-bucket {
  font-weight: var(--ds-weight-regular);
  color: var(--ds-ink);
}
.ds-agg-count {
  color: var(--ds-ink-muted);
  font-variant-numeric: tabular-nums;
}
.ds-agg-bar-track {
  background: var(--ds-parchment-mid);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}
.ds-agg-bar-fill {
  height: 100%;
  background: linear-gradient(90deg,
    var(--ds-brass) 0%, var(--ds-leather) 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.ds-agg-text-item {
  padding: 6px 0;
  border-bottom: 1px solid var(--ds-parchment-shadow);
}
.ds-agg-text-item:last-child {
  border-bottom: none;
}
.ds-agg-text-val {
  color: var(--ds-ink);
  font-size: var(--ds-text-small);
}
.ds-agg-text-doc {
  margin-top: 2px;
}

/* --- Analytics — chart / bubble selection colors -------------------- */
:root {
  --ds-analytics-select: var(--ds-brass);
  --ds-analytics-select-ring: rgba(255, 100, 108, 0.45);
}

/* Fund bubbles use flex wrap until physics runs; no hide-on-load flash. */
.ds-bubble-row-bubbles.ds-fund-bubble-grid.is-physics-ready {
  transition: height 0.22s ease;
}

/* Viewport hosts zoom/pan; the grid itself is transformed inside it. */
.ds-fund-bubble-viewport {
  position: relative;
  overflow: hidden;
  min-height: 160px;
  touch-action: none;
  cursor: grab;
}
.ds-fund-bubble-viewport.is-panning {
  cursor: grabbing;
}
.ds-fund-bubble-viewport.is-dragging-bubble {
  cursor: grabbing;
}
.ds-fund-bubble-viewport.is-zoomed {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

/* Fund picker — soft physics layout (positions set in clientside.js). */
.ds-bubble-row-bubbles.ds-fund-bubble-grid.is-physics {
  position: relative;
  display: block;
  overflow: visible;
  min-height: 160px;
  padding: 8px 4px;
  gap: 0;
  will-change: transform;
}
.ds-bubble-row-bubbles.ds-fund-bubble-grid.is-physics .ds-fund-bubble {
  position: absolute;
  left: 0;
  top: 0;
  width: auto;
  margin: 0;
  will-change: transform;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: auto;
}
.ds-bubble-row-bubbles.ds-fund-bubble-grid.is-physics .ds-fund-bubble * {
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}
.ds-bubble-row-bubbles.ds-fund-bubble-grid.is-physics .ds-fund-bubble.is-dragging {
  cursor: grabbing;
  z-index: 5;
}
.ds-bubble-row-bubbles.ds-fund-bubble-grid.is-physics .ds-fund-bubble-circle {
  transition: box-shadow 0.18s ease, filter 0.18s ease;
}
.ds-bubble-row-bubbles.ds-fund-bubble-grid.is-physics .ds-fund-bubble.is-dragging .ds-fund-bubble-circle {
  transform: scale(1.08);
  filter: brightness(1.06);
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.28),
    inset 0 -6px 14px rgba(0, 0, 0, 0.12),
    inset 0 4px 10px rgba(255, 255, 255, 0.28);
  transition: none;
}
.ds-bubble-row-bubbles.ds-fund-bubble-grid.is-physics .ds-fund-bubble.is-dragging:hover .ds-fund-bubble-circle,
.ds-bubble-row-bubbles.ds-fund-bubble-grid.is-physics .ds-fund-bubble.is-dragging .ds-fund-bubble-circle {
  transform: scale(1.08);
}
.ds-bubble-row-bubbles.ds-fund-bubble-grid.is-physics .ds-fund-bubble:hover .ds-fund-bubble-circle {
  /* Keep hover lift on the circle only — never fight the bubble translate. */
  transform: translateY(-2px) scale(1.04);
}

.ds-fund-bubble-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  padding: 10px;
  text-align: center;
  box-shadow:
    0 4px 14px rgba(15, 23, 42, 0.18),
    inset 0 -6px 14px rgba(0, 0, 0, 0.12),
    inset 0 4px 10px rgba(255, 255, 255, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.ds-fund-bubble-label {
  font-size: var(--ds-text-small);
  font-weight: var(--ds-weight-bold);
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}
.ds-fund-bubble:hover .ds-fund-bubble-circle {
  transform: translateY(-2px) scale(1.04);
  filter: brightness(1.04);
}
.ds-fund-bubble.is-selected .ds-fund-bubble-circle {
  box-shadow:
    0 0 0 3px var(--ds-analytics-select-ring),
    0 8px 22px rgba(15, 23, 42, 0.24),
    inset 0 -6px 14px rgba(0, 0, 0, 0.10),
    inset 0 4px 10px rgba(255, 255, 255, 0.30);
}
.ds-fund-bubble.is-selected .ds-bubble-caption {
  color: var(--ds-analytics-select);
  font-weight: var(--ds-weight-bold);
}

.ds-fund-bubble-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.ds-fund-bubble-circle-hero {
  width: 148px;
  height: 148px;
}
.ds-fund-bubble-label-hero {
  font-size: var(--ds-text-large);
  -webkit-line-clamp: 4;
}
.ds-fund-bubble-hero-meta {
  letter-spacing: 0.02em;
}

/* --- Analytics 2 — bubble matrix ------------------------------------ */
/* One row per fund. Bubbles inside each row are circular buttons sized
   by document count. Whole row is on a soft surface so the bubbles
   feel like they're floating on a fund's own canvas. */
.ds-bubble-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ds-bubble-fund-row {
  background: #fff;
  border: 1px solid var(--ds-parchment-shadow);
  border-radius: 12px;
  padding: 14px 18px 18px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: box-shadow 0.2s ease;
}
.ds-bubble-fund-row:hover {
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.ds-bubble-fund-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--ds-parchment-shadow);
}
.ds-bubble-fund-title {
  display: flex;
  align-items: center;
}
.ds-bubble-fund-name {
  font-size: var(--ds-text-large);
  font-weight: var(--ds-weight-bold);
  color: var(--ds-mahogany-deep);
  letter-spacing: 0.01em;
}
.ds-bubble-fund-count {
  font-variant-numeric: tabular-nums;
}

.ds-bubble-row-bubbles {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px 22px;
  min-height: 150px;
  padding-top: 6px;
  padding-bottom: 6px;
}

/* The outer button is a transparent column container: circle on top,
   always-visible caption underneath. This guarantees the status name
   stays readable no matter how small the bubble itself becomes. */
.ds-bubble {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--ds-ink);
  outline: none;
  width: 110px;     /* fixed column width so captions line up tidily */
  text-align: center;
}

/* The circle owns the colour, size, and shadow. Sized inline by the
   renderer (width / height in px) — everything else is here. */
.ds-bubble-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  box-shadow:
    0 4px 14px rgba(15, 23, 42, 0.18),
    inset 0 -6px 14px rgba(0, 0, 0, 0.12),
    inset 0 4px 10px rgba(255, 255, 255, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.ds-bubble:hover .ds-bubble-circle {
  transform: translateY(-2px) scale(1.04);
  box-shadow:
    0 8px 22px rgba(15, 23, 42, 0.24),
    inset 0 -6px 14px rgba(0, 0, 0, 0.10),
    inset 0 4px 10px rgba(255, 255, 255, 0.30);
  filter: brightness(1.04);
}
.ds-bubble:focus-visible .ds-bubble-circle {
  box-shadow:
    0 0 0 3px var(--ds-analytics-select-ring),
    0 4px 14px rgba(15, 23, 42, 0.18);
}
.ds-bubble.is-selected .ds-bubble-circle {
  box-shadow:
    0 0 0 3px var(--ds-analytics-select-ring),
    0 8px 22px rgba(15, 23, 42, 0.24),
    inset 0 -6px 14px rgba(0, 0, 0, 0.10),
    inset 0 4px 10px rgba(255, 255, 255, 0.30);
}
.ds-bubble.is-selected .ds-bubble-caption {
  color: var(--ds-analytics-select);
  font-weight: var(--ds-weight-bold);
}
.ds-bubble-count {
  font-size: var(--ds-text-large);
  font-weight: var(--ds-weight-bold);
  line-height: 1;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
  font-variant-numeric: tabular-nums;
}

/* Caption sits below the circle and is always rendered, regardless
   of bubble diameter. We allow up to two lines so longer labels like
   "Filled — in review" never get ellipsed. */
.ds-bubble-caption {
  font-size: var(--ds-text-small);
  font-weight: var(--ds-weight-bold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ds-ink-muted);
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  max-width: 100%;
}
.ds-bubble:hover .ds-bubble-caption {
  color: var(--ds-ink);
}

/* Legend strip below the page hint. */
.ds-bubble-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
}
.ds-bubble-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ds-bubble-legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.18);
}
.ds-bubble-legend-text {
  color: var(--ds-ink-muted);
  letter-spacing: 0.01em;
}

/* Detail panel — fills when a bubble is clicked. */
.ds-bubble-detail {
  margin-top: 18px;
  background: #fff;
  border: 1px solid var(--ds-parchment-shadow);
  border-radius: 10px;
  padding: 14px 16px;
  min-height: 60px;
}
.ds-bubble-detail-empty {
  padding: 6px 2px;
}
.ds-bubble-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--ds-parchment-shadow);
}
.ds-bubble-detail-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  box-shadow: inset 0 -2px 3px rgba(0, 0, 0, 0.18);
}

/* On narrow screens, let bubble columns shrink a bit so two fit
   side-by-side on phones. The captions still get up to two lines. */
@media (max-width: 700px) {
  .ds-bubble-fund-row {
    padding: 12px 14px;
  }
  .ds-bubble-row-bubbles {
    gap: 12px 14px;
    min-height: 120px;
  }
  .ds-bubble {
    width: 92px;
  }
}

/* Invite-accept page meta chips. Pills next to the welcome heading
 * that surface the new user's role + team + inviter as structured
 * data rather than plain "Role: X" lines. */
.ds-invite-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ds-invite-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(218, 165, 32, 0.10);
  border: 1px solid rgba(218, 165, 32, 0.28);
  color: var(--ds-ink);
  font-size: var(--ds-text-small);
  letter-spacing: 0.01em;
}

/* Analytics document-table notes cell: keep admin investor notes from
 * stretching the table. Truncate to one line with a tooltip (title attr)
 * carrying the full text. */
.ds-analytics-notes-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Inline notes editor in the admin Investors roster. Compact, grows on
 * focus so longer notes are comfortable to type. */
.ds-investor-notes-input {
  resize: vertical;
  min-height: 31px;
}

/* Click-to-edit notes: read-only one-line preview in the roster cell.
 * Truncates with an ellipsis and reads as clickable; the popover editor
 * opens on click. Keeps the table a scannable list, not a form. */
.ds-notes-display {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  margin: -2px -6px;
}
.ds-notes-display:hover {
  background: var(--ds-surface-2, #f1f5f9);
}
.ds-notes-popover {
  max-width: 320px;
}
.ds-notes-popover .popover-body {
  min-width: 240px;
}

/* Banner noting the active sub-document slice above the KPIs. */
.ds-analytics-slice-note {
  color: var(--ds-ink-muted);
}

/* ====================================================================
 * Fund → sub-document radial graph (analytics fund chooser)
 * Selected fund node sits at the centre; its template nodes pop off
 * around it, joined by rotated-bar CSS edges. Nodes are buttons that
 * drive the dashboard slice.
 * ==================================================================== */
.ds-fund-graph-wrap {
  overflow-x: auto;
  display: flex;
  justify-content: center;
}
.ds-fund-graph {
  position: relative;
  flex: 0 0 auto;
  margin: 0 auto;
}
.ds-fund-graph.is-graph-pending .ds-fund-graph-center,
.ds-fund-graph.is-graph-pending .ds-fund-graph-leaf,
.ds-fund-graph.is-graph-pending .ds-fund-graph-edge {
  opacity: 0;
}
.ds-fund-graph.is-graph-ready .ds-fund-graph-center,
.ds-fund-graph.is-graph-ready .ds-fund-graph-leaf,
.ds-fund-graph.is-graph-ready .ds-fund-graph-edge {
  opacity: 1;
  transition: opacity 0.22s ease;
}
.ds-fund-graph-edge {
  position: absolute;
  height: 2px;
  background: rgba(125, 91, 47, 0.35);
  transform-origin: 0 50%;
  z-index: 1;
}
.ds-fund-graph-edge.is-active {
  height: 3px;
  background: var(--ds-analytics-select);
  box-shadow: 0 0 6px var(--ds-focus-ring);
}
.ds-fund-graph-node {
  position: absolute;
  z-index: 2;
  border: 0;
  border-radius: 50%;
  padding: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ds-fund-graph-node:hover {
  transform: scale(1.06);
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22);
}
.ds-fund-graph-center {
  color: #fff;
  font-weight: var(--ds-weight-bold);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
}
.ds-fund-graph-center.is-selected {
  outline: 3px solid var(--ds-analytics-select);
  outline-offset: 3px;
  box-shadow:
    0 0 0 1px var(--ds-analytics-select-ring),
    0 5px 14px rgba(0, 0, 0, 0.22);
}
.ds-fund-graph-center-label {
  font-size: var(--ds-text-small);
  line-height: 1.1;
  padding: 0 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Sub-document leaves: circular bubbles sharing the fund node's coral
 * gradient (set inline). The active leaf gets the same ring as the
 * selected centre node. */
.ds-fund-graph-leaf {
  color: #fff;
  font-weight: var(--ds-weight-bold);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
  box-shadow:
    0 4px 14px rgba(15, 23, 42, 0.18),
    inset 0 -6px 14px rgba(0, 0, 0, 0.12),
    inset 0 4px 10px rgba(255, 255, 255, 0.25);
}
.ds-fund-graph-leaf:hover {
  transform: scale(1.06);
  filter: brightness(1.04);
  box-shadow:
    0 6px 18px rgba(15, 23, 42, 0.22),
    inset 0 -6px 14px rgba(0, 0, 0, 0.12),
    inset 0 4px 10px rgba(255, 255, 255, 0.25);
}
.ds-fund-graph-leaf.is-selected {
  outline: 3px solid var(--ds-analytics-select);
  outline-offset: 3px;
  box-shadow:
    0 0 0 1px var(--ds-analytics-select-ring),
    0 8px 22px rgba(15, 23, 42, 0.24),
    inset 0 -6px 14px rgba(0, 0, 0, 0.10),
    inset 0 4px 10px rgba(255, 255, 255, 0.30);
}
.ds-fund-graph-leaf-label {
  font-size: var(--ds-text-small);
  line-height: 1.06;
  max-width: 96px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Per-node metrics — document count + committed capital, shown on both
 * the centre (fund total) and leaf (per-template) nodes. */
.ds-fund-graph-node-count {
  font-size: var(--ds-text-small);
  opacity: 0.92;
  margin-top: 3px;
  line-height: 1;
}
.ds-fund-graph-node-committed {
  font-size: var(--ds-text-small);
  font-weight: var(--ds-weight-bold);
  margin-top: 2px;
  line-height: 1;
}
