:root {
  color-scheme: dark;
  --bg: #0d1116;
  --panel: #151b22;
  --panel-2: #101821;
  --line: #273241;
  --text: #eef3f8;
  --muted: #91a0af;
  --green: #34d399;
  --red: #fb7185;
  --amber: #f6c65b;
  --cyan: #38bdf8;
  --violet: #a78bfa;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.32);
  --glow: 0 0 28px rgba(56, 189, 248, 0.2);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 18% 2%, rgba(56, 189, 248, 0.16), transparent 34rem),
    radial-gradient(circle at 78% 0%, rgba(167, 139, 250, 0.12), transparent 30rem),
    radial-gradient(circle at 50% 120%, rgba(52, 211, 153, 0.08), transparent 36rem),
    linear-gradient(145deg, #05070b 0%, #0f1721 48%, #070a0f 100%);
  color: var(--text);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.35) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(56, 189, 248, 0.18) 0 1px, transparent 2px),
    linear-gradient(rgba(56, 189, 248, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.025) 1px, transparent 1px);
  background-size:
    92px 92px,
    170px 170px,
    48px 48px,
    48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.22));
  animation: deepStarDrift 70s linear infinite;
  content: "";
}

body::after {
  position: fixed;
  inset: -12%;
  z-index: -1;
  background-image:
    radial-gradient(circle, rgba(56, 189, 248, 0.34) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(52, 211, 153, 0.22) 0 1px, transparent 2px),
    linear-gradient(115deg, transparent 0 38%, rgba(56, 189, 248, 0.07) 44%, transparent 52%);
  background-position:
    0 0,
    34px 58px,
    0 0;
  background-size:
    150px 150px,
    210px 210px,
    360px 360px;
  opacity: 0.38;
  animation: cosmicDrift 28s linear infinite;
  pointer-events: none;
  content: "";
}

html::before,
html::after {
  position: fixed;
  inset: -18%;
  z-index: -2;
  content: "";
  pointer-events: none;
}

html::before {
  background:
    radial-gradient(ellipse at 18% 26%, rgba(56, 189, 248, 0.08), transparent 34rem),
    radial-gradient(ellipse at 80% 64%, rgba(52, 211, 153, 0.065), transparent 38rem),
    linear-gradient(115deg, transparent 28%, rgba(167, 139, 250, 0.04) 48%, transparent 68%);
  filter: blur(6px);
  animation: spaceMist 88s ease-in-out infinite alternate;
}

html::after {
  background-image:
    linear-gradient(118deg, transparent 0 44%, rgba(56, 189, 248, 0.045) 48%, transparent 52%),
    linear-gradient(32deg, transparent 0 46%, rgba(52, 211, 153, 0.035) 50%, transparent 54%);
  background-size:
    520px 520px,
    680px 680px;
  opacity: 0.52;
  animation: farNeuralFlow 110s linear infinite;
}

body.market-disturbed::after {
  opacity: 0.48;
  animation-duration: 18s;
}

body[data-mood="calm"]::after {
  opacity: 0.3;
}

body[data-mood="eth"]::after {
  filter: hue-rotate(28deg) saturate(1.08);
}

body[data-mood="vacuum"]::after {
  opacity: 0.22;
  filter: brightness(0.72) saturate(0.85);
}

body[data-mood="compressed"]::after,
body[data-mood="volatile"]::after {
  opacity: 0.52;
}

body.market-disturbed .shell {
  animation: viewportBreath 11s ease-in-out infinite;
}

button,
input,
select {
  font: inherit;
}

.shell {
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 32px;
  transform-origin: 50% 12%;
}

.quote-card,
.pulse-panel,
.inference-panel,
.state-machine-panel,
.flow-panel,
.dominance-panel,
.lifecycle-panel,
.competition-panel,
.state-flow-panel,
.memory-panel,
.cosmic-core,
.signal-panel,
.tool-panel,
.chart-panel,
.report-panel,
.multi-panel {
  border-color: rgba(148, 163, 184, 0.075) !important;
  background:
    radial-gradient(circle at 18% 0%, rgba(56, 189, 248, 0.065), transparent 16rem),
    linear-gradient(180deg, rgba(13, 20, 29, 0.5), rgba(6, 10, 16, 0.34)) !important;
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.026) !important;
  backdrop-filter: blur(18px);
}

.quote-card,
.pulse-panel,
.inference-panel,
.state-machine-panel,
.dominance-panel,
.lifecycle-panel,
.competition-panel,
.memory-panel,
.flow-panel,
.cosmic-core,
.signal-panel,
.tool-panel,
.chart-panel,
.report-panel,
.multi-panel {
  border-radius: 18px;
}

.probability-card,
.transition-card,
.dominance-card,
.life-grid div,
.causal-grid > div,
.war-side > div,
.history-grid > div,
.memory-card,
.consciousness-card,
.memory-timeline-wrap,
.flow-whisper,
.flow-system-grid > div,
.flow-metric,
.core-explainer > div,
.speed-grid div,
.oi-card,
.liquidity-row,
.alert-item,
.event-feed li {
  border-color: rgba(148, 163, 184, 0.075) !important;
  background: rgba(4, 8, 13, 0.22) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.018);
}

.panel-label,
.muted,
.competition-line span,
.memory-card span,
.flow-system-grid span,
.war-side span,
.history-grid span {
  opacity: 0.72;
}

.signal-copy,
.inference-observation,
.memory-card p,
.consciousness-card p,
.war-side p,
#timeFlow {
  color: rgba(219, 234, 254, 0.78);
}

.topbar,
.market-grid,
.cosmic-grid,
.workspace,
.panel-head,
.quote-head,
.quote-meta,
.range-row,
.pulse-stats,
.status-cluster {
  display: flex;
}

.topbar {
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.eyebrow,
.panel-label {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(1.7rem, 3vw, 3.4rem);
  line-height: 1.02;
}

h2 {
  font-size: 1.08rem;
}

.muted {
  color: var(--muted);
  font-size: 0.92rem;
}

.status-cluster {
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.status-pill {
  min-width: 96px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(52, 211, 153, 0.1);
  color: #bbf7d0;
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
}

.status-pill.warn {
  border-color: rgba(246, 198, 91, 0.4);
  background: rgba(246, 198, 91, 0.12);
  color: #fde68a;
}

.status-pill.backup {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.12);
  color: #bae6fd;
}

.status-pill.offline {
  border-color: rgba(251, 113, 133, 0.45);
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
}

.perf-toggle {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 8px 12px;
  color: #cbd5e1;
  background: rgba(4, 8, 13, 0.42);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
}

.perf-status {
  position: fixed;
  right: 14px;
  bottom: 12px;
  z-index: 20;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  padding: 7px 10px;
  color: rgba(203, 213, 225, 0.78);
  background: rgba(4, 8, 13, 0.68);
  backdrop-filter: blur(10px);
  font-size: 0.76rem;
  pointer-events: none;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr)) minmax(280px, 0.85fr);
  gap: 14px;
  margin-bottom: 14px;
}

.cosmic-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1.18fr) minmax(260px, 0.9fr) minmax(260px, 0.9fr);
  gap: 14px;
  margin-bottom: 14px;
}

.quote-card,
.pulse-panel,
.inference-panel,
.state-machine-panel,
.flow-panel,
.report-panel,
.cosmic-core,
.signal-panel,
.chart-panel,
.tool-panel {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(21, 31, 42, 0.92), rgba(12, 17, 24, 0.92)),
    rgba(21, 27, 34, 0.88);
  box-shadow: var(--shadow);
}

.report-panel {
  margin-bottom: 14px;
  padding: 16px 18px;
  border-color: rgba(56, 189, 248, 0.22);
}

.multi-panel {
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(21, 31, 42, 0.92), rgba(12, 17, 24, 0.92)),
    rgba(21, 27, 34, 0.88);
  box-shadow: var(--shadow);
}

.multi-matrix {
  display: grid;
  gap: 9px;
}

.multi-row {
  display: grid;
  grid-template-columns: 54px repeat(5, minmax(72px, 1fr)) minmax(130px, 0.8fr);
  align-items: center;
  gap: 8px;
}

.multi-row > strong {
  color: #e0f2fe;
  font-size: 0.92rem;
}

.tf-node {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  background: rgba(4, 8, 13, 0.42);
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 900;
  text-align: center;
}

.tf-bull {
  border-color: rgba(52, 211, 153, 0.36);
  color: #bbf7d0;
}

.tf-bull-strong {
  border-color: rgba(52, 211, 153, 0.68);
  color: #ecfdf5;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.16);
}

.tf-bear {
  border-color: rgba(251, 113, 133, 0.36);
  color: #fecdd3;
}

.tf-bear-strong {
  border-color: rgba(251, 113, 133, 0.68);
  color: #fff1f2;
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.16);
}

.tf-neutral {
  border-color: rgba(246, 198, 91, 0.32);
  color: #fde68a;
}

.resonance-cell {
  min-width: 0;
}

.resonance-cell em {
  display: block;
  margin-bottom: 5px;
  color: #dbeafe;
  font-style: normal;
  font-weight: 900;
}

.resonance-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 49, 61, 0.86);
}

.resonance-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  transition: width 280ms ease, margin-left 280ms ease;
}

.resonance-track i.bearish {
  background: linear-gradient(90deg, var(--red), var(--amber));
}

.report-panel p {
  margin: 0;
  color: #dbeafe;
  line-height: 1.55;
}

.flow-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.28fr);
  align-items: center;
  gap: 18px;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 18px;
  border-color: rgba(56, 189, 248, 0.24);
}

.dominance-panel {
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(21, 31, 42, 0.92), rgba(12, 17, 24, 0.92)),
    rgba(21, 27, 34, 0.88);
  box-shadow: var(--shadow);
}

.lifecycle-panel {
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(21, 31, 42, 0.92), rgba(12, 17, 24, 0.92)),
    rgba(21, 27, 34, 0.88);
  box-shadow: var(--shadow);
}

.competition-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 22% 18%, rgba(56, 189, 248, 0.13), transparent 17rem),
    radial-gradient(circle at 78% 10%, rgba(167, 139, 250, 0.11), transparent 18rem),
    linear-gradient(180deg, rgba(21, 31, 42, 0.94), rgba(12, 17, 24, 0.94));
  box-shadow: var(--shadow);
}

.competition-panel::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 0%, rgba(56, 189, 248, 0.08) 48%, transparent 62%);
  opacity: 0.38;
  animation: slowDrift 9s ease-in-out infinite alternate;
  content: "";
  pointer-events: none;
}

.competition-layout,
.history-grid,
.competition-panel .panel-head {
  position: relative;
  z-index: 1;
}

.competition-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, 0.9fr);
  gap: 12px;
}

.competition-map {
  display: grid;
  gap: 8px;
}

.competition-row {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(4, 8, 13, 0.38);
  opacity: 0.88;
  transition:
    border-color 260ms ease,
    opacity 260ms ease,
    box-shadow 260ms ease;
}

.competition-row.dominant {
  opacity: 1;
  animation: stateBreath 3.8s ease-in-out infinite;
}

.competition-row.rising {
  border-color: rgba(52, 211, 153, 0.32);
  box-shadow: 0 0 18px rgba(52, 211, 153, 0.12);
}

.competition-row.fading,
.competition-row.suppressed {
  opacity: 0.68;
}

.competition-row.critical {
  border-color: rgba(246, 198, 91, 0.44);
  box-shadow: 0 0 18px rgba(246, 198, 91, 0.16);
}

.competition-row.dead {
  opacity: 0.42;
  filter: saturate(0.55);
}

.competition-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.competition-line strong {
  color: #e5f2ff;
}

.competition-line span,
.competition-row small,
.war-side span,
.history-grid span {
  color: var(--muted);
  font-size: 0.78rem;
}

.competition-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 49, 61, 0.8);
}

.competition-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--green));
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
  transition: width 320ms ease;
}

.competition-row.fading .competition-track i,
.competition-row.suppressed .competition-track i {
  background: linear-gradient(90deg, #64748b, #94a3b8);
  box-shadow: none;
}

.competition-row.critical .competition-track i {
  background: linear-gradient(90deg, var(--amber), var(--red));
}

.competition-row.dead .competition-track i {
  background: #475569;
}

.war-side {
  display: grid;
  gap: 10px;
}

.war-side > div,
.history-grid > div {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 11px;
  background: rgba(4, 8, 13, 0.38);
}

.war-side p {
  margin: 7px 0 0;
  color: #dbeafe;
  line-height: 1.45;
}

#criticalAlerts {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #fde68a;
  line-height: 1.45;
}

.history-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.timeline-log {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
}

.timeline-log li {
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 999px;
  padding: 6px 9px;
  color: #bae6fd;
  background: rgba(4, 8, 13, 0.42);
  font-size: 0.78rem;
}

.state-flow-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(167, 139, 250, 0.22);
  border-radius: 22px;
  background:
    radial-gradient(circle at 16% 18%, rgba(167, 139, 250, 0.16), transparent 20rem),
    radial-gradient(circle at 76% 58%, rgba(52, 211, 153, 0.1), transparent 18rem),
    linear-gradient(180deg, rgba(10, 16, 25, 0.96), rgba(5, 9, 15, 0.96));
  box-shadow: var(--shadow);
}

.state-flow-panel::before {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle, rgba(56, 189, 248, 0.14) 1px, transparent 1px),
    radial-gradient(circle, rgba(167, 139, 250, 0.12) 1px, transparent 1px);
  background-position:
    0 0,
    32px 24px;
  background-size:
    72px 72px,
    108px 108px;
  opacity: 0.42;
  animation: consciousnessDrift 20s linear infinite alternate;
  content: "";
  pointer-events: none;
}

.state-flow-panel > * {
  position: relative;
  z-index: 1;
}

.consciousness-center {
  position: relative;
  display: grid;
  min-height: 210px;
  place-items: center;
  margin: 4px 0 16px;
}

.space-core {
  position: relative;
  display: grid;
  width: clamp(150px, 16vw, 220px);
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: rgba(224, 242, 254, 0.88);
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.18), transparent 18%),
    radial-gradient(circle at 50% 52%, rgba(56, 189, 248, 0.26), transparent 34%),
    radial-gradient(circle, rgba(4, 8, 13, 0.86) 42%, rgba(56, 189, 248, 0.12) 68%, transparent 72%);
  box-shadow:
    inset 0 0 40px rgba(6, 10, 18, 0.9),
    0 0 52px rgba(56, 189, 248, 0.18),
    0 0 120px rgba(52, 211, 153, 0.08);
  animation: consciousnessPulse 8s ease-in-out infinite, coreRotation 36s linear infinite;
}

.space-core::before,
.space-core::after {
  position: absolute;
  inset: -16%;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.space-core::before {
  border: 1px solid rgba(56, 189, 248, 0.16);
  background:
    conic-gradient(from 20deg, transparent, rgba(56, 189, 248, 0.28), transparent, rgba(52, 211, 153, 0.18), transparent);
  mask-image: radial-gradient(circle, transparent 56%, #000 58%, transparent 70%);
  animation: coreRotation 24s linear infinite reverse;
}

.space-core::after {
  inset: -34%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12), transparent 56%);
  filter: blur(8px);
  animation: coreBreathField 7s ease-in-out infinite;
}

.space-core span {
  position: relative;
  z-index: 1;
  font-size: 0.88rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.space-core.mood-calm {
  animation-duration: 10s, 42s;
}

.space-core.mood-eth {
  box-shadow:
    inset 0 0 40px rgba(6, 10, 18, 0.9),
    0 0 58px rgba(52, 211, 153, 0.22),
    0 0 130px rgba(52, 211, 153, 0.1);
}

.space-core.mood-compressed,
.space-core.stage-疲劳 {
  animation-duration: 5.8s, 28s;
}

.space-core.mood-vacuum {
  background:
    radial-gradient(circle at 50% 52%, rgba(0, 0, 0, 0.96) 0 42%, rgba(167, 139, 250, 0.18) 54%, transparent 70%);
  box-shadow:
    inset 0 0 48px rgba(0, 0, 0, 1),
    0 0 48px rgba(167, 139, 250, 0.14);
}

.space-core.mood-volatile {
  box-shadow:
    inset 0 0 40px rgba(6, 10, 18, 0.9),
    0 0 62px rgba(251, 113, 133, 0.18),
    0 0 130px rgba(246, 198, 91, 0.08);
  animation-duration: 4.8s, 26s;
}

.core-ripples {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.core-ripples i {
  position: absolute;
  width: 170px;
  aspect-ratio: 1;
  border: 1px solid rgba(56, 189, 248, 0.11);
  border-radius: 50%;
  animation: coreRipple 9s ease-out infinite;
}

.core-ripples i:nth-child(2) {
  animation-delay: 2.8s;
}

.core-ripples i:nth-child(3) {
  animation-delay: 5.6s;
}

.flow-organism {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 12px;
}

.flow-network {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.055);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.08), transparent 15rem),
    rgba(4, 8, 13, 0.18);
  box-shadow:
    inset 0 0 70px rgba(0, 0, 0, 0.24),
    0 0 50px rgba(56, 189, 248, 0.04);
}

.flow-network::before,
.flow-network::after {
  position: absolute;
  inset: -12%;
  content: "";
  pointer-events: none;
}

.flow-network::before {
  background:
    radial-gradient(circle at 28% 34%, rgba(56, 189, 248, 0.12), transparent 9rem),
    radial-gradient(circle at 66% 62%, rgba(10, 14, 23, 0.72), transparent 8rem),
    linear-gradient(120deg, transparent, rgba(52, 211, 153, 0.04), transparent);
  filter: blur(1px);
  animation: nebulaBreath 14s ease-in-out infinite alternate;
}

.flow-network::after {
  background-image:
    linear-gradient(115deg, transparent 42%, rgba(56, 189, 248, 0.08) 48%, transparent 54%),
    radial-gradient(circle, rgba(255, 255, 255, 0.16) 0 1px, transparent 1px);
  background-size:
    220px 220px,
    92px 92px;
  opacity: 0.34;
  animation: neuralDrift 22s linear infinite;
}

.flow-state-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  display: grid;
  width: var(--s);
  height: var(--s);
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.16), transparent 24%),
    conic-gradient(from 40deg, rgba(56, 189, 248, 0.08), transparent, rgba(52, 211, 153, 0.08), transparent),
    radial-gradient(circle, rgba(56, 189, 248, 0.18), rgba(6, 10, 17, 0.72) 64%);
  box-shadow: 0 0 calc(var(--s) * 0.32) rgba(56, 189, 248, 0.18);
  color: #e0f2fe;
  text-align: center;
  transform: translate(-50%, -50%);
  animation: nodeDrift 7s ease-in-out infinite alternate;
  animation-delay: var(--d);
  backdrop-filter: blur(2px);
}

.flow-state-node::before,
.flow-state-node::after {
  position: absolute;
  inset: -9px;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.flow-state-node::before {
  border: 1px solid rgba(56, 189, 248, 0.16);
  opacity: 0.7;
  animation: energyHalo 4.8s ease-in-out infinite;
  animation-delay: var(--d);
}

.flow-state-node::after {
  inset: -17px;
  background:
    radial-gradient(circle, rgba(56, 189, 248, 0.14), transparent 62%),
    conic-gradient(from 120deg, transparent, rgba(56, 189, 248, 0.08), transparent);
  opacity: 0.42;
  filter: blur(4px);
  animation: outerPulse 5.6s ease-in-out infinite, coreRotation 28s linear infinite;
}

.flow-state-node strong {
  position: relative;
  z-index: 1;
  max-width: 80%;
  font-size: 0.76rem;
  line-height: 1.15;
}

.flow-state-node em {
  position: relative;
  z-index: 1;
  color: #93c5fd;
  font-size: 0.72rem;
  font-style: normal;
}

.flow-state-node.dominant,
.flow-state-node.devourer {
  border-color: rgba(52, 211, 153, 0.44);
  box-shadow: 0 0 calc(var(--s) * 0.48) rgba(52, 211, 153, 0.23);
  animation-name: nodeDrift, livingPulse;
  animation-duration: 7s, 3.6s;
}

.flow-state-node.prey {
  opacity: 0.58;
  filter: saturate(0.76);
  transform: translate(-50%, -50%) scale(0.92);
}

.flow-state-node.accumulation {
  background:
    radial-gradient(circle at 35% 28%, rgba(186, 230, 253, 0.18), transparent 24%),
    radial-gradient(circle, rgba(52, 211, 153, 0.18), rgba(6, 10, 17, 0.75) 66%);
}

.flow-state-node.compression {
  border-color: rgba(246, 198, 91, 0.34);
  box-shadow: 0 0 calc(var(--s) * 0.34) rgba(246, 198, 91, 0.14);
  animation-name: compressionTremor;
  animation-duration: 1.8s;
}

.flow-state-node.vacuum {
  background:
    radial-gradient(circle at 50% 50%, rgba(3, 7, 12, 0.92) 0 42%, rgba(167, 139, 250, 0.2) 54%, rgba(6, 10, 17, 0.7) 70%);
  box-shadow:
    inset 0 0 calc(var(--s) * 0.22) rgba(0, 0, 0, 0.9),
    0 0 calc(var(--s) * 0.55) rgba(167, 139, 250, 0.2);
}

.flow-state-node.vacuum::after {
  background: radial-gradient(circle, transparent 30%, rgba(167, 139, 250, 0.16) 42%, transparent 66%);
  animation: vacuumWarp 4.5s ease-in-out infinite;
}

.flow-state-node.trap {
  animation-name: nodeDrift, signalJitter;
  animation-duration: 7s, 2.2s;
}

.flow-state-node.cascade,
.flow-state-node.critical {
  border-color: rgba(251, 113, 133, 0.42);
  box-shadow: 0 0 calc(var(--s) * 0.42) rgba(251, 113, 133, 0.2);
}

.flow-state-node.critical::before {
  border-color: rgba(251, 113, 133, 0.36);
  animation-duration: 2.2s;
}

.flow-state-node.repair {
  border-color: rgba(52, 211, 153, 0.28);
}

.flow-link {
  position: absolute;
  left: 8%;
  right: 8%;
  top: calc(20% + var(--i) * 15%);
  height: 3px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.16), rgba(52, 211, 153, 0.78), transparent),
    repeating-linear-gradient(90deg, transparent 0 22px, rgba(255, 255, 255, 0.22) 24px 26px, transparent 28px 54px);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.24);
  animation: flowingPath 3.6s ease-in-out infinite;
  filter: blur(0.1px);
}

.flow-link::before,
.flow-link::after {
  position: absolute;
  top: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(186, 230, 253, 0.82);
  box-shadow: 0 0 14px rgba(56, 189, 248, 0.58);
  transform: translateY(-50%);
  animation: particleTravel 2.9s linear infinite;
  content: "";
}

.flow-link::after {
  width: 5px;
  height: 5px;
  animation-delay: 1.2s;
  opacity: 0.72;
}

.flow-link b {
  position: absolute;
  right: 0;
  top: -24px;
  color: rgba(203, 213, 225, 0.72);
  font-size: 0.72rem;
  font-weight: 700;
}

.flow-link.devour {
  height: 3px;
  background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.22), rgba(251, 113, 133, 0.72), transparent);
}

.flow-link.collapse {
  background: linear-gradient(90deg, transparent, rgba(246, 198, 91, 0.3), rgba(251, 113, 133, 0.84), transparent);
}

.flow-link.dormant {
  opacity: 0.24;
}

.flow-critical .flow-network {
  border-color: rgba(251, 113, 133, 0.18);
}

.flow-critical .flow-network::before {
  background:
    radial-gradient(circle at 68% 58%, rgba(251, 113, 133, 0.11), transparent 10rem),
    radial-gradient(circle at 28% 34%, rgba(56, 189, 248, 0.09), transparent 9rem);
}

.flow-disturbed .flow-network {
  animation: environmentRipple 8s ease-in-out infinite;
}

.flow-whisper,
.flow-system-grid > div {
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 8, 13, 0.42);
}

.flow-whisper span,
.flow-system-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.flow-whisper p,
#timeFlow {
  margin: 8px 0 0;
  color: #dbeafe;
  line-height: 1.55;
}

#timeFlow span {
  display: block;
}

.life-stage-line {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 11px;
  font-weight: 800;
}

.life-stage-line i {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 999px;
  padding: 6px 4px;
  color: rgba(203, 213, 225, 0.56);
  background: rgba(4, 8, 13, 0.4);
  font-size: 0.72rem;
  font-style: normal;
  text-align: center;
}

.life-stage-line i.active {
  border-color: rgba(52, 211, 153, 0.36);
  color: #bbf7d0;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.14);
  animation: stateBreath 4s ease-in-out infinite;
}

.flow-system-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.velocity-list {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.velocity-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  padding-bottom: 7px;
  color: #dbeafe;
  font-size: 0.8rem;
}

.velocity-list span {
  color: #a7f3d0;
  text-align: right;
}

.collapse-list {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.collapse-row {
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(15, 23, 32, 0.82);
}

.collapse-row span,
.collapse-row strong {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 7px 8px;
  color: #dbeafe;
  font-size: 0.78rem;
}

.collapse-row strong {
  float: right;
}

.collapse-row i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.3), rgba(251, 113, 133, 0.18));
  box-shadow: 0 0 16px rgba(167, 139, 250, 0.18);
  transition: width 320ms ease;
}

.memory-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(52, 211, 153, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 12%, rgba(52, 211, 153, 0.12), transparent 17rem),
    radial-gradient(circle at 74% 38%, rgba(56, 189, 248, 0.1), transparent 18rem),
    linear-gradient(180deg, rgba(15, 25, 34, 0.94), rgba(8, 13, 20, 0.95));
  box-shadow: var(--shadow);
}

.memory-panel::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(52, 211, 153, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at center, #000 12%, transparent 76%);
  animation: energyLineDrift 16s linear infinite;
  content: "";
  pointer-events: none;
}

.memory-panel > * {
  position: relative;
  z-index: 1;
}

.fingerprint-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.fingerprint-tags span {
  border: 1px solid rgba(52, 211, 153, 0.22);
  border-radius: 999px;
  padding: 7px 10px;
  color: #bbf7d0;
  background: rgba(4, 8, 13, 0.46);
  box-shadow: 0 0 14px rgba(52, 211, 153, 0.08);
  font-size: 0.78rem;
  font-weight: 900;
}

.memory-grid {
  display: grid;
  grid-template-columns: 0.82fr 1fr 1fr;
  gap: 10px;
}

.memory-card,
.consciousness-card,
.memory-timeline-wrap {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 8, 13, 0.42);
}

.memory-card span,
.consciousness-card span,
.memory-timeline-wrap > span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.memory-card strong {
  display: block;
  margin-top: 7px;
  color: #e0f2fe;
  font-size: 1.42rem;
}

.memory-card p,
.consciousness-card p {
  margin: 8px 0 0;
  color: #dbeafe;
  line-height: 1.5;
}

.outcome-bars {
  display: grid;
  gap: 8px;
  margin-top: 9px;
}

.outcome-row {
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  background: rgba(15, 23, 32, 0.86);
}

.outcome-row div {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  padding: 7px 9px;
  color: #dbeafe;
  font-size: 0.78rem;
}

.outcome-row i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.34), rgba(52, 211, 153, 0.2));
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.16);
  transition: width 320ms ease;
}

.consciousness-card {
  margin-top: 10px;
}

.memory-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 12px;
}

.flow-node {
  position: relative;
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 999px;
  color: #bae6fd;
  background: rgba(4, 8, 13, 0.54);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.08);
  font-size: 0.8rem;
  font-weight: 900;
}

.flow-node::after {
  position: absolute;
  top: 50%;
  left: calc(100% + 2px);
  width: 18px;
  height: 2px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.15), rgba(52, 211, 153, 0.72), rgba(56, 189, 248, 0.15));
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.36);
  animation: flowPulse 2.8s ease-in-out infinite;
  content: "";
}

.flow-node:last-child::after {
  display: none;
}

.flow-node.active {
  border-color: rgba(52, 211, 153, 0.34);
  animation: stateBreath 4s ease-in-out infinite;
}

.memory-timeline-wrap {
  margin-top: 12px;
}

.memory-timeline {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}

.memory-timeline li {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px;
  border-left: 2px solid rgba(52, 211, 153, 0.32);
  padding: 4px 0 4px 10px;
  color: #dbeafe;
  font-size: 0.82rem;
}

.memory-timeline time {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.danger-安全 {
  border-color: rgba(52, 211, 153, 0.34);
}

.danger-中性 {
  border-color: rgba(246, 198, 91, 0.36);
}

.danger-危险,
.danger-极危 {
  border-color: rgba(251, 113, 133, 0.42);
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.16);
}

.life-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.life-grid div,
.causal-grid > div {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(4, 8, 13, 0.38);
}

.life-grid span,
.causal-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.life-grid strong {
  display: block;
  margin-top: 5px;
  color: #dbeafe;
  font-size: 1rem;
}

.causal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.causal-grid p {
  margin: 7px 0 0;
  color: #dbeafe;
  line-height: 1.45;
}

.life-next {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.life-next span {
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 999px;
  padding: 7px 9px;
  background: rgba(4, 8, 13, 0.38);
  color: #bae6fd;
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.dominance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dominance-card {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 11px;
  background: rgba(4, 8, 13, 0.42);
}

.dominance-card span,
.dominance-next span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.dominance-card strong {
  display: block;
  margin-top: 5px;
  color: #dbeafe;
  font-size: 1.05rem;
}

.dominance-card.primary {
  border-color: rgba(56, 189, 248, 0.26);
}

.dominance-card.risk {
  border-color: rgba(251, 113, 133, 0.28);
}

.dominance-next {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.dominance-next span {
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 999px;
  padding: 7px 9px;
  background: rgba(4, 8, 13, 0.38);
  color: #bae6fd;
  font-weight: 900;
  text-align: center;
}

.dominance-log {
  display: grid;
  max-height: 120px;
  margin: 12px 0 0;
  padding: 0;
  gap: 6px;
  overflow: auto;
  list-style: none;
}

.dominance-log li {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.028);
  color: var(--muted);
  font-size: 0.82rem;
}

.flow-panel::before {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 13% 50%, rgba(56, 189, 248, 0.18), transparent 18rem),
    linear-gradient(92deg, rgba(52, 211, 153, 0.06), transparent 42%, rgba(167, 139, 250, 0.08)),
    repeating-linear-gradient(105deg, transparent 0 70px, rgba(56, 189, 248, 0.055) 71px 73px);
  animation: energyLineDrift 16s linear infinite;
  pointer-events: none;
  content: "";
}

.flow-core,
.flow-metrics {
  position: relative;
  z-index: 1;
}

.flow-core {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.core-sphere {
  position: relative;
  display: grid;
  width: 132px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid rgba(56, 189, 248, 0.5);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(224, 251, 255, 0.9), rgba(56, 189, 248, 0.24) 24%, rgba(6, 12, 19, 0.62) 58%),
    conic-gradient(from 180deg, rgba(52, 211, 153, 0.7), rgba(56, 189, 248, 0.12), rgba(167, 139, 250, 0.54), rgba(52, 211, 153, 0.7));
  box-shadow:
    0 0 34px rgba(56, 189, 248, 0.28),
    inset 0 0 28px rgba(6, 12, 19, 0.72);
  animation: coreBreath 5.8s ease-in-out infinite;
}

.core-sphere::before,
.core-sphere::after {
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 50%;
  animation: slowSpin 14s linear infinite;
  content: "";
}

.core-sphere::after {
  inset: 10px;
  border-color: rgba(52, 211, 153, 0.22);
  transform: rotate(55deg) scaleX(0.62);
}

.core-sphere span::after {
  display: block;
  margin-top: 4px;
  color: rgba(224, 251, 255, 0.64);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  content: "CORE";
}

.core-sphere span {
  position: relative;
  z-index: 1;
  color: #effcff;
  font-size: 2.35rem;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 0 18px rgba(56, 189, 248, 0.8);
}

.flow-core h2 {
  font-size: clamp(1.24rem, 2vw, 1.8rem);
}

.flow-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.core-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
}

.core-badges span {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(4, 8, 13, 0.42);
  color: #dbeafe;
  font-size: 0.78rem;
  font-weight: 900;
}

.core-explainer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(280px, 1fr) minmax(360px, 0.82fr);
  gap: 10px;
  align-items: stretch;
}

.core-explainer > div,
.speed-grid > div {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 11px;
  background: rgba(4, 8, 13, 0.42);
}

.core-explainer span,
.speed-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.core-explainer p {
  margin: 7px 0 0;
  color: #dbeafe;
  line-height: 1.45;
}

.speed-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.speed-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}

.flow-metric {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 8, 13, 0.42);
}

.flow-metric span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.flow-metric strong {
  display: block;
  margin: 7px 0 9px;
  font-size: 1.35rem;
}

.flow-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 49, 61, 0.86);
}

.flow-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 280ms ease;
}

.flow-track.bull i {
  background: linear-gradient(90deg, #38bdf8, #34d399);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.44);
}

.flow-track.bear i {
  background: linear-gradient(90deg, #f6c65b, #fb7185);
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.4);
}

.flow-track.density i {
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.42);
}

.state-machine-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 18px;
  border-color: rgba(167, 139, 250, 0.24);
}

.state-machine-panel::before {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 16% 24%, rgba(56, 189, 248, 0.16), transparent 17rem),
    radial-gradient(circle at 80% 48%, rgba(52, 211, 153, 0.12), transparent 19rem),
    linear-gradient(100deg, rgba(167, 139, 250, 0.08), transparent 52%);
  pointer-events: none;
  content: "";
}

.machine-head,
.state-network,
.transition-grid {
  position: relative;
  z-index: 1;
}

.machine-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.machine-head h2 {
  font-size: clamp(1.28rem, 2.1vw, 1.8rem);
}

.machine-meta {
  min-width: 150px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  padding: 9px 11px;
  background: rgba(4, 8, 13, 0.42);
}

.machine-meta span,
.transition-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.machine-meta strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.state-network {
  display: grid;
  grid-template-columns: repeat(7, minmax(88px, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.state-node {
  position: relative;
  display: grid;
  min-height: 42px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  background: rgba(6, 12, 19, 0.68);
  color: #cbd5e1;
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.state-node::after {
  position: absolute;
  right: -10px;
  width: 10px;
  height: 2px;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.55), transparent);
  content: "";
}

.state-node:last-child::after {
  display: none;
}

.state-node.active {
  border-color: rgba(52, 211, 153, 0.72);
  color: #ecfeff;
  background: rgba(20, 184, 166, 0.13);
  box-shadow:
    0 0 20px rgba(52, 211, 153, 0.22),
    inset 0 0 18px rgba(56, 189, 248, 0.12);
}

.state-node.previous {
  border-color: rgba(246, 198, 91, 0.58);
  color: #fde68a;
}

.state-node.next {
  border-color: rgba(56, 189, 248, 0.5);
  color: #bae6fd;
}

.transition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.transition-card {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(4, 8, 13, 0.42);
}

.transition-card strong {
  display: block;
  margin: 5px 0 8px;
  font-size: 1.35rem;
}

.transition-path {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 49, 61, 0.86);
}

.transition-path i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--cyan), var(--green));
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.44);
  transition: width 280ms ease;
}

.inference-panel {
  position: relative;
  overflow: hidden;
  margin-bottom: 14px;
  padding: 18px;
  border-color: rgba(56, 189, 248, 0.22);
}

.inference-panel::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(56, 189, 248, 0.08), transparent 28%, rgba(167, 139, 250, 0.08)),
    repeating-linear-gradient(90deg, transparent 0 54px, rgba(56, 189, 248, 0.045) 55px 56px);
  opacity: 0.72;
  pointer-events: none;
  content: "";
}

.inference-panel.risk-low {
  border-color: rgba(52, 211, 153, 0.38);
  box-shadow: var(--shadow), 0 0 34px rgba(52, 211, 153, 0.12);
}

.inference-panel.risk-mid {
  border-color: rgba(246, 198, 91, 0.42);
  box-shadow: var(--shadow), 0 0 34px rgba(246, 198, 91, 0.12);
}

.inference-panel.risk-high {
  border-color: rgba(251, 113, 133, 0.46);
  box-shadow: var(--shadow), 0 0 36px rgba(251, 113, 133, 0.16);
}

.inference-head,
.probability-grid,
.inference-observation {
  position: relative;
  z-index: 1;
}

.inference-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.inference-head h2 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.dominance-chip {
  min-width: 138px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.045);
  color: #dbeafe;
  font-size: 0.88rem;
  font-weight: 900;
  text-align: center;
}

.probability-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.probability-card {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(4, 8, 13, 0.42);
}

.probability-card span {
  color: var(--muted);
  font-size: 0.82rem;
}

.probability-card strong {
  display: block;
  margin: 6px 0 9px;
  font-size: 1.55rem;
  line-height: 1;
}

.probability-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 49, 61, 0.86);
}

.probability-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 280ms ease;
}

.probability-card.trap i {
  background: linear-gradient(90deg, #f6c65b, #38bdf8);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.44);
}

.probability-card.squeeze i {
  background: linear-gradient(90deg, #38bdf8, #34d399);
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.44);
}

.probability-card.cascade i {
  background: linear-gradient(90deg, #f6c65b, #fb7185);
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.45);
}

.inference-observation {
  margin: 13px 0 0;
  color: #cbd5e1;
  font-size: 0.98rem;
  line-height: 1.55;
}

.quote-card {
  padding: 18px;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    transform 180ms ease,
    background 180ms ease;
}

.quote-card:hover,
.quote-card.active {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(21, 32, 42, 0.96);
}

.quote-card:hover {
  transform: translateY(-1px);
}

.quote-head,
.quote-meta,
.range-row,
.pulse-stats {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.coin-mark {
  display: inline-grid;
  min-width: 68px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  font-weight: 900;
}

.coin-mark.btc {
  background: rgba(246, 198, 91, 0.16);
  color: var(--amber);
}

.coin-mark.eth {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
}

.icon-button,
.ghost-button,
.primary-button,
.segment {
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1.05rem;
}

.price {
  display: block;
  margin: 18px 0 12px;
  font-size: clamp(2rem, 4.4vw, 4.3rem);
  line-height: 0.95;
  white-space: nowrap;
}

.price.flash-up {
  animation: priceFlashUp 420ms ease-out;
}

.price.flash-down {
  animation: priceFlashDown 420ms ease-out;
}

.quote-meta,
.range-row {
  color: var(--muted);
  font-size: 0.92rem;
}

.positive {
  color: var(--green);
}

.negative {
  color: var(--red);
}

.pulse-panel {
  padding: 18px;
}

.cosmic-core {
  position: relative;
  min-height: 216px;
  overflow: hidden;
  padding: 20px;
  border-color: rgba(56, 189, 248, 0.26);
}

.cosmic-core::before {
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(circle at center, rgba(56, 189, 248, 0.24), transparent 9rem),
    conic-gradient(from 120deg, transparent, rgba(52, 211, 153, 0.18), transparent, rgba(167, 139, 250, 0.16), transparent);
  animation: slowSpin 18s linear infinite;
  content: "";
}

.core-content {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
}

.core-content strong {
  display: block;
  margin: 8px 0;
  color: #e0fbff;
  font-size: clamp(3.2rem, 7vw, 6.4rem);
  line-height: 0.88;
  text-shadow: 0 0 26px rgba(56, 189, 248, 0.46);
}

.core-content h2 {
  font-size: 1.35rem;
}

.core-content p:last-child,
.signal-copy {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.core-orbit {
  position: absolute;
  right: 28px;
  top: 34px;
  width: 170px;
  height: 170px;
  opacity: 0.8;
}

.core-orbit span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 50%;
  box-shadow: inset 0 0 24px rgba(56, 189, 248, 0.1);
}

.core-orbit span:nth-child(2) {
  transform: rotate(58deg) scaleX(0.52);
}

.core-orbit span:nth-child(3) {
  transform: rotate(-38deg) scaleX(0.62);
}

.energy-track,
.strength-scale,
.liquidity-bar {
  overflow: hidden;
  border-radius: 999px;
  background: rgba(38, 49, 61, 0.92);
}

.energy-track {
  height: 12px;
  margin: 16px 0 0;
}

.energy-track span,
.strength-scale span,
.liquidity-bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition:
    width 280ms ease,
    transform 280ms ease,
    background 280ms ease;
}

.energy-track span {
  width: 0%;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--green), var(--cyan));
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.5);
}

.signal-panel {
  padding: 18px;
  min-height: 216px;
}

.signal-panel.glow-green,
.cosmic-core.glow-green {
  border-color: rgba(52, 211, 153, 0.42);
  box-shadow: var(--shadow), 0 0 36px rgba(52, 211, 153, 0.16);
}

.signal-panel.glow-red,
.cosmic-core.glow-red {
  border-color: rgba(251, 113, 133, 0.42);
  box-shadow: var(--shadow), 0 0 36px rgba(251, 113, 133, 0.15);
}

.signal-panel.glow-amber,
.cosmic-core.glow-amber {
  border-color: rgba(246, 198, 91, 0.44);
  box-shadow: var(--shadow), 0 0 36px rgba(246, 198, 91, 0.14);
}

#strengthScore {
  font-size: 2rem;
}

.strength-scale {
  position: relative;
  height: 12px;
  margin-top: 24px;
  background: linear-gradient(90deg, rgba(251, 113, 133, 0.75), rgba(246, 198, 91, 0.78), rgba(52, 211, 153, 0.72));
}

.strength-scale span {
  width: 14px;
  background: #fff;
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.72);
  transform: translateX(calc(50% - 7px));
}

.status-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(246, 198, 91, 0.8);
}

.structure-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.structure-mini-grid div,
.liquidity-summary {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 9px;
  background: rgba(4, 8, 13, 0.32);
}

.structure-mini-grid span,
.oi-card small,
.liquidity-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.structure-mini-grid strong,
.liquidity-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 0.96rem;
}

.pulse-panel strong {
  display: block;
  min-height: 30px;
  font-size: 1.35rem;
}

.pulse-meter {
  height: 10px;
  margin: 22px 0 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #26313d;
}

.pulse-meter span {
  display: block;
  width: 50%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--amber), var(--green));
  transition: width 220ms ease;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
  align-items: start;
}

.chart-panel {
  min-width: 0;
  padding: 18px;
}

.panel-head {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-head.compact {
  margin-bottom: 12px;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
}

.segment {
  min-width: 68px;
  height: 38px;
  border: 0;
  border-right: 1px solid rgba(148, 163, 184, 0.16);
}

.segment:last-child {
  border-right: 0;
}

.segment.active {
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
  font-weight: 800;
}

.chart-wrap {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(16, 24, 33, 0.96), rgba(10, 15, 21, 0.96));
}

#priceChart {
  display: block;
  width: 100%;
  height: 440px;
}

.chart-readout {
  position: absolute;
  right: 14px;
  top: 12px;
  max-width: calc(100% - 28px);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(9, 13, 18, 0.72);
  color: var(--muted);
  font-size: 0.88rem;
  pointer-events: none;
}

.side-panel {
  display: grid;
  gap: 14px;
}

.tool-panel {
  padding: 16px;
}

.mini-tag {
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 999px;
  padding: 5px 9px;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.08);
  font-size: 0.78rem;
  font-weight: 800;
}

.oi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.oi-card {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.oi-card span,
.liquidity-row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.oi-card strong {
  display: block;
  margin: 8px 0 5px;
  font-size: 1.25rem;
  white-space: nowrap;
}

.oi-card em {
  font-style: normal;
  font-weight: 900;
}

.oi-card small {
  margin-top: 6px;
}

.liquidity-radar {
  display: grid;
  gap: 11px;
}

.liquidity-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 10px;
}

.liquidity-bar {
  height: 9px;
}

.liquidity-bar i {
  width: 0%;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.66), rgba(52, 211, 153, 0.9));
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
}

.liquidity-row strong {
  text-align: right;
  font-size: 0.84rem;
}

.liquidity-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.alert-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
}

select,
input {
  width: 100%;
  min-height: 40px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  padding: 0 10px;
  outline: none;
  background: #0d141c;
  color: var(--text);
}

input:focus,
select:focus {
  border-color: rgba(56, 189, 248, 0.65);
}

.wide {
  grid-column: 1 / -1;
}

.primary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 12px;
  font-weight: 800;
}

.primary-button {
  border-color: rgba(56, 189, 248, 0.4);
  background: #0ea5e9;
  color: #061018;
}

.ghost-button {
  color: var(--muted);
}

.alerts-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.alert-item,
.event-feed li {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.alert-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
}

.alert-item button {
  min-width: 28px;
  height: 28px;
}

.event-feed {
  display: grid;
  max-height: 318px;
  margin: 0;
  padding: 0;
  gap: 8px;
  overflow: auto;
  list-style: none;
}

.event-feed li {
  padding: 10px;
  color: var(--muted);
  font-size: 0.88rem;
}

.event-feed strong {
  color: var(--text);
}

@media (max-width: 1040px) {
  .market-grid,
  .cosmic-grid,
  .flow-panel,
  .flow-organism,
  .flow-system-grid,
  .competition-layout,
  .history-grid,
  .memory-grid,
  .memory-flow,
  .multi-row,
  .workspace {
    grid-template-columns: 1fr;
  }

  .side-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@keyframes slowSpin {
  to {
    transform: rotate(1turn);
  }
}

@keyframes cosmicDrift {
  to {
    transform: translate3d(72px, 46px, 0);
  }
}

@keyframes deepStarDrift {
  to {
    background-position:
      92px 160px,
      -170px 210px,
      48px 96px,
      96px 48px;
  }
}

@keyframes spaceMist {
  from {
    opacity: 0.56;
    transform: translate3d(-1.5%, 0, 0) scale(1);
  }

  to {
    opacity: 0.78;
    transform: translate3d(1.5%, -1%, 0) scale(1.04);
  }
}

@keyframes farNeuralFlow {
  to {
    background-position:
      520px 240px,
      -340px 260px;
  }
}

@keyframes energyLineDrift {
  to {
    background-position:
      0 0,
      0 0,
      180px 0;
  }
}

@keyframes slowDrift {
  from {
    transform: translateX(-10%);
  }

  to {
    transform: translateX(10%);
  }
}

@keyframes stateBreath {
  0%,
  100% {
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.12);
  }

  50% {
    box-shadow: 0 0 23px rgba(52, 211, 153, 0.2);
  }
}

@keyframes flowPulse {
  0%,
  100% {
    opacity: 0.34;
    transform: translateY(-50%) scaleX(0.72);
  }

  50% {
    opacity: 1;
    transform: translateY(-50%) scaleX(1);
  }
}

@keyframes consciousnessDrift {
  to {
    transform: translate3d(54px, -38px, 0) rotate(3deg);
  }
}

@keyframes nodeDrift {
  from {
    transform: translate(-50%, -50%) translate3d(-5px, 4px, 0);
  }

  to {
    transform: translate(-50%, -50%) translate3d(6px, -5px, 0);
  }
}

@keyframes livingPulse {
  50% {
    filter: brightness(1.18);
  }
}

@keyframes flowingPath {
  0%,
  100% {
    opacity: 0.35;
    transform: translateX(-8px) scaleX(0.92);
  }

  50% {
    opacity: 0.95;
    transform: translateX(8px) scaleX(1);
  }
}

@keyframes viewportBreath {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(0, -3px, 0) scale(1.002);
  }
}

@keyframes nebulaBreath {
  from {
    opacity: 0.5;
    transform: scale(0.98) rotate(-1deg);
  }

  to {
    opacity: 0.82;
    transform: scale(1.03) rotate(1deg);
  }
}

@keyframes neuralDrift {
  to {
    background-position:
      260px 120px,
      92px 46px;
  }
}

@keyframes energyHalo {
  0%,
  100% {
    opacity: 0.34;
    transform: scale(0.92);
  }

  50% {
    opacity: 0.88;
    transform: scale(1.12);
  }
}

@keyframes outerPulse {
  0%,
  100% {
    opacity: 0.22;
    transform: scale(0.86);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.18);
  }
}

@keyframes compressionTremor {
  0%,
  100% {
    transform: translate(-50%, -50%) translate3d(-2px, 1px, 0) scale(0.98);
  }

  50% {
    transform: translate(-50%, -50%) translate3d(2px, -1px, 0) scale(1.01);
  }
}

@keyframes vacuumWarp {
  0%,
  100% {
    opacity: 0.28;
    transform: rotate(0deg) scale(0.9);
  }

  50% {
    opacity: 0.56;
    transform: rotate(8deg) scale(1.16);
  }
}

@keyframes signalJitter {
  0%,
  100% {
    filter: brightness(0.96);
  }

  45% {
    filter: brightness(1.24);
  }

  52% {
    filter: brightness(0.84);
  }
}

@keyframes particleTravel {
  from {
    left: 0;
    opacity: 0;
  }

  12% {
    opacity: 1;
  }

  88% {
    opacity: 1;
  }

  to {
    left: 100%;
    opacity: 0;
  }
}

@keyframes environmentRipple {
  0%,
  100% {
    box-shadow: inset 0 0 0 rgba(251, 113, 133, 0), 0 0 0 rgba(56, 189, 248, 0);
  }

  50% {
    box-shadow: inset 0 0 42px rgba(251, 113, 133, 0.06), 0 0 30px rgba(56, 189, 248, 0.08);
  }
}

@keyframes coreBreath {
  50% {
    transform: scale(1.025);
  }
}

@keyframes consciousnessPulse {
  0%,
  100% {
    transform: scale(0.985);
    filter: brightness(0.96);
  }

  50% {
    transform: scale(1.025);
    filter: brightness(1.12);
  }
}

@keyframes coreRotation {
  to {
    rotate: 1turn;
  }
}

@keyframes coreBreathField {
  0%,
  100% {
    opacity: 0.32;
    transform: scale(0.88);
  }

  50% {
    opacity: 0.72;
    transform: scale(1.16);
  }
}

@keyframes coreRipple {
  0% {
    opacity: 0;
    transform: scale(0.72);
  }

  18% {
    opacity: 0.72;
  }

  100% {
    opacity: 0;
    transform: scale(2.7);
  }
}

@keyframes priceFlashUp {
  0% {
    color: #ecfeff;
    text-shadow: 0 0 22px rgba(52, 211, 153, 0.72);
  }
  100% {
    color: var(--text);
    text-shadow: none;
  }
}

@keyframes priceFlashDown {
  0% {
    color: #ffe4e6;
    text-shadow: 0 0 22px rgba(251, 113, 133, 0.68);
  }
  100% {
    color: var(--text);
    text-shadow: none;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1500px);
    padding-top: 14px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .side-panel {
    grid-template-columns: 1fr;
  }

  .price {
    font-size: 2.6rem;
  }

  .panel-head {
    align-items: start;
    flex-direction: column;
  }

  .inference-head {
    flex-direction: column;
  }

  .machine-head {
    flex-direction: column;
  }

  .dominance-chip {
    width: 100%;
  }

  .machine-meta,
  .flow-metrics,
  .core-explainer,
  .dominance-grid,
  .dominance-next,
  .life-grid,
  .causal-grid,
  .life-next,
  .flow-organism,
  .flow-system-grid,
  .competition-layout,
  .history-grid,
  .memory-grid,
  .memory-flow,
  .probability-grid,
  .transition-grid {
    width: 100%;
  }

  .probability-grid,
  .flow-metrics,
  .core-explainer,
  .dominance-grid,
  .dominance-next,
  .life-grid,
  .causal-grid,
  .life-next,
  .flow-organism,
  .flow-system-grid,
  .competition-layout,
  .history-grid,
  .memory-grid,
  .memory-flow,
  .transition-grid {
    grid-template-columns: 1fr;
  }

  .speed-grid {
    grid-template-columns: 1fr;
  }

  .flow-core {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .core-sphere {
    width: 92px;
  }

  .core-sphere span {
    font-size: 1.75rem;
  }

  .state-network {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .state-node::after {
    display: none;
  }

  .flow-node::after {
    display: none;
  }

  .flow-network {
    min-height: 520px;
  }

  .segmented {
    width: 100%;
  }

  #priceChart {
    height: 360px;
  }

  .chart-wrap {
    min-height: 360px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  body::after,
  html::before,
  html::after,
  .flow-panel::before,
  .state-flow-panel::before,
  .competition-panel::after,
  .memory-panel::before,
  .cosmic-core::before,
  .core-sphere::before,
  .core-sphere::after,
  .flow-network::before,
  .flow-network::after,
  .flow-state-node::before,
  .flow-state-node::after,
  .flow-link::before,
  .flow-link::after {
    animation: none !important;
    transition: none !important;
  }
}

body[data-performance="low"] html::before,
body[data-performance="low"] html::after {
  animation-duration: 160s !important;
}

body[data-performance="low"]::before,
body[data-performance="low"]::after {
  opacity: 0.18;
  animation-duration: 120s !important;
}

body[data-performance="low"] .flow-state-node:not(.dominant):not(.devourer),
body[data-performance="low"] .flow-state-node:not(.dominant):not(.devourer)::before,
body[data-performance="low"] .flow-state-node:not(.dominant):not(.devourer)::after,
body[data-performance="low"] .flow-link::before,
body[data-performance="low"] .flow-link::after,
body[data-performance="low"] .competition-panel::after,
body[data-performance="low"] .memory-panel::before,
body[data-performance="low"] .flow-network::after {
  animation: none !important;
}

body[data-performance="low"] .flow-link {
  animation-duration: 10s !important;
  opacity: 0.42;
}

body[data-performance="low"] .space-core,
body[data-performance="low"] .core-ripples i,
body[data-performance="low"] .flow-state-node.dominant,
body[data-performance="low"] .flow-state-node.devourer {
  animation-duration: 12s !important;
}

body[data-performance="low"] .flow-network::before,
body[data-performance="low"] .state-flow-panel::before {
  opacity: 0.18;
  animation-duration: 120s !important;
}

body[data-performance="static"] *,
body[data-performance="static"] *::before,
body[data-performance="static"] *::after,
body.is-hidden *,
body.is-hidden *::before,
body.is-hidden *::after {
  animation: none !important;
  transition: none !important;
}

body[data-performance="static"]::before,
body[data-performance="static"]::after,
body.is-hidden::before,
body.is-hidden::after {
  animation: none !important;
  opacity: 0.12;
}

body[data-performance="static"] .flow-link::before,
body[data-performance="static"] .flow-link::after,
body[data-performance="static"] .core-ripples,
body.is-hidden .flow-link::before,
body.is-hidden .flow-link::after,
body.is-hidden .core-ripples {
  display: none;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100svh;
  overflow-x: hidden;
  overflow-x: clip;
}

.shell {
  width: min(1500px, calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}

.market-grid > *,
.cosmic-grid > *,
.workspace > *,
.side-panel > *,
.multi-row > *,
.state-network > *,
.probability-grid > *,
.transition-grid > *,
.flow-metrics > *,
.dominance-grid > *,
.life-grid > *,
.memory-grid > * {
  min-width: 0;
}

.perf-status {
  right: max(14px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
}

.icon-button,
.segment,
.primary-button,
.ghost-button,
.perf-toggle,
select,
input {
  min-height: 44px;
}

.icon-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
}

@media (min-width: 1041px) and (max-width: 1366px) and (pointer: coarse) {
  :root {
    font-size: 17px;
  }

  .shell {
    width: min(1500px, calc(100vw - 36px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr) clamp(340px, 28vw, 380px);
  }

  .state-node,
  .tf-node {
    min-height: 44px;
  }

  .segment {
    min-width: 78px;
  }
}

@media (min-width: 721px) and (max-width: 1040px) and (pointer: coarse) {
  :root {
    font-size: 16.5px;
  }

  .shell {
    width: min(100% - 28px, 1500px);
  }

  .market-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pulse-panel {
    grid-column: 1 / -1;
  }

  .multi-row {
    grid-template-columns: 48px repeat(5, minmax(58px, 1fr)) minmax(110px, 0.9fr);
    gap: 6px;
  }

  .tf-node {
    min-height: 42px;
    padding-inline: 6px;
    line-height: 1.15;
    white-space: normal;
  }

  .state-network {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .state-node {
    min-height: 44px;
  }

  .state-node::after {
    display: none;
  }

  .life-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow-network {
    min-height: 480px;
  }
}

@media (max-width: 720px) {
  .shell {
    width: calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right));
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }

  .status-cluster {
    justify-content: flex-start;
    width: 100%;
  }

  .price {
    font-size: clamp(2.15rem, 11vw, 2.6rem);
  }

  .multi-panel {
    padding-inline: 12px;
  }

  .multi-row {
    grid-template-columns: 38px repeat(5, minmax(0, 1fr));
    gap: 5px;
  }

  .multi-row > strong {
    font-size: 0.78rem;
  }

  .tf-node {
    min-height: 40px;
    padding: 4px 3px;
    font-size: 0.62rem;
    line-height: 1.12;
    white-space: normal;
  }

  .resonance-cell {
    grid-column: 2 / -1;
  }

  .life-stage-line {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow-core {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .core-sphere {
    width: 86px;
  }

  .state-node {
    min-height: 44px;
    padding-inline: 8px;
  }

  .chart-readout {
    left: 10px;
    right: 10px;
    max-width: none;
  }

  .perf-status {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    text-align: center;
  }
}
