/* ===== 東風 DONG FENG · MVP styles ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

/* ============================================================
 *  HERO BANNER · prominent CTA at top
 * ============================================================ */
.hero-banner {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, rgba(11,18,32,0.97), rgba(20,33,61,0.97));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,122,46,0.25);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
}
.hero-banner-inner {
  max-width: 1600px; margin: 0 auto;
  padding: 14px 28px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  flex-wrap: wrap;
}
.hero-text { display: flex; align-items: center; gap: 14px; }

/* ============================================================
 *  SyncBuddy LOGO · with subtle glow + hover bloom
 * ============================================================ */
.brand-link {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none;
  transition: transform 0.25s;
}
.brand-link:hover { transform: translateY(-1px); }
.brand-logo {
  width: 42px; height: 42px;
  border-radius: 10px;
  object-fit: cover;
  filter: drop-shadow(0 0 12px rgba(96,165,255,0.45));
  transition: filter 0.3s, transform 0.3s;
}
.brand-link:hover .brand-logo {
  filter: drop-shadow(0 0 18px rgba(96,165,255,0.85));
  transform: scale(1.04);
}
.footer-logo {
  width: 22px; height: 22px;
  border-radius: 5px;
  object-fit: cover;
  vertical-align: middle;
  filter: drop-shadow(0 0 6px rgba(96,165,255,0.4));
}
.footer-mini {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

.hero-cn {
  font-size: 28px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(135deg, #ff7a2e, #ffb37a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-tag { color: #ffd9b8; font-size: 13px; font-weight: 500; letter-spacing: 0.5px; }

.hero-cta-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 22px;
  background: linear-gradient(135deg, #ff7a2e 0%, #ff9a4e 60%, #ffb37a 100%);
  color: #0b1220 !important;
  text-decoration: none;
  border-radius: 30px;
  font-weight: 800; font-size: 14px; letter-spacing: 0.5px;
  box-shadow: 0 8px 24px rgba(255,122,46,0.45), 0 0 0 1px rgba(255,255,255,0.15) inset;
  transition: all 0.25s cubic-bezier(.2,.8,.2,1);
  position: relative; overflow: hidden;
}
.hero-cta-btn::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.4) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}
.hero-cta-btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 12px 32px rgba(255,122,46,0.65); }
.hero-cta-btn:hover::before { transform: translateX(100%); }
.cta-icon { font-size: 18px; }
.cta-arrow { font-size: 16px; transition: transform 0.25s; }
.hero-cta-btn:hover .cta-arrow { transform: translateX(4px); }

/* Secondary CTA: console dashboard link */
.console-cta {
  background: linear-gradient(135deg, #0f766e 0%, #14b8a6 60%, #2dd4bf 100%) !important;
  box-shadow: 0 8px 24px rgba(13,118,110,0.4), 0 0 0 1px rgba(45,212,191,0.2) inset !important;
}
.console-cta:hover { box-shadow: 0 12px 32px rgba(20,184,166,0.55) !important; }
.console-cta .cta-icon { font-size: 16px; }

/* Compare page console link */
.cmp-console-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px;
  background: rgba(30,74,138,0.6);
  border: 1px solid rgba(78,161,255,0.3);
  border-radius: 20px;
  color: #4ea1ff !important;
  text-decoration: none;
  font-size: 13px; font-weight: 600;
  transition: background 0.2s, border-color 0.2s;
}
.cmp-console-link:hover { background: rgba(30,100,180,0.7); border-color: rgba(78,161,255,0.5); }

@media (max-width: 720px) {
  .hero-banner-inner { flex-direction: column; gap: 12px; padding: 12px 16px; }
  .hero-tag { display: none; }
}

:root {
  --bg: #0b1220;
  --bg-2: #111a2e;
  --panel: #16223c;
  --panel-2: #1d2c4a;
  --text: #e8eefc;
  --muted: #8aa0c4;
  --accent: #ff7a2e;        /* 東風 orange */
  --accent-2: #ffb37a;
  --green: #28d49a;
  --red: #ff5a5f;
  --blue: #4ea1ff;
  --whatsapp: #075e54;
  --whatsapp-bubble: #dcf8c6;
  --whatsapp-bg: #ece5dd;
  --shadow: 0 10px 40px rgba(0,0,0,0.35);
}
html, body {
  height: 100%;
  background: linear-gradient(135deg, #0b1220 0%, #14213d 100%);
  color: var(--text);
  font-family: -apple-system, "PingFang TC", "Microsoft JhengHei", "Segoe UI", Roboto, sans-serif;
}
.app-shell {
  display: grid;
  grid-template-columns: 360px 1fr 360px;
  gap: 18px;
  padding: 18px;
  min-height: 100vh;
}

/* ===== LEFT: pitch ===== */
.pitch { display: flex; flex-direction: column; gap: 14px; }
.logo { display: flex; align-items: baseline; gap: 10px; }
.logo-cn {
  font-size: 36px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: 2px;
}
.logo-en { color: var(--muted); font-weight: 600; letter-spacing: 4px; }
.tagline { color: var(--accent-2); font-size: 14px; margin-top: -6px; }

.card {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.card h3 { font-size: 13px; color: var(--muted); margin-bottom: 10px; font-weight: 600; letter-spacing: 1px; }

.scenario-list { display: flex; flex-direction: column; gap: 8px; }
.scenario {
  text-align: left;
  background: var(--panel-2);
  border: 1px solid transparent;
  color: var(--text);
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s;
  display: flex; align-items: center; gap: 10px;
}
.scenario:hover { border-color: var(--accent); transform: translateX(2px); }
.scenario.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(255,122,46,0.18), rgba(255,122,46,0.06));
  box-shadow: 0 4px 14px rgba(255,122,46,0.15);
}
.scenario.new::after {
  content: ""; position: absolute;
}
.s-emoji { font-size: 20px; flex: 0 0 24px; text-align: center; }
.s-info { flex: 1; min-width: 0; }
.s-title { font-size: 12.5px; font-weight: 600; }
.s-sub { font-size: 10.5px; color: var(--muted); margin-top: 2px; }
.new-tag {
  display: inline-block; font-size: 9px; padding: 1px 5px;
  background: linear-gradient(135deg, #28d49a, #4ea1ff);
  color: white; border-radius: 3px; margin-left: 4px;
  font-weight: 700; letter-spacing: 0.5px; vertical-align: middle;
}

/* ============================================================
 *  CONFIDENCE GAUGE · 信賴度儀表
 * ============================================================ */
.confidence-block {
  margin-top: 12px;
  padding: 10px;
  background: var(--bg-2);
  border-radius: 10px;
  text-align: center;
  position: relative;
}
.conf-label {
  font-size: 10.5px; color: var(--muted); letter-spacing: 1px;
  margin-bottom: 4px;
}
.conf-gauge { width: 100%; max-width: 200px; height: auto; display: block; margin: 0 auto; }
.conf-value {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  font-size: 26px; font-weight: 800;
  background: linear-gradient(135deg, #ffb37a, #28d49a);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-family: "SF Mono", Menlo, monospace;
}
#confArc {
  transition: stroke-dashoffset 1.2s cubic-bezier(.2,.8,.2,1);
  filter: drop-shadow(0 0 8px rgba(255,179,122,0.5));
}

.engine-card { min-height: 180px; }
.trace { font-family: "SF Mono", Menlo, monospace; font-size: 11.5px; line-height: 1.7; max-height: 240px; overflow-y: auto; }
.trace-empty { color: var(--muted); font-style: italic; }
.trace-line { opacity: 0; animation: fadeUp 0.3s forwards; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.trace-line .trace-text { flex: 1; min-width: 0; }
.trace-line .trace-conf {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: rgba(255,179,122,0.18); color: var(--accent-2);
  font-weight: 700; flex: 0 0 auto;
  font-family: "SF Mono", Menlo, monospace;
}
.trace-line.step { color: var(--blue); }
.trace-line.cause { color: var(--green); }
.trace-line.alert { color: var(--accent); font-weight: 700; }
.trace-line.alert .trace-conf { background: rgba(255,122,46,0.3); color: white; }
.trace-line.data { color: var(--muted); }
@keyframes fadeUp { from {opacity:0; transform: translateY(4px);} to {opacity:1; transform: translateY(0);} }

#forecastChart {
  width: 100%; height: 160px;
  background: linear-gradient(180deg, #0a1426, var(--bg-2));
  border-radius: 8px;
  box-shadow: inset 0 0 30px rgba(78,161,255,0.06);
}
.live-dot {
  display: inline-block;
  width: 7px; height: 7px; border-radius: 50%;
  background: #ff5a5f;
  margin: 0 4px 0 8px; vertical-align: middle;
  box-shadow: 0 0 8px #ff5a5f;
  animation: live-pulse 1.4s infinite;
}
.live-text {
  font-size: 9.5px; color: #ff8a8e; letter-spacing: 1.5px;
  font-family: "SF Mono", Menlo, monospace; font-weight: 700;
}
@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.85); }
}
.legend { display: flex; gap: 10px; font-size: 10.5px; color: var(--muted); margin-top: 8px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.dot-history { background: var(--blue); }
.dot-forecast { background: var(--accent); }
.dot-turn { background: var(--red); }

.footer-mini { color: var(--muted); font-size: 10px; text-align: center; margin-top: auto; padding: 10px; }

/* ===== CENTER: phone ===== */
.phone-stage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.phone {
  width: 380px; height: 720px;
  background: var(--whatsapp-bg);
  border-radius: 36px;
  border: 12px solid #0b1220;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
  overflow: hidden;
  position: relative;
}
.phone-header {
  background: var(--whatsapp);
  color: white;
  padding: 14px 14px 12px;
  display: flex; align-items: center; gap: 10px;
}
.back { font-size: 20px; }
.contact { display: flex; align-items: center; gap: 10px; flex: 1; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: white;
}
.name { font-size: 14px; font-weight: 600; }
.status { font-size: 10.5px; opacity: 0.85; }
.actions { font-size: 14px; opacity: 0.85; }

.chat {
  flex: 1;
  padding: 14px 12px;
  overflow-y: auto;
  background:
    linear-gradient(rgba(236,229,221,0.92), rgba(236,229,221,0.92)),
    repeating-linear-gradient(45deg, #d9cfc4 0 1px, transparent 1px 14px);
  display: flex; flex-direction: column; gap: 8px;
}
.bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  color: #0b1220;
  line-height: 1.45;
  box-shadow: 0 1px 1px rgba(0,0,0,0.08);
  position: relative;
  animation: bubbleIn 0.28s ease both;
  word-wrap: break-word;
}
@keyframes bubbleIn { from {opacity:0; transform: translateY(6px);} to {opacity:1; transform: translateY(0);} }
.bubble.bot { background: white; align-self: flex-start; border-top-left-radius: 4px; }
.bubble.user { background: var(--whatsapp-bubble); align-self: flex-end; border-top-right-radius: 4px; }
.bubble.alert {
  background: linear-gradient(135deg, #fff4ec, #ffe8d6);
  border-left: 3px solid var(--accent);
}
.bubble .meta { font-size: 9.5px; color: #888; margin-top: 4px; text-align: right; }
.bubble strong { color: #c0531a; }
.bubble .tag {
  display: inline-block; font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: var(--accent); color: white; font-weight: 600; margin-bottom: 4px;
}
.bubble .actions-row { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.bubble .a-btn {
  flex: 1; min-width: 90px;
  padding: 7px 8px; font-size: 12px; border-radius: 8px;
  border: 1px solid #ddd; background: white; cursor: pointer;
  font-weight: 600; color: #075e54;
  transition: all 0.15s;
}
.bubble .a-btn.primary { background: var(--whatsapp); color: white; border-color: var(--whatsapp); }
.bubble .a-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 8px rgba(0,0,0,0.15); }

/* ---- 查看詳細視圖 (DAG / ROI / Forecast / Explain) ---- */

/* DAG breakdown list (shows in chat bubble after clicking 看詳細因果圖) */
.dag-breakdown {
  list-style: none; padding: 0; margin: 8px 0 6px;
}
.dag-breakdown li {
  font-size: 12px; padding: 5px 8px;
  background: #f7f9fc; border-radius: 6px; margin-bottom: 4px;
  display: flex; align-items: center; gap: 8px;
}
.dag-breakdown .bk-icon { font-size: 16px; }
.dag-breakdown .bk-type {
  margin-left: auto;
  font-size: 10px; padding: 2px 7px; border-radius: 3px;
  background: #075e54; color: white; font-weight: 600;
}
.bk-edges {
  font-size: 11px; color: #555; margin-top: 6px;
  background: #f0f0f0; padding: 6px 8px; border-radius: 6px;
}
.bk-edges code { background: white; padding: 1px 4px; border-radius: 3px; font-size: 10.5px; }
.bk-edges .ew { color: #c0531a; font-weight: 700; font-family: monospace; }
.bk-hint { display: block; font-size: 11px; color: #666; margin-top: 6px; }

/* DAG spotlight: pulse highlight on right console block when clicked */
.dag-block.dag-spotlight {
  animation: dag-spotlight 2.4s ease-in-out;
}
@keyframes dag-spotlight {
  0%, 100% { box-shadow: none; }
  20%, 60% {
    box-shadow: 0 0 0 3px var(--accent),
                0 0 40px rgba(255,122,46,0.55);
    transform: scale(1.012);
  }
}

/* ROI bar chart in chat */
.roi-chart { margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.roi-row { display: flex; flex-direction: column; gap: 3px; }
.roi-name { font-size: 12px; font-weight: 700; color: #222; }
.roi-track {
  height: 24px; background: #f0f0f0; border-radius: 6px; overflow: hidden;
  position: relative;
}
.roi-bar {
  height: 100%; padding: 0 8px;
  display: flex; align-items: center; justify-content: flex-end;
  font-size: 11.5px; font-weight: 800; color: white;
  border-radius: 6px;
  animation: roi-grow 0.9s cubic-bezier(.2,.8,.2,1);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2);
}
@keyframes roi-grow { from { width: 0 !important; } }
.roi-note { font-size: 10.5px; color: #777; }
.roi-recommend {
  margin-top: 8px; padding: 8px 10px;
  background: linear-gradient(135deg, #fff4ec, #ffe8d6);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  font-size: 12px; color: #333;
}

/* Forecast mini view */
.fc-mini {
  display: flex; align-items: center; justify-content: space-between;
  background: #f7f9fc; border-radius: 8px; padding: 10px 14px;
  margin: 8px 0;
}
.fc-row { text-align: center; }
.fc-label { font-size: 10px; color: #888; letter-spacing: 1px; }
.fc-value { font-size: 22px; font-weight: 800; font-family: "SF Mono", monospace; }
.fc-current { color: #ff5a5f; }
.fc-target  { color: #28d49a; }
.fc-arrow {
  font-size: 22px; color: var(--accent);
  animation: fc-arrow-pulse 1.4s infinite;
}
@keyframes fc-arrow-pulse {
  0%, 100% { transform: translateX(0); opacity: 1; }
  50%      { transform: translateX(4px); opacity: 0.6; }
}
.fc-confidence {
  font-size: 11.5px; color: #555;
  background: #ecf6ff; padding: 6px 10px; border-radius: 5px;
  margin-bottom: 4px;
}
.fc-confidence strong { color: #075e54; }

/* Explain view */
.explain-list {
  list-style: none; padding: 0; margin: 8px 0;
}
.explain-list li {
  padding: 6px 8px;
  background: #f7f9fc; border-radius: 6px; margin-bottom: 4px;
  font-size: 12px; line-height: 1.5;
  display: flex; align-items: flex-start; gap: 8px;
}
.explain-list .ex-icon {
  font-size: 18px; flex: 0 0 24px; text-align: center;
}
.explain-list strong { color: #075e54; }

/* ---- 微調話術 編輯器 ---- */
.tweak-options {
  display: flex; flex-direction: column; gap: 6px; margin-top: 8px;
}
.tweak-opt {
  text-align: left;
  background: white; border: 1.5px solid #e5e5e5;
  padding: 8px 10px; border-radius: 8px;
  cursor: pointer; transition: all 0.18s;
  width: 100%;
}
.tweak-opt:hover {
  border-color: #075e54;
  background: linear-gradient(135deg, #ecfdf5, white);
  transform: translateX(2px);
  box-shadow: 0 4px 10px rgba(7,94,84,0.12);
}
.tweak-opt .t-tone { font-size: 12px; font-weight: 700; color: #075e54; margin-bottom: 3px; }
.tweak-opt .t-preview { font-size: 11px; color: #555; line-height: 1.4; }
.tweak-final {
  background: #f7f7f7; padding: 10px 12px; border-radius: 8px;
  font-size: 13px; color: #222; line-height: 1.55;
  border-left: 3px solid #075e54;
  font-style: italic;
  margin: 4px 0;
}

.typing {
  align-self: flex-start;
  background: white; padding: 10px 14px; border-radius: 12px; border-top-left-radius: 4px;
  display: flex; gap: 4px;
}
.typing span {
  width: 6px; height: 6px; border-radius: 50%; background: #aaa;
  animation: typing 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.15s; }
.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%,60%,100% {opacity:0.3;} 30% {opacity:1;} }

.composer {
  padding: 10px;
  background: #f0f0f0;
  display: flex; gap: 8px;
}
.btn-primary, .btn-secondary {
  flex: 1; padding: 11px; border-radius: 22px; border: none; cursor: pointer;
  font-weight: 700; font-size: 13px;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), #ff9a4e); color: white; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-secondary { background: white; color: #444; border: 1px solid #ddd; flex: 0 0 90px; }

.phone-caption { color: var(--muted); font-size: 12px; text-align: center; line-height: 1.5; }
.phone-caption strong { color: var(--accent-2); }

/* ===== RIGHT: console ===== */
.console {
  background: var(--panel);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex; flex-direction: column;
  overflow-y: auto;
  max-height: calc(100vh - 36px);
}
.console h3 { font-size: 14px; font-weight: 700; }
.console h4 { font-size: 11.5px; color: var(--muted); margin: 16px 0 8px; letter-spacing: 1.5px; }
.console .sub { font-size: 11px; color: var(--muted); margin-top: 4px; margin-bottom: 14px; }

.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi {
  background: var(--panel-2); padding: 10px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.04);
}
.k-num { font-size: 20px; font-weight: 800; color: var(--accent-2); }
.k-lbl { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* ============================================================
 *  SEXY DAG · 因果圖譜 with energy flow + glow + weights
 * ============================================================ */
.dag-block {
  background: linear-gradient(180deg, var(--bg-2), #0a1020);
  border-radius: 12px; padding: 12px;
  border: 1px solid rgba(255,255,255,0.04);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}
.dag-block::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(78,161,255,0.08), transparent 60%),
              radial-gradient(circle at 70% 70%, rgba(255,122,46,0.06), transparent 60%);
  pointer-events: none;
}
.dag-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; position: relative;
}
.dag-head h4 { margin: 0; font-size: 11.5px; }
.dag-status {
  font-size: 10px; padding: 3px 8px; border-radius: 4px;
  background: rgba(138,160,196,0.15); color: var(--muted);
  letter-spacing: 1px; font-weight: 600;
  transition: all 0.3s;
}
.dag-status.scanning {
  background: rgba(78,161,255,0.2); color: var(--blue);
  animation: pulse-status 1.2s infinite;
}
.dag-status.locked {
  background: linear-gradient(135deg, rgba(255,122,46,0.25), rgba(255,179,122,0.15));
  color: var(--accent-2);
  box-shadow: 0 0 14px rgba(255,122,46,0.4);
}
@keyframes pulse-status {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.dag-sexy {
  width: 100%; height: 320px;
  display: block; position: relative;
}
.dag-sexy text {
  fill: var(--text);
  font-family: -apple-system, "PingFang TC", sans-serif;
  pointer-events: none;
}

/* nodes */
.dag-sexy .node-circle {
  fill: var(--panel-2);
  stroke: rgba(138,160,196,0.4);
  stroke-width: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  transition: all 0.4s;
}
.dag-sexy .node-circle.cause    { stroke: #ffb37a; }
.dag-sexy .node-circle.evidence { stroke: #4ea1ff; }
.dag-sexy .node-circle.effect   { stroke: #c47cff; }
.dag-sexy .node-circle.alert    { stroke: #ff5a5f; }

.dag-sexy .node-circle.active {
  stroke-width: 3;
  filter: drop-shadow(0 0 14px currentColor);
  animation: node-pulse 1.6s infinite;
}
.dag-sexy .node-circle.active.cause    { fill: rgba(255,179,122,0.18); stroke: #ffb37a; color: #ffb37a; }
.dag-sexy .node-circle.active.evidence { fill: rgba(78,161,255,0.18);  stroke: #4ea1ff; color: #4ea1ff; }
.dag-sexy .node-circle.active.effect   { fill: rgba(196,124,255,0.18); stroke: #c47cff; color: #c47cff; }
.dag-sexy .node-circle.active.alert    { fill: rgba(255,90,95,0.22);   stroke: #ff5a5f; color: #ff5a5f; }
@keyframes node-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px currentColor); }
  50%      { filter: drop-shadow(0 0 18px currentColor); }
}

.dag-sexy .node-icon {
  font-size: 14px;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
.dag-sexy .node-label {
  font-size: 9px;
  text-anchor: middle;
  fill: var(--text);
  font-weight: 500;
}
.dag-sexy .node-label-bg {
  fill: rgba(11,18,32,0.85);
  rx: 4;
}

/* edges */
.dag-sexy .edge {
  stroke: rgba(138,160,196,0.25);
  stroke-width: 1.5;
  fill: none;
  marker-end: url(#arrowMuted);
  transition: stroke 0.4s, stroke-width 0.4s;
}
.dag-sexy .edge.active {
  stroke: var(--accent);
  stroke-width: 2.2;
  marker-end: url(#arrowAccent);
  filter: drop-shadow(0 0 4px rgba(255,122,46,0.6));
}

/* energy flow particles */
.dag-sexy .edge-flow {
  stroke: #ffb37a;
  stroke-width: 2;
  fill: none;
  stroke-dasharray: 4 12;
  stroke-linecap: round;
  opacity: 0;
  pointer-events: none;
}
.dag-sexy .edge-flow.flowing {
  opacity: 1;
  animation: flow 1.4s linear infinite;
}
@keyframes flow {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -32; }
}

/* edge weight labels */
.dag-sexy .edge-weight {
  font-size: 9px;
  font-weight: 700;
  fill: var(--muted);
  font-family: "SF Mono", Menlo, monospace;
  text-anchor: middle;
  paint-order: stroke;
  stroke: #0b1220;
  stroke-width: 3;
}
.dag-sexy .edge-weight.active {
  fill: var(--accent-2);
  stroke: #0b1220;
}

/* counterfactual */
.counterfactual-block {
  margin-top: 10px; padding: 10px;
  background: rgba(11,18,32,0.5);
  border-radius: 8px;
  border-left: 3px solid #ff5a5f;
  display: none;
}
.counterfactual-block.show { display: block; animation: fadeUp 0.4s; }
.cf-title {
  font-size: 11px; color: #ff8a8e; font-weight: 700;
  letter-spacing: 1px; margin-bottom: 6px;
}
.cf-list { list-style: none; padding: 0; }
.cf-list li {
  font-size: 11.5px; color: var(--muted);
  padding: 3px 0;
  text-decoration: line-through;
  text-decoration-color: rgba(255,90,95,0.6);
  text-decoration-thickness: 1.5px;
  position: relative;
  padding-left: 18px;
  opacity: 0;
  animation: fadeUp 0.3s forwards;
}
.cf-list li::before {
  content: "✗";
  position: absolute; left: 0;
  color: #ff5a5f; font-weight: 700;
  text-decoration: none;
}
.cf-list li:nth-child(1) { animation-delay: 0.1s; }
.cf-list li:nth-child(2) { animation-delay: 0.25s; }
.cf-list li:nth-child(3) { animation-delay: 0.4s; }
.cf-list li:nth-child(4) { animation-delay: 0.55s; }

.sources { list-style: none; font-size: 12px; }
.sources li { padding: 5px 0; color: var(--muted); }
.src-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; }
.src-dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.src-dot.warn { background: #f5b342; }

.exec-log {
  background: var(--bg-2); border-radius: 8px; padding: 8px; font-size: 11.5px;
  font-family: "SF Mono", Menlo, monospace; min-height: 60px;
}
.log-item { padding: 4px 0; border-bottom: 1px dashed rgba(255,255,255,0.06); }
.log-item.muted { color: var(--muted); font-style: italic; }
.log-item.success { color: var(--green); }
.log-item.exec { color: var(--accent); }

@media (max-width: 1200px) {
  .app-shell { grid-template-columns: 1fr; }
  .phone-stage { order: -1; }
}
