/* Termonto V1.13.4.6: Negative Signal Clarity
   Negative performance, contribution, growth, drawdown and loss metrics must
   be recognizable immediately without turning the entire interface red. */

/* Stronger signal palette. */
.public-site .negative,
.public-site.page-home .hero-performance .mini-stats b.negative,
.public-site .stats-grid-reference .stat-card > strong.negative,
.page-performance .performance-signal.negative,
.page-portfolio .holding-market-statistics-v1310 strong.negative,
.page-portfolio .holding-performance-grid-v1300 strong.negative,
.page-portfolio .holding-risk-grid-v1300 strong.negative,
.page-portfolio .holding-metric-group-list-v1300 strong.negative,
.page-portfolio .holding-context-grid-v1300 strong.negative,
.page-portfolio .holding-history-summary-v1200 strong.negative,
.page-portfolio .holding-chart-head-v1200 strong.negative {
  color: #ff5c67 !important;
  text-shadow: 0 0 12px rgba(255,92,103,.12);
}
.public-site .positive,
.public-site.page-home .hero-performance .mini-stats b.positive,
.public-site .stats-grid-reference .stat-card > strong.positive {
  color: #67dc4b !important;
}
.public-site .neutral { color: #d8e1e4 !important; }

/* Negative KPI cards get a restrained red edge and surface tint. */
.public-site .signal-surface.signal-negative,
.page-performance .performance-primary-card-v1113.signal-negative,
.page-performance .performance-period-card-v1113.signal-negative {
  border-color: rgba(255,92,103,.42) !important;
  background:
    linear-gradient(90deg, rgba(255,92,103,.075), rgba(255,92,103,.018) 28%, transparent 62%),
    linear-gradient(180deg, #081117 0%, #061017 100%) !important;
  box-shadow: inset 3px 0 0 rgba(255,92,103,.82), 0 10px 30px rgba(0,0,0,.08);
}
.public-site .signal-surface.signal-negative > span:first-child,
.page-performance .signal-negative > span:first-child {
  color: #d69298 !important;
}

/* Homepage: a negative short-period KPI must not stay visually green. */
.public-site.page-home .hero-performance.signal-negative {
  border-color: rgba(255,92,103,.48) !important;
  box-shadow: inset 3px 0 0 rgba(255,92,103,.8), 0 24px 55px rgba(0,0,0,.30) !important;
}
.public-site.page-home .hero-performance.signal-negative .panel-head span {
  color: #d9969b;
}

/* Portfolio table: losses and negative contribution get a visible red lane. */
.public-site .portfolio-table td.negative {
  position: relative;
  color: #ff5c67 !important;
  font-weight: 780 !important;
  background: linear-gradient(90deg, rgba(255,92,103,.075), rgba(255,92,103,.018) 62%, transparent);
}
.public-site .portfolio-table td.negative::before {
  content: '';
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 2px;
  border-radius: 2px;
  background: #ff5c67;
  box-shadow: 0 0 8px rgba(255,92,103,.22);
}
.page-portfolio .portfolio-summary-line-v163 > span.summary-negative {
  color: #c8898f;
  background: rgba(255,92,103,.035);
}
.page-portfolio .portfolio-summary-line-v163 > span.summary-negative b {
  color: #ff5c67 !important;
}

/* The existing biggest-decline card is made unmistakably negative. */
.page-portfolio .portfolio-highlight-negative-v1112 {
  border-color: rgba(255,92,103,.42) !important;
  background: linear-gradient(135deg, rgba(255,92,103,.085), rgba(8,17,23,.96) 48%) !important;
  box-shadow: inset 3px 0 0 rgba(255,92,103,.82);
}
.page-portfolio .portfolio-highlight-negative-v1112 > strong,
.page-portfolio .portfolio-highlight-negative-v1112 .portfolio-highlight-name-v1112 {
  color: #ff5c67 !important;
}

/* Holding intelligence: tint only the metric cell that actually carries the signal. */
.page-portfolio .holding-market-statistics-v1310 > div:has(> strong.negative),
.page-portfolio .holding-performance-grid-v1300 > div:has(> strong.negative),
.page-portfolio .holding-risk-grid-v1300 > div:has(> strong.negative),
.page-portfolio .holding-metric-group-list-v1300 > div:has(> strong.negative),
.page-portfolio .holding-context-grid-v1300 > div:has(> strong.negative),
.page-portfolio .holding-history-summary-v1200 > div:has(> strong.negative) {
  background: linear-gradient(90deg, rgba(255,92,103,.07), rgba(255,92,103,.012) 68%, transparent);
  box-shadow: inset 2px 0 0 rgba(255,92,103,.58);
}
.page-portfolio .holding-primary-card-v1200.negative,
.page-portfolio .holding-status-card-v1300.negative {
  border-color: rgba(255,92,103,.4) !important;
  background: linear-gradient(135deg, rgba(255,92,103,.075), rgba(5,14,19,.96) 52%) !important;
  box-shadow: inset 3px 0 0 rgba(255,92,103,.72);
}

/* A selected negative market range gets a red chart instead of a green one. */
.page-portfolio [data-holding-market-chart].negative-range .holding-interactive-chart-v1300 .area {
  fill: rgba(255,92,103,.07);
}
.page-portfolio [data-holding-market-chart].negative-range .holding-interactive-chart-v1300 .line {
  stroke: #ff5c67;
}
.page-portfolio [data-holding-market-chart].negative-range .holding-interactive-chart-v1300 .cursor-point {
  fill: #ff7078;
}
.page-portfolio [data-holding-market-chart].negative-range .holding-chart-tooltip-v1300 {
  border-color: rgba(255,92,103,.3);
}

/* Performance range chart legend follows the selected range signal. */
.public-site canvas#performanceChart.negative-chart + .chart-empty + .chart-legend i,
.public-site canvas#performanceChart.negative-chart ~ .chart-legend i {
  background: #ff5c67;
}

/* Preserve economic meaning: a negative net-debt value is net cash, not a loss.
   holding.php explicitly marks that value positive. */

@media (max-width: 820px) {
  .public-site .signal-surface.signal-negative,
  .page-performance .signal-negative {
    box-shadow: inset 2px 0 0 rgba(255,92,103,.78);
  }
  .public-site .portfolio-table td.negative::before { width: 2px; }
}
