:root {
  --bg: #f4f5fb;
  --frame: #ffffff;
  --panel: #ffffff;
  --panel-soft: #fafaff;
  --canvas: #fcfcff;
  --grid: rgba(99, 102, 241, 0.08);
  --ink: #15192f;
  --muted: #727894;
  --muted-strong: #4b536f;
  --line: #e7e9f3;
  --line-strong: #d8dbeb;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 8px 18px rgba(15, 23, 42, 0.06);
  --accent: #5a4df2;
  --accent-soft: #f3f1ff;
  --accent-strong: #4338ca;
  --success: #e7fbf0;
  --success-ink: #0f9d58;
  --warning: #fff7dd;
  --warning-ink: #a06a00;
  --danger: #fff0ef;
  --danger-ink: #d14343;
  --selected: #6a5af9;
  --left-rail-open: 232px;
  --left-rail-collapsed: 52px;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(106, 90, 249, 0.10), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(47, 99, 224, 0.08), transparent 26%),
    linear-gradient(180deg, #fbfcff 0%, #f4f6fc 100%);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
}

body.is-dragging-nodes,
body.is-dragging-nodes *,
body.is-panning-canvas,
body.is-panning-canvas * {
  user-select: none !important;
  -webkit-user-select: none !important;
}

body.is-dragging-nodes,
body.is-dragging-nodes * {
  cursor: move !important;
}

body.is-panning-canvas,
body.is-panning-canvas * {
  cursor: grabbing !important;
}

.hidden {
  display: none !important;
}

.hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.app-shell {
  height: 100vh;
  padding: 14px;
  overflow: hidden;
}

.app-frame {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 28px);
  min-height: 0;
  background: var(--frame);
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 40;
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-height: 68px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
}

body.is-home-route .topbar {
  justify-content: flex-start;
}

body.is-home-route .brand-copy {
  display: none;
}

body.is-home-route .topbar-actions,
body.is-home-route .workspace {
  display: none;
}

.home-view {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 34px;
  background:
    radial-gradient(circle at 10% 12%, rgba(90, 77, 242, 0.12), transparent 30%),
    radial-gradient(circle at 82% 8%, rgba(16, 185, 129, 0.12), transparent 26%),
    linear-gradient(135deg, #ffffff 0%, #f7f9ff 58%, #f4fff9 100%);
}

.home-hero {
  display: grid;
  gap: 14px;
  max-width: 880px;
  margin: 0 auto 24px;
  padding: 30px;
  border: 1px solid rgba(99, 102, 241, 0.16);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: var(--shadow-soft);
}

.home-hero h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.home-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 1rem;
  line-height: 1.65;
}

.home-hero code {
  color: var(--accent-strong);
  font-weight: 700;
}

.home-actions,
.home-projects-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.home-actions {
  justify-content: flex-start;
}

.home-projects-panel {
  display: grid;
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
  padding: 22px;
  border: 1px solid rgba(216, 219, 235, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
}

.home-projects-header h3 {
  margin: 4px 0 0;
  font-size: 1.25rem;
}

.home-projects-count {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8f9ff;
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 700;
}

.home-projects-list {
  display: grid;
  gap: 12px;
}

.home-projects-list .project-card {
  border-radius: 18px;
}

.brand-block,
.topbar-actions,
.topbar-meta,
.brand-row,
.canvas-toolbox,
.field-grid,
.inspector-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-block {
  gap: 14px;
}

.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6a5af9, #4e46f5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36);
}

.brand-mark span,
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border: 2px solid #ffffff;
  border-radius: 8px;
}

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

.brand-mark::after {
  inset: 6px 6px 6px 15px;
}

.brand-mark span {
  inset: 10px 10px 10px 10px;
}

.brand-copy h1,
.panel-heading h2,
.canvas-topline h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.brand-copy h1 {
  font-size: 1.08rem;
}

.workflow-title {
  max-width: min(34vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: text;
}

.workflow-title-input {
  width: min(34vw, 420px);
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--selected);
  border-radius: 10px;
  outline: none;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  font-size: 1.08rem;
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(106, 90, 249, 0.12);
}

.panel-kicker,
.group-label,
.field-group label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.group-label {
  display: block;
  margin-bottom: 10px;
}

.icon-btn,
.tool-btn,
.zoom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #ffffff;
  color: var(--muted-strong);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.icon-btn {
  width: 32px;
  height: 32px;
  font-size: 0.95rem;
}

.icon-btn:hover,
.tool-btn:hover,
.zoom-btn:hover {
  border-color: #cfd3ea;
  box-shadow: var(--shadow-soft);
}

.icon-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.content-brush-btn {
  font-size: 0.9rem;
}

.content-brush-btn.is-armed {
  background: var(--accent-soft);
  border-color: rgba(106, 90, 249, 0.34);
  color: var(--accent-strong);
  box-shadow: 0 0 0 3px rgba(106, 90, 249, 0.1);
}

body.is-content-brush-armed .workflow-node {
  cursor: copy;
}

.topbar-actions {
  margin-left: auto;
  position: relative;
}

.topbar-meta {
  gap: 18px;
  margin-right: 8px;
}

.status-meta {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted-strong);
  font-size: 0.92rem;
}

.status-meta::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c7ccdf;
}

.status-meta-saving::before {
  background: #19b66b;
}

.status-meta-saving.is-dirty::before {
  background: #f59e0b;
}

.status-meta-saving.is-saving::before {
  background: #5f6cff;
}

.status-meta-saving.is-error::before {
  background: #ef4444;
}

.status-meta-metric::before {
  background: #5f6cff;
}

.status-meta-project::before {
  background: #f59e0b;
}

.server-pill,
.node-type-pill,
.node-status,
.inspector-node-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 600;
}

.server-pill {
  gap: 7px;
  min-height: 30px;
  background: #fff4e6;
  color: #d77400;
  border-color: rgba(245, 158, 11, 0.22);
}

.server-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(15, 157, 88, 0.14);
}

.server-pill.is-offline {
  background: var(--danger);
  color: var(--danger-ink);
}

.ghost-btn,
.solid-btn,
.danger-btn,
.canvas-mini-action,
.palette-item {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.ghost-btn,
.solid-btn,
.danger-btn {
  min-height: 44px;
  padding: 0 16px;
}

.ghost-btn {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
}

#focusNodeButton::before {
  content: "⌖";
  margin-right: 8px;
  color: var(--accent-strong);
}

.actions-menu {
  position: relative;
}

.actions-menu-button {
  min-width: 112px;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}

.actions-menu-popover {
  position: absolute;
  z-index: 35;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  width: 238px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
}

.actions-menu.is-open .actions-menu-popover {
  display: grid;
}

.actions-menu-item {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.actions-menu-item span {
  width: 18px;
  color: var(--accent-strong);
  text-align: center;
}

.actions-menu-item:hover {
  background: var(--accent-soft);
}

.actions-menu-separator {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

.ghost-btn:hover,
.solid-btn:hover,
.danger-btn:hover,
.palette-item:hover,
.canvas-mini-action:hover {
  border-color: #cfd3ea;
  box-shadow: var(--shadow-soft);
}

.solid-btn {
  background: linear-gradient(135deg, #6a5af9, #4d44f4);
  color: #ffffff;
  border-color: transparent;
}

.solid-btn:disabled {
  background: #e5e7eb;
  color: #8a93a6;
  border-color: #d7dce8;
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}

.solid-btn:disabled:hover {
  border-color: #d7dce8;
  box-shadow: none;
  transform: none;
}

.danger-btn {
  background: var(--danger);
  color: var(--danger-ink);
}

.launch-btn.is-stop {
  background: var(--danger);
  color: var(--danger-ink);
  border-color: rgba(209, 67, 67, 0.28);
}

.launch-btn {
  min-width: 136px;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(77, 68, 244, 0.20);
}

.runtime-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.execution-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 38px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8f9ff;
}

.execution-mode-option {
  min-height: 30px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted-strong);
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
  transition: background 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

.execution-mode-option:hover {
  color: var(--ink);
}

.execution-mode-option.is-active {
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.runtime-control-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 72px;
  font-weight: 700;
}

.runtime-control-btn.is-unavailable {
  border-style: dashed;
  background: #f8f9ff;
  color: var(--muted-strong);
  box-shadow: none;
}

.runtime-control-btn.is-unavailable:hover {
  border-color: #cfd3ea;
  background: #ffffff;
}

.runtime-control-btn.is-loading {
  border-color: rgba(95, 108, 255, 0.28);
  background: #f5f6ff;
  color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(95, 108, 255, 0.08);
}

.runtime-control-btn.is-loading::before {
  content: "";
  width: 12px;
  height: 12px;
  border: 2px solid rgba(95, 108, 255, 0.22);
  border-top-color: #5f6cff;
  border-radius: 50%;
  animation: control-spin 780ms linear infinite;
}

.run-icon {
  font-size: 0.86rem;
  line-height: 1;
}

.icon-only {
  width: 44px;
  min-width: 44px;
  padding: 0;
  font-size: 1.2rem;
}

.workspace {
  display: grid;
  grid-template-columns: var(--left-rail-collapsed) minmax(0, 1fr) 372px;
  flex: 1 1 auto;
  min-height: 0;
}

.workspace.inspector-collapsed {
  grid-template-columns: var(--left-rail-collapsed) minmax(0, 1fr);
}

.workspace.inspector-collapsed .right-rail {
  display: none;
}

.left-rail,
.right-rail {
  background: var(--panel);
  min-height: 0;
  overflow: auto;
}

.left-rail {
  position: relative;
  z-index: 35;
  border-right: 1px solid var(--line);
  overflow: visible;
}

.palette-collapsed-icons {
  position: absolute;
  inset: 0 0 0 auto;
  z-index: 3;
  display: flex;
  width: var(--left-rail-collapsed);
  padding: 14px 8px;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  overflow: hidden auto;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 250, 255, 0.94));
  border-right: 1px solid rgba(231, 233, 243, 0.85);
  transition: opacity 120ms ease, transform 160ms ease;
}

.palette-collapsed-icons button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid rgba(106, 90, 249, 0.16);
  border-radius: 10px;
  background: #ffffff;
  color: #4f5775;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.04);
  cursor: pointer;
}

.palette-collapsed-icons button:hover,
.palette-collapsed-icons button:focus-visible {
  border-color: rgba(106, 90, 249, 0.44);
  background: var(--accent-soft);
  color: var(--accent-strong);
  outline: none;
}

.right-rail {
  border-left: 1px solid var(--line);
}

.panel {
  background: var(--panel);
}

.palette-panel,
.canvas-wrap,
.inspector-panel {
  padding: 18px 16px;
}

.palette-panel {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--left-rail-open);
  height: 100%;
  max-width: calc(100vw - 32px);
  overflow: hidden;
  border-right: 1px solid var(--line);
  transform: translateX(calc((var(--left-rail-open) - var(--left-rail-collapsed)) * -1));
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.palette-panel > * {
  opacity: 0;
  pointer-events: none;
  transition: opacity 90ms ease;
}

.left-rail:hover .palette-panel,
.left-rail:focus-within .palette-panel {
  overflow: auto;
  transform: translateX(0);
  box-shadow: 16px 0 34px rgba(15, 23, 42, 0.08);
}

.left-rail:hover .palette-collapsed-icons,
.left-rail:focus-within .palette-collapsed-icons {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
}

.left-rail:hover .palette-panel > *,
.left-rail:focus-within .palette-panel > * {
  opacity: 1;
  pointer-events: auto;
}

.left-rail.palette-force-collapsed .palette-panel {
  overflow: hidden;
  transform: translateX(calc((var(--left-rail-open) - var(--left-rail-collapsed)) * -1));
  box-shadow: none;
}

.left-rail.palette-force-collapsed .palette-panel > * {
  opacity: 0;
  pointer-events: none;
}

.left-rail.palette-force-collapsed .palette-collapsed-icons {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.panel-link-btn {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(106, 90, 249, 0.2);
  border-radius: 10px;
  background: #f6f4ff;
  color: var(--accent-strong);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.panel-link-btn:hover {
  border-color: rgba(106, 90, 249, 0.42);
  background: #eeeaff;
}

.palette-search {
  position: relative;
  display: block;
  margin-bottom: 18px;
}

.palette-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.95rem;
}

.palette-search input {
  padding-left: 36px;
}

.palette-group {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.palette-group:first-of-type {
  border-top: none;
  padding-top: 0;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  margin-bottom: 8px;
  background: #ffffff;
  color: var(--muted-strong);
  text-align: left;
}

.palette-item:last-child {
  margin-bottom: 0;
}

.palette-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  color: #5f6582;
  font-size: 0.92rem;
  flex: 0 0 18px;
}

.canvas-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: linear-gradient(180deg, #ffffff 0%, #fefeff 100%);
}

.canvas-topline {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  z-index: 30;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  pointer-events: none;
}

.canvas-toolbox {
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  pointer-events: auto;
}

.graph-breadcrumb {
  display: flex;
  align-items: center;
  min-width: 0;
  max-width: min(560px, 45vw);
  gap: 6px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
  color: var(--muted);
  font-size: 0.84rem;
  pointer-events: auto;
  overflow: hidden;
}

.graph-breadcrumb button,
.graph-breadcrumb span {
  max-width: 180px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-breadcrumb button {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

.graph-breadcrumb button:hover {
  text-decoration: underline;
}

.graph-breadcrumb .breadcrumb-current {
  color: var(--ink);
  font-weight: 700;
}

.graph-breadcrumb .breadcrumb-separator {
  color: #a5acc3;
  flex: 0 0 auto;
}

.tool-btn {
  min-width: 38px;
  height: 38px;
  background: transparent;
}

.tool-btn.is-active {
  background: var(--accent-soft);
  border-color: rgba(106, 90, 249, 0.18);
  color: var(--accent);
}

#connectionHighlightButton.is-active {
  background: rgba(79, 70, 229, 0.12);
  border-color: rgba(79, 70, 229, 0.28);
  color: #4338ca;
}

.tool-btn:disabled,
.zoom-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.tool-btn-wide {
  padding: 0 12px;
  min-width: 70px;
}

.canvas-scroll {
  position: relative;
  border: 1px solid var(--line);
  background: var(--canvas);
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}

.canvas-scroll.is-panning {
  cursor: grabbing;
}

.canvas-scroll.is-pan-tool {
  cursor: grab;
}

.canvas-scroll.is-pan-tool.is-panning {
  cursor: grabbing;
}

.canvas-scroll::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.canvas-scroll::-webkit-scrollbar-thumb {
  border: 3px solid var(--canvas);
  border-radius: 999px;
  background: #c7ccdf;
}

.canvas-scroll::-webkit-scrollbar-track {
  background: var(--canvas);
}

.canvas-zoom-layer {
  position: relative;
  width: 1120px;
  height: 720px;
  min-width: 1120px;
  min-height: 720px;
}

.canvas-grid {
  position: absolute;
  left: 0;
  top: 0;
  width: 1120px;
  height: 720px;
  min-width: 1120px;
  min-height: 720px;
  background-color: var(--canvas);
  background-image:
    radial-gradient(circle, var(--grid) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.92));
  background-size: 10px 10px, 100% 100%;
  overflow: visible;
  transform: scale(var(--canvas-zoom, 1));
  transform-origin: 0 0;
}

.selection-box {
  position: absolute;
  z-index: 18;
  border: 1px solid rgba(106, 90, 249, 0.72);
  border-radius: 6px;
  background: rgba(106, 90, 249, 0.10);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
  pointer-events: none;
}

.edge-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.edge-path {
  fill: none;
  stroke: #68708a;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  pointer-events: stroke;
}

.edge-path.selected {
  stroke: var(--selected);
  stroke-width: 3;
}

.edge-path.is-connection-highlight-edge,
.edge-jump-arc.is-connection-highlight-edge {
  stroke-width: 3.4;
  filter: drop-shadow(0 0 3px rgba(79, 70, 229, 0.22));
  opacity: 1;
}

.edge-path.is-dimmed-by-connection-highlight,
.edge-jump-gap.is-dimmed-by-connection-highlight,
.edge-jump-arc.is-dimmed-by-connection-highlight,
.edge-feedback-badge.is-dimmed-by-connection-highlight {
  opacity: 0.16;
}

.edge-feedback-badge.is-connection-highlight-edge rect {
  stroke-width: 1.8;
  filter: drop-shadow(0 2px 5px rgba(79, 70, 229, 0.18));
}

.edge-path.feedback {
  stroke: #7f1d1d;
}

.edge-path.feedback.selected {
  stroke: #991b1b;
}

.edge-jump-gap,
.edge-jump-arc {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.edge-jump-gap {
  stroke: #ffffff;
  stroke-width: 7;
}

.edge-jump-arc {
  stroke: #68708a;
  stroke-width: 2.25;
}

.edge-jump-arc.selected {
  stroke: var(--selected);
  stroke-width: 3;
}

.edge-jump-arc.feedback {
  stroke: #7f1d1d;
}

.edge-jump-arc.feedback.selected {
  stroke: #991b1b;
}

.edge-feedback-badge {
  cursor: pointer;
  pointer-events: auto;
}

.edge-feedback-badge rect {
  fill: #fff1f2;
  stroke: #7f1d1d;
  stroke-width: 1.25;
  filter: drop-shadow(0 1px 2px rgba(127, 29, 29, 0.12));
}

.edge-feedback-badge text {
  fill: #7f1d1d;
  font-size: 11px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
  user-select: none;
}

.edge-preview {
  fill: none;
  stroke: var(--selected);
  stroke-width: 2;
  stroke-dasharray: 6 5;
  pointer-events: none;
}

.canvas-overlay {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: grid;
  gap: 10px;
  z-index: 20;
}

.canvas-utility-dock {
  position: absolute;
  right: 24px;
  bottom: 20px;
  z-index: 25;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.canvas-mini-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted-strong);
  font-size: 0.82rem;
  font-weight: 650;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.canvas-mini-action span[aria-hidden="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
}

.canvas-tip-popover {
  position: absolute;
  right: 0;
  bottom: 44px;
  width: 260px;
  padding: 14px;
  border: 1px solid rgba(106, 90, 249, 0.22);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow-soft);
}

.canvas-tip-popover strong {
  display: block;
  margin-bottom: 6px;
}

.canvas-tip-popover p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.mini-map-card {
  width: 162px;
  height: 88px;
  border: 1px solid rgba(106, 90, 249, 0.34);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfbff 100%);
  box-shadow: var(--shadow-soft);
  position: relative;
}

.mini-map-flow,
.mini-map-flow::before,
.mini-map-flow::after {
  content: "";
  position: absolute;
  border-radius: 4px;
  border: 1px solid #cfd3ea;
  background: #ffffff;
}

.mini-map-flow {
  left: 24px;
  right: 94px;
  top: 34px;
  bottom: 34px;
}

.mini-map-flow::before {
  left: 54px;
  top: -10px;
  width: 34px;
  height: 22px;
}

.mini-map-flow::after {
  left: 110px;
  top: 0;
  width: 36px;
  height: 22px;
}

.zoom-dock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  color: var(--muted-strong);
}

.zoom-btn {
  width: 24px;
  height: 24px;
  border: none;
  box-shadow: none;
}

.canvas-node {
  position: absolute;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 230px;
  min-height: 150px;
  padding: 16px 18px 18px;
  border-radius: 18px;
  border: 1px solid #ccd4e6;
  background: rgba(248, 250, 252, 0.82);
  box-shadow: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, filter 120ms ease, opacity 120ms ease, transform 120ms ease;
  cursor: move;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.canvas-node.selected {
  border-color: var(--selected);
  box-shadow: 0 0 0 3px rgba(106, 90, 249, 0.16);
}

.canvas-node.selected-primary {
  box-shadow: 0 0 0 3px rgba(106, 90, 249, 0.20), 0 0 0 1px rgba(106, 90, 249, 0.34);
}

.canvas-node.is-graph-focus-target {
  border-color: #4f46e5;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.22), 0 16px 28px rgba(79, 70, 229, 0.12);
}

.canvas-node.is-connection-highlight-focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18), 0 12px 26px rgba(79, 70, 229, 0.10);
}

.canvas-node.is-connection-highlight-neighbor {
  border-color: rgba(79, 70, 229, 0.48);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.10);
}

.canvas-node.is-dimmed-by-connection-highlight {
  filter: grayscale(0.35);
  opacity: 0.26;
}

.canvas-node.is-dragging {
  z-index: 12;
  box-shadow: 0 18px 32px rgba(21, 25, 47, 0.16);
}

.canvas-node.is-inhibited {
  border-color: #a9b1c5;
  background: rgba(244, 246, 250, 0.72);
  color: #4b5563;
  filter: grayscale(0.7);
  opacity: 0.7;
}

.canvas-node.is-inhibited::after {
  content: "⊘";
  position: absolute;
  top: 10px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid #9ca3af;
  border-radius: 50%;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.canvas-node.is-inhibited.selected,
.canvas-node.is-inhibited.selected-primary {
  border-color: #6b7280;
  box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.18);
}

.generic-node.canvas-node.is-inhibited::after {
  display: none;
}

.node-runtime-metrics {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  transform: translateX(-50%);
  color: #6d7591;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  opacity: 0.62;
  pointer-events: none;
  white-space: nowrap;
}

.node-runtime-metrics span {
  display: inline-flex;
  align-items: center;
}

.demo-node-source {
  left: 110px;
  top: 290px;
}

.demo-node-process {
  left: 420px;
  top: 260px;
}

.demo-node-output {
  left: 730px;
  top: 290px;
}

.generic-node {
  left: 520px;
  top: 360px;
  background: rgba(248, 250, 252, 0.82);
  border-color: #9aa7bd;
}

.block-owned-node {
  justify-content: center;
}

.node-owned-card-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.generic-node-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.canvas-node h3 {
  margin: 18px 0 10px;
  font-size: 0.99rem;
  font-weight: 700;
  text-align: center;
}

.canvas-node p,
.node-footer {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  text-align: center;
}

.node-owned-card-preview {
  max-width: 170px;
  min-height: 2.8em;
  margin-inline: auto;
}

.node-head,
.node-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.node-footer {
  display: none;
  margin-top: 10px;
}

.block-owned-node .node-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
}

.block-owned-node .node-footer span {
  max-width: 92px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.node-type-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.node-type-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: #26314d;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(70, 82, 122, 0.12);
}

.node-type-pill {
  min-height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--muted-strong);
  font-size: 0.9rem;
  font-weight: 600;
}

.node-status {
  display: none;
}

.generic-node .node-status {
  display: inline-flex;
  flex: 0 0 22px;
  width: 22px;
  min-width: 22px;
  max-width: 22px;
  height: 22px;
  min-height: 22px;
  max-height: 22px;
  padding: 0;
  border-radius: 50%;
  font-size: 0;
  border: 2px solid transparent;
}

.generic-node > .node-status {
  position: absolute;
  top: 14px;
  right: 16px;
}

.generic-node .node-status::before {
  font-size: 0.78rem;
  line-height: 1;
}

.generic-node .node-status.is-done {
  background: var(--success);
  color: var(--success-ink);
  border-color: rgba(15, 157, 88, 0.24);
}

.generic-node .node-status.is-done::before {
  content: "✓";
}

.generic-node .node-status.is-running {
  background: #edf4ff;
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.24);
}

.generic-node .node-status.is-running::before {
  content: "↻";
}

.generic-node .node-status.is-listening,
.generic-node .node-status.is-draft,
.generic-node .node-status.is-idle,
.generic-node .node-status.is-ready,
.generic-node .node-status.is-skipped {
  background: #f5f7fb;
  color: #66708d;
  border-color: rgba(102, 112, 141, 0.24);
}

.generic-node .node-status.is-listening::before,
.generic-node .node-status.is-draft::before,
.generic-node .node-status.is-idle::before,
.generic-node .node-status.is-ready::before {
  content: "○";
}

.generic-node .node-status.is-skipped::before {
  content: "–";
}

.generic-node .node-status.is-failed {
  background: var(--danger);
  color: var(--danger-ink);
  border-color: rgba(209, 67, 67, 0.24);
}

.generic-node .node-status.is-failed::before {
  content: "!";
}

.generic-node .node-status.is-cancelled {
  background: #f5f7fb;
  color: #66708d;
  border-color: rgba(102, 112, 141, 0.24);
}

.generic-node .node-status.is-cancelled::before {
  content: "×";
}

.generic-node .node-status.is-inhibited {
  background: #f5f7fb;
  color: #66708d;
  border-color: rgba(102, 112, 141, 0.28);
}

.generic-node .node-status.is-inhibited::before {
  content: "⊘";
}

.node-port-meta {
  position: absolute;
  display: inline-grid;
  gap: 2px;
  width: max-content;
  max-width: 132px;
  pointer-events: none;
  transform: translateY(-50%);
}

.node-port-meta-in {
  right: calc(100% + 14px);
  justify-items: end;
  text-align: right;
}

.node-port-meta-out {
  left: calc(100% + 14px);
  justify-items: start;
  pointer-events: auto;
  text-align: left;
}

.node-port-meta-override {
  top: calc(100% + 14px);
  display: inline-flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 5px;
  justify-items: center;
  max-width: none;
  text-align: left;
  transform: translateX(-50%);
}

.node-port-meta-override .node-port-direction,
.node-port-meta-override .node-port-name {
  max-width: none;
  max-height: 96px;
  color: #8a2f22;
  writing-mode: sideways-rl;
  text-orientation: mixed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@supports not (writing-mode: sideways-rl) {
  .node-port-meta-override .node-port-direction,
  .node-port-meta-override .node-port-name {
    writing-mode: vertical-rl;
  }
}

.node-port-meta-code {
  top: calc(100% + 14px);
  display: inline-flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 5px;
  justify-items: center;
  max-width: none;
  text-align: left;
  transform: translateX(-50%);
}

.node-port-meta-code .node-port-direction,
.node-port-meta-code .node-port-name {
  max-width: none;
  max-height: 96px;
  color: #1d4f80;
  writing-mode: sideways-rl;
  text-orientation: mixed;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@supports not (writing-mode: sideways-rl) {
  .node-port-meta-code .node-port-direction,
  .node-port-meta-code .node-port-name {
    writing-mode: vertical-rl;
  }
}

.node-port-direction {
  max-width: 100%;
  color: #25314b;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-port-name {
  max-width: 100%;
  color: #2f63e0;
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.node-output-link {
  text-decoration: none;
  cursor: pointer;
}

.node-output-link:hover {
  text-decoration: underline;
}

.node-output-link.is-disabled {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: none;
}

.node-port {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: #ffffff;
  border: 2px solid #707796;
  cursor: crosshair;
}

.node-port-in {
  left: -7px;
  background: #ffffff;
  border-color: #6f79a5;
  box-shadow: 0 0 0 3px rgba(111, 121, 165, 0.08);
}

.node-port-out {
  right: -7px;
  background: #6a5af9;
  border-color: #4d44f4;
  box-shadow: 0 0 0 3px rgba(106, 90, 249, 0.12);
}

.node-port-override {
  background: #fff7f5;
  border-color: #9a3412;
  box-shadow: 0 0 0 3px rgba(154, 52, 18, 0.12);
}

.node-port-code {
  background: #f0f8ff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.node-port-effective {
  background: #eef1f6;
  border-color: #7b8498;
  box-shadow: 0 0 0 3px rgba(123, 132, 152, 0.12);
}

.node-port-meta-effective .node-port-direction,
.node-port-meta-effective .node-port-name {
  color: #687084;
}

.node-port.selected {
  background: var(--selected);
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 4px rgba(91, 76, 255, 0.22), 0 8px 18px rgba(91, 76, 255, 0.22);
  transform: scale(1.16);
  z-index: 9;
}

.node-port.is-graph-focus-target {
  background: #4f46e5;
  border-color: #312e81;
  box-shadow: 0 0 0 5px rgba(79, 70, 229, 0.24), 0 10px 20px rgba(79, 70, 229, 0.24);
  transform: scale(1.2);
  z-index: 10;
}

.node-context-menu {
  position: fixed;
  z-index: 80;
  width: max-content;
  min-width: 0;
  max-width: min(320px, calc(100vw - 16px));
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.node-context-menu button {
  width: max-content;
  min-width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.node-context-menu button:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.node-context-menu button:disabled {
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.node-context-menu button + button {
  border-top: 1px solid rgba(221, 226, 239, 0.72);
}

.annotation-node {
  position: absolute;
  box-sizing: border-box;
  z-index: 4;
  min-height: 24px;
  padding: 2px 14px 2px 4px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-strong);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: move;
  user-select: none;
  -webkit-user-select: none;
}

.annotation-note {
  min-height: 24px;
}

.annotation-zone {
  z-index: 1;
  min-height: 80px;
  padding: 10px 14px;
  border: 2px dashed rgba(106, 90, 249, 0.36);
  border-radius: 12px;
  background: rgba(106, 90, 249, 0.035);
  color: #4f46e5;
  cursor: default;
}

.annotation-content {
  min-height: 24px;
  outline: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.annotation-zone .annotation-content {
  position: relative;
  z-index: 1;
  display: inline-flex;
  max-width: calc(100% - 12px);
  min-height: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 3px rgba(42, 47, 75, 0.08);
  font-size: 0.82rem;
  cursor: move;
}

.annotation-zone.is-editing .annotation-content {
  cursor: text;
}

.canvas-scroll.is-drawing-zone,
.canvas-scroll.is-drawing-zone .canvas-grid,
.canvas-scroll.is-drawing-zone .canvas-node,
.canvas-scroll.is-drawing-zone .annotation-node {
  cursor: crosshair;
}

.annotation-zone-draft {
  position: absolute;
  z-index: 1;
  box-sizing: border-box;
  border: 2px dashed rgba(79, 70, 229, 0.62);
  border-radius: 12px;
  background: rgba(79, 70, 229, 0.06);
  pointer-events: none;
}

.annotation-zone-draft.is-too-small {
  border-color: rgba(217, 119, 6, 0.58);
  background: rgba(217, 119, 6, 0.06);
}

.annotation-node.selected {
  border-color: var(--selected);
  box-shadow: 0 0 0 3px rgba(106, 90, 249, 0.12);
}

.annotation-node.is-dragging,
.annotation-node.is-resizing {
  z-index: 12;
}

.annotation-node.is-editing {
  cursor: text;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
}

.annotation-resize-handle {
  position: absolute;
  top: 4px;
  right: -4px;
  bottom: 4px;
  width: 9px;
  border-radius: 999px;
  cursor: ew-resize;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.annotation-zone-resize-handle {
  position: absolute;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.12s ease, background 0.12s ease;
}

.annotation-zone-resize-e,
.annotation-zone-resize-w {
  top: 10px;
  bottom: 10px;
  width: 10px;
  cursor: ew-resize;
}

.annotation-zone-resize-e {
  right: -5px;
}

.annotation-zone-resize-w {
  left: -5px;
}

.annotation-zone-resize-n,
.annotation-zone-resize-s {
  left: 10px;
  right: 10px;
  height: 10px;
  cursor: ns-resize;
}

.annotation-zone-resize-n {
  top: -5px;
}

.annotation-zone-resize-s {
  bottom: -5px;
}

.annotation-zone-resize-se {
  right: -6px;
  bottom: -6px;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
}

.annotation-resize-handle::after {
  content: "";
  position: absolute;
  top: 2px;
  right: 3px;
  bottom: 2px;
  width: 2px;
  border-radius: 999px;
  background: rgba(106, 90, 249, 0.45);
}

.annotation-zone-resize-e::after,
.annotation-zone-resize-w::after,
.annotation-zone-resize-n::after,
.annotation-zone-resize-s::after,
.annotation-zone-resize-se::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(106, 90, 249, 0.45);
}

.annotation-zone-resize-e::after,
.annotation-zone-resize-w::after {
  top: 4px;
  bottom: 4px;
  width: 2px;
}

.annotation-zone-resize-e::after {
  right: 4px;
}

.annotation-zone-resize-w::after {
  left: 4px;
}

.annotation-zone-resize-n::after,
.annotation-zone-resize-s::after {
  left: 4px;
  right: 4px;
  height: 2px;
}

.annotation-zone-resize-n::after {
  top: 4px;
}

.annotation-zone-resize-s::after {
  bottom: 4px;
}

.annotation-zone-resize-se::after {
  top: 4px;
  right: 4px;
  width: 6px;
  height: 6px;
  border-right: 2px solid rgba(106, 90, 249, 0.55);
  border-bottom: 2px solid rgba(106, 90, 249, 0.55);
  border-radius: 0;
  background: transparent;
}

.annotation-node:hover .annotation-resize-handle,
.annotation-node.selected .annotation-resize-handle,
.annotation-node.is-resizing .annotation-resize-handle,
.annotation-zone:hover .annotation-zone-resize-handle,
.annotation-zone.selected .annotation-zone-resize-handle,
.annotation-zone.is-resizing .annotation-zone-resize-handle {
  opacity: 1;
}

.annotation-node.is-editing .annotation-resize-handle,
.annotation-node.is-editing .annotation-zone-resize-handle {
  display: none;
}

.right-rail {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

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

.inspector-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.inspector-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.inspector-empty-state {
  margin: auto 0;
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  color: var(--muted);
  padding: 24px 12px 40px;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border: 2px solid #7b819f;
  border-radius: 50%;
  color: #59607d;
  font-size: 1.45rem;
}

.inspector-selection {
  display: grid;
  gap: 14px;
}

.inspector-node-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.inspector-node-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #fff4c8;
  border: 1px solid #f0c864;
  color: #8d6500;
}

.inspector-node-copy {
  display: grid;
  gap: 3px;
}

.inspector-node-copy strong {
  font-size: 0.98rem;
}

.inspector-node-copy span {
  color: var(--muted);
}

.inspector-node-tag {
  background: #fff3cb;
  color: #a27100;
  font-size: 0.74rem;
  min-height: 26px;
}

.inspector-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  margin: 2px -16px 2px;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

.inspector-tab {
  padding: 12px 12px 11px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.inspector-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.inspector-tab:disabled,
.inspector-tab.is-placeholder {
  cursor: default;
}

.inspector-tab:disabled:not(.active),
.inspector-tab.is-placeholder:not(.active) {
  opacity: 0.72;
}

.inspector-view {
  display: grid;
  gap: 12px;
}

.block-apply-toolbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 0 10px;
  margin: -2px 0 2px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 72%, rgba(255, 255, 255, 0));
}

.block-apply-toolbar .solid-btn {
  min-width: 104px;
}

.ports-editor-section {
  display: grid;
  gap: 10px;
}

.ports-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.ports-editor-actions {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

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

.ports-editor-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 12px 13px;
  background: #fafbff;
  color: var(--muted);
}

.port-edit-row {
  display: grid;
  gap: 7px;
}

.port-edit-row.has-port-order {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.port-edit-row.has-port-action {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.port-edit-meta {
  display: grid;
  gap: 2px;
  grid-column: 1 / -1;
}

.port-edit-meta strong {
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
}

.port-edit-meta small {
  color: var(--muted);
  font-size: 0.78rem;
}

.port-name-input {
  text-transform: none;
}

.port-override-toggle {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid rgba(154, 52, 18, 0.18);
  border-radius: 12px;
  background: rgba(255, 247, 245, 0.72);
  color: #5f2a18;
  font-size: 0.8rem;
  line-height: 1.25;
}

.port-override-toggle input {
  width: 15px;
  height: 15px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: #9a3412;
}

.port-order-actions {
  display: inline-flex;
  gap: 5px;
}

.port-order-btn {
  width: 34px;
  min-height: 36px;
  padding: 0;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 800;
}

.port-delete-btn {
  color: #b42318;
  border-color: #ffd1d1;
  background: #fff7f7;
}

.port-delete-btn:disabled {
  color: var(--muted);
  border-color: var(--line);
  background: #f8f9fc;
}

.port-instruction-btn {
  min-height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 0.8rem;
}

.add-port-btn {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 0.83rem;
}

.field-group {
  display: grid;
  gap: 7px;
  margin-bottom: 14px;
}

.field-group label {
  text-transform: none;
}

.field-hint {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.field-hint.is-error {
  color: #b42318;
}

.field-group.is-disabled {
  opacity: 0.55;
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 650;
}

.checkbox-field input {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: #7f1d1d;
}

.field-grid {
  align-items: end;
}

.field-grid > * {
  flex: 1;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  outline: none;
}

input[readonly],
textarea[readonly] {
  background: #f7f8fc;
}

textarea {
  min-height: 142px;
  resize: vertical;
  line-height: 1.55;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(106, 90, 249, 0.6);
  box-shadow: 0 0 0 4px rgba(106, 90, 249, 0.08);
}

.select-menu {
  position: relative;
  width: 100%;
}

.select-menu-button {
  width: 100%;
  min-height: 42px;
  padding: 11px 34px 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.select-menu-button::after {
  content: "⌄";
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-52%);
  color: var(--muted);
  pointer-events: none;
}

.select-menu-button:focus {
  border-color: rgba(106, 90, 249, 0.6);
  box-shadow: 0 0 0 4px rgba(106, 90, 249, 0.08);
  outline: none;
}

.select-menu-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.select-menu.is-open .select-menu-options {
  display: grid;
}

.select-menu-options button {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.select-menu-options button:hover,
.select-menu-options button.is-selected {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.select-menu-options button:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.inspector-copy {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f9ff;
  color: var(--muted);
  line-height: 1.45;
}

.inspector-copy pre {
  margin: 8px 0 0;
  color: var(--ink);
  font: 12px/1.45 "JetBrains Mono", "Fira Code", monospace;
  white-space: pre-wrap;
}

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

.file-browse-btn {
  min-height: 42px;
  padding-inline: 12px;
}

.log-output {
  margin: 0;
  min-height: 240px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f9fe;
  color: #24283d;
  font-family: var(--mono);
  font-size: 0.79rem;
  line-height: 1.6;
  white-space: pre-wrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(22, 28, 45, 0.28);
  backdrop-filter: blur(5px);
  z-index: 200;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-panel {
  width: min(920px, 100%);
  max-height: calc(100vh - 40px);
  overflow: hidden;
  border: 1px solid rgba(120, 126, 167, 0.18);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
}

.logs-modal,
.run-snapshot-modal,
.block-library-modal,
.projects-modal,
.codex-policy-modal,
.node-outputs-modal,
.composite-modal {
  display: grid;
  grid-template-rows: auto 1fr;
}

.codex-policy-modal {
  width: min(760px, 100%);
}

.codex-policy-body {
  display: grid;
  min-height: 0;
  gap: 14px;
  overflow: auto;
  padding: 18px;
}

.codex-policy-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfcff;
  cursor: pointer;
}

.codex-policy-toggle input {
  width: auto;
  margin-top: 3px;
}

.codex-policy-toggle strong,
.codex-policy-toggle small {
  display: block;
}

.codex-policy-toggle small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.codex-policy-log {
  min-height: 48px;
  max-height: 110px;
  overflow: auto;
}

.composite-modal {
  width: min(1120px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-header > div:first-child {
  min-width: 0;
}

.modal-header h2 {
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.modal-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.logs-modal .log-output {
  min-height: 0;
  height: min(70vh, 640px);
  overflow: auto;
  margin: 18px;
}

.run-snapshot-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

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

.snapshot-summary-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #f8f9ff;
}

.snapshot-summary-card span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.78rem;
  color: var(--muted);
}

.snapshot-summary-card strong {
  color: var(--ink);
  font-weight: 700;
  word-break: break-word;
}

.snapshot-log-output {
  min-height: min(42vh, 360px);
  max-height: min(52vh, 480px);
  overflow: auto;
}

.composite-modal-body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: min(70vh, 620px);
  padding: 18px;
}

.composite-modal-summary {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #f8f9ff;
  color: var(--muted-strong);
  font-size: 0.88rem;
}

.composite-editor-scroll {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    radial-gradient(circle at 1px 1px, rgba(106, 90, 249, 0.18) 1px, transparent 0) 0 0 / 10px 10px,
    #ffffff;
}

.composite-editor-canvas {
  position: relative;
  min-width: 900px;
  min-height: 520px;
}

.composite-edge-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.composite-boundary-edge {
  stroke: #6a5af9;
  stroke-dasharray: 5 4;
}

.composite-boundary-node {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 2px;
  width: 172px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid rgba(106, 90, 249, 0.25);
  border-radius: 12px;
  background: rgba(248, 249, 255, 0.94);
  box-shadow: 0 8px 18px rgba(22, 28, 45, 0.08);
  cursor: move;
  user-select: none;
}

.composite-boundary-node.is-dragging {
  z-index: 14;
  box-shadow: 0 16px 32px rgba(22, 28, 45, 0.16);
}

.composite-boundary-node.is-connection-highlight-focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18), 0 12px 26px rgba(79, 70, 229, 0.10);
}

.composite-boundary-node.is-connection-highlight-neighbor {
  border-color: rgba(79, 70, 229, 0.48);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.10);
}

.composite-boundary-node.is-dimmed-by-connection-highlight {
  filter: grayscale(0.35);
  opacity: 0.26;
}

.composite-boundary-node.selected,
.active-composite-boundary-node.selected {
  z-index: 12;
  border: 2px solid var(--selected);
  box-shadow: 0 0 0 3px rgba(106, 90, 249, 0.20), 0 0 0 1px rgba(106, 90, 249, 0.34);
}

.composite-boundary-output {
  justify-items: end;
  text-align: right;
}

.composite-boundary-direction,
.composite-boundary-wire {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.1;
}

.composite-boundary-node strong {
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.composite-boundary-node .node-port {
  top: calc(50% - 7px);
}

.composite-boundary-input .node-port {
  right: -7px;
}

.composite-boundary-output .node-port {
  left: -7px;
}

.composite-inner-node {
  z-index: 2;
}

.block-library-modal {
  width: min(980px, 100%);
}

.block-library-body {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.block-library-toolbar {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f9ff;
  color: var(--muted-strong);
  line-height: 1.45;
}

.block-library-toolbar p {
  margin: 0;
}

.block-library-toolbar code {
  color: var(--accent-strong);
  font-weight: 800;
}

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

.block-library-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.block-library-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.block-library-card h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 1rem;
}

.block-library-meta,
.block-library-preview,
.block-library-empty {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.block-library-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.block-library-meta span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8f9ff;
}

.block-library-empty {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: #fbfcff;
  text-align: center;
}

.projects-body {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.projects-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.projects-help code {
  color: var(--accent-strong);
  font-weight: 700;
}

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

.project-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
}

.project-card.is-current {
  border-color: rgba(106, 90, 249, 0.4);
  box-shadow: 0 0 0 3px rgba(106, 90, 249, 0.08);
}

.project-card h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 1rem;
}

.project-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: stretch;
}

.project-meta,
.project-session,
.projects-empty {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.project-meta span {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8f9ff;
}

.block-config-modal {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1080px, 100%);
}

.block-config-modal-body {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  min-height: 0;
  padding: 18px;
  overflow: auto;
  align-items: start;
}

.block-config-modal-body > .ports-editor-section {
  min-width: 0;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.block-config-modal-body > .ports-editor-section:nth-child(1),
.block-config-modal-body > .ports-editor-section:nth-child(2) {
  grid-column: 1;
}

.block-config-modal-body > .ports-editor-section:nth-child(3),
.block-config-modal-body > .ports-editor-section:nth-child(4) {
  grid-column: 2;
}

.block-config-modal .field-group {
  min-width: 0;
  margin-bottom: 12px;
}

.block-config-modal .field-group input:not([type="checkbox"]),
.block-config-modal .field-group textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.block-config-modal .field-group textarea {
  min-height: 116px;
  max-height: min(42vh, 420px);
  resize: vertical;
  font-family: var(--mono);
  line-height: 1.5;
}

.block-config-modal .checkbox-line {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.35;
}

.block-config-modal .checkbox-line input {
  margin-top: 2px;
}

.block-config-modal .inspector-actions {
  justify-content: flex-end;
}

.block-config-modal .port-edit-row {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
}

.block-config-modal .port-edit-meta small {
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.block-config-modal [data-block-modal-copy-source] {
  min-height: 160px;
}

.projects-empty {
  padding: 22px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: #fbfcff;
  text-align: center;
}

.display-output-modal,
.node-outputs-modal {
  width: min(1080px, 100%);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.display-output-modal-body,
.node-outputs-modal-body {
  display: grid;
  gap: 14px;
  min-height: 0;
  padding: 18px;
  overflow: auto;
}

.display-output-summary,
.node-outputs-summary {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8f9ff;
  color: var(--muted-strong);
}

.display-output-list,
.node-outputs-list {
  display: grid;
  gap: 12px;
}

.display-output-card,
.node-output-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #ffffff;
  padding: 14px;
}

.display-output-card-header,
.node-output-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-strong);
  font-size: 0.84rem;
  font-weight: 650;
}

.display-output-content,
.node-output-content {
  margin: 0;
  max-height: min(58vh, 520px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f9fe;
  padding: 13px;
  color: #24283d;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.node-output-card-header strong,
.node-output-card-header span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 820px) {
  .block-config-modal-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .block-config-modal-body > .ports-editor-section:nth-child(n) {
    grid-column: 1;
  }
}

.node-output-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.78rem;
}

.node-output-card-meta a {
  color: var(--accent-strong);
  font-weight: 700;
  text-decoration: none;
}

.node-output-card-meta a:hover {
  text-decoration: underline;
}

.is-busy .launch-btn {
  opacity: 0.92;
}

@media (max-width: 1440px) {
  :root {
    --left-rail-open: 220px;
  }

  .workspace {
    grid-template-columns: var(--left-rail-collapsed) minmax(0, 1fr) 340px;
  }

  .canvas-node {
    width: 210px;
  }
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .left-rail,
  .right-rail {
    border: none;
  }

  .left-rail {
    position: static;
    z-index: auto;
    overflow: auto;
  }

  .palette-panel {
    position: static;
    width: auto;
    max-width: none;
    height: auto;
    overflow: visible;
    border-right: none;
    transform: none;
    box-shadow: none;
  }

  .palette-panel > * {
    opacity: 1;
    pointer-events: auto;
  }

  .palette-collapsed-icons {
    display: none;
  }

  .right-rail {
    grid-template-rows: auto auto;
    border-top: 1px solid var(--line);
  }

  .canvas-wrap {
    order: -1;
  }
}

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

  .topbar,
  .topbar-actions,
  .topbar-meta,
  .canvas-topline,
  .field-grid {
    flex-wrap: wrap;
  }

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

  .home-view {
    padding: 18px;
  }

  .home-hero,
  .home-projects-panel {
    padding: 18px;
    border-radius: 20px;
  }

  .home-projects-list .project-card {
    grid-template-columns: 1fr;
  }

  .home-projects-list .project-actions {
    flex-direction: row;
  }

  .workspace {
    min-height: auto;
  }

  .canvas-scroll {
    height: 640px;
    min-height: 640px;
  }

  .canvas-grid {
    min-height: 900px;
  }

  .canvas-overlay {
    left: 12px;
    bottom: 12px;
  }

  .demo-node-source {
    left: 20px;
    top: 160px;
  }

  .demo-node-process {
    left: 20px;
    top: 330px;
  }

  .demo-node-output {
    left: 20px;
    top: 510px;
  }
}
