/* ---------- AI simulation frame (shared by all sections) ---------- */
.sim {
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: linear-gradient(170deg, rgba(14, 34, 76, 0.85), rgba(6, 14, 32, 0.92));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(47, 123, 255, 0.08), 0 0 60px rgba(47, 123, 255, 0.12);
  overflow: hidden;
}
.sim-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--text-2);
}
.sim-bar .live { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.sim-bar .live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 10px var(--accent-2); animation: blink 1.6s infinite; }
.sim-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--warn); border: 1px solid rgba(255, 181, 71, 0.4); padding: 2px 8px; border-radius: 999px; }
.sim-replay { background: none; border: 1px solid var(--border-strong); color: var(--text-2); border-radius: 999px; padding: 3px 10px; font-size: 11px; }
.sim-replay:hover { color: var(--text); border-color: var(--accent); }
.sim-body { padding: 16px; display: grid; grid-template-columns: minmax(0, 1.05fr) 28px minmax(0, 1fr); gap: 0; align-items: stretch; }
.sim-caption { padding: 0 16px 12px; font-size: 11px; color: var(--muted); }
@keyframes blink { 50% { opacity: 0.35; } }

/* Data link between panes */
.sim-link { position: relative; display: flex; align-items: center; justify-content: center; }
.sim-link::before { content: ""; position: absolute; top: 10%; bottom: 10%; width: 2px; left: 50%; transform: translateX(-50%); background: linear-gradient(transparent, var(--border-strong), transparent); }
.sim-link .pkt { position: absolute; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 12px var(--accent-2); opacity: 0; }

/* ---------- Chat pane ---------- */
.chat { border: 1px solid var(--border); border-radius: 14px; background: rgba(2, 7, 18, 0.6); display: flex; flex-direction: column; min-height: 380px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.avatar-ai { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: conic-gradient(from 200deg, var(--accent), var(--accent-2), var(--accent)); box-shadow: 0 0 14px var(--accent-glow); }
.chat-head strong { font-size: 13px; display: block; line-height: 1.2; }
.chat-head small { font-size: 11px; color: var(--good); }
.chat-head .chip { margin-left: auto; font-size: 10px; color: var(--text-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chat-log { flex: 1; padding: 12px; display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; font-size: 12.5px; line-height: 1.45; }
.msg { max-width: 86%; padding: 8px 11px; border-radius: 12px; }
.msg--in { align-self: flex-start; background: rgba(255, 255, 255, 0.08); border-bottom-left-radius: 4px; }
.msg--ai { align-self: flex-end; background: linear-gradient(135deg, #2357d9, var(--accent)); border-bottom-right-radius: 4px; box-shadow: 0 6px 20px rgba(47, 123, 255, 0.3); }
.msg .who { display: block; font-size: 10px; opacity: 0.7; margin-bottom: 2px; font-weight: 600; }
.typing { align-self: flex-end; display: inline-flex; gap: 4px; padding: 10px 12px; border-radius: 12px; background: rgba(47, 123, 255, 0.25); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: 0.6; animation: bounce 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); opacity: 1; } }
.caret::after { content: "▍"; margin-left: 1px; color: var(--accent-2); animation: blink 0.8s infinite; }

/* ---------- Right-hand stack ---------- */
.sim-stack { display: flex; flex-direction: column; gap: 12px; }
.pane { border: 1px solid var(--border); border-radius: 14px; background: rgba(2, 7, 18, 0.55); padding: 12px 14px; }
.pane-title { display: flex; align-items: center; justify-content: space-between; font-size: 12px; font-weight: 700; margin-bottom: 10px; }
.pane-state { font-size: 10px; font-weight: 600; color: var(--accent-2); }
.pane-state.done { color: var(--good); }

.analysis { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.facts { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; }
.fact { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed var(--border); padding-bottom: 4px; }
.fact span { color: var(--muted); }
.fact b { font-weight: 600; text-align: right; }
.gauge { position: relative; width: 84px; height: 84px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .track { stroke: var(--border); }
.gauge .val { stroke-linecap: round; }
.analysis--full { grid-template-columns: 1fr; }
.msg--sys { align-self: center; max-width: 92%; font-size: 11px; color: var(--text-2); background: rgba(25, 211, 255, 0.08); border: 1px dashed rgba(25, 211, 255, 0.35); border-radius: 999px; padding: 4px 12px; text-align: center; }
.gauge-num { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1; }
.gauge-num strong { font-size: 22px; font-weight: 800; }
.gauge-num small { display: block; font-size: 9px; color: var(--warn); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; margin-top: 3px; }

.actions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 11.5px; }
.actions li { display: flex; gap: 9px; align-items: flex-start; }
.actions .tick { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(47, 216, 164, 0.15); color: var(--good); border: 1px solid rgba(47, 216, 164, 0.5); }
.actions .tick svg { width: 10px; height: 10px; }
.actions small { display: block; color: var(--muted); font-size: 10.5px; }

@media (max-width: 680px) {
  .sim-body { grid-template-columns: 1fr; gap: 12px; }
  .sim-link { display: none; }
  .chat { min-height: 340px; }
}
