/* public/runs.css — v0.27.0
 *
 * Runs view polish:
 *   1. "Orbit" running indicator — a circular "R" monogram with 3 arc
 *      satellites of differing radii/speeds orbiting it. CSS-only,
 *      respects prefers-reduced-motion (falls back to a soft pulse).
 *      Used in two places:
 *        - .lt-orbit  (large, ~22px) inside the Live-thinking header,
 *          shown only while that header carries .lt-header-running.
 *        - .lt-orbit.lt-orbit-sm (small, ~14px) beside the status pill
 *          for "running" rows in the main Runs table.
 *   2. Mid-run chat bubbles (.lt-user-msg) — right-aligned, accent-bordered
 *      "You: …" lines appended to the Live-thinking panel when the
 *      operator sends a message.
 *   3. Per-row run actions (Stop / Resume / Delete) in the main Runs
 *      table + drawer footer — replaces the removed Recent-runs strip.
 *
 * Namespaced — no global resets. Uses the portal's --primary tokens
 * (indigo, see portal-fixes.css) as the default accent, with the
 * Live-thinking panel overriding to its own purple (#7c3aed) to match
 * that panel's existing "Ravya thinking" palette.
 */

/* ---------------------------------------------------------------------
   1. Orbit running indicator
--------------------------------------------------------------------- */
.lt-orbit {
  --orbit-accent: var(--primary, #4f46e5);
  --orbit-accent-soft: var(--primary-soft, #f3ecfe);
  --orbit-accent-border: var(--primary-border, #c7d2fe);
  position: relative;
  display: none; /* shown explicitly per-context below */
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  vertical-align: middle;
}

/* Large variant: only visible while the Live-thinking header is running. */
#live-thinking-header.lt-header-running .lt-orbit {
  display: inline-block;
  --orbit-accent: #7c3aed; /* match this panel's existing purple accent */
  --orbit-accent-soft: #ede9fe;
  --orbit-accent-border: #c4b5fd;
}

/* Small variant: injected next to the status pill for "running" rows in
   the main Runs table (app.js runStatusPill()). Always visible once
   present in the DOM — no header gating needed, the row itself IS the
   running row. */
.lt-orbit.lt-orbit-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 6px;
}

/* v0.28.0 — operator request: drop the rotating purple "R" monogram; use an
   abstract "orbiting dots" mark (like other AI assistants) instead. The
   markup is unchanged (core + 3 ring elements); the core is now a small
   breathing center dot and each ring is an invisible rotating wrapper whose
   ::before is a satellite dot. */
.lt-orbit-core {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 36%;
  height: 36%;
  margin: -18% 0 0 -18%;
  background: var(--orbit-accent);
  border-radius: 50%;
  animation: lt-orbit-pulse 2.2s ease-in-out infinite;
}

.lt-orbit-ring {
  position: absolute;
  border-radius: 50%;
  border: none;
}
.lt-orbit-ring::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
}
.lt-orbit-sm .lt-orbit-ring::before {
  width: 3.5px;
  height: 3.5px;
  margin-left: -1.75px;
}
/* Three dots, differing radii + speeds + rotation direction. */
.lt-orbit-ring-1 { inset: -2px; animation: lt-orbit-spin 1.2s linear infinite; }
.lt-orbit-ring-2 { inset: -5px; animation: lt-orbit-spin 2s linear infinite reverse; }
.lt-orbit-ring-3 { inset: -8px; animation: lt-orbit-spin 3.1s linear infinite; }
.lt-orbit-ring-1::before { background: var(--orbit-accent); }
.lt-orbit-ring-2::before { background: var(--orbit-accent-border); }
.lt-orbit-ring-3::before { background: var(--orbit-accent-soft); }

.lt-orbit-sm .lt-orbit-ring-1 { inset: -1px; }
.lt-orbit-sm .lt-orbit-ring-2 { inset: -3px; }
.lt-orbit-sm .lt-orbit-ring-3 { inset: -5px; }

@keyframes lt-orbit-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Reduced motion: kill the spinning rings, fall back to a soft pulse on
   the core monogram only. */
@media (prefers-reduced-motion: reduce) {
  .lt-orbit-ring { animation: none !important; opacity: 0.6; }
  .lt-orbit-core { animation: lt-orbit-pulse 2s ease-in-out infinite; }
}
@keyframes lt-orbit-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}

/* ---------------------------------------------------------------------
   2. Mid-run chat bubbles
--------------------------------------------------------------------- */
.lt-line.lt-user-msg {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 88%;
  margin: 6px 0 6px auto;
  padding: 6px 12px;
  background: #ede9fe;
  border-right: 3px solid #7c3aed;
  border-radius: 8px 3px 3px 8px;
  color: #4c1d95;
  font-style: normal;
}
.lt-user-msg-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.7;
}
.lt-user-msg-text { white-space: pre-wrap; word-break: break-word; }
.lt-msg-state { font-size: 10.5px; white-space: nowrap; opacity: 0.85; }
.lt-msg-sent   { color: #1e7d4a; }
.lt-msg-pending{ color: #64748b; }
.lt-msg-failed { color: #b3261e; }
.lt-msg-retry {
  background: none;
  border: none;
  padding: 0;
  margin-left: 2px;
  color: #b3261e;
  text-decoration: underline;
  cursor: pointer;
  font-size: 10.5px;
}

/* ---------------------------------------------------------------------
   3. Per-row run actions (Runs table + drawer footer)
--------------------------------------------------------------------- */
.run-row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.run-row-actions button {
  padding: 4px 10px;
  font-size: 11.5px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.run-row-actions .rra-stop {
  background: transparent;
  color: #8f1e17;
  border: 1px solid #e6a9a3;
}
.run-row-actions .rra-resume {
  background: var(--primary, #4f46e5);
  color: #fff;
  border: 1px solid var(--primary, #4f46e5);
}
.run-row-actions .rra-delete {
  background: transparent;
  color: #b3261e;
  border: 1px solid #f0c5c1;
}
.run-row-actions button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
