/* Energy's EMIS modules: Cockpit and Distribution (CockpitPage, DistributionPage, the single-line). Linked after emis.css (Components\App.razor); only the theme's tokens and emis.css's. */


/* ---- Cockpit ---- */
.em-alert .em-status { min-width: 92px; }
.em-alert .em-alert-kind { min-width: 110px; }

/* ---- Distribution: the single-line (EmSingleLine) ---- */
.em-sl { overflow-x: auto; padding-bottom: 6px; }
.em-sl-top { display: flex; justify-content: center; }
.em-sl-top .em-sl-box { width: 240px; }
.em-sl-bus {
  height: 0;
  border-top: 4px solid var(--text);
  margin: 12px calc(100% / var(--em-sl-cols) / 2) 0;
  min-width: calc(150px * var(--em-sl-cols) - 150px);
  position: relative;
}
.em-sl-bus::before { content: ""; position: absolute; left: 50%; top: -16px; height: 12px; border-left: 2px solid var(--text); }
.em-sl-boards { display: grid; grid-template-columns: repeat(var(--em-sl-cols), minmax(150px, 1fr)); gap: 8px; min-width: calc(158px * var(--em-sl-cols)); }
.em-sl-col { display: flex; flex-direction: column; align-items: stretch; }
.em-sl-drop { height: 12px; border-left: 2px solid var(--text); margin-left: 50%; }
.em-sl-loads { display: grid; gap: 6px; margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--border); }
.em-sl-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.78rem;
  min-width: 0;
}
.em-sl-source { background: var(--accent-soft); border-color: var(--accent); }
.em-sl-board { background: var(--panel); border: 2px solid var(--text); }
.em-sl-off { opacity: 0.6; }
.em-sl-code { font-family: ui-monospace, Consolas, monospace; font-size: 0.7rem; color: var(--muted); }
.em-sl-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.em-sl-kw { font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.em-sl-bar { height: 5px; background: var(--chip); border-radius: 3px; overflow: hidden; margin: 3px 0; }
.em-sl-bar span { display: block; height: 100%; background: var(--em-s1); }
.em-sl-bar span.em-sl-over { background: var(--warn); }
.em-sl-meta { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 0.7rem; }
.em-sl-tag { font-weight: 700; color: var(--good-text); }
.em-sl-tag.em-sl-est { color: var(--warn); font-style: italic; }
.em-sl-key { display: inline-block; width: 18px; height: 5px; border-radius: 3px; background: var(--em-s1); }
.em-sl-key-over { background: var(--warn); }

/* ---- Distribution: the sectors ---- */
.em-dist-sector { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--panel-2); }
.em-dist-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin-bottom: 8px; }
.em-dist-sector .em-hbar { grid-template-columns: minmax(120px, 190px) 1fr minmax(80px, auto); }
.em-cockpit-load .em-chart svg { max-height: none; }
.em-act { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .em-act { grid-template-columns: 1fr; } }
