/* TradeCPO TMC V4.5
   Unified Light Theme and Inspector Integrity
   Frontend presentation only.
*/

/* Shared Inspector overflow protection */
#p-tmc .tmc4-inspector-body .tmc4-stat {
  min-width: 0;
  align-items: flex-start;
}

#p-tmc .tmc4-inspector-body .tmc4-stat > span {
  min-width: 0;
  flex: 0 1 43%;
}

#p-tmc .tmc4-inspector-body .tmc4-stat > b {
  min-width: 0;
  flex: 1 1 57%;
  text-align: right;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.45;
}

/* Light theme */
html[data-theme="light"] #p-tmc .tmc4 {
  color: #163d38;
  background: linear-gradient(145deg,#f6faf9,#e8f3f0);
  border-color: #9ccdc0;
}

html[data-theme="light"] #p-tmc .tmc4-head {
  border-bottom-color: #b6d8ce;
}

html[data-theme="light"] #p-tmc .tmc4-head h2,
html[data-theme="light"] #p-tmc .tmc4-inspector h2 {
  color: #103e35;
}

html[data-theme="light"] #p-tmc .tmc4-kpis > div {
  background: linear-gradient(145deg,#ffffff,#e9f5f1);
  border-color: #b2d9cb;
}

html[data-theme="light"] #p-tmc .tmc4-kpis span {
  color: #547a70;
}

html[data-theme="light"] #p-tmc .tmc4-kpis strong {
  color: #103d34;
}

html[data-theme="light"] #p-tmc .tmc4-panel {
  background: linear-gradient(145deg,#ffffff,#edf7f4);
  border-color: #a8d6c8;
  box-shadow: none;
}

html[data-theme="light"] #p-tmc .tmc4-panel h3 {
  color: #144b3f;
}

html[data-theme="light"] #p-tmc .tmc4-panel h3 small,
html[data-theme="light"] #p-tmc .tmc4-panel dl dt,
html[data-theme="light"] #p-tmc .tmc4-stream-item small {
  color: #5d8177;
}

html[data-theme="light"] #p-tmc .tmc4-panel dl dt,
html[data-theme="light"] #p-tmc .tmc4-panel dl dd,
html[data-theme="light"] #p-tmc .tmc4-inspector-body .tmc4-stat {
  border-bottom-color: #d0e6dd;
}

html[data-theme="light"] #p-tmc .tmc4-panel dl dd,
html[data-theme="light"] #p-tmc .tmc4-inspector-body,
html[data-theme="light"] #p-tmc .tmc4-inspector-body b {
  color: #173e35;
}

html[data-theme="light"] #p-tmc .tmc4-brain-panel {
  background: radial-gradient(
    circle at 50% 45%,
    #e5f8ef 0%,
    #f1faf7 52%,
    #ffffff 100%
  );
  border-color: #a8d6c8;
}

html[data-theme="light"] #p-tmc .tmc4-brain-top,
html[data-theme="light"] #p-tmc .tmc4-brain-foot {
  color: #285e50;
}

html[data-theme="light"] #p-tmc .tmc4-brain-top small {
  color: #527e70;
}

/* Preserve green Cortex nodes; improve labels */
html[data-theme="light"] #p-tmc .tmc4-node text {
  fill: #174d3d;
}

html[data-theme="light"] #p-tmc .tmc4-line {
  stroke: #168d69;
  stroke-opacity: .35;
}

html[data-theme="light"] #p-tmc .tmc4-actions button,
html[data-theme="light"] #p-tmc .tmc4-tabs button {
  background: #f3faf7;
  color: #194b3e;
  border-color: #a7d4c6;
}

html[data-theme="light"] #p-tmc .tmc4-tabs button.active {
  background: #087b59;
  color: #ffffff;
  border-color: #087b59;
}

html[data-theme="light"] #p-tmc .tmc4-stream-item {
  color: #173e35;
  border-bottom-color: #d0e6dd;
}

html[data-theme="light"] #p-tmc .tmc4-stream-item:hover {
  background: #e1f4eb;
}

html[data-theme="light"] #p-tmc .tmc4-foot {
  color: #527d70;
  border-top-color: #b6d8ce;
}

/* Mobile and tablet readability */
@media (max-width: 720px) {
  #p-tmc .tmc4-inspector-body .tmc4-stat {
    gap: 8px;
  }

  #p-tmc .tmc4-inspector-body .tmc4-stat > b {
    font-size: 11px;
  }

  #p-tmc .tmc4-actions {
    flex-wrap: wrap;
  }
}
