/* Reserve feedback space above the status controls so messages never move them. */
body > header {
  padding-top:calc(max(12px, var(--safe-top, 0px)) + 24px);
}
body > header > .header-right { position:relative; }
body > header #headerFeedbackPill {
  position:absolute;
  right:0;
  bottom:calc(100% + 6px);
  width:max-content;
  max-width:calc(100vw - 32px);
  box-sizing:border-box;
  overflow:hidden;
  pointer-events:none;
  font-size:11px;
  line-height:16px;
}
@media(max-width:768px) {
  body > header { padding-top:calc(max(8px, var(--safe-top, 0px)) + 24px); }
}

.workflow-health-ftp-notice { position:fixed; z-index:20040; top:54px; right:8px; width:430px; max-width:calc(100vw - 16px); box-sizing:border-box;
  display:flex; align-items:center; gap:10px; padding:12px 14px; border:1px solid #f87171; border-radius:9px; background:#451a1a; color:#fff1f2; box-shadow:0 5px 18px #0004; font:12px/1.4 system-ui,sans-serif; }
.workflow-health-ftp-notice[hidden] { display:none !important; }
.workflow-health-ftp-notice>div { min-width:0; flex:1; }
.workflow-health-ftp-notice strong { display:block; font-size:16px; margin-bottom:3px; }
.workflow-health-ftp-notice span { display:block; color:#fecaca; }
.workflow-health-ftp-notice button { flex-shrink:0; min-height:40px; padding:6px 9px; border:1px solid #f8717180; border-radius:6px; background:transparent; color:#fff1f2; cursor:pointer; font:inherit; }
.workflow-health-ftp-notice button:last-child { font-size:22px; min-width:36px; padding:4px; border:0; }
.workflow-health-ftp-warning { border:1px solid #f87171; background:#451a1a; color:#fff1f2; padding:12px; border-radius:8px; margin:0 0 12px; }
.workflow-health-ftp-warning strong { font-size:16px; }
.workflow-health-ftp-warning p { margin:6px 0 0; color:#fecaca; font-size:12px; }
.workflow-health-ftp-failures { margin:0 0 12px; padding:12px; border:1px solid #f87171; border-radius:8px; background:#451a1a; color:#fff1f2; }
.workflow-health-ftp-failures strong { font-size:14px; }
.workflow-health-ftp-failures p { margin:6px 0; color:#fecaca; font-size:11px; overflow-wrap:anywhere; }
.workflow-health-ftp-failures button { margin-top:5px; padding:5px 9px; border:1px solid #f8717180; border-radius:6px; background:transparent; color:#fff1f2; cursor:pointer; }
.header-status-indicators { display:none !important; }
.workflow-health { display:flex; align-items:center; flex-shrink:0; }
.workflow-health button, .workflow-health-mobile-viewer {
  display:flex; align-items:center; justify-content:center; gap:5px; width:36px; height:32px;
  padding:0; margin:0; border:1px solid var(--border-subtle,#334155); border-radius:0;
  background:var(--bg-panel,#1e293b); color:var(--text,#e2e8f0); cursor:pointer; font:12px/1 system-ui,sans-serif;
}
.workflow-health button:first-child { border-radius:6px 0 0 6px; }
.workflow-health button:nth-child(3) { border-radius:0 6px 6px 0; }
.workflow-health button+button { border-left:0; }
.workflow-health button.workflow-health-ftp-failure { background:#7f1d1d; border-color:#f87171; color:#fff1f2; }
.workflow-health button.workflow-health-ftp-failure .workflow-health-symbol { display:grid; place-items:center; width:17px; height:17px; border-radius:50%; background:#ef4444; color:white; font-weight:800; }
.workflow-health .workflow-health-aggregate { display:none; }
.workflow-health-symbol { font-weight:600; font-size:12px; font-variant-numeric:tabular-nums; }
[data-level="ok"] .workflow-health-symbol, .workflow-health-state[data-level="ok"] { color:#22c55e; }
[data-level="warning"] .workflow-health-symbol, .workflow-health-state[data-level="warning"] { color:#f59e0b; }
[data-level="error"] .workflow-health-symbol, .workflow-health-state[data-level="error"] { color:#ef4444; }
[data-level="idle"] .workflow-health-symbol, [data-level="unknown"] .workflow-health-symbol { color:var(--text-muted,#94a3b8); }
/* Animate only the existing symbol/ring; warnings keep their own colour. */
.workflow-health-receiving[data-level="ok"] .workflow-health-symbol {
  animation:workflow-health-receive 1.8s ease-in-out infinite;
}
@keyframes workflow-health-receive {
  0%,100% { color:#22c55e; }
  50% { color:#60a5fa; }
}
@media(prefers-reduced-motion:reduce) {
  .workflow-health-receiving[data-level="ok"] .workflow-health-symbol { animation:none; color:#60a5fa; }
}
.workflow-health button:focus-visible,.workflow-health-mobile-viewer:focus-visible,#workflowHealthPanel button:focus-visible { outline:2px solid var(--accent,#60a5fa); outline-offset:2px; }
#workflowHealthPanel { position:fixed; z-index:20050; width:350px; max-width:calc(100vw - 16px); overflow:auto;
  border:1px solid var(--border-subtle,#334155); border-radius:10px; background:var(--bg-panel,#1e293b);
  color:var(--text,#e2e8f0); box-shadow:0 8px 28px #0005; padding:0; font:13px/1.45 system-ui,sans-serif; }
#workflowHealthPanel[hidden] { display:none; }
.workflow-health-heading { display:flex; align-items:center; justify-content:space-between; padding:7px 8px 7px 14px; }
#workflowHealthClose { width:38px; height:38px; padding:0; border:0; background:transparent; color:var(--text-muted,#94a3b8); font-size:22px; cursor:pointer; }
#workflowHealthContent { padding:0 14px 12px; }
.workflow-health-project { color:var(--text-muted,#94a3b8); font-size:11px; margin:0 0 10px; }
.workflow-health-person { display:block; padding:11px 12px; margin:0 0 10px; border:1px solid var(--border-subtle,#334155); border-radius:9px; background:var(--bg-page,#0f172a); }
.workflow-health-person>.workflow-health-row { padding:0 0 9px; gap:10px; align-items:center; }
.workflow-health-person>.workflow-health-row strong { min-width:0; overflow-wrap:anywhere; font-size:13px; }
.workflow-health-person .workflow-health-state { flex-shrink:0; font-size:11px; }
.workflow-health-total { display:flex; flex-direction:column; gap:3px; margin:0 0 12px; padding:9px 0 12px; border-bottom:1px solid var(--border-subtle,#334155); }
.workflow-health-total>strong { font-size:20px; line-height:1.25; font-weight:650; font-variant-numeric:tabular-nums; }
.workflow-health-caption,.workflow-health-timestamp,.workflow-health-metric>span { color:var(--text-muted,#94a3b8); font-size:10px; }
.workflow-health-speed-row { display:flex; align-items:baseline; justify-content:space-between; flex-wrap:wrap; gap:3px 10px; margin:3px 0 10px; }
.workflow-health-speed { display:flex; align-items:baseline; gap:5px; color:var(--text,#e2e8f0); }
.workflow-health-speed strong { font-size:22px; line-height:1.2; font-weight:650; font-variant-numeric:tabular-nums; }
.workflow-health-speed>span { font-size:11px; }
.workflow-health-timestamp { white-space:nowrap; }
.workflow-health-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px 14px; }
.workflow-health-metric { display:flex; flex-direction:column; gap:2px; min-width:0; }
.workflow-health-metric>strong { font-size:12px; font-weight:550; font-variant-numeric:tabular-nums; }
.workflow-health-averages { border-top:1px solid var(--border-subtle,#334155); margin-top:10px; }
.workflow-health-averages summary { padding-top:9px; color:var(--text-muted,#94a3b8); font-size:10px; cursor:pointer; }
.workflow-health-averages[open] summary { margin-bottom:10px; }
.workflow-health-row { display:flex; align-items:flex-start; justify-content:space-between; gap:12px; padding:6px 0; }
.workflow-health-row strong { font-size:12px; font-weight:600; }
.workflow-health-state { font-size:11px; text-align:right; max-width:65%; }
.workflow-health-note { color:var(--text-muted,#94a3b8); font-size:11px; line-height:1.5; margin:5px 0; }
.workflow-health-live { color:var(--accent,#38bdf8); font-size:12px; font-weight:600; margin:0 0 9px; }
.workflow-health-footer { margin:10px 0 0; padding-top:10px; border-top:1px solid var(--border-subtle,#334155); color:var(--text-muted,#94a3b8); font-size:10px; }
.workflow-health-history summary { cursor:pointer; font-size:12px; padding:10px 0; }
.workflow-health-ftp-recent { margin-top:12px; padding-top:12px; border-top:1px solid var(--border-subtle,#334155); }
.workflow-health-ftp-recent>strong { font-size:12px; font-weight:600; }
.workflow-health-ftp-table-scroll { max-width:100%; overflow-x:auto; }
.workflow-health-ftp-recent table { width:100%; min-width:max-content; border-collapse:collapse; margin-top:7px; font-size:11px; }
.workflow-health-ftp-recent thead th { color:var(--text-muted,#94a3b8); font-size:10px; font-weight:500; text-align:center; white-space:nowrap; }
.workflow-health-ftp-recent th,.workflow-health-ftp-recent td { padding:7px 10px; border-bottom:1px solid var(--border-subtle,#334155); }
.workflow-health-ftp-recent th:first-child { min-width:145px; max-width:225px; padding-left:0; text-align:left; overflow-wrap:anywhere; }
.workflow-health-ftp-recent tbody th { font-weight:500; }
.workflow-health-ftp-recent td { min-width:72px; text-align:center; font-size:15px; line-height:1; }
.workflow-health-ftp-recent tr:last-child th,.workflow-health-ftp-recent tr:last-child td { border-bottom:0; }
.workflow-health-ftp-more { display:block; margin:10px 0 0 auto; padding:5px 10px; border:1px solid var(--border-subtle,#334155); border-radius:6px; background:var(--bg-panel,#1e293b); color:var(--text,#e2e8f0); cursor:pointer; font:inherit; }
.workflow-health-ftp-modal { position:fixed; inset:0; z-index:20100; display:flex; align-items:center; justify-content:center; padding:16px; background:#0009; }
.workflow-health-ftp-modal[hidden] { display:none; }
.workflow-health-ftp-dialog { display:flex; flex-direction:column; width:min(100%,1000px); max-height:min(90vh,900px); border:1px solid var(--border-subtle,#334155); border-radius:10px; background:var(--bg-panel,#1e293b); color:var(--text,#e2e8f0); box-shadow:0 16px 48px #0008; }
.workflow-health-ftp-dialog-heading,.workflow-health-ftp-dialog-footer { display:flex; align-items:center; gap:10px; padding:12px 16px; }
.workflow-health-ftp-dialog-heading { justify-content:space-between; border-bottom:1px solid var(--border-subtle,#334155); }
.workflow-health-ftp-dialog-heading strong { font-size:16px; }
.workflow-health-ftp-dialog-content { min-height:80px; overflow:auto; padding:8px 16px; }
.workflow-health-ftp-dialog-content .workflow-health-ftp-table-scroll { overflow-x:visible; }
.workflow-health-ftp-dialog-content table { width:100%; min-width:max-content; border-collapse:collapse; font-size:12px; }
.workflow-health-ftp-dialog-content th,.workflow-health-ftp-dialog-content td { padding:8px 10px; border-bottom:1px solid var(--border-subtle,#334155); }
.workflow-health-ftp-dialog-content thead th { position:sticky; top:-8px; background:var(--bg-panel,#1e293b); color:var(--text-muted,#94a3b8); font-size:11px; text-align:center; }
.workflow-health-ftp-dialog-content th:first-child { min-width:170px; text-align:left; }
.workflow-health-ftp-dialog-content td { min-width:80px; text-align:center; font-size:16px; }
.workflow-health-ftp-dialog-footer { justify-content:flex-end; border-top:1px solid var(--border-subtle,#334155); }
.workflow-health-ftp-dialog-footer span { margin-right:auto; color:var(--text-muted,#94a3b8); font-size:11px; }
.workflow-health-ftp-dialog button { padding:6px 10px; border:1px solid var(--border-subtle,#334155); border-radius:6px; background:transparent; color:inherit; cursor:pointer; font:inherit; }
.workflow-health-ftp-dialog button[hidden] { display:none; }
.workflow-health-ftp-dialog-heading button { border:0; font-size:23px; line-height:1; }
.workflow-health-mobile-viewer { flex-shrink:0; border:0; border-radius:50%; width:36px; height:44px; background:transparent; }
.workflow-health-mobile-viewer .workflow-health-symbol { border:1.5px solid currentColor; width:22px; height:22px; border-radius:50%; display:grid; place-items:center; }
#mvProjectInfo { min-width:0; }
@media(max-width:900px) {
  .workflow-health button { display:none; }
  .workflow-health .workflow-health-aggregate { display:flex; border:0; border-radius:0; width:28px; height:38px; background:transparent; }
  .workflow-health-aggregate .workflow-health-symbol { display:grid; place-items:center; width:21px; height:21px; border:1.5px solid currentColor; border-radius:50%; }
}
@media(pointer:coarse) {
  .workflow-health .workflow-health-aggregate { height:44px; width:32px; }
  #workflowHealthClose { width:44px; height:44px; }
}

.workflow-health-service-compact { display:inline-flex; gap:5px; margin-right:12px; }
.workflow-health-queues { margin:0 0 14px; padding:12px; border:1px solid var(--border-subtle,#334155); border-radius:8px; }
.workflow-health-queues>strong { font-size:12px; }
.workflow-health-queue { display:grid; grid-template-columns:minmax(0,1fr) minmax(110px,1fr); align-items:center; gap:4px 12px; padding-top:10px; }
.workflow-health-queue>strong { font-size:11px; font-weight:500; }
.workflow-health-queue .workflow-health-metric>span { font-size:10px; color:var(--text-muted,#94a3b8); }
.workflow-health-queue .workflow-health-metric>strong { font-size:18px; }
.workflow-health-queue>.workflow-health-note { grid-column:2; margin:0; }
.workflow-health-service-compact .workflow-health-state { max-width:none; }
.workflow-health-service-compact strong { font-size:11px; }
.workflow-health button:hover { background:var(--bg-panel,#1e293b); }
.workflow-health .workflow-health-aggregate:hover,
#mvHeader .workflow-health-mobile-viewer,
#mvHeader .workflow-health-mobile-viewer:hover,
#mvFsHeader .workflow-health-mobile-viewer,
#mvFsHeader .workflow-health-mobile-viewer:hover { background:transparent; border:0; }
