/* Gold light-mode component corrections. Dark-mode rules remain untouched. */
html[data-theme=light] body.demo-theme {
  --distribution-empty-ring: #e3ecf5;
  --gold-light-text: #142c40;
  --gold-light-muted: #50687a;
  --gold-light-border: #cddae4;
  --gold-light-soft: #f3f7fc;
  --gold-light-good: #087344;
  --gold-light-warning: #87500b;
  --gold-light-danger: #b42318;
}

html[data-theme=light] .demo-theme :is(.dashboard-date-chip,.dashboard-pill) {
  background: var(--gold-light-soft);
  border-color: var(--gold-light-border);
  color: var(--gold-light-muted);
}
html[data-theme=light] .demo-theme :is(.dashboard-date-chip span,.energy-kpi-card span,.energy-kpi-card small,.usage-compare-label span,.usage-bar-line>span,.distribution-legend span,.dashboard-device-table td small,.top-live) {
  color: var(--gold-light-muted);
}
html[data-theme=light] .demo-theme .energy-kpi-card {
  box-shadow: 0 4px 16px rgba(28,54,75,.06);
}
html[data-theme=light] .demo-theme .energy-kpi-card span {font-size:12px;line-height:1.45}
html[data-theme=light] .demo-theme .energy-kpi-card small {font-size:11px;line-height:1.45}
html[data-theme=light] .demo-theme :is(.dashboard-date-chip strong,.distribution-donut strong,.usage-bar-line>b,.dashboard-device-table td,.distribution-legend strong) {
  color: var(--gold-light-text);
}
html[data-theme=light] .demo-theme :is(.dashboard-card-head,.dashboard-device-table th,.dashboard-device-table td) {
  border-color: var(--gold-light-border);
}
html[data-theme=light] .demo-theme .dashboard-device-table thead {
  background: var(--gold-light-soft);
}
html[data-theme=light] .demo-theme :is(.dashboard-device-table th,.dashboard-card-head p,.usage-compare-label span,.usage-bar-line>span,.usage-bar-line>b,.distribution-legend span,.distribution-legend strong,.dashboard-empty) {
  font-size:11px;
}
html[data-theme=light] .demo-theme .dashboard-device-table td {font-size:12px}
html[data-theme=light] .demo-theme .dashboard-device-table td strong {font-size:12px}
html[data-theme=light] .demo-theme .dashboard-device-table td small {font-size:11px}
html[data-theme=light] .demo-theme :is(.dashboard-device-table th,.dashboard-live-strip span,.dashboard-live-strip small) {
  color: var(--gold-light-muted);
}
html[data-theme=light] .demo-theme .dashboard-live-strip span {font-size:10px}
html[data-theme=light] .demo-theme .dashboard-live-strip small {font-size:10px}
html[data-theme=light] .demo-theme .distribution-donut::after {
  background: #fff;
  border-color: var(--gold-light-border);
}
html[data-theme=light] .demo-theme .distribution-legend {min-width:0}
html[data-theme=light] .demo-theme .distribution-legend>div:not(.dashboard-empty) {grid-template-columns:10px minmax(0,1fr) auto}
html[data-theme=light] .demo-theme .distribution-legend span {overflow-wrap:anywhere;line-height:1.5}
html[data-theme=light] .demo-theme .distribution-legend>.dashboard-empty {
  display:block;
  padding:12px 0;
  text-align:left;
  line-height:1.65;
}
html[data-theme=light] .demo-theme .channel-status {background:#eef3f8;color:var(--gold-light-muted)}
html[data-theme=light] .demo-theme :is(.channel-status.online,.poll-state.enabled,.enable-polling) {
  background:#eaf7ef;
  border-color:#79ae8b;
  color:var(--gold-light-good);
}
html[data-theme=light] .demo-theme :is(.channel-status.waiting,.poll-state.disabled,.disable-polling) {
  background:#fff6e7;
  border-color:#c9974d;
  color:var(--gold-light-warning);
}
html[data-theme=light] .demo-theme .disable-polling:hover {background:#ffecd0;border-color:#a97223}
html[data-theme=light] .demo-theme .enable-polling:hover {background:#d9f0e1;border-color:#42865b}
html[data-theme=light] .demo-theme :is(.enable-polling,.disable-polling):focus-visible {outline:3px solid #126bca;outline-offset:3px}
html[data-theme=light] .demo-theme :is(.dashboard-good,.ok-text,.negative-change) {color:var(--gold-light-good)!important}
html[data-theme=light] .demo-theme :is(.dashboard-warn,.warn-text,.positive-change) {color:var(--gold-light-warning)!important}

/* Keep the equipment drawing intact; theme the surrounding information panels. */
html[data-theme=light] .demo-theme .campus-callout span {color:#000}
html[data-theme=light] .demo-theme :is(.switchgear-sidebar section,.ol-summary-sidebar section,.ol-system-status,.one-line-ops-strip section,.one-line-alarm-strip) {
  background:#fff;
  color:var(--gold-light-text);
  border-color:var(--gold-light-border);
}
html[data-theme=light] .demo-theme :is(.switchgear-sidebar h3,.ol-summary-sidebar h3) {
  background:var(--gold-light-soft);
  color:var(--gold-light-text);
  border-color:var(--gold-light-border);
}
html[data-theme=light] .demo-theme :is(.summary-list>div,.alarm-summary-list>div) {background:#fff;border-color:var(--gold-light-border)}
html[data-theme=light] .demo-theme :is(.summary-list span,.alarm-summary-list span,.gear-legend,.one-line-ops-strip span,.one-line-alarm-strip) {color:var(--gold-light-muted);font-size:11px}
html[data-theme=light] .demo-theme :is(.summary-list strong,.alarm-summary-list strong,.one-line-ops-strip strong,.one-line-alarm-strip>span,.one-line-alarm-strip strong,.no-alarm-row strong) {color:var(--gold-light-text)}
html[data-theme=light] .demo-theme :is(.severity-high,.severity-high span) {color:var(--gold-light-danger)!important}
html[data-theme=light] .demo-theme .severity-medium span {color:#97500b}
html[data-theme=light] .demo-theme .severity-low span {color:#795500}
html[data-theme=light] .demo-theme .one-line-ops-strip {background:var(--gold-light-border);border-color:var(--gold-light-border)}
html[data-theme=light] .demo-theme .energized-line {color:var(--gold-light-good)}
html[data-theme=light] .demo-theme :is(.trend-title,.trend-table-head,.pq-detector-card) {border-color:var(--gold-light-border)}
html[data-theme=light] .demo-theme :is(.pq-detector-card span,.pq-reference-note,.no-alarm-row small) {color:var(--gold-light-muted)}
html[data-theme=light] .demo-theme .meters-devices-panel #deviceEditor {scrollbar-color:#8da6b9 #f3f7fc}
html[data-theme=light] .demo-theme .meters-devices-panel #deviceEditor::-webkit-scrollbar-track {background:#f3f7fc;border-color:#cddae4}
html[data-theme=light] .demo-theme .meters-devices-panel #deviceEditor::-webkit-scrollbar-thumb {background:#8da6b9;border-color:#f3f7fc}
html[data-theme=light] .demo-theme .meters-devices-panel #deviceEditor::-webkit-scrollbar-thumb:hover {background:#6b879e}

/* COMTRADE analysis: all engineering values remain legible in light mode. */
html[data-theme=light] .demo-theme :is(.ct-event-content>div,.ct-seq-group,.ct-cursor-readout,.ct-channel-check,.ct-phasor-wrap canvas) {background:#f3f7fc;border-color:var(--gold-light-border);color:var(--gold-light-text)}
html[data-theme=light] .demo-theme :is(.ct-event-content strong,.ct-seq-group strong,.ct-seq-group span,.ct-cursor-readout strong) {color:var(--gold-light-text)}
html[data-theme=light] .demo-theme :is(.ct-event-content span,.ct-seq-group small,.ct-cursor-readout span,.ct-cursor-readout small,.ct-toolbar label,.ct-channel-check small,.ct-no-data,.ct-event-marker-legend) {color:var(--gold-light-muted)}
html[data-theme=light] .demo-theme .ct-channel-check {color:var(--gold-light-text)!important}
html[data-theme=light] .demo-theme .ct-channel-check:has(input:checked) {background:#eaf1f9;border-color:#7197c0}
html[data-theme=light] .demo-theme .ct-channel-check:focus-within {outline:2px solid #126bca;outline-offset:2px}
html[data-theme=light] .demo-theme .ct-phasor-wrap canvas {background:#fff}
html[data-theme=light] .demo-theme .ct-event-marker-legend .pre {background:#71859b}
html[data-theme=light] .demo-theme .ct-event-marker-legend .post {background:#48765a}
