/* css/health.css — Model Health Monitor styles.
 * Scoped to .health-* classes plus IDs introduced by this feature.
 * Removing this file along with the health.js script and the DOM
 * placeholders (status-btn, telem-btn, status-panel) is a clean revert.
 */

/* ── Status / Telemetry buttons in the menubar ─────────────────────────── */

.pill-btn.pill-status,
.pill-btn.pill-telem {
  background: none;
  border: 1px solid var(--bd-panel);
  color: var(--fg-muted-2);
  padding: 5px 14px;
  font-size: 12px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.pill-btn.pill-status:hover { background: var(--bg-input); border-color: var(--bd-hover); color: var(--fg-muted); }
.pill-btn.pill-telem:hover:not(:disabled)  { background: var(--bg-input); border-color: var(--bd-hover); color: var(--fg-muted); }

/* The dot is a small circle whose state drives its colour. */
.status-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--bd-input);
  background: transparent;
  transition: background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.status-dot[data-state="idle"]   { background: transparent; border-color: var(--bd-input); }
.status-dot[data-state="green"]  { background: var(--accent-good-strong); border-color: var(--accent-good-strong); }
.status-dot[data-state="yellow"] { background: var(--accent-warn-soft); border-color: var(--accent-warn-soft); }
.status-dot[data-state="red"]    { background: var(--accent-bad); border-color: var(--accent-bad);
                                    box-shadow: 0 0 6px var(--accent-bad-glow); }

/* Telemetry button: green tint when data has been recorded; "off" italics
   marker when the user has the showTelemetry display flag off. */
.pill-btn.pill-telem.has-data {
  border-color: var(--accent-good-bd);
  color: var(--accent-good-text);
}
.pill-btn.pill-telem.has-data:hover { background: var(--accent-good-bg); border-color: var(--accent-good); color: var(--accent-good-text-h); }
.telem-off-marker em { font-style: italic; color: var(--fg-faint); font-weight: normal; }

/* Embed mode: hide the Status button. Telemetry button stays visible so
   embed viewers can open the chart if the model author has data flowing. */
body.embed-mode .pill-btn.pill-status { display: none !important; }

/* ── Floating Status panel (shape cloned from #prop-panel) ────────────── */

#status-panel {
  position: fixed;
  top: 116px;
  right: 250px;            /* clear of the prop-panel which sits at right:10px */
  width: 320px;
  background: var(--bg-panel);
  border: 1px solid var(--bd-panel);
  border-radius: 6px;
  box-shadow: 0 4px 18px var(--shadow-modal);
  z-index: 45;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 128px);
}

#status-panel-drag {
  padding: 6px 12px;
  background: var(--bg-panel-3);
  border-bottom: 1px solid var(--bd-panel);
  border-radius: 6px 6px 0 0;
  cursor: grab;
  display: flex;
  align-items: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-faint);
  user-select: none;
  flex-shrink: 0;
}
#status-panel-drag:active { cursor: grabbing; }

#status-panel-content {
  overflow-y: auto;
  flex: 1;
  padding: 8px 0;
}

#status-entries .health-entry {
  padding: 10px 14px;
  border-bottom: 1px solid var(--bd-faint);
  font-size: 12px;
  line-height: 1.45;
  color: var(--fg);
  cursor: pointer;
  transition: background 0.1s;
}
#status-entries .health-entry:hover {
  background: var(--bg-panel-2);
}
#status-entries .health-entry:last-child { border-bottom: none; }

.health-entry-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-weight: 600;
}
.health-entry-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  text-align: center;
  font-size: 10px;
  line-height: 14px;
  color: var(--fg-strongest);
  flex-shrink: 0;
}
.health-entry[data-severity="error"]    .health-entry-icon { background: var(--accent-bad); }
.health-entry[data-severity="warning"]  .health-entry-icon { background: var(--accent-warn-soft); color: var(--accent-warn-icon-fg); }
.health-entry[data-severity="info"]     .health-entry-icon { background: var(--accent-slider); }
.health-entry[data-severity="advisory"] .health-entry-icon { background: var(--accent-advisory); }
.health-entry[data-severity="error"]    .health-entry-icon::before { content: '!'; }
.health-entry[data-severity="warning"]  .health-entry-icon::before { content: '!'; }
.health-entry[data-severity="info"]     .health-entry-icon::before { content: 'i'; font-style: italic; }
.health-entry[data-severity="advisory"] .health-entry-icon::before { content: '·'; }

.health-entry-element {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px;
  color: var(--fg-muted-2);
  margin-left: auto;
}
.health-entry-message  { color: var(--fg); }
.health-entry-derivation {
  margin-top: 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 10.5px;
  color: var(--fg-faint);
}
.health-entry-remedy {
  margin-top: 4px;
  font-size: 11px;
  color: var(--fg-fainter);
  font-style: italic;
}

/* Action buttons inside a status entry (Static-mode probe banner buttons:
 * Watch ShelterLab / Watch Planck / Skip to static result / Re-analyze). */
.health-entry-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.health-entry-action-btn {
  background: var(--bg-hover);
  border: 1px solid var(--bd-input-hover);
  color: var(--fg-mid);
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 3px;
  cursor: pointer;
  font-family: inherit;
}
.health-entry-action-btn:hover {
  background: var(--bd-input);
  border-color: var(--bd-hover);
  color: var(--fg-strongest);
}
.health-entry-action-btn:active {
  background: var(--bg-panel-3);
}
.health-entry-action-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  background: var(--bg-panel-2);
  color: var(--fg-fainter);
}
.health-entry-action-btn[disabled]:hover {
  background: var(--bg-panel-2);
  border-color: var(--bd-input-hover);
  color: var(--fg-fainter);
}
