/* Mercury Investment — scoped investor shell. */
.investor-shell {
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
  color: var(--mi-text);
  background: var(--mi-page-bg);
  font-family: var(--mi-font-sans);
  font-size: var(--mi-text-md);
}
.investor-shell,
.investor-shell button,
.investor-shell input,
.investor-shell select { font-family: var(--mi-font-sans); }
.investor-shell .ui-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.investor-shell .brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--mi-text);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.investor-shell .brand-lockup img { display: block; border-radius: 9px; }
body.sidebar-collapsed.investor-shell { grid-template-columns: 68px minmax(0, 1fr); }

/* Sidebar */
.investor-shell .cabinet-sidebar {
  z-index: 10;
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px 16px;
  gap: 20px;
  color: var(--mi-text-secondary);
  background: var(--mi-surface);
  border-right: 1px solid var(--mi-border);
  box-shadow: none;
}
.investor-shell .cabinet-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--mi-border);
}
.investor-shell .sidebar-toggle {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--mi-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--mi-radius-sm);
}
.investor-shell .sidebar-toggle:hover {
  color: var(--mi-accent);
  background: var(--mi-accent-soft);
}
.investor-shell .cabinet-sidebar-nav { gap: 4px; }
.investor-shell .cabinet-sidebar-nav a,
.investor-shell .cabinet-logout-btn {
  position: relative;
  min-height: 42px;
  padding: 10px 12px;
  justify-content: flex-start;
  gap: 11px;
  color: var(--mi-text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 550;
  line-height: 1.2;
}
.investor-shell .cabinet-sidebar-nav a:hover,
.investor-shell .cabinet-logout-btn:hover {
  color: var(--mi-text);
  background: #f7f8fb;
}
.investor-shell .cabinet-sidebar-nav a.is-active {
  color: var(--mi-accent);
  background: var(--mi-accent-soft);
  border-color: #e5e9ff;
  box-shadow: none;
}
.investor-shell .nav-icon { width: 18px; height: 18px; }
.investor-shell .cabinet-sidebar-footer {
  gap: 5px;
  padding-top: 14px;
  border-top: 1px solid var(--mi-border);
}
.investor-shell .cabinet-user {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0 4px 10px;
}
.investor-shell .cabinet-user-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: var(--mi-accent);
  background: var(--mi-accent-soft);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}
.investor-shell .cabinet-user-copy { display: flex; flex-direction: column; min-width: 0; }
.investor-shell .cabinet-user-name {
  overflow: hidden;
  color: var(--mi-text);
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.investor-shell .cabinet-user-email {
  overflow: hidden;
  color: var(--mi-text-subtle);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body.sidebar-collapsed.investor-shell .brand-full,
body.sidebar-collapsed.investor-shell .nav-text,
body.sidebar-collapsed.investor-shell .cabinet-user-copy { display: none; }
body.sidebar-collapsed.investor-shell .cabinet-sidebar { padding-inline: 9px; }
body.sidebar-collapsed.investor-shell .cabinet-sidebar-brand {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
body.sidebar-collapsed.investor-shell .cabinet-sidebar-brand .brand-lockup { display: inline-flex; }
body.sidebar-collapsed.investor-shell .sidebar-toggle svg { transform: rotate(180deg); }
body.sidebar-collapsed.investor-shell .cabinet-sidebar-nav a,
body.sidebar-collapsed.investor-shell .cabinet-logout-btn {
  justify-content: center;
  padding-inline: 0;
}
body.sidebar-collapsed.investor-shell .cabinet-user { justify-content: center; margin-inline: 0; }
body.sidebar-collapsed.investor-shell [data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 30;
  left: calc(100% + 10px);
  top: 50%;
  padding: 7px 9px;
  color: #fff;
  background: #172033;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(4px, -50%);
  transition: opacity .12s ease, transform .12s ease;
}
body.sidebar-collapsed.investor-shell [data-tooltip]:hover::after,
body.sidebar-collapsed.investor-shell [data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(0, -50%);
}

/* Header */
.investor-shell .cabinet-workspace { min-width: 0; }
.investor-shell .investor-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 28px;
  padding: 30px 40px 10px;
  color: var(--mi-text);
  background: var(--mi-page-bg);
  box-shadow: none;
}
.investor-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.investor-shell .investor-title h1 {
  color: var(--mi-text);
  font-size: var(--mi-text-xl);
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.15;
}
.investor-shell .investor-title p {
  margin-top: 6px;
  color: var(--mi-text-secondary);
  font-size: 13px;
}
.investor-shell .cabinet-kind {
  margin: 0;
  padding: 4px 9px;
  color: var(--mi-text-secondary);
  background: var(--mi-surface);
  border: 1px solid var(--mi-border);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  opacity: 1;
}
.investor-shell .cabinet-kind.viewed-as {
  color: var(--mi-warning);
  background: var(--mi-warning-soft);
  border-color: #f5ddb7;
  font-size: 11px;
}
.investor-shell .header-actions { display: flex; align-items: center; gap: 10px; }
.investor-shell .notification-wrap { position: relative; }
.investor-shell .notification-button,
.investor-shell .date-step,
.investor-shell .date-today {
  display: grid;
  place-items: center;
  height: var(--mi-control-height);
  min-width: var(--mi-control-height);
  padding: 0 10px;
  color: var(--mi-text-secondary);
  background: var(--mi-surface);
  border: 1px solid var(--mi-border);
  border-radius: 10px;
  box-shadow: var(--mi-shadow);
  cursor: pointer;
}
.investor-shell .notification-button:hover,
.investor-shell .date-step:hover,
.investor-shell .date-today:hover {
  color: var(--mi-accent);
  background: var(--mi-accent-soft);
  border-color: #dce2ff;
}
.investor-shell .date-control {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  background: var(--mi-surface);
  border: 1px solid var(--mi-border);
  border-radius: 12px;
  box-shadow: var(--mi-shadow);
}
.investor-shell .date-control .date-step {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  box-shadow: none;
}
.investor-shell .date-picker { display: flex; align-items: center; gap: 7px; padding-left: 7px; }
.investor-shell .date-picker span {
  color: var(--mi-text-subtle);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.investor-shell .date-input {
  width: 132px;
  height: 32px;
  padding: 0 4px;
  color: var(--mi-text);
  background: transparent;
  border: none;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
}
.investor-shell .date-today {
  display: block;
  min-width: auto;
  height: 32px;
  margin-left: 2px;
  padding-inline: 12px;
  color: var(--mi-accent);
  background: var(--mi-accent-soft);
  border: none;
  box-shadow: none;
  font-size: 12px;
  font-weight: 650;
}
.investor-shell .date-bar-hint {
  grid-column: 1 / -1;
  min-height: 18px;
  margin: -8px 0 0;
  color: var(--mi-text-subtle);
  font-size: 11px;
  text-align: right;
}
.notification-popover {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  display: flex;
  flex-direction: column;
  width: 238px;
  padding: 16px;
  color: var(--mi-text);
  background: var(--mi-surface);
  border: 1px solid var(--mi-border);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(16,24,40,.12);
}
.notification-popover strong { font-size: 13px; }
.notification-popover span { margin-top: 8px; color: var(--mi-text-secondary); font-size: 12px; }

/* Main and cards */
.investor-main {
  width: 100%;
  max-width: 1560px;
  margin: 0 auto;
  padding: 12px 40px 48px;
}
.investor-shell .dashboard-card,
.investor-shell .money-overview,
.investor-shell .collateral-block {
  color: var(--mi-text);
  background: var(--mi-surface);
  border: 1px solid var(--mi-border);
  border-radius: var(--mi-radius-lg);
  box-shadow: var(--mi-shadow);
}
.investor-shell .money-overview {
  margin: 0 0 16px;
  padding: 8px 12px;
}
.investor-shell .money-totals {
  display: grid;
  grid-template-columns: 1.25fr repeat(3, 1fr);
  gap: 0;
  margin: 0;
}
.investor-shell .money-card {
  min-width: 0;
  padding: 18px 22px 17px;
  color: var(--mi-text);
  background: transparent;
  border-radius: 0;
  text-align: left;
  backdrop-filter: none;
}
.investor-shell .money-card + .money-card { border-left: 1px solid var(--mi-border); }
.investor-shell .money-card .label {
  margin: 0 0 8px;
  color: var(--mi-text-secondary);
  font-size: 11px;
  font-weight: 620;
  letter-spacing: .045em;
  opacity: 1;
  text-transform: uppercase;
}
.investor-shell .money-card .value {
  overflow: hidden;
  color: var(--mi-text);
  font-size: 24px;
  font-weight: 670;
  letter-spacing: -.035em;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.investor-shell .money-card.total .value {
  color: var(--mi-text);
  font-size: var(--mi-text-display);
  font-weight: 710;
}
.investor-shell .money-card.profit .value { color: var(--mi-positive); }
.investor-shell .kpi-caption {
  margin-top: 6px;
  color: var(--mi-text-subtle);
  font-size: 11px;
}
.investor-shell .annual-line {
  margin: 0;
  padding: 10px 22px 7px;
  color: var(--mi-text-secondary);
  border-top: 1px solid var(--mi-border);
  font-size: 11px;
  line-height: 1.5;
  opacity: 1;
}
.investor-shell .annual-line:empty { display: none; }
.investor-shell .capital-note {
  margin: 8px 12px;
  color: var(--mi-warning);
  background: var(--mi-warning-soft);
  border: none;
  border-radius: 8px;
  font-size: 12px;
}
.fact-status {
  margin-bottom: 16px;
  padding: 10px 14px;
  color: var(--mi-text-secondary);
  background: var(--mi-surface);
  border: 1px solid var(--mi-border);
  border-radius: var(--mi-radius-md);
  font-size: 12px;
}
.dashboard-primary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 370px;
  align-items: start;
  gap: 16px;
}
.dashboard-left-stack,
.dashboard-side-stack { display: grid; align-content: start; gap: 16px; }
.investor-shell .dashboard-card { padding: 22px; }
.investor-shell .capital-chart-section,
.investor-shell .capital-schedule-section {
  margin: 0;
  padding: 22px;
}
.investor-shell .card-heading,
.investor-shell .section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}
.investor-shell .card-heading h2,
.investor-shell .section-head h2,
.investor-shell .capital-chart-section h2,
.investor-shell .capital-schedule-section h2 {
  margin: 2px 0 0;
  color: var(--mi-text);
  font-size: 17px;
  font-weight: 660;
  letter-spacing: -.02em;
}
.investor-shell .eyebrow {
  display: block;
  color: var(--mi-text-subtle);
  font-size: 10px;
  font-weight: 670;
  letter-spacing: .065em;
  text-transform: uppercase;
}
.investor-shell .chart-legend { display: flex; align-items: center; gap: 14px; font-size: 11px; }
.investor-shell .chart-legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--mi-text-secondary); }
.legend-line { display: inline-block; width: 20px; height: 0; border-top: 2px solid var(--mi-accent); }
.legend-line.forecast { border-top-style: dashed; opacity: .55; }
.investor-shell .capital-chart-host { min-height: 0; }
.investor-shell .chart-empty {
  min-height: 340px;
  display: grid;
  place-items: center;
  color: var(--mi-text-subtle);
  background: transparent;
  font-size: 13px;
}
.investor-shell .capital-chart { display: block; width: 100%; height: auto; }
.investor-shell .chart-stage { position: relative; width: 100%; }
.investor-shell .chart-grid { stroke: #edf0f5; stroke-width: 1; }
.investor-shell .chart-tick { fill: var(--mi-text-subtle); font-size: 10px; }
.investor-shell .capital-area-fact { fill: rgba(50,79,197,.075); }
.investor-shell .capital-area-forecast { fill: rgba(50,79,197,.03); }
.investor-shell .capital-line {
  fill: none;
  stroke: var(--mi-accent);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.investor-shell .capital-line.projected { stroke-dasharray: 6 6; opacity: .58; }
.investor-shell .capital-dot { fill: var(--mi-surface); stroke: var(--mi-accent); stroke-width: 1.8; }
.investor-shell .capital-dot.projected { opacity: .65; }
.investor-shell .capital-hit { fill: transparent; stroke: none; cursor: crosshair; }
.investor-shell .capital-hit:focus { outline: none; stroke: var(--mi-accent); stroke-width: 1; }
.investor-shell .chart-today { stroke: #cfd5e1; stroke-width: 1; stroke-dasharray: 3 4; }
.investor-shell .chart-today-label { fill: var(--mi-text-subtle); font-size: 10px; font-weight: 600; }
.investor-shell .capital-value {
  fill: var(--mi-text-secondary);
  stroke: var(--mi-surface);
  stroke-width: 4;
  paint-order: stroke;
  font-size: 10px;
  font-weight: 600;
}
.investor-shell .capital-value.last { fill: var(--mi-text); font-size: 12px; font-weight: 700; }
.chart-tooltip {
  position: absolute;
  z-index: 4;
  min-width: 154px;
  padding: 10px 12px;
  color: #fff;
  background: #172033;
  border-radius: 9px;
  box-shadow: 0 8px 18px rgba(16,24,40,.18);
  font-size: 11px;
  line-height: 1.45;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
}
.chart-tooltip strong { display: block; font-size: 13px; }
.chart-tooltip span { color: #cbd2df; }

/* Operational allocation */
.allocation-card { min-height: 290px; }
.allocation-content { min-height: 170px; }
.allocation-visual { display: flex; align-items: center; gap: 18px; }
.allocation-donut {
  position: relative;
  width: 124px;
  height: 124px;
  flex: 0 0 124px;
  border-radius: 50%;
}
.allocation-donut::after {
  content: "";
  position: absolute;
  inset: 18px;
  background: var(--mi-surface);
  border-radius: 50%;
}
.allocation-center {
  position: absolute;
  z-index: 2;
  inset: 24px;
  display: grid;
  place-content: center;
  text-align: center;
}
.allocation-center strong { font-size: 13px; letter-spacing: -.02em; }
.allocation-center span { color: var(--mi-text-subtle); font-size: 9px; text-transform: uppercase; }
.allocation-legend {
  display: grid;
  flex: 1;
  gap: 7px;
  min-width: 0;
  max-height: 170px;
  overflow: auto;
  padding-right: 3px;
}
.allocation-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 11px;
}
.allocation-swatch { width: 8px; height: 8px; border-radius: 3px; }
.allocation-name { color: var(--mi-text-secondary); line-height: 1.25; }
.allocation-value { grid-column: 2; color: var(--mi-text); font-weight: 620; white-space: nowrap; }
.allocation-value small { color: var(--mi-text-subtle); font-weight: 500; }
.allocation-note { margin-top: 14px; color: var(--mi-text-subtle); font-size: 10px; line-height: 1.45; }
.allocation-empty {
  min-height: 160px;
  display: grid;
  place-content: center;
  padding: 22px;
  color: var(--mi-text-secondary);
  background: #fafbfc;
  border: 1px dashed var(--mi-border-strong);
  border-radius: var(--mi-radius-md);
  text-align: center;
  font-size: 12px;
}

/* Forecast */
.forecast-tag {
  padding: 4px 8px;
  color: var(--mi-warning);
  background: var(--mi-warning-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.forecast-card .calc-controls {
  gap: 14px;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
}
.forecast-card .calc-label { color: var(--mi-text-secondary); font-size: 10px; letter-spacing: .055em; }
.forecast-card .calc-amount { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 9px; }
.forecast-card .calc-amount > .calc-label { grid-column: 1 / -1; }
.forecast-card .calc-stepper { grid-column: 1 / -1; width: 100%; }
.forecast-card .calc-stepper input {
  width: 100%;
  min-width: 0;
  height: 42px;
  color: var(--mi-text);
  border-color: var(--mi-border-strong);
  font-size: 17px;
  font-weight: 650;
}
.forecast-card .calc-step-btn {
  width: 42px;
  color: var(--mi-accent);
  border-color: var(--mi-border-strong);
  font-size: 19px;
}
.forecast-card .calc-step-btn:hover { background: var(--mi-accent-soft); color: var(--mi-accent); }
.forecast-card .calc-step-select { display: flex; align-items: center; color: var(--mi-text-subtle); font-size: 10px; }
.forecast-card .calc-step-select select,
.forecast-card .calc-field input {
  height: 36px;
  color: var(--mi-text);
  background: var(--mi-surface);
  border: 1px solid var(--mi-border);
  border-radius: 8px;
  font-size: 12px;
}
.forecast-card .calc-date { min-width: 130px; }
.forecast-card .calc-add-btn {
  height: 36px;
  padding: 0 12px;
  color: var(--mi-accent);
  background: var(--mi-accent-soft);
  border: 1px solid #dfe4ff;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 650;
}
.forecast-card .calc-add-btn:hover { background: #e4e9ff; }
.forecast-card .calc-injections { min-height: 18px; }
.forecast-card .calc-hint { color: var(--mi-text-subtle); font-size: 10px; }
.forecast-card .calc-chip {
  color: var(--mi-text-secondary);
  background: #f7f8fb;
  border-color: var(--mi-border);
  border-radius: 7px;
  font-size: 10px;
}
.forecast-card .calc-term { display: block; }
.forecast-card .calc-terms {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-top: 7px;
}
.forecast-card .calc-terms button {
  min-height: 36px;
  padding: 7px 5px;
  color: var(--mi-text-secondary);
  background: var(--mi-surface);
  border: 1px solid var(--mi-border);
  border-radius: 8px;
  font-size: 11px;
}
.forecast-card .calc-terms button[data-days="0"] { display: none; }
.forecast-card .calc-terms button.active {
  color: var(--mi-accent);
  background: var(--mi-accent-soft);
  border-color: #d9e0ff;
}
.forecast-card .calc-result { margin: 16px 0 0; }
.forecast-card .calc-result-line {
  padding: 12px 0 0;
  color: var(--mi-text-secondary);
  background: transparent;
  border: none;
  border-top: 1px solid var(--mi-border);
  border-radius: 0;
  font-size: 11px;
  line-height: 1.5;
}
.forecast-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.forecast-result-item {
  padding: 11px;
  background: #fafbfc;
  border: 1px solid var(--mi-border);
  border-radius: 10px;
}
.forecast-result-item span { display: block; color: var(--mi-text-subtle); font-size: 9px; text-transform: uppercase; }
.forecast-result-item strong { display: block; margin-top: 4px; color: var(--mi-text); font-size: 15px; }
.forecast-result-item.positive strong { color: var(--mi-positive); }
.forecast-card .calc-badge { margin-top: 9px; padding: 9px 10px; border: none; border-radius: 8px; font-size: 10px; }
.forecast-card .calc-badge.fact { color: var(--mi-positive); background: var(--mi-positive-soft); }
.forecast-card .calc-badge.hypothesis { color: var(--mi-warning); background: var(--mi-warning-soft); }
.forecast-card .passport-details { margin-top: 12px; }
.forecast-card .passport-details summary { color: var(--mi-text-secondary); font-size: 11px; }
.forecast-card .passport-details > div { color: var(--mi-text-secondary); font-size: 11px; }
.investor-shell .show-banner {
  margin: -4px 0 14px;
  padding: 10px 11px;
  border: none;
  border-radius: 9px;
  font-size: 10px;
}
.investor-shell .show-banner.live { color: var(--mi-warning); background: var(--mi-warning-soft); }
.investor-shell .show-banner.mine { color: var(--mi-accent); background: var(--mi-accent-soft); }
.forecast-card .calc-readonly .calc-controls { opacity: .55; }

/* Accruals and details */
.investor-shell .capital-schedule-section { margin: 0; }
.investor-shell .link-btn {
  padding: 7px 0;
  color: var(--mi-accent);
  font-size: 12px;
  font-weight: 620;
  text-decoration: none;
}
.recent-accruals {
  min-height: 162px;
  border-top: 1px solid var(--mi-border);
}
.accrual-skeleton {
  height: 54px;
  border-bottom: 1px solid var(--mi-border);
  background: linear-gradient(90deg, #fafbfc 25%, #f1f3f7 50%, #fafbfc 75%);
  background-size: 240px 100%;
}
.accrual-row {
  display: grid;
  grid-template-columns: minmax(120px, .7fr) minmax(180px, 1.5fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 54px;
  color: var(--mi-text-secondary);
  border-bottom: 1px solid var(--mi-border);
  font-size: 12px;
}
.accrual-row:last-child { border-bottom: none; }
.accrual-type { color: var(--mi-text); }
.accrual-amount { color: var(--mi-positive); font-weight: 660; text-align: right; white-space: nowrap; }
.investor-shell .capital-schedule-wrap {
  margin-top: 18px;
  overflow-x: auto;
  border-top: 1px solid var(--mi-border);
}
.investor-shell .capital-schedule-table { font-size: 11px; }
.investor-shell .capital-schedule-table th,
.investor-shell .capital-schedule-table td { padding: 10px 8px; border-color: var(--mi-border); }
.investor-shell .capital-schedule-table thead th { color: var(--mi-text-subtle); background: transparent; }
.investor-shell .collateral-block {
  margin: 16px 0 0;
  padding: 15px 20px;
}
.investor-shell .collateral-block > summary { color: var(--mi-text-secondary); font-size: 12px; }
.investor-shell .collateral-note { color: var(--mi-text-secondary); font-size: 11px; }
.investor-shell .collateral-lot { border-color: var(--mi-border); }
.investor-shell .collateral-lot-name { color: var(--mi-text); }
.investor-shell .progress-bar { background: #eef0f4; }
.investor-shell .progress-bar .fill { background: var(--mi-accent); }

/* Login and accessibility */
.investor-shell .login-overlay {
  background: linear-gradient(150deg, #f1f4ff, var(--mi-page-bg) 48%, #eef0f6);
}
.investor-shell .modal-overlay { background: rgba(23,32,51,.38); backdrop-filter: blur(3px); }
.investor-shell .login-card {
  max-width: 400px;
  padding: 30px;
  border: 1px solid var(--mi-border);
  border-radius: var(--mi-radius-lg);
  box-shadow: 0 20px 50px rgba(16,24,40,.15);
}
.investor-shell .login-card h2 { color: var(--mi-text); font-size: 22px; }
.investor-shell .login-help { color: var(--mi-text-secondary); border-color: var(--mi-border); }
.investor-shell :where(button, input, select, a, summary):focus-visible {
  outline: 3px solid rgba(50,79,197,.22);
  outline-offset: 2px;
}
.investor-shell button:disabled { cursor: not-allowed; }
.investor-shell .admin-toast { font-family: var(--mi-font-sans); }

/* Responsive */
@media (max-width: 1180px) {
  .investor-shell { grid-template-columns: 216px minmax(0, 1fr); }
  body.sidebar-collapsed.investor-shell { grid-template-columns: 68px minmax(0, 1fr); }
  .investor-shell .investor-header { padding-inline: 28px; }
  .investor-main { padding-inline: 28px; }
  .investor-shell .money-card { padding-inline: 16px; }
  .investor-shell .money-card .value { font-size: 21px; }
  .investor-shell .money-card.total .value { font-size: 29px; }
  .dashboard-primary-grid { display: flex; flex-direction: column; }
  .dashboard-left-stack { display: contents; }
  .capital-chart-section, .capital-schedule-section { width: 100%; }
  .capital-chart-section { order: 1; }
  .dashboard-side-stack { order: 2; width: 100%; align-items: start; grid-template-columns: minmax(280px, .85fr) minmax(360px, 1.15fr); }
  .capital-schedule-section { order: 3; }
}
@media (max-width: 880px) {
  .investor-shell .investor-header { grid-template-columns: 1fr; }
  .investor-shell .header-actions { justify-content: space-between; }
  .investor-shell .date-bar-hint { text-align: left; margin-top: -6px; }
  .investor-shell .money-totals { grid-template-columns: 1fr 1fr; }
  .investor-shell .money-card:nth-child(3) { border-left: none; border-top: 1px solid var(--mi-border); }
  .investor-shell .money-card:nth-child(4) { border-top: 1px solid var(--mi-border); }
  .dashboard-side-stack { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .investor-shell,
  body.sidebar-collapsed.investor-shell { display: block; }
  .investor-shell .cabinet-sidebar {
    position: static;
    height: auto;
    min-height: 64px;
    padding: 12px 18px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    border-right: none;
    border-bottom: 1px solid var(--mi-border);
  }
  .investor-shell .cabinet-sidebar-brand { min-height: auto; padding: 0; border: none; }
  .investor-shell .sidebar-toggle { display: none; }
  .investor-shell .cabinet-sidebar-nav { flex-direction: row; justify-content: flex-end; }
  .investor-shell .cabinet-sidebar-footer { padding: 0; border: none; flex-direction: row; }
  .investor-shell .cabinet-user,
  .investor-shell #btn-change-password { display: none; }
  .investor-shell .cabinet-logout-btn { width: 40px; padding: 0; justify-content: center; }
  .investor-shell .cabinet-logout-btn .nav-text { display: none; }
  .investor-shell .investor-header { padding: 24px 20px 8px; }
  .investor-main { padding: 12px 20px 36px; }
  body.sidebar-collapsed.investor-shell .cabinet-sidebar-brand .brand-lockup { display: inline-flex; }
}
@media (max-width: 600px) {
  .investor-shell .header-actions { align-items: flex-start; }
  .investor-shell .date-control { flex: 1; min-width: 0; }
  .investor-shell .date-picker { flex: 1; min-width: 0; }
  .investor-shell .date-input { width: 100%; min-width: 112px; }
  .investor-shell .money-totals { grid-template-columns: 1fr; }
  .investor-shell .money-card + .money-card { border-left: none; border-top: 1px solid var(--mi-border); }
  .investor-shell .capital-chart-host { min-height: 290px; }
  .investor-shell .chart-empty { min-height: 260px; }
  .allocation-visual { align-items: flex-start; }
  .allocation-donut { width: 108px; height: 108px; flex-basis: 108px; }
  .accrual-row { grid-template-columns: 1fr auto; gap: 4px 14px; padding: 10px 0; }
  .accrual-type { grid-column: 1; }
  .accrual-amount { grid-column: 2; grid-row: 1 / 3; }
}
@media (max-width: 420px) {
  .investor-shell .cabinet-sidebar { padding-inline: 12px; }
  .investor-shell .cabinet-sidebar-nav a { padding-inline: 9px; }
  .investor-shell .cabinet-sidebar-nav .nav-text { display: none; }
  .investor-shell .investor-title h1 { font-size: 24px; }
  .investor-shell .investor-title p { font-size: 12px; }
  .investor-shell .investor-header { padding-inline: 14px; }
  .investor-main { padding-inline: 14px; }
  .investor-shell .date-picker span { display: none; }
  .investor-shell .date-today { padding-inline: 8px; }
  .investor-shell .dashboard-card { padding: 18px; }
  .allocation-visual { flex-direction: column; align-items: center; }
  .allocation-legend { width: 100%; }
}


/* Mercury Investment — FINAL INVESTOR DESIGN LANGUAGE. */
.investor-shell {
  grid-template-columns: 232px minmax(0, 1fr);
  color: #18202f;
  background: #f7f8fb;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  transition: grid-template-columns var(--mi-motion-base) var(--mi-ease-out);
}
body.sidebar-collapsed.investor-shell { grid-template-columns: 68px minmax(0, 1fr); }
.investor-shell .cabinet-sidebar {
  gap: 18px;
  padding: 20px 14px 16px;
  transition: padding var(--mi-motion-base) var(--mi-ease-out);
}
.investor-shell .brand-lockup { font-weight: 560; letter-spacing: -.01em; }
.investor-shell .brand-full,
.investor-shell .nav-text,
.investor-shell .cabinet-user-copy {
  display: block;
  max-width: 190px;
  opacity: 1;
  overflow: hidden;
  transform: translateX(0);
  transition: max-width var(--mi-motion-base) var(--mi-ease-out),
    opacity var(--mi-motion-fast) var(--mi-ease-standard),
    transform var(--mi-motion-base) var(--mi-ease-out);
  white-space: nowrap;
}
.investor-shell .cabinet-user-copy {
  display: flex;
  flex-direction: column;
}
.investor-shell .cabinet-sidebar-nav a,
.investor-shell .cabinet-logout-btn {
  font-weight: 440;
  transition: color var(--mi-motion-fast) var(--mi-ease-standard),
    background var(--mi-motion-fast) var(--mi-ease-standard),
    border-color var(--mi-motion-fast) var(--mi-ease-standard);
}
.investor-shell .cabinet-sidebar-nav a.is-active { font-weight: 510; }
.investor-shell .cabinet-user-name { font-weight: 520; }
.investor-shell .cabinet-user-avatar { font-weight: 540; }
.investor-shell .sidebar-toggle svg {
  transition: transform var(--mi-motion-base) var(--mi-ease-out);
}
body.sidebar-collapsed.investor-shell .brand-full,
body.sidebar-collapsed.investor-shell .nav-text,
body.sidebar-collapsed.investor-shell .cabinet-user-copy {
  display: block;
  max-width: 0;
  opacity: 0;
  transform: translateX(-5px);
  visibility: hidden;
}
body.sidebar-collapsed.investor-shell .cabinet-sidebar-nav a,
body.sidebar-collapsed.investor-shell .cabinet-logout-btn,
body.sidebar-collapsed.investor-shell .cabinet-user,
body.sidebar-collapsed.investor-shell .brand-lockup { gap: 0; }
body.sidebar-collapsed.investor-shell .cabinet-sidebar-brand { gap: 9px; }
body.sidebar-collapsed.investor-shell .cabinet-sidebar { padding-inline: 9px; }
.investor-shell .investor-header {
  gap: 14px 24px;
  padding: 28px 34px 10px;
}
.investor-title-row { min-height: 34px; flex-wrap: nowrap; }
.investor-shell .investor-title h1 {
  font-size: 28px;
  font-weight: 550;
  letter-spacing: -.025em;
}
.investor-shell .investor-title p { color: #7a8494; font-size: 12px; font-weight: 400; }
.investor-shell .cabinet-kind,
.investor-shell .date-picker span,
.investor-shell .date-today,
.investor-shell .money-card .label,
.investor-shell .eyebrow,
.forecast-card .calc-label { font-weight: 490; letter-spacing: .035em; }
.investor-shell .cabinet-kind {
  max-width: 270px;
  overflow: hidden;
  font-weight: 450;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.investor-shell .cabinet-kind.viewed-as { font-weight: 470; }
.investor-shell .date-input { font-weight: 500; }
.investor-shell .date-today { font-weight: 500; }
.investor-main { padding: 10px 34px 48px; }
.investor-shell .money-overview { margin-bottom: 18px; padding: 5px 10px; }
.investor-shell .money-card { padding: 19px 22px 18px; }
.investor-shell .kpi-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.investor-shell .money-card .label {
  margin-bottom: 9px;
  color: #788294;
  font-size: 9.5px;
  font-weight: 490;
}
.investor-shell .kpi-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: -4px 0 5px;
  color: #96631e;
  font-size: 9px;
  font-weight: 520;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.investor-shell .kpi-mode::before {
  width: 5px;
  height: 5px;
  background: #d79a45;
  border-radius: 50%;
  content: "";
}
.investor-shell .money-card .value {
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -.022em;
  font-variant-numeric: tabular-nums;
}
.investor-shell .money-card.total .value {
  font-size: 34px;
  font-weight: 550;
  letter-spacing: -.028em;
}
.investor-shell .money-card .value.is-updating {
  animation: mi-kpi-swap 220ms var(--mi-ease-out) both;
}
.investor-shell .kpi-caption { color: #9aa3b1; font-size: 9.5px; font-weight: 400; }
.investor-shell .annual-line {
  padding: 10px 22px 7px;
  color: #7f8999;
  font-size: 10.5px;
  font-weight: 400;
}
.investor-shell .money-overview.is-scenario .annual-line { color: #876c43; }
.investor-shell .dashboard-card,
.investor-shell .money-overview,
.investor-shell .collateral-block {
  border-color: #e8ebf1;
  border-radius: 15px;
}
.dashboard-primary-grid {
  grid-template-columns: minmax(0, 1fr) minmax(348px, 360px);
  gap: 18px;
}
.dashboard-left-stack,
.dashboard-side-stack { gap: 18px; }
.investor-shell .dashboard-card { padding: 24px; }
.investor-shell .card-heading,
.investor-shell .section-head { margin-bottom: 16px; }
.investor-shell .card-heading h2,
.investor-shell .section-head h2,
.investor-shell .capital-chart-section h2,
.investor-shell .capital-schedule-section h2 {
  font-size: 17px;
  font-weight: 530;
  letter-spacing: -.014em;
}
.investor-shell .eyebrow { color: #a0a8b5; font-size: 9px; font-weight: 480; }
.forecast-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  background: transparent;
  font-weight: 500;
  letter-spacing: .035em;
}
.forecast-tag::before {
  width: 5px;
  height: 5px;
  background: #d79a45;
  border-radius: 50%;
  content: "";
}
.forecast-card .calc-controls { gap: 17px; }
.forecast-card .calc-label { color: #7e8898; font-size: 9.5px; }
.forecast-card .calc-amount {
  grid-template-columns: minmax(102px, .8fr) minmax(138px, 1.2fr);
  gap: 10px;
}
.forecast-card .calc-stepper input {
  height: 42px;
  border-color: #dce1ea;
  font-size: 16px;
  font-weight: 480;
  font-variant-numeric: tabular-nums;
}
.forecast-card .calc-step-btn {
  width: 42px;
  border-color: #dce1ea;
  font-size: 17px;
  font-weight: 450;
  transition: color var(--mi-motion-fast) var(--mi-ease-standard),
    background var(--mi-motion-fast) var(--mi-ease-standard);
}
.forecast-card .calc-step-select {
  display: grid;
  grid-column: 1;
  gap: 5px;
  align-items: stretch;
  color: #8e97a6;
  font-size: 9.5px;
}
.forecast-card .calc-step-select span,
.forecast-card .calc-field > span:first-child {
  color: #8e97a6;
  font-size: 9.5px;
  font-weight: 400;
  line-height: 1.3;
}
.forecast-card .calc-step-select select,
.forecast-card .calc-field input {
  width: 100%;
  height: 38px;
  margin: 0;
  border-color: #e0e4ec;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 400;
}
.forecast-card .calc-date { grid-column: 2; min-width: 0; }
.forecast-card .calc-add-btn,
.forecast-card .calc-terms button,
.investor-shell .link-btn { font-weight: 500; }
.forecast-card .calc-add-btn {
  grid-column: 1 / -1;
  width: 100%;
  height: 38px;
  color: #2948b8;
  background: #f1f3ff;
  border-color: #e2e6fb;
  border-radius: 9px;
  font-size: 11px;
  transition: color var(--mi-motion-fast) var(--mi-ease-standard),
    background var(--mi-motion-fast) var(--mi-ease-standard),
    border-color var(--mi-motion-fast) var(--mi-ease-standard);
}
.forecast-card .calc-add-btn:hover { background: #e9edff; border-color: #d8defb; }
.forecast-card .calc-injections { min-height: 0; gap: 6px; }
.forecast-card .calc-hint { color: #a0a8b5; font-size: 9.5px; line-height: 1.45; }
.forecast-card .calc-chip {
  padding: 5px 8px;
  color: #697386;
  background: #f8f9fb;
  border-color: #e7eaf0;
  border-radius: 7px;
  font-size: 9.5px;
}
.forecast-card .calc-terms { gap: 6px; margin-top: 8px; }
.forecast-card .calc-terms button {
  min-height: 38px;
  color: #737d8e;
  border-color: #e2e6ed;
  border-radius: 9px;
  font-size: 10.5px;
  font-weight: 450;
  transition: color var(--mi-motion-fast) var(--mi-ease-standard),
    background var(--mi-motion-fast) var(--mi-ease-standard),
    border-color var(--mi-motion-fast) var(--mi-ease-standard),
    transform var(--mi-motion-fast) var(--mi-ease-out);
}
.forecast-card .calc-terms button:active { transform: scale(.985); }
.forecast-card .calc-terms button.active {
  color: #2948b8;
  background: #f0f2ff;
  border-color: #d9dffa;
}
.forecast-card .calc-result { margin: 18px 0 0; }
.forecast-card .calc-result.is-updating {
  animation: mi-result-swap 240ms var(--mi-ease-out) both;
}
.forecast-result-grid {
  gap: 0;
  margin: 0;
  padding: 16px 0 15px;
  border-top: 1px solid #e9ecf2;
  border-bottom: 1px solid #e9ecf2;
}
.forecast-result-item {
  min-width: 0;
  padding: 0 14px;
  background: transparent;
  border: none;
  border-radius: 0;
}
.forecast-result-item:first-child { padding-left: 0; }
.forecast-result-item + .forecast-result-item { border-left: 1px solid #e9ecf2; }
.forecast-result-item span {
  color: #9aa3b1;
  font-size: 8.5px;
  font-weight: 480;
  letter-spacing: .035em;
}
.forecast-result-item strong {
  margin-top: 6px;
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -.015em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forecast-result-item.primary strong {
  font-size: 22px;
  font-weight: 540;
  letter-spacing: -.025em;
}
.forecast-result-item.positive strong { color: var(--mi-positive); font-size: 13.5px; }
.forecast-card .calc-result-line {
  padding: 12px 0 0;
  color: #7f8999;
  border: none;
  font-size: 10.5px;
  line-height: 1.55;
}
.forecast-card .calc-badge {
  position: relative;
  margin-top: 10px;
  padding: 0 0 0 13px;
  color: #8b6a36;
  background: transparent;
  border: none;
  font-size: 9.5px;
  line-height: 1.5;
}
.forecast-card .calc-badge::before {
  position: absolute;
  top: .48em;
  left: 0;
  width: 5px;
  height: 5px;
  background: #dba557;
  border-radius: 50%;
  content: "";
}
.forecast-card .calc-badge.hypothesis,
.forecast-card .calc-badge.fact {
  padding-left: 13px;
  background: transparent;
  border: none;
  color: #8b6a36;
}
.forecast-card .passport-details { margin-top: 14px; }
.forecast-card .passport-details summary,
.forecast-card .passport-details > div { color: #7f8999; font-size: 10.5px; font-weight: 400; }
.investor-shell .show-banner {
  margin: -3px 0 15px;
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 9.5px;
  font-weight: 450;
}
.forecast-card .calc-readonly .calc-controls { opacity: .62; }
.allocation-card {
  min-height: 0;
  margin-top: 18px;
  background: rgba(255,255,255,.82);
}
.allocation-card .allocation-visual {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
}
.allocation-card .allocation-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
}
.allocation-card .card-heading h2 { font-size: 16px; font-weight: 510; }
.allocation-content { min-height: 112px; }
.allocation-visual { gap: 16px; }
.allocation-donut { width: 112px; height: 112px; flex-basis: 112px; }
.allocation-donut::after { inset: 16px; }
.allocation-center { inset: 22px; }
.allocation-center strong { font-size: 12px; font-weight: 510; }
.allocation-center span { font-size: 8px; letter-spacing: .025em; }
.allocation-name,
.allocation-note,
.investor-shell .capital-schedule-table,
.investor-shell .collateral-note { color: #7f8999; font-weight: 400; }
.allocation-value,
.accrual-amount { font-weight: 520; }
.allocation-note { margin-top: 12px; font-size: 9.5px; }
.allocation-empty {
  min-height: 132px;
  padding: 18px;
  background: #fafbfc;
  border: none;
  font-size: 11px;
}
.allocation-empty strong { font-weight: 510; }
.allocation-empty span { color: #929bab; font-size: 10px; }
.recent-accruals { min-height: 150px; }
.accrual-row { min-height: 50px; font-size: 11.5px; }
.investor-shell .collateral-block { margin-top: 18px; padding: 14px 20px; }
.investor-shell .collateral-block > summary { font-weight: 430; }
.investor-shell .chart-legend { gap: 13px; font-size: 9.5px; }
.legend-line { width: 18px; border-top-width: 1.5px; }
.investor-shell .capital-chart-host,
.investor-shell .chart-stage { min-height: 310px; }
.investor-shell .capital-chart-host > .chart-empty { min-height: 310px; }
.investor-shell .capital-chart-host { position: relative; }
.investor-shell .chart-stage-current { position: relative; z-index: 2; }
.investor-shell .chart-stage.is-entering {
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 300ms var(--mi-ease-standard),
    transform 360ms var(--mi-ease-out);
}
.investor-shell .chart-stage.is-entering.is-visible { opacity: 1; transform: translateY(0); }
.investor-shell .chart-stage.is-exiting {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  pointer-events: none;
  animation: mi-chart-exit 340ms var(--mi-ease-standard) both;
}
.investor-shell .chart-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: -2px 0 10px;
  color: #697386;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.investor-shell .chart-summary span { display: inline-flex; gap: 6px; align-items: baseline; }
.investor-shell .chart-summary b {
  color: #a0a8b5;
  font-size: 8.5px;
  font-weight: 480;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.investor-shell .capital-value-summary { color: #596476; font-weight: 450; }
.investor-shell .chart-grid { stroke: #f1f3f7; stroke-width: .7; }
.investor-shell .chart-axis { stroke: #e3e7ee; stroke-width: .85; }
.investor-shell .forecast-zone { fill: #fafbff; opacity: .72; }
.investor-shell .chart-tick { fill: #a5adba; font-size: 9px; font-weight: 400; }
.investor-shell .capital-line { stroke-width: 1.75; vector-effect: non-scaling-stroke; }
.investor-shell .capital-line.projected { stroke-dasharray: 5 6; opacity: .58; }
.investor-shell .capital-dot {
  fill: #fff;
  stroke: #3855c7;
  stroke-width: 1.5;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform var(--mi-motion-fast) var(--mi-ease-out),
    fill var(--mi-motion-fast) var(--mi-ease-standard);
}
.investor-shell .capital-anchor.projected .capital-dot { opacity: .72; }
.investor-shell .capital-anchor.is-active .capital-dot { fill: #eef1ff; transform: scale(1.28); }
.investor-shell .capital-point-label {
  fill: #8791a1;
  stroke: var(--mi-surface);
  stroke-width: 4;
  paint-order: stroke;
  font-size: 8px;
  font-weight: 490;
  letter-spacing: .035em;
  text-transform: uppercase;
}
.investor-shell .chart-today { stroke: #d8dde6; stroke-width: .8; stroke-dasharray: 3 5; }
.investor-shell .chart-today-label { fill: #9aa3b1; font-size: 8.5px; font-weight: 450; }
.investor-shell .chart-stage.is-initial .capital-lines {
  animation: mi-chart-reveal var(--mi-motion-slow) var(--mi-ease-out) both;
}
.investor-shell .chart-stage.is-initial .capital-areas {
  opacity: 0;
  animation: mi-chart-area 440ms var(--mi-ease-standard) 260ms both;
}
.investor-shell .chart-stage.is-initial .chart-today-marker {
  opacity: 0;
  animation: mi-chart-marker 300ms var(--mi-ease-standard) 480ms both;
}
.investor-shell .chart-stage.is-initial .capital-anchor {
  opacity: 0;
  animation: mi-chart-anchor 300ms var(--mi-ease-out) var(--anchor-delay, 420ms) both;
}
.investor-shell .chart-stage.is-entering.is-visible .capital-anchor.final.projected .capital-dot {
  animation: mi-endpoint-confirm 520ms var(--mi-ease-out) 80ms both;
}
.chart-tooltip {
  min-width: 188px;
  padding: 11px 12px 10px;
  background: #18202f;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(16,24,40,.16);
  font-size: 10px;
  font-weight: 400;
}
.chart-tooltip-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chart-tooltip-head span { color: #cbd2df; }
.chart-tooltip-head em {
  color: #aebcf7;
  font-size: 8px;
  font-style: normal;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.chart-tooltip strong {
  display: block;
  margin-top: 5px;
  font-size: 14px;
  font-weight: 520;
  letter-spacing: -.015em;
}
.chart-tooltip dl { display: grid; gap: 3px; margin: 8px 0 0; }
.chart-tooltip dl div { display: flex; justify-content: space-between; gap: 12px; }
.chart-tooltip dt { color: #9fa8b8; }
.chart-tooltip dd { margin: 0; color: #e8ebf2; font-variant-numeric: tabular-nums; }
.chart-tooltip.is-below { transform: translate(-50%, 12px); }

@keyframes mi-kpi-swap {
  from { opacity: .35; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes mi-result-swap {
  from { opacity: .42; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes mi-chart-reveal {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes mi-chart-area {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes mi-chart-marker {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes mi-chart-anchor {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes mi-chart-exit {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes mi-endpoint-confirm {
  0% { filter: drop-shadow(0 0 0 rgba(50,79,197,0)); transform: scale(1); }
  45% { filter: drop-shadow(0 0 5px rgba(50,79,197,.25)); transform: scale(1.45); }
  100% { filter: drop-shadow(0 0 0 rgba(50,79,197,0)); transform: scale(1); }
}

@media (max-width: 1180px) {
  .investor-shell { grid-template-columns: 196px minmax(0, 1fr); }
  body.sidebar-collapsed.investor-shell { grid-template-columns: 68px minmax(0, 1fr); }
  .investor-shell .investor-header { padding-inline: 26px; }
  .investor-main { padding-inline: 26px; }
  .investor-shell .money-card .value { font-size: 21px; }
  .investor-shell .money-card.total .value { font-size: 29px; }
  .dashboard-side-stack {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}
@media (min-width: 881px) and (max-width: 1180px) {
  .forecast-card #calc-block {
    display: grid;
    grid-template-areas:
      "controls result"
      "controls passport";
    grid-template-columns: minmax(0, 1.12fr) minmax(270px, .88fr);
    column-gap: 28px;
    align-items: start;
  }
  .forecast-card .calc-controls { grid-area: controls; }
  .forecast-card .calc-result { grid-area: result; margin-top: 0; }
  .forecast-card .passport-details { grid-area: passport; }
}
@media (max-width: 1080px) {
  .investor-shell .investor-header { grid-template-columns: minmax(0, 1fr); }
  .investor-shell .header-actions { justify-content: space-between; }
  .investor-shell .date-bar-hint { margin-top: -5px; text-align: left; }
}
@media (min-width: 881px) and (max-width: 1080px) {
  .investor-shell .header-actions { justify-content: flex-end; }
  .investor-shell .date-bar-hint { text-align: right; }
}
@media (max-width: 880px) {
  .investor-shell,
  body.sidebar-collapsed.investor-shell { display: block; }
  .investor-shell .cabinet-sidebar,
  body.sidebar-collapsed.investor-shell .cabinet-sidebar {
    position: static;
    height: auto;
    min-height: 64px;
    padding: 12px 20px;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 12px;
    border-right: none;
    border-bottom: 1px solid var(--mi-border);
  }
  .investor-shell .cabinet-sidebar-brand,
  body.sidebar-collapsed.investor-shell .cabinet-sidebar-brand {
    min-height: auto;
    padding: 0;
    gap: 9px;
    flex-direction: row;
    border: none;
  }
  .investor-shell .sidebar-toggle { display: none; }
  .investor-shell .cabinet-sidebar-nav { margin-left: auto; flex-direction: row; justify-content: flex-end; }
  .investor-shell .cabinet-sidebar-footer { padding: 0; border: none; flex-direction: row; }
  .investor-shell .cabinet-user,
  .investor-shell #btn-change-password { display: none; }
  .investor-shell .cabinet-logout-btn { width: 40px; padding: 0; justify-content: center; }
  .investor-shell .cabinet-logout-btn .nav-text { display: none; }
  body.sidebar-collapsed.investor-shell .brand-full,
  body.sidebar-collapsed.investor-shell .cabinet-sidebar-nav .nav-text {
    display: block;
    max-width: 190px;
    opacity: 1;
    transform: none;
    visibility: visible;
  }
  body.sidebar-collapsed.investor-shell .brand-lockup,
  body.sidebar-collapsed.investor-shell .cabinet-sidebar-nav a { gap: 10px; }
  .investor-shell .investor-header { padding: 24px 24px 8px; }
  .investor-main { padding: 12px 24px 38px; }
  .investor-shell .money-totals { grid-template-columns: 1fr 1fr; }
  .investor-shell .money-card:nth-child(3) { border-left: none; border-top: 1px solid var(--mi-border); }
  .investor-shell .money-card:nth-child(4) { border-top: 1px solid var(--mi-border); }
  .dashboard-side-stack { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .investor-title-row { min-height: 58px; flex-wrap: wrap; align-content: flex-start; }
  body.viewing-investor .investor-title-row { min-height: 100px; }
  .investor-shell .header-actions { align-items: flex-start; }
  .investor-shell .date-control { flex: 1; min-width: 0; }
  .investor-shell .date-picker { flex: 1; min-width: 0; }
  .investor-shell .date-input { width: 100%; min-width: 112px; }
  .investor-shell .money-totals { grid-template-columns: 1fr; }
  .investor-shell .money-card + .money-card { border-left: none; border-top: 1px solid var(--mi-border); }
  .investor-shell .capital-chart-host,
  .investor-shell .chart-stage,
  .investor-shell .chart-empty { min-height: 286px; }
  .allocation-card .allocation-visual {
    display: flex;
    align-items: stretch;
  }
  .allocation-card .allocation-legend { display: block; }
  .allocation-visual { align-items: flex-start; }
  .allocation-donut { width: 104px; height: 104px; flex-basis: 104px; }
}
@media (max-width: 420px) {
  .investor-shell .cabinet-sidebar,
  body.sidebar-collapsed.investor-shell .cabinet-sidebar { padding-inline: 12px; }
  .investor-shell .cabinet-sidebar-nav a { padding-inline: 9px; }
  .investor-shell .cabinet-sidebar-nav .nav-text,
  body.sidebar-collapsed.investor-shell .cabinet-sidebar-nav .nav-text { display: none; }
  .investor-shell .investor-title h1 { font-size: 24px; }
  .investor-shell .investor-header { padding-inline: 14px; }
  .investor-main { padding-inline: 14px; }
  .investor-shell .date-picker span { display: none; }
  .investor-shell .date-today { padding-inline: 8px; }
  .investor-shell .dashboard-card { padding: 19px; }
  .forecast-card .calc-amount { grid-template-columns: 108px minmax(0, 1fr); }
  .forecast-result-item.primary strong { font-size: 20px; }
  .allocation-visual { flex-direction: column; align-items: center; }
  .allocation-legend { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .investor-shell,
  .investor-shell *,
  .investor-shell *::before,
  .investor-shell *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }
  .investor-shell .chart-stage.is-entering {
    opacity: 1 !important;
    transform: none !important;
  }
  .investor-shell .chart-stage.is-exiting { display: none !important; }
}

/* Root role selection precedes investor paint; retain geometry during auth. */
.investor-shell.root-entry-pending .cabinet-sidebar,
.investor-shell.root-entry-pending .cabinet-workspace { visibility: hidden; }
.investor-shell .root-entry-status {
  position: fixed;
  inset: 35% 24px auto;
  text-align: center;
  color: var(--mi-text-secondary);
}

/* Independent reference placement surfaces. */
.reference-card, .reference-admin, .reference-legacy { overflow-wrap: anywhere; }
.reference-card { margin-top: 24px; padding: 24px; }
.reference-placement { padding: 18px 0; border-bottom: 1px solid var(--border, #ddd); }
.reference-placement p { margin: 8px 0; white-space: pre-wrap; }
.reference-amount { font-size: 1.2rem; font-weight: 600; }
.reference-tag { display: inline-block; padding: 3px 9px; border-radius: 8px; background: #f2e9c8; color: #59460f; }
.reference-preview { margin-top: 20px; padding: 16px; border: 1px solid var(--border, #ddd); border-radius: 12px; }
.reference-preview p { white-space: pre-wrap; }
.reference-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.reference-wide { grid-column: 1 / -1; }
.reference-checkbox { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0; }
.reference-participant { min-width: 0; margin: 16px 0; padding: 16px; border: 1px solid var(--border, #ddd); border-radius: 12px; }
.reference-latest { max-width: 100%; white-space: pre-wrap; word-break: break-word; }
.reference-admin textarea, .reference-admin input, .reference-admin select { max-width: 100%; }
.reference-legacy { margin-top: 24px; padding: 20px; }
.reference-legacy > summary, .reference-history summary { cursor: pointer; }
.reference-admin button:focus-visible, .reference-card button:focus-visible, .reference-placement summary:focus-visible { outline: 3px solid #6b7c44; outline-offset: 3px; }
@media (max-width: 768px) { .reference-fields { grid-template-columns: minmax(0, 1fr); } .reference-card { padding: 16px; } }
