:root {
  color-scheme: dark;
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  color: #ece9ff;
  background: #050410;

  --space-0: #050410;
  --space-1: #0a0818;
  --space-2: #0e0c20;
  --space-3: #141130;
  --space-4: #1b1742;
  --glass: rgba(20, 17, 48, 0.58);
  --glass-strong: rgba(17, 14, 40, 0.88);
  --glass-2: rgba(28, 24, 64, 0.58);
  --line: rgba(150, 140, 255, 0.12);
  --line-2: rgba(150, 140, 255, 0.2);
  --line-3: rgba(150, 140, 255, 0.34);
  --tx: #ece9ff;
  --tx-2: #aaa5d5;
  --tx-3: #706b9b;
  --blue: #4f7cff;
  --cyan: #34d6f5;
  --purple: #b557f6;
  --mid: #7c6cff;
  --green: #3ddc97;
  --yellow: #fbbf24;
  --red: #fb7185;
  --orange: #fb923c;
  --idle: #6b6796;
  --gradient: linear-gradient(120deg, var(--blue), var(--purple));
  --gradient-soft: linear-gradient(
    120deg,
    rgba(79, 124, 255, 0.18),
    rgba(181, 87, 246, 0.18)
  );
  --radius: 14px;
  --radius-sm: 10px;
  --focus: 0 0 0 3px rgba(79, 124, 255, 0.32);
  --shadow: 0 24px 70px rgba(2, 1, 12, 0.36);
}

* {
  box-sizing: border-box;
}

html,
body,
#root {
  width: 100%;
  min-width: 1100px;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 59% 18%, rgba(79, 124, 255, 0.12), transparent 34%),
    radial-gradient(circle at 93% 14%, rgba(181, 87, 246, 0.15), transparent 30%),
    radial-gradient(circle at 34% 78%, rgba(52, 214, 245, 0.06), transparent 30%),
    var(--space-0);
  color: var(--tx);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  box-shadow: var(--focus);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.46;
}

.prototype-root {
  width: 100%;
  height: 100%;
}

.app-shell {
  display: grid;
  grid-template-columns: 214px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  min-height: 720px;
}

.application {
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr);
  min-width: 0;
  height: 100%;
  background:
    radial-gradient(circle at 16% 8%, rgba(79, 124, 255, 0.06), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(181, 87, 246, 0.08), transparent 34%);
}

.sidebar {
  position: relative;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 10px 12px;
  border-right: 1px solid var(--line);
  background: rgba(5, 4, 16, 0.9);
  box-shadow: 18px 0 55px rgba(2, 1, 12, 0.2);
  backdrop-filter: blur(20px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  padding: 0 8px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(181, 87, 246, 0.44);
  border-radius: 11px;
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 0 28px rgba(124, 108, 255, 0.55);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 17px;
  letter-spacing: 0.11em;
}

.brand small {
  margin-top: 2px;
  color: var(--tx-3);
  font-size: 11px;
}

.navigation {
  flex: 1;
  min-height: 0;
  margin-top: 14px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 108, 255, 0.3) transparent;
}

.nav-group + .nav-group {
  margin-top: 11px;
}

.nav-group h2,
.eyebrow {
  margin: 0;
  color: #8f89c4;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.13em;
  line-height: 1.4;
  text-transform: uppercase;
}

.nav-group h2 {
  padding: 0 9px 5px;
}

.nav-list {
  display: grid;
  gap: 3px;
}

.nav-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 36px;
  padding: 6px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--tx-2);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease;
}

.nav-item:hover {
  border-color: var(--line);
  background: rgba(124, 108, 255, 0.06);
  color: var(--tx);
}

.nav-item.is-active {
  border-color: rgba(124, 108, 255, 0.34);
  background: linear-gradient(
    110deg,
    rgba(79, 124, 255, 0.18),
    rgba(181, 87, 246, 0.18)
  );
  color: #fff;
  box-shadow: inset 3px 0 0 var(--blue);
}

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(107, 103, 150, 0.1);
  color: var(--tx-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
}

.nav-count.has-items {
  border-color: rgba(251, 113, 133, 0.25);
  background: rgba(251, 113, 133, 0.1);
  color: var(--red);
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.owner {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--tx);
  text-align: left;
  cursor: pointer;
}

.owner:hover {
  border-color: var(--line);
  background: rgba(124, 108, 255, 0.06);
}

.owner-avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--glass-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.owner strong,
.owner small {
  display: block;
}

.owner strong {
  font-size: 12px;
}

.owner small {
  margin-top: 2px;
  color: var(--tx-3);
  font-size: 10px;
}

.topbar {
  position: relative;
  z-index: 15;
  display: grid;
  grid-template-columns: minmax(310px, 0.82fr) minmax(420px, 1.18fr) auto;
  align-items: center;
  gap: 18px;
  min-width: 0;
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 6, 23, 0.76);
  backdrop-filter: blur(18px);
}

.run-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.run-identity > span:nth-child(2) {
  min-width: 0;
}

.run-identity small,
.run-identity strong {
  display: block;
}

.run-identity small {
  margin-bottom: 1px;
  color: var(--tx-3);
  font-size: 10px;
}

.run-identity strong {
  overflow: hidden;
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 13px rgba(61, 220, 151, 0.75);
}

.runtime-dot--paused {
  background: var(--yellow);
  box-shadow: 0 0 13px rgba(251, 191, 36, 0.7);
}

.runtime-dot--stopped {
  background: var(--red);
  box-shadow: 0 0 13px rgba(251, 113, 133, 0.7);
}

.run-state {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--green);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.run-state--paused {
  color: var(--yellow);
}

.run-state--stopped {
  color: var(--red);
}

.topbar-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(100px, 1fr));
  gap: 0;
  min-width: 0;
  margin: 0;
}

.topbar-meta > div {
  min-width: 0;
  padding: 0 14px;
  border-left: 1px solid var(--line);
}

.topbar-meta dt {
  color: var(--tx-3);
  font-size: 9px;
}

.topbar-meta dd {
  overflow: hidden;
  margin: 3px 0 0;
  color: var(--tx-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.mock-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(251, 191, 36, 0.24);
  border-radius: 99px;
  background: rgba(251, 191, 36, 0.06);
  color: var(--yellow);
  font-size: 10px;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: rgba(17, 14, 40, 0.72);
  color: var(--tx);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.button:not(:disabled):hover {
  transform: translateY(-1px);
  border-color: var(--line-3);
}

.button--primary {
  border-color: rgba(181, 87, 246, 0.52);
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 0 24px -6px rgba(181, 87, 246, 0.72);
}

.button--secondary:hover {
  background: rgba(124, 108, 255, 0.12);
}

.button--danger {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(251, 113, 133, 0.07);
  color: #ff9baa;
}

.button--danger:hover {
  background: rgba(251, 113, 133, 0.12);
}

.button--ghost {
  border-color: transparent;
  background: transparent;
  color: var(--tx-2);
}

.button--full {
  width: 100%;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--tx-2);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-2);
  background: rgba(124, 108, 255, 0.08);
  color: var(--tx);
}

.run-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 342px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.workspace-stage {
  display: grid;
  grid-template-rows: 40px minmax(0, 1fr) minmax(188px, 25%);
  gap: 10px;
  min-width: 0;
  min-height: 0;
  padding: 14px 18px 18px 20px;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(circle at 54% 20%, rgba(79, 124, 255, 0.09), transparent 31%),
    radial-gradient(circle at 84% 46%, rgba(181, 87, 246, 0.07), transparent 30%);
}

.status-strip {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  width: min(100%, 424px);
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(20, 17, 48, 0.4);
  backdrop-filter: blur(12px);
}

.status-strip > span,
.status-strip button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--tx-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  white-space: nowrap;
}

.status-strip button {
  margin-left: auto;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  cursor: pointer;
}

.status-strip button:hover {
  background: rgba(124, 108, 255, 0.08);
}

.status-strip button strong {
  color: var(--green);
}

.status-dot {
  display: inline-block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--idle);
}

.status-dot--active,
.status-dot--completed {
  background: var(--green);
  box-shadow: 0 0 11px rgba(61, 220, 151, 0.6);
}

.status-dot--working {
  background: var(--cyan);
  box-shadow: 0 0 11px rgba(52, 214, 245, 0.58);
}

.status-dot--waiting {
  background: var(--yellow);
  box-shadow: 0 0 11px rgba(251, 191, 36, 0.48);
}

.status-dot--idle {
  background: var(--idle);
}

.orchestration-map {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(circle at 50% 21%, rgba(79, 124, 255, 0.14), transparent 31%),
    radial-gradient(circle at 85% 47%, rgba(181, 87, 246, 0.12), transparent 30%),
    rgba(7, 5, 20, 0.12);
}

.orchestration-map::before {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(160, 153, 255, 0.26) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(89, 126, 255, 0.17) 0 1px, transparent 1.5px);
  background-position:
    0 0,
    31px 46px;
  background-size:
    89px 83px,
    137px 119px;
  content: "";
  opacity: 0.76;
  pointer-events: none;
}

.orchestration-map.run-paused::after,
.orchestration-map.run-stopped::after {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background: rgba(5, 4, 16, 0.58);
  color: var(--yellow);
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 700;
  content: "Run paused";
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.orchestration-map.run-stopped::after {
  color: var(--red);
  content: "Run stopped";
}

.agent-node,
.approval-node {
  position: absolute;
  z-index: 5;
  display: grid;
  width: 190px;
  padding: 13px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(19, 16, 44, 0.9);
  color: var(--tx);
  text-align: left;
  box-shadow: 0 18px 40px rgba(2, 1, 12, 0.28);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition:
    border-color 150ms ease,
    transform 150ms ease,
    box-shadow 150ms ease;
}

.agent-node:hover,
.approval-node:hover {
  border-color: var(--line-3);
  transform: translateY(-2px);
}

.agent-node.is-selected {
  border-color: rgba(124, 108, 255, 0.78);
  box-shadow:
    0 0 0 1px rgba(124, 108, 255, 0.22),
    0 0 26px rgba(124, 108, 255, 0.34);
}

.agent-node--iris {
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
}

.agent-node--iris:hover {
  transform: translateX(-50%) translateY(-2px);
}

.agent-node--programmer {
  top: 36%;
  left: 4%;
}

.agent-node--reviewer {
  top: 36%;
  left: calc(50% - 95px);
}

.agent-node--executor {
  top: 36%;
  right: 3%;
}

.node-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.agent-icon,
.detail-agent-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-2);
  border-radius: 9px;
  background: var(--glass-2);
  color: #c8c2ff;
}

.node-title {
  min-width: 0;
}

.node-title strong,
.node-title small {
  display: block;
}

.node-title strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
}

.node-title small {
  overflow: hidden;
  margin-top: 2px;
  color: var(--tx-3);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-status {
  overflow: hidden;
  margin-top: 12px;
  color: var(--tx-2);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-track {
  position: relative;
  height: 3px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(150, 140, 255, 0.12);
}

.progress-value {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--gradient);
}

.state-completed .progress-value {
  background: var(--green);
}

.state-working .progress-value {
  background: linear-gradient(90deg, var(--cyan), var(--purple));
}

.node-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--tx-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
}

.state-completed .node-footer span:first-child {
  color: var(--green);
}

.state-working .node-footer span:first-child {
  color: var(--cyan);
}

.state-waiting .node-footer span:first-child {
  color: var(--yellow);
}

.approval-node {
  top: 65%;
  right: 3%;
  width: 272px;
  border-color: rgba(181, 87, 246, 0.64);
  background: rgba(24, 18, 51, 0.94);
  box-shadow:
    0 0 0 1px rgba(181, 87, 246, 0.18),
    0 0 30px rgba(181, 87, 246, 0.28);
}

.approval-node--approved {
  border-color: rgba(61, 220, 151, 0.54);
  box-shadow: 0 0 26px rgba(61, 220, 151, 0.18);
}

.approval-kicker {
  color: var(--purple);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.approval-node--approved .approval-kicker {
  color: var(--green);
}

.approval-node > strong {
  margin-top: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
}

.approval-node > small {
  margin-top: 5px;
  color: var(--tx-2);
  font-size: 10px;
  line-height: 1.45;
}

.approval-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  color: var(--tx-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
}

.deploy-node {
  position: absolute;
  top: 87%;
  right: 6%;
  z-index: 4;
  display: grid;
  width: 250px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(11, 9, 28, 0.82);
}

.deploy-node > span {
  color: var(--tx-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
  text-transform: uppercase;
}

.deploy-node > strong {
  margin-top: 4px;
  font-size: 11px;
}

.deploy-node > small {
  margin-top: 3px;
  color: var(--tx-3);
  font-size: 9px;
}

.deploy-node--approved {
  border-color: rgba(61, 220, 151, 0.24);
}

.deploy-node--approved > span {
  color: var(--green);
}

.connection {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}

.connection--iris-programmer {
  top: 28%;
  right: 14%;
  left: 14%;
  height: 13%;
  border-top: 1px dashed rgba(124, 108, 255, 0.34);
  border-right: 1px dashed rgba(124, 108, 255, 0.34);
  border-left: 1px dashed rgba(124, 108, 255, 0.34);
  border-radius: 9px 9px 0 0;
}

.connection--iris-reviewer {
  top: 24%;
  left: 50%;
  height: 17%;
  border-left: 2px solid rgba(79, 124, 255, 0.72);
}

.connection--iris-executor {
  top: 28%;
  right: 14%;
  width: 1px;
  height: 13%;
  border-right: 1px dashed rgba(124, 108, 255, 0.34);
}

.connection--executor-approval {
  top: 57%;
  right: 14%;
  height: 12%;
  border-right: 2px solid rgba(181, 87, 246, 0.56);
}

.connection--approval-deploy {
  top: 80%;
  right: 14%;
  height: 9%;
  border-right: 1px solid rgba(124, 108, 255, 0.32);
}

.event-rail {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(14, 12, 32, 0.68);
  backdrop-filter: blur(12px);
}

.event-rail > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 5px 13px;
  border-bottom: 1px solid var(--line);
}

.event-rail > header .eyebrow {
  display: none;
}

.event-rail h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
}

.event-rail > header > span {
  color: var(--tx-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
}

.event-list {
  height: calc(100% - 34px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 108, 255, 0.32) transparent;
}

.event-row {
  display: grid;
  grid-template-columns: 60px 12px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 4px 11px;
  border: 0;
  border-bottom: 1px solid rgba(150, 140, 255, 0.07);
  background: transparent;
  color: var(--tx-2);
  text-align: left;
  cursor: pointer;
}

.event-row:hover {
  background: rgba(124, 108, 255, 0.07);
}

.event-row time {
  color: var(--tx-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
}

.event-marker {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mid);
}

.event-row--success .event-marker {
  background: var(--green);
}

.event-row--working .event-marker {
  background: var(--cyan);
}

.event-row--approval .event-marker {
  background: var(--yellow);
}

.event-copy {
  display: grid;
  grid-template-columns: minmax(80px, auto) minmax(130px, 1fr);
  gap: 2px 8px;
  min-width: 0;
}

.event-copy strong {
  color: var(--tx);
  font-size: 10px;
}

.event-copy > span {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-copy small {
  grid-column: 1 / -1;
  display: none;
}

.detail-panel {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background:
    radial-gradient(circle at 82% 0%, rgba(79, 124, 255, 0.1), transparent 30%),
    radial-gradient(circle at 100% 42%, rgba(181, 87, 246, 0.07), transparent 34%),
    rgba(8, 6, 24, 0.68);
  scrollbar-width: thin;
  scrollbar-color: rgba(124, 108, 255, 0.32) transparent;
}

.detail-agent-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 36px;
  align-items: center;
  gap: 9px;
  min-height: 76px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 8, 27, 0.94);
  backdrop-filter: blur(18px);
}

.detail-agent-header strong,
.detail-agent-header small {
  display: block;
}

.detail-agent-header strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 15px;
}

.detail-agent-header small {
  margin-top: 3px;
  color: var(--tx-3);
  font-size: 10px;
}

.detail-section {
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.detail-section h2 {
  margin: 10px 0 0;
  color: var(--tx);
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 11px;
  padding: 5px 8px;
  border: 1px solid rgba(124, 108, 255, 0.3);
  border-radius: 7px;
  background: rgba(124, 108, 255, 0.08);
  color: #beb8ff;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
}

.step-badge--approved {
  border-color: rgba(61, 220, 151, 0.3);
  background: rgba(61, 220, 151, 0.07);
  color: var(--green);
}

.step-description {
  margin: 7px 0 0;
  color: var(--tx-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  line-height: 1.55;
}

.agent-facts {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
}

.approval-facts {
  margin-top: 16px;
}

.agent-facts > div,
.detail-list > div,
.runtime-facts > div,
.decision-context dl > div {
  display: grid;
  grid-template-columns: minmax(95px, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
  gap: 10px;
}

.agent-facts dt,
.detail-list dt,
.runtime-facts dt,
.decision-context dt {
  color: var(--tx-3);
  font-size: 10px;
}

.agent-facts dd,
.detail-list dd,
.runtime-facts dd,
.decision-context dd {
  margin: 0;
  color: var(--tx-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  line-height: 1.5;
  text-align: right;
  overflow-wrap: anywhere;
}

.tool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.tool-chips span {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(124, 108, 255, 0.06);
  color: var(--tx-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 8px;
}

.detail-row {
  display: grid;
  grid-template-columns: 18px 74px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 34px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--tx-3);
  text-align: left;
}

.detail-row strong {
  overflow: hidden;
  color: var(--tx-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 500;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-row--action {
  border-radius: 7px;
  cursor: pointer;
}

.detail-row--action:hover {
  background: rgba(124, 108, 255, 0.07);
  color: var(--tx);
}

.usage-section .detail-row {
  min-height: 30px;
}

.decision-card {
  margin: 14px;
  padding: 15px;
  border: 1px solid rgba(181, 87, 246, 0.52);
  border-radius: 12px;
  background: rgba(181, 87, 246, 0.06);
  box-shadow: 0 0 24px rgba(181, 87, 246, 0.12);
}

.decision-card h2 {
  margin: 7px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
}

.decision-card p:not(.eyebrow) {
  margin: 7px 0 13px;
  color: var(--tx-2);
  font-size: 10px;
  line-height: 1.5;
}

.decision-card--approved {
  border-color: rgba(61, 220, 151, 0.36);
  background: rgba(61, 220, 151, 0.05);
  box-shadow: 0 0 24px rgba(61, 220, 151, 0.09);
}

.decision-card--stopped {
  border-color: rgba(251, 113, 133, 0.36);
  background: rgba(251, 113, 133, 0.06);
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 28px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(3, 2, 14, 0.76);
  backdrop-filter: blur(7px);
  cursor: default;
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 540px);
  max-height: min(780px, calc(100vh - 56px));
  overflow: auto;
  border: 1px solid var(--line-3);
  border-radius: 16px;
  background:
    radial-gradient(circle at 92% 0%, rgba(181, 87, 246, 0.12), transparent 34%),
    rgba(12, 9, 31, 0.98);
  box-shadow: var(--shadow);
}

.modal-panel--wide {
  width: min(100%, 720px);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 9, 31, 0.94);
  backdrop-filter: blur(16px);
}

.modal-header h2 {
  margin: 4px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
}

.modal-content {
  padding: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin: 18px -18px -18px;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: rgba(8, 6, 24, 0.48);
}

.approval-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  gap: 18px;
}

.approval-layout h3,
.runtime-overview h3 {
  margin: 18px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
}

.approval-summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  padding: 13px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  border-radius: 11px;
  background: rgba(251, 191, 36, 0.06);
  color: var(--yellow);
}

.approval-summary--approved {
  border-color: rgba(61, 220, 151, 0.28);
  background: rgba(61, 220, 151, 0.06);
  color: var(--green);
}

.approval-summary strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 13px;
}

.approval-summary p {
  margin: 4px 0 0;
  color: var(--tx-2);
  font-size: 10px;
  line-height: 1.5;
}

.scope-list {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.scope-list li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  color: var(--tx-2);
  font-size: 11px;
  line-height: 1.5;
}

.scope-list svg {
  margin-top: 2px;
  color: var(--green);
}

.decision-context {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(124, 108, 255, 0.05);
}

.decision-context dl,
.detail-list,
.runtime-facts {
  display: grid;
  gap: 12px;
  margin: 0;
}

.event-detail {
  display: grid;
  gap: 14px;
}

.event-detail > p {
  margin: 0;
  color: var(--tx-2);
  font-size: 12px;
  line-height: 1.6;
}

.event-detail-icon,
.runtime-large-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-2);
  border-radius: 11px;
  background: rgba(124, 108, 255, 0.09);
  color: #c5beff;
}

.event-detail-icon--approval {
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.07);
  color: var(--yellow);
}

.runtime-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 0.85fr);
  gap: 20px;
}

.runtime-overview {
  min-width: 0;
}

.runtime-overview > p:not(.runtime-status) {
  margin: 8px 0 0;
  color: var(--tx-2);
  font-size: 11px;
  line-height: 1.6;
}

.runtime-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 12px 0 0;
  color: var(--green);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
}

.runtime-facts {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(124, 108, 255, 0.05);
}

.iris-dialog {
  display: grid;
  gap: 12px;
}

.iris-message {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(124, 108, 255, 0.05);
}

.iris-message p {
  margin: 3px 0 0;
  color: var(--tx-2);
  font-size: 11px;
  line-height: 1.55;
}

.iris-message--reply {
  border-color: rgba(79, 124, 255, 0.28);
  background: rgba(79, 124, 255, 0.07);
}

.iris-dialog form {
  display: grid;
  gap: 8px;
}

.iris-dialog label {
  color: var(--tx-3);
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  text-transform: uppercase;
}

.iris-dialog textarea {
  width: 100%;
  resize: vertical;
  min-height: 84px;
  padding: 11px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: rgba(6, 4, 18, 0.72);
  color: var(--tx);
  font-size: 12px;
  line-height: 1.5;
}

.iris-dialog textarea::placeholder {
  color: var(--tx-3);
}

.iris-dialog form .button {
  justify-self: end;
}

.stop-dialog {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.stop-dialog p {
  margin: 0;
  color: var(--tx-2);
  font-size: 12px;
  line-height: 1.6;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 130;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: 380px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(61, 220, 151, 0.28);
  border-radius: 11px;
  background: rgba(11, 30, 27, 0.96);
  color: #baf6da;
  box-shadow: var(--shadow);
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.desktop-gate {
  display: none;
}

@media (max-width: 1270px) {
  .topbar {
    grid-template-columns: minmax(260px, 0.8fr) minmax(230px, 0.8fr) auto;
  }

  .topbar-meta > div:nth-child(3),
  .mock-label {
    display: none;
  }

  .topbar-meta {
    grid-template-columns: repeat(2, minmax(100px, 1fr));
  }

  .run-workspace {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

  .agent-node,
  .approval-node {
    width: 174px;
  }

  .approval-node {
    width: 230px;
  }
}

@media (max-width: 1099px) {
  html,
  body,
  #root {
    min-width: 0;
  }

  .app-shell {
    display: none;
  }

  .desktop-gate {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 10px;
    width: 100%;
    min-height: 100vh;
    padding: 32px;
    color: var(--tx);
    text-align: center;
  }

  .desktop-gate svg {
    color: var(--mid);
  }

  .desktop-gate h1 {
    margin: 0;
    font-family: "Space Grotesk", sans-serif;
    font-size: 26px;
  }

  .desktop-gate p {
    max-width: 420px;
    margin: 0;
    color: var(--tx-2);
    line-height: 1.6;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
