/* ================= Agent dock (top bar) ================= */
.agent-dock {
  display: flex; align-items: center; gap: 10px;
  margin-left: auto;
  padding: 4px 4px 4px 10px;
  border: 1px solid var(--line-2); border-radius: 12px;
  background: linear-gradient(180deg, #121722, #0d1118);
}
.dock-agents { display: flex; gap: 6px; }
.dock-agent, .dock-core-icon {
  position: relative; width: 26px; height: 26px; display: grid; place-items: center;
  animation: dockIdle 3.2s ease-in-out infinite;
}
.dock-agent svg, .dock-core-icon svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 6px var(--glow, transparent)); }
.dock-agent::after, .dock-core-icon::after {
  content: ''; position: absolute; right: -2px; bottom: -2px; width: 8px; height: 8px; border-radius: 50%;
  background: var(--green); border: 2px solid #0e1219; box-shadow: 0 0 6px var(--green);
}
.dock-agent:nth-child(2) { animation-delay: -.6s; }
.dock-agent:nth-child(3) { animation-delay: -1.2s; }
.dock-agent:nth-child(4) { animation-delay: -1.8s; }
.dock-agent:nth-child(5) { animation-delay: -2.4s; }
@keyframes dockIdle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.dock-arrow { color: var(--dim); font-size: 13px; }
.dock-core-icon { width: 30px; height: 30px; animation: corePulse 2.4s ease-in-out infinite; border-radius: 10px; }
@keyframes corePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(55, 227, 155, .0); } 50% { box-shadow: 0 0 0 4px rgba(55, 227, 155, .18); } }
.dock-status { display: flex; align-items: center; gap: 6px; font: 600 11.5px var(--mono); color: var(--green); white-space: nowrap; }
.dock-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); animation: pulse 1.6s infinite; }
.dock-status b { font-weight: 700; }
.agent-dock.running .dock-agent { animation-duration: 1s; }
.agent-dock.running .dock-status { color: var(--yellow); }
.agent-dock.running .dock-status i { background: var(--yellow); }

.launch-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: 9px;
  font-weight: 700; font-size: 13px; color: #04150d;
  background: linear-gradient(180deg, #4ff0ad, #22d488);
  box-shadow: 0 0 0 1px rgba(79, 240, 173, .35), 0 4px 18px rgba(55, 227, 155, .25);
  transition: transform .12s, box-shadow .2s;
  white-space: nowrap;
}
.launch-btn svg { width: 14px; height: 14px; fill: currentColor; }
.launch-btn:hover { transform: translateY(-1px); box-shadow: 0 0 0 1px rgba(79, 240, 173, .6), 0 6px 26px rgba(55, 227, 155, .4); }
.launch-btn:active { transform: translateY(0); }
.top-right { margin-left: 0; }

@media (max-width: 1280px) { .dock-status { display: none; } }
@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; height: auto; padding-top: 8px; padding-bottom: 8px; row-gap: 8px; }
  .agent-dock { order: 3; width: 100%; margin-left: 0; justify-content: space-between; padding-left: 8px; }
  .dock-agents { gap: 4px; }
  .dock-status { display: flex; }
}
@media (max-width: 420px) { .dock-status { display: none; } .dock-agent { width: 24px; height: 24px; } }

/* ================= Modal shell ================= */
.sim-overlay {
  position: fixed; inset: 0; z-index: 1;
  background: rgba(3, 5, 8, .78); backdrop-filter: blur(6px);
  display: grid; place-items: center;
  animation: simFade .25s ease-out;
}
@keyframes simFade { from { opacity: 0; } }
.sim {
  --sim-bg: #070a0e;
  position: relative;
  width: min(1120px, 96vw); height: min(900px, 94vh);
  background: radial-gradient(120% 60% at 30% 0%, #0d1a14 0%, var(--sim-bg) 55%);
  border: 1px solid var(--line-2); border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: simPop .35s cubic-bezier(.2, .9, .3, 1.15);
  font-variant-numeric: tabular-nums;
}
@keyframes simPop { from { transform: translateY(16px) scale(.97); opacity: 0; } }
.sim-x {
  position: absolute; top: 12px; right: 12px; z-index: 30; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; color: var(--muted); background: rgba(255, 255, 255, .04);
}
.sim-x:hover { color: var(--text); background: rgba(255, 255, 255, .09); }
.sim-x svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2.2; fill: none; }
.sim-view { position: absolute; inset: 0; display: flex; flex-direction: column; }
.sim-view.hidden { display: none; }
.mono { font-family: var(--mono); }

.ag-ico { display: inline-grid; place-items: center; flex: none; }
.ag-ico svg { width: 100%; height: 100%; display: block; }

/* ================= Connect view ================= */
.cx-hero { flex: 1; display: grid; place-items: center; min-height: 0; padding: 0 16px; }
.cx-pair { display: flex; align-items: center; gap: 14px; }
.cx-node { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; width: 150px; }
.cx-node .ag-ico, .cx-node .cx-tb { width: 104px; height: 104px; filter: drop-shadow(0 10px 30px rgba(0, 0, 0, .5)); }
.cx-tb { border-radius: 26px; background: #121a24; display: grid; place-items: center; box-shadow: 0 0 40px rgba(55, 227, 155, .18); }
.cx-tb svg { width: 64px; height: 64px; }
.cx-node b { font-size: 17px; }
.cx-node small { color: var(--dim); font: 500 11px var(--mono); }
.cx-node.green b { color: var(--green); }
.cx-link { display: flex; align-items: center; gap: 6px; color: var(--dim); }
.cx-link .dash { width: 26px; border-top: 2px dashed #39404f; }
.cx-link .knot {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid #39404f; color: var(--muted); font-weight: 700; transition: .3s;
}
.cx-link .knot svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 3; fill: none; }
.cx-link.on .dash { border-color: var(--green); animation: dashFlow .6s linear infinite; }
.cx-link.on .knot { background: var(--green); border-color: var(--green); color: #04150d; box-shadow: 0 0 20px rgba(55, 227, 155, .6); }
@keyframes dashFlow { to { border-image: none; } }

.cx-sheet {
  margin: 0 auto 26px; width: min(520px, calc(100% - 32px));
  background: #10141b; border: 1px solid var(--line-2); border-radius: 22px; padding: 18px 18px 18px;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .35);
}
.cx-sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: #2b313d; margin: -6px auto 14px; }
.cx-sheet h3 { margin: 0; text-align: center; font-size: 22px; }
.cx-sheet .sub { text-align: center; color: var(--muted); margin: 4px 0 14px; }
.cx-table { background: #0b0e13; border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px; }
.cx-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.cx-row + .cx-row { border-top: 1px solid var(--line); }
.cx-row span:last-child { color: var(--text); }
.cx-checks { list-style: none; padding: 0; margin: 14px 2px; display: grid; gap: 7px; font-size: 12.5px; color: var(--muted); }
.cx-checks li { display: flex; gap: 8px; align-items: center; }
.cx-checks .ok { color: var(--green); font-weight: 800; }
.cx-checks .no { color: var(--red); font-weight: 800; }
.cx-go {
  width: 100%; height: 48px; border-radius: 14px; font-weight: 700; font-size: 16px; color: #04150d;
  background: linear-gradient(180deg, #4ff0ad, #22d488); box-shadow: 0 6px 30px rgba(55, 227, 155, .3);
}
.cx-go:disabled { opacity: .9; cursor: default; }
.cx-disclaimer { text-align: center; color: var(--dim); font-size: 11px; margin-top: 10px; }

/* ================= Boot view ================= */
.bt { width: min(560px, calc(100% - 32px)); margin: 0 auto; padding: 64px 0 24px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.bt-head { display: flex; justify-content: space-between; font: 500 12.5px var(--mono); color: var(--muted); padding: 0 2px 4px; }
.bt-head b { color: var(--green); }
.bt-card {
  --c: #fff;
  display: grid; grid-template-columns: 58px 1fr auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: linear-gradient(100deg, color-mix(in srgb, var(--c) 9%, #0c1016), #0c1016 70%);
  opacity: 0; transform: translateY(10px);
  transition: opacity .35s, transform .35s cubic-bezier(.2, .9, .3, 1.2);
}
.bt-card.in { opacity: 1; transform: none; }
.bt-card .ag-ico { width: 52px; height: 52px; }
.bt-card h4 { margin: 0; color: var(--c); font: 700 19px var(--mono); letter-spacing: .02em; }
.bt-card p { margin: 2px 0 6px; color: #c8ccd6; font-size: 13px; }
.bt-pill { display: inline-flex; gap: 6px; align-items: center; font: 600 11.5px var(--mono); color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); border-radius: 99px; padding: 3px 10px; }
.bt-pill.wait { color: var(--muted); background: rgba(255, 255, 255, .05); }
.bt-tag { font: 500 11px var(--mono); color: var(--dim); align-self: start; }
.bt-core { grid-template-columns: 52px 1fr auto; --c: #9aa3b2; border-color: var(--line-2); background: #0c1016; }
.bt-core h4 { color: #eef0f4; font-family: Inter, sans-serif; font-size: 18px; }
.bt-core p { color: var(--dim); font: 500 11px var(--mono); margin: 2px 0 0; }
.bt-ready { font: 700 12.5px var(--mono); color: var(--green); opacity: 0; transition: opacity .3s; }
.bt-core.ready .bt-ready { opacity: 1; }

/* ================= Run view ================= */
.rn { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.rn-head { display: flex; align-items: center; gap: 10px; padding: 14px 58px 10px 18px; }
.rn-head .ag-ico { width: 30px; height: 30px; }
.rn-head h3 { margin: 0; font-size: 18px; }
.chip { font: 600 11px var(--mono); padding: 3px 8px; border-radius: 99px; border: 1px solid; }
.rn-head .sp { flex: 1; }
.rn-live { display: inline-flex; gap: 6px; align-items: center; font-weight: 700; font-size: 12.5px; color: var(--green); background: var(--green-bg); padding: 4px 10px; border-radius: 99px; }
.rn-live i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: pulse 1.4s infinite; }
.rn-live.done { color: var(--yellow); background: rgba(245, 200, 76, .12); }
.rn-live.done i { animation: none; }

.ticker { overflow: hidden; border-block: 1px solid var(--line); background: rgba(255, 255, 255, .015); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-track { display: inline-flex; gap: 22px; padding: 7px 0; white-space: nowrap; animation: tick 38s linear infinite; }
@keyframes tick { to { transform: translateX(-50%); } }
.tk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.tk img, .tk .av0 { width: 16px; height: 16px; border-radius: 50%; }
.tk em { font-style: normal; font: 600 11.5px var(--mono); }
.tk small { color: var(--dim); font-size: 10.5px; font-weight: 500; }

.rn-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; padding: 14px 16px 26px; }
.rn-col { min-height: 0; display: flex; flex-direction: column; gap: 12px; }

.bal { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: start; }
.bal-meta { font: 500 11.5px var(--mono); color: var(--dim); }
.bal-num { font-weight: 800; font-size: 64px; line-height: 1.05; letter-spacing: -.03em; margin: 2px 0 6px; text-shadow: 0 0 34px rgba(55, 227, 155, .35); white-space: nowrap; }
.bal-num .c { color: #4c5263; text-shadow: none; }
.bal-num.neg { text-shadow: 0 0 34px rgba(255, 95, 126, .3); }
.bal-pills { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bal-in { font: 600 12.5px var(--mono); color: #c8ccd6; background: rgba(255, 255, 255, .06); padding: 5px 10px; border-radius: 9px; }
.bal-x { font: 800 13px var(--mono); color: #07090c; background: #f2f4f7; padding: 5px 10px; border-radius: 10px; transition: background .3s; }
.bal-x.gold { background: var(--yellow); }
.bal-x.bad { background: var(--red); color: #fff; }
.bal-pnl { margin-top: 8px; font: 700 13px var(--mono); color: var(--green); display: flex; gap: 14px; }
.bal-pnl.neg { color: var(--red); }

.ring { position: relative; width: 108px; height: 108px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring .tickmarks line { stroke: #2a303c; stroke-width: 1.5; }
.ring .tickmarks line.on { stroke: rgba(55, 227, 155, .55); }
.ring .arc { fill: none; stroke: var(--green); stroke-width: 4; stroke-linecap: round; filter: drop-shadow(0 0 5px rgba(55, 227, 155, .7)); }
.ring .dot { fill: #fff; filter: drop-shadow(0 0 6px #fff); }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 1px; }
.ring-txt small { font: 600 8.5px var(--mono); color: var(--muted); letter-spacing: .1em; }
.ring-txt b { font: 700 14px var(--mono); }
.ring-txt span { font: 500 10px var(--mono); color: var(--muted); }
.ring.done .arc { stroke: var(--green); }
.ring.done .ring-txt span { color: var(--green); font-weight: 700; }

.chart { position: relative; flex: 1; min-height: 170px; }
.chart canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart-fx { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.trades-perf { display: flex; align-items: baseline; justify-content: space-between; margin-top: 6px; font: 600 12px var(--mono); color: var(--muted); }
.trades-perf b { font-size: 14px; color: var(--text); }
.pt-label { position: absolute; transform: translate(-100%, -150%); font: 800 14px var(--mono); white-space: nowrap; text-shadow: 0 0 12px currentColor; transition: opacity .4s; }
.pt-label.up { color: var(--green); }
.pt-label.dn { color: var(--red); }
.hi-pill {
  position: absolute; left: 6px; top: 6px; z-index: 3;
  font: 800 12.5px var(--mono); letter-spacing: .04em; color: #04150d; background: var(--green);
  padding: 6px 12px; border-radius: 10px; box-shadow: 0 0 24px rgba(55, 227, 155, .5);
  opacity: 0; transform: translateY(-6px); transition: .35s;
}
.hi-pill.show { opacity: 1; transform: none; }
.hi-pill.gold { background: var(--yellow); box-shadow: 0 0 24px rgba(245, 200, 76, .5); }
.hi-pill.bad { background: var(--red); color: #fff; box-shadow: 0 0 24px rgba(255, 95, 126, .4); }
.wave { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; border: 2px solid rgba(55, 227, 155, .7); animation: wave 1.4s ease-out forwards; }
@keyframes wave { to { transform: scale(14); opacity: 0; } }
.coin { position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; overflow: hidden; border: 2px solid rgba(255, 255, 255, .7); background: #1b212c; display: grid; place-items: center; font: 800 10px Inter; color: #fff; box-shadow: 0 0 12px rgba(55, 227, 155, .6); }
.coin img { width: 100%; height: 100%; object-fit: cover; }
.big-pnl { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); font: 900 64px Inter, sans-serif; letter-spacing: -.03em; color: var(--green); text-shadow: 0 0 28px rgba(55, 227, 155, .8); white-space: nowrap; animation: bigPnl 1.5s cubic-bezier(.2, .9, .3, 1.2) forwards; }
@keyframes bigPnl { 0% { transform: translate(-50%, -30%) scale(.6); opacity: 0; } 18% { transform: translate(-50%, -50%) scale(1.08); opacity: 1; } 30% { transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { transform: translate(-50%, -70%) scale(1); opacity: 0; } }

.wl { display: grid; grid-template-columns: repeat(96, 1fr); gap: 2px; height: 10px; }
.wl i { border-radius: 2px; background: #1a1f29; }
.wl i.g { background: var(--green); box-shadow: 0 0 4px rgba(55, 227, 155, .5); }
.wl i.r { background: var(--red); }

.panel { background: rgba(14, 18, 25, .85); border: 1px solid var(--line); border-radius: 16px; }
.log { padding: 4px 12px; min-height: 108px; overflow: hidden; }
.log-row { display: grid; grid-template-columns: 44px 44px 1fr auto; align-items: center; gap: 6px; padding: 7px 0; font: 500 12px var(--mono); color: var(--muted); animation: logIn .35s ease-out; }
.log-row + .log-row { border-top: 1px solid rgba(255, 255, 255, .03); }
.log-row:nth-child(n+3) { opacity: .45; }
.log-row:nth-child(n+4) { display: none; }
@keyframes logIn { from { opacity: 0; transform: translateY(-8px); } }
.log-row .k { font-weight: 700; }
.log-row .k.buy { color: var(--blue); }
.log-row .k.sell { color: var(--green); }
.log-row .k.stop { color: var(--red); }
.log-row .tx { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.log-row .tx b { color: var(--text); font-family: Inter, sans-serif; }
.log-row .tx .up { color: var(--green); }
.log-row .tx .dn { color: var(--red); }
.log-row .ag-ico { width: 15px; height: 15px; opacity: .8; }
.av0 { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #2a3140; color: #fff; font: 800 9px Inter; flex: none; overflow: hidden; }
.av0 img { width: 100%; height: 100%; object-fit: cover; }

.agents { padding: 12px 12px 8px; }
.p-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.p-head h4 { margin: 0; font-size: 15px; }
.p-head .run { font: 600 12px var(--mono); color: var(--green); display: inline-flex; align-items: center; gap: 6px; }
.p-head .run i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ag-row { display: grid; grid-template-columns: 18px 70px 1fr auto; gap: 8px; align-items: center; padding: 6px 6px; border-radius: 8px; font: 500 12px var(--mono); color: #c8ccd6; transition: background .5s; }
.ag-row .ag-ico { width: 18px; height: 18px; }
.ag-row .nm { font-weight: 700; }
.ag-row .st { display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-row .st span { overflow: hidden; text-overflow: ellipsis; }
.ag-row .tg { font-size: 10.5px; color: var(--dim); background: rgba(255, 255, 255, .04); padding: 2px 7px; border-radius: 6px; }
.ag-row.hot { background: rgba(255, 255, 255, .05); transition: none; }
.ag-row .st.flip { animation: flip .4s ease-out; }
@keyframes flip { from { opacity: 0; transform: translateY(4px); } }

.net { padding: 12px 12px 10px; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.net-stage { position: relative; flex: 1; min-height: 180px; max-height: 290px; margin-block: auto; width: 100%; }
.net-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.net-stage path.wire { fill: none; stroke: rgba(255, 255, 255, .13); stroke-width: 1.3; }
.net-node { position: absolute; transform: translate(-50%, 0); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.net-node small { font: 700 9.5px var(--mono); }
.net-node .ag-ico { width: 34px; height: 34px; filter: drop-shadow(0 0 10px var(--c)); transition: transform .2s; }
.net-node.fire .ag-ico { transform: scale(1.15); }
.vote { font: 800 9.5px var(--mono); padding: 2px 7px; border-radius: 6px; color: #07090c; background: var(--c); opacity: 0; transform: scale(.6); transition: .2s; }
.vote.show { opacity: 1; transform: none; }
.vote.no { background: #39404f; color: #c8ccd6; }
.net-core { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; }
.net-core .halo { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(55, 227, 155, .18), transparent 70%); border: 2px solid rgba(55, 227, 155, .5); box-shadow: 0 0 30px rgba(55, 227, 155, .35), inset 0 0 18px rgba(55, 227, 155, .25); transition: transform .2s; }
.net-core .halo .ag-ico { width: 46px; height: 46px; }
.net-core.pulse .halo { animation: corePop .5s ease-out; }
@keyframes corePop { 40% { transform: scale(1.12); box-shadow: 0 0 50px rgba(55, 227, 155, .7); } }
.net-core small { font: 700 10.5px var(--mono); letter-spacing: .08em; }
.net-side { position: absolute; bottom: 34px; font: 700 11.5px var(--mono); }
.net-side.l { left: 18%; color: var(--dim); }
.net-side.r { right: 8%; color: var(--green); display: flex; align-items: center; gap: 5px; opacity: .55; transition: opacity .2s; }
.net-side.r.on { opacity: 1; text-shadow: 0 0 10px rgba(55, 227, 155, .8); }
.agree { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.8); font: 800 13px var(--mono); letter-spacing: .05em; color: var(--green); background: #07120d; border: 2px solid var(--green); padding: 5px 14px; border-radius: 12px; box-shadow: 0 0 18px rgba(55, 227, 155, .35); opacity: 0; transition: .2s; white-space: nowrap; }
.agree.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.agree.bad { color: var(--red); border-color: var(--red); background: #160a0d; box-shadow: 0 0 18px rgba(255, 95, 126, .3); }
.agree.buy { color: var(--blue); border-color: var(--blue); background: #08111d; box-shadow: 0 0 18px rgba(90, 168, 255, .3); }
.sig { font: 600 12px var(--mono); color: var(--green); }

.chains { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.chain { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 99px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); font-weight: 600; font-size: 12.5px; }
.chain i { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.chain b { margin-left: auto; font: 600 12px var(--mono); color: var(--muted); }
.chain.bump b { color: var(--text); animation: bump .3s; }
@keyframes bump { 50% { transform: scale(1.35); } }

/* toasts */
.toasts { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 20; width: min(460px, calc(100% - 120px)); pointer-events: none; }
.toast-c {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 16px; background: rgba(28, 33, 42, .96); border: 1px solid #2c3340;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .5);
  animation: toastIn .4s cubic-bezier(.2, .9, .3, 1.2);
}
.toast-c.out { animation: toastOut .3s ease-in forwards; }
@keyframes toastIn { from { transform: translateY(-120%); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(-120%); opacity: 0; } }
.toast-c .tav { width: 40px; height: 40px; border-radius: 11px; overflow: hidden; display: grid; place-items: center; background: #222a36; font: 800 16px Inter; }
.toast-c .tav img { width: 100%; height: 100%; object-fit: cover; }
.toast-c .tav .ag-ico { width: 32px; height: 32px; }
.toast-c b { display: block; font-size: 14.5px; }
.toast-c b.up { color: var(--green); }
.toast-c b.dn { color: var(--red); }
.toast-c span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.toast-c .tb { min-width: 34px; height: 34px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font: 800 11.5px var(--mono); color: #04150d; background: var(--green); }
.toast-c .tb.dn { background: var(--red); color: #fff; }
.toast-c .tb.ylw { background: var(--yellow); }

.sim-foot { position: absolute; left: 0; right: 0; bottom: 6px; text-align: center; font-size: 10.5px; color: var(--dim); pointer-events: none; }

/* ================= Result ================= */
.res-wrap { position: absolute; inset: 0; z-index: 25; display: grid; place-items: center; background: rgba(4, 6, 9, .72); backdrop-filter: blur(5px); animation: simFade .4s ease-out; }
.res {
  width: min(560px, calc(100% - 28px)); max-height: calc(100% - 28px); overflow: auto;
  background: linear-gradient(180deg, #0f1a15, #0b0f14 45%); border: 1px solid #23463a; border-radius: 22px; padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(55, 227, 155, .12);
  animation: resUp .5s cubic-bezier(.2, .9, .3, 1.15);
}
.res.neg { border-color: #4a2430; background: linear-gradient(180deg, #1a0f12, #0b0f14 45%); box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(255, 95, 126, .1); }
@keyframes resUp { from { transform: translateY(30px) scale(.96); opacity: 0; } }
.res-top { display: flex; align-items: center; gap: 12px; }
.res-top .ag-ico { width: 44px; height: 44px; }
.res-top h3 { margin: 0; font-size: 18px; }
.res-top p { margin: 2px 0 0; color: var(--muted); font: 500 12px var(--mono); }
.res-top .chip { margin-left: auto; }
.res-pnl { margin: 18px 0 4px; font: 900 54px Inter, sans-serif; letter-spacing: -.03em; color: var(--green); text-shadow: 0 0 30px rgba(55, 227, 155, .45); line-height: 1; }
.res.neg .res-pnl { color: var(--red); text-shadow: 0 0 30px rgba(255, 95, 126, .35); }
.res-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font: 600 14px var(--mono); color: #c8ccd6; }
.res-line .pct { color: var(--green); }
.res.neg .res-line .pct { color: var(--red); }
.res-info { margin: 16px 0 0; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(255, 255, 255, .035); color: #c8ccd6; font-size: 13px; line-height: 1.6; }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 18px 0 12px; }
.res-cell { background: rgba(255, 255, 255, .035); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.res-cell small { display: block; color: var(--dim); font: 600 10.5px var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.res-cell b { display: block; margin-top: 4px; font: 700 15px var(--mono); }
.res-cell b.up { color: var(--green); }
.res-cell b.dn { color: var(--red); }
.res-cell em { display: block; font-style: normal; color: var(--muted); font-size: 11px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res-agents { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 4px 0 16px; color: var(--muted); font: 500 11.5px var(--mono); }
.res-agents .ag-ico { width: 26px; height: 26px; }
.res-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.res-btns button { height: 46px; border-radius: 13px; font-weight: 700; font-size: 15px; }
.res-btns .again { color: #04150d; background: linear-gradient(180deg, #4ff0ad, #22d488); }
.res-btns .close { color: var(--text); background: rgba(255, 255, 255, .07); border: 1px solid var(--line-2); }
.res-note { margin: 12px 0 0; text-align: center; font-size: 11px; color: var(--dim); }
.confetti { position: absolute; width: 8px; height: 14px; border-radius: 2px; top: -20px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ================= Responsive ================= */
@media (max-width: 900px) {
  .sim { width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .rn-body { grid-template-columns: 1fr; overflow-y: auto; }
  .rn-col { min-height: auto; }
  .chart { min-height: 200px; flex: none; height: 220px; }
  .net-stage { min-height: 210px; flex: none; height: 230px; }
  .bal-num { font-size: 50px; }
  .ring { width: 88px; height: 88px; }
  .toasts { width: calc(100% - 70px); left: 12px; transform: none; }
  .rn-head { padding-right: 52px; flex-wrap: wrap; }
  .big-pnl { font-size: 46px; }
  .sim-foot { position: static; padding: 6px 12px 8px; border-top: 1px solid var(--line); }
  .rn-body { padding-bottom: 14px; }
}
@media (max-width: 420px) {
  .bal-num { font-size: 42px; }
  .chains { grid-template-columns: repeat(2, 1fr); }
  .res-grid { grid-template-columns: repeat(2, 1fr); }
  .res-pnl { font-size: 42px; }
  .cx-node .ag-ico, .cx-node .cx-tb { width: 80px; height: 80px; }
  .cx-pair { gap: 8px; }
  .cx-node { width: 112px; gap: 8px; }
  .cx-node small { font-size: 10.5px; line-height: 1.4; }
  .cx-link .dash { width: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .dock-agent, .dock-core-icon, .ticker-track { animation: none; }
}
