/* =====================================================================
   OPS UI — war room, metrics, digest, source controls
   ===================================================================== */

.war-btn { gap: 6px; }
.war-btn .war-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--fg-faint); }
.war-btn.on { color: var(--red); border-color: rgba(248, 113, 113, 0.55); background: rgba(248, 113, 113, 0.08); }
.war-btn.on .war-dot { background: var(--red); animation: warpulse 1.2s ease-in-out infinite; }
@keyframes warpulse { 50% { opacity: 0.35; } }

.war-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.16), rgba(248, 113, 113, 0.04));
  border-bottom: 1px solid rgba(248, 113, 113, 0.35);
  font-family: var(--mono);
  font-size: 10px;
  color: var(--fg-dim);
  position: relative;
  z-index: 40;
}
.war-badge {
  color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.5);
  border-radius: 2px;
  padding: 1px 6px;
  letter-spacing: 0.16em;
  font-weight: 700;
  white-space: nowrap;
}
.war-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.war-meta { color: var(--fg-faint); white-space: nowrap; }
.war-exit { height: 24px; padding: 0 8px; font-size: 9px; }

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.metrics-grid .card { margin: 0; }
.metrics-grid .card h2 { margin-bottom: 10px; }

.metric-bar-wrap { margin: 9px 0; }
.metric-bar-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--fg-faint);
  margin-bottom: 4px;
}
.metric-bar-label b { color: var(--fg-dim); font-weight: 500; }
.metric-bar { height: 5px; background: var(--bg-3); border-radius: 3px; overflow: hidden; }
.metric-bar i { display: block; height: 100%; border-radius: 3px; }

.digest-pre {
  max-height: 340px;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.55;
  color: var(--fg-dim);
  white-space: pre-wrap;
}

/* source controls */
.source-controls {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-2);
}
.source-ctl-row {
  display: grid;
  grid-template-columns: 1fr 110px 100px;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--fg-dim);
}
.source-ctl-row:last-child { border-bottom: 0; }
.sc-name { display: flex; flex-direction: column; }
.sc-desk {
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-top: 1px;
}
.sc-weight {
  background: var(--bg);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 4px 6px;
  font-size: 10px;
  color: var(--fg-dim);
}
.sc-toggle { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 9px; color: var(--fg-faint); }
.sc-toggle input { accent-color: var(--red); }

/* Keep the war-room banner out of the app grid (avoids reflowing the panel layout). */
.war-banner {
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  z-index: 45;
  backdrop-filter: blur(8px);
}
#app:has(.war-banner) #main { padding-top: 32px; }
