/* ==========================================================================
   CHAOS — command center stylesheet · bright candy edition
   ========================================================================== */
@property --acc  { syntax: '<color>'; inherits: true; initial-value: #3d8bff; }
@property --acc2 { syntax: '<color>'; inherits: true; initial-value: #9b5cff; }

:root {
  --ink: #16224a;
  --ink2: #4a5a86;
  --ink3: #8795b8;
  --line: rgba(22, 34, 74, .09);
  --line-2: rgba(22, 34, 74, .16);
  --blue: #3d8bff; --sky: #36b9ff; --purple: #9b5cff; --violet: #b57cff; --mint: #33e3a4; --lime: #a3de2a;
  --teal: #1fd1c1; --green: #2fd67a; --pink: #ff6fb5; --amber: #ffae1a; --red: #ff4d5e; --orange: #ff8a2a; --yellow: #ffe45c;
  --candy: linear-gradient(135deg, #b46cff 0%, #6a8dff 38%, #36b9ff 62%, #33e3a4 100%);
  --candy-h: linear-gradient(100deg, #b46cff, #5f9bff 50%, #33e3a4);
  --acc: #3d8bff; --acc2: #9b5cff;
  --f-display: 'Big Shoulders Display', 'Chakra Petch', 'Arial Narrow', sans-serif;
  --f-ui: 'Chakra Petch', system-ui, sans-serif;
  --f-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --gap: 12px;
  --r: 22px;
  --shadow: 0 18px 44px -18px rgba(30, 80, 170, .45), 0 2px 6px rgba(30, 80, 170, .08);
}
body { --acc-d: color-mix(in srgb, var(--acc) 72%, #0d1a44); --acc2-d: color-mix(in srgb, var(--acc2) 72%, #0d1a44); transition: --acc .9s ease, --acc2 .9s ease; }
body[data-mode="overload"] { --acc: #ff9f1a; --acc2: #ff6fb5; }
body[data-mode="cascade"]  { --acc: #ff4d5e; --acc2: #9b5cff; }
body[data-mode="region"]   { --acc: #ff8a2a; --acc2: #ff4d5e; }
body[data-mode="dbmelt"]   { --acc: #ff6fb5; --acc2: #9b5cff; }
body[data-mode="latency"]  { --acc: #9b5cff; --acc2: #36b9ff; }
body[data-mode="packet"]   { --acc: #1fd1c1; --acc2: #ff6fb5; }
body[data-mode="recovery"] { --acc: #2fd67a; --acc2: #36b9ff; }
body[data-mode="max"]      { --acc: #ff3b4f; --acc2: #ff8a2a; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: #7cc6ff; color: var(--ink); font-family: var(--f-ui); font-size: 13px;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; cursor: pointer; }
.mono { font-family: var(--f-mono); }
.ico { width: 16px; height: 16px; flex: none; }
.syn { color: var(--ink3); letter-spacing: .14em; }
kbd { font: 700 9px/1 var(--f-mono); padding: 3px 5px; border-radius: 6px; color: var(--ink2); background: rgba(255,255,255,.8); box-shadow: inset 0 -2px 0 rgba(22,34,74,.12); }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }

/* ---------- canvas + global fx ---------- */
#world { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; touch-action: none; }
#world.dragging { cursor: grabbing !important; }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.fx-noise { display: none; }
.fx-scan { overflow: hidden; }
.fx-scan::after {
  content: ''; position: absolute; left: 0; right: 0; height: 30vh; top: -34vh;
  background: linear-gradient(to bottom, transparent, rgba(255,255,255,.12) 80%, rgba(255,255,255,.28) 99%, transparent);
  animation: beam 9s linear infinite;
}
@keyframes beam { to { transform: translateY(170vh); } }
.fx-vignette { background: radial-gradient(ellipse at 50% 50%, transparent 62%, rgba(30, 90, 190, .22) 100%); }
.fx-alert { opacity: 0; transition: opacity .6s; box-shadow: inset 0 0 160px rgba(255, 77, 94, .55), inset 0 0 40px rgba(255, 77, 94, .35); }
body[data-alert="2"] .fx-alert { opacity: .5; }
body[data-alert="3"] .fx-alert { opacity: 1; animation: alertPulse .9s ease-in-out infinite; }
@keyframes alertPulse { 50% { opacity: .45; } }

/* ---------- glitch text ---------- */
.glitch { position: relative; }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; left: 0; top: 0; width: 100%; pointer-events: none; opacity: .85; text-shadow: none;
}
.glitch::before { color: var(--pink); clip-path: inset(0 0 100% 0); animation: gl1 3.4s infinite steps(1); }
.glitch::after { color: var(--sky); clip-path: inset(0 0 100% 0); animation: gl2 2.9s infinite steps(1); }
@keyframes gl1 {
  0%, 84%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  85% { clip-path: inset(12% 0 58% 0); transform: translate(-4px, 1px); }
  88% { clip-path: inset(62% 0 10% 0); transform: translate(3px, -1px); }
  91% { clip-path: inset(38% 0 38% 0); transform: translate(-2px, 0); }
  94% { clip-path: inset(0 0 100% 0); }
}
@keyframes gl2 {
  0%, 78%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  79% { clip-path: inset(50% 0 25% 0); transform: translate(4px, 0); }
  83% { clip-path: inset(8% 0 70% 0); transform: translate(-3px, 1px); }
  86% { clip-path: inset(0 0 100% 0); }
}
body[data-mode="max"] .glitch::before { animation-duration: .9s; }
body[data-mode="max"] .glitch::after { animation-duration: .7s; }

/* ==========================================================================
   BOOT — toy city assembles, then a portal opens into the live simulation
   ========================================================================== */
@property --hole { syntax: '<length>'; inherits: false; initial-value: 0px; }
#boot {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; cursor: pointer; overflow: hidden;
  --hole: 0px;
  -webkit-mask: radial-gradient(circle at 50% 46%, transparent var(--hole), #000 calc(var(--hole) + 1px));
  mask: radial-gradient(circle at 50% 46%, transparent var(--hole), #000 calc(var(--hole) + 1px));
}
#boot.open { animation: portal 1s cubic-bezier(.7, 0, .25, 1) forwards; pointer-events: none; }
@keyframes portal { to { --hole: 150vmax; } }
#boot.done { opacity: 0; pointer-events: none; transition: opacity .3s; }
.bt-sky { position: absolute; inset: 0; background: linear-gradient(180deg, #3aa2ff, #78c4ff 55%, #d2efff); }
.bt-sky::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 82% 6%, rgba(255,255,255,.75), transparent 40%), radial-gradient(circle at 10% 100%, rgba(180,108,255,.35), transparent 45%); }
.bt-rays {
  position: absolute; left: 50%; top: 46%; width: 180vmax; height: 180vmax; margin: -90vmax 0 0 -90vmax; opacity: 0; transform: scale(.4);
  background: repeating-conic-gradient(from 0deg, rgba(255,255,255,.2) 0 6deg, transparent 6deg 18deg);
  -webkit-mask: radial-gradient(circle, #000 0, transparent 55%); mask: radial-gradient(circle, #000 0, transparent 55%);
  transition: opacity 1s, transform 1.4s cubic-bezier(.2, .8, .2, 1);
}
#boot.s1 .bt-rays { opacity: 1; transform: scale(1); animation: spin 40s linear infinite; }
.bt-clouds i {
  position: absolute; display: block; width: 160px; height: 52px; border-radius: 52px; background: #fff; opacity: 0;
  box-shadow: 34px -22px 0 6px #fff, 78px -8px 0 -2px #fff, 0 10px 24px -6px rgba(40, 110, 220, .25);
  transition: transform 1.6s cubic-bezier(.2, .8, .2, 1), opacity 1s;
}
.bt-clouds .c1 { left: 6%; top: 16%; transform: translateX(-40vw) scale(1.2); }
.bt-clouds .c2 { right: 8%; top: 12%; transform: translateX(40vw) scale(.9); }
.bt-clouds .c3 { left: 14%; bottom: 18%; transform: translateX(-50vw) scale(.8); }
.bt-clouds .c4 { right: 12%; bottom: 24%; transform: translateX(50vw) scale(1.1); }
.bt-clouds .c5 { left: 38%; top: 6%; transform: translateY(-30vh) scale(.6); }
.bt-clouds .c6 { right: 32%; bottom: 6%; transform: translateY(30vh) scale(.7); }
#boot.s1 .bt-clouds i { opacity: .95; animation: bob 5s ease-in-out infinite; }
#boot.s1 .bt-clouds .c1 { transform: scale(1.2); } #boot.s1 .bt-clouds .c2 { transform: scale(.9); animation-delay: -1s; }
#boot.s1 .bt-clouds .c3 { transform: scale(.8); animation-delay: -2s; } #boot.s1 .bt-clouds .c4 { transform: scale(1.1); animation-delay: -3s; }
#boot.s1 .bt-clouds .c5 { transform: scale(.6); animation-delay: -1.5s; } #boot.s1 .bt-clouds .c6 { transform: scale(.7); animation-delay: -.5s; }
@keyframes bob { 50% { translate: 0 -10px; } }
#boot.open .bt-clouds i { transition-duration: .9s; }
#boot.open .bt-clouds .c1, #boot.open .bt-clouds .c3 { transform: translateX(-60vw) scale(1.4); }
#boot.open .bt-clouds .c2, #boot.open .bt-clouds .c4 { transform: translateX(60vw) scale(1.4); }
.bt-bubbles { position: absolute; inset: 0; pointer-events: none; }
.bt-bubbles i { position: absolute; bottom: -30px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff, rgba(255,255,255,.35) 45%, rgba(255,255,255,.1)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); animation: rise linear infinite; }
@keyframes rise { to { transform: translateY(-115vh) translateX(var(--dx, 20px)); } }

.bt-center { position: relative; display: flex; flex-direction: column; align-items: center; width: min(520px, 90vw); transition: transform 1s cubic-bezier(.7, 0, .25, 1), opacity .8s; }
#boot.open .bt-center { transform: scale(1.8); opacity: 0; }
.bt-icon { position: relative; width: 190px; height: 190px; transform: scale(0) rotate(-20deg); }
#boot.s1 .bt-icon { animation: iconPop .9s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes iconPop { to { transform: scale(1) rotate(0); } }
#boot.shake .bt-squircle { animation: iconShake .45s ease; }
@keyframes iconShake { 20% { transform: translate(-6px, 2px) rotate(-3deg); } 40% { transform: translate(6px, -2px) rotate(3deg); } 60% { transform: translate(-4px, 1px) rotate(-2deg); } 80% { transform: translate(3px, 0) rotate(1deg); } }
.bt-squircle {
  position: absolute; inset: 0; border-radius: 52px; overflow: hidden;
  background: linear-gradient(145deg, #c07bff 0%, #7d8dff 40%, #3fc6ff 70%, #37e8a4 100%);
  box-shadow: 0 30px 60px -18px rgba(70, 60, 200, .6), inset 0 4px 0 rgba(255,255,255,.55), inset 0 -8px 16px rgba(40, 20, 140, .25);
}
.bt-gloss { position: absolute; left: 8%; right: 8%; top: 4%; height: 38%; border-radius: 44px 44px 60% 60%; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0)); }
.bt-city { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bt-city .plat { transform-box: fill-box; transform-origin: center; transform: translateY(30px) scale(.6); opacity: 0; transition: transform .7s cubic-bezier(.2, 1.5, .4, 1), opacity .4s; }
#boot.s2 .bt-city .plat { transform: none; opacity: 1; }
.bt-city .bld { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform .8s cubic-bezier(.2, 1.5, .4, 1); transition-delay: var(--d); }
#boot.s3 .bt-city .bld { transform: scaleY(1); }
.bt-city .win { fill: rgba(40, 40, 90, .25); transition: fill .25s; }
.bt-city .win.on { fill: #fff3a0; }
.bt-city .tree { transform-box: fill-box; transform-origin: 50% 100%; transform: scale(0); transition: transform .5s cubic-bezier(.2, 1.8, .4, 1); transition-delay: var(--d); }
#boot.s2 .bt-city .tree { transform: scale(1); }
.bt-city .bulb { opacity: 0; transition: opacity .3s; transition-delay: var(--d); }
#boot.s3 .bt-city .bulb { opacity: 1; animation: blink 1.1s infinite; }
.bt-city .bld.broken .face { fill: #ff4d5e !important; }
.bt-city .bld.broken { animation: brk .12s steps(2) 4; }
@keyframes brk { 50% { opacity: .4; } }
.bt-rings i { position: absolute; inset: 0; border-radius: 52px; border: 3px solid rgba(255,255,255,.85); opacity: 0; }
#boot.s1 .bt-rings i { animation: ring 2.2s ease-out infinite; }
#boot.s1 .bt-rings i:nth-child(2) { animation-delay: .7s; }
#boot.s1 .bt-rings i:nth-child(3) { animation-delay: 1.4s; }
@keyframes ring { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.7); opacity: 0; } }
#boot.red .bt-rings i { border-color: rgba(255, 77, 94, .9); }
.bt-alert {
  position: absolute; left: 50%; top: -14px; transform: translate(-50%, 10px) scale(.6); opacity: 0; white-space: nowrap; z-index: 2;
  padding: 7px 12px; border-radius: 20px; font-size: 10px; font-weight: 700; letter-spacing: .16em; color: #fff; background: #ff4d5e;
  box-shadow: 0 8px 18px -6px rgba(255, 59, 79, .8); transition: all .35s cubic-bezier(.2, 1.6, .4, 1);
}
#boot.red .bt-alert { opacity: 1; transform: translate(-50%, 0) scale(1); }
#boot.fixed .bt-alert { opacity: 1; transform: translate(-50%, 0) scale(1); background: #2fd67a; box-shadow: 0 8px 18px -6px rgba(47, 214, 122, .8); }

.bt-word { display: flex; gap: 2px; margin-top: 28px; font: 900 clamp(64px, 11vw, 112px)/.85 var(--f-display); letter-spacing: .04em; }
.bt-word span {
  display: inline-block; color: #fff; opacity: 0; transform: translateY(-120px) rotate(-12deg) scale(.6);
  text-shadow: 0 4px 0 var(--sc, #7d5cff), 0 8px 0 rgba(40, 20, 140, .25), 0 18px 30px rgba(20, 60, 170, .35);
}
.bt-word span:nth-child(1) { --sc: #b46cff; } .bt-word span:nth-child(2) { --sc: #6a8dff; } .bt-word span:nth-child(3) { --sc: #36b9ff; }
.bt-word span:nth-child(4) { --sc: #1fd1c1; } .bt-word span:nth-child(5) { --sc: #33c98a; }
#boot.s2 .bt-word span { animation: drop .8s cubic-bezier(.2, 1.7, .4, 1) forwards; animation-delay: calc(var(--i) * 80ms); }
@keyframes drop { to { opacity: 1; transform: none; } }
#boot.s5 .bt-word span { animation: drop .8s cubic-bezier(.2, 1.7, .4, 1) forwards, wave 1.4s ease-in-out infinite; animation-delay: 0s, calc(var(--i) * 100ms); }
@keyframes wave { 50% { translate: 0 -8px; } }
.bt-tag { font-size: 10px; font-weight: 700; letter-spacing: .3em; color: #fff; margin-top: 12px; opacity: 0; transform: translateY(8px); transition: all .6s .4s; text-shadow: 0 1px 4px rgba(20, 60, 170, .4); }
#boot.s2 .bt-tag { opacity: 1; transform: none; }
.bt-status {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 22px; padding: 9px 16px; border-radius: 22px; min-width: 300px; justify-content: center;
  font-size: 11px; font-weight: 700; letter-spacing: .16em; color: var(--ink); background: rgba(255,255,255,.92);
  box-shadow: 0 10px 24px -10px rgba(20, 60, 170, .45); opacity: 0; transform: translateY(12px) scale(.9); transition: all .5s cubic-bezier(.2, 1.4, .4, 1) .3s, background .3s, color .3s;
}
#boot.s2 .bt-status { opacity: 1; transform: none; }
.bt-status i { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px rgba(61, 139, 255, .25); animation: blink .7s infinite; }
#boot.red .bt-status { background: #ff4d5e; color: #fff; }
#boot.red .bt-status i { background: #fff; }
#boot.fixed .bt-status, #boot.s5 .bt-status { background: #2fd67a; color: #fff; }
#boot.fixed .bt-status i, #boot.s5 .bt-status i { background: #fff; }
.bt-status span { display: inline-block; }
.bt-status span.flip { animation: flip .35s ease; }
@keyframes flip { 0% { transform: translateY(10px); opacity: 0; filter: blur(4px); } 100% { transform: none; opacity: 1; filter: none; } }
.bt-bar { position: relative; width: min(360px, 80vw); height: 12px; margin-top: 16px; border-radius: 12px; background: rgba(255,255,255,.55); box-shadow: inset 0 2px 4px rgba(20, 60, 170, .2); overflow: hidden; opacity: 0; transition: opacity .4s .5s; }
#boot.s2 .bt-bar { opacity: 1; }
.bt-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 12px; background: linear-gradient(90deg, #b46cff, #5f9bff, #36b9ff, #33e3a4); box-shadow: inset 0 2px 0 rgba(255,255,255,.5); transition: width .3s ease; }
.bt-bar i::after { content: ''; position: absolute; inset: 0; border-radius: 12px; background: repeating-linear-gradient(-45deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px); animation: barMove .6s linear infinite; }
@keyframes barMove { to { background-position: 17px 0; } }
.bt-bar b { position: absolute; top: 3px; width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; animation: pkRun 1.2s linear infinite; }
.bt-bar b:nth-of-type(2) { animation-delay: .4s; } .bt-bar b:nth-of-type(3) { animation-delay: .8s; }
@keyframes pkRun { from { left: -8px; } to { left: 100%; } }
.bt-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(360px, 80vw); margin-top: 12px; opacity: 0; transition: opacity .4s .6s; }
#boot.s2 .bt-meta { opacity: 1; }
.bt-pct { white-space: nowrap; flex: none; font: 900 30px/1 var(--f-display); color: #fff; letter-spacing: .02em; text-shadow: 0 3px 0 #5f7dff, 0 8px 16px rgba(20, 60, 170, .35); font-variant-numeric: tabular-nums; }
.bt-pct em { font-style: normal; display: inline-block; min-width: 2.2ch; text-align: right; }
.bt-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; max-width: 280px; }
.bt-chips span { font-size: 8.5px; font-weight: 700; letter-spacing: .1em; padding: 5px 8px; border-radius: 12px; color: var(--ink); background: #fff; box-shadow: 0 4px 10px -4px rgba(20, 60, 170, .4); animation: chipIn .45s cubic-bezier(.2, 1.8, .4, 1) both; }
.bt-chips span b { color: #12a85a; }
@keyframes chipIn { from { transform: scale(0) translateY(8px); opacity: 0; } }
.bt-skip { white-space: nowrap; position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 700; letter-spacing: .26em; color: rgba(255,255,255,.9); padding: 7px 14px; border-radius: 20px; background: rgba(255,255,255,.18); }
.bt-portal { position: absolute; left: 50%; top: 46%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; border: 6px solid #fff; opacity: 0; pointer-events: none; }
#boot.open .bt-portal { animation: portalRing 1s cubic-bezier(.7, 0, .25, 1) forwards; }
.bt-conf { position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 3px; background: var(--c); pointer-events: none; animation: conf 1.1s cubic-bezier(.15, .7, .3, 1) forwards; }
.bt-conf.round { border-radius: 50%; }
@keyframes conf { 0% { transform: translate(0, 0) rotate(0) scale(.4); opacity: 1; } 70% { opacity: 1; } 100% { transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); opacity: 0; } }
@media (max-width: 600px) {
  .bt-clouds i { width: 90px; height: 30px; box-shadow: 20px -13px 0 4px #fff, 44px -5px 0 -1px #fff, 0 8px 16px -6px rgba(40, 110, 220, .25); }
  .bt-icon { width: 160px; height: 160px; }
  .bt-squircle, .bt-rings i { border-radius: 44px; }
  .bt-tag { font-size: 8px; letter-spacing: .18em; }
  .bt-status { min-width: 0; width: 90%; font-size: 9.5px; letter-spacing: .1em; }
  .bt-pct { font-size: 26px; }
  .bt-skip { font-size: 8px; letter-spacing: .2em; }
}
@keyframes portalRing { 0% { opacity: 1; transform: scale(0); } 100% { opacity: 0; transform: scale(320); border-width: .2px; } }

/* ==========================================================================
   APP GRID
   ========================================================================== */
#app {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  display: grid; gap: var(--gap); padding: var(--gap);
  grid-template-columns: 296px minmax(0, 1fr) 336px;
  grid-template-rows: 60px minmax(0, 1fr) 208px;
  grid-template-areas: "top top top" "left stage right" "dock dock dock";
}
body[data-mode="max"] #app { animation: jitter .22s steps(2) infinite; }
@keyframes jitter { 50% { transform: translate(.6px, -.4px); } }

.topbar, .p-left, .p-right, .dock, .hud-in { transition: transform 1s cubic-bezier(.16, .84, .24, 1), opacity .9s ease; }
body:not(.live) .topbar { transform: translateY(-24px); opacity: 0; }
body:not(.live) .p-left { transform: translateX(-40px); opacity: 0; }
body:not(.live) .p-right { transform: translateX(40px); opacity: 0; }
body:not(.live) .dock { transform: translateY(40px); opacity: 0; }
body:not(.live) .hud-in { opacity: 0; }
body.live .topbar { transition-delay: .05s; }
body.live .p-left { transition-delay: .2s; }
body.live .p-right { transition-delay: .3s; }
body.live .dock { transition-delay: .42s; }
body.live .hud-in { transition-delay: .6s; }

/* ---------- panels ---------- */
.panel {
  pointer-events: auto; position: relative; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,.88), rgba(244,249,255,.78));
  border: 1.5px solid rgba(255,255,255,.95); border-radius: var(--r);
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%);
  box-shadow: var(--shadow), inset 0 -6px 18px rgba(90, 140, 255, .07);
}
.panel::before {
  content: ''; position: absolute; left: 18px; right: 18px; top: 0; height: 4px; z-index: 2; border-radius: 0 0 6px 6px;
  background: linear-gradient(90deg, var(--acc2), var(--acc)); opacity: .9;
}
.ph { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); flex: none; }
.ph-k { font-size: 9px; letter-spacing: .24em; color: var(--acc-d); font-weight: 700; }
.ph-t { font: 700 15px/1.2 var(--f-ui); letter-spacing: .06em; margin-top: 2px; }
.ph-badge { font-size: 9px; letter-spacing: .14em; padding: 5px 9px; border-radius: 20px; background: rgba(22,34,74,.05); color: var(--ink2); }
.pbody { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 4px 16px 16px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--acc) 40%, transparent) transparent; }
.pbody::-webkit-scrollbar { width: 5px; }
.pbody::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--acc) 40%, transparent); border-radius: 5px; }
.sh { display: flex; align-items: center; gap: 8px; font: 700 10px/1 var(--f-mono); letter-spacing: .16em; color: var(--ink2); margin: 16px 0 9px; white-space: nowrap; }
.sh b { color: #fff; background: linear-gradient(135deg, var(--acc2), var(--acc)); padding: 3px 5px; border-radius: 6px; font-size: 9px; }
.sh::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); order: 2; }
.sh .sh-r { order: 3; color: var(--acc-d); letter-spacing: .08em; font-size: 9px; }

/* ---------- top bar ---------- */
.topbar {
  grid-area: top; pointer-events: auto; position: relative; display: flex; align-items: center; gap: 16px; padding: 0 10px 0 12px;
  background: linear-gradient(180deg, rgba(255,255,255,.92), rgba(244,249,255,.8)); border: 1.5px solid #fff; border-radius: 20px;
  backdrop-filter: blur(18px) saturate(160%); -webkit-backdrop-filter: blur(18px) saturate(160%); box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 36px; height: 36px; padding: 5px; border-radius: 12px; background: var(--candy); box-shadow: 0 6px 14px -4px rgba(120, 90, 255, .6), inset 0 2px 0 rgba(255,255,255,.5); animation: markSpin 12s linear infinite; }
.brand-mark path { stroke: #fff; }
.brand-mark path + path { fill: #fff; }
@keyframes markSpin { 0%, 90% { transform: none; } 95% { transform: rotate(8deg) scale(1.06); } 100% { transform: none; } }
.brand-word { font: 900 30px/1 var(--f-display); letter-spacing: .07em; background: var(--candy-h); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-word.glitch::before, .brand-word.glitch::after { -webkit-text-fill-color: currentColor; }
.brand-sub { font-size: 8.5px; line-height: 1.35; letter-spacing: .16em; color: var(--ink2); border-left: 1px solid var(--line-2); padding-left: 10px; }
.brand-sub span { color: var(--purple); font-weight: 700; }
.nav { display: flex; gap: 2px; margin-left: 8px; }
.nav button { position: relative; font: 700 11px/1 var(--f-ui); letter-spacing: .14em; color: var(--ink2); padding: 10px 12px; border-radius: 12px; transition: all .2s; }
.nav button:hover { color: var(--ink); background: rgba(61, 139, 255, .1); }
.status-cluster { display: flex; align-items: center; gap: 14px; margin-left: auto; font-size: 10px; }
.state-pill { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 20px; color: #0f8a4a; letter-spacing: .12em; font-weight: 700; background: rgba(47, 214, 122, .16); transition: all .4s; white-space: nowrap; }
.state-pill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 25%, transparent); animation: blink 1.2s infinite; }
.state-pill.l1 { color: #b56d00; background: rgba(255, 174, 26, .2); }
.state-pill.l2, .state-pill.l3 { color: #d91f36; background: rgba(255, 77, 94, .18); }
.state-pill.l3 { animation: pillFlash .5s steps(2) infinite; }
.state-pill.rc { color: #0f8a4a; background: rgba(47, 214, 122, .2); }
@keyframes pillFlash { 50% { background: rgba(255, 77, 94, .38); } }
@keyframes blink { 50% { opacity: .3; } }
.tb-stat { display: flex; flex-direction: column; gap: 2px; letter-spacing: .1em; }
.tb-stat small { font-size: 8px; color: var(--ink3); letter-spacing: .2em; }
.tb-stat span { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.9); color: var(--ink2); box-shadow: 0 2px 6px rgba(30, 80, 170, .12), inset 0 -2px 0 rgba(22,34,74,.08); transition: all .2s; }
.icon-btn:hover { color: var(--acc-d); transform: translateY(-1px); }
.icon-btn.on { color: #fff; background: linear-gradient(135deg, var(--acc2), var(--acc)); }
.m-only { display: none; }
.xlogo { width: 15px; height: 15px; display: block; }
.x-btn { color: #fff; background: var(--ink); box-shadow: 0 4px 10px -3px rgba(22, 34, 74, .6), inset 0 2px 0 rgba(255,255,255,.18); }
.x-btn:hover { color: #fff; background: #000; transform: translateY(-1px) rotate(-6deg); }
.tk-x { grid-column: span 2; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border-radius: 12px; font-size: 9.5px; font-weight: 700; letter-spacing: .14em; color: #fff; background: var(--ink); box-shadow: 0 6px 14px -6px rgba(22, 34, 74, .7), inset 0 2px 0 rgba(255,255,255,.15); transition: all .2s; }
.tk-x:hover { background: #000; transform: translateY(-1px); }
.tk-x .xlogo { width: 13px; height: 13px; }
.m-btn .xlogo { display: inline-block; width: 12px; height: 12px; vertical-align: -2px; margin-right: 6px; }
.m-btn.xb { color: #fff; background: var(--ink); }
.m-btn.xb:hover { color: #fff; background: #000; }

.btn-wallet {
  position: relative; display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 16px; flex: none; border-radius: 14px;
  font: 700 11px/1 var(--f-ui); letter-spacing: .12em; color: var(--ink); background: #fff;
  box-shadow: 0 3px 10px rgba(30, 80, 170, .15), inset 0 -3px 0 rgba(22,34,74,.08); transition: all .25s;
}
.btn-wallet:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(30, 80, 170, .22), inset 0 -3px 0 rgba(22,34,74,.08); }
.wdot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink3); }
.btn-wallet[data-state="loading"] .wdot { background: var(--amber); animation: blink .5s infinite; }
.btn-wallet[data-state="connected"] .wdot { background: var(--green); box-shadow: 0 0 0 3px rgba(47,214,122,.25); }
.btn-wallet[data-state="error"] { color: #d91f36; }
.btn-wallet[data-state="error"] .wdot { background: var(--red); }

.btn-buy {
  position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; height: 42px; padding: 0 22px; flex: none;
  background: var(--candy); color: #fff; border-radius: 16px;
  box-shadow: 0 8px 20px -6px rgba(120, 90, 255, .65), inset 0 2px 0 rgba(255,255,255,.45), inset 0 -3px 0 rgba(40, 20, 120, .18); transition: transform .2s, filter .2s;
}
.btn-buy .buy-t { position: relative; font: 800 14px/1 var(--f-ui); letter-spacing: .1em; text-shadow: 0 1px 2px rgba(40, 20, 120, .35); }
.btn-buy .buy-s { position: relative; font-size: 8px; letter-spacing: .3em; opacity: .9; margin-top: 3px; }
.buy-shine { position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.6), transparent); animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.btn-buy:hover { transform: translateY(-2px) scale(1.02); filter: saturate(1.2) brightness(1.05); }

/* ---------- left panel controls ---------- */
.p-left { grid-area: left; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; gap: 3px; border-radius: 14px; background: rgba(22,34,74,.05); }
.seg button { font: 700 9.5px/1 var(--f-mono); letter-spacing: .04em; padding: 9px 2px; border-radius: 11px; color: var(--ink2); transition: all .2s; }
.seg button:hover { color: var(--ink); background: rgba(255,255,255,.7); }
.seg button.on { color: #fff; background: linear-gradient(135deg, var(--acc2), var(--acc)); box-shadow: 0 4px 10px -2px color-mix(in srgb, var(--acc) 55%, transparent); }

.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mode {
  --c: #3d8bff; position: relative; overflow: hidden; text-align: left; padding: 9px 8px 8px; border-radius: 13px;
  font: 700 9px/1.15 var(--f-mono); letter-spacing: .03em; color: var(--ink2);
  background: #fff; box-shadow: 0 2px 6px rgba(30, 80, 170, .1), inset 0 -2px 0 rgba(22,34,74,.06); transition: all .22s; min-height: 44px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
}
.mode i { width: 16px; height: 5px; border-radius: 5px; background: var(--c); transition: all .25s; }
.mode:hover { color: var(--ink); transform: translateY(-2px); box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--c) 60%, transparent); }
.mode.on { color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--c) 78%, #fff), var(--c)); box-shadow: 0 6px 16px -4px color-mix(in srgb, var(--c) 80%, transparent), inset 0 2px 0 rgba(255,255,255,.4); }
.mode.on i { width: 100%; background: rgba(255,255,255,.85); }
.mode[data-mode="max"] { grid-column: span 3; min-height: 36px; flex-direction: row; align-items: center; justify-content: center; font-size: 10.5px; letter-spacing: .2em; color: #d91f36; }
.mode[data-mode="max"] i { position: absolute; left: 10px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; }
.mode[data-mode="max"].on { color: #fff; background: linear-gradient(120deg, #ff8a2a, #ff3b4f 50%, #ff6fb5); animation: maxPulse .8s ease-in-out infinite; }
@keyframes maxPulse { 50% { box-shadow: 0 0 0 4px rgba(255, 77, 94, .25), 0 10px 26px -6px rgba(255, 59, 79, .8); } }

.ctl { margin-bottom: 12px; }
.ctl label { display: flex; justify-content: space-between; font: 700 9.5px/1 var(--f-mono); letter-spacing: .14em; color: var(--ink2); margin-bottom: 8px; }
.ctl output { color: var(--acc-d); font-variant-numeric: tabular-nums; }
.rng { --v: 50%; -webkit-appearance: none; appearance: none; width: 100%; height: 20px; background: transparent; cursor: pointer; }
.rng::-webkit-slider-runnable-track { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--acc2), var(--acc) var(--v), rgba(22,34,74,.09) var(--v)); }
.rng::-moz-range-track { height: 8px; border-radius: 8px; background: rgba(22,34,74,.09); }
.rng::-moz-range-progress { height: 8px; border-radius: 8px; background: linear-gradient(90deg, var(--acc2), var(--acc)); }
.rng::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -6px; border-radius: 50%; background: #fff; border: 3px solid var(--acc); box-shadow: 0 3px 8px rgba(30, 80, 170, .3); transition: transform .2s; }
.rng::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--acc); box-shadow: 0 3px 8px rgba(30, 80, 170, .3); }
.rng:hover::-webkit-slider-thumb { transform: scale(1.15); }
.rng.hot::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--amber), var(--red) var(--v), rgba(22,34,74,.09) var(--v)); }
.rng.hot::-webkit-slider-thumb { border-color: var(--red); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { font: 700 9px/1 var(--f-mono); letter-spacing: .06em; padding: 8px 10px; border-radius: 20px; color: var(--ink2); background: #fff; box-shadow: 0 2px 5px rgba(30, 80, 170, .1); transition: all .2s; }
.chips button:hover { color: var(--ink); transform: translateY(-1px); }
.chips button.on { color: #fff; background: linear-gradient(135deg, var(--acc2), var(--acc)); box-shadow: 0 4px 10px -3px color-mix(in srgb, var(--acc) 60%, transparent); }
.chips button .rd { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; background: var(--green); vertical-align: 0; }
.chips button .rd.bad { background: var(--red); }
.chips button .rd.hot { background: var(--amber); }
.chips button.on .rd { box-shadow: 0 0 0 2px #fff; }

.btn-inject, .btn-reset {
  position: relative; overflow: hidden; width: 100%; margin-top: 9px; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; font: 800 11px/1 var(--f-ui); letter-spacing: .16em; border-radius: 14px; transition: all .2s;
}
.btn-inject { color: #fff; background: linear-gradient(120deg, #ff6fb5, #ff4d5e); box-shadow: 0 8px 18px -6px rgba(255, 77, 94, .7), inset 0 2px 0 rgba(255,255,255,.35), inset 0 -3px 0 rgba(120, 0, 30, .15); }
.btn-inject kbd { background: rgba(255,255,255,.25); color: #fff; box-shadow: none; }
.btn-inject::after, .cmd::after, .btn-reset::after, .tk-buy::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: -80%; width: 60%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent); transition: left .55s ease;
}
.btn-inject:hover::after, .cmd:hover::after, .btn-reset:hover::after, .tk-buy:hover::after { left: 130%; }
.btn-inject:hover { transform: translateY(-1px); }
.btn-reset { justify-content: center; margin-top: 14px; color: var(--ink2); background: #fff; box-shadow: 0 2px 6px rgba(30, 80, 170, .12), inset 0 -3px 0 rgba(22,34,74,.07); }
.btn-reset:hover { color: var(--ink); }

.tgl { display: flex; align-items: center; gap: 11px; padding: 7px 0; cursor: pointer; }
.tgl input { position: absolute; opacity: 0; pointer-events: none; }
.sw { position: relative; width: 38px; height: 22px; flex: none; border-radius: 22px; background: rgba(22,34,74,.12); transition: all .25s; }
.sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(22,34,74,.25); transition: all .25s cubic-bezier(.2, .8, .2, 1); }
.tgl input:checked + .sw { background: linear-gradient(135deg, var(--acc2), var(--acc)); }
.tgl input:checked + .sw::after { left: 19px; }
.tgl input:focus-visible + .sw { outline: 2px solid var(--acc); outline-offset: 2px; }
.tl { display: flex; flex-direction: column; gap: 3px; font: 700 10.5px/1.1 var(--f-ui); letter-spacing: .1em; }
.tl small { font: 400 9.5px/1.1 var(--f-mono); letter-spacing: .02em; color: var(--ink3); }

/* ---------- stage HUD ---------- */
#stage { grid-area: stage; position: relative; pointer-events: none; min-width: 0; min-height: 0; }
.sc { display: none; }
.hud-hero { position: absolute; left: 22px; top: 14px; max-width: 64%; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 9.5px; font-weight: 700; letter-spacing: .2em; color: var(--ink); padding: 6px 12px; border-radius: 20px; background: rgba(255,255,255,.85); box-shadow: 0 3px 10px rgba(30, 80, 170, .15); }
.rec { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
.hero-title {
  font: 900 clamp(40px, 4.8vw, 92px)/.86 var(--f-display); letter-spacing: .015em; margin: 12px 0 12px; color: #fff; white-space: nowrap;
  text-shadow: 0 3px 0 color-mix(in srgb, var(--acc) 75%, #2a4fd0), 0 6px 0 color-mix(in srgb, var(--acc2) 65%, #3a2ab0), 0 14px 28px rgba(20, 60, 170, .35);
  transition: opacity .25s, transform .35s, filter .25s;
}
.hero-title.swap { opacity: 0; transform: translateX(-12px) skewX(-8deg); filter: blur(6px); }
.hero-sub { display: inline-flex; gap: 10px; font-size: 10.5px; font-weight: 700; letter-spacing: .18em; color: var(--ink2); padding: 6px 12px; border-radius: 20px; background: rgba(255,255,255,.85); box-shadow: 0 3px 10px rgba(30, 80, 170, .15); }
.hero-sub .sep { color: var(--ink3); }
.state-line { color: #0f8a4a; transition: color .3s; }
.state-line.l1 { color: #c07400; }
.state-line.l2, .state-line.l3 { color: #d91f36; }
.state-line.l3 { animation: blink .5s steps(2) infinite; }
.state-line.rc { color: #0f8a4a; }

.hud-right { position: absolute; right: 14px; top: 16px; width: 232px; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.radar-wrap { position: relative; width: 128px; height: 128px; border-radius: 50%; box-shadow: var(--shadow), 0 0 0 5px rgba(255,255,255,.75); }
#radar { width: 100%; height: 100%; display: block; border-radius: 50%; }
.radar-ring { position: absolute; inset: -11px; border-radius: 50%; border: 2px dashed rgba(255,255,255,.9); animation: spin 30s linear infinite; }
.radar-ring::after { content: ''; position: absolute; top: -5px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 3px #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
.radar-lbl { position: absolute; left: -84px; bottom: 4px; display: flex; flex-direction: column; align-items: flex-end; font-size: 8.5px; font-weight: 700; letter-spacing: .2em; color: #fff; text-shadow: 0 1px 3px rgba(20, 60, 170, .5); }
.radar-lbl b { font: 800 26px/1 var(--f-display); color: #fff; letter-spacing: .04em; text-shadow: 0 2px 0 var(--acc), 0 4px 10px rgba(20, 60, 170, .3); }
.alerts { pointer-events: auto; width: 100%; display: flex; flex-direction: column; gap: 5px; }
.al {
  display: grid; grid-template-columns: 8px 1fr auto; gap: 8px; align-items: center; padding: 7px 11px 7px 10px; border-radius: 13px;
  background: rgba(255,255,255,.92); box-shadow: 0 4px 12px rgba(30, 80, 170, .16);
  font: 700 9.5px/1.2 var(--f-mono); letter-spacing: .04em; animation: alIn .35s cubic-bezier(.2, .8, .2, 1);
}
.al::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--green)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c, var(--green)) 25%, transparent); }
.al b { color: var(--ink); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al span { color: color-mix(in srgb, var(--c) 75%, #0d1a44); font-size: 8.5px; }
.al.crit { --c: var(--red); background: #fff1f3; }
.al.crit::before { animation: blink .6s infinite; }
.al.warn { --c: var(--amber); }
.al.rcvr { --c: var(--green); }
.al.info { --c: var(--blue); }
.al.more { grid-template-columns: 1fr; padding-left: 12px; color: var(--ink2); }
.al.more::before { display: none; }
@keyframes alIn { from { opacity: 0; transform: translateX(16px) scale(.96); } }

.hud-bl { position: absolute; left: 16px; bottom: 14px; display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 5px 12px; max-width: 380px; font-size: 8.5px; font-weight: 700; letter-spacing: .12em; color: var(--ink); padding: 8px 12px; border-radius: 14px; background: rgba(255,255,255,.85); box-shadow: 0 3px 10px rgba(30, 80, 170, .14); }
.legend i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 3px; background: var(--c); vertical-align: -1px; }
.cam { display: flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 700; letter-spacing: .12em; color: var(--ink2); }
.cam button { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 10px; color: var(--ink2); background: #fff; box-shadow: 0 3px 8px rgba(30, 80, 170, .16), inset 0 -2px 0 rgba(22,34,74,.07); transition: all .2s; }
.cam button:hover { color: var(--acc-d); transform: translateY(-1px); }
.cam button .ico { width: 14px; height: 14px; }
.cam span { margin-left: 6px; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.8); font-variant-numeric: tabular-nums; }
.hud-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); font-size: 9px; font-weight: 700; letter-spacing: .16em; color: var(--ink2); white-space: nowrap; padding: 7px 12px; border-radius: 20px; background: rgba(255,255,255,.8); }
.hud-hint b { color: var(--acc-d); }
.demo-tag { position: absolute; right: 16px; bottom: 14px; font-size: 8.5px; font-weight: 700; letter-spacing: .22em; color: var(--ink2); padding: 6px 10px; border-radius: 20px; background: rgba(255,255,255,.8); }

/* banner */
.banner {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.9); opacity: 0; pointer-events: none; text-align: center; z-index: 3;
  padding: 18px 46px 16px; --c: var(--red); border-radius: 28px; overflow: hidden;
  background: rgba(255,255,255,.95); box-shadow: 0 24px 60px -16px color-mix(in srgb, var(--c) 70%, transparent), 0 0 0 6px color-mix(in srgb, var(--c) 35%, transparent);
}
.banner::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 7px; background: repeating-linear-gradient(-45deg, var(--c) 0 8px, transparent 8px 16px); }
.banner.show { animation: bannerIn 2.8s cubic-bezier(.2, .8, .2, 1) forwards; }
.banner.amber { --c: var(--amber); } .banner.green { --c: var(--green); } .banner.cyan { --c: var(--blue); } .banner.magenta { --c: var(--purple); }
.bn-k { font-size: 10px; font-weight: 700; letter-spacing: .36em; color: color-mix(in srgb, var(--c) 70%, #0d1a44); }
.bn-t { font: 900 clamp(38px, 5vw, 76px)/.95 var(--f-display); letter-spacing: .03em; color: var(--c); margin: 4px 0; white-space: nowrap; text-shadow: 0 3px 0 color-mix(in srgb, var(--c) 55%, #0d1a44); }
.bn-s { font-size: 10.5px; font-weight: 700; letter-spacing: .2em; color: var(--ink2); }
@keyframes bannerIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); filter: blur(10px); }
  8% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: none; }
  12% { transform: translate(-50%, -50%) scale(1.04); } 16% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(.96); filter: blur(4px); }
}

/* node drawer */
.node-drawer {
  position: absolute; right: 14px; bottom: 50px; width: 266px; pointer-events: auto; z-index: 4; border-radius: 22px; overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f2f7ff); border: 1.5px solid #fff; box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent);
  transform: translateX(30px); opacity: 0; visibility: hidden; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s, visibility 0s .45s;
  --c: var(--acc);
}
.node-drawer.open { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
.node-drawer::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: var(--c); }
.nd-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 12px 0 16px; font: 700 9px/1 var(--f-mono); letter-spacing: .18em; color: color-mix(in srgb, var(--c) 70%, #0d1a44); }
.nd-x { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 9px; color: var(--ink2); background: rgba(22,34,74,.06); }
.nd-x:hover { color: var(--ink); }
.nd-x .ico { width: 12px; height: 12px; }
.nd-id { font: 800 24px/1.05 var(--f-display); letter-spacing: .03em; padding: 6px 16px 0; }
.nd-st { display: inline-flex; gap: 6px; align-items: center; margin: 7px 16px 9px; font: 700 9px/1 var(--f-mono); letter-spacing: .16em; color: #fff; padding: 5px 9px; border-radius: 20px; background: var(--c); }
.nd-st i { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: blink 1s infinite; }
.nd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; padding: 0 16px; }
.nd-f { font: 700 8.5px/1.2 var(--f-mono); letter-spacing: .12em; color: var(--ink3); }
.nd-f b { display: block; font: 700 12px/1.3 var(--f-mono); letter-spacing: .02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.nd-f.full { grid-column: span 2; }
.nd-bar { height: 6px; border-radius: 6px; background: rgba(22,34,74,.08); margin-top: 4px; overflow: hidden; }
.nd-bar i { display: block; height: 100%; border-radius: 6px; background: var(--bc, var(--acc)); transition: width .3s; }
.nd-spark { display: block; width: calc(100% - 32px); height: 38px; margin: 9px 16px 0; }
.nd-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 10px 16px 14px; }
.nd-actions button { font: 800 8.5px/1 var(--f-mono); letter-spacing: .06em; padding: 9px 2px; border-radius: 10px; color: var(--ink2); background: rgba(22,34,74,.05); transition: all .2s; }
.nd-actions button:hover { color: #fff; background: var(--bc, var(--acc)); box-shadow: 0 4px 10px -3px var(--bc, var(--acc)); }
.nd-actions button:disabled { opacity: .35; pointer-events: none; }
.nd-token { margin: 0 16px 14px; display: block; text-align: center; padding: 11px; font: 800 12px/1 var(--f-ui); letter-spacing: .12em; color: #fff; background: var(--candy); border-radius: 14px; }

/* ---------- right panel ---------- */
.p-right { grid-area: right; }
.health { display: grid; grid-template-columns: 118px 1fr; gap: 12px; align-items: center; margin-top: 12px; }
.gauge-wrap { position: relative; width: 118px; height: 118px; }
.gauge { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.g-ticks { fill: none; stroke: color-mix(in srgb, var(--acc) 45%, transparent); stroke-width: 3; stroke-dasharray: 1 4.6; transform-origin: 60px 60px; animation: spin 40s linear infinite; }
.g-bg { fill: none; stroke: rgba(22,34,74,.08); stroke-width: 9; }
.g-val { fill: none; stroke-width: 9; stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; transition: stroke-dashoffset .5s ease; }
.g-inner { fill: #fff; stroke: none; filter: drop-shadow(0 3px 6px rgba(30, 80, 170, .18)); }
.g-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.g-center b { font: 800 30px/1 var(--f-display); letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.g-center small { font: 700 7px/1 var(--f-mono); letter-spacing: .2em; color: var(--ink2); margin-top: 4px; }
.health-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.grade { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 1px solid var(--line); padding-bottom: 5px; }
.grade span { font-size: 9px; font-weight: 700; letter-spacing: .2em; color: var(--ink2); }
.grade b { font: 900 32px/1 var(--f-display); background: linear-gradient(135deg, var(--acc2), var(--acc)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.grade b.bad { background: linear-gradient(135deg, #ff8a2a, #ff3b4f); -webkit-background-clip: text; background-clip: text; }
.hbar label { display: flex; justify-content: space-between; font-size: 8.5px; font-weight: 700; letter-spacing: .14em; color: var(--ink2); margin-bottom: 4px; }
.hbar em { font-style: normal; color: var(--ink); font-variant-numeric: tabular-nums; }
.hbar div { height: 6px; border-radius: 6px; background: rgba(22,34,74,.08); overflow: hidden; }
.hbar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, var(--acc2), var(--acc)); transition: width .5s; }
.hbar i.hot { background: linear-gradient(90deg, var(--amber), var(--red)); }

.metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 12px; }
.tile { position: relative; padding: 9px 11px 0; border-radius: 16px; background: #fff; overflow: hidden; box-shadow: 0 3px 10px rgba(30, 80, 170, .1), inset 0 -2px 0 rgba(22,34,74,.05); transition: all .3s; }
.tile:hover { transform: translateY(-1px); }
.tile.alarm { background: #fff1f3; box-shadow: 0 0 0 2px rgba(255, 77, 94, .45), 0 4px 12px rgba(255, 77, 94, .2); }
.tl { font-size: 8px; font-weight: 700; letter-spacing: .16em; color: var(--ink3); }
.tv { font: 800 20px/1.1 var(--f-display); letter-spacing: .03em; margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv u { text-decoration: none; font: 700 9px var(--f-mono); color: var(--ink3); margin-left: 3px; }
.spark { display: block; width: calc(100% + 22px); height: 22px; margin: 2px -11px 0; }

.fmode { position: relative; padding: 11px 13px; border-radius: 16px; overflow: hidden; color: #fff; background: linear-gradient(120deg, var(--acc2), var(--acc)); box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--acc) 70%, transparent); }
.fmode::after { content: ''; position: absolute; top: 0; bottom: 0; width: 40%; left: -40%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.3), transparent); animation: sweep 3.5s linear infinite; }
@keyframes sweep { to { left: 120%; } }
.fm-top { display: flex; align-items: center; gap: 8px; }
.fm-dot { width: 9px; height: 9px; border-radius: 3px; background: #fff; transform: rotate(45deg); animation: blink 1.4s infinite; }
.fm-top b { font: 800 20px/1 var(--f-display); letter-spacing: .05em; }
.fm-lvl { margin-left: auto; font-size: 8.5px; font-weight: 700; letter-spacing: .14em; padding: 3px 7px; border-radius: 10px; background: rgba(255,255,255,.25); }
.fm-desc { font-size: 9.5px; margin-top: 6px; letter-spacing: .02em; opacity: .92; }
.fm-events { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.fm-events span { font: 700 8.5px/1 var(--f-mono); letter-spacing: .06em; padding: 5px 8px; border-radius: 10px; color: #8a4b00; background: #fff4d6; }
.fm-events span.none { color: #fff; background: rgba(255,255,255,.22); }

/* token module */
.token {
  position: relative; margin-top: 12px; padding: 5px; border-radius: 24px; overflow: hidden;
  background: var(--candy); box-shadow: 0 14px 30px -12px rgba(120, 90, 255, .6), inset 0 2px 0 rgba(255,255,255,.45);
}
.token > * { position: relative; }
.token::before { content: ''; position: absolute; inset: 5px; border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.97), rgba(246,250,255,.95)); }
.token::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.35) 50%, transparent 60%); background-size: 250% 100%; animation: holo 5s linear infinite; pointer-events: none; }
@keyframes holo { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.tk-head { display: flex; justify-content: space-between; font-size: 8.5px; font-weight: 700; letter-spacing: .22em; color: var(--ink2); padding: 9px 10px 0; }
.official { color: #0f9a5a; }
.tk-top { display: flex; align-items: center; gap: 13px; margin: 8px 10px 10px; }
.orb { position: relative; width: 62px; height: 62px; flex: none; display: grid; place-items: center; }
.orb i { position: absolute; border-radius: 50%; }
.orb .o1 { inset: 0; background: conic-gradient(from 0deg, #b46cff, #36b9ff, #33e3a4, #a3de2a, #ffe45c, #ff6fb5, #b46cff); animation: spin 4s linear infinite; mask: radial-gradient(circle, transparent 58%, #000 60%); -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%); }
.orb .o2 { inset: 7px; border: 2px dashed rgba(155, 92, 255, .4); animation: spin 9s linear infinite reverse; }
.orb .o3 { inset: 13px; background: radial-gradient(circle at 35% 28%, #fff 0, #d9c2ff 18%, #9b5cff 55%, #5a2fd0); box-shadow: 0 6px 16px -2px rgba(120, 70, 255, .6), inset 0 -4px 8px rgba(40, 10, 120, .35); animation: corePulse 2.2s ease-in-out infinite; }
.orb .o4 { inset: -5px; border: 2px solid transparent; border-top-color: #36b9ff; border-right-color: #33e3a4; animation: spin 2.4s linear infinite; }
.orb b { position: relative; font: 900 24px/1 var(--f-display); color: #fff; text-shadow: 0 2px 0 rgba(60, 20, 160, .45); }
@keyframes corePulse { 50% { transform: scale(1.06); box-shadow: 0 8px 22px 0 rgba(120, 70, 255, .7), inset 0 -4px 8px rgba(40, 10, 120, .35); } }
.tk-name { font: 900 32px/.9 var(--f-display); letter-spacing: .03em; background: var(--candy-h); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tk-sub { font-size: 9px; font-weight: 700; letter-spacing: .2em; color: var(--ink2); margin: 5px 0 7px; }
.chain-badge { display: inline-flex; align-items: center; gap: 7px; font-size: 9px; font-weight: 700; letter-spacing: .18em; padding: 5px 10px; border-radius: 20px; color: #fff; background: var(--ink); }
.sol { width: 13px; height: 10px; display: block; }
.ca-box { position: relative; margin: 0 10px; padding: 9px 11px; border-radius: 14px; background: #eef4ff; cursor: pointer; transition: all .2s; box-shadow: inset 0 0 0 1.5px rgba(61, 139, 255, .2); }
.ca-box:hover { box-shadow: inset 0 0 0 1.5px rgba(155, 92, 255, .6); }
.ca-label { font-size: 8px; font-weight: 700; letter-spacing: .22em; color: var(--ink3); }
.ca { font-size: 11px; font-weight: 500; line-height: 1.4; letter-spacing: .01em; color: var(--ink); word-break: break-all; margin: 5px 66px 0 0; user-select: all; -webkit-user-select: all; }
.ca-copy { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 5px; font-size: 9px; font-weight: 700; letter-spacing: .12em; padding: 8px 10px; border-radius: 11px; color: #fff; background: linear-gradient(135deg, var(--purple), var(--blue)); box-shadow: 0 4px 10px -3px rgba(100, 90, 255, .7); transition: all .2s; }
.ca-copy .ico { width: 12px; height: 12px; }
.ca-copy:hover { transform: translateY(-50%) scale(1.05); }
.ca-box.copied { animation: copied .9s ease; }
.ca-box.copied .ca-copy { background: linear-gradient(135deg, #2fd67a, #33e3a4); }
@keyframes copied { 0% { box-shadow: inset 0 0 0 2px #2fd67a, 0 0 0 0 rgba(47, 214, 122, .7); } 100% { box-shadow: inset 0 0 0 2px transparent, 0 0 0 16px rgba(47, 214, 122, 0); } }
.tk-core { margin: 9px 10px; }
.tkc-l { display: flex; justify-content: space-between; font-size: 8.5px; font-weight: 700; letter-spacing: .18em; color: var(--ink2); }
.tkc-l b { color: var(--ink); }
.tkc-bar { height: 7px; border-radius: 7px; margin: 5px 0 4px; background: rgba(22,34,74,.08); overflow: hidden; }
.tkc-bar i { display: block; height: 100%; width: 0; border-radius: 7px; background: linear-gradient(90deg, #b46cff, #36b9ff, #33e3a4, #b46cff); background-size: 200% 100%; animation: flowBar 2s linear infinite; transition: width .5s; }
@keyframes flowBar { to { background-position: -200% 0; } }
.tkc-note { font-size: 7.5px; font-weight: 700; letter-spacing: .18em; color: var(--ink3); }
.tk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 0 10px 10px; }
.tk-buy { position: relative; overflow: hidden; grid-column: span 2; text-align: center; padding: 12px; font: 800 13px/1 var(--f-ui); letter-spacing: .14em; color: #fff; border-radius: 14px; background: var(--candy); box-shadow: 0 8px 18px -6px rgba(120, 90, 255, .7), inset 0 2px 0 rgba(255,255,255,.4); text-shadow: 0 1px 2px rgba(40, 20, 120, .35); transition: transform .2s; }
.tk-buy:hover { transform: translateY(-1px); }
.tk-sec { text-align: center; padding: 9px 4px; font-size: 9px; font-weight: 700; letter-spacing: .12em; color: var(--ink2); border-radius: 12px; background: #fff; box-shadow: 0 2px 6px rgba(30, 80, 170, .12), inset 0 -2px 0 rgba(22,34,74,.06); transition: all .2s; }
.tk-sec:hover { color: var(--purple); transform: translateY(-1px); }

/* ---------- dock ---------- */
.dock { grid-area: dock; display: grid; gap: 8px var(--gap); grid-template-columns: minmax(0, 1fr) minmax(470px, 590px) minmax(0, 1fr); grid-template-rows: 24px minmax(0, 1fr); pointer-events: none; }
.timeline { grid-column: 1 / -1; pointer-events: auto; position: relative; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 14px; background: rgba(255,255,255,.85); box-shadow: 0 3px 10px rgba(30, 80, 170, .14); }
.tl-k, .tl-now { font-size: 8.5px; font-weight: 700; letter-spacing: .18em; color: var(--ink2); white-space: nowrap; }
.tl-now { color: #fff; background: var(--acc); padding: 3px 7px; border-radius: 8px; }
#timeline { flex: 1; height: 100%; min-width: 0; display: block; }
.dh { display: flex; align-items: center; gap: 10px; padding: 10px 14px 8px; border-bottom: 1px solid var(--line); flex: none; }
.dh-t { display: flex; align-items: center; gap: 7px; font-size: 9.5px; font-weight: 700; letter-spacing: .2em; color: var(--ink); white-space: nowrap; }
.dh-c { margin-left: auto; font-size: 9px; font-weight: 700; letter-spacing: .12em; color: var(--ink3); font-variant-numeric: tabular-nums; }
.dh-slogan { margin-left: auto; font: 800 16px/1 var(--f-display); letter-spacing: .1em; background: linear-gradient(135deg, var(--acc2), var(--acc)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(47, 214, 122, .25); animation: blink 1.2s infinite; }
.live-dot.hot { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 77, 94, .25); }
.lf { display: flex; gap: 3px; margin-left: 6px; }
.lf button { font-size: 8.5px; font-weight: 700; letter-spacing: .08em; padding: 4px 8px; border-radius: 8px; color: var(--ink3); }
.lf button:hover { color: var(--ink); }
.lf button.on { color: #fff; background: var(--acc); }

.log { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 0; font-size: 10.5px; line-height: 1.6; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; mask-image: linear-gradient(to bottom, transparent, #000 18px); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18px); }
.ln { display: grid; grid-template-columns: 78px 42px 1fr; gap: 8px; padding: 0 14px; cursor: pointer; white-space: nowrap; animation: lnIn .4s ease; }
.ln:hover { background: rgba(61, 139, 255, .07); }
.ln .lt { color: var(--ink3); font-variant-numeric: tabular-nums; }
.ln .lv { font-weight: 800; font-size: 9px; letter-spacing: .06em; }
.ln .lm { overflow: hidden; text-overflow: ellipsis; color: var(--ink2); }
.ln.INFO .lv, .ln.TRACE .lv { color: var(--ink3); }
.ln.TRACE .lm { color: var(--ink3); }
.ln.WARN .lv { color: #d98600; } .ln.WARN .lm { color: #9a5c00; }
.ln.CRIT .lv { color: #e0283c; } .ln.CRIT .lm { color: #b0172b; font-weight: 500; }
.ln.CRIT { background: linear-gradient(90deg, rgba(255, 77, 94, .12), transparent 60%); }
.ln.RCVR .lv { color: #12a85a; } .ln.RCVR .lm { color: #0b7a41; }
.ln.ROUTE .lv { color: #2b7de0; } .ln.ROUTE .lm { color: #1d5fb0; }
.ln.CMD .lv { color: #8a45ee; } .ln.CMD .lm { color: var(--ink); font-weight: 600; }
.ln.CMD { background: linear-gradient(90deg, rgba(155, 92, 255, .12), transparent 60%); }
.ln.SYS .lv { color: var(--acc-d); } .ln.SYS .lm { color: var(--ink); }
@keyframes lnIn { from { opacity: 0; transform: translateX(-8px); background: color-mix(in srgb, var(--acc) 16%, transparent); } }
.log[data-f="crit"] .ln:not(.CRIT):not(.CMD) { display: none; }
.log[data-f="route"] .ln:not(.ROUTE) { display: none; }
.log[data-f="rcvr"] .ln:not(.RCVR) { display: none; }

.d-deck .deck { flex: 1; min-height: 0; display: grid; grid-template-columns: 150px 1fr; gap: 8px; padding: 9px; }
.break-btn {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: 20px;
  background: radial-gradient(circle at 50% 22%, #ff9a8f, #ff4d5e 55%, #e02447);
  box-shadow: 0 12px 26px -8px rgba(255, 59, 79, .8), inset 0 3px 0 rgba(255,255,255,.45), inset 0 -6px 0 rgba(140, 0, 30, .25); transition: transform .12s, filter .2s;
}
.bb-haz { position: absolute; left: 10%; right: 10%; top: 6px; height: 18px; border-radius: 12px; background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0)); }
.break-btn::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 7px; background: repeating-linear-gradient(-45deg, rgba(255, 228, 92, .95) 0 7px, rgba(22,34,74,.85) 7px 14px); animation: haz 1s linear infinite; }
@keyframes haz { to { background-position: 20px 0; } }
.bb-t { position: relative; font: 900 36px/.9 var(--f-display); letter-spacing: .05em; color: #fff; text-shadow: 0 3px 0 rgba(140, 0, 30, .45); }
.bb-s { position: relative; font-size: 8px; font-weight: 700; letter-spacing: .18em; color: #fff; opacity: .9; }
.bb-ring { position: absolute; left: 50%; top: 50%; width: 60px; height: 60px; margin: -30px; border: 2px solid rgba(255,255,255,.8); border-radius: 50%; animation: bbRing 1.6s ease-out infinite; }
@keyframes bbRing { from { transform: scale(.6); opacity: 1; } to { transform: scale(3.4); opacity: 0; } }
.break-btn:hover { filter: brightness(1.08) saturate(1.1); transform: translateY(-2px); }
.break-btn:active, .break-btn.fire { transform: scale(.96); }
.break-btn.fire { animation: fire .5s ease; }
@keyframes fire { 0% { filter: brightness(1.8); } 100% { filter: none; } }
.cmds { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: minmax(0, 1fr); gap: 6px; min-height: 0; }
.cmd {
  --c: var(--acc); position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px; padding: 0 9px; min-height: 0; border-radius: 14px;
  background: #fff; box-shadow: 0 3px 8px rgba(30, 80, 170, .12), inset 0 -3px 0 color-mix(in srgb, var(--c) 30%, transparent); text-align: left; transition: all .2s;
}
.cmd .ico { color: #fff; width: 26px; height: 26px; padding: 5px; border-radius: 9px; background: var(--c); box-shadow: 0 3px 8px -2px var(--c); transition: transform .3s; flex: none; }
.cmd .ct { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cmd .ct b { font: 800 10.5px/1 var(--f-ui); letter-spacing: .07em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd .ct small { font: 700 7.5px/1 var(--f-mono); letter-spacing: .12em; color: var(--ink3); white-space: nowrap; }
.cmd kbd { margin-left: auto; font-size: 8px; padding: 2px 5px; }
.cmd:hover { transform: translateY(-2px); box-shadow: 0 8px 16px -6px color-mix(in srgb, var(--c) 70%, transparent), inset 0 -3px 0 color-mix(in srgb, var(--c) 45%, transparent); }
.cmd:hover .ico { transform: scale(1.1) rotate(-8deg); }
.cmd.fire { animation: cmdFire .6s ease; }
@keyframes cmdFire { 0% { background: color-mix(in srgb, var(--c) 45%, #fff); transform: scale(.96); } 100% { background: #fff; } }

.d-chart .chart-wrap { position: relative; flex: 1; min-height: 0; }
#chart { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ch-leg { display: flex; gap: 10px; font-size: 8px; font-weight: 700; letter-spacing: .12em; color: var(--ink2); }
.ch-leg i { display: inline-block; width: 10px; height: 4px; border-radius: 3px; margin-right: 4px; background: var(--c); vertical-align: 1px; }
.ch-read { position: absolute; right: 12px; top: 6px; display: flex; gap: 10px; font-size: 8.5px; font-weight: 700; letter-spacing: .1em; color: var(--ink3); }
.ch-read b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; visibility: hidden; pointer-events: none; }
.modal.open { visibility: visible; pointer-events: auto; }
.m-back { position: absolute; inset: 0; background: rgba(40, 90, 190, .3); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .3s; }
.modal.open .m-back { opacity: 1; }
.m-card {
  position: relative; width: min(780px, 100%); max-height: min(86vh, 760px); display: flex; flex-direction: column; border-radius: 30px; overflow: hidden;
  background: linear-gradient(180deg, #ffffff, #f3f8ff); box-shadow: 0 40px 90px -20px rgba(20, 60, 160, .55), 0 0 0 6px rgba(255,255,255,.55);
  transform: translateY(18px) scale(.97); opacity: 0; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s;
}
.modal.open .m-card { transform: none; opacity: 1; }
.m-card::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 6px; background: var(--candy-h); }
.m-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 22px 22px 14px; border-bottom: 1px solid var(--line); }
.m-k { font-size: 9px; font-weight: 700; letter-spacing: .28em; color: var(--acc-d); }
.m-t { font: 900 36px/1 var(--f-display); letter-spacing: .03em; margin-top: 4px; }
.m-x { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; color: var(--ink2); background: rgba(22,34,74,.06); }
.m-x:hover { color: var(--ink); background: rgba(22,34,74,.1); }
.m-body { padding: 16px 22px 22px; overflow-y: auto; scrollbar-width: thin; }
.m-body p { color: var(--ink2); line-height: 1.6; font-size: 12.5px; }
.m-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.m-card-i { position: relative; padding: 16px 14px 14px 18px; border-radius: 18px; background: #fff; text-align: left; transition: all .25s; overflow: hidden; --c: var(--acc); box-shadow: 0 4px 12px rgba(30, 80, 170, .12), inset 0 -3px 0 rgba(22,34,74,.05); }
.m-card-i:hover { transform: translateY(-3px); box-shadow: 0 12px 24px -8px color-mix(in srgb, var(--c) 60%, transparent); }
.m-card-i.on { box-shadow: 0 0 0 3px var(--c), 0 10px 24px -8px color-mix(in srgb, var(--c) 60%, transparent); }
.m-card-i b { display: block; font: 800 20px/1 var(--f-display); letter-spacing: .04em; color: var(--ink); }
.m-card-i small { display: block; font: 500 10px/1.5 var(--f-mono); color: var(--ink2); margin-top: 6px; }
.m-card-i i { position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--c); }
.m-card-i .mc-stats { display: flex; gap: 10px; margin-top: 10px; font: 700 9px/1 var(--f-mono); letter-spacing: .08em; color: color-mix(in srgb, var(--c) 70%, #0d1a44); }
.m-sec { font: 700 10px/1 var(--f-mono); letter-spacing: .22em; color: var(--acc-d); margin: 18px 0 10px; display: flex; gap: 8px; align-items: center; }
.m-sec::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.m-table { width: 100%; border-collapse: collapse; font: 500 10.5px/1.3 var(--f-mono); }
.m-table th { text-align: left; font-weight: 700; font-size: 8.5px; letter-spacing: .16em; color: var(--ink3); padding: 6px 8px; border-bottom: 1px solid var(--line); }
.m-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); color: var(--ink); font-variant-numeric: tabular-nums; }
.m-table td.ok { color: #12a85a; font-weight: 700; } .m-table td.warn { color: #d98600; font-weight: 700; } .m-table td.bad { color: #e0283c; font-weight: 700; }
.m-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.m-stat { padding: 11px 12px; border-radius: 16px; background: #fff; box-shadow: 0 3px 10px rgba(30, 80, 170, .1); }
.m-stat small { display: block; font: 700 8.5px/1 var(--f-mono); letter-spacing: .16em; color: var(--ink3); }
.m-stat b { display: block; font: 800 24px/1.1 var(--f-display); margin-top: 5px; font-variant-numeric: tabular-nums; }
.m-chart { width: 100%; height: 210px; display: block; border-radius: 16px; background: #fff; box-shadow: 0 3px 10px rgba(30, 80, 170, .1); }
.m-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.m-btn { font: 800 10.5px/1 var(--f-ui); letter-spacing: .14em; padding: 12px 16px; border-radius: 14px; color: var(--ink); background: #fff; box-shadow: 0 3px 8px rgba(30, 80, 170, .14), inset 0 -3px 0 rgba(22,34,74,.07); transition: all .2s; --c: var(--acc); }
.m-btn:hover { transform: translateY(-2px); color: color-mix(in srgb, var(--c) 75%, #0d1a44); }
.m-btn.primary { color: #fff; background: var(--c); box-shadow: 0 8px 18px -6px var(--c), inset 0 2px 0 rgba(255,255,255,.35); }
.m-btn.primary:hover { color: #fff; }
.m-pre { font: 400 11px/1.55 var(--f-mono); color: #1d3a7a; background: #eef4ff; border-radius: 14px; padding: 14px; white-space: pre-wrap; word-break: break-all; user-select: text; -webkit-user-select: text; }
.docs h4 { font: 800 19px/1 var(--f-display); letter-spacing: .06em; margin: 18px 0 8px; color: var(--ink); }
.docs h4:first-child { margin-top: 0; }
.docs ul { list-style: none; display: grid; gap: 6px; }
.docs li { font: 400 11.5px/1.5 var(--f-mono); color: var(--ink2); padding-left: 18px; position: relative; }
.docs li::before { content: ''; position: absolute; left: 2px; top: 6px; width: 7px; height: 7px; border-radius: 3px; background: linear-gradient(135deg, var(--acc2), var(--acc)); }
.docs li b { color: var(--ink); font-weight: 700; }
.fine { font: 400 10px/1.5 var(--f-mono) !important; color: var(--ink3) !important; margin-top: 14px; letter-spacing: .02em; }

.tk-hero { display: grid; grid-template-columns: 180px 1fr; gap: 24px; align-items: center; }
.orb.big { width: 170px; height: 170px; }
.orb.big .o3 { inset: 34px; }
.orb.big .o2 { inset: 17px; }
.orb.big b { font-size: 50px; }
.tk-hero .tk-name { font-size: 66px; }
.tk-lines { display: grid; gap: 4px; margin: 10px 0 14px; }
.tk-lines div { font: 800 17px/1.15 var(--f-display); letter-spacing: .08em; color: var(--ink2); }
.tk-lines div b { color: var(--ink); }
.tk-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.modal .ca-box { margin: 0; }

.wallet-list { display: grid; gap: 10px; }
.wallet-opt { display: grid; grid-template-columns: 42px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 18px; background: #fff; box-shadow: 0 3px 10px rgba(30, 80, 170, .12); transition: all .2s; text-align: left; }
.wallet-opt:hover { transform: translateX(3px); box-shadow: 0 8px 18px -6px rgba(61, 139, 255, .45); }
.wicon { width: 42px; height: 42px; display: grid; place-items: center; font: 900 20px/1 var(--f-display); color: #fff; border-radius: 13px; background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: inset 0 2px 0 rgba(255,255,255,.35); }
.wname { font: 800 15px/1 var(--f-ui); letter-spacing: .06em; }
.wname small { display: block; font: 400 9.5px/1 var(--f-mono); color: var(--ink3); margin-top: 5px; letter-spacing: .08em; }
.wstate { font: 700 9px/1 var(--f-mono); letter-spacing: .14em; padding: 6px 9px; border-radius: 10px; color: var(--ink2); background: rgba(22,34,74,.06); }
.wstate.det { color: #fff; background: var(--green); }
.wallet-status { margin-top: 12px; min-height: 44px; padding: 12px 14px; border-radius: 14px; background: #eef4ff; font: 500 11px/1.5 var(--f-mono); color: var(--ink2); display: flex; gap: 10px; align-items: center; }
.wallet-status.loading { background: #fff4d6; color: #9a5c00; }
.wallet-status.error { background: #fff1f3; color: #c0182c; }
.wallet-status.ok { background: #e3faee; color: #0b7a41; }
.wallet-status a { color: var(--purple); text-decoration: underline; font-weight: 700; }
.spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: none; }

/* ---------- tooltip / toast ---------- */
.tip { position: fixed; z-index: 90; pointer-events: none; padding: 10px 12px; border-radius: 14px; background: #fff; box-shadow: 0 10px 26px -8px rgba(20, 60, 160, .45); font-size: 10px; line-height: 1.5; letter-spacing: .04em; opacity: 0; transition: opacity .15s; min-width: 170px; color: var(--ink); }
.tip.show { opacity: 1; }
.tip b { display: block; font: 800 13px/1.3 var(--f-ui); letter-spacing: .06em; }
.tip .tr { display: flex; justify-content: space-between; gap: 14px; color: var(--ink3); }
.tip .tr span:last-child { color: var(--ink); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: 240px; z-index: 110; transform: translate(-50%, 16px); opacity: 0; pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .18em; color: var(--ink); background: #fff; box-shadow: 0 14px 32px -10px rgba(47, 214, 122, .7), 0 0 0 3px rgba(47, 214, 122, .4); transition: all .35s cubic-bezier(.2, .8, .2, 1); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { box-shadow: 0 14px 32px -10px rgba(255, 77, 94, .6), 0 0 0 3px rgba(255, 77, 94, .4); }
.toast i { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.toast.err i { background: var(--red); }
.copy-pulse { position: fixed; z-index: 120; pointer-events: none; width: 10px; height: 10px; margin: -5px 0 0 -5px; }
.copy-pulse i { position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--mint); animation: cp .9s cubic-bezier(.2, .8, .2, 1) forwards; }
.copy-pulse i:nth-child(2) { border-color: var(--sky); animation-delay: .1s; }
.copy-pulse i:nth-child(3) { border-color: var(--purple); animation-delay: .2s; }
@keyframes cp { from { transform: scale(1); opacity: 1; } to { transform: scale(14); opacity: 0; } }

/* ---------- responsive ---------- */
.mbar, .fab-break, .scrim { display: none; }

@media (max-width: 1720px) { .hud-hint { display: none; } }
@media (max-width: 1380px) {
  #app { grid-template-columns: 268px minmax(0, 1fr) 306px; }
  .nav button { padding: 10px 8px; letter-spacing: .1em; }
  .tb-stat:nth-of-type(2) { display: none; }
}
@media (max-width: 1180px) {
  .brand-sub, .tb-stat { display: none; }
  .dock { grid-template-columns: minmax(0, 1fr) minmax(430px, 520px) minmax(0, .8fr); }
  .d-deck .deck { grid-template-columns: 124px 1fr; }
  .bb-t { font-size: 30px; }
  .cmd .ct small { display: none; }
}
@media (max-height: 820px) and (min-width: 981px) {
  #app { grid-template-rows: 56px minmax(0, 1fr) 190px; }
  .hero-title { font-size: clamp(36px, 4vw, 70px); }
  .radar-wrap { width: 108px; height: 108px; }
}

@media (max-width: 980px) {
  :root { --gap: 8px; --r: 18px; }
  #app { grid-template-columns: 1fr; grid-template-rows: 54px minmax(0, 1fr) 66px; grid-template-areas: "top" "stage" "dock"; padding-bottom: calc(var(--gap) + 60px + env(safe-area-inset-bottom)); }
  .topbar { gap: 8px; padding: 0 8px; border-radius: 18px; }
  .brand-word { font-size: 26px; }
  .brand-mark { width: 30px; height: 30px; padding: 4px; border-radius: 10px; }
  .nav, .status-cluster .tb-stat, #audioBtn { display: none; }
  .status-cluster { margin-left: auto; }
  .state-pill { padding: 6px 9px; font-size: 8.5px; }
  .state-pill span { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
  .btn-wallet { height: 34px; padding: 0 10px; font-size: 0; gap: 0; }
  .btn-wallet .wdot { width: 9px; height: 9px; }
  .btn-wallet::after { content: ''; width: 16px; height: 16px; margin-left: 6px; background: currentColor; mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='3' y='6' width='18' height='14' rx='2'/><path d='M3 10h18M16 15h2'/></svg>") center/contain no-repeat; -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'><rect x='3' y='6' width='18' height='14' rx='2'/><path d='M3 10h18M16 15h2'/></svg>") center/contain no-repeat; }
  .btn-buy { height: 36px; padding: 0 12px; border-radius: 13px; }
  .btn-buy .buy-t { font-size: 11px; }
  .btn-buy .buy-s { display: none; }
  .m-only { display: grid; }

  .p-left, .p-right {
    position: fixed; top: 0; bottom: 0; z-index: 60; width: min(340px, 88vw);
    transition: transform .45s cubic-bezier(.2, .8, .2, 1) !important; opacity: 1 !important;
  }
  .p-left, .p-right, .d-log { background: linear-gradient(180deg, #ffffff, #f2f7ff); }
  body.show-left #app, body.show-right #app, body.show-log #app { z-index: 56; }
  .p-left { left: 0; transform: translateX(-105%) !important; border-radius: 0 24px 24px 0; }
  .p-right { right: 0; transform: translateX(105%) !important; border-radius: 24px 0 0 24px; }
  body.show-left .p-left, body.show-right .p-right { transform: none !important; }
  .pbody { padding-bottom: 80px; }

  .dock { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
  .timeline, .d-chart { display: none; }
  .d-log { position: fixed; left: 0; right: 0; bottom: calc(66px + env(safe-area-inset-bottom)); height: 46vh; z-index: 55; border-radius: 24px 24px 0 0; transform: translateY(120%) !important; transition: transform .45s cubic-bezier(.2, .8, .2, 1) !important; opacity: 1 !important; }
  body.show-log .d-log { transform: none !important; }
  .d-deck { background: rgba(255,255,255,.72); }
  .d-deck::before { display: none; }
  .d-deck .dh { display: none; }
  .d-deck .deck { display: block; padding: 7px; overflow-x: auto; scrollbar-width: none; }
  .d-deck .deck::-webkit-scrollbar { display: none; }
  .d-deck .break-btn { display: none; }
  .cmds { display: flex; gap: 7px; height: 100%; }
  .cmd { flex: none; padding: 0 12px 0 8px; }
  .cmd .ct small, .cmd kbd { display: none; }

  .hud-hero { left: 12px; top: 10px; max-width: calc(100% - 24px); }
  .hero-title { font-size: clamp(34px, 11vw, 56px); white-space: normal; }
  .kicker { font-size: 8px; letter-spacing: .12em; }
  .hero-sub { font-size: 8.5px; letter-spacing: .1em; }
  .hero-sub span:not(.state-line) { display: none; }
  .hud-right { top: auto; bottom: 44px; left: 10px; right: auto; width: 200px; align-items: flex-start; }
  .radar-wrap { display: none; }
  .alerts .al:nth-child(n+3) { display: none; }
  .hud-bl { display: none; }
  .demo-tag { left: 12px; right: auto; bottom: 10px; font-size: 7.5px; }
  .node-drawer { right: 8px; left: 8px; width: auto; bottom: auto; top: 118px; }
  .toast { bottom: 150px; }

  .mbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 8px; right: 8px; bottom: calc(6px + env(safe-area-inset-bottom)); z-index: 70;
    height: 56px; border-radius: 20px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .mbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: 700 8.5px/1 var(--f-mono); letter-spacing: .12em; color: var(--ink2); border-radius: 16px; margin: 4px; }
  .mbar button.on { color: #fff; background: linear-gradient(135deg, var(--acc2), var(--acc)); }
  .mbar .mi .ico { width: 18px; height: 18px; }
  .fab-break {
    display: grid; place-items: center; position: fixed; right: 14px; bottom: calc(62px + 66px + 26px + env(safe-area-inset-bottom)); z-index: 50;
    width: 80px; height: 80px; border-radius: 50%; font: 900 18px/.9 var(--f-display); letter-spacing: .05em; color: #fff; text-align: center;
    background: radial-gradient(circle at 50% 25%, #ff9a8f, #ff4d5e 55%, #e02447); text-shadow: 0 2px 0 rgba(140, 0, 30, .4);
    box-shadow: 0 0 0 5px #fff, 0 12px 30px -6px rgba(255, 59, 79, .8), inset 0 3px 0 rgba(255,255,255,.4);
  }
  .fab-break::after { content: ''; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid rgba(255, 77, 94, .7); animation: bbRing 1.6s ease-out infinite; }
  .fab-break:active { transform: scale(.94); }
  .scrim { display: block; position: fixed; inset: 0; z-index: 54; background: rgba(30, 70, 160, .3); opacity: 0; pointer-events: none; transition: opacity .3s; }
  body.show-left .scrim, body.show-right .scrim, body.show-log .scrim { opacity: 1; pointer-events: auto; }
  body:not(.live) .mbar, body:not(.live) .fab-break { opacity: 0; }
  .mbar, .fab-break { transition: opacity .8s .5s; }

  .m-grid, .m-stats, .tk-facts { grid-template-columns: 1fr 1fr; }
  .tk-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .tk-hero .tk-name { font-size: 50px; }
  .m-t { font-size: 28px; }
  .modal { padding: 10px; }
}
@media (max-width: 520px) {
  .x-btn { display: none; }
  .state-pill span { display: none; }
  .state-pill { padding: 8px; }
  .brand-word { font-size: 23px; }
  .topbar { gap: 6px; }
  .btn-buy { padding: 0 10px; }
  .hero-title { font-size: clamp(30px, 10.5vw, 44px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
  .fx-scan::after { display: none; }
}
