:root {
  --bg-1: #04080f;
  --bg-2: #081423;
  --panel: rgba(8, 18, 31, 0.88);
  --panel-strong: rgba(6, 15, 26, 0.98);
  --line: rgba(112, 154, 189, 0.18);
  --line-strong: rgba(118, 203, 255, 0.48);
  --text: #eff8ff;
  --muted: #9cb6c8;
  --brand: #77d1ff;
  --brand-strong: #29a7ff;
  --cyber-cyan: #66f2ff;
  --electric-purple: #9a6dff;
  --success: #6de3b2;
  --warning: #ffd36c;
  --danger: #ff7787;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Manrope", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 14% 16%, rgba(61, 139, 200, 0.24), transparent 18%),
    radial-gradient(circle at 88% 14%, rgba(40, 139, 255, 0.12), transparent 16%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
}

body {
  overflow: auto;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    linear-gradient(rgba(128, 180, 216, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(128, 180, 216, 0.05) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black, transparent 76%);
}

body::after {
  background:
    radial-gradient(circle at 0% 100%, rgba(77, 148, 208, 0.18), transparent 26%),
    radial-gradient(circle at 100% 100%, rgba(17, 71, 133, 0.18), transparent 24%);
}

button,
textarea {
  font: inherit;
}

#app,
.command-center-shell {
  min-height: 100svh;
}

.command-center-shell {
  position: relative;
  width: min(1600px, calc(100% - 28px));
  margin: 0 auto;
  padding: 14px 0;
  display: grid;
  grid-template-rows: auto minmax(620px, auto);
  gap: 14px;
}

.command-header,
.panel,
.workspace-menu {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.command-header {
  position: relative;
  z-index: 12;
  border-radius: 24px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(560px, 0.8fr);
  gap: 18px;
  min-height: 152px;
}

.header-primary {
  position: relative;
  z-index: 15;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 800;
}

.header-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.header-title-row h1,
.panel-head h2,
.terminal-topbar h2 {
  margin: 0;
}

.header-title-row h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.7rem, 3vw, 2.6rem);
  line-height: 1.03;
}

.header-copy,
.instruction-summary,
.scenario-note span,
.selector-card span,
.workspace-option small,
.log-time,
.terminal-placeholder p {
  color: var(--muted);
}

.header-copy {
  margin: 10px 0 0;
  max-width: 70ch;
  line-height: 1.55;
}

.workspace-trigger,
.ghost-button,
.execute-button,
.workspace-option,
.selector-card,
.terminal-tabs button,
.workspace-close {
  border: 0;
  cursor: pointer;
}

.workspace-trigger,
.ghost-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border: 1px solid rgba(127, 184, 219, 0.16);
}

.workspace-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  width: min(720px, 100%);
  border-radius: 22px;
  padding: 18px;
  z-index: 40;
}

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

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

.workspace-option {
  width: 100%;
  text-align: left;
  padding: 14px 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border: 1px solid rgba(127, 184, 219, 0.12);
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.workspace-option span {
  display: block;
  font-weight: 800;
}

.workspace-option small {
  display: block;
  margin-top: 6px;
  line-height: 1.45;
}

.workspace-option:hover,
.workspace-option.active {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px rgba(119, 209, 255, 0.18), 0 18px 36px rgba(0, 0, 0, 0.24);
}

.workspace-close {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.mini-stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-self: stretch;
}

.mini-stat-card {
  min-height: 100%;
  border-radius: 18px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(127, 184, 219, 0.12);
}

.mini-stat-card span,
.console-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.mini-stat-card strong {
  display: block;
  margin-top: 12px;
  font-size: clamp(1.45rem, 2vw, 2rem);
  font-family: "Space Grotesk", sans-serif;
}

.action-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 20%) minmax(460px, 40%) minmax(460px, 40%);
  gap: 14px;
  align-items: start;
}

.orchestration-panel {
  grid-column: 2 / 4;
  position: relative;
  min-height: 0;
  border: 1px solid rgba(132, 164, 216, 0.18);
  border-radius: 24px;
  background:
    radial-gradient(circle at 12% 22%, rgba(102, 242, 255, 0.12), transparent 18%),
    radial-gradient(circle at 56% 18%, rgba(154, 109, 255, 0.14), transparent 22%),
    linear-gradient(180deg, rgba(8, 11, 21, 0.82), rgba(6, 10, 18, 0.9));
  backdrop-filter: blur(22px);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.46), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 18px 20px;
  overflow: hidden;
}

.orchestration-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.orchestration-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.orchestration-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(165, 183, 198, 0.9);
}

.status-dot.idle {
  background: rgba(165, 183, 198, 0.9);
}

.status-dot.success {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(109, 227, 178, 0.12);
}

.status-dot.thinking {
  background: var(--warning);
  box-shadow: 0 0 0 6px rgba(255, 211, 108, 0.12);
}

.orchestration-body {
  position: relative;
  min-height: 260px;
  height: calc(100% - 52px);
  margin-top: 12px;
}

.orchestration-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.orchestration-columns {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 25% 37.5% 37.5%;
  height: 100%;
  gap: 18px;
}

.orchestration-column {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.column-label {
  display: block;
  margin-bottom: 10px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.core-column {
  justify-content: center;
}

.core-node,
.mesh-node {
  position: relative;
  border: 1px solid rgba(163, 196, 255, 0.14);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  backdrop-filter: blur(16px);
}

.core-node {
  min-height: 182px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 22px 16px 18px;
  overflow: hidden;
}

.core-node strong,
.mesh-node strong {
  display: block;
}

.core-node span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.neural-core {
  position: relative;
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
}

.neural-ring,
.neural-sphere,
.core-ripple {
  position: absolute;
  border-radius: 999px;
}

.neural-ring {
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(102, 242, 255, 0.24);
  mix-blend-mode: screen;
}

.ring-a {
  width: 132px;
  height: 132px;
  animation: spinRing 18s linear infinite;
}

.ring-b {
  width: 104px;
  height: 104px;
  border-color: rgba(154, 109, 255, 0.32);
  animation: spinRingReverse 13s linear infinite;
}

.ring-c {
  width: 78px;
  height: 78px;
  border-style: dashed;
  border-color: rgba(102, 242, 255, 0.36);
  animation: spinRing 9s linear infinite;
}

.neural-sphere {
  position: relative;
  width: 64px;
  height: 64px;
  background:
    radial-gradient(circle at 35% 32%, rgba(255, 255, 255, 0.92), rgba(154, 109, 255, 0.55) 24%, rgba(68, 24, 120, 0.88) 58%, rgba(14, 10, 34, 0.96) 100%);
  box-shadow:
    0 0 36px rgba(154, 109, 255, 0.34),
    0 0 72px rgba(102, 242, 255, 0.12),
    inset 0 -10px 24px rgba(0, 0, 0, 0.42);
  animation: sphereFloat 5.2s ease-in-out infinite;
}

.sphere-glow,
.sphere-grid {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.sphere-glow {
  background: radial-gradient(circle at 50% 50%, rgba(102, 242, 255, 0.18), transparent 64%);
}

.sphere-grid {
  background:
    linear-gradient(90deg, transparent 28%, rgba(255, 255, 255, 0.18) 50%, transparent 72%),
    linear-gradient(transparent 28%, rgba(255, 255, 255, 0.12) 50%, transparent 72%);
  opacity: 0.48;
  mix-blend-mode: screen;
}

.core-ripple {
  inset: 50% auto auto 50%;
  width: 84px;
  height: 84px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(102, 242, 255, 0.14);
  opacity: 0;
}

.ripple-one {
  animation: rippleWave 3.4s infinite;
}

.ripple-two {
  animation: rippleWave 3.4s 0.8s infinite;
}

.ripple-three {
  animation: rippleWave 3.4s 1.6s infinite;
}

.tone-thinking .core-ripple {
  border-color: rgba(255, 211, 108, 0.24);
  animation-duration: 1.05s;
}

.tone-success .core-ripple {
  border-color: rgba(109, 227, 178, 0.24);
}

.tone-thinking .neural-sphere {
  animation-duration: 2.4s;
}

.tone-thinking .ring-a,
.tone-thinking .ring-b,
.tone-thinking .ring-c {
  animation-duration: 7s;
}

.tone-success .neural-sphere {
  box-shadow:
    0 0 28px rgba(109, 227, 178, 0.28),
    0 0 56px rgba(102, 242, 255, 0.12),
    inset 0 -10px 24px rgba(0, 0, 0, 0.42);
}

@keyframes rippleWave {
  0% { transform: translate(-50%, -50%) scale(0.72); opacity: 0.76; }
  100% { transform: translate(-50%, -50%) scale(2.12); opacity: 0; }
}

@keyframes spinRing {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spinRingReverse {
  to { transform: translate(-50%, -50%) rotate(-360deg); }
}

@keyframes sphereFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-6px) scale(1.04); }
}

.node-stack {
  min-height: 0;
  height: 100%;
  display: grid;
  gap: 10px;
  align-content: center;
}

.mesh-node {
  min-height: 58px;
  border-radius: 18px;
  padding: 12px 14px 11px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mesh-node .node-led {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(165, 183, 198, 0.7);
  flex-shrink: 0;
}

.node-copy {
  min-width: 0;
  flex: 1;
}

.node-copy small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.node-sparkline {
  width: 84px;
  height: 24px;
  flex-shrink: 0;
}

.node-sparkline polyline {
  fill: none;
  stroke: rgba(102, 242, 255, 0.34);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mesh-node.active.success,
.core-node.success {
  border-color: rgba(109, 227, 178, 0.42);
  box-shadow: 0 0 0 1px rgba(109, 227, 178, 0.18), 0 0 32px rgba(109, 227, 178, 0.12);
}

.mesh-node.active.success .node-led {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(109, 227, 178, 0.12);
}

.mesh-node.active.success .node-sparkline polyline {
  stroke: rgba(109, 227, 178, 0.92);
}

.mesh-node.active.thinking,
.core-node.thinking {
  border-color: rgba(102, 242, 255, 0.38);
  box-shadow: 0 0 0 1px rgba(102, 242, 255, 0.14), 0 0 28px rgba(154, 109, 255, 0.18);
}

.mesh-node.active.thinking .node-led {
  background: var(--warning);
  box-shadow: 0 0 0 6px rgba(255, 211, 108, 0.12);
}

.mesh-node.active.thinking .node-sparkline polyline {
  stroke: rgba(102, 242, 255, 0.94);
  animation: sparkFlicker 1s linear infinite;
}

.adapter-node.handshake {
  animation: handshakeGlow 1.1s ease-in-out;
}

.orchestration-line {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 8 10;
  opacity: 0.86;
  filter: drop-shadow(0 0 8px rgba(102, 242, 255, 0.18));
  animation: dashFlow 8s linear infinite;
}

.orchestration-line.idle {
  stroke: rgba(127, 184, 219, 0.24);
}

.orchestration-line.thinking {
  stroke: rgba(102, 242, 255, 0.96);
}

.orchestration-line.success {
  stroke: rgba(109, 227, 178, 0.9);
}

@keyframes dashFlow {
  to { stroke-dashoffset: -200; }
}

.data-packet {
  opacity: 0.95;
}

.data-packet.thinking {
  fill: var(--cyber-cyan);
}

.data-packet.success {
  fill: var(--success);
}

@keyframes sparkFlicker {
  0%, 100% { opacity: 0.9; }
  50% { opacity: 0.45; }
}

@keyframes handshakeGlow {
  0% { box-shadow: 0 0 0 rgba(109, 227, 178, 0); }
  50% { box-shadow: 0 0 0 1px rgba(109, 227, 178, 0.22), 0 0 28px rgba(109, 227, 178, 0.22); }
  100% { box-shadow: 0 0 0 rgba(109, 227, 178, 0); }
}

.panel {
  min-height: 0;
  border-radius: 24px;
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.panel-head,
.terminal-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

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

.selector-panel {
  grid-row: 1 / span 2;
  overflow: hidden;
}

.selector-list {
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 10px;
  padding-right: 4px;
}

.selector-card {
  width: 100%;
  text-align: left;
  padding: 13px 14px;
  border-radius: 16px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(127, 184, 219, 0.12);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.selector-card strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
}

.selector-card span {
  display: block;
  margin-top: 5px;
  font-size: 0.78rem;
}

.term-note {
  margin-left: 0.28rem;
  font-size: 0.72em;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.orchestration-body {
  min-height: 560px;
  height: auto;
  margin-top: 12px;
}

.orchestration-map {
  position: relative;
  min-height: 560px;
  height: 560px;
  overflow: hidden;
}

.map-label {
  position: absolute;
  top: 10px;
  z-index: 4;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(196, 212, 235, 0.64);
}

.map-label-left {
  left: 24px;
}

.map-label-center {
  left: 50%;
  transform: translateX(-50%);
}

.map-label-right {
  right: 24px;
}

.orchestration-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: visible;
}

.orchestration-line {
  fill: none;
  stroke-linecap: round;
  transition: opacity 0.25s ease, stroke 0.25s ease, filter 0.25s ease;
}

.orchestration-line.ghost {
  stroke: rgba(118, 147, 190, 0.16);
  stroke-width: 2;
  opacity: 0.12;
}

.orchestration-line.ghost.inactive {
  opacity: 0.08;
}

.orchestration-line.active {
  stroke-width: 3.2;
  stroke-dasharray: 14 11;
  opacity: 0.12;
}

.orchestration-line.active.idle {
  stroke: rgba(133, 162, 199, 0.22);
}

.orchestration-line.active.engaged.thinking {
  stroke: rgba(102, 242, 255, 0.94);
  opacity: 1;
  filter: drop-shadow(0 0 8px rgba(102, 242, 255, 0.34));
  animation: neonFlow 1.8s linear infinite;
}

.orchestration-line.active.engaged.success {
  stroke: rgba(109, 227, 178, 0.94);
  opacity: 1;
  filter: drop-shadow(0 0 10px rgba(109, 227, 178, 0.3));
  animation: neonFlow 2.4s linear infinite;
}

.data-packet {
  opacity: 0.98;
  filter: drop-shadow(0 0 6px rgba(102, 242, 255, 0.55));
}

.data-packet.thinking {
  fill: var(--cyber-cyan);
}

.data-packet.success {
  fill: var(--success);
  filter: drop-shadow(0 0 6px rgba(109, 227, 178, 0.56));
}

.brain-node,
.map-node-card {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 3;
  backdrop-filter: blur(16px);
}

.brain-node {
  width: 232px;
  min-height: 232px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 20px;
  border: 1px solid rgba(156, 175, 215, 0.2);
  background:
    radial-gradient(circle at 35% 28%, rgba(154, 109, 255, 0.18), transparent 36%),
    radial-gradient(circle at 62% 68%, rgba(102, 242, 255, 0.12), transparent 32%),
    rgba(15, 19, 34, 0.58);
  box-shadow:
    0 24px 52px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.brain-node::before,
.map-node-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(102, 242, 255, 0.62), rgba(154, 109, 255, 0.48), rgba(109, 227, 178, 0.18));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.55;
  pointer-events: none;
}

.brain-node strong {
  display: block;
  margin-top: 10px;
  font-size: 0.95rem;
}

.brain-node span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.78rem;
}

.brain-ripple {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 104px;
  height: 104px;
  border-radius: 999px;
  transform: translate(-50%, -50%) scale(0.72);
  border: 1px solid rgba(102, 242, 255, 0.22);
  opacity: 0;
}

.brain-node.thinking .brain-ripple {
  animation: rippleWave 1.15s infinite;
}

.brain-node.success .brain-ripple {
  border-color: rgba(109, 227, 178, 0.28);
  animation: rippleWave 2.2s infinite;
}

.brain-icon {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  font-size: 1.35rem;
  color: rgba(240, 244, 255, 0.92);
  text-shadow: 0 0 18px rgba(154, 109, 255, 0.44);
}

.brain-node.thinking {
  box-shadow:
    0 0 0 1px rgba(102, 242, 255, 0.18),
    0 0 48px rgba(154, 109, 255, 0.2),
    0 24px 52px rgba(0, 0, 0, 0.36);
}

.brain-node.success {
  box-shadow:
    0 0 0 1px rgba(109, 227, 178, 0.18),
    0 0 42px rgba(109, 227, 178, 0.18),
    0 24px 52px rgba(0, 0, 0, 0.36);
}

.map-node-card {
  width: 188px;
  min-height: 90px;
  padding: 14px 15px;
  border-radius: 24px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  background: rgba(14, 18, 32, 0.48);
  border: 1px solid rgba(132, 164, 216, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 1;
  transition: opacity 0.24s ease, transform 0.24s ease, box-shadow 0.24s ease;
}

.map-node-card.inactive {
  opacity: 0.16;
}

.map-node-card.active {
  opacity: 1;
}

.node-icon-shell {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(102, 242, 255, 0.14), rgba(154, 109, 255, 0.14));
  color: rgba(240, 245, 255, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.node-icon-shell i {
  font-size: 0.95rem;
}

.map-node-card .node-copy {
  min-width: 0;
}

.map-node-card .node-copy strong {
  display: block;
  font-size: 0.82rem;
  line-height: 1.35;
}

.map-node-card .node-copy small {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}

.node-detail {
  margin-top: 8px;
  display: grid;
  gap: 5px;
}

.node-detail p {
  margin: 0;
  font-size: 0.69rem;
  line-height: 1.45;
  color: rgba(219, 232, 245, 0.86);
}

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

.lite-orchestration {
  display: grid;
  gap: 14px;
}

.lite-core {
  border-radius: 22px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(127, 184, 219, 0.12);
}

.lite-core-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(102, 242, 255, 0.08);
  color: #d8f7ff;
  font-weight: 700;
}

.lite-core strong {
  display: block;
  margin-top: 12px;
  font-size: 0.96rem;
}

.lite-core p {
  margin: 10px 0 0;
  font-size: 0.83rem;
  line-height: 1.62;
  color: #dceaf5;
}

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

.lite-card-stack {
  display: grid;
  gap: 10px;
}

.lite-card {
  border-radius: 18px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(127, 184, 219, 0.1);
  opacity: 0.45;
}

.lite-card.active {
  opacity: 1;
}

.lite-card.active.thinking {
  border-color: rgba(102, 242, 255, 0.28);
  box-shadow: 0 0 0 1px rgba(102, 242, 255, 0.08), 0 0 20px rgba(102, 242, 255, 0.1);
}

.lite-card.active.success,
.lite-card.handshake {
  border-color: rgba(109, 227, 178, 0.28);
  box-shadow: 0 0 0 1px rgba(109, 227, 178, 0.08), 0 0 18px rgba(109, 227, 178, 0.1);
}

.lite-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lite-card-head i {
  color: #dff8ff;
}

.lite-card strong {
  font-size: 0.82rem;
}

.lite-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.72rem;
}

.lite-card p {
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.55;
  color: rgba(218, 232, 245, 0.9);
}

.insight-column {
  min-width: 0;
}

.insight-stack {
  display: grid;
  gap: 10px;
}

.insight-card {
  border-radius: 18px;
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(127, 184, 219, 0.1);
}

.insight-card.active {
  border-color: rgba(102, 242, 255, 0.24);
  box-shadow: 0 0 0 1px rgba(102, 242, 255, 0.08);
}

.insight-card strong {
  display: block;
  font-size: 0.82rem;
}

.insight-card p {
  margin: 8px 0 0;
  font-size: 0.75rem;
  line-height: 1.55;
  color: rgba(218, 232, 245, 0.9);
}

.map-node-card .node-sparkline {
  grid-column: 1 / -1;
  width: 100%;
  height: 26px;
}

.map-node-card .node-sparkline polyline {
  fill: none;
  stroke: rgba(102, 242, 255, 0.34);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agent-card.active.thinking {
  animation: processingFlicker 1s linear infinite;
  box-shadow: 0 0 0 1px rgba(102, 242, 255, 0.14), 0 0 28px rgba(102, 242, 255, 0.16);
}

.agent-card.active.success {
  box-shadow: 0 0 0 1px rgba(109, 227, 178, 0.14), 0 0 28px rgba(109, 227, 178, 0.16);
}

.agent-card.active.thinking .node-sparkline polyline {
  stroke: rgba(102, 242, 255, 0.94);
}

.agent-card.active.success .node-sparkline polyline {
  stroke: rgba(109, 227, 178, 0.94);
}

.system-card.active.thinking {
  box-shadow: 0 0 0 1px rgba(102, 242, 255, 0.14), 0 0 22px rgba(102, 242, 255, 0.14);
}

.system-card.active.success,
.system-card.handshake {
  box-shadow: 0 0 0 1px rgba(109, 227, 178, 0.16), 0 0 26px rgba(109, 227, 178, 0.2);
}

.system-card.handshake {
  animation: systemHandshake 1.15s ease-in-out;
}

@keyframes neonFlow {
  to { stroke-dashoffset: -160; }
}

@keyframes processingFlicker {
  0%, 100% { filter: brightness(1); }
  35% { filter: brightness(1.2); }
  60% { filter: brightness(0.92); }
}

@keyframes systemHandshake {
  0% { transform: translate(-50%, -50%) scale(1); }
  35% { transform: translate(-50%, -50%) scale(1.04); }
  70% { transform: translate(-50%, -50%) scale(1.01); }
  100% { transform: translate(-50%, -50%) scale(1); }
}

.selector-card:hover,
.selector-card.active {
  border-color: rgba(119, 209, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(119, 209, 255, 0.34), 0 0 24px rgba(40, 147, 255, 0.2);
  transform: translateX(2px);
}

.instruction-panel {
  min-height: 0;
  gap: 14px;
  overflow: hidden;
}

.state-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.state-badge.ready {
  background: rgba(109, 227, 178, 0.12);
  color: #bdf4d9;
}

.state-badge.running {
  background: rgba(255, 211, 108, 0.12);
  color: #ffe29f;
}

.state-badge.done {
  background: rgba(119, 209, 255, 0.14);
  color: #cbeeff;
}

.instruction-summary {
  margin: 0;
  line-height: 1.55;
}

.system-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.system-chip-row span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(119, 209, 255, 0.1);
  border: 1px solid rgba(119, 209, 255, 0.18);
  color: #d6f2ff;
  font-size: 0.8rem;
  font-weight: 700;
}

.console-label {
  margin-top: 2px;
}

textarea {
  flex: 1 1 auto;
  width: 100%;
  min-height: 140px;
  height: 100%;
  resize: none;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(127, 184, 219, 0.14);
  background: rgba(3, 12, 20, 0.78);
  color: var(--text);
  line-height: 1.65;
  outline: none;
}

textarea:focus {
  border-color: rgba(119, 209, 255, 0.52);
  box-shadow: 0 0 0 1px rgba(119, 209, 255, 0.22);
}

.instruction-footer {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.execute-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: 16px;
  color: #082238;
  font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 18px 30px rgba(34, 125, 184, 0.28);
}

.execute-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.execute-button.pulse {
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 0 0 rgba(119, 209, 255, 0.36), 0 18px 30px rgba(34, 125, 184, 0.28);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(119, 209, 255, 0), 0 18px 30px rgba(34, 125, 184, 0.28);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(119, 209, 255, 0), 0 18px 30px rgba(34, 125, 184, 0.28);
  }
}

.ghost-button {
  min-height: 50px;
}

.scenario-note {
  flex-shrink: 0;
  border-radius: 18px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(127, 184, 219, 0.12);
  max-height: 320px;
  overflow: auto;
}

.scenario-note strong {
  display: block;
  margin-top: 6px;
  line-height: 1.45;
}

.brief-narrative {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.brief-narrative p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.6;
  color: #dceaf5;
}

.terminal-panel {
  background: linear-gradient(180deg, rgba(6, 14, 24, 0.96), rgba(4, 11, 19, 0.98));
}

.terminal-tabs {
  display: inline-flex;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.terminal-tabs button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.terminal-tabs button.active {
  background: rgba(119, 209, 255, 0.14);
  color: var(--text);
}

.progress-block {
  margin-top: 14px;
}

.progress-label-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.88rem;
}

.progress-label-row span {
  color: var(--muted);
}

.progress-track {
  margin-top: 8px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #57c3ff, #8be7c6);
  transition: width 0.22s ease;
}

.terminal-stage {
  min-height: 0;
  margin-top: 14px;
  flex: 1;
  border-radius: 18px;
  background: rgba(1, 7, 13, 0.88);
  border: 1px solid rgba(127, 184, 219, 0.12);
  overflow: hidden;
}

.terminal-log-view,
.terminal-payload-view {
  height: 100%;
  overflow: auto;
  padding: 14px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.terminal-placeholder {
  min-height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  text-align: center;
}

.terminal-placeholder i {
  font-size: 1.4rem;
  color: var(--brand);
}

.log-line {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(127, 184, 219, 0.08);
  font-size: 0.88rem;
}

.log-line.live .log-time {
  color: var(--brand);
}

.log-text {
  color: #e6f4ff;
  line-height: 1.6;
}

.typing::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 1em;
  margin-left: 4px;
  vertical-align: -2px;
  background: var(--brand);
  animation: blink 0.9s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

.json-output {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.62;
  font-size: 0.88rem;
}

.json-key { color: #7fd9ff; }
.json-string { color: #c9f7b0; }
.json-number { color: #ffc982; }
.json-boolean { color: #ff9eb2; }
.json-null { color: #a5b7c6; }

@media (max-width: 1320px) {
  body {
    overflow: auto;
  }

  .command-center-shell {
    height: auto;
    min-height: 100svh;
    grid-template-rows: auto auto;
  }

  .command-header {
    grid-template-columns: 1fr;
  }

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

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

  .selector-panel,
  .orchestration-panel {
    grid-row: auto;
    grid-column: auto;
  }

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

  .orchestration-body {
    height: auto;
    min-height: 680px;
  }

  .orchestration-map {
    height: 680px;
    min-height: 680px;
  }

  .orchestration-insights {
    grid-template-columns: 1fr;
  }

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

  .selector-panel,
  .terminal-stage,
  .selector-list {
    min-height: 320px;
  }
}

@media (max-width: 720px) {
  .command-center-shell {
    width: min(100% - 20px, 100%);
    padding: 10px 0 16px;
  }

  .command-header,
  .panel {
    border-radius: 20px;
    padding: 16px;
  }

  .workspace-grid,
  .mini-stats-row {
    grid-template-columns: 1fr;
  }

  .header-title-row,
  .panel-head,
  .terminal-topbar,
  .instruction-footer,
  .orchestration-header {
    flex-direction: column;
    align-items: stretch;
  }

  textarea {
    min-height: 220px;
  }

  .orchestration-body,
  .orchestration-map {
    min-height: 780px;
    height: 780px;
  }

  .orchestration-insights {
    grid-template-columns: 1fr;
  }

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

  .brain-node {
    width: 204px;
    min-height: 204px;
  }

  .map-node-card {
    width: 160px;
    min-height: 84px;
    padding: 12px;
  }

  .map-label {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }
}
