/* ============================================================
   LabLoop — Plan/Schedule/Execute/Observe/Optimize demo.
   Self-contained: uses only tokens already defined in style.css
   (plus the --cd-well-* palette redeclared here so the shared
   plate-grid renderer resolves them outside .cd-demo).
   ============================================================ */

.ll-loop {
  --cd-well-buffer: rgba(255,255,255,0.05);
  --cd-well-vehicle: rgba(194,200,222,0.5);
  --cd-well-positive: var(--c-rose);
  --cd-well-untreated: rgba(255,255,255,0.14);
  --cd-well-drug-1: rgba(47,224,201,0.28);
  --cd-well-drug-2: rgba(47,224,201,0.5);
  --cd-well-drug-3: rgba(47,224,201,0.75);
  --cd-well-drug-4: #2fe0c9;

  display: flex;
  flex-direction: column;
  border: 1px solid var(--c-line);
  border-radius: var(--r-xl);
  background: var(--c-surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* ---------- topbar ---------- */
.ll-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 8px 18px;
  border-bottom: 1px solid var(--c-line);
  background: var(--c-bg-1);
}
.ll-wordmark { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; white-space: nowrap; }
.ll-word-fl { color: #5b79f7; }
.ll-word-os { color: #00c1b9; }
.ll-sim-badge { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--c-ink-3); }
.ll-sim-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-teal); box-shadow: 0 0 0 3px rgba(47,224,201,0.16); }

/* ---------- main layout: ring left, chat/card panel right on desktop; stacks on narrow screens ---------- */
.ll-main {
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr;
  align-items: stretch;
  min-height: 0;
}
.ll-diagram {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 20px;
  border-right: 1px solid var(--c-line);
  background: var(--c-bg-1);
}
.ll-panel {
  width: 100%;
  min-width: 0;
  position: relative;
  height: auto;
  /* tall enough that a stage's whole exchange fits without scrolling
     internally — see the ll-scroll-up transition below for how the panel
     clears itself between stages instead. */
  min-height: clamp(460px, 68vh, 640px);
}
@media (max-width: 860px) {
  .ll-main { grid-template-columns: 1fr; }
  .ll-diagram { padding: 20px 18px 14px; border-right: none; border-bottom: 1px solid var(--c-line); }
  .ll-panel { min-height: 0; height: clamp(420px, 62vh, 560px); }
}
@media (max-width: 640px) {
  .ll-diagram { padding: 16px 14px 10px; }
  .ll-panel { height: clamp(380px, 60vh, 500px); }
}

.ll-footer { padding: 5px 18px; border-top: 1px solid var(--c-line); font-size: 10.5px; color: var(--c-ink-4); background: var(--c-bg-1); }

/* ---------- ring wrap ---------- */
.ll-ring-wrap {
  position: relative;
  width: min(260px, 92%);
  aspect-ratio: 1 / 1;
}
.ll-ring-svg { width: 100%; height: 100%; overflow: visible; }
.ll-ring-guide { fill: none; stroke: var(--c-line); stroke-width: 1.4; }
.ll-ring-arc {
  fill: none; stroke: var(--c-line-2); stroke-width: 3.6; stroke-linecap: round;
  transition: stroke 0.3s var(--ease), opacity 0.3s var(--ease);
}
.ll-ring-arc.is-lit { stroke: rgba(47,224,201,0.35); }
.ll-ring-arc.is-hover { stroke: var(--c-teal-soft); }
.ll-ring-arc.is-active { stroke: var(--c-teal); }
.ll-ring-progress {
  fill: none; stroke: var(--c-teal); stroke-width: 3.6; stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(47,224,201,0.5));
}
.ll-ring-marker {
  fill: var(--c-teal-soft);
  filter: drop-shadow(0 0 3px rgba(47,224,201,0.7));
  transition: opacity 0.2s var(--ease);
}

/* tributary lines/icons (decorative, in-SVG) */
.ll-trib-line { fill: none; stroke: var(--c-line-2); stroke-width: 0.7; stroke-dasharray: 1.6 1.4; }
.ll-trib-line-light { stroke-width: 0.5; opacity: 0.6; }
.ll-trib-line.is-active { stroke: var(--c-iris-soft); animation: llDash 0.9s linear infinite; }
@keyframes llDash { to { stroke-dashoffset: -6; } }
.ll-trib-icon-bg { fill: var(--c-surface-2); stroke: var(--c-line-2); stroke-width: 0.5; }
.ll-trib-icon.is-active .ll-trib-icon-bg { stroke: var(--c-iris-soft); animation: llTribPulse 1.4s ease-in-out infinite; }
@keyframes llTribPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }

/* center version tag */
.ll-ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; pointer-events: none; text-align: center;
}
.ll-ring-stage-label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--c-teal-soft); }
.ll-ring-version { font-family: var(--font-mono); font-size: 15px; font-weight: 600; color: var(--c-ink); transition: color 0.3s var(--ease); }
.ll-ring-version.ll-version-tick { animation: llVersionTick 0.9s var(--ease); }
@keyframes llVersionTick { 0% { color: var(--c-ink); } 35% { color: var(--c-teal-soft); transform: scale(1.08); } 100% { color: var(--c-ink); } }

/* stage + tributary overlay buttons */
.ll-stage-btn, .ll-trib-btn {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent; cursor: pointer; padding: 0;
  color: var(--c-ink-3);
}
.ll-stage-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--c-bg-1); border: 1px solid var(--c-line-2);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.ll-stage-btn:hover, .ll-stage-btn:focus-visible { color: var(--c-teal-soft); border-color: rgba(47,224,201,0.4); }
.ll-stage-btn.is-active { color: var(--c-teal); border-color: var(--c-teal); background: rgba(47,224,201,0.08); }
.ll-stage-ic { width: 16px; height: 16px; }

.ll-trib-btn {
  flex-direction: column; gap: 2px;
  width: auto; color: var(--c-ink-4);
}
.ll-trib-ic { width: 15px; height: 15px; }
.ll-trib-label { font-family: var(--font-mono); font-size: 8.5px; letter-spacing: 0.03em; white-space: nowrap; }
.ll-trib-btn.is-active, .ll-trib-btn:hover, .ll-trib-btn:focus-visible { color: var(--c-iris-soft); }

/* legend — hidden by default, shown under ~320px per spec */
.ll-legend { display: none; }
@media (max-width: 340px) {
  .ll-ring-wrap { width: 78vw; }
  .ll-legend {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px;
    font-family: var(--font-mono); font-size: 10.5px; color: var(--c-ink-3);
  }
  .ll-legend-btn { display: inline-flex; align-items: center; gap: 5px; border: none; background: none; color: inherit; cursor: pointer; padding: 2px; }
  .ll-legend-btn.is-active { color: var(--c-teal-soft); }
  .ll-legend-ic { width: 12px; height: 12px; }
}

/* controls */
.ll-controls { display: flex; gap: 10px; }
.ll-ctrl-btn {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-line-2); background: var(--c-surface-2); color: var(--c-ink-2);
  border-radius: var(--r-sm); font-size: 12px; line-height: 1; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.ll-ctrl-btn:hover { color: var(--c-ink); border-color: var(--c-teal); }

/* ---------- detail panel: mode switching ---------- */
.ll-panel-mode {
  position: absolute; inset: 0;
  overflow-y: auto; overscroll-behavior: contain;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s var(--ease);
  padding: 24px clamp(16px, 4vw, 40px);
  scrollbar-width: thin;
}
.ll-panel-mode.ll-mode-active { opacity: 1; pointer-events: auto; }
/* played just before a new stage's content starts: scrolls the previous
   stage's content up and out before the panel clears and refills */
.ll-panel-mode.ll-scroll-up {
  transition: transform 0.42s var(--ease), opacity 0.42s var(--ease);
  transform: translateY(-36px);
  opacity: 0;
}

/* ---------- chat thread ---------- */
.ll-chat-thread { display: flex; flex-direction: column; gap: 16px; }
.ll-msg { display: flex; align-items: flex-start; gap: 10px; max-width: 100%; }
.ll-msg-user { justify-content: flex-end; }
.ll-bubble {
  max-width: min(680px, 78%);
  padding: 12px 16px;
  border-radius: var(--r-lg);
  font-family: var(--font-mono);
  font-size: 13.5px; line-height: 1.65; letter-spacing: 0.01em;
  position: relative;
}
.ll-bubble-user { background: var(--c-surface-2); color: var(--c-ink-2); border: 1px solid var(--c-line-2); border-top-right-radius: 3px; }
.ll-bubble-assistant { background: rgba(47,224,201,0.06); color: var(--c-ink); border: 1px solid rgba(47,224,201,0.18); border-top-left-radius: 3px; }
.ll-bubble-proactive { border-color: rgba(193,88,240,0.35); background: rgba(193,88,240,0.06); padding-left: 30px; }
.ll-proactive-glyph {
  position: absolute; left: 10px; top: 11px;
  color: var(--c-iris-soft); font-size: 12px;
}
.ll-bubble-text { white-space: pre-wrap; }
.ll-typing::after {
  content: ''; display: inline-block; width: 6px; height: 12px; margin-left: 1px;
  background: var(--c-teal-soft); vertical-align: -2px;
  animation: llCaretBlink 0.9s step-end infinite;
}
@keyframes llCaretBlink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.ll-fade-in { animation: llFadeIn 0.2s ease both; }
@keyframes llFadeIn { from { opacity: 0; } to { opacity: 1; } }
.ll-thinking { display: none; align-items: center; gap: 3px; height: 16px; }
.ll-thinking.ll-visible { display: inline-flex; }
.ll-thinking i { width: 5px; height: 5px; border-radius: 50%; background: var(--c-teal-soft); animation: llThinkBounce 1s ease-in-out infinite; }
.ll-thinking i:nth-child(2) { animation-delay: 0.15s; }
.ll-thinking i:nth-child(3) { animation-delay: 0.3s; }
@keyframes llThinkBounce { 0%, 60%, 100% { opacity: 0.25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.ll-chat-takeaway {
  align-self: flex-start; max-width: 92%;
  font-size: 12.5px; font-weight: 700; color: var(--c-ink);
  padding: 10px 0 2px; border-top: 1px dashed var(--c-line); margin-top: 4px;
}

/* ---------- inline visuals (shared shell) ---------- */
.ll-visual {
  align-self: flex-start; width: 100%; max-width: 640px;
  border: 1px solid var(--c-line-2); border-radius: var(--r-lg);
  background: var(--c-surface-2); padding: 12px 14px;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.ll-visual.ll-in { opacity: 1; transform: translateY(0); }

.ll-chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.ll-chip-row:last-child { margin-bottom: 0; }
.ll-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 10.5px; padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--c-line-2); color: var(--c-ink-3); background: var(--c-surface);
  opacity: 0; transform: scale(0.92);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.ll-chip.ll-in { opacity: 1; transform: scale(1); }
.ll-chip-cite { color: var(--c-ink-2); }
.ll-chip-version { color: var(--c-teal-soft); border-color: rgba(47,224,201,0.3); }
.ll-chip-warn { color: var(--c-amber); border-color: rgba(240,179,62,0.3); }
.ll-warn-glyph { color: var(--c-amber); margin-right: 1px; }

/* plate visual */
.ll-plate-svg { width: auto; max-width: 100%; height: 190px; display: block; margin: 0 auto; }
.ll-plate-axis { font-family: var(--font-mono); font-size: 6px; fill: var(--c-ink-4); }
.ll-plate-axis-row { text-anchor: end; }
.ll-well { opacity: 0; transition: opacity 0.35s var(--ease); }
.ll-well.ll-in { opacity: 1; }
.ll-well-buffer { stroke: var(--c-line); stroke-width: 0.5; }
.ll-plate-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--c-line); }
.ll-plate-swatch { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--c-ink-3); }
.ll-swatch-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.ll-swatch-drug { background: linear-gradient(90deg, var(--cd-well-drug-1), var(--cd-well-drug-4)); }

/* instrument strip */
.ll-instrument-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.ll-instrument-badge {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10.5px; color: var(--c-ink-2);
  border: 1px solid var(--c-line-2); border-radius: 999px; padding: 6px 11px 6px 8px;
  background: var(--c-surface);
  opacity: 0; transform: scale(0.92);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.ll-instrument-badge.ll-in { opacity: 1; transform: scale(1); }
.ll-instrument-ic { width: 13px; height: 13px; }
.ll-instrument-sub { border-color: rgba(240,179,62,0.4); }
.ll-instrument-tag {
  position: absolute; top: -7px; right: -6px;
  font-size: 8px; letter-spacing: 0.03em; color: var(--c-bg);
  background: var(--c-amber); border-radius: 999px; padding: 1px 5px;
}

/* diff strip */
.ll-diff-strip { display: flex; flex-direction: column; gap: 6px; }
.ll-diff-row {
  display: flex; align-items: baseline; gap: 8px; font-size: 12px;
  opacity: 0; transform: translateX(-4px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.ll-diff-row.ll-in { opacity: 1; transform: translateX(0); }
.ll-diff-tag { font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--c-ink-4); flex: 0 0 32px; }
.ll-diff-from .ll-diff-text { color: var(--c-ink-4); }
.ll-diff-strike { text-decoration: line-through; text-decoration-color: rgba(240,97,111,0.5); }
.ll-diff-to .ll-diff-text { color: var(--c-teal-soft); font-weight: 600; }

/* ---------- visual-card shell (Schedule/Execute/Observe/Optimize lead-in) ---------- */
.ll-visual-shell { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.ll-caption-line {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--c-ink-3);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.ll-caption-line.ll-in { opacity: 1; }
.ll-card {
  border: 1px solid var(--c-line-2); border-radius: var(--r-lg);
  background: var(--c-surface-2); padding: 18px 20px;
}
.ll-card-takeaway {
  font-size: 13.5px; font-weight: 700; color: var(--c-ink);
  padding-top: 10px; border-top: 1px dashed var(--c-line);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.ll-card-takeaway.ll-in { opacity: 1; }

/* approval pill (Schedule card) */
.ll-approval-pill {
  display: flex; align-items: center; gap: 10px; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--c-line);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.ll-approval-pill.ll-in { opacity: 1; transform: translateY(0); }
.ll-avatar {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-size: 10px; font-weight: 700;
  border: 1px solid var(--c-line-2); color: var(--c-ink-3);
}
.ll-approval-body { display: flex; flex-direction: column; gap: 4px; }
.ll-approval-name { font-size: 12.5px; color: var(--c-ink-2); }
.ll-status-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px; color: var(--c-amber); width: fit-content; }
.ll-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-amber); animation: llPulse 1.6s ease-in-out infinite; }
@keyframes llPulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

/* execute card */
.ll-exec-track { position: relative; height: 8px; background: var(--c-surface); border-radius: 999px; margin: 30px 6px 6px; overflow: visible; }
.ll-exec-fill { position: absolute; inset: 0; width: 0%; border-radius: 999px; background: linear-gradient(90deg, rgba(47,224,201,0.5), var(--c-teal)); }
.ll-exec-dots { position: absolute; inset: 0; }
.ll-exec-dot-wrap { position: absolute; top: 50%; transform: translate(-50%, -50%); }
.ll-exec-dot { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--c-surface); border: 1.5px solid var(--c-line-2); transition: background 0.2s, border-color 0.2s, box-shadow 0.2s; }
.ll-exec-dot.ll-in { background: var(--c-teal); border-color: var(--c-teal); box-shadow: 0 0 6px rgba(47,224,201,0.6); }
.ll-exec-counter { margin-top: 20px; font-family: var(--font-mono); font-size: 13px; color: var(--c-ink); text-align: center; }
.ll-exec-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--c-line); justify-content: center; }
.ll-exec-legend-item { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px; color: var(--c-ink-4); transition: color 0.2s; }
.ll-exec-legend-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c-line-2); transition: background 0.2s, box-shadow 0.2s; }
.ll-exec-legend-dot.ll-in { background: var(--c-teal); box-shadow: 0 0 4px rgba(47,224,201,0.6); }
.ll-exec-legend-item:has(.ll-in) { color: var(--c-ink-2); }

/* observe card (control-well fluctuation + carry-over chart) */
.ll-observe-metrics { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--c-line); }
.ll-observe-metric-row {
  display: grid; grid-template-columns: 1fr 74px 74px; gap: 8px; align-items: baseline;
  font-size: 12px; opacity: 0; transform: translateY(4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.ll-observe-metric-row.ll-in { opacity: 1; transform: translateY(0); }
.ll-observe-metric-head {
  opacity: 1 !important; transform: none !important;
  font-family: var(--font-mono); font-size: 9.5px; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--c-ink-4);
}
.ll-observe-metric-label { color: var(--c-ink-3); }
.ll-observe-metric-predicted { color: var(--c-ink-3); font-family: var(--font-mono); }
.ll-observe-metric-observed { color: var(--c-amber); font-family: var(--font-mono); font-weight: 600; }
.ll-observe-chart-label { font-family: var(--font-mono); font-size: 10.5px; color: var(--c-ink-3); margin-bottom: 6px; }
.ll-observe-chart { width: 100%; max-width: 820px; aspect-ratio: 400 / 130; display: block; margin: 0 auto; }
.ll-observe-axis { stroke: var(--c-line-2); stroke-width: 1; }
.ll-observe-axis-label { font-family: var(--font-mono); font-size: 8px; fill: var(--c-ink-4); }
.ll-observe-sim-line { fill: none; stroke: var(--c-teal-soft); stroke-width: 1.6; stroke-dasharray: 3 3; opacity: 0; transition: opacity 0.4s var(--ease); }
.ll-observe-sim-line.ll-in { opacity: 1; }
.ll-observe-dot { fill: var(--c-iris-soft); stroke: var(--c-bg); stroke-width: 1; opacity: 0; transition: opacity 0.3s var(--ease); }
.ll-observe-dot.ll-in { opacity: 1; }
.ll-observe-dot.ll-observe-dev { fill: var(--c-rose); r: 4.6; }
.ll-observe-anomaly-tag { fill: var(--c-rose); font-size: 8px; opacity: 0; transition: opacity 0.3s var(--ease); }
.ll-observe-anomaly-tag.ll-in { opacity: 1; }
.ll-observe-legend { display: flex; gap: 14px; margin-top: 4px; font-size: 10.5px; color: var(--c-ink-4); }
.ll-observe-legend span { display: inline-flex; align-items: center; gap: 5px; }
.ll-observe-swatch { width: 10px; height: 2px; display: inline-block; border-radius: 1px; }
.ll-observe-swatch-line { background: var(--c-teal-soft); }
.ll-observe-swatch-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-iris-soft); }
.ll-observe-anomaly {
  margin-top: 12px; padding: 9px 11px; border-radius: var(--r-md);
  border: 1px solid rgba(240,179,62,0.3); background: rgba(240,179,62,0.06);
  font-size: 12px; line-height: 1.55; color: var(--c-ink-2); display: flex; gap: 7px;
  opacity: 0; transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.ll-observe-anomaly.ll-in { opacity: 1; transform: translateY(0); }

/* optimize lead-in card */
.ll-optimize-heading { font-family: var(--font-mono); font-size: 11px; color: var(--c-ink-3); margin-bottom: 10px; }
.ll-kb-strip { display: flex; flex-direction: column; gap: 8px; }
.ll-kb-chip {
  display: flex; flex-direction: column; gap: 2px;
  border: 1px solid var(--c-line-2); border-radius: var(--r-md); padding: 8px 11px; background: var(--c-surface);
  opacity: 0; transform: translateY(4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}
.ll-kb-chip.ll-in { opacity: 1; transform: translateY(0); }
.ll-kb-chip-label { font-family: var(--font-mono); font-size: 11px; color: var(--c-teal-soft); }
.ll-kb-chip-detail { font-size: 11.5px; color: var(--c-ink-3); }

/* ---------- broken ring (hero, decorative) ---------- */
.ll-broken {
  display: flex; flex-direction: column; align-items: center; gap: 28px;
}
.ll-broken-caption {
  max-width: 480px; margin: 0 auto; text-align: center;
  font-size: 14px; line-height: 1.65; color: var(--c-ink-3);
}
.ll-broken-body {
  display: flex; flex-direction: column; align-items: center; gap: 24px; width: 100%;
}
.ll-broken-ring-wrap { width: min(280px, 60vw); aspect-ratio: 1 / 1; flex: 0 0 auto; }
.ll-broken-svg { width: 100%; height: 100%; overflow: visible; }
.ll-broken-guide { fill: none; stroke: var(--c-line); stroke-width: 1; opacity: 0.4; }
.ll-broken-arc {
  fill: none; stroke: var(--c-line-2); stroke-width: 3.2; stroke-linecap: round;
  opacity: 0.4;
  animation: llBrokenPulse 3.6s ease-in-out infinite;
}
.ll-broken-arc.is-broken { stroke: rgba(240,97,111,0.55); }
@keyframes llBrokenPulse { 0%, 100% { opacity: 0.3; } 50% { opacity: 0.75; } }
.ll-broken-stage-label {
  font-family: var(--font-mono); font-size: 4.2px; letter-spacing: 0.04em;
  fill: var(--c-ink-4); text-transform: uppercase;
}
.ll-break-spark { animation: llBreakFlicker 2.4s ease-in-out infinite; transform-box: fill-box; }
.ll-break-dot { fill: var(--c-bg); stroke: var(--c-rose); stroke-width: 1.4; }
.ll-break-bolt { fill: none; stroke: var(--c-rose); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
@keyframes llBreakFlicker { 0%, 100% { opacity: 0.9; } 46% { opacity: 0.9; } 50% { opacity: 0.15; } 54% { opacity: 0.9; } }

/* legend */
.ll-broken-legend {
  display: flex; flex-direction: column; gap: 14px;
  width: 100%; max-width: 720px;
}
.ll-broken-legend-head {
  font-family: var(--font-mono); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--c-ink-4); text-align: center;
}
.ll-broken-legend-item { display: flex; align-items: flex-start; gap: 10px; }
.ll-broken-legend-dot {
  flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; margin-top: 5px;
  background: var(--c-bg); border: 1.5px solid var(--c-rose);
  box-shadow: 0 0 6px rgba(240,97,111,0.35);
}
.ll-broken-legend-label { font-size: 13.5px; font-weight: 700; color: var(--c-ink); }
.ll-broken-legend-item p { margin: 2px 0 0; font-size: 13px; line-height: 1.55; color: var(--c-ink-3); }
@media (min-width: 760px) {
  .ll-broken-body { flex-direction: row; align-items: center; justify-content: center; gap: 44px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ll-visual, .ll-chip, .ll-well, .ll-instrument-badge, .ll-diff-row, .ll-card-takeaway,
  .ll-approval-pill, .ll-observe-sim-line, .ll-observe-dot, .ll-observe-anomaly, .ll-observe-metric-row, .ll-kb-chip,
  .ll-caption-line, .ll-panel-mode {
    transition-duration: 0.001ms !important;
  }
  .ll-status-dot, .ll-thinking i { animation: none; opacity: 0.9; }
  .ll-trib-line.is-active, .ll-trib-icon.is-active .ll-trib-icon-bg { animation: none; }
  .ll-ring-version.ll-version-tick { animation: none; }
  .ll-typing::after { animation: none; }
  .ll-broken-arc, .ll-break-spark { animation: none; opacity: 0.6; }
  .ll-break-spark { opacity: 0.9; }
}
