:root {
  --bg: #070b0f;
  --bg-2: #0a1117;
  --panel: rgba(9, 18, 24, 0.78);
  --panel-strong: rgba(11, 24, 32, 0.92);
  --line: rgba(88, 224, 233, 0.26);
  --line-strong: rgba(117, 240, 245, 0.62);
  --text: #e7fbff;
  --muted: #91a7ad;
  --subtle: #5d7379;
  --cyan: #63f4ff;
  --teal: #1fcfb8;
  --amber: #ffb84c;
  --red: #ff5d66;
  --green: #7df28f;
  --steel: #9eb6bd;
  --shadow: 0 20px 70px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 42%, rgba(18, 71, 74, 0.42), transparent 34%),
    linear-gradient(135deg, #050708 0%, #091319 52%, #040607 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(99, 244, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 244, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at center, black 0%, black 58%, transparent 88%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgba(99, 244, 255, 0.035), transparent);
  background-size: 100% 7px;
  opacity: 0.38;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: relative;
  display: grid;
  grid-template-rows: 58px minmax(0, 1fr);
  height: 100vh;
  padding: 14px 18px;
  overflow: hidden;
}

#networkCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 58px;
  padding: 8px 14px;
  border: 1px solid rgba(99, 244, 255, 0.22);
  background: linear-gradient(90deg, rgba(6, 15, 20, 0.88), rgba(14, 32, 40, 0.7));
  box-shadow: var(--shadow), inset 0 0 34px rgba(99, 244, 255, 0.04);
  backdrop-filter: blur(18px);
  animation: chromeSlide 700ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.topbar::before,
.readout-panel::before,
.activity-rail::before,
.console-card::before,
.config-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  border: 1px solid rgba(255, 184, 76, 0.16);
  clip-path: polygon(0 0, 78px 0, 78px 2px, 2px 2px, 2px 56px, 0 56px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(99, 244, 255, 0.34), inset 0 0 18px rgba(99, 244, 255, 0.18);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(99, 244, 255, 0.6);
}

.brand-mark::before {
  inset: 6px;
}

.brand-mark::after {
  inset: 13px;
  background: var(--cyan);
  box-shadow: 0 0 16px var(--cyan);
}

.brand-mark span {
  inset: 2px;
  border-color: rgba(255, 184, 76, 0.38);
  border-left-color: transparent;
  animation: spin 9s linear infinite;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.02;
  letter-spacing: 0;
}

.topbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(125, 242, 143, 0.34);
  color: var(--green);
  background: rgba(26, 84, 42, 0.18);
}

.command-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(236px, 286px) minmax(560px, 1fr) minmax(244px, 304px);
  grid-template-rows: minmax(0, 1fr) 118px;
  gap: 14px;
  min-height: 0;
  padding-top: 14px;
}

.readout-panel,
.activity-rail,
.console-card,
.config-card {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow), inset 0 0 48px rgba(99, 244, 255, 0.04);
  backdrop-filter: blur(18px);
}

.readout-panel {
  align-self: stretch;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
  animation: panelLift 680ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.left-panel {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.network-stage {
  grid-column: 2;
  grid-row: 1;
}

.right-panel {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.panel-heading,
.rail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(99, 244, 255, 0.14);
}

.panel-heading > div {
  display: grid;
  gap: 4px;
}

.panel-heading span,
.rail-title span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.panel-heading b,
.rail-title b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.small-action,
.secondary-action {
  min-height: 30px;
  border: 1px solid rgba(99, 244, 255, 0.28);
  background: rgba(99, 244, 255, 0.08);
  color: var(--text);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.signal-list {
  display: grid;
  grid-auto-rows: minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  padding-top: 10px;
  overflow: hidden;
}

.signal-card {
  position: relative;
  min-height: 0;
  padding: 9px 10px;
  border: 1px solid rgba(99, 244, 255, 0.16);
  background: linear-gradient(135deg, rgba(10, 24, 31, 0.86), rgba(13, 33, 37, 0.48));
  overflow: hidden;
  animation: cardIn 560ms cubic-bezier(0.19, 1, 0.22, 1) both;
  animation-delay: calc(var(--i, 0) * 58ms);
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease, background 220ms ease;
}

.signal-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent, var(--cyan)) 55%, transparent);
  background: linear-gradient(135deg, rgba(12, 35, 42, 0.94), rgba(11, 26, 32, 0.7));
  box-shadow: 0 0 22px color-mix(in srgb, var(--accent, var(--cyan)) 18%, transparent);
}

.signal-card::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 2px;
  background: var(--accent, var(--cyan));
  box-shadow: 0 0 12px var(--accent, var(--cyan));
}

.signal-card h3 {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0;
}

.signal-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--cyan);
  font-size: 21px;
  font-weight: 900;
}

.signal-value span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.signal-card p {
  display: -webkit-box;
  margin: 5px 0 0;
  color: var(--muted);
  overflow: hidden;
  font-size: 12px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.network-stage {
  position: relative;
  min-height: 0;
  overflow: hidden;
  animation: panelLift 760ms cubic-bezier(0.19, 1, 0.22, 1) 90ms both;
}

.network-stage::before,
.network-stage::after {
  content: "";
  position: absolute;
  inset: 7% 9%;
  border: 1px solid rgba(99, 244, 255, 0.14);
  border-radius: 50%;
  transform: rotate(-8deg);
  animation: orbitalDrift 28s linear infinite;
}

.network-stage::after {
  inset: 15% 18%;
  border-color: rgba(255, 184, 76, 0.18);
  transform: rotate(18deg);
  animation-duration: 36s;
  animation-direction: reverse;
}

.orbit-label {
  position: absolute;
  z-index: 2;
  color: rgba(231, 251, 255, 0.48);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.orbit-build {
  top: 18%;
  left: 13%;
}

.orbit-research {
  top: 13%;
  right: 14%;
}

.orbit-content {
  bottom: 19%;
  left: 13%;
}

.orbit-ops {
  right: 13%;
  bottom: 18%;
}

.central-node {
  position: absolute;
  z-index: 4;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 224px;
  height: 224px;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  filter: drop-shadow(0 0 24px rgba(99, 244, 255, 0.2));
  transition: filter 240ms ease, transform 240ms ease;
}

.central-node:hover {
  filter: drop-shadow(0 0 42px rgba(99, 244, 255, 0.34));
  transform: translate(-50%, -50%) scale(1.025);
}

.central-node::before,
.central-node::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.central-node::before {
  inset: 32px;
  background: conic-gradient(from 0deg, transparent, rgba(99, 244, 255, 0.3), transparent 38%, rgba(255, 184, 76, 0.22), transparent 72%);
  filter: blur(1px);
  animation: spin 11s linear infinite;
}

.central-node::after {
  inset: -14px;
  border: 1px solid rgba(99, 244, 255, 0.12);
  animation: coreBreath 3.8s ease-in-out infinite;
}

.central-node:focus-visible,
.agent-node:focus-visible,
.primary-action:focus-visible,
.secondary-action:focus-visible,
.small-action:focus-visible,
.icon-button:focus-visible,
.chat-compose button:focus-visible,
.prompt-chip:focus-visible,
.console-tab:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.reactor-ring {
  position: absolute;
  border-radius: 50%;
}

.ring-a {
  inset: 0;
  border: 2px solid rgba(99, 244, 255, 0.7);
  box-shadow: 0 0 35px rgba(99, 244, 255, 0.38), inset 0 0 50px rgba(99, 244, 255, 0.14);
  animation: spin 22s linear infinite;
}

.ring-b {
  inset: 18px;
  border: 1px dashed rgba(255, 184, 76, 0.72);
  animation: spinReverse 18s linear infinite;
}

.ring-c {
  inset: 45px;
  border: 1px solid rgba(31, 207, 184, 0.72);
  background:
    radial-gradient(circle, rgba(99, 244, 255, 0.3) 0%, transparent 44%),
    conic-gradient(from 40deg, transparent, rgba(99, 244, 255, 0.42), transparent, rgba(255, 184, 76, 0.36), transparent);
  box-shadow: inset 0 0 50px rgba(99, 244, 255, 0.18);
  animation: spin 16s linear infinite;
}

.core-label {
  position: relative;
  z-index: 5;
  display: grid;
  gap: 4px;
  text-align: center;
  animation: coreTextBreath 4s ease-in-out infinite;
}

.core-label span {
  color: var(--cyan);
  font-size: 36px;
  font-weight: 950;
  letter-spacing: 0;
  text-shadow: 0 0 18px rgba(99, 244, 255, 0.55);
}

.core-label b {
  color: var(--text);
  font-size: 13px;
  text-transform: uppercase;
}

.core-label em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.agent-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.agent-node {
  position: absolute;
  width: 144px;
  height: 106px;
  padding: 9px 11px;
  border: 1px solid rgba(99, 244, 255, 0.28);
  background: rgba(7, 17, 22, 0.8);
  box-shadow: 0 0 24px rgba(99, 244, 255, 0.1), inset 0 0 22px rgba(99, 244, 255, 0.04);
  color: var(--text);
  text-align: left;
  transform: translate(-50%, -50%);
  animation: nodeArrive 620ms cubic-bezier(0.19, 1, 0.22, 1) both, nodeIdle 4.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 48ms), calc(var(--i, 0) * -420ms);
  transition: transform 260ms cubic-bezier(0.19, 1, 0.22, 1), border-color 260ms ease, background 260ms ease, box-shadow 260ms ease;
}

.agent-node:hover,
.agent-node.active {
  transform: translate(-50%, -50%) scale(1.055);
  border-color: var(--accent, var(--cyan));
  background: rgba(9, 29, 34, 0.95);
  box-shadow: 0 0 30px rgba(99, 244, 255, 0.23), inset 0 0 26px rgba(99, 244, 255, 0.08);
}

.agent-node::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent, var(--cyan));
  box-shadow: 0 0 14px var(--accent, var(--cyan));
}

.agent-node.working::after {
  content: "";
  position: absolute;
  inset: -6px;
  border: 1px solid color-mix(in srgb, var(--accent, var(--cyan)) 70%, transparent);
  opacity: 0.55;
  animation: nodePulse 2.4s ease-in-out infinite;
}

.agent-node h3 {
  margin: 0 0 4px;
  padding-left: 16px;
  font-size: 14px;
  letter-spacing: 0;
}

.agent-node p {
  display: -webkit-box;
  margin: 0;
  color: var(--muted);
  overflow: hidden;
  font-size: 11px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.node-status {
  display: inline-flex;
  margin-top: 8px;
  color: var(--accent, var(--cyan));
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.agent-inspector {
  display: grid;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
  padding-top: 10px;
}

.agent-inspector > * {
  animation: inspectorIn 520ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.agent-inspector > *:nth-child(2) {
  animation-delay: 35ms;
}

.agent-inspector > *:nth-child(3) {
  animation-delay: 70ms;
}

.agent-inspector > *:nth-child(4) {
  animation-delay: 105ms;
}

.agent-inspector > *:nth-child(5) {
  animation-delay: 140ms;
}

.inspector-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inspector-title h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.05;
}

.agent-badge {
  color: var(--accent, var(--cyan));
  border: 1px solid color-mix(in srgb, var(--accent, var(--cyan)) 42%, transparent);
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.inspector-copy {
  display: -webkit-box;
  color: var(--muted);
  overflow: hidden;
  font-size: 13px;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mini-stat {
  min-height: 62px;
  padding: 9px;
  border: 1px solid rgba(99, 244, 255, 0.14);
  background: rgba(4, 10, 13, 0.42);
}

.mini-stat span {
  display: block;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.mini-stat b {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
}

.capability-list {
  display: grid;
  gap: 6px;
}

.capability-list span {
  display: block;
  padding: 7px 9px;
  border-left: 2px solid var(--accent, var(--cyan));
  color: var(--steel);
  background: rgba(99, 244, 255, 0.06);
  font-size: 12px;
}

.primary-action {
  width: 100%;
  min-height: 42px;
  margin-top: 12px;
  border: 1px solid rgba(99, 244, 255, 0.46);
  background: linear-gradient(90deg, rgba(18, 161, 176, 0.36), rgba(255, 184, 76, 0.22));
  color: var(--text);
  font-weight: 900;
  text-transform: uppercase;
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease, background 220ms ease;
}

.primary-action:hover,
.small-action:hover,
.secondary-action:hover,
.icon-button:hover,
.console-tab:hover,
.prompt-chip:hover,
.chat-compose button:hover {
  transform: translateY(-1px);
  border-color: rgba(99, 244, 255, 0.62);
  box-shadow: 0 0 22px rgba(99, 244, 255, 0.16);
}

.activity-rail {
  position: relative;
  z-index: 3;
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
  margin-top: 0;
  padding: 11px 12px;
  animation: panelLift 720ms cubic-bezier(0.19, 1, 0.22, 1) 150ms both;
}

.rail-title {
  display: block;
  padding: 0 12px 0 0;
  border-right: 1px solid rgba(99, 244, 255, 0.18);
  border-bottom: 0;
}

.rail-title b {
  display: block;
  margin-top: 8px;
  text-align: left;
}

.activity-stream {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(190px, 1fr);
  gap: 8px;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.activity-item {
  min-height: 0;
  padding: 9px 10px;
  border: 1px solid rgba(99, 244, 255, 0.14);
  background: rgba(8, 19, 25, 0.68);
  animation: cardIn 560ms cubic-bezier(0.19, 1, 0.22, 1) both;
  animation-delay: calc(var(--i, 0) * 50ms + 170ms);
  transition: border-color 220ms ease, box-shadow 220ms ease, transform 220ms ease, background 220ms ease;
}

.activity-item:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent, var(--cyan)) 52%, transparent);
  background: rgba(11, 31, 38, 0.78);
  box-shadow: 0 0 20px color-mix(in srgb, var(--accent, var(--cyan)) 16%, transparent);
}

.activity-item span {
  color: var(--accent, var(--cyan));
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.activity-item b {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  line-height: 1.2;
}

.activity-item p {
  display: -webkit-box;
  margin: 5px 0 0;
  color: var(--muted);
  overflow: hidden;
  font-size: 11px;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.console-drawer,
.config-drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  background: rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 320ms ease, visibility 320ms ease, backdrop-filter 320ms ease;
}

.console-drawer.open,
.config-drawer.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  backdrop-filter: blur(8px);
}

.console-card,
.config-card {
  position: relative;
  width: min(920px, 100vw);
  min-height: 100vh;
  padding: 18px;
  background: var(--panel-strong);
  border-right: 0;
  overflow-x: hidden;
  overflow-y: auto;
  transform: translateX(34px) scale(0.985);
  opacity: 0.4;
  transition: transform 420ms cubic-bezier(0.19, 1, 0.22, 1), opacity 320ms ease, box-shadow 320ms ease;
}

.config-card {
  width: min(760px, 100vw);
}

.console-drawer.open .console-card,
.config-drawer.open .config-card {
  transform: translateX(0) scale(1);
  opacity: 1;
  box-shadow: -28px 0 90px rgba(0, 0, 0, 0.48), inset 0 0 48px rgba(99, 244, 255, 0.06);
}

.console-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(99, 244, 255, 0.16);
}

.console-head h2 {
  margin: 0 0 4px;
  font-size: 28px;
}

.console-head span {
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(99, 244, 255, 0.22);
  background: rgba(99, 244, 255, 0.06);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.demo-warning {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 184, 76, 0.32);
  color: #ffe0a8;
  background: rgba(255, 184, 76, 0.08);
  font-size: 13px;
  line-height: 1.4;
}

.console-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  animation: inspectorIn 460ms cubic-bezier(0.19, 1, 0.22, 1) 80ms both;
}

.console-tab {
  min-height: 36px;
  border: 1px solid rgba(99, 244, 255, 0.18);
  background: rgba(99, 244, 255, 0.06);
  color: var(--muted);
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease, background 200ms ease, color 200ms ease;
}

.console-tab.active {
  color: var(--text);
  border-color: rgba(99, 244, 255, 0.52);
  background: rgba(99, 244, 255, 0.16);
  box-shadow: inset 0 0 22px rgba(99, 244, 255, 0.08);
}

.console-body {
  margin-top: 14px;
  animation: consoleBodyIn 360ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.prompt-chip {
  border: 1px solid rgba(99, 244, 255, 0.2);
  background: rgba(99, 244, 255, 0.07);
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

.chat-log {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 360px);
  margin-top: 16px;
  overflow: auto;
  padding-right: 4px;
}

.console-list {
  display: grid;
  gap: 10px;
}

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

.console-row,
.config-row {
  position: relative;
  padding: 12px;
  border: 1px solid rgba(99, 244, 255, 0.14);
  background: rgba(8, 19, 25, 0.68);
  animation: cardIn 480ms cubic-bezier(0.19, 1, 0.22, 1) both;
  transition: transform 220ms ease, border-color 220ms ease, background 220ms ease, box-shadow 220ms ease;
}

.console-row:hover,
.config-row:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent, var(--cyan)) 44%, transparent);
  background: rgba(10, 28, 35, 0.78);
  box-shadow: 0 0 18px rgba(99, 244, 255, 0.12);
}

.console-row::before,
.config-row::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 2px;
  background: var(--accent, var(--cyan));
  box-shadow: 0 0 12px var(--accent, var(--cyan));
}

.console-row span,
.metric-select span {
  display: block;
  color: var(--subtle);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.console-row b {
  display: block;
  max-width: calc(100% - 42px);
  margin-top: 6px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.3;
}

.console-row p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.console-row code {
  display: block;
  margin-top: 8px;
  color: var(--cyan);
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  word-break: break-word;
}

.task-row span {
  color: var(--accent, var(--cyan));
}

.config-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.config-list .config-row:nth-child(2),
.console-list .console-row:nth-child(2) {
  animation-delay: 45ms;
}

.config-list .config-row:nth-child(3),
.console-list .console-row:nth-child(3) {
  animation-delay: 90ms;
}

.config-list .config-row:nth-child(4),
.console-list .console-row:nth-child(4) {
  animation-delay: 135ms;
}

.config-list .config-row:nth-child(n + 5),
.console-list .console-row:nth-child(n + 5) {
  animation-delay: 180ms;
}

.config-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 240px);
  gap: 14px;
  align-items: center;
}

.toggle-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.toggle-row input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--cyan);
}

.toggle-row b {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.toggle-row em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.metric-select select {
  width: 100%;
  min-height: 38px;
  margin-top: 6px;
  border: 1px solid rgba(99, 244, 255, 0.24);
  background: #08141a;
  color: var(--text);
  padding: 7px 9px;
}

.config-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.config-actions .primary-action,
.config-actions .secondary-action {
  width: auto;
  min-width: 150px;
  margin-top: 0;
}

.message {
  width: fit-content;
  max-width: 92%;
  padding: 11px 12px;
  border: 1px solid rgba(99, 244, 255, 0.14);
  background: rgba(99, 244, 255, 0.06);
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  animation: messageIn 260ms cubic-bezier(0.19, 1, 0.22, 1) both;
}

.message.user {
  justify-self: end;
  border-color: rgba(255, 184, 76, 0.28);
  background: rgba(255, 184, 76, 0.1);
}

.message.agent {
  justify-self: start;
}

.chat-compose {
  display: grid;
  grid-template-columns: 1fr 88px;
  gap: 8px;
  margin-top: 16px;
}

.chat-compose input {
  min-width: 0;
  height: 44px;
  border: 1px solid rgba(99, 244, 255, 0.24);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.chat-compose button {
  border: 1px solid rgba(99, 244, 255, 0.38);
  background: rgba(99, 244, 255, 0.14);
  color: var(--text);
  font-weight: 900;
  transition: transform 200ms ease, border-color 200ms ease, box-shadow 200ms ease, background 200ms ease;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes spinReverse {
  to {
    transform: rotate(-360deg);
  }
}

@keyframes chromeSlide {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panelLift {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes inspectorIn {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes consoleBodyIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes nodeArrive {
  from {
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes nodeIdle {
  0%,
  100% {
    box-shadow: 0 0 24px rgba(99, 244, 255, 0.1), inset 0 0 22px rgba(99, 244, 255, 0.04);
  }
  50% {
    box-shadow: 0 0 30px rgba(99, 244, 255, 0.17), inset 0 0 28px rgba(99, 244, 255, 0.065);
  }
}

@keyframes coreBreath {
  0%,
  100% {
    opacity: 0.18;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.54;
    transform: scale(1.05);
  }
}

@keyframes coreTextBreath {
  0%,
  100% {
    transform: scale(1);
    text-shadow: 0 0 18px rgba(99, 244, 255, 0.55);
  }
  50% {
    transform: scale(1.018);
    text-shadow: 0 0 26px rgba(99, 244, 255, 0.72);
  }
}

@keyframes orbitalDrift {
  to {
    rotate: 360deg;
  }
}

@keyframes nodePulse {
  0%,
  100% {
    opacity: 0.18;
    transform: scale(0.99);
  }
  50% {
    opacity: 0.62;
    transform: scale(1.08);
  }
}

@media (max-width: 1180px) {
  html,
  body {
    height: auto;
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-shell {
    display: block;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .command-grid {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    min-height: calc(100vh - 100px);
  }

  .readout-panel {
    align-self: auto;
  }

  .left-panel {
    grid-column: auto;
    grid-row: auto;
    order: 2;
  }

  .network-stage {
    grid-column: auto;
    grid-row: auto;
    order: 1;
    min-height: 640px;
  }

  .right-panel {
    grid-column: auto;
    grid-row: auto;
    order: 3;
  }

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

  .right-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 16px;
  }

  .right-panel .panel-heading {
    grid-column: 1 / -1;
  }

  .primary-action {
    align-self: start;
    margin-top: 14px;
  }

  .activity-rail {
    grid-column: auto;
    grid-row: auto;
    order: 4;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

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

  .topbar-meta {
    justify-content: flex-start;
  }

  .network-stage {
    min-height: 760px;
  }

  .central-node {
    width: 184px;
    height: 184px;
  }

  .core-label span {
    font-size: 28px;
  }

  .agent-node {
    width: 132px;
    min-height: 82px;
    padding: 9px;
  }

  .agent-node h3 {
    font-size: 13px;
  }

  .agent-node p {
    font-size: 11px;
  }

  .signal-list,
  .mini-grid,
  .right-panel,
  .skill-grid,
  .config-row {
    grid-template-columns: 1fr;
  }

  .activity-rail {
    grid-template-columns: 1fr;
  }

  .rail-title {
    border-right: 0;
    border-bottom: 1px solid rgba(99, 244, 255, 0.18);
    padding: 0 0 10px;
  }

  .activity-stream {
    grid-auto-flow: row;
  }

  .chat-compose {
    grid-template-columns: 1fr;
  }

  .console-card,
  .config-card {
    width: 100vw;
    padding: 14px;
  }

  .config-actions {
    flex-direction: column;
  }

  .config-actions .primary-action,
  .config-actions .secondary-action {
    width: 100%;
  }
}
